/* LoopMade - tokens come from DESIGN.md. No colour, size or radius outside these. */
@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --surface: #ffffff;
  --surface-tint: #f6f5f2;
  --surface-ink: #111111;
  --surface-ink-hover: #2b2b2b;
  --text: #111111;
  --text-2: #505050;
  --text-3: #767676;
  --text-off: #999999;
  --on-ink: #ffffff;
  --on-ink-2: #b5b5b5;
  --line: rgba(17, 17, 17, 0.1);
  --line-strong: rgba(17, 17, 17, 0.18);
  --line-on-ink: rgba(255, 255, 255, 0.16);
  --loop: #ff4a1c;
  --loop-ink: #b82e08;
  --loop-on-ink: #ff6b42;
  --focus: #0a5fd8;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px; --s20: 80px; --s24: 96px;
  --s32: 128px; --s40: 160px;

  --gutter: clamp(20px, 5vw, 48px);
  --content: 1200px;
  --section-gap: clamp(96px, 14vw, 176px);
  --nav-h: 64px;

  --r-sm: 8px;
  --r-md: 16px;
  --r-full: 9999px;

  --ring: 0 0 0 1px var(--line);
  --ring-strong: 0 0 0 1px var(--line-strong);
  --card: var(--ring), 0 2px 2px rgba(17, 17, 17, 0.03), 0 8px 8px -8px rgba(17, 17, 17, 0.04);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-micro: 140ms var(--ease);
  --t-std: 280ms var(--ease);
  --t-enter: 700ms var(--ease-out);

  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + var(--s6)); }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--s1); }
::selection { background: var(--surface-ink); color: var(--on-ink); }

.wrap { width: min(100% - 2 * var(--gutter), var(--content)); margin-inline: auto; }
.skip {
  position: absolute; left: var(--s4); top: var(--s4); z-index: 20;
  padding: var(--s3) var(--s4); background: var(--surface-ink); color: var(--on-ink);
  border-radius: var(--r-sm); font-size: 0.875rem; font-weight: 500;
  transform: translateY(-200%);
}
.skip:focus-visible { transform: none; }

/* Type */
.display { font-size: clamp(2.75rem, 5.2vw, 5rem); font-weight: 600; line-height: 0.98; letter-spacing: -0.045em; }
.h2 { font-size: clamp(2rem, 4.4vw, 3.5rem); font-weight: 600; line-height: 1.05; letter-spacing: -0.04em; text-wrap: balance; }
.h3 { font-size: 1.5rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.03em; }
.lead { font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.55; letter-spacing: -0.01em; color: var(--text-2); text-wrap: pretty; }
.label {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--mono); font-size: 0.75rem; font-weight: 500; line-height: 1.3;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2);
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10; height: var(--nav-h);
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 0 transparent;
  transition: box-shadow var(--t-std);
}
.nav[data-stuck="true"] { box-shadow: 0 1px 0 0 var(--line); }
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--s6); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.04em; }
.brand svg { width: 28px; height: 14px; }
.nav-links { display: flex; align-items: center; gap: var(--s1); }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3);
  font-size: 0.875rem; font-weight: 500; color: var(--text-2); border-radius: var(--r-sm);
  transition: color var(--t-micro), background-color var(--t-micro);
}
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--text); }
.nav-links a:hover { background: rgba(17, 17, 17, 0.04); }

/* Buttons */
.btn {
  --mx: 0px; --my: 0px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5);
  font: 500 0.875rem/1.45 var(--font); border: 0; border-radius: var(--r-sm); cursor: pointer;
  transform: translate(var(--mx), var(--my));
  transition: background-color var(--t-micro), box-shadow var(--t-micro), scale var(--t-micro);
}
.btn:active { scale: 0.98; }
.btn svg { width: 16px; height: 16px; transition: transform var(--t-std); }
.btn:hover svg { transform: translateX(3px); }
.btn-primary { background: var(--surface-ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--surface-ink-hover); }
.btn-ghost { background: var(--surface); color: var(--text); box-shadow: var(--ring-strong); }
.btn-ghost:hover { box-shadow: 0 0 0 1px var(--text); }
.btn-invert { background: var(--on-ink); color: var(--text); }
.btn-invert:hover { background: var(--surface-tint); }

/* Hero (cover) */
.hero { position: relative; min-height: calc(100dvh - var(--nav-h)); display: grid; align-items: center; padding-block: var(--s16) var(--s20); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s10); align-items: center; }
.hero-copy { display: grid; gap: var(--s8); justify-items: start; position: relative; z-index: 1; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.hero h1 .line > span { display: block; }
.hero .lead { max-width: 34ch; }
.cta { display: flex; flex-wrap: wrap; gap: var(--s3); }
.hero-object { position: relative; perspective: 1000px; justify-self: center; width: min(88vw, 520px); aspect-ratio: 1; }
.hero-object .tilt { width: 100%; height: 100%; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translate3d(var(--tx, 0px), var(--ty, 0px), 0); will-change: transform; }
.hero-object img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; -webkit-mask-image: radial-gradient(closest-side, #000 86%, transparent); mask-image: radial-gradient(closest-side, #000 86%, transparent); animation: float 9s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(-1.5%); } 50% { transform: translateY(1.5%); } }
.scroll-cue { position: absolute; left: 50%; bottom: var(--s6); translate: -50% 0; }
.scroll-cue .label { color: var(--text-2); }
.scroll-cue i { display: block; width: 1px; height: var(--s8); margin: var(--s2) auto 0; background: var(--line-strong); transform-origin: top; animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 0; }
  .hero h1 .line { white-space: nowrap; }
  .hero-object { width: 116%; justify-self: end; margin-right: -10%; }
}

/* Sections */
.section { padding-block: calc(var(--section-gap) / 2); }
.section-head { display: grid; gap: var(--s5); max-width: 760px; margin-bottom: var(--s16); }

/* Manifesto */
.manifesto { padding-block: var(--section-gap); }
.manifesto p { font-size: clamp(1.75rem, 4vw, 3.25rem); font-weight: 600; line-height: 1.12; letter-spacing: -0.04em; max-width: 22em; text-wrap: balance; }
.manifesto em { font-style: normal; color: var(--loop-ink); }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .manifesto p { view-timeline: --manifesto block; }
    .manifesto .w { animation: word linear both; animation-timeline: --manifesto; animation-range: cover calc(12% + var(--i) * 0.9%) cover calc(24% + var(--i) * 0.9%); }
  }
}
@keyframes word { from { opacity: 0.16; } to { opacity: 1; } }

/* Work (card-grid) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr)); gap: var(--s6); }
.card {
  --px: 50%; --py: 50%;
  position: relative; display: grid; grid-template-rows: auto 1fr; gap: var(--s5);
  padding: var(--s2) var(--s2) var(--s6); border-radius: var(--r-md); background: var(--surface);
  box-shadow: var(--card); transition: box-shadow var(--t-std);
}
.card:hover, .card:focus-within { box-shadow: var(--ring-strong), 0 2px 2px rgba(17, 17, 17, 0.03), 0 8px 8px -8px rgba(17, 17, 17, 0.04); }
.card-media { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-sm); background: var(--surface-tint); overflow: hidden; display: grid; place-items: center; }
.card-media::after { content: ""; position: absolute; inset: 0; background: radial-gradient(18rem circle at var(--px) var(--py), rgba(17, 17, 17, 0.06), transparent 60%); opacity: 0; transition: opacity var(--t-std); pointer-events: none; }
.card:hover .card-media::after { opacity: 1; }
.card-media svg { width: min(64%, 24rem); height: auto; }
.card-body { display: grid; gap: var(--s3); padding-inline: var(--s4); align-content: start; }
.card-body p { color: var(--text-2); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: var(--r-full); box-sizing: border-box; }
.status[data-state="dev"]::before { border: 1.5px solid var(--text-2); }
.status[data-state="redesign"]::before { border: 1.5px dashed var(--text-2); }
.status[data-state="oss"]::before { background: var(--text-2); border-radius: 2px; }
.g-ink { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.g-soft { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-linecap: round; }
.g-fill { fill: var(--text); }
.g-loop { fill: var(--loop); }
.g-loop-stroke { fill: none; stroke: var(--loop); stroke-width: 2; stroke-linecap: round; }
.g-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .card:hover .g-draw, .card:focus-within .g-draw { animation: draw 900ms var(--ease-out) both; }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.note { margin-top: var(--s10); max-width: 60ch; color: var(--text-2); font-size: 0.875rem; }

/* Loop chapter */
.loop-stage { position: relative; margin-inline: calc(var(--gutter) * -0.5); aspect-ratio: 2.6 / 1; min-height: 220px; }
.loop-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: var(--s2); margin-top: var(--s12); }
.step {
  display: grid; gap: var(--s3); align-content: start; width: 100%; padding: var(--s5); text-align: left;
  font: inherit; color: var(--text-2); background: transparent; border: 0; border-radius: var(--r-md); cursor: pointer;
  transition: background-color var(--t-std), color var(--t-std);
}
.step .label { color: inherit; }
.step .h3 { color: var(--text); }
.step:hover { background: rgba(17, 17, 17, 0.03); }
.step[aria-pressed="true"] { background: var(--surface-tint); color: var(--text); }
.step .label::before { content: ""; width: 8px; height: 8px; border-radius: var(--r-full); border: 1.5px solid currentColor; box-sizing: border-box; transition: background-color var(--t-std), border-color var(--t-std); }
.step[aria-pressed="true"] .label::before { background: var(--loop); border-color: var(--loop); }

/* Studio facts */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr)); gap: var(--s16) var(--s20); align-items: start; }
.split .section-head { margin-bottom: 0; }
.facts { display: grid; }
.facts > div { display: grid; grid-template-columns: minmax(7rem, 0.4fr) 1fr; gap: var(--s4); padding-block: var(--s5); box-shadow: 0 1px 0 0 var(--line); align-items: baseline; }
.facts > div:first-child { box-shadow: 0 1px 0 0 var(--line), 0 -1px 0 0 var(--line); }
.facts dd { font-size: 1.125rem; letter-spacing: -0.01em; }

.prose { display: grid; gap: var(--s5); max-width: 68ch; }
.prose .h3 { margin-top: var(--s6); }
.prose p { color: var(--text-2); }
.prose .lead { color: var(--text-2); }
.text-link { color: var(--loop-ink); text-decoration: underline; text-underline-offset: 0.2em; }

/* Contact band + footer */
.band { background: var(--surface-ink); color: var(--on-ink); margin-top: calc(var(--section-gap) / 2); }
.band .wrap { padding-block: var(--section-gap) var(--s12); display: grid; gap: var(--s24); }
.band-head { position: relative; display: grid; gap: var(--s8); justify-items: start; }
.band-loop { display: none; position: absolute; right: 0; top: 50%; translate: 0 -50%; width: min(42%, 520px); pointer-events: none; }
.band-loop path { fill: none; stroke: var(--line-on-ink); stroke-width: 1.5; }
.band-loop circle { fill: var(--loop); }
@media (min-width: 900px) { .band-loop { display: block; } }
.band .label { color: var(--on-ink-2); }
.band .display { max-width: 12ch; text-wrap: balance; }
.band .lead { color: var(--on-ink-2); max-width: 40ch; }
.band a.mail { color: var(--loop-on-ink); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.band a.mail:hover { text-decoration-thickness: 2px; }
.band :focus-visible { outline-color: var(--on-ink); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s4) var(--s8); padding-top: var(--s8); box-shadow: 0 -1px 0 0 var(--line-on-ink); font-size: 0.875rem; color: var(--on-ink-2); }
.legal { display: grid; gap: var(--s1); font-style: normal; max-width: 60ch; }
.legal .mail { display: inline; min-height: 0; padding: 0; }
.foot nav { display: flex; gap: var(--s2); margin-block: calc(var(--s3) * -1); }
.foot a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--s2); color: var(--on-ink-2); transition: color var(--t-micro); }
.foot a:hover { color: var(--on-ink); }

/* Entrances */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity var(--t-enter), transform var(--t-enter); transition-delay: calc(var(--d, 0) * 70ms); }
  .js [data-reveal].in { opacity: 1; transform: none; }
  .js .hero h1 .line > span { transform: translateY(105%); transition: transform 900ms var(--ease-out); transition-delay: calc(var(--d, 0) * 90ms + 80ms); }
  .js .hero.in h1 .line > span { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-object img, .scroll-cue i { animation: none; }
  .btn, .btn svg { transition: none; }
}

@media (max-width: 899px) {
  .hero { padding-block: var(--s10) var(--s24); }
  .hero-object { width: min(78vw, 420px); margin-top: calc(var(--s8) * -1); }
}
@media (max-width: 639px) {
  .nav-links a.hide-sm { display: none; }
  .loop-stage { aspect-ratio: 1.7 / 1; }
  .facts > div { grid-template-columns: 1fr; gap: var(--s1); }
}
