/* ==========================================================================
   The Resignation Consultant — Design Tokens & Base
   Direction: Modern & Confidential — ink graphite, warm paper, evergreen,
   brass hairlines. Restrained, institutional, premium.
   ========================================================================== */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.83rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.4375rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  --text-2xl: clamp(1.9rem, 1.2rem + 2.4vw, 3.25rem);
  --text-3xl: clamp(2.4rem, 1.1rem + 3.8vw, 4.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius — near-square, institutional */
  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --radius-full: 9999px;

  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 680px;
  --content-default: 1000px;
  --content-wide: 1280px;

  --font-display: 'Cabinet Grotesk', 'Satoshi', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', 'Helvetica Neue', sans-serif;
  --font-serif: 'Gambetta', Georgia, serif;
}

/* ---------------------------- LIGHT ---------------------------- */
:root,
[data-theme='light'] {
  --color-bg: #f4f3ef;
  --color-surface: #faf9f6;
  --color-surface-2: #ffffff;
  --color-surface-offset: #ecebe5;
  --color-surface-offset-2: #e3e1d9;
  --color-surface-dynamic: #d9d7cd;
  --color-divider: #dddbd3;
  --color-border: #cdcabf;

  --color-text: #14181a;
  --color-text-muted: #5d6668;
  --color-text-faint: #9aa1a1;
  --color-text-inverse: #f6f5f1;

  --color-primary: #17453b;
  --color-primary-hover: #0f3129;
  --color-primary-active: #0a221c;
  --color-primary-highlight: #dbe5e0;
  --color-primary-on: #f6f5f1;

  --color-brass: #8a6a34;
  --color-brass-faint: #cbb896;

  --color-ink: #0e1112;
  --color-ink-2: #171b1c;

  --shadow-sm: 0 1px 2px rgba(20, 24, 26, 0.06);
  --shadow-md: 0 6px 22px rgba(20, 24, 26, 0.07);
  --shadow-lg: 0 18px 48px rgba(20, 24, 26, 0.1);

  --overlay-strong: linear-gradient(90deg, rgba(10, 13, 14, 0.94) 0%, rgba(10, 13, 14, 0.8) 45%, rgba(10, 13, 14, 0.42) 100%);
}

/* ---------------------------- DARK ---------------------------- */
[data-theme='dark'] {
  --color-bg: #0e1112;
  --color-surface: #14181a;
  --color-surface-2: #191e20;
  --color-surface-offset: #171b1d;
  --color-surface-offset-2: #1d2224;
  --color-surface-dynamic: #262c2e;
  --color-divider: #212729;
  --color-border: #333a3c;

  --color-text: #e7e8e4;
  --color-text-muted: #939b99;
  --color-text-faint: #626b6a;
  --color-text-inverse: #0e1112;

  --color-primary: #7bbca7;
  --color-primary-hover: #96cdba;
  --color-primary-active: #aedbcb;
  --color-primary-highlight: #1c2b28;
  --color-primary-on: #0a1a16;

  --color-brass: #c9a468;
  --color-brass-faint: #6b5936;

  --color-ink: #0a0d0e;
  --color-ink-2: #101415;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 22px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);

  --overlay-strong: linear-gradient(90deg, rgba(6, 8, 9, 0.95) 0%, rgba(6, 8, 9, 0.85) 45%, rgba(6, 8, 9, 0.5) 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0e1112;
    --color-surface: #14181a;
    --color-surface-2: #191e20;
    --color-surface-offset: #171b1d;
    --color-surface-offset-2: #1d2224;
    --color-surface-dynamic: #262c2e;
    --color-divider: #212729;
    --color-border: #333a3c;
    --color-text: #e7e8e4;
    --color-text-muted: #939b99;
    --color-text-faint: #626b6a;
    --color-text-inverse: #0e1112;
    --color-primary: #7bbca7;
    --color-primary-hover: #96cdba;
    --color-primary-active: #aedbcb;
    --color-primary-highlight: #1c2b28;
    --color-primary-on: #0a1a16;
    --color-brass: #c9a468;
    --color-brass-faint: #6b5936;
  }
}

/* ---------------------------- RESET ---------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01' 1;
  overflow-x: hidden;
  transition: background-color 300ms ease, color 300ms ease;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

/* Intrinsic-ratio guard: images carry width/height attributes for CLS, which
   map to presentation hints. Without an explicit auto height, a constrained
   width leaves the attribute height in force and the image renders stretched.
   Component rules that set a real height still win on specificity. */
:where(img[width][height]) {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--color-primary);
  color: var(--color-primary-on);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
