/* ============================================================
   ITZEL — base.css
   Reset, design tokens, typography.
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
  margin: 0;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

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

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

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

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

:root {
  /* Color — warm paper light. Itzel: sunlight through leaves on a wall.
     --accent retargets per artwork (color-theme.js). */
  --bg:           #f6f1e6;   /* warm paper cream */
  --bg-elev:      #ede5d2;   /* deeper warm cream */
  --bg-card:      #efe7d6;   /* card surface */
  --fg:           #2a241c;   /* deep warm brown — softer than black */
  --fg-strong:    #14110c;   /* near-black warm */
  --fg-muted:     #7a6e58;   /* warm taupe */
  --fg-faint:     #ada397;   /* light warm gray */
  --border:       #d8cfb9;   /* soft warm border */
  --border-strong:#bfb29a;
  --accent:       #a87a2e;   /* darker itzel gold — readable on cream */
  --accent-soft:  #a87a2e1c;
  --danger:       #a8442e;
  --success:      #5e7a3e;

  /* Type */
  --font-display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:    ui-monospace, 'JetBrains Mono', Menlo, monospace;

  /* Scale — fluid */
  --step--2: clamp(0.69rem, 0.66rem + 0.16vw, 0.78rem);
  --step--1: clamp(0.83rem, 0.79rem + 0.22vw, 0.94rem);
  --step-0:  clamp(1.00rem, 0.94rem + 0.30vw, 1.13rem);
  --step-1:  clamp(1.20rem, 1.12rem + 0.42vw, 1.35rem);
  --step-2:  clamp(1.44rem, 1.32rem + 0.59vw, 1.62rem);
  --step-3:  clamp(1.73rem, 1.55rem + 0.85vw, 1.95rem);
  --step-4:  clamp(2.07rem, 1.81rem + 1.27vw, 2.44rem);
  --step-5:  clamp(2.49rem, 2.10rem + 1.92vw, 3.05rem);
  --step-6:  clamp(2.99rem, 2.42rem + 2.84vw, 3.82rem);
  --step-7:  clamp(3.58rem, 2.77rem + 4.07vw, 4.77rem);
  --step-8:  clamp(4.30rem, 3.13rem + 5.84vw, 5.96rem);

  /* Space */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --sp-10: 9rem;

  /* Layout */
  --gutter: clamp(1.25rem, 3vw, 2.5rem);
  --maxw: 1440px;

  /* Motion */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:cubic-bezier(0.65, 0, 0.35, 1);
  --ease-art:   cubic-bezier(0.77, 0, 0.18, 1);
  --dur-fast:   200ms;
  --dur:        420ms;
  --dur-slow:   720ms;

  color-scheme: light;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  font-weight: 380;
  letter-spacing: 0.005em;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1200px 800px at 80% -10%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 60%),
    var(--bg);
  transition: background var(--dur-slow) var(--ease-out);
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 360;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--fg-strong);
  font-variation-settings: "opsz" 144, "SOFT" 30;
}

h1 { font-size: var(--step-7); }
h2 { font-size: var(--step-5); letter-spacing: -0.018em; }
h3 { font-size: var(--step-3); letter-spacing: -0.012em; }
h4 { font-size: var(--step-2); }

.display {
  font-family: var(--font-display);
  font-weight: 320;
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}

.display em,
.display .italic {
  font-style: italic;
  font-weight: 320;
  color: color-mix(in oklab, var(--accent) 80%, var(--fg-strong));
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.lede {
  font-family: var(--font-display);
  font-weight: 320;
  font-style: italic;
  font-size: var(--step-2);
  line-height: 1.35;
  color: color-mix(in oklab, var(--fg) 85%, var(--accent));
  max-width: 38ch;
}

p { max-width: 64ch; }

.kerned {
  font-feature-settings: "ss01", "ss02", "kern", "liga";
}

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

/* Focus ----------------------------------------------------- */

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

/* Utilities ------------------------------------------------- */

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-width: none;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: 880px;
}

.stack > * + * { margin-top: var(--sp-5); }
.stack-lg > * + * { margin-top: var(--sp-7); }
.stack-xl > * + * { margin-top: var(--sp-9); }

.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.accent { color: var(--accent); }

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  z-index: 1000;
  padding: var(--sp-3) var(--sp-5);
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.skip-link:focus { top: var(--sp-4); }
