/* =========================================================
   Lor Criber — design tokens, reset and typography
   ========================================================= */

:root {
  /* Palette — light (paper) */
  --bg: #fbf7f2;
  --bg-elevated: #ffffff;
  --bg-sunken: #f3ece3;
  --ink: #191512;
  --ink-soft: #4a423b;
  --ink-muted: #7a6f66;
  --line: #e4d9cb;
  --line-strong: #cdbdaa;
  --accent: #b0501a;
  --accent-hover: #8f3f12;
  --accent-soft: #f6e6da;
  --accent-2: #4c3577;
  --gold: #a67c1f;
  --success: #2f6b4f;

  --shadow-sm: 0 1px 2px rgb(25 21 18 / 6%), 0 2px 6px rgb(25 21 18 / 4%);
  --shadow-md: 0 4px 12px rgb(25 21 18 / 8%), 0 12px 28px rgb(25 21 18 / 8%);
  --shadow-lg: 0 12px 24px rgb(25 21 18 / 10%), 0 32px 64px rgb(25 21 18 / 14%);
  --shadow-cover: 0 18px 40px rgb(25 21 18 / 26%);

  /* Type */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.34rem + 0.8vw, 2rem);
  --step-3: clamp(1.9rem, 1.6rem + 1.5vw, 2.9rem);
  --step-4: clamp(2.4rem, 1.8rem + 3vw, 4.4rem);

  /* Space & shape */
  --gutter: clamp(1.15rem, 4vw, 2.5rem);
  --measure: 68ch;
  --wrap: 1200px;
  --wrap-narrow: 780px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 160ms;
  --dur: 320ms;
  --dur-slow: 620ms;

  --header-h: 68px;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #14110f;
  --bg-elevated: #1d1917;
  --bg-sunken: #0e0c0b;
  --ink: #f4ede5;
  --ink-soft: #d3c8bd;
  --ink-muted: #9d9188;
  --line: #302a26;
  --line-strong: #4a4039;
  --accent: #ef8b4b;
  --accent-hover: #ffa66d;
  --accent-soft: #33221a;
  --accent-2: #b7a0e8;
  --gold: #d8ae4d;
  --success: #6cc196;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow-md: 0 6px 16px rgb(0 0 0 / 45%);
  --shadow-lg: 0 16px 32px rgb(0 0 0 / 50%), 0 40px 72px rgb(0 0 0 / 40%);
  --shadow-cover: 0 20px 44px rgb(0 0 0 / 60%);
  color-scheme: dark;
}

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

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

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

ul,
ol {
  list-style: none;
  padding: 0;
}

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

/* ---------- Typography ---------- */

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

h1 {
  font-size: var(--step-4);
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-2);
}
h4 {
  font-size: var(--step-1);
}

p {
  text-wrap: pretty;
}

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

/* ---------- Focus & a11y ---------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 999;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
  transform: translate(-50%, -110%);
  transition: transform var(--dur) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
}

/* ---------- Layout helpers ---------- */

.wrap {
  width: min(100% - var(--gutter) * 2, var(--wrap));
  margin-inline: auto;
}

.wrap-narrow {
  width: min(100% - var(--gutter) * 2, var(--wrap-narrow));
  margin-inline: auto;
}

.section {
  padding-block: clamp(3.5rem, 9vw, 7rem);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: '';
  width: 1.75rem;
  height: 1px;
  background: currentColor;
}

.lede {
  max-width: var(--measure);
  font-size: var(--step-1);
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ---------- Global motion policy ----------
   Every animation in this project must degrade here. */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
