/* ==========================================================================
   AIVELO — tokens, reset, typography
   Palette: noir-camel (black & camel). Motif: venetian blind slats.
   ========================================================================== */

:root {
  /* palette — fixed by the brand spec, do not drift */
  --ink: #17171a;
  --paper: #faf9f7;
  --paper-2: #edeae4;
  --deep: #17171a;
  --camel: #7e5b2a;
  --on-camel: #ffffff;
  --line: #dedad2;
  --camel-ink: #6f5024;

  /* derived */
  /* Text tokens are tuned so 13px copy clears WCAG AA (4.5:1) on BOTH
     --paper and --paper-2. Anything lighter is decoration only. */
  --ink-70: color-mix(in srgb, var(--ink) 78%, var(--paper));   /* ~7.6:1 */
  --ink-55: color-mix(in srgb, var(--ink) 72%, var(--paper));   /* ~5.7:1 */
  --ink-40: color-mix(in srgb, var(--ink) 66%, var(--paper));   /* ~5.0:1 */
  --ink-hairline: color-mix(in srgb, var(--ink) 34%, var(--paper)); /* decorative only */
  --paper-3: color-mix(in srgb, var(--paper-2) 60%, var(--paper));
  --on-deep: #f2efe9;
  --on-deep-60: color-mix(in srgb, #f2efe9 60%, var(--deep));
  --camel-soft: color-mix(in srgb, var(--camel) 14%, var(--paper));
  --camel-lift: color-mix(in srgb, var(--camel) 88%, #ffffff);
  /* small camel text on the dark ground needs ~6.8:1, not 4.3:1 */
  --camel-light: color-mix(in srgb, var(--camel) 58%, #ffffff);

  /* type */
  --display: 'Zilla Slab', 'Iowan Old Style', Georgia, serif;
  --body: 'Epilogue', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

  --fs-eyebrow: 0.6875rem;
  --fs-micro: 0.75rem;
  --fs-small: 0.8125rem;
  --fs-body: 1rem;
  --fs-lead: clamp(1.0625rem, 0.95rem + 0.45vw, 1.3125rem);
  --fs-h4: clamp(1.0625rem, 1rem + 0.35vw, 1.3125rem);
  --fs-h3: clamp(1.375rem, 1.2rem + 0.8vw, 2rem);
  --fs-h2: clamp(1.875rem, 1.4rem + 2.2vw, 3.5rem);
  --fs-h1: clamp(2.5rem, 1.5rem + 4.4vw, 5.75rem);
  --fs-mega: clamp(2.75rem, 1rem + 7.4vw, 7.75rem);

  /* rhythm — density: normal */
  --gut: clamp(1.125rem, 0.6rem + 2.2vw, 2.75rem);
  --shell: 1560px;
  --block: clamp(4.5rem, 3rem + 6vw, 9rem);
  --stack: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);

  /* shape — pill buttons, square everything else */
  --pill: 999px;
  --slat-h: 7px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

html:focus-within { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--fs-body);
  font-weight: 350;
  line-height: 1.62;
  letter-spacing: 0.002em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.021em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); letter-spacing: -0.012em; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 600; }

ul, ol { margin: 0 0 1.15em; padding-left: 1.15em; }
li { margin-bottom: 0.4em; }

hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: var(--stack) 0;
}

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

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

/* ---------- utility type ---------- */

.eyebrow {
  font-family: var(--body);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--camel-ink);
  margin: 0 0 1.1em;
  display: block;
}

.eyebrow--light { color: var(--camel-light); }
.eyebrow--muted { color: var(--ink-55); }

.lede {
  font-size: var(--fs-lead);
  line-height: 1.5;
  font-weight: 320;
  letter-spacing: -0.006em;
  max-width: 38ch;
}

.mono {
  font-family: var(--body);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.index-figure {
  font-family: var(--display);
  font-size: clamp(2.75rem, 1.5rem + 4vw, 5.5rem);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--ink-hairline);
  display: block;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  border-radius: var(--pill);
  font-size: var(--fs-small);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- the slat motif ---------- */

.slat-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(23, 23, 26, 0.34) 0,
    rgba(23, 23, 26, 0.34) 2px,
    transparent 2px,
    transparent var(--slat-h)
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

.slat-field--light {
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(250, 249, 247, 0.16) 0,
    rgba(250, 249, 247, 0.16) 2px,
    transparent 2px,
    transparent var(--slat-h)
  );
  mix-blend-mode: normal;
  opacity: 1;
}

/* three-line rule used instead of a plain border */
.slat-rule {
  display: block;
  border: 0;
  height: 9px;
  margin: 0 0 var(--stack);
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 100% 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 4px / 62% 1px no-repeat,
    linear-gradient(var(--camel), var(--camel)) 0 8px / 26% 1px no-repeat;
}

.slat-rule--light {
  background:
    linear-gradient(var(--on-deep), var(--on-deep)) 0 0 / 100% 1px no-repeat,
    linear-gradient(var(--on-deep), var(--on-deep)) 0 4px / 62% 1px no-repeat,
    linear-gradient(var(--camel-lift), var(--camel-lift)) 0 8px / 26% 1px no-repeat;
}

/* ---------- motion ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
