/* The Success Codex website: tokens, fonts, the page frame, header, footer and buttons (CR-105).
   Colours are the app's (apps/customer-app/lib/design/tokens.dart) and the homepage spec's
   (docs/sketches/pass-v/design-spec.md). Sizes that should follow the reader's text size use --u, which is 1px at the
   browser's default size and grows with it (KTD10); hairlines and gaps stay in px. */

@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/poppins-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: italic; font-display: swap; src: url("/fonts/poppins-600-italic.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/poppins-700.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/lora-400.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/lora-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/lora-600.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/lora-700.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/eb-garamond-400.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/eb-garamond-500.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/eb-garamond-400-italic.woff2") format("woff2"); }

:root {
  --u: 0.0625rem;
  --ink: #272727;
  --cream: #FDFCF8;
  --warm-white: #F2EFE6;
  --near-black: #111111;
  --dark: #161616;
  --dark-card: #1C1C1C;
  --white: #FFFFFF;
  --gold: #E1B30F;
  --gold-deep: #8A6B10;
  --gold-icon: #C9A227;
  --gold-hover: #B98A2E;
  --gold-bright: #F0C51C;
  --hairline: #F0E9D8;
  --hairline-soft: #F5EAC4;
  --hairline-strong: #EAD9A0;
  --rule: #E0C384;
  --soft-rule: #DACFA9;
  --purple: #2A2350;
  --lilac: #E6E0F0;
  --lilac-soft: #D9D2E6;
  --grey: #6B6B6B;
  --grey-body: #5A5A5A;
  --grey-muted: #8A8A8A;
  --grey-light: #9A9A9A;
  --grey-on-dark: #CFCFCF;
  --side: clamp(18px, 3vw, 40px);
  --font-ui: "Poppins", system-ui, sans-serif;
  --font-display: "Lora", Georgia, serif;
  --font-voice: "EB Garamond", Georgia, serif;
}

/* The phone's own text size (KTD10): iOS Safari sizes the page from its Dynamic Type setting, desktop Safari keeps
   100%. Chrome on Android reads the text-scale meta tag in the page head. */
@supports (font: -apple-system-body) and (-webkit-touch-callout: default) {
  :root { font: -apple-system-body; }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; background: var(--cream); }

body {
  font-family: var(--font-ui);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

img, svg, video { display: block; max-width: 100%; }

a { color: var(--gold-deep); }
a:hover { color: var(--gold-hover); }

:focus-visible { outline: 2px solid var(--gold-icon); outline-offset: 3px; border-radius: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: var(--cream);
  font-size: calc(13 * var(--u)); font-weight: 600; text-decoration: none; border-radius: 3px;
}
.skip-link:focus { top: 12px; color: var(--cream); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------------------------------------------------------
   Buttons (pass V spec, section 0): gold with near-black lettering, 3px corners, letter-spaced capitals. */
.button {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--font-ui); font-weight: 600; letter-spacing: 0.16em; text-decoration: none;
  border-radius: 3px; background: var(--gold); color: var(--near-black);
}
.button:hover { background: var(--gold-bright); color: var(--near-black); }

/* ---------------------------------------------------------------------------------------------------------------
   The brand: the mark and THE SUCCESS CODEX. In the header the wordmark sits in a one-line box that drops it out of
   view when room runs short, leaving the mark (pass V spec, section 2). */
/* The header's brand gives up its room before the links do (HomeHeader: the wordmark goes first, the logo stays). */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1000 auto; text-decoration: none; }
.site-header .brand { min-width: calc(24 * var(--u)); }
.brand .mark { width: calc(24 * var(--u)); height: calc(24 * var(--u)); flex: none; }
.brand__fit {
  display: flex; flex-wrap: wrap; row-gap: 3em; overflow: hidden; min-width: 0;
  height: calc(20 * var(--u)); line-height: calc(20 * var(--u));
}
.brand__spacer { width: 0; }
.brand__word {
  font-size: calc(11 * var(--u)); font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase;
  white-space: nowrap; color: var(--ink);
}

/* ---------------------------------------------------------------------------------------------------------------
   Header (pass V spec, section 2). */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--white); border-bottom: 1px solid var(--hairline); }
.site-header__inner {
  max-width: 1360px; margin: 0 auto; min-height: 62px; padding: 0 var(--side);
  display: flex; align-items: center; justify-content: space-between; gap: clamp(16px, 2.2vw, 32px);
}
.site-nav { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: clamp(14px, 2vw, 28px); }
/* The text links drop out of view from the left when they don't fit (LOG IN stays longest). */
.site-nav__fit {
  display: flex; flex-direction: row-reverse; flex-wrap: wrap; column-gap: clamp(14px, 1.9vw, 28px); row-gap: 3em;
  overflow: hidden; min-width: 0; height: calc(22 * var(--u)); line-height: calc(22 * var(--u));
}
/* A zero-width first item, so even LOG IN drops out whole (never clipped) when there is no room for it. */
.site-nav__spacer { width: 0; margin-left: calc(-1 * clamp(14px, 1.9vw, 28px)); }
.site-nav__link {
  font-size: calc(11 * var(--u)); font-weight: 600; letter-spacing: 0.14em; white-space: nowrap; text-decoration: none;
  color: var(--grey);
}
.site-nav__link:hover { color: var(--ink); }
.site-nav__link--ink, .site-nav__link--ink:hover { color: var(--ink); }
.site-nav__link--gold { color: var(--gold-deep); }
.site-nav__link--gold:hover { color: var(--gold-hover); }
/* Below 600 px the app's header sets its links smaller and closer (HomeHeader.compactBelow): 9.5 px, 0.04em, and
   10 px gaps, so GET CERTIFIED fits beside LOG IN on a phone, as in the app. */
@media (max-width: 599.98px) {
  .site-header__inner { gap: 10px; }
  .site-nav { gap: 10px; }
  .site-nav__fit { column-gap: 10px; }
  .site-nav__spacer { margin-left: -10px; }
  .site-nav__link { font-size: calc(9.5 * var(--u)); letter-spacing: 0.04em; }
}
.site-nav__link[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.button--chart {
  flex: none; padding: 11px 16px; font-size: calc(10.5 * var(--u)); white-space: nowrap; color: #1A1A1A;
}
.button--chart:hover { background: var(--gold-icon); color: #1A1A1A; }

/* ---------------------------------------------------------------------------------------------------------------
   Footer (pass V spec, section 13). */
.site-footer { background: var(--dark); color: var(--cream); }
.site-footer__inner { max-width: 1360px; margin: 0 auto; padding: 52px var(--side) clamp(84px, 8vw, 96px); }
.site-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 36px; }
.site-footer__brand { display: flex; flex-direction: column; min-width: min(100%, 250px); }
.brand--dark { gap: 9px; }
.brand--dark .mark { width: calc(20 * var(--u)); height: calc(20 * var(--u)); }
.brand--dark .brand__word { font-size: calc(10 * var(--u)); color: var(--cream); }
/* The footer's brand wraps at large text rather than push the page sideways (its header twin drops out instead). */
.site-footer .brand--dark { flex-wrap: wrap; min-width: 0; }
.site-footer .brand--dark .brand__word { white-space: normal; min-width: 0; }

.site-footer__tagline {
  margin: 16px 0 0; max-width: 250px; font-family: var(--font-voice); font-style: italic;
  font-size: calc(16.5 * var(--u)); line-height: 1.55; color: #B9AD86;
}
.site-footer__social { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.social {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid #3A3528; border-radius: 3px;
  font-size: calc(9.5 * var(--u)); font-weight: 600; letter-spacing: 0.16em; color: var(--cream); text-decoration: none;
}
.social:hover { border-color: var(--gold); color: var(--gold); }
.social svg { flex: none; }
.button--certified {
  margin-top: 14px; align-self: flex-start; min-height: 44px; padding: 0 20px;
  font-size: calc(10 * var(--u)); color: #1A1A1A;
}
.button--certified:hover { background: var(--gold-icon); color: #1A1A1A; }
.site-footer__col { display: flex; flex-direction: column; gap: 12px; }
.site-footer__col h2 {
  margin: 0 0 3px; font-size: calc(9.5 * var(--u)); font-weight: 600; letter-spacing: 0.2em; color: var(--gold);
}
.site-footer__col a { font-size: calc(12.5 * var(--u)); font-weight: 500; color: #B9B3A1; text-decoration: none; }
.site-footer__col a:hover { color: var(--gold); }
.site-footer__bar {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(225, 179, 15, 0.16);
  display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; align-items: center;
}
.site-footer__copyright { font-size: calc(11 * var(--u)); color: #8A8578; }
.site-footer__address { font-size: calc(11 * var(--u)); font-family: ui-monospace, Menlo, monospace; color: #6F6A5E; }

/* ---------------------------------------------------------------------------------------------------------------
   A plain page's frame (Not found, and the pages that only need a centred column). */
.page { max-width: 760px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--side); }
.page h1 { font-family: var(--font-display); font-weight: 700; font-size: calc(34 * var(--u)); line-height: 1.15; margin: 0 0 16px; }
.page p { font-size: calc(15 * var(--u)); color: var(--grey-body); }
.page .voice { font-family: var(--font-voice); font-style: italic; font-size: calc(18 * var(--u)); color: var(--grey-body); }
.button--page { padding: 12px 22px; font-size: calc(11 * var(--u)); }

/* ---------------------------------------------------------------------------------------------------------------
   Shared page pieces, as the app has them.
   - Phones (narrower than 760px) draw every word 10% larger than the design, as the app does (PhoneTextScaler).
   - Layout switches between phone and computer at 900px (the app's Breakpoints.wide).
   - .page-body: the app's PageBody, a 1200px column with 40px sides (20px under 900px), 40px above and below (26px).
   - .back-pill: "← MY CODEX" / "← LEGAL", shown only under 900px, as in the app (lib/widgets/back_pill.dart).
   - .eyebrow: the small letter-spaced capitals over a title. */
@media (max-width: 759.98px) {
  :root { --u: 0.06875rem; }
}
.page-body { max-width: 1200px; margin: 0 auto; padding: 40px 40px; }
@media (max-width: 899.98px) {
  .page-body { padding: 26px 20px; }
}
.back-pill {
  display: none; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--hairline-strong);
  border-radius: 999px; background: var(--cream); color: var(--gold-deep); text-decoration: none;
  font-size: calc(10 * var(--u)); font-weight: 600; letter-spacing: 0.14em; width: fit-content;
}
.back-pill:hover { color: var(--gold-deep); background: #FBF8EE; }
@media (max-width: 899.98px) {
  .back-pill { display: inline-flex; }
}
.eyebrow {
  margin: 0; font-size: calc(11 * var(--u)); font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--gold-deep);
}
