@import url("https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Inter:ital,wght@0,400..700;1,400..700&display=swap");

/* Static sitelink pages (sign-in, create-account, how-it-works, contact).
   These are plain HTML with no React, so they cannot render Chrome.tsx.
   The header, signpost and footer below mirror the app's shared chrome by
   hand: same markup and class names, same values as src/session-tokens.css
   and the reference-header / reference-footer rules in opening-flow.css.
   Keep the two in step when the app chrome changes; src/chrome-mirror.test.ts
   fails if the shared colour, font and header-height values drift. */

:root {
  --paper: #eae9e6;
  --surface: #e3e2df;
  --ink: #141414;
  --muted: #333333;
  --navy: #15203a;
  --on-dark: #f1e9da;
  --on-dark-muted: #c8c1b4;
  --accent: #7b2d2d;
  --accent-dark: #632222;
  --brass: #b08d57;
  --line: #d7d5d0;
  --line-on-dark: rgba(241, 233, 218, 0.14);
  --font-display: "DM Serif Display", "Iowan Old Style", Georgia, serif;
  --font-interface: Inter, "Avenir Next", Avenir, system-ui, sans-serif;
  --header-height: 56px;
  --content-max: 1200px;
  --page-pad: 36px;
  --gutter: calc(var(--page-pad) + max(0px, (100% - var(--content-max)) / 2));
}

@media (max-width: 900px) {
  :root {
    --page-pad: 24px;
  }
}

@media (max-width: 600px) {
  :root {
    --page-pad: 20px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-interface);
  -webkit-text-size-adjust: 100%;
}

a:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

/* Header: mirrors AppHeader (.reference-header.app-chrome-header). */
.reference-header {
  position: sticky;
  z-index: 100;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--header-height);
  padding-inline: var(--gutter);
  border-bottom: 1px solid var(--line-on-dark);
  background: var(--navy);
  box-shadow: 0 10px 28px rgba(8, 14, 27, 0.13);
}

.app-chrome-home {
  display: inline-flex;
  text-decoration: none;
}

.reference-brand {
  color: var(--on-dark);
}

.reference-brand strong {
  display: block;
  font-family: var(--font-interface);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* Page body: content starts on the same gutter as the header wordmark. */
main {
  flex: 1 0 auto;
  width: 100%;
  padding: clamp(48px, 8vw, 96px) var(--gutter);
}

main > * {
  max-width: 640px;
}

h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(2.375rem, 2rem + 1.6vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.98;
}

main p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: clamp(1rem, 0.97rem + 0.12vw, 1.125rem);
  line-height: 1.58;
}

/* Mirrors .reference-primary-button. */
.cta {
  display: inline-flex;
  align-items: center;
  min-height: 45px;
  padding: 0 17px;
  border: 1px solid #672229;
  border-radius: 2px;
  color: #f5f0e6;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(103, 34, 41, 0.17);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 180ms ease;
}

.cta:hover {
  background: var(--accent-dark);
}

main nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

main nav a {
  padding-block: 4px;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

main nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Signpost and footer: mirror AppFooter (full variant). */
.reference-signpost {
  padding: 20px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-size: 0.875rem;
}

.reference-signpost p {
  max-width: 100%;
  margin: 0;
  line-height: 1.6;
  text-wrap: pretty;
}

.reference-signpost a,
.reference-footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.reference-signpost a {
  color: var(--accent);
}

.reference-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  min-height: 50px;
  padding: 12px var(--gutter);
  border-top: 1px solid var(--line-on-dark);
  color: var(--on-dark-muted);
  background: var(--navy);
  font-size: 0.75rem;
}

.reference-footer p {
  flex: 1 1 16rem;
  min-width: min(100%, 16rem);
  margin: 0;
}

.reference-footer > p:first-child {
  flex-grow: 2;
}

.reference-footer a {
  color: var(--on-dark-muted);
}

.reference-footer a:hover {
  color: var(--on-dark);
}

.reference-signpost a:hover {
  color: var(--accent-dark);
}

@media (max-width: 600px) {
  .reference-header {
    gap: 9px;
  }

  .reference-signpost p {
    font-size: 0.8125rem;
    line-height: 1.5;
  }

  .reference-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .reference-footer p {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta {
    transition: none;
  }
}
