/* ============================================================================
   AI Web Hosting — one-pager
   Paper and ink do the work. Sand appears only as hairlines and eyebrows,
   canopy only on hover and in the horizon rule's active state. No gradients.
   ========================================================================= */

/* ── Fonts (self-hosted, latin subset) ───────────────────────────────────── */
@font-face {
  font-family: 'Archivo Expanded';
  src: url('../fonts/archivo-expanded-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Newsreader';
  src: url('../fonts/newsreader-var.woff2') format('woff2-variations'),
       url('../fonts/newsreader-var.woff2') format('woff2');
  font-weight: 400 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Martian Mono';
  src: url('../fonts/martianmono-300.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --paper:  #F4F6F5;   /* cool near-white — page ground */
  --silver: #D9DEE0;   /* tunnel concrete — panels, hairlines */
  --haze:   #A9BCC7;   /* far mountains — decorative only, never text on paper */
  --ink:    #1A2124;   /* text, dark sections, primary button */
  --canopy: #5C9A3E;   /* metasequoia green — the rule's active state */
  --sand:   #C9A97C;   /* Biwa shoreline — thin rules, focus ring */

  /* Text-safe darkenings. Ratios on --paper: haze 4.83, sand 4.56, canopy 4.85. */
  --haze-text:   #547080;
  --sand-text:   #8C6A3C;
  --canopy-deep: #46782F;

  /* The horizon. Every photograph is cropped so its real horizon lands here. */
  --horizon: 58%;

  --gutter: clamp(1.25rem, 5vw, 5.5rem);
  --page:   1440px;
  --pad-y:  clamp(5.5rem, 13vh, 11rem);

  --fs-display:   clamp(2.5rem, 8vw, 8.5rem);   /* floor set by "landscape." at 320px */
  --fs-figure:    clamp(2.4rem, 5.6vw, 4.75rem);
  --fs-statement: clamp(1.7rem, 3.4vw, 2.8rem);
  --fs-lede:      clamp(1.15rem, 1.5vw, 1.35rem);
  --fs-body:      1.075rem;
  --fs-mono:      0.68rem;

  --ease:  cubic-bezier(0.22, 1, 0.36, 1);
  --slow:  0.9s;
  --hairline: 1px solid var(--silver);
}

/* Lenis needs these two rules; it sets the classes itself. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, p, ol, ul, figure, figcaption, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img, picture { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Newsreader', ui-serif, Georgia, 'Times New Roman', serif;
  font-size: var(--fs-body);
  line-height: 1.65;
  font-optical-sizing: auto;
  overflow-x: hidden;
}

/* ── Typography roles ────────────────────────────────────────────────────── */
.display {
  font-family: 'Archivo Expanded', 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  font-stretch: 125%;
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-wrap: balance;
}
.mono {
  font-family: 'Martian Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-weight: 300;
  font-size: var(--fs-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.5;
}
.statement { font-size: var(--fs-statement); font-weight: 400; line-height: 1.3; letter-spacing: -0.01em; text-wrap: pretty; }
.lede      { font-size: var(--fs-lede); line-height: 1.6; text-wrap: pretty; }
.figure    { font-family: 'Archivo Expanded', 'Archivo', sans-serif; font-weight: 700; font-stretch: 125%;
             font-size: var(--fs-figure); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.eyebrow   { color: var(--sand-text); }
.index     { color: var(--haze-text); }
.caption   { color: var(--haze-text); }
.smallprint{ color: var(--haze-text); }
.wordmark  { font-family: 'Martian Mono', ui-monospace, monospace; font-weight: 300;
             font-size: var(--fs-mono); letter-spacing: 0.2em; text-transform: uppercase; }

/* Links: underline draws in on hover. */
a { color: inherit; text-decoration: none; }
.nav__links a, .footer a, .contact__direct a, .field__note a {
  background-image: linear-gradient(var(--canopy-deep), var(--canopy-deep));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size var(--slow) var(--ease), color var(--slow) var(--ease);
}
.nav__links a:hover, .footer a:hover, .contact__direct a:hover {
  background-size: 100% 1px;
  color: var(--canopy-deep);
}

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

.skip {
  position: absolute; left: 0; top: 0; z-index: 200;
  padding: 0.9rem 1.2rem; background: var(--ink); color: var(--paper);
  font-family: 'Martian Mono', monospace; font-size: var(--fs-mono);
  letter-spacing: 0.14em; text-transform: uppercase;
  transform: translateY(-120%);
}
.skip:focus { transform: none; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }
.section { position: relative; padding-block: var(--pad-y); }

.grid-2 { display: grid; gap: 0; grid-template-columns: 1fr; margin-top: clamp(3rem, 6vw, 5rem); }
.grid-2 > li { padding-block: clamp(2rem, 4vw, 3rem); border-top: var(--hairline); }
.grid-2 .lede { margin-block: 0.65rem 0.85rem; font-weight: 500; }
.grid-2 p:last-child { max-width: 46ch; color: var(--ink); }

.grid-3 { display: grid; gap: clamp(2.5rem, 5vw, 4rem); grid-template-columns: 1fr; align-items: end; }
.grid-3 .index { margin-top: 0.9rem; padding-top: 0.9rem; border-top: var(--hairline); }
.smallprint { grid-column: 1 / -1; margin-top: clamp(1.5rem, 3vw, 2.5rem); }

/* ── The horizon rule ────────────────────────────────────────────────────── */
.horizon {
  position: absolute; left: 0; right: 0; top: var(--horizon);
  height: 1px; background: var(--silver);
  transform-origin: left center;
  pointer-events: none; z-index: 2;
}
.horizon--edge { top: 0; }

.js-anim .horizon { transform: scaleX(0); }
.js-anim .horizon.is-in { animation: draw var(--slow) var(--ease) forwards, warm 2.2s ease 0.25s; }
@keyframes draw { to { transform: scaleX(1); } }
@keyframes warm {
  0%, 45% { background: var(--canopy); }
  100%    { background: var(--silver); }
}

/* ── Image frames: aspect matches the crop, so the horizon lands true ───── */
.frame { position: relative; overflow: hidden; background: var(--silver); }
.frame picture { display: block; width: 100%; height: 100%; }
.frame img { width: 100%; height: 100%; object-fit: cover; object-position: center var(--horizon); }
.frame--portrait { aspect-ratio: 3 / 4; }
.frame--wide     { aspect-ratio: 16 / 9; }
.frame--band     { aspect-ratio: 1600 / 686; }

/* the monogrid move: masked reveal, image settles from 1.08 */
.js-anim .frame img { transform: scale(1.08); transition: transform 1.4s var(--ease), opacity 1.1s var(--ease); opacity: 0; }
.js-anim [data-reveal].is-in .frame img,
.js-anim .frame.is-in img { transform: none; opacity: 1; }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 60;
  transition: transform 0.55s var(--ease), background-color 0.55s var(--ease),
              border-color 0.55s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav__bar {
  width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto;
  display: flex; align-items: center; gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: clamp(1.1rem, 2.2vw, 1.6rem);
}
.nav__links { display: flex; gap: clamp(1.25rem, 2.5vw, 2.25rem); margin-left: auto; }
.nav__links a { font-family: 'Martian Mono', monospace; font-weight: 300;
                font-size: var(--fs-mono); letter-spacing: 0.14em; text-transform: uppercase; }
.nav.is-stuck { background: color-mix(in srgb, var(--paper) 86%, transparent); border-bottom-color: var(--silver); }
@supports (backdrop-filter: blur(1px)) { .nav.is-stuck { backdrop-filter: blur(14px) saturate(1.1); } }
.nav.is-hidden { transform: translateY(-105%); }

/* ── Pills ───────────────────────────────────────────────────────────────── */
.pill {
  display: inline-block; padding: 0.85em 1.6em;
  font-family: 'Martian Mono', monospace; font-weight: 300;
  font-size: var(--fs-mono); letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid var(--ink); border-radius: 100px; background: transparent; color: var(--ink);
  cursor: pointer;
  transition: background-color 0.55s var(--ease), color 0.55s var(--ease),
              border-color 0.55s var(--ease), transform 0.4s var(--ease);
}
.pill--solid { background: var(--ink); color: var(--paper); }
.pill:hover, .pill:focus-visible {
  background: var(--canopy-deep); border-color: var(--canopy-deep); color: var(--paper);
}
.pill[disabled] { opacity: 0.45; pointer-events: none; }

/* ── Intro overlay ───────────────────────────────────────────────────────── */
.intro {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: var(--paper); place-items: center;
}
.has-intro .intro { display: grid; }
.intro__inner { display: grid; gap: 1.1rem; justify-items: center; text-align: center; }
.intro__line { font-size: var(--fs-lede); color: var(--haze-text); }
.intro.is-out { opacity: 0; transition: opacity 0.85s var(--ease); pointer-events: none; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
/* Grid, not flex: on mobile the caption joins the flow as a second row rather
   than becoming a sibling column that eats the content's gutter. */
.hero {
  position: relative; min-height: 100svh; display: grid; align-content: end;
  padding-block: clamp(6rem, 12vh, 9rem) clamp(3.5rem, 8vh, 6rem);
  overflow: hidden; isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__frame { position: absolute; inset: 0; }
.hero__frame picture, .hero__frame img { width: 100%; height: 100%; }
.hero__frame img { object-fit: cover; object-position: center var(--horizon); }

/* scroll pushes forward and washes out into the manifesto */
.js-anim .hero__frame {
  transform: scale(1.1); will-change: transform;
  transition: transform 1.4s var(--ease);
}
.hero__wash { position: absolute; inset: 0; background: var(--paper); opacity: var(--hero-wash, 0); pointer-events: none; }

/* the page's one looping element */
.hero__haze { position: absolute; inset: -20%; pointer-events: none; opacity: 0; }
.js-anim .hero__haze {
  opacity: 0.05;
  background: radial-gradient(45% 35% at 30% 45%, #fff 0%, transparent 70%),
              radial-gradient(40% 30% at 72% 60%, #fff 0%, transparent 70%);
  animation: drift 70s linear infinite;
}
@keyframes drift {
  0%   { transform: translate3d(-3%, 1%, 0); }
  50%  { transform: translate3d(3%, -2%, 0); }
  100% { transform: translate3d(-3%, 1%, 0); }
}

/* The rule threads the hero behind the type — never across it, which would
   read as a strikethrough once the headline stacks on narrow screens. */
.hero > .horizon { z-index: 0; }
.hero__content, .hero__caption { position: relative; z-index: 1; }

.hero__content { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }
.hero__title { font-size: var(--fs-display); max-width: 15ch; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero__title .line > span { display: block; }
.js-anim .hero__title .line > span { transform: translateY(112%); }
.js-anim .hero.is-in .hero__title .line > span { transform: none; transition: transform 1s var(--ease); }
.js-anim .hero.is-in .hero__title .line:nth-child(2) > span { transition-delay: 0.08s; }
.js-anim .hero.is-in .hero__title .line:nth-child(3) > span { transition-delay: 0.16s; }
.js-anim .hero.is-in .hero__title .line:nth-child(4) > span { transition-delay: 0.24s; }

.hero__sub { margin-top: clamp(1.5rem, 3vw, 2.25rem); font-size: var(--fs-lede); max-width: 34ch; }
.hero__cta { margin-top: clamp(1.75rem, 3vw, 2.5rem); }
.js-anim [data-hero-late] { opacity: 0; }
.js-anim .hero.is-in [data-hero-late] { opacity: 1; transition: opacity 1s var(--ease) 0.5s; }

.hero__caption {
  position: absolute; left: var(--gutter); bottom: clamp(1rem, 2.5vh, 1.75rem);
  color: var(--ink);
}
.hero__hint {
  position: absolute; right: var(--gutter); bottom: 0; width: 1px; height: clamp(3rem, 8vh, 5.5rem);
  background: var(--ink); opacity: 0.35; transform-origin: bottom;
}
.js-anim .hero__hint { animation: hint 3.4s var(--ease) infinite; }
@keyframes hint {
  0%, 100% { transform: scaleY(0.35); opacity: 0.15; }
  50%      { transform: scaleY(1);    opacity: 0.35; }
}

/* ── Manifesto ───────────────────────────────────────────────────────────── */
.manifesto { padding-block: clamp(7rem, 20vh, 15rem); }
.manifesto .wrap { display: grid; justify-items: center; text-align: center; gap: clamp(2rem, 4vw, 3rem); }
.manifesto .statement { max-width: 30ch; }

/* ── Break I: split ──────────────────────────────────────────────────────── */
.split__grid { display: grid; gap: clamp(2.5rem, 6vw, 5rem); grid-template-columns: 1fr; }
.split__text { display: grid; gap: clamp(1.25rem, 2.5vw, 2rem); align-content: start; }
.split__text .lede { max-width: 42ch; }
.split__figure { display: grid; gap: 1rem; justify-items: start; }
.split__figure .frame { width: 100%; }
/* the caption settles just after its image — but only when JS is driving it,
   so with JS off it is simply there */
.js-anim .split__figure figcaption { opacity: 0; transform: translateY(8px); }
.js-anim .split__figure.is-in figcaption {
  opacity: 1; transform: none;
  transition: opacity 0.9s var(--ease) 0.45s, transform 0.9s var(--ease) 0.45s;
}

/* ── Break II: the ink band ──────────────────────────────────────────────── */
.band { background: var(--ink); color: var(--paper); padding-block: 0 clamp(4rem, 9vw, 7rem); }
.band .frame { background: var(--ink); }

/* Parallax slack. Height 110% with a -5.8% offset puts the photograph's own
   horizon at exactly 58% of the frame when the translate is 0 — which is when
   the block is centred in the viewport. ±3% of travel stays inside the slack. */
.js-anim .band .frame--wide picture { height: 110%; margin-top: -5.8%; will-change: transform; }
.band__foot { margin-top: clamp(3rem, 7vw, 5.5rem); display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); }
.band__line { font-size: var(--fs-statement); line-height: 1.3; color: var(--haze); max-width: 34ch; text-wrap: pretty; }
.band__caption { color: var(--haze); }
.band .horizon { background: color-mix(in srgb, var(--paper) 55%, transparent); }
.js-anim .band .horizon.is-in { animation: draw var(--slow) var(--ease) forwards, warm-dark 2.2s ease 0.25s; }
@keyframes warm-dark {
  0%, 45% { background: var(--canopy); }
  100%    { background: color-mix(in srgb, var(--paper) 55%, transparent); }
}

/* ── Contact ─────────────────────────────────────────────────────────────── */
.contact { padding-block: 0 var(--pad-y); }
.contact__grid { margin-top: clamp(3.5rem, 8vw, 6rem); display: grid; gap: clamp(3rem, 7vw, 5rem); grid-template-columns: 1fr; }
.contact__head { display: grid; gap: clamp(1rem, 2vw, 1.5rem); align-content: start; }
.contact__title { font-size: clamp(2.6rem, 6vw, 5rem); }
.contact__head .lede { max-width: 32ch; }
.contact__direct { margin-top: 0.5rem; }

.form { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); }
.field { display: grid; gap: 0.6rem; }
.field label { color: var(--haze-text); }
.field .opt { text-transform: none; letter-spacing: 0.06em; }
.field input, .field textarea {
  width: 100%; padding: 0.7rem 0 0.8rem;
  background: transparent; border: 0; border-bottom: 1px solid var(--silver);
  font-size: var(--fs-body); color: var(--ink); border-radius: 0;
  transition: border-color 0.5s var(--ease);
}
.field textarea { resize: vertical; min-height: 7.5rem; }
.field input:hover, .field textarea:hover { border-bottom-color: var(--haze); }
.field input:focus, .field textarea:focus { outline: 0; border-bottom-color: var(--ink); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--sand); outline-offset: 4px; }
.field__note { font-family: 'Martian Mono', monospace; font-weight: 300; font-size: var(--fs-mono);
               letter-spacing: 0.1em; color: var(--sand-text); min-height: 1.2em; }
.field.is-bad input, .field.is-bad textarea { border-bottom-color: var(--sand-text); }

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

.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(1rem, 2.5vw, 1.75rem); }
.form__status { color: var(--haze-text); }
.form__status.is-ok  { color: var(--canopy-deep); }
.form__status.is-bad { color: var(--sand-text); }
.form.is-sent { opacity: 0.55; transition: opacity 0.7s var(--ease); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer { position: relative; padding-block: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 4vw, 3rem); }
.footer__grid { display: grid; gap: clamp(1rem, 2.5vw, 1.5rem); }
.footer p { color: var(--haze-text); }
.footer__social, .footer__legal { display: flex; flex-wrap: wrap; gap: clamp(1rem, 2.5vw, 1.75rem); }

/* ── Scroll reveals ──────────────────────────────────────────────────────── */
.js-anim [data-reveal] { opacity: 0; transform: translateY(24px); }
.js-anim [data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
}

/* ── Breakpoints ─────────────────────────────────────────────────────────── */
@media (min-width: 700px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); column-gap: clamp(2.5rem, 6vw, 6rem); }
  .grid-2 > li:nth-child(-n+2) { border-top: var(--hairline); }
  .split__grid { grid-template-columns: 1fr minmax(0, 40%); align-items: center; }
  .split__figure { justify-self: end; width: min(100%, 460px); }
  .contact__grid { grid-template-columns: 1fr 1fr; gap: clamp(3rem, 8vw, 7rem); }
  .footer__grid { grid-template-columns: auto auto 1fr auto; align-items: baseline; }
  .footer__legal { justify-content: flex-end; }
}
@media (max-width: 899.98px) {
  .nav__links { display: none; }
  .nav__bar { justify-content: space-between; }
  .hero__title { max-width: 12ch; }
  .hero__caption { position: static; margin: clamp(2rem, 5vh, 3rem) auto 0;
                   width: min(100% - 2 * var(--gutter), var(--page)); }
  .hero__hint { display: none; }
}

/* ── Reduced motion: nothing moves, nothing loops, no intro ─────────────── */
@media (prefers-reduced-motion: reduce) {
  .intro, .has-intro .intro { display: none !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
  .hero__frame, .frame img { transform: none !important; }
  .hero__haze { display: none; }
  .hero__hint { animation: none; transform: none; }
  [data-reveal], [data-hero-late], .split__figure figcaption { opacity: 1 !important; transform: none !important; }
  .horizon { transform: none !important; }
}
.is-still .hero__frame, .is-still .frame img { transform: none; }
.is-still .hero__haze, .is-still .intro { display: none; }
