/* Design tokens for satyam's website, v2.
   Source: Figma "Website" section (Moodboard, Case Study, Jumbo, Zorro, Vertera, Swipe File).

   Take every value from this file. Never invent a new one.
   Pages and components use the SEMANTIC tokens (second block) only, never the primitives,
   never a raw hex, px size, shadow or duration. If something can't be built from these,
   stop and ask Satyam before adding a token. Rules and the why behind them: DESIGN.md. */


/* ───────────── 1. Primitives: raw values. Only the semantic block below reads these. ───────────── */
:root {
  /* Neutrals, light to dark. Every grey in the Figma file snaps to one of these. */
  --grey-0: #ffffff;
  --grey-25: #f7f7f7;
  --grey-50: #f4f4f4;
  --grey-100: #ededed;
  --grey-200: #e0e0e0;
  --grey-400: #a3a3a3;   /* muted text on the dark About card: 4.7:1 on --bg-inverse */
  --grey-450: #848484;   /* logos and lines on the dark card (graphics: 3.1:1) */
  --grey-500: #707070;   /* Figma used #8e8e8e here; darkened to pass 4.5:1 on the page */
  --grey-600: #646464;
  --grey-700: #424242;
  --grey-800: #383838;
  --grey-900: #232323;
  --grey-950: #151515;
  --black-a5: rgb(0 0 0 / .05);
  --black-a8: rgb(0 0 0 / .08);
  --black-a14: rgb(0 0 0 / .14);
  --black-a60: rgb(0 0 0 / .6);

  /* Type */
  --family-hand: "Shantell Sans", "Comic Sans MS", "Marker Felt", cursive;
  --family-sans: Inter, "Inter Fallback", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --size-11: 11px;
  --size-13: 13px;
  --size-15: 15px;
  --size-18: 18px;
  --size-28: 28px;
  /* Fluid: 14→15 (body) and 12→13 (label) as the screen grows from 1024 to 1440. Phones override below. */
  --size-body-fluid: clamp(14px, calc(14px + (100vw - 1024px) / 416), 15px);
  --size-label-fluid: clamp(12px, calc(12px + (100vw - 1024px) / 416), 13px);
  --weight-regular: 400;
  --weight-425: 425;
  --weight-465: 465;
  --weight-560: 560;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* Spacing: 4px base. 2 and 6 exist only for hairline gaps inside small parts. */
  --px-2: 2px; --px-4: 4px; --px-6: 6px; --px-8: 8px; --px-12: 12px; --px-16: 16px;
  --px-20: 20px; --px-24: 24px; --px-28: 28px; --px-32: 32px; --px-48: 48px; --px-64: 64px;

  /* Corners */
  --r-4: 4px; --r-6: 6px; --r-8: 8px; --r-12: 12px; --r-full: 999px;

  /* Motion curves (emil-animations library) */
  --curve-out: cubic-bezier(.23, 1, .32, 1);       /* ease-out quint: enters, reveals */
  --curve-drawer: cubic-bezier(.32, .72, 0, 1);    /* modals, sheets */
  --curve-in: cubic-bezier(.55, .055, .675, .19);  /* exits only */
  --curve-move: cubic-bezier(.645, .045, .355, 1); /* things already on screen moving */
}

/* ───────────── 2. Semantic tokens: what a value is FOR. Use only these. ───────────── */
:root {
  /* TEXT: four colours, no more.
     strong → titles, names, active nav, numbers that matter
     body   → paragraphs you read
     muted  → descriptions, nav, captions, labels
     faint  → meta (greeting, time, visitors), photo captions, "*of course it's not linear" */
  --text-strong: var(--grey-900);
  --text-body: var(--grey-700);
  --text-muted: var(--grey-600);
  --text-faint: var(--grey-500);
  --text-on-action: var(--grey-0);

  /* SURFACES */
  --bg-page: var(--grey-25);        /* the moodboard canvas and modal sheet */
  --bg-surface: var(--grey-50);     /* media cards, chips, swipe tiles */
  --bg-sunken: var(--grey-100);     /* process card, modal media well, close button */
  --bg-raised: var(--grey-0);       /* browser frames, polaroid photos */
  --bg-inverse: var(--grey-800);    /* the "Hi, I'm Satyam" card */
  --bg-device: var(--grey-950);     /* phone bezel */
  --bg-action: var(--grey-900);     /* selected chip */
  --bg-overlay: var(--black-a60);   /* behind a case study */
  --bg-glass: rgb(245 245 245 / .93); /* sticky sheet header (with --blur-glass) */
  --blur-overlay: 2px;
  --blur-glass: 30px;
  --texture-opacity: .64;       /* paper texture, blended with luminosity (Figma) */

  /* BORDERS: alpha, so they recede on any grey */
  --border-subtle: var(--black-a5);  /* card edges, frames */
  --border-default: var(--black-a8); /* dividers */
  --border-strong: var(--black-a14); /* margin-note rule */
  --border-quote: var(--px-2) solid var(--border-strong); /* case study intro quote */

  /* TYPE: four styles, no more. Use the shorthand vars below, never set size/weight by hand.
     Emphasis inside body text is --weight-medium (names) or --weight-semibold (key phrases); nothing else. */
  --font: var(--family-sans);
  /* Handwritten accent: asides, process steps, photo captions, case study margin notes.
     Figma Hand is only licensed inside Figma, so the site uses Shantell Sans (OFL), the closest open match. */
  --font-hand: var(--family-hand);
  --type-title: var(--weight-semibold) var(--size-28) / 32px var(--font);   /* case study title, page title */
  --type-heading: var(--weight-semibold) var(--size-18) / 24px var(--font); /* section heading, "Just a designer" */
  --type-body: var(--weight-regular) var(--size-body-fluid) / 1.5 var(--font); /* every paragraph, caption, chip, fact: 14px at 1024 → 15px at 1440+, 15px on phones */
  --type-label: var(--weight-medium) var(--size-label-fluid) / 18px var(--font); /* uppercase: fact names, Before/Chosen: 12px → 13px, 13px on phones */
  --track-title: -.024em;
  --track-heading: -.03em;
  --track-body: -.013em;
  --track-nav: -0.16px;
  --track-label: .06em;   /* uppercase needs air */
  --weight-emphasis: var(--weight-medium);
  --weight-strong: var(--weight-semibold);
  --size-nav: var(--size-13);
  --weight-nav: var(--weight-425);
  --weight-nav-active: var(--weight-465);
  /* Case study reading pair (2026-12-01): key phrases stand out in strong ink at 560,
     the rest of the paragraph steps back in muted ink at 425. */
  --weight-key: var(--weight-560);
  --weight-quiet: var(--weight-425);
  /* Body + 2px (16 → 17px): the case study intro quote and the homepage greeting. */
  --size-lead: calc(var(--size-body-fluid) + var(--px-2));
  /* Case study intro quote, set off by a rule on the left. */
  --type-lead: var(--weight-465) var(--size-lead) / 1.5 var(--font);

  /* SPACE */
  --gap-hair: var(--px-2);      /* title + subtitle pairs */
  --gap-tight: var(--px-4);     /* name + description in a tile */
  --gap-inline: var(--px-8);    /* chips, icon + text, meta row */
  --gap-stack: var(--px-12);    /* media + its caption, tiles in a column */
  --gap-group: var(--px-16);    /* paragraphs, blocks inside a card */
  --gap-list: var(--px-20);     /* general list spacing */
  --gap-chapter: var(--px-28);  /* between case study chapters */
  --gap-section: var(--px-32);  /* generous spacing inside sections */
  --gap-case-section: var(--px-48); /* case study: space above each section's rule, clearly more than between blocks (28) */
  --gap-home-section: 44px;     /* separates the homepage sections */
  --gap-home-work-start: var(--px-32);
  --gap-home-projects: var(--px-24);
  --gap-end: var(--px-64);      /* page bottom, sidebar top to first card */
  --pad-chip: 7px var(--px-12); /* figma 7/12: keeps chips 28px tall */
  --pad-card: var(--px-12) var(--px-16);
  --pad-card-lg: var(--px-32);
  --pad-page: var(--px-24);     /* outer page margin */
  --pad-sheet: var(--px-20) var(--px-24); /* inside a case study or swipe file sheet */

  /* CORNERS: nested corners use outer minus padding */
  --radius-tile: var(--r-4);    /* swipe tiles, modal media well */
  --radius-small: var(--r-6);   /* sidebar cards, app icons, the case study sheet */
  --radius-card: var(--r-8);    /* media cards, note cards */
  --radius-large: var(--r-12);  /* About card, full-width media card */
  --radius-device: var(--r-12); /* phone bezel */
  --radius-pill: var(--r-full); /* chips, the dismiss button */
  --bezel: 3px;                 /* phone frame, homepage size */
  --bezel-lg: 7px;              /* phone frame, case study size */

  /* ELEVATION: layered, so shadows read as physical */
  --shadow-photo: 0 0 0 .5px var(--black-a5), 0 4px 4px -2px rgb(0 0 0 / .1);   /* polaroids, app icons */
  --shadow-card: 0 0 1px rgb(0 0 0 / .31), 0 5px 6px -4px rgb(0 0 0 / .12);     /* pinned note card */
  --shadow-screen: 0 1px 3px var(--black-a8), 0 24px 60px -32px rgb(0 0 0 / .35); /* loose screenshots */
  --shadow-device: 0 2px 6px rgb(0 0 0 / .12), 0 30px 60px -30px rgb(0 0 0 / .45); /* phones, case study size */
  --shadow-device-sm: 0 1px 3px rgb(0 0 0 / .12), 0 14px 28px -14px rgb(0 0 0 / .45); /* phones, homepage size (half) */
  --shadow-highlight: inset 0 1px 1px rgb(255 255 255 / .25);                    /* close button */

  /* LAYOUT, read from the Figma layout grid: 12 columns, 12 gutter, 24 margin, at 1024.
     Sidebar = columns 1–3, column 4 is air, content = columns 5–12 (subgrid of 8). */
  --page-max: 1440px;           /* Figma is drawn at 1024; the grid stays fluid up to 1440 */
  --grid-columns: 12;
  --grid-gutter: var(--px-12);
  --grid-margin: var(--px-24);
  --sheet-max: 834px;           /* default sheet cap and case study reference at 1024px */
  --sheet-wide-max: 1024px;     /* swipe file sheet */
  --sheet-inset: var(--px-24);  /* space around a sheet on desktop */
  --size-dismiss: var(--px-32);
  --size-touch-target: 44px;
  --size-dismiss-hit-area: var(--size-touch-target);
  --size-avatar: 40px;          /* testimonial portrait */
  --size-swipe-card: 276px;     /* sidebar swipe file card stops growing here (wide screens) */
  --size-focus-marker: var(--px-8);
  --measure: 65ch;              /* longest readable line */

  /* MOTION: tokens per job. Every one has a reduced-motion path (DESIGN.md). */
  --ease-enter: var(--curve-out);
  --ease-sheet: var(--curve-drawer);
  --ease-exit: var(--curve-in);
  --ease-move: var(--curve-move);
  --dur-press: 150ms;    /* :active scale(.96) */
  --dur-hover: 150ms;    /* colour, shadow */
  --dur-pop: 200ms;      /* tooltips, the speech bubble */
  --dur-move: 280ms;     /* something on screen moving to a new place */
  --dur-follow: 160ms;   /* the nav dot following the scroll: quick, still eased */
  --dur-sheet: 240ms;    /* case study opening, with its overlay */
  --dur-sheet-out: 180ms;
  --dur-reveal: 700ms;   /* scroll reveal, kept from v1 */
  --dur-wait: 1200ms;    /* an image's placeholder block breathing while the image loads */
  --dur-logo-loop: 24s;  /* one pass through the mobile logo strip */
  --dur-image: 500ms;    /* real image resolving over the wireframe, kept from v1 */
  --stagger: 70ms;       /* siblings arriving together, capped at 6 */
  --reveal-blur: 10px;
  --reveal-rise: 14px;
  --press-scale: .96;
  --sheet-scale: .97;

  /* Light only for now (decided 2026-11-30). */
  color-scheme: light;
}

/* Phones read up close: keep the larger sizes there. */
@media (max-width: 719px) {
  :root { --size-body-fluid: var(--size-15); --size-label-fluid: var(--size-13); }
}

/* On the dark About card the same four text roles map to light greys. Never a fifth role. */
.on-inverse {
  --text-strong: var(--grey-0);
  --text-body: var(--grey-200);
  --text-muted: var(--grey-400);
  --text-faint: var(--grey-450);
  color: var(--text-muted);
}
