/* ==========================================================================
   eugeniusone.com — Design tokens + base stylesheet
   Art direction: department-store editorial. Monochrome ink on paper,
   hairline rules, wide letterspacing, generous whitespace.
   ========================================================================== */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.3rem + 2.4vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1.2rem + 4.2vw, 4.75rem);

  /* Spacing — 4px base */
  --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;

  /* Fonts — Marcellus is the closest free relative of Optima:
     humanist, flared stems, inscriptional. Switzer is the neutral
     grotesque for body and UI. */
  --font-display: 'Marcellus', Optima, 'Palatino Linotype', Georgia, serif;
  --font-body: 'Switzer', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;

  /* Letterspacing */
  --track-wide: 0.14em;
  --track-wider: 0.24em;

  /* Radius — near-square. Softness reads casual; this shouldn't. */
  --radius-sm: 1px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --radius-xl: 3px;
  --radius-full: 9999px;

  --transition-interactive: 220ms cubic-bezier(0.22, 1, 0.36, 1);

  /* Content widths */
  --content-narrow: 620px;
  --content-default: 940px;
  --content-wide: 1240px;
}

:root,
[data-theme='light'] {
  --color-bg: #ffffff;
  --color-surface: #fbfaf8;
  --color-surface-2: #ffffff;
  --color-surface-offset: #f5f4f1;
  --color-surface-offset-2: #efedea;
  --color-surface-dynamic: #e8e6e2;
  --color-divider: #e8e6e2;
  --color-border: #d8d5cf;

  --color-text: #111111;
  --color-text-muted: #6a6763;
  --color-text-faint: #a29e98;
  --color-text-inverse: #ffffff;

  /* Ink is the accent. Restraint is the point. */
  --color-primary: #111111;
  --color-primary-hover: #000000;
  --color-primary-active: #000000;
  --color-primary-highlight: #f0eeea;
  --color-on-primary: #ffffff;

  --color-success: #3f5c3a;
  --color-warning: #8a5a2b;

  --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.05);
  --shadow-md: 0 6px 20px rgba(17, 17, 17, 0.07);
  --shadow-lg: 0 18px 48px rgba(17, 17, 17, 0.1);
}

[data-theme='dark'] {
  --color-bg: #0c0c0b;
  --color-surface: #121211;
  --color-surface-2: #171716;
  --color-surface-offset: #141413;
  --color-surface-offset-2: #1b1b19;
  --color-surface-dynamic: #232320;
  --color-divider: #23231f;
  --color-border: #33322e;

  --color-text: #efedea;
  --color-text-muted: #94908a;
  --color-text-faint: #6a6660;
  --color-text-inverse: #0c0c0b;

  --color-primary: #efedea;
  --color-primary-hover: #ffffff;
  --color-primary-active: #ffffff;
  --color-primary-highlight: #1e1e1b;
  --color-on-primary: #0c0c0b;

  --color-success: #8aa77f;
  --color-warning: #c49a63;

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

/* ---------- Reset / base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-20);
}

body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition:
    background-color 260ms ease,
    color 260ms ease;
}

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

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
  line-height: 1.12;
  font-weight: 400;
}

p,
li,
figcaption {
  text-wrap: pretty;
  max-width: 66ch;
}

a {
  color: inherit;
}

::selection {
  background: var(--color-text);
  color: var(--color-bg);
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

a,
button,
[role='button'],
input,
textarea,
select {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    opacity var(--transition-interactive),
    transform var(--transition-interactive);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
