/* GlyphIQ Archived Code Landing — Tokens + Page Styles */

/* ============================================================
   GlyphIQ Design System — Colors & Type (Light Mode Only — MVP)
   Pulled from src/app/globals.css
   ============================================================ */

:root {
  /* ─── PRIMARY — Emerald (brand, main CTA) ─── */
  --primary:            oklch(0.596 0.145 163.225);   /* emerald-600 #059669 */
  --primary-hover:      oklch(0.508 0.118 165.612);
  --primary-foreground: oklch(1 0 0);
  --primary-50:         oklch(0.979 0.021 166.113);
  --primary-100:        oklch(0.950 0.052 163.051);
  --primary-200:        oklch(0.905 0.093 164.150);
  --primary-300:        oklch(0.845 0.143 164.978);
  --primary-400:        oklch(0.765 0.177 163.223);
  --primary-500:        oklch(0.696 0.170 162.480);
  --primary-700:        oklch(0.508 0.118 165.612);
  --primary-800:        oklch(0.432 0.095 166.913);
  --primary-900:        oklch(0.378 0.077 168.940);
  --primary-950:        oklch(0.262 0.051 172.552);

  /* ─── SECONDARY — Neutral (shadcn default) ─── */
  /* Non-branded. Used for muted component variants (secondary Button, tonal
     chips). Do not compete with semantic tokens. */
  --secondary:            oklch(0.968 0.007 264.531); /* gray-50 */
  --secondary-foreground: oklch(0.208 0.042 265.755); /* slate-900 */

  /* ─── ACCENT — Neutral (shadcn default) ─── */
  /* Non-branded. Used for hover/focus washes and subtle emphasis. */
  --accent:            oklch(0.968 0.007 264.531); /* gray-50 */
  --accent-foreground: oklch(0.208 0.042 265.755); /* slate-900 */

  /* ─── NEUTRAL — Slate ─── */
  --background:       oklch(1 0 0);             /* white */
  --foreground:       oklch(0.208 0.042 265.755); /* slate-900 */
  --card:             oklch(1 0 0);
  --card-foreground:  oklch(0.208 0.042 265.755);

  /* ─── SURFACES ─── */
  /* System-wide rule (light mode):
     - Main canvas is pure white (--background).
     - Left navigation rails — main sidebar AND any surface-scoped nav columns
       (e.g. folders on QR Codes) — share a pale mint surface tint.
       Slightly more saturated than primary-50 so the tint reads clearly at
       small preview sizes; still well within the emerald-50 range.
       Not per-page configurable. */
  --surface-nav:      oklch(0.965 0.035 163);
  --muted:            oklch(0.968 0.007 264.531); /* gray-50 surface */
  --muted-foreground: oklch(0.554 0.046 257.417); /* gray-500 secondary */
  --border:           oklch(0.929 0.013 255.508); /* gray-200 */
  --input:            oklch(0.929 0.013 255.508);
  --ring:             oklch(0.596 0.145 163.225);
  --popover:          oklch(1 0 0);
  --popover-foreground: oklch(0.208 0.042 265.755);

  /* ─── SURFACE (tonal layering) ─── */
  --inverse-surface:          oklch(0.254 0.013 264);
  --inverse-on-surface:       oklch(0.953 0.007 264);
  --surface-container-high:   oklch(0.928 0.006 264);
  --surface-container-low:    oklch(0.967 0.003 264);

  /* ─── SEMANTIC ─── */
  /* Each semantic role owns its own hue. Primary (emerald) is brand only. */
  --destructive:            oklch(0.577 0.245 27.325); /* red-600 */
  --destructive-foreground: oklch(1 0 0);
  --destructive-bg:         oklch(0.971 0.013 17.380); /* red-50 */
  --success:                oklch(0.627 0.194 149.214); /* green-600 #16a34a */
  --success-bg:             oklch(0.962 0.044 156.743); /* green-50 */
  --success-foreground:     oklch(0.448 0.119 151.328); /* green-800 */
  --warning:                oklch(0.666 0.179 58.318);  /* amber-500 */
  --warning-bg:             oklch(0.962 0.059 95.617);  /* amber-50 */
  --warning-foreground:     oklch(0.473 0.137 46.201);  /* amber-800 */

  /* ─── CHART (recharts) ─── */
  /* Categorical palette: emerald leads, then four genuinely distinct hues
     for good categorical separation (device donuts, country bars, etc).
     Muted/desaturated but each hue is recognizably its own color. Teal
     deliberately absent — lives only inside --signature-gradient. */
  --chart-1: oklch(0.596 0.145 163.225); /* emerald-600 (primary) */
  --chart-2: oklch(0.623 0.134 258.000); /* blue-600, muted */
  --chart-3: oklch(0.720 0.155 68.000);  /* amber-500, muted */
  --chart-4: oklch(0.620 0.170 12.000);  /* rose-600, muted */
  --chart-5: oklch(0.560 0.165 303.000); /* violet-600, muted */

  /* ─── RADII ─── */
  /* Pulled down from previous scale. Reads as precise/infrastructural, not
     playful. 12px is the cap on any surface — no rounded-[2rem]/[3rem].
     Pill (9999) covers badges, eyebrow pills, avatars, status chips. */
  --radius:       6px;   /* default — cards, panels */
  --radius-sm:    2px;   /* tight surfaces (input affordances, dividers) */
  --radius-input: 4px;   /* form inputs — high-touch, slightly softer */
  --radius-md:    4px;   /* buttons, small cards */
  --radius-lg:    6px;   /* alias of default */
  --radius-xl:    8px;   /* modals, larger containers */
  --radius-2xl:   12px;  /* hero/pricing only — hard cap */
  --radius-pill:  9999px; /* badges, eyebrow pills, avatars, status chips */

  /* ─── SHADOWS ─── */
  --shadow-card:        0 4px 20px oklch(0 0 0 / 0.04);
  /* Rule: shadows are always neutral. Color lives in fills, text, and
     borders — never in the shadow. Colored drop-shadows read as alarmist
     (destructive) or trend-dated (brand-tinted CTAs). */
  --shadow-cta:         0 4px 12px oklch(0.208 0.042 265.755 / 0.10);
  --shadow-cta-lg:      0 10px 28px oklch(0.208 0.042 265.755 / 0.12);
  --shadow-dialog:      0 16px 48px oklch(0 0 0 / 0.15);
  --shadow-empty:       0 8px 40px oklch(0 0 0 / 0.04);
  --shadow-destructive: 0 4px 12px oklch(0.208 0.042 265.755 / 0.12);

  /* ─── SPACING ─── */
  /* Strict 4pt grid. No 6, no 20 — they duplicate adjacent steps and add
     decision fatigue without semantic role. Bento grid inherits this scale
     (gap uses 8px, not a special 6px unit). */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  /* ─── TYPE (fonts) ─── */
  /* IBM Plex Sans is the sole typeface. Chosen over Inter to differentiate
     from commodity AI/SaaS look. All roles — display, headings, body, UI —
     share one family; hierarchy comes from weight, size, and tracking.
     --font-mono uses system fallbacks only — no additional webfont. */
  --font-sans:     'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-heading:  'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --font-headline: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono:     ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ─── TYPE — foundational variables ─── */
  --fg1: var(--foreground);           /* slate-900 — primary text */
  --fg2: var(--muted-foreground);     /* slate-500 — secondary text */
  --fg3: oklch(0.704 0.040 256.788);  /* tertiary / captions */

  /* ─── TYPE — semantic scale ─── */
  --text-display-size:   clamp(2.5rem, 5vw + 1rem, 4.5rem);
  --text-display-lh:     1.05;
  --text-display-weight: 800;
  --text-display-ls:     -0.02em;

  --text-h1-size:   2.25rem;
  --text-h1-lh:     1.15;
  --text-h1-weight: 800;
  --text-h1-ls:     -0.02em;

  --text-h2-size:   1.75rem;
  --text-h2-lh:     1.2;
  --text-h2-weight: 700;
  --text-h2-ls:     -0.015em;

  --text-h3-size:   1.25rem;
  --text-h3-lh:     1.3;
  --text-h3-weight: 700;
  --text-h3-ls:     -0.01em;

  --text-card-title-size: 1rem; /* 16px */
  --text-card-title-lh:   1.4;
  --text-card-title-weight: 600;

  /* Body = browser default (16px). The ONLY smaller step allowed is 14px.
     Nothing smaller than 14px exists in this system — no 13, no 12. */
  --text-body-size:   1rem;      /* 16px */
  --text-body-lh:     1.55;
  --text-body-weight: 400;

  --text-small-size:   0.875rem; /* 14px — floor */
  --text-small-lh:     1.5;

  --text-caption-size: 0.875rem; /* 14px — floor */
  --text-caption-lh:   1.4;
  --text-caption-ls:   0.02em;

  --text-eyebrow-size:   0.875rem; /* 14px — floor */
  --text-eyebrow-lh:     1.2;
  --text-eyebrow-weight: 700;
  --text-eyebrow-ls:     0.14em;

  --text-mono-size: 0.875rem;    /* 14px — floor */
  --text-mono-lh:   1.5;
}

/* ─── SEMANTIC TYPE ELEMENTS ─── */
.display, .t-display {
  font-family: var(--font-headline);
  font-size: var(--text-display-size);
  line-height: var(--text-display-lh);
  font-weight: var(--text-display-weight);
  letter-spacing: var(--text-display-ls);
  color: var(--fg1);
}

.h1, .t-h1 {
  font-family: var(--font-headline);
  font-size: var(--text-h1-size);
  line-height: var(--text-h1-lh);
  font-weight: var(--text-h1-weight);
  letter-spacing: var(--text-h1-ls);
  color: var(--fg1);
}

.h2, .t-h2 {
  font-family: var(--font-headline);
  font-size: var(--text-h2-size);
  line-height: var(--text-h2-lh);
  font-weight: var(--text-h2-weight);
  letter-spacing: var(--text-h2-ls);
  color: var(--fg1);
}

.h3, .t-h3 {
  font-family: var(--font-heading);
  font-size: var(--text-h3-size);
  line-height: var(--text-h3-lh);
  font-weight: var(--text-h3-weight);
  letter-spacing: var(--text-h3-ls);
  color: var(--fg1);
}

.card-title, .t-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-card-title-size);
  line-height: var(--text-card-title-lh);
  font-weight: var(--text-card-title-weight);
  letter-spacing: -0.01em;
  color: var(--fg1);
}

.p, .t-body {
  font-family: var(--font-sans);
  font-size: var(--text-body-size);
  line-height: var(--text-body-lh);
  color: var(--fg1);
}

.small, .t-small {
  font-family: var(--font-sans);
  font-size: var(--text-small-size);
  line-height: var(--text-small-lh);
  color: var(--fg2);
}

.caption, .t-caption {
  font-family: var(--font-sans);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  letter-spacing: var(--text-caption-ls);
  color: var(--fg2);
}

.eyebrow, .t-eyebrow {
  font-family: var(--font-headline);
  font-size: var(--text-eyebrow-size);
  line-height: var(--text-eyebrow-lh);
  font-weight: var(--text-eyebrow-weight);
  letter-spacing: var(--text-eyebrow-ls);
  text-transform: uppercase;
  color: var(--fg2);
}

.mono, .t-mono, code {
  font-family: var(--font-mono);
  font-size: var(--text-mono-size);
  line-height: var(--text-mono-lh);
  color: var(--fg1);
}

/* ─── Signature gradient ───
   Teal exists ONLY as the second stop of this gradient. It is not a
   standalone color token anywhere else in the system. The gradient is
   used sparingly: top CTA, hero 'outlive' word, 'Most Popular' badge. */
:root {
  --signature-gradient: linear-gradient(
    135deg,
    oklch(0.596 0.145 163.225) 0%, /* primary emerald-600 */
    oklch(0.600 0.118 175.066) 100% /* teal-600 — gradient-only */
  );
}
.bg-signature-gradient { background: var(--signature-gradient); }
.text-signature-gradient {
  background: var(--signature-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

body, html {
  font-family: var(--font-sans);
  color: var(--fg1);
  background: var(--background);
}

/* ─── Reset + page shell ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--background);
  color: var(--fg1);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }

/* ─── Page max-width container ───────────────────────────── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  width: 100%;
}

/* ─── Header (full-width strip, bg-card, border-b) ───────── */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  min-height: 64px;
  display: flex;
  align-items: center;
}
.site-header .container {
  display: flex;
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: opacity 150ms ease;
}
.brand:hover { opacity: 0.85; }
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: block;
}
.brand-name {
  font-family: var(--font-heading);
  font-size: var(--text-h3-size);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg1);
}

/* ─── Main content area ──────────────────────────────────── */
main { flex: 1 0 auto; }
.content {
  padding-top: 48px;       /* space-12 */
  padding-bottom: 64px;    /* space-16 before footer */
}

/* Reset default margins on typed elements; spacing utilities below own bottom margin. */
h1.t-h1, h2.t-h3, h3.t-h3, p.t-body { margin-top: 0; margin-bottom: 0; }

/* Spacing utility-ish — mapped to brief tokens. Higher-specificity selectors
   so they win against the typed-element resets above. */
.mb-3.mb-3   { margin-bottom: 12px; }
.mb-6.mb-6   { margin-bottom: 24px; }
.mb-8.mb-8   { margin-bottom: 32px; }
.mb-12.mb-12 { margin-bottom: 48px; }
.mb-16.mb-16 { margin-bottom: 64px; }
.text-fg2 { color: var(--fg2); }
.text-fg3 { color: var(--fg3); }

/* ─── Ad slot ────────────────────────────────────────────── */
.ad-slot {
  width: 300px;
  max-width: 300px;
  min-width: 300px;
  min-height: 250px;
  margin: 0 auto;
  background: var(--surface-container-low);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.ad-slot__caption {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  color: var(--fg3);
  letter-spacing: 0.02em;
}

/* ─── CTA ────────────────────────────────────────────────── */
.cta-row { display: flex; }
.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-cta);
  padding: 12px 24px;        /* space-3 / space-6 */
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.005em;
  transition: background-color 150ms ease, transform 100ms ease, box-shadow 150ms ease;
  cursor: pointer;
}
.cta:hover { background: var(--primary-hover); }
.cta:active { transform: translateY(1px); box-shadow: 0 2px 8px oklch(0.208 0.042 265.755 / 0.10); }
.cta:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}
.cta__arrow {
  width: 16px; height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: transform 150ms ease;
}
.cta:hover .cta__arrow { transform: translateX(2px); }

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding-top: 32px;
  padding-bottom: 32px;       /* space-8 vertical */
  flex-shrink: 0;
}
.footer-tagline {
  margin: 0 0 12px;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  font-family: var(--font-sans);
  font-size: var(--text-small-size);
  line-height: var(--text-small-lh);
}
.footer-links a {
  color: var(--fg2);
  transition: color 150ms ease;
}
.footer-links a:hover { color: var(--fg1); }
.footer-links .sep {
  color: var(--fg3);
  padding: 0 10px;
  user-select: none;
}
.footer-copy {
  margin: 0;
  color: var(--fg3);
}

/* ─── Cookie banner ──────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  box-shadow: var(--shadow-dialog);
  padding: 16px 24px;          /* space-4 / space-6 */
  z-index: 50;
  transform: translateY(0);
  transition: transform 220ms ease, opacity 220ms ease;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
}
.cookie-banner__copy {
  flex: 1 1 auto;
  font-family: var(--font-sans);
  font-size: var(--text-small-size);
  line-height: 1.55;
  color: var(--inverse-on-surface);
  margin: 0;
}
.cookie-banner__copy a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: oklch(1 0 0 / 0.4);
  text-underline-offset: 2px;
  transition: text-decoration-color 150ms ease;
}
.cookie-banner__copy a:hover {
  text-decoration-color: oklch(1 0 0 / 0.85);
}
.cookie-banner__actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.btn {
  font-family: var(--font-sans);
  font-size: var(--text-small-size);
  font-weight: 600;
  line-height: 1.2;
  padding: 12px 20px;          /* space-3 / space-5 */
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 100ms ease;
  letter-spacing: -0.005em;
}
.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--ghost {
  background: transparent;
  color: var(--inverse-on-surface);
  border-color: oklch(1 0 0 / 0.4);
}
.btn--ghost:hover {
  background: oklch(1 0 0 / 0.08);
  border-color: oklch(1 0 0 / 0.6);
}
