/* =========================================================================
   Most Invisible — Design System
   Base tokens: colors, typography, spacing, radii, shadows
   Two-color system: Dark #101010 + Light #F9FAFB
   ========================================================================= */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("./fonts/Inter.ttf") format("truetype-variations"),
       url("./fonts/Inter.ttf") format("truetype");
}

:root {
  /* ─── Core palette — two colors only ──────────────────────────────── */
  --dark:  #101010;
  --light: #F9FAFB;

  /* ─── Semantic surface / foreground / border ──────────────────────── */
  --fg-1: var(--dark);          /* primary text */
  --fg-2: var(--dark);          /* secondary text (use opacity for hierarchy) */
  --fg-3: var(--dark);          /* tertiary — apply opacity: 0.5 */
  --fg-inverse: var(--light);

  --bg-1: var(--light);         /* app background */
  --bg-2: var(--light);         /* subtle surface */
  --bg-inverse: var(--dark);

  --border-1: var(--dark);
  --border-2: var(--dark);

  --accent: var(--dark);
  --accent-hover: var(--dark);

  /* ─── Typography — font stacks ────────────────────────────────────── */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text",
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas,
               "Liberation Mono", monospace;

  /* ─── Type scale — Headings desktop ───────────────────────────────── */
  --type-display-lg-size: 52px;   --type-display-lg-line: 56px;
  --type-display-sm-size: 44px;   --type-display-sm-line: 48px;
  --type-h1-size: 40px;            --type-h1-line: 48px;
  --type-h2-size: 36px;            --type-h2-line: 44px;
  --type-h3-size: 32px;            --type-h3-line: 40px;
  --type-h4-size: 28px;            --type-h4-line: 36px;
  --type-h5-size: 24px;            --type-h5-line: 32px;
  --type-h6-size: 20px;            --type-h6-line: 28px;

  /* ─── Paragraphs ──────────────────────────────────────────────────── */
  --type-p-lg-size: 18px;  --type-p-lg-line: 28px;
  --type-p-md-size: 16px;  --type-p-md-line: 24px;
  --type-p-sm-size: 14px;  --type-p-sm-line: 20px;
  --type-p-xs-size: 12px;  --type-p-xs-line: 20px;

  --type-overline-size: 12px; --type-overline-line: 16px;

  /* ─── Line-height modes ───────────────────────────────────────────── */
  --lh-sm: 0.99;   /* 99% — tight, display use */
  --lh-md: 1.15;   /* 115% — standard */
  --lh-lg: 1.25;   /* 125% — relaxed, body use */

  /* ─── Tracking ────────────────────────────────────────────────────── */
  --tracking-tight: -0.03em; /* -3% — headings */
  --tracking-normal: 0em;
  --tracking-wide: 0.08em;   /* overlines */

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* ─── Spacing scale (4px grid) ────────────────────────────────────── */
  --space-xx-sm: 4px;
  --space-x-sm:  8px;
  --space-sm:    12px;
  --space-md:    16px;
  --space-big:   20px;
  --space-x-big: 24px;
  --space-xx-big:28px;
  --space-xxx-big:32px;
  --space-lg:    40px;
  --space-x-lg:  48px;
  --space-xx-lg: 64px;
  --space-xxx-lg:80px;
  --space-huge:  96px;
  --space-x-huge:128px;
  --space-xx-huge:160px;
  --space-xxx-huge:192px;

  /* ─── Radii ───────────────────────────────────────────────────────── */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-pill: 9999px;

  /* ─── Shadows — monochrome on #101010 ─────────────────────────────── */
  --shadow-xs:     0 1px 2px 0 rgba(16,16,16,0.05);
  --shadow-sm:     0 1px 2px 0 rgba(16,16,16,0.06), 0 1px 3px 0 rgba(16,16,16,0.10);
  --shadow-md:     0 2px 4px -2px rgba(16,16,16,0.06), 0 4px 8px -2px rgba(16,16,16,0.10);
  --shadow-lg:     0 4px 6px -2px rgba(16,16,16,0.03), 0 12px 16px -4px rgba(16,16,16,0.08);
  --shadow-xl:     0 8px 8px -4px rgba(16,16,16,0.03), 0 20px 24px -4px rgba(16,16,16,0.08);
  --shadow-2xl:    0 24px 48px -12px rgba(16,16,16,0.18);
  --shadow-focus:  0 0 0 4px rgba(16,16,16,0.16);

  /* ─── Blur ────────────────────────────────────────────────────────── */
  --blur-sm: 4px;
  --blur-md: 8px;
  --blur-lg: 16px;
  --blur-xl: 24px;

  /* ─── Layout grids ────────────────────────────────────────────────── */
  --container-max: 1216px;
  --container-padding-desktop: 112px;
  --container-padding-tablet: 32px;
  --container-padding-mobile: 16px;

  /* ─── Motion ──────────────────────────────────────────────────────── */
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 280ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================================================
   Semantic base styles
   ========================================================================= */

html, body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-lg);
  color: var(--fg-1);
  background: var(--bg-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-lg, .display-sm {
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
  text-transform: uppercase;
  color: var(--fg-1);
  margin: 0;
  line-height: var(--lh-sm);
  text-wrap: balance;
}

.display-lg {
  font-size: var(--type-display-lg-size);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
}
.display-sm {
  font-size: var(--type-display-sm-size);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
}
h1, .h1 { font-size: var(--type-h1-size); }
h2, .h2 { font-size: var(--type-h2-size); }
h3, .h3 { font-size: var(--type-h3-size); }
h4, .h4 { font-size: var(--type-h4-size); }
h5, .h5 { font-size: var(--type-h5-size); }
h6, .h6 { font-size: var(--type-h6-size); }

p, .p-md {
  font-size: var(--type-p-md-size);
  line-height: var(--lh-lg);
  font-weight: var(--fw-regular);
  color: var(--fg-1);
  margin: 0;
  text-wrap: pretty;
}
.p-lg { font-size: var(--type-p-lg-size); line-height: var(--lh-lg); }
.p-sm { font-size: var(--type-p-sm-size); line-height: var(--lh-md); }
.p-xs { font-size: var(--type-p-xs-size); line-height: var(--lh-md); }

.overline {
  font-size: var(--type-overline-size);
  line-height: var(--lh-md);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-1);
  opacity: 0.5;
}

/* ─── Line-height utility classes ───────────────────────────────────── */
.lh-sm { line-height: var(--lh-sm); }
.lh-md { line-height: var(--lh-md); }
.lh-lg { line-height: var(--lh-lg); }

code, kbd, pre, samp, .mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

a {
  color: var(--fg-1);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: opacity var(--motion-fast) var(--ease-standard);
}
a:hover { opacity: 0.6; }

::selection { background: var(--dark); color: var(--light); }

:where(button, a, input, select, textarea, [role="button"], [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}
