/* Dark theme: tinted neutrals + OKLCH (no pure black / flat gray). Spacing: 4-based, tuned for laptop. */

:root {
  color-scheme: dark;

  /* Surfaces — warm hue ~58 ties to bronze accent */
  --bg: oklch(17% 0.012 58);
  --bg-elevated: oklch(21% 0.014 58);
  --line: oklch(32% 0.018 58);

  /* Text */
  --text: oklch(93% 0.012 58);
  --text-muted: oklch(72% 0.022 58);
  --text-subtle: oklch(58% 0.02 58);

  /* Accent — rare, for emphasis + CTA hover */
  --accent: oklch(72% 0.09 68);
  --accent-dim: oklch(52% 0.06 62);

  /* Spacing (4pt-ish scale) — laptop-first clamps */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-6: 1.5rem; /* 24px */
  --space-8: 2rem; /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem; /* 48px */
  /* Horizontal padding: fluid + never inside display cutouts (notch / home indicator) */
  --pad-x: clamp(1.25rem, 4vw + 0.5rem, 3rem);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --pad-x-safe: max(var(--pad-x), var(--safe-left));
  --pad-x-safe-end: max(var(--pad-x), var(--safe-right));
  --pad-y-hero: clamp(3rem, min(12vh, 7rem), 6.5rem);
  --pad-y-footer: clamp(2.5rem, 6vh, 4rem);
  /* Hero measure: ~2 balanced lines (ch = width of “0” in this font) */
  --hero-headline-max: min(100%, 28ch);
  --hero-lead-max: min(100%, 48ch);
  --page-max: 52rem;

  --font-serif: "Instrument Serif", Georgia, serif;
  --font-sans: "Manrope", system-ui, sans-serif;
  --font-mono: "Reddit Mono", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(
      1000px 520px at 88% -8%,
      oklch(28% 0.05 62 / 0.35),
      transparent 55%
    ),
    radial-gradient(
      800px 480px at -10% 105%,
      oklch(24% 0.04 55 / 0.25),
      transparent 50%
    );
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip:focus {
  left: var(--space-4);
  top: var(--space-4);
  width: auto;
  height: auto;
  padding: var(--space-3) var(--space-4);
  background: var(--text);
  color: var(--bg);
  z-index: 100;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, var(--page-max));
  margin-inline: auto;
  padding: var(--space-4) var(--pad-x-safe-end) var(--space-4) var(--pad-x-safe);
  background: transparent;
  border-bottom: none;
}

.wordmark {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: clamp(1.05rem, 1.1rem + 0.2vw, 1.2rem);
}

.wordmark-pun {
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
}

.stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, var(--page-max));
  margin-inline: auto;
  padding: var(--pad-y-hero) var(--pad-x-safe-end)
    calc(var(--pad-y-footer) + var(--safe-bottom)) var(--pad-x-safe);
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Vertical rhythm: one spacing token between hero blocks (Impeccable: rhythm from type) */
  gap: var(--space-8);
  min-height: min(60dvh, 32rem);
  padding-block: var(--space-6);
  width: 100%;
}

.display {
  font-family: var(--font-serif);
  font-weight: 400;
  /* Fluid display; stronger min/max contrast than body */
  font-size: clamp(2.125rem, 2.75vw + 1.1rem, 3.375rem);
  /* Light-on-dark + italic: slightly open leading (Impeccable typography ref) */
  line-height: 1.14;
  letter-spacing: -0.028em;
  margin: 0;
  max-width: var(--hero-headline-max);
  text-wrap: balance;
  text-rendering: optimizeLegibility;
}

.display em {
  font-style: italic;
  color: var(--accent);
  /* Optical: italic serif can read “heavy” on the right */
  font-feature-settings: "kern" 1;
}

.sub {
  margin: 0;
  max-width: var(--hero-lead-max);
  padding-inline: 0;
  color: var(--text-muted);
  font-weight: 500;
  /* Clear step below display: “lg” band, not near-body */
  font-size: clamp(1.0625rem, 0.35vw + 1rem, 1.1875rem);
  /* Wider measure → slightly more leading; muted on dark → +breathing room */
  line-height: 1.78;
  text-wrap: balance;
}

.btn-mail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(0.875rem, 0.2vw + 0.82rem, 0.9375rem);
  letter-spacing: 0.06em;
  padding: 1rem 1.75rem;
  min-height: 48px;
  touch-action: manipulation;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  border: 2px solid color-mix(in oklch, var(--text) 92%, var(--accent));
  box-shadow: 0 10px 36px oklch(0% 0 0 / 0.35);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .btn-mail:hover {
    background: color-mix(in oklch, var(--text) 94%, var(--accent));
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 14px 44px oklch(0% 0 0 / 0.4);
  }
}

.btn-mail:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-mail:active {
  transform: translateY(0);
}

.foot {
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-top: var(--space-10);
  margin-top: auto;
  border-top: none;
  text-align: center;
}

/* Full-bleed line; horizontal overflow clipped on `html` so `100vw` does not create a scrollbar */
.foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 1px;
  transform: translateX(-50%);
  background: var(--line);
  pointer-events: none;
}

.foot p {
  margin-block: var(--space-3);
  margin-inline: auto;
  width: 100%;
  max-width: 34rem;
  font-size: 0.9rem;
  color: var(--text-subtle);
  text-align: center;
  text-wrap: balance;
}

.foot a {
  color: var(--text-muted);
  font-weight: 600;
  text-underline-offset: 0.22em;
  /* ~44px min tap row without breaking inline flow in the sentence */
  padding: 0.7rem 0.55rem;
  margin: -0.7rem -0.35rem;
  border-radius: 0.2rem;
}

@media (hover: hover) and (pointer: fine) {
  .foot a:hover {
    color: var(--accent);
  }
}

.foot-tagline {
  margin-block: var(--space-4) 0;
  margin-inline: auto;
  width: 100%;
  max-width: 34rem;
  padding-inline: 0;
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  font-style: italic;
  line-height: 1.5;
  color: var(--text-subtle);
  text-align: center;
  text-wrap: balance;
}

/* Laptop band: slightly tighter vertical rhythm on short viewports */
@media (min-width: 1024px) and (max-height: 800px) {
  .hero {
    min-height: unset;
    padding-block: var(--space-4);
    gap: var(--space-6);
  }

  .stack {
    padding-top: clamp(2rem, 8vh, 3.5rem);
    padding-bottom: calc(var(--space-8) + var(--safe-bottom));
  }

  .foot {
    padding-top: var(--space-8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-mail {
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) and (hover: hover) and (pointer: fine) {
  .btn-mail:hover {
    transform: none;
  }
}

/* Short viewports (e.g. phone landscape): don’t reserve excessive hero height */
@media (max-height: 28rem) and (max-width: 64rem) {
  .hero {
    min-height: unset;
    padding-block: var(--space-4);
    gap: var(--space-6);
  }
}
