/* Critter: landing page */

:root {
  --bg: #0b0c0a;
  --fg: #ecebe4;
  --fg-2: #a9a9a0;
  --line: rgba(236, 235, 228, .1);
  --accent: #f6c6d0;
  --accent-rgb: 246, 198, 208;
  --ink: #0b0c0a;

  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --pad: clamp(20px, 4vw, 56px);
  --max: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--ink); }
a { color: inherit; text-decoration: none; }
svg, canvas { display: block; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

.skip {
  position: fixed; left: 16px; top: -80px; z-index: 200;
  padding: 10px 14px; border-radius: 8px; background: var(--fg); color: var(--ink);
}
.skip:focus { top: 16px; }

/* Page-wide background field, fixed behind everything. Content sits above it. */
.field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block; }
main, .footer { position: relative; z-index: 1; }

/* Transition curtain */
.curtain { position: fixed; inset: 0; z-index: 110; display: flex; pointer-events: none; }
.curtain.is-in { pointer-events: auto; }
.curtain-col {
  flex: 1; height: 100%; background: #121311; box-shadow: inset 1px 0 0 var(--line);
  transform: scaleY(0); transform-origin: 50% 100%;
  transition: transform .7s var(--ease-io);
  transition-delay: calc(var(--i) * 45ms);
}
.curtain.is-in .curtain-col { transform: scaleY(1); }
.curtain.is-in.is-out .curtain-col { transform: scaleY(0); transform-origin: 50% 0; }
.curtain-title {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--fg); font-size: clamp(40px, 6vw, 88px); line-height: 1; font-weight: 500; letter-spacing: -.02em;
  opacity: 0; transform: translateY(24px); transition: opacity .3s, transform .3s;
}
.curtain.is-in .curtain-title { opacity: 1; transform: none; transition: opacity .5s .4s, transform .9s .4s var(--ease-out); }
.curtain.is-in.is-out .curtain-title { opacity: 0; transform: translateY(-24px); transition: opacity .25s, transform .4s var(--ease-io); }
/* Arriving from another page: the curtain starts closed, then main.js lifts it. */
.arriving .curtain-col { transform: scaleY(1); transition: none; }
.arriving .curtain-title { opacity: 1; transform: none; transition: none; }
.curtain.no-anim .curtain-col, .curtain.no-anim .curtain-title { transition: none !important; }

/* Nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 60; transition: transform .7s var(--ease-out); }
.nav.is-hidden { transform: translateY(-120%); }
/* Soft fade behind the nav once the page has scrolled, so it never sits on top of text. */
.nav::before {
  content: ""; position: absolute; inset: 0 0 -48px; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(11, 12, 10, .92), rgba(11, 12, 10, .6) 60%, rgba(11, 12, 10, 0));
  opacity: 0; transition: opacity .5s;
}
.nav.is-scrolled::before { opacity: 1; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 24px; }
.brand { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.nav-links { display: flex; gap: 28px; font-size: 15px; }
.nav-links a { color: var(--fg-2); transition: color .3s; }
.nav-links a:hover, .nav-links a.is-active { color: var(--fg); }

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; justify-self: start;
  height: 46px; padding: 0 20px; border-radius: 6px;
  background: var(--fg); color: var(--ink); font-size: 15px; font-weight: 500;
  transition: background .3s;
}
.btn:hover { background: var(--accent); }
.btn[aria-disabled="true"] { background: transparent; color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--line); cursor: default; }
.btn[aria-disabled="true"]:hover { background: transparent; }

/* Shorter hero for inner pages */
.hero.hero-page { height: auto; min-height: 78vh; min-height: 78svh; }
.hero-page .hero-inner { min-height: inherit; height: auto; }

/* Hero */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; }
.hero-inner {
  position: relative; height: 100%;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 32px;
  padding-top: 120px; padding-bottom: clamp(40px, 8vh, 80px);
  pointer-events: none;
}
.hero-inner a { pointer-events: auto; }
.hero-title { font-size: clamp(40px, 5.4vw, 84px); line-height: 1.02; letter-spacing: -.025em; font-weight: 500; }
.line { display: block; overflow: hidden; padding: 0 .12em .1em 0; margin-bottom: -.1em; }
.line-in { display: block; }
.w { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; }
.js .hero-title .ch { transform: translateY(115%); }
.js.is-ready .hero-title .ch {
  transform: none;
  transition: transform 1.2s var(--ease-out);
  transition-delay: calc(var(--i) * 16ms);
}
.hero-aside { display: grid; gap: 24px; max-width: 440px; color: var(--fg-2); }
.js [data-intro] { opacity: 0; transform: translateY(14px); }
.js.is-ready [data-intro] { opacity: 1; transform: none; transition: opacity 1s .6s, transform 1.2s .6s var(--ease-out); }

/* Chapters: every section shares one grid. The head (label + heading) pins in the left column
   while the section's content scrolls past on the right, and is pushed out by the next one. */
.section { position: relative; min-height: 80vh; padding: clamp(100px, 13vh, 170px) 0; }
.chapter { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 40px clamp(40px, 6vw, 104px); align-items: start; }
.chapter-head { position: sticky; top: 120px; display: grid; gap: 18px; }
.chapter-body { display: grid; gap: clamp(56px, 7vw, 96px); }
.eyebrow { justify-self: start; color: var(--accent); font-size: 15px; font-weight: 500; }
.h2 { font-size: clamp(30px, 3.4vw, 48px); line-height: 1.1; letter-spacing: -.02em; font-weight: 500; }
.lede { color: var(--fg-2); font-size: clamp(18px, 1.5vw, 22px); line-height: 1.45; max-width: 46ch; }
.chapter-head .lede { font-size: 17px; max-width: 36ch; }

.manifesto { font-size: clamp(24px, 2.6vw, 38px); line-height: 1.3; letter-spacing: -.015em; max-width: 920px; }
/* Manifesto words are driven by --p (0 to 1) from scroll: they sharpen, rise and brighten. */
.manifesto .sw { display: inline-block; }
.js .manifesto .sw {
  opacity: calc(.14 + .86 * var(--p, 0));
  filter: blur(calc((1 - var(--p, 0)) * 5px));
  transform: translateY(calc((1 - var(--p, 0)) * .22em));
}

.grid { display: grid; gap: 44px 36px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.item { position: relative; display: grid; gap: 12px; align-content: start; }
.item h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.item p { color: var(--fg-2); font-size: 16px; }

/* Companies: soft frosted cards that let the background gradient through. The whole card is
   clickable through the link's stretched hit area. Hover lifts with `translate` so it doesn't
   fight the reveal's `transform`. */
.companies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.company {
  position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 270px; padding: 30px;
  border-radius: 18px; background: rgba(236, 235, 228, .035);
  box-shadow: inset 0 1px 0 rgba(236, 235, 228, .07);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.js .company[data-reveal] { transition: opacity .9s, transform 1.1s var(--ease-out), translate .6s var(--ease-out), background .5s; transition-delay: calc(var(--d, 0) * 90ms), calc(var(--d, 0) * 90ms), 0s, 0s; }
.company:hover { translate: 0 -4px; background: rgba(var(--accent-rgb), .07); }
.company-domain { color: var(--accent); font-size: 14px; font-weight: 500; }
.company h3 { font-size: clamp(24px, 2.2vw, 30px); font-weight: 500; letter-spacing: -.02em; }
.company p { color: var(--fg-2); max-width: 44ch; }
.company-link { margin-top: auto; padding-top: 18px; display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--fg); transition: color .4s; }
.company-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.company-link .arrow { display: inline-block; transition: transform .6s var(--ease-out); }
.company:hover .company-link { color: var(--accent); }
.company:hover .arrow { transform: translate(3px, -3px); }
.company-soon { color: var(--fg-2); }

/* Reveal states */
.js [data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity .9s, transform 1.1s var(--ease-out); transition-delay: calc(var(--d, 0) * 90ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.mask { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .1em .12em 0; margin: 0 -.1em -.12em 0; }
.mask > .wi { display: inline-block; }
.js [data-split] .wi { transform: translateY(110%); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i) * 50ms); }
.js [data-split].is-in .wi { transform: none; }

/* Footer */
.footer { margin-top: clamp(40px, 6vw, 80px); }
.footer-inner { padding-top: 28px; padding-bottom: 28px; color: var(--fg-2); font-size: 15px; }

/* Responsive */
@media (max-width: 960px) {
  .chapter { grid-template-columns: 1fr; }
  .chapter-head { position: static; }
  .section { min-height: 0; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .companies { grid-template-columns: 1fr; }
  .company { min-height: 0; padding: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; transition-delay: 0s !important; }
  .js .manifesto .sw { --p: 1; }
}
