/* ==========================================================================
   Comstocks design tokens
   The look is a 1:1 field-manual clone of stateofblocks.com (paper, ink, ruled
   grid, Instrument Serif display, IBM Plex Mono labels, Inter body, square
   corners, hard offset shadows) with its blueprint blue swapped for the
   Comstocks logo green. Reference: reference/sob/ (assets/index.css holds the
   original values; captures/ holds full-page shots at 1440 and 390).

   Breakpoints (use these exact numbers, min-width = at or above):
     400   detail: the idea clamps to 5 lines with "Show more" only below this
     600   header grows; gutters 24 -> 32 (header, footer) and 24 -> 40 (content)
     640   wordmark subtitle shows; modals become centered cards (bottom sheets below)
     720   the search box moves into the header
     760   footer goes multi-column; detail page goes two-column
     800   markets list switches to the desktop row (sparkline, return, Trade on the right)
     1024  full nav + the $COMSTOCKS chip show in the header
     1100  containers stop growing
   Tap targets are at least 40x40 below 640.
   ========================================================================== */

/* Self-hosted latin subsets: Instrument Serif, IBM Plex Mono, Inter (the State of Blocks type stack). */
@font-face { font-family: 'IBM Plex Mono'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/IBMPlexMono-400i.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/IBMPlexMono-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/IBMPlexMono-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/IBMPlexMono-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/InstrumentSerif-400i.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/InstrumentSerif-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/Inter-var.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }


:root {
  color-scheme: light;

  /* ---- the State of Blocks palette (HSL channels, so alpha works: hsl(var(--x) / .2)) ---- */
  --paper-c: 43 33% 92%;
  --paper-2-c: 42 26% 88%;
  --paper-3-c: 40 22% 82%;
  --ink-c: 220 24% 14%;
  --ink-soft-c: 219 15% 29%;
  --ink-faint-c: 219 12% 40%;
  --kraft-c: 35 33% 58%;
  --green-c: 152 68% 26%;        /* replaces SOB --blueprint 218 68% 37% */
  --green-deep-c: 154 70% 15%;   /* replaces SOB --blueprint-deep: dark bands, plates */
  --green-bright-c: 148 62% 46%; /* replaces SOB --blueprint-bright: accents on dark bands */
  --red-c: 5 62% 45%;            /* stamps, the period after a headline, losses */

  --paper: hsl(var(--paper-c));
  --paper-2: hsl(var(--paper-2-c));
  --paper-3: hsl(var(--paper-3-c));
  --green: hsl(var(--green-c));
  --green-deep: hsl(var(--green-deep-c));
  --green-bright: hsl(var(--green-bright-c));
  --red: hsl(var(--red-c));
  --kraft: hsl(var(--kraft-c));
  --shadow-hard: 4px 4px 0 hsl(var(--ink-c));
  --shadow-hard-sm: 2.5px 2.5px 0 hsl(var(--ink-c));
  --shadow-hard-lg: 6px 6px 0 hsl(var(--ink-c));
  --grid-minor: hsl(var(--green-c) / 0.07);
  --grid-major: hsl(var(--green-c) / 0.13);

  /* ---- surfaces (semantic names kept from the previous build; every page uses them) ---- */
  --page: var(--paper);                       /* page and header background */
  --card: hsl(43 36% 95%);                    /* sheets laid on the paper: cards, inputs, popovers */
  --border: hsl(var(--ink-c) / 0.2);          /* every 1px hairline */
  --border-strong: hsl(var(--ink-c) / 0.4);   /* framed sheets, outline buttons */
  --border-soft: hsl(var(--ink-c) / 0.12);
  --elevated: var(--paper-3);                 /* toasts, active segment, cover placeholder */
  --hole: var(--paper-2);
  --hover-wash: hsl(var(--paper-2-c) / 0.6);
  --press-wash: hsl(var(--paper-3-c) / 0.7);

  /* ---- text ---- */
  --ink: hsl(var(--ink-c));
  --ink-2: hsl(var(--ink-soft-c));
  --muted: hsl(var(--ink-faint-c));
  --muted-2: hsl(219 10% 46%);
  --neutral: hsl(219 10% 58%);                /* icons and non-text only */

  /* ---- market colors ---- */
  --up: hsl(152 68% 26%);
  --up-line: hsl(152 60% 32%);
  --down: hsl(5 62% 42%);
  --down-line: hsl(5 58% 48%);
  --down-ink: hsl(5 62% 40%);
  --danger: hsl(5 62% 45%);
  --danger-ink: hsl(5 62% 38%);
  --up-wash: hsl(152 68% 26% / 0.08);
  --down-wash: hsl(5 62% 45% / 0.08);

  /* ---- accent: logo green on paper ---- */
  --accent: var(--green);
  --accent-hover: hsl(152 68% 22%);
  --accent-ink: hsl(43 33% 96%);
  --accent-soft: var(--green);                /* links and highlights */
  --ring: var(--green);
  --accent-wash: hsl(var(--green-c) / 0.1);
  --accent-line: hsl(var(--green-c) / 0.4);
  --selection: hsl(var(--green-c) / 0.25);

  /* ---- controls ---- */
  --light-btn: var(--green);                  /* the primary action */
  --light-btn-hover: hsl(152 68% 22%);
  --light-btn-ink: hsl(43 33% 96%);
  --outline-hover: var(--ink);
  --seg-on-bg: var(--paper-3);
  --seg-on-border: hsl(var(--ink-c) / 0.45);
  --field-focus: var(--ink);
  --option-border: hsl(var(--ink-c) / 0.35);
  --watermark: hsl(var(--ink-c) / 0.06);

  /* ---- overlays and depth ---- */
  --scrim: hsl(var(--ink-c) / 0.45);
  --scrim-blur: 2px;
  --shadow-pop: var(--shadow-hard);
  --shadow-menu: var(--shadow-hard);
  --shadow-sheet: 0 -2px 0 hsl(var(--ink-c));

  /* ---- radii: State of Blocks is square (.125rem) ---- */
  --radius-xs: 2px;
  --radius-sm: 2px;
  --radius: 2px;
  --radius-cover: 0px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --radius-xl: 2px;
  --radius-2xl: 2px;
  --radius-pill: 999px;                       /* status dots only */

  /* ---- type ---- */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --track-label: 0.2em;                       /* mono uppercase labels */
  --track-btn: 0.22em;

  /* ---- layout ---- */
  --container: 1104px;        /* SOB content width (x 168..1272 at 1440) */
  --content: 1104px;
  --gutter: 16px;             /* phone gutter */
  --gutter-x: 16px;           /* header/footer side padding: 32 at >= 600 */
  --gutter-content: 16px;     /* page content side padding: 32 at >= 600 */
  --header-h: 64px;           /* bar height under the top strip: 72 at >= 600 */
  --strip-h: 30px;            /* the mono top strip above the header */
  --scrollbar-comp: 0px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  /* ---- spacing scale ---- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 28px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* ---- z-index scale ---- */
  --z-raised: 1;
  --z-sticky: 40;
  --z-header: 50;
  --z-dropdown: 60;
  --z-overlay: 1000;
  --z-modal: 1001;
  --z-toast: 1100;
  --z-tooltip: 1200;

  /* ---- motion (SOB reveal curve is cubic-bezier(.22,1,.36,1)) ---- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-thought: cubic-bezier(0.2, 0.9, 0.25, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-stamp: cubic-bezier(0.34, 1.4, 0.64, 1);
  --dur-1: 140ms;
  --dur-2: 160ms;
  --dur-3: 200ms;
  --dur-4: 260ms;
  --dur-row: 300ms;
  --dur-page: 180ms;
  --dur-reveal: 800ms;
}

@media (min-width: 600px) {
  :root {
    --gutter-x: 32px;
    --gutter-content: 32px;
    --header-h: 72px;
  }
}
