/* timolabs.co · one liquid drop becomes a product.
   Desktop layout = the approved Figma storyboard (1440 × 900 frames), scaled to fit the viewport:
   every element is placed in design units (--x, --y, --w, --h) times --u. Mobile stacks each chapter. */

@font-face {
  font-family: "Clash Grotesk";
  src: url(../fonts/clash-grotesk-600.woff2) format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url(../fonts/inter-tight-var.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --black: #000000;
  --night: #0A0A12;
  --graphite: #16161E;
  --slate: #2A2A35;
  --fog: #8A8A99;
  --white: #FFFFFF;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* one design unit: the 1440 × 900 frame fitted inside the viewport */
  --u: min(calc(100vw / 1440), calc(100svh / 900));
}

* { box-sizing: border-box; }
html { background: var(--black); color: var(--white); }
html, body { margin: 0; }
body {
  font-family: "Inter Tight", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img { display: block; }

/* ---------- layers: grid (behind) · liquid canvas · content ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to bottom, color-mix(in srgb, var(--graphite) 80%, transparent) 1px, transparent 1px),
    linear-gradient(to right, color-mix(in srgb, var(--graphite) 80%, transparent) 1px, transparent 1px);
  background-size: calc(48 * var(--u)) calc(48 * var(--u));
  background-position: center;
  opacity: var(--grid, 0);
}
#liquid {
  position: fixed; inset: 0; z-index: 0;
  width: 100vw; height: 100vh; height: 100svh;
  display: block; pointer-events: none;
}
main, .nav, .dots { position: relative; z-index: 1; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(20 * var(--u)) calc(80 * var(--u));
  padding-top: max(calc(20 * var(--u)), env(safe-area-inset-top));
}
/* after the hero, content scrolling under the nav fades out instead of colliding with the logo
   (not on the hero itself: the drop hangs from the top edge there) */
.nav::before {
  content: ""; position: absolute; inset: 0 0 -24px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgb(0 0 0 / .94) 0%, rgb(0 0 0 / .8) 55%, rgb(0 0 0 / 0) 100%);
  opacity: var(--navbg, 0); transition: opacity .4s var(--ease);
}
.nav-logo img { height: max(22px, calc(28 * var(--u))); width: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: max(40px, calc(48 * var(--u)));
  padding: 0 calc(24 * var(--u)); padding-inline: max(16px, calc(24 * var(--u)));
  border-radius: 999px; background: var(--white); color: var(--night);
  font: 500 max(14px, calc(16 * var(--u)))/1 "Inter Tight", system-ui, sans-serif;
  text-decoration: none; letter-spacing: -0.01em;
  transition: transform .3s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

/* ---------- chapter dots ---------- */
.dots {
  position: fixed; z-index: 10; right: calc(46 * var(--u)); top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: calc(16 * var(--u));
}
.dots button {
  width: 14px; height: 14px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.dots button::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--slate);
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.dots button[aria-current="step"]::before { background: var(--white); transform: scale(1.35); }

/* ---------- chapters: pinned panels ---------- */
.chapter { position: relative; height: 180vh; height: 180svh; }
.chapter-last { height: 100vh; height: 100svh; }
/* the contact chapter sits on the bottom edge on tall screens instead of floating mid-screen */
.chapter-last .panel { place-items: end center; }
.panel {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: grid; place-items: center;
}
.frame { position: relative; width: calc(1440 * var(--u)); height: calc(900 * var(--u)); }
.frame > * {
  position: absolute; margin: 0;
  left: calc(var(--x, 0) * var(--u));
  top: calc(var(--y, 0) * var(--u));
}
.frame > [style*="--w"] { width: calc(var(--w) * var(--u)); }

/* ---------- type ---------- */
.h-hero, .h-ch, .h-foot {
  font-family: "Clash Grotesk", "Helvetica Neue", Arial, sans-serif; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1; margin: 0;
}
.h-hero { font-size: calc(96 * var(--u)); }
.h-ch { font-size: max(28px, calc(56 * var(--u))); }
.h-foot { font-size: max(32px, calc(64 * var(--u))); }
.fog { color: var(--fog); }
.label {
  font-size: max(14px, calc(16 * var(--u))); font-weight: 500; line-height: 1.3;
  letter-spacing: 0.02em; text-transform: uppercase; color: var(--fog);
}
.body {
  font-size: max(16px, calc(20 * var(--u))); line-height: 1.5; letter-spacing: -0.01em;
  color: var(--fog);
}
.scroll-cue {
  font-size: max(12px, calc(14 * var(--u))); font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fog);
  opacity: calc(1 - var(--p0, 0) * 3);
}

/* scroll-scrubbed reveal: --in (0 → 1) is set per chapter by main.js */
.reveal {
  opacity: var(--in, 1);
  translate: 0 calc((1 - var(--in, 1)) * 24px);
}
.late { opacity: var(--late, 1); transition: opacity .2s linear; }

/* ---------- stages: where the drop lives ---------- */
.stage { width: calc(var(--w) * var(--u)); height: calc(var(--h) * var(--u)); }
.fallback {
  position: absolute; inset: -12%; width: 124%; height: 124%;
  object-fit: contain; opacity: 0; pointer-events: none;
  mix-blend-mode: screen; /* renders sit on black, so black drops out */
}
.stage-hero .fallback { inset: 0; width: 100%; height: 100%; }

/* hero tags: approved Pro-banner copy */
.hero-tags { display: flex; flex-wrap: wrap; gap: calc(12 * var(--u)); }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: calc(9 * var(--u)) calc(16 * var(--u)); padding-inline: max(12px, calc(16 * var(--u)));
  border: 1px solid rgb(255 255 255 / .28); border-radius: 999px;
  font-size: max(12px, calc(14 * var(--u))); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--white); white-space: nowrap;
}
.stage-pill .fallback, .stage-abc .fallback { inset: -40% -6%; width: 112%; height: 180%; }
.stage-panel .fallback { inset: -6%; width: 112%; height: 112%; }
.no-gl .fallback, .gl-warming .fallback { opacity: 1; }
.no-gl #liquid { display: none; }
.gl-warming #liquid { opacity: 0; }
#liquid, .fallback { transition: opacity .6s var(--ease); }

/* Craft: the pill as if selected in a design tool */
.select { position: absolute; inset: 0; border: 1px solid rgb(255 255 255 / .7); }
.select i {
  position: absolute; width: 8px; height: 8px; background: var(--white); border: 1px solid var(--black);
}
.select i:nth-child(1) { left: -4px; top: -4px; }
.select i:nth-child(2) { right: -4px; top: -4px; }
.select i:nth-child(3) { left: -4px; bottom: -4px; }
.select i:nth-child(4) { right: -4px; bottom: -4px; }

.tag {
  position: absolute; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; background: var(--white); color: var(--night);
  font-size: max(12px, calc(14 * var(--u))); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
.tag-size { left: 50%; top: calc(100% + 16 * var(--u)); translate: -50% 0; border-radius: 6px; }
.tag-kept { left: 50%; top: calc(100% + 46 * var(--u)); translate: -50% 0; }
.tag-live { left: calc(44 * var(--u)); top: calc(30 * var(--u)); }
.tag-live b { width: 6px; height: 6px; border-radius: 50%; background: var(--night); }

/* Experiment: A / B / C under the three variants */
.variant {
  position: absolute; top: calc(100% + 12 * var(--u)); left: calc(var(--at) * 1%); translate: -50% 0;
  font-size: max(14px, calc(16 * var(--u))); font-weight: 500; color: var(--fog);
}
.variant-kept { color: var(--white); }

/* ---------- contact ---------- */
.contact { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); }
.email {
  justify-self: start;
  font-family: "Clash Grotesk", "Helvetica Neue", Arial, sans-serif; font-weight: 600;
  font-size: max(22px, calc(32 * var(--u))); letter-spacing: -0.01em; text-decoration: none;
  padding-bottom: calc(6 * var(--u)); border-bottom: 1.5px solid rgb(255 255 255 / .4);
  transition: border-color .3s var(--ease);
}
.email:hover { border-color: var(--white); }
.follow {
  margin: calc(58 * var(--u)) 0 calc(14 * var(--u));
  font-family: "Clash Grotesk", "Helvetica Neue", Arial, sans-serif; font-weight: 600;
  font-size: max(20px, calc(24 * var(--u))); letter-spacing: -0.01em;
}
.socials { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: calc(28 * var(--u)); }
.socials a {
  font-size: max(16px, calc(20 * var(--u))); color: var(--fog); text-decoration: none;
  transition: color .3s var(--ease);
}
.socials a:hover { color: var(--white); }
.foot {
  left: calc(80 * var(--u)); right: calc(80 * var(--u));
  display: flex; align-items: center; justify-content: space-between;
  padding-top: calc(33 * var(--u)); border-top: 1px solid var(--slate);
}
.foot img { height: max(20px, calc(24 * var(--u))); width: auto; }
.foot small { font-size: max(14px, calc(16 * var(--u))); color: var(--fog); }

/* ---------- mobile: stack each chapter ---------- */
@media (max-width: 767px), (max-aspect-ratio: 4/5) {
  :root { --u: calc(100vw / 390); }
  .nav { padding: 16px 20px; padding-top: max(16px, env(safe-area-inset-top)); }
  .dots { right: 6px; gap: 10px; }
  .frame {
    width: 100%; height: 100%;
    display: flex; flex-direction: column; gap: 14px;
    padding: 96px 20px max(28px, env(safe-area-inset-bottom));
  }
  .frame > * { position: relative; left: auto; top: auto; width: auto !important; }
  .stage { order: 2; flex: 1 1 auto; width: 100% !important; height: auto; min-height: 30svh; }
  .stage-pill { flex: 0 0 auto; align-self: center; width: 88% !important; aspect-ratio: 480 / 130; min-height: 0; margin: auto 0; }
  .stage-abc { flex: 0 0 auto; aspect-ratio: 620 / 160; min-height: 0; margin: auto 0 calc(64px) ; }
  .stage-panel { flex: 0 0 auto; aspect-ratio: 700 / 464; min-height: 0; margin: auto 0; }
  .label { order: 0; }
  .h-ch { order: 1; font-size: 36px; }
  .body { order: 3; font-size: 17px; }
  .h-hero { order: 3; font-size: 48px; }
  #hero .stage { order: 1; }
  .hero-tags { order: 0; gap: 8px; }
  .pill { font-size: 11px; padding: 7px 12px; }
  #hero .body { order: 4; }
  .scroll-cue { order: 5; transform: none; align-self: center; }
  .h-foot { order: 0; font-size: 36px; }
  /* the contact block sits at the bottom of the screen; the drop keeps its size and is centred in the
     room left between the headline and the contact block (auto margins take the free space) */
  #contact .stage { order: 1; flex: 0 0 auto; height: 24svh; min-height: 0; margin: auto 0; }
  #idea .stage { flex: 0 0 auto; height: 30svh; min-height: 0; margin: auto 0; }
  .contact { order: 2; }
  .email { font-size: 22px; overflow-wrap: anywhere; }
  .follow { margin-top: 28px; }
  .socials { gap: 8px 16px; }
  .socials a { font-size: 16px; }
  .foot { order: 3; left: auto; right: auto; padding-top: 18px; margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .chapter { height: auto; min-height: 100svh; }
  .panel { position: relative; }
  .reveal, .late { opacity: 1 !important; translate: none !important; }
}
