/* OGOFX design system, copied from the landing page stylesheet (ogofx.com/assets/css/styles.css):
   the tokens and base (its lines 5-652) and the brand mark (766-788). Kept identical so the portal
   and the landing page cannot drift apart; portal-only rules live in portal.css. */

/* =====================================================================
   Design tokens
   ===================================================================== */

/* =====================================================================
   OGOFX design tokens — v3 "Emerald & Champagne"
   Evergreen depth, bone-paper light, champagne for action.
   There is NO blue anywhere in this system: not in links, focus rings,
   charts, gradients, shadows or meta colours.
   Every section stylesheet reads from these. Do not hard-code hex
   values in section CSS; add a token here if one is missing.

   Breakpoints (mobile-first, use min-width media queries):
     --bp-sm   480px   large phones
     --bp-md   768px   tablets portrait
     --bp-lg  1024px   tablets landscape / small laptops (desktop menu)
     --bp-xl  1280px   desktop
     --bp-2xl 1440px   wide desktop (container stops growing at 1240px)
   CSS custom properties can't be used inside @media, so write the px
   values literally:  @media (min-width: 768px) { ... }
   ===================================================================== */

:root {
  /* ---------- Palette (named) ---------- */
  /* Dark family — evergreen, never a tinted black */
  --c-deep:       #0A1A15;   /* footer, utility risk bar, deepest dark     */
  --c-evergreen:  #0E2620;   /* dark section base, header                  */
  --c-forest:     #15342C;   /* raised panel on dark                       */
  --c-forest-2:   #1C4137;   /* hover / second raise on dark               */
  --c-moss:       #2F5648;   /* lines on dark that must be visible         */

  /* Light family — bone paper, warm but never cream-yellow */
  --c-ivory:      #FBF9F4;   /* raised panels on bone, menu panels         */
  --c-bone:       #F5F2EA;   /* page background, light sections            */
  --c-linen:      #EDE7DA;   /* alt light section                          */
  --c-sand:       #E4DDCD;   /* inset wells on linen, table stripes        */
  --c-hairline:   #DAD2C1;   /* default line on light                      */
  --c-rule:       #B9AE96;   /* strong line on light / input borders       */

  /* Text */
  --c-ink:        #0F1F1A;   /* primary text on light   (15.3:1 on bone)   */
  --c-ink-2:      #3A4A44;   /* secondary text on light (8.4:1)            */
  --c-ink-3:      #56645E;   /* muted text on light     (5.6:1, 4.6 on sand) */
  --c-pearl:      #F3EFE5;   /* primary text on dark    (13.9:1 on evergreen) */
  --c-sage:       #B9C4BC;   /* secondary text on dark  (8.9:1)            */
  --c-lichen:     #93A69D;   /* muted text on dark      (6.2:1; 5.3 on forest) */

  /* Brand */
  --c-champagne:      #C9A961; /* THE action colour: primary button fill (ink text 7.6:1), links + focus on dark (7.1:1) */
  --c-champagne-300:  #D9BF84; /* hover on primary, buy price on dark (8.9:1)           */
  --c-champagne-050:  #F3EAD5; /* recommended-plan tint, selected row on light          */
  --c-bronze:         #755A1A; /* champagne when it must be TEXT on light: links, buy price (5.8:1 on bone) */
  --c-bronze-700:     #5E4712; /* link hover on light                                    */
  --c-jade:           #2E8A68; /* decorative jade (chart strokes on light, icon detail)  — not for text */

  /* Market semantics — light surfaces */
  --c-sell:  #B23048;   /* bid / sell, garnet-rose (5.5:1 on bone)   */
  --c-buy:   #755A1A;   /* ask / buy, bronze       (5.8:1 on bone)   */
  --c-up:    #0A6B4B;   /* positive change, jade   (5.8:1 on bone)   */
  --c-down:  #B23048;   /* negative change                           */
  --c-sell-tint: #F6E3E3;
  --c-buy-tint:  #F3EAD5;
  /* Market semantics — dark surfaces */
  --c-sell-on-dark: #F2949A;  /* 7.2:1 on evergreen */
  --c-buy-on-dark:  #D9BF84;  /* 8.9:1 on evergreen */
  --c-up-on-dark:   #66D3A6;  /* 8.7:1 on evergreen */
  --c-down-on-dark: #F2949A;

  /* Placeholder (must be replaced before launch) */
  --c-todo-bg:   #FFF1B8;
  --c-todo-line: #B58900;
  --c-todo-ink:  #3D2E00;

  /* ---------- Semantic surface roles ---------- */
  --surface-page:        var(--c-bone);
  --surface-alt:         var(--c-linen);
  --surface-raised:      var(--c-ivory);
  --surface-inset:       var(--c-sand);
  --surface-dark:        var(--c-evergreen);
  --surface-dark-raised: var(--c-forest);
  --surface-deepest:     var(--c-deep);

  /* ---------- Type families ---------- */
  /* One family, many weights: Hanken Grotesk carries hero, headings, UI,
     body and numbers (tabular figures for every number). Headings are
     set heavy with tight tracking; body is 400. --font-display is kept
     as an alias so existing section CSS keeps working. */
  --font-sans:    "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: var(--font-sans);

  /* ---------- Type scale (fluid; 360px -> 1440px) ---------- */
  --fs-2xs:  0.75rem;                                           /* 12  legal floor             */
  --fs-xs:   0.8125rem;                                         /* 13  captions, table meta    */
  --fs-sm:   0.9375rem;                                         /* 15  UI, buttons, nav        */
  --fs-base: clamp(1rem, 0.97rem + 0.14vw, 1.0625rem);          /* 16 -> 17 body               */
  --fs-md:   clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);           /* 17 -> 20 lead               */
  --fs-lg:   clamp(1.1875rem, 1.08rem + 0.45vw, 1.4375rem);     /* 19 -> 23 h4 / card title    */
  --fs-xl:   clamp(1.375rem, 1.2rem + 0.8vw, 1.875rem);         /* 22 -> 30 h3                 */
  --fs-2xl:  clamp(1.875rem, 1.4rem + 2.1vw, 3.25rem);          /* 30 -> 52 h2 section title   */
  --fs-3xl:  clamp(2.25rem, 1.6rem + 3vw, 4rem);                /* 36 -> 64 h1                 */
  --fs-4xl:  clamp(2.5rem, 1.4rem + 4.4vw, 4.75rem);            /* 40 -> 76 hero display       */

  --fw-display: 760;  /* hero */
  --fw-heading: 680;  /* h1-h2 */
  --fw-title:   620;  /* h3-h4, card titles */

  --lh-tight: 1;      /* display */
  --lh-snug:  1.12;   /* headings */
  --lh-ui:    1.35;   /* buttons, labels */
  --lh-body:  1.6;    /* paragraphs */

  --tr-display: -0.042em;
  --tr-heading: -0.03em;
  --tr-title:   -0.016em;
  --tr-ui:      0.005em;
  --tr-caps:    0.08em;   /* ONLY for the OGOFX wordmark and 3-letter currency codes */

  --measure:      66ch;   /* body copy */
  --measure-lead: 54ch;
  --measure-head: 20ch;

  /* ---------- Spacing (4px base) ---------- */
  --sp-1:  0.25rem;  /*   4 */
  --sp-2:  0.5rem;   /*   8 */
  --sp-3:  0.75rem;  /*  12 */
  --sp-4:  1rem;     /*  16 */
  --sp-5:  1.5rem;   /*  24 */
  --sp-6:  2rem;     /*  32 */
  --sp-7:  3rem;     /*  48 */
  --sp-8:  4rem;     /*  64 */
  --sp-9:  6rem;     /*  96 */
  --sp-10: 8rem;     /* 128 */

  --section-y:    clamp(4.5rem, 2.6rem + 8vw, 9.5rem);   /* 72 -> 152 vertical padding of a section */
  --section-y-sm: clamp(3rem, 2rem + 4vw, 5.5rem);        /* compact bands (risk, CTA) */
  --head-gap:     clamp(2rem, 1.4rem + 2.4vw, 4rem);      /* section heading -> content */

  /* ---------- Layout ---------- */
  --container:      1240px;
  --container-wide: 1400px;
  --container-text: 760px;
  --gutter:         clamp(1rem, 0.4rem + 2.7vw, 2.5rem); /* 16 -> 40 */
  --grid-gap:       clamp(1rem, 0.6rem + 1.6vw, 2rem);
  --header-h:       72px;
  --header-h-compact: 64px;

  /* ---------- Radii (hierarchy-aware) ---------- */
  --r-xs:   4px;     /* badges, todo, tiny chips      */
  --r-sm:   8px;     /* inputs, notes, menu rows      */
  --r-md:   14px;    /* cards / tiles, menu panels    */
  --r-lg:   22px;    /* major panels                  */
  --r-xl:   32px;    /* one hero-scale surface per page at most */
  --r-pill: 999px;   /* buttons, segmented control, chips */

  /* ---------- Elevation ---------- */
  /* Shadows are tinted with evergreen, layered, used sparingly. */
  --shadow-1: 0 1px 2px rgba(14, 38, 32, 0.07), 0 1px 1px rgba(14, 38, 32, 0.04);
  --shadow-2: 0 2px 4px rgba(14, 38, 32, 0.06), 0 8px 24px -6px rgba(14, 38, 32, 0.14);
  --shadow-3: 0 4px 8px rgba(14, 38, 32, 0.07), 0 24px 56px -16px rgba(14, 38, 32, 0.32);
  --shadow-dark: 0 1px 0 rgba(243, 239, 229, 0.06) inset, 0 30px 60px -20px rgba(3, 12, 10, 0.72);
  --shadow-menu: 0 1px 0 rgba(255, 252, 244, 0.6) inset, 0 2px 6px rgba(10, 26, 21, 0.10), 0 28px 60px -18px rgba(10, 26, 21, 0.45);

  /* lines */
  --line:         1px solid var(--c-hairline);
  --line-strong:  1px solid var(--c-rule);
  --line-dark:    1px solid rgba(243, 239, 229, 0.12);
  --line-dark-strong: 1px solid var(--c-moss);

  /* ---------- Motion ---------- */
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --dur-4: 600ms;
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-std:    cubic-bezier(0.2, 0, 0, 1);

  /* ---------- Z-index ---------- */
  --z-base:    1;
  --z-raised:  10;
  --z-sticky:  50;
  --z-header:  100;
  --z-drawer:  200;
  --z-skip:    1000;

  /* ---------- Focus (never blue) ---------- */
  --focus-ring: 0 0 0 2px var(--c-bone), 0 0 0 4px var(--c-bronze);          /* light */
  --focus-ring-dark: 0 0 0 2px var(--c-evergreen), 0 0 0 4px var(--c-champagne); /* dark */
}


/* =====================================================================
   Base: reset, type, layout, components, shell
   ===================================================================== */

/* =====================================================================
   OGOFX base v3 — reset, typography, layout primitives, components,
   risk components, utility risk bar, header + mega menu, mobile drawer,
   footer. Requires tokens.css first.
   Sections must NOT restyle these globally; scope overrides under the
   section root class (.s-hero .btn { ... }).
   ===================================================================== */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  overflow-x: clip;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; }
ul[role="list"], ol[role="list"], .list-reset { list-style: none; }
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
table { border-collapse: collapse; border-spacing: 0; }
summary { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- 2. Context colours ----------
   Components read these variables, so they work on light AND dark.
   A section switches context with .section--dark / .on-dark.       */
:root, .on-light {
  --fg:    var(--c-ink);
  --fg-2:  var(--c-ink-2);
  --fg-3:  var(--c-ink-3);
  --bg:    var(--c-bone);
  --bg-raised: var(--c-ivory);
  --bg-inset:  var(--c-linen);
  --line-c:    var(--c-hairline);
  --line-c-strong: var(--c-rule);
  --link:  var(--c-bronze);
  --link-hover: var(--c-bronze-700);
  --accent: var(--c-bronze);          /* accent that must read as text or a thin line */
  --accent-fill: var(--c-champagne);  /* accent used as a fill (dot, bar, button)     */
  --sell:  var(--c-sell);
  --buy:   var(--c-buy);
  --up:    var(--c-up);
  --down:  var(--c-down);
  --ring:  var(--focus-ring);
  --accent-detail: var(--c-bronze);
  --risk-accent: var(--c-bronze);
}
.section--alt { --bg: var(--c-linen); --bg-raised: var(--c-ivory); --bg-inset: var(--c-sand); }
.on-dark, .section--dark, .section--deep, .risk-bar, .site-header, .site-drawer, .site-footer {
  --fg:    var(--c-pearl);
  --fg-2:  var(--c-sage);
  --fg-3:  var(--c-lichen);
  --bg:    var(--c-evergreen);
  --bg-raised: var(--c-forest);
  --bg-inset:  var(--c-forest);
  --line-c:    rgba(243, 239, 229, 0.12);
  --line-c-strong: var(--c-moss);
  --link:  var(--c-champagne);
  --link-hover: var(--c-champagne-300);
  --accent: var(--c-champagne);
  --accent-fill: var(--c-champagne);
  --sell:  var(--c-sell-on-dark);
  --buy:   var(--c-buy-on-dark);
  --up:    var(--c-up-on-dark);
  --down:  var(--c-down-on-dark);
  --ring:  var(--focus-ring-dark);
  --accent-detail: var(--c-champagne);
  --risk-accent: var(--c-champagne);
  color-scheme: dark;
}
.section--deep, .site-footer, .risk-bar { --bg: var(--c-deep); --bg-raised: var(--c-evergreen); --bg-inset: var(--c-evergreen); }

/* ---------- 3. Body + typography ---------- */
body {
  min-height: 100vh;
  background: var(--c-bone);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.has-drawer { overflow: hidden; }

/* One family: headings are heavy grotesk with tight tracking. */
h1, h2, h3, .t-display, .t-h1, .t-h2, .t-h3 {
  font-family: var(--font-sans);
  font-weight: var(--fw-heading);
  color: var(--fg);
  text-wrap: balance;
}
h4, h5, h6, .t-h4 { font-family: var(--font-sans); font-weight: var(--fw-title); color: var(--fg); }

.t-display { font-size: var(--fs-4xl); line-height: var(--lh-tight); letter-spacing: var(--tr-display); font-weight: var(--fw-display); }
.t-h1      { font-size: var(--fs-3xl); line-height: 1.02; letter-spacing: var(--tr-display); font-weight: var(--fw-heading); }
.t-h2      { font-size: var(--fs-2xl); line-height: 1.04; letter-spacing: var(--tr-heading); }
.t-h3      { font-size: var(--fs-xl);  line-height: var(--lh-snug); letter-spacing: -0.022em; font-weight: var(--fw-title); }
.t-h4      { font-size: var(--fs-lg);  line-height: 1.25; letter-spacing: var(--tr-title); }
.t-lead    { font-size: var(--fs-md);  line-height: 1.55; color: var(--fg-2); max-width: var(--measure-lead); text-wrap: pretty; }
.t-body    { font-size: var(--fs-base); color: var(--fg-2); max-width: var(--measure); text-wrap: pretty; }
.t-small   { font-size: var(--fs-sm); line-height: 1.5; color: var(--fg-2); }
.t-fine    { font-size: var(--fs-xs); line-height: 1.55; color: var(--fg-3); }
.t-label   { font-size: var(--fs-sm); font-weight: 600; line-height: var(--lh-ui); color: var(--fg); letter-spacing: var(--tr-ui); }
.t-meta    { font-size: var(--fs-xs); font-weight: 500; line-height: var(--lh-ui); color: var(--fg-3); }
.t-num     { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "tnum" 1, "lnum" 1; }
.t-muted   { color: var(--fg-3); }
.t-center  { text-align: center; }
.t-balance { text-wrap: balance; }

p { text-wrap: pretty; }
strong, b { font-weight: 650; }
::selection { background: var(--c-champagne); color: var(--c-ink); }

/* ---------- 4. Links ---------- */
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--link-hover); }
.link {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
  transition: text-decoration-color var(--dur-1) var(--ease-std), color var(--dur-1) var(--ease-std);
}
.link:hover { text-decoration-color: currentColor; }
.link--quiet { color: var(--fg); font-weight: 500; }
.link--quiet:hover { color: var(--link); }
.link .icon { display: inline-block; vertical-align: -0.18em; margin-left: 0.2em; }

/* ---------- 5. Focus, skip link, utilities ---------- */
:focus { outline: none; }
:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring); border-radius: var(--r-xs); }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { box-shadow: var(--ring); }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: var(--ring); }

.skip-link {
  position: fixed;
  left: var(--sp-4);
  top: var(--sp-3);
  z-index: var(--z-skip);
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: var(--c-champagne);
  color: var(--c-ink);
  font-weight: 650;
  font-size: var(--fs-sm);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dur-2) var(--ease-out);
}
.skip-link:focus, .skip-link:focus-visible { transform: none; box-shadow: 0 0 0 2px var(--c-evergreen), 0 0 0 4px var(--c-champagne); }

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

/* Placeholder content the company must supply before launch */
.todo {
  display: inline;
  padding: 0.05em 0.35em;
  border-radius: var(--r-xs);
  background: var(--c-todo-bg);
  color: var(--c-todo-ink);
  box-shadow: inset 0 0 0 1px var(--c-todo-line);
  font-weight: 500;
  font-style: normal;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ---------- 6. Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--wide { max-width: calc(var(--container-wide) + 2 * var(--gutter)); }
.wrap--text { max-width: calc(var(--container-text) + 2 * var(--gutter)); }

.section { position: relative; padding-block: var(--section-y); background: var(--bg); color: var(--fg); }
.section--alt  { background: var(--c-linen); }
.section--dark { background: var(--c-evergreen); }
.section--deep { background: var(--c-deep); }
.section--tight { padding-block: var(--section-y-sm); }
/* two bone sections in a row get a hairline instead of a gap of nothing */
.section:not(.section--dark):not(.section--deep):not(.section--alt) + .section:not(.section--dark):not(.section--deep):not(.section--alt) { border-top: var(--line); }

.section-head { display: grid; gap: var(--sp-4); margin-bottom: var(--head-gap); max-width: 46rem; }
.section-head > h2, .section-head .section-head__title { font-size: var(--fs-2xl); line-height: 1.04; letter-spacing: var(--tr-heading); }
.section-head p { font-size: var(--fs-md); line-height: 1.55; color: var(--fg-2); max-width: var(--measure-lead); }
.section-head--center { margin-inline: auto; text-align: center; justify-items: center; }
@media (min-width: 1024px) {
  .section-head--split { max-width: none; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; gap: var(--grid-gap); }
  .section-head--split p { justify-self: end; }
}

.stack   { display: flex; flex-direction: column; gap: var(--stack-gap, var(--sp-4)); }
.stack-sm { --stack-gap: var(--sp-2); }
.stack-lg { --stack-gap: var(--sp-6); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--sp-3)); }

.grid   { display: grid; gap: var(--grid-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}

.rule { height: 0; border: 0; border-top: 1px solid var(--line-c); margin: 0; }

/* ---------- 7. Icons ---------- */
.icon { width: 1.25rem; height: 1.25rem; flex: none; color: inherit; overflow: visible; }
.icon--xs { width: 0.875rem; height: 0.875rem; }
.icon--sm { width: 1rem; height: 1rem; }
.icon--md { width: 1.5rem; height: 1.5rem; }
.icon--lg { width: 2rem; height: 2rem; }
.icon--xl { width: 2.5rem; height: 2.5rem; }
.icon-frame {
  display: inline-grid; place-items: center;
  width: 3rem; height: 3rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-c-strong);
  color: var(--accent);
  background: var(--bg-raised);
}
.icon-frame .icon { width: 1.375rem; height: 1.375rem; }

/* ---------- 8. Buttons ---------- */
.btn {
  --btn-h: 48px;
  --btn-px: 22px;
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--btn-h);
  padding: 0 var(--btn-px);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 650;
  line-height: 1;
  letter-spacing: var(--tr-ui);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-1) var(--ease-std), border-color var(--dur-1) var(--ease-std), color var(--dur-1) var(--ease-std), transform var(--dur-2) var(--ease-out);
}
.btn:hover { color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 1.125rem; height: 1.125rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* champagne: the one action colour. Dark ink text on gold (7.6:1). */
.btn--primary {
  --btn-bg: var(--c-champagne); --btn-fg: var(--c-ink); --btn-bd: var(--c-champagne);
  box-shadow: 0 1px 0 rgba(255, 250, 235, 0.35) inset, 0 1px 2px rgba(14, 38, 32, 0.2);
}
.btn--primary:hover { --btn-bg: var(--c-champagne-300); --btn-bd: var(--c-champagne-300); --btn-fg: var(--c-ink); }

.btn--secondary { --btn-bg: transparent; --btn-fg: var(--fg); --btn-bd: var(--line-c-strong); }
.btn--secondary:hover { --btn-bd: var(--fg); }

.btn--ghost { --btn-fg: var(--fg); --btn-px: 14px; }
.btn--ghost:hover { --btn-bg: color-mix(in srgb, var(--fg) 8%, transparent); }

/* evergreen button for bone sections where a second solid action is needed */
.btn--dark { --btn-bg: var(--c-evergreen); --btn-fg: var(--c-pearl); --btn-bd: var(--c-evergreen); }
.btn--dark:hover { --btn-bg: var(--c-forest); --btn-bd: var(--c-forest); --btn-fg: var(--c-pearl); }

/* ivory button for dark panels where champagne would compete */
.btn--light { --btn-bg: var(--c-ivory); --btn-fg: var(--c-ink); --btn-bd: var(--c-ivory); }
.btn--light:hover { --btn-bg: var(--c-linen); --btn-bd: var(--c-linen); --btn-fg: var(--c-ink); }

.on-dark .btn--secondary, .section--dark .btn--secondary, .section--deep .btn--secondary, .site-header .btn--secondary, .site-drawer .btn--secondary {
  --btn-bd: rgba(243, 239, 229, 0.34);
}
.on-dark .btn--secondary:hover, .section--dark .btn--secondary:hover, .section--deep .btn--secondary:hover, .site-header .btn--secondary:hover, .site-drawer .btn--secondary:hover { --btn-bd: var(--c-pearl); }

.btn--sm { --btn-h: 44px; --btn-px: 18px; }
.btn--lg { --btn-h: 56px; --btn-px: 28px; font-size: var(--fs-base); }
.btn--block { width: 100%; }
.btn--icon { --btn-px: 0; width: var(--btn-h); }

/* ---------- 9. Segmented control + chips ---------- */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--bg-inset);
  box-shadow: inset 0 0 0 1px var(--line-c);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented > button, .segmented > a {
  flex: none;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  color: var(--fg-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 40px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-2) var(--ease-std), color var(--dur-1) var(--ease-std), box-shadow var(--dur-2) var(--ease-std);
}
.segmented > :hover { color: var(--fg); }
.segmented > [aria-selected="true"], .segmented > [aria-pressed="true"], .segmented > [aria-current="true"] {
  background: var(--bg-raised);
  color: var(--fg);
  box-shadow: 0 0 0 1px var(--line-c), var(--shadow-1);
}
.on-dark .segmented > [aria-selected="true"], .section--dark .segmented > [aria-selected="true"],
.on-dark .segmented > [aria-pressed="true"], .section--dark .segmented > [aria-pressed="true"] { background: var(--c-forest-2); }
@media (pointer: coarse) { .segmented > button, .segmented > a { min-height: 44px; line-height: 44px; } }

.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 32px; padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-c-strong);
  color: var(--fg-2);
  font-size: var(--fs-xs); font-weight: 500;
  white-space: nowrap;
}
.chip .icon { width: 0.9rem; height: 0.9rem; }

/* ---------- 10. Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  background: var(--bg-inset);
  color: var(--fg-2);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.35;
  white-space: nowrap;
}
.badge--brand { background: var(--c-champagne-050); color: var(--c-bronze-700); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-champagne) 55%, transparent); }
.badge--up    { background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); }
.badge--down  { background: color-mix(in srgb, var(--down) 14%, transparent); color: var(--down); }
.badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-c-strong); }
.badge--sample { background: transparent; box-shadow: inset 0 0 0 1px var(--line-c-strong); color: var(--fg-3); font-weight: 500; }
.badge--sample::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-fill); }
.on-dark .badge--brand, .section--dark .badge--brand { background: color-mix(in srgb, var(--c-champagne) 16%, transparent); color: var(--c-champagne-300); box-shadow: none; }

/* ---------- 11. Prices ---------- */
/* <span class="px px--buy"><span class="px__pre">1.08</span><span class="px__big">42</span><span class="px__pip">4</span></span>
   Sell = garnet-rose, Buy = bronze (light) / champagne (dark), Up = jade, Down = garnet-rose.
   Colour is never the only cue: always label Sell/Buy or show a sign. */
.px { display: inline-flex; align-items: baseline; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; line-height: 1; white-space: nowrap; color: var(--fg); }
.px__pre { font-size: 0.62em; font-weight: 500; letter-spacing: -0.01em; }
.px__big { font-size: 1em; font-weight: 650; letter-spacing: -0.02em; }
.px__pip { align-self: flex-start; font-size: 0.48em; font-weight: 600; margin-top: 0.06em; margin-left: 0.06em; }
.px--sell { color: var(--sell); }
.px--buy  { color: var(--buy); }
.is-up    { color: var(--up); }
.is-down  { color: var(--down); }
.tick-up, .tick-down { transition: background-color var(--dur-4) var(--ease-out); }
.tick-up   { background-color: color-mix(in srgb, var(--up) 16%, transparent); }
.tick-down { background-color: color-mix(in srgb, var(--down) 16%, transparent); }

/* ---------- 12. Forms ---------- */
.field { display: grid; gap: 6px; }
.field__label { font-size: var(--fs-sm); font-weight: 600; color: var(--fg); }
.field__hint { font-size: var(--fs-xs); color: var(--fg-3); }
.input, .select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-c-strong);
  background: var(--bg-raised);
  color: var(--fg);
  font-size: var(--fs-base);
  transition: border-color var(--dur-1) var(--ease-std);
}
.input::placeholder { color: var(--fg-3); }
.input:hover, .select:hover { border-color: var(--fg-3); }
.input:focus-visible, .select:focus-visible { border-color: var(--accent); }

/* ---------- 13. Tables ---------- */
.table { width: 100%; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 14px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line-c); }
.table thead th { padding-block: 10px; font-size: var(--fs-xs); font-weight: 500; color: var(--fg-3); border-bottom-color: var(--line-c-strong); white-space: nowrap; }
.table tbody th { font-weight: 600; color: var(--fg); }
.table td { color: var(--fg-2); }
.table .num { text-align: right; }
.table td.px--sell, .table .px--sell { color: var(--sell); }
.table td.px--buy, .table .px--buy { color: var(--buy); }
.table td.is-up, .table .is-up { color: var(--up); }
.table td.is-down, .table .is-down { color: var(--down); }
.table .t-strong { color: var(--fg); font-weight: 600; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table--hover tbody tr { transition: background-color var(--dur-1) var(--ease-std); }
.table--hover tbody tr:hover { background: color-mix(in srgb, var(--fg) 3%, transparent); }
.table--compact th, .table--compact td { padding: 10px 12px; }
.table-frame { border: 1px solid var(--line-c); border-radius: var(--r-md); background: var(--bg-raised); overflow-x: auto; overscroll-behavior-x: contain; }
.table-frame .table th:first-child, .table-frame .table td:first-child { padding-left: 20px; }
.table-frame .table th:last-child, .table-frame .table td:last-child { padding-right: 20px; }
@media (max-width: 599px) {
  .table { font-size: var(--fs-xs); }
  .table th, .table td { padding: 12px 8px; }
  .table-frame .table th:first-child, .table-frame .table td:first-child { padding-left: 14px; }
  .table-frame .table th:last-child, .table-frame .table td:last-child { padding-right: 14px; }
  .hide-sm { display: none !important; }
}

/* ---------- 14. Notes ---------- */
.note {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: var(--bg-inset);
  color: var(--fg-2);
  font-size: var(--fs-xs); line-height: 1.55;
}
.note .icon { width: 1rem; height: 1rem; margin-top: 0.15em; color: var(--fg-3); }
.note strong { color: var(--fg); }


.brand {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  color: var(--c-pearl);
  text-decoration: none;
  flex: none;
}
.brand:hover { color: var(--c-ivory); }
.brand__mark { width: 34px; height: 22px; overflow: visible; }
.brand__ring { fill: none; stroke: currentColor; stroke-width: 1.6; }
.brand__lens { fill: var(--c-champagne); }
.brand__word {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  margin-right: -0.16em;
}
.brand__word span { color: var(--c-champagne); font-weight: 500; }
.brand--on-light { color: var(--c-ink); }
.brand--on-light .brand__word span { color: var(--c-bronze); }
.brand--on-light .brand__lens { fill: var(--c-champagne); }
