:root {
  --bg: #05070c;
  --fg: #f1eee8;
  --fg-2: rgba(241, 238, 232, 0.74);
  --fg-3: rgba(241, 238, 232, 0.52);
  --line: rgba(241, 238, 232, 0.2);
  --warm: #f0c9a4;
  --gutter: clamp(16px, 4.6vw, 72px);
  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --veil: 0.1;
  --head: 0;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--warm); color: #1a0f07; }

/* ---------- Backdrop ---------- */
#bg {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  display: block;
  background: linear-gradient(#070a14 0%, #1b2233 55%, #0a0d15 56%, #05070c 100%);
  z-index: -3;
}
.veil {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4, 6, 11, 0.5) 0%, rgba(4, 6, 11, 0.12) 55%, rgba(4, 6, 11, 0) 100%),
    rgba(4, 6, 11, var(--veil));
}
.grain {
  position: fixed; inset: -50%; z-index: -1; pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Header ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px var(--gutter);
}
.top::before {
  content: ""; position: absolute; inset: 0 0 -40px; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(4, 6, 11, 0.75), rgba(4, 6, 11, 0));
  opacity: var(--head); transition: opacity 0.4s;
}
.name {
  display: flex; align-items: center; gap: 11px;
  font-size: 18px; font-weight: 600; letter-spacing: -0.02em;
}
.name img { width: 27px; height: 27px; flex: none; opacity: 0.95; }
.nav { display: flex; gap: 28px; }
.nav a { font-size: 15px; font-weight: 400; color: var(--fg-2); transition: color 0.2s; }
.nav a:hover { color: var(--fg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 120px var(--gutter) 80px;
}
.hero-copy {
  margin: 0; font-weight: 500;
  letter-spacing: -0.035em; line-height: 1.02;
  max-width: 20ch;
  font-size: clamp(38px, 5vw, 84px);
}
.hero-copy .l { display: block; text-wrap: balance; }
.hero-copy .l + .l { margin-top: 0.3em; }
.l1 { color: rgba(241, 238, 232, 0.76); }
.l2 { color: rgba(241, 238, 232, 0.56); font-size: 0.7em; letter-spacing: -0.03em; }
.l3 { color: var(--fg); }

.hero-copy .l {
  opacity: 0; filter: blur(8px); transform: translateY(14px);
  animation: in 1.4s cubic-bezier(.2, .7, .1, 1) forwards;
}
.l1 { animation-delay: 0.25s !important; }
.l2 { animation-delay: 0.8s !important; }
.l3 { animation-delay: 1.4s !important; }
@keyframes in { to { opacity: 1; filter: blur(0); transform: none; } }

/* ---------- Statement ---------- */
.statement {
  min-height: 100vh;
  padding: 18vh var(--gutter) 14vh;
  display: flex; flex-direction: column; justify-content: center;
}
.big {
  margin: 0;
  font-size: clamp(38px, 5.6vw, 92px);
  letter-spacing: -0.04em; line-height: 1.02;
}
.big span { display: block; }
.big .dim { color: var(--fg-3); }
.about-row {
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 24px;
}
.about-label { font-size: 15px; font-weight: 400; color: var(--fg-3); }
.about {
  margin: 0;
  max-width: 38ch;
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.45; font-weight: 400;
  color: var(--fg-2);
  text-wrap: pretty;
}

/* ---------- Work ---------- */
.work { height: 380vh; position: relative; }
.work-sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: flex; flex-direction: column;
  padding: 104px var(--gutter) 44px;
  width: 100%; max-width: 1400px; margin: 0 auto;
}
.work-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 28px;
}
.work-title {
  margin: 0;
  font-size: clamp(38px, 4.6vw, 74px);
  font-weight: 500; letter-spacing: -0.04em; line-height: 0.95;
}
.work-index {
  display: flex; align-items: center; gap: 18px;
  padding-bottom: 6px;
  font-size: 14px; font-weight: 400; color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}
.segs { display: flex; gap: 6px; }
.seg { width: 32px; height: 14px; display: flex; align-items: center; }
.seg i { display: block; width: 100%; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.seg i::after {
  content: ""; position: absolute; inset: 0;
  background: var(--fg);
  transform-origin: left; transform: scaleX(var(--p, 0));
}

.projects { position: relative; flex: 1; min-height: 0; }
.proj {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 4.5vw, 72px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.6s ease, visibility 0s 0.6s;
}
.proj.is-active { opacity: 1; visibility: visible; transition: opacity 0.6s ease, visibility 0s; }
.proj-text { align-self: center; }
.proj-text > * {
  opacity: 0; transform: translateY(14px);
  transition: opacity 0.8s ease, transform 1s cubic-bezier(.2, .7, .1, 1);
}
.proj.is-active .proj-text > * { opacity: 1; transform: none; }
.proj.is-active .proj-text > :nth-child(2) { transition-delay: 0.06s; }
.proj.is-active .proj-text > :nth-child(3) { transition-delay: 0.12s; }
.proj.is-active .proj-text > :nth-child(4) { transition-delay: 0.18s; }
.proj.is-active .proj-text > :nth-child(5) { transition-delay: 0.24s; }

.kicker { margin: 0 0 18px; font-size: 15px; font-weight: 400; color: var(--fg-3); }
.proj h3 {
  margin: 0 0 22px;
  font-size: clamp(48px, 5.6vw, 92px);
  font-weight: 500; letter-spacing: -0.045em; line-height: 0.92;
}
.lede {
  margin: 0 0 16px;
  font-size: clamp(20px, 1.75vw, 27px);
  line-height: 1.28; letter-spacing: -0.015em;
  text-wrap: balance;
}
.body {
  margin: 0 0 26px;
  max-width: 44ch;
  font-size: 16.5px; line-height: 1.55; font-weight: 400;
  color: var(--fg-2);
  text-wrap: pretty;
}
.tags { margin: 0; font-size: 14px; font-weight: 400; color: var(--fg-3); }

.frame {
  position: relative;
  height: 100%;
  border-radius: 4px;
  background: #06080d;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(241, 238, 232, 0.1), 0 40px 120px -30px rgba(0, 0, 0, 0.85);
}
.demo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- Models ---------- */
.models { padding: 20vh var(--gutter) 6vh; }
.models-title {
  margin: 0 0 22px;
  font-size: clamp(38px, 5.6vw, 90px);
  font-weight: 500; letter-spacing: -0.04em; line-height: 1;
}
.models-sub {
  margin: 0;
  max-width: 40ch;
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.45; font-weight: 400;
  color: var(--fg-2);
  text-wrap: balance;
}
.model-grid {
  margin-top: 9vh;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 40px);
}
.model {
  padding: 26px 26px 12px;
  border-radius: 4px;
  background: rgba(8, 10, 16, 0.72);
  box-shadow: 0 0 0 1px rgba(241, 238, 232, 0.1);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition-delay: calc(var(--i) * 80ms);
}
.model-head { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 14px; margin-bottom: 10px; }
.status {
  flex: none;
  padding: 4px 10px 5px; border-radius: 999px;
  font-size: 12px; font-weight: 400; color: var(--warm);
  box-shadow: inset 0 0 0 1px rgba(240, 201, 164, 0.45);
}
.model h3 { margin: 0; white-space: nowrap; font-size: clamp(24px, 2vw, 31px); font-weight: 500; letter-spacing: -0.03em; }
.model > p { margin: 0 0 22px; font-size: 15.5px; line-height: 1.45; font-weight: 400; color: var(--fg-2); min-height: 2.9em; }
.model dl { margin: 0; }
.model dl div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 12px 0;
  border-top: 1px solid rgba(241, 238, 232, 0.12);
  font-size: 14.5px;
}
.model dt { font-weight: 400; color: var(--fg-3); }
.model dd { margin: 0; text-align: right; }

.diff {
  margin-top: 16vh;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 4.5vw, 72px);
  align-items: start;
}
.diff-visual { position: sticky; top: 110px; }
.roof-frame { height: auto; aspect-ratio: 4 / 3; max-height: calc(100svh - 150px); }
.roof-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.diff-title {
  margin: 0 0 28px;
  font-size: clamp(28px, 2.6vw, 42px);
  font-weight: 500; letter-spacing: -0.03em; line-height: 1.05;
}
.tech { list-style: none; margin: 0; padding: 0; counter-reset: tech; }
.tech li { padding: 26px 0; border-top: 1px solid var(--line); counter-increment: tech; }
.tech h4 {
  margin: 0 0 10px;
  font-size: clamp(18px, 1.5vw, 21px); font-weight: 500; letter-spacing: -0.015em;
}
.tech h4::before { content: counter(tech, decimal-leading-zero); margin-right: 14px; font-size: 14px; font-weight: 400; color: var(--warm); }
.tech p { margin: 0; font-size: 16px; line-height: 1.6; font-weight: 400; color: var(--fg-2); text-wrap: pretty; }

/* ---------- Papers ---------- */
.papers { padding: 20vh var(--gutter) 6vh; }
.papers-title {
  margin: 0 0 22px;
  font-size: clamp(38px, 5.6vw, 90px);
  font-weight: 500; letter-spacing: -0.04em; line-height: 1;
}
.papers-sub {
  margin: 0;
  max-width: 40ch;
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.45; font-weight: 400;
  color: var(--fg-2);
  text-wrap: balance;
}
.plist { margin-top: 9vh; }
.phead, .prow {
  display: grid;
  grid-template-columns: 56px minmax(0, 2.4fr) minmax(0, 1.2fr) 72px 88px 28px;
  gap: 0 clamp(16px, 2vw, 32px);
  align-items: baseline;
}
.phead {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 400; color: var(--fg-3);
}
.prow {
  position: relative;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  text-shadow: 0 1px 14px rgba(4, 6, 11, 0.95), 0 0 3px rgba(4, 6, 11, 0.7);
  transition: padding 0.4s cubic-bezier(.2, .7, .1, 1);
}
.prow::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--fg); transform: scaleX(0); transform-origin: left;
  transition: transform 0.6s cubic-bezier(.2, .7, .1, 1);
}
.prow:hover { padding-left: 14px; }
.prow:hover::before { transform: scaleX(1); }
.prow.reveal { transition: opacity 1.1s ease, transform 1.2s cubic-bezier(.2, .7, .1, 1), filter 1.1s ease, padding 0.4s cubic-bezier(.2, .7, .1, 1); transition-delay: calc(var(--i) * 40ms), calc(var(--i) * 40ms), calc(var(--i) * 40ms), 0s; }

.pr-n { font-size: 14px; font-weight: 400; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.pr-title {
  font-size: clamp(18px, 1.7vw, 25px); letter-spacing: -0.015em; line-height: 1.25;
  text-wrap: balance;
  transition: color 0.3s;
}
.pr-why { display: block; margin-top: 6px; font-size: 14.5px; letter-spacing: 0; line-height: 1.45; font-weight: 400; color: var(--fg-3); text-wrap: pretty; }
.pr-who { font-size: 15px; font-weight: 400; color: var(--fg-2); line-height: 1.4; }
.pr-who span { display: block; color: var(--fg-3); font-size: 13.5px; }
.pr-year { font-size: clamp(18px, 1.7vw, 25px); letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.pr-type { font-size: 13.5px; font-weight: 400; color: var(--fg-3); }
.pr-type.is-niche { color: var(--warm); }
.prow .ne { justify-self: end; font-size: clamp(18px, 1.7vw, 25px); transition: transform 0.4s cubic-bezier(.2, .7, .1, 1), color 0.3s; }
.prow:hover .pr-title, .prow:hover .ne { color: var(--warm); }
.prow:hover .ne { transform: translate(4px, -4px); }

/* ---------- Team ---------- */
.team { padding: 20vh var(--gutter) 6vh; }
.team-title {
  margin: 0 0 22px;
  font-size: clamp(38px, 5.6vw, 90px);
  font-weight: 500; letter-spacing: -0.04em; line-height: 1;
  text-wrap: balance;
}
.team-sub {
  margin: 0;
  max-width: 40ch;
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.45; font-weight: 400;
  color: var(--fg-2);
  text-wrap: balance;
}
.org {
  margin-top: 9vh;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7vh clamp(14px, 1.6vw, 24px);
}
.group { grid-column: span var(--span); border-top: 1px solid var(--line); padding-top: 14px; }
.group-name {
  margin: 0 0 18px;
  font-size: 15px; line-height: 1.35; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.group-name span { display: block; font-weight: 400; color: var(--fg-3); }
.group-cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(var(--span), minmax(0, 1fr));
  gap: 0 clamp(14px, 1.6vw, 24px);
}
.org-note {
  grid-column: 5 / span 3; align-self: end;
  margin: 0 0 8px;
  font-size: clamp(17px, 1.4vw, 20px); line-height: 1.45; font-weight: 400;
  color: var(--fg-2);
  text-wrap: pretty;
  text-shadow: 0 1px 14px rgba(4, 6, 11, 0.95), 0 0 3px rgba(4, 6, 11, 0.7);
}
.tag {
  position: absolute; left: 10px; top: 10px;
  padding: 4px 9px 5px;
  border-radius: 999px;
  background: rgba(240, 201, 164, 0.92);
  color: #1a0f07;
  font-size: 12px; font-weight: 500;
}
.person { transition-delay: calc(var(--i) * 50ms); }
.ph {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 125'><g fill='%23f1eee8' fill-opacity='.09'><circle cx='50' cy='50' r='17'/><path d='M14 125c0-24 16-40 36-40s36 16 36 40z'/></g></svg>") center bottom / 64% auto no-repeat,
    radial-gradient(120% 70% at 50% 110%, rgba(240, 201, 164, 0.16), rgba(240, 201, 164, 0) 60%),
    linear-gradient(#10141d, #080a10);
  box-shadow: 0 0 0 1px rgba(241, 238, 232, 0.1);
}
.ph img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transform: scale(1.02);
  transition: filter 0.6s ease, transform 0.9s cubic-bezier(.2, .7, .1, 1);
}
.person .role-2 { margin-top: 1px; color: var(--fg-3); }
.person:hover .ph img { filter: grayscale(0); transform: scale(1.05); }
.person p { margin: 0; text-shadow: 0 1px 14px rgba(4, 6, 11, 0.95), 0 0 3px rgba(4, 6, 11, 0.7); }
.person .who { font-size: 17px; letter-spacing: -0.01em; }
.person .role { margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; font-weight: 400; color: rgba(241, 238, 232, 0.82); line-height: 1.3; }

/* ---------- CTA ---------- */
.cta {
  min-height: 100vh;
  padding: 20vh var(--gutter) 18vh;
  display: flex; flex-direction: column; justify-content: center;
}
.cta-title {
  margin: 0 0 7vh;
  font-size: clamp(38px, 5.6vw, 90px);
  font-weight: 500; letter-spacing: -0.04em; line-height: 1;
  max-width: 16ch;
  text-wrap: balance;
}
.rows { border-top: 1px solid var(--line); }
.row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(18px, 2vw, 28px); letter-spacing: -0.015em;
  position: relative;
  transition: padding 0.4s cubic-bezier(.2, .7, .1, 1);
}
.row::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--fg); transform: scaleX(0); transform-origin: left;
  transition: transform 0.6s cubic-bezier(.2, .7, .1, 1);
}
.row:hover { padding-left: 14px; }
.row:hover::before { transform: scaleX(1); }
.ne { transition: transform 0.4s cubic-bezier(.2, .7, .1, 1), color 0.3s; }
.row:hover .ne { transform: translate(4px, -4px); color: var(--warm); }

/* ---------- Footer ---------- */
.foot {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 28px var(--gutter);
  font-size: 14px; font-weight: 400;
  color: var(--fg-3);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0; transform: translateY(22px); filter: blur(6px);
  transition: opacity 1.1s ease, transform 1.2s cubic-bezier(.2, .7, .1, 1), filter 1.1s ease;
}
.reveal.on { opacity: 1; transform: none; filter: none; }
.about.reveal { transition-delay: 0.15s; }
.rows .row.reveal:nth-child(2) { transition-delay: 0.12s; }

/* ---------- Small screens ---------- */
@media (max-width: 1100px) {
  .phead, .prow { grid-template-columns: 44px minmax(0, 2fr) minmax(0, 1fr) 60px 28px; }
  .phead span:nth-child(5), .pr-type { display: none; }
  .org { grid-template-columns: 1fr; }
  .group, .org-note { grid-column: auto; }
  .group-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 16px; }
}
@media (max-width: 900px) {
  .model-grid { grid-template-columns: 1fr; }
  .diff { grid-template-columns: 1fr; margin-top: 10vh; }
  .diff-visual { position: static; }
  .work { height: auto; }
  .work-sticky { position: static; height: auto; padding: 14vh var(--gutter) 4vh; }
  .work-index { display: none; }
  .work-head { margin-bottom: 8vh; }
  .projects { flex: none; }
  .proj {
    position: static; opacity: 1; visibility: visible;
    grid-template-columns: 1fr; gap: 28px;
    margin-bottom: 14vh;
  }
  .proj-text > * { opacity: 1; transform: none; }
  .frame { height: auto; aspect-ratio: 4 / 5; }
}
@media (max-width: 760px) {
  .top { padding: 20px var(--gutter); }
  .name { gap: 9px; }
  .name img { width: 23px; height: 23px; }
  .nav { gap: 20px; }
  .about-row { grid-template-columns: 1fr; gap: 12px; }
  .phead { display: none; }
  .prow {
    grid-template-columns: 30px minmax(0, 1fr) 24px;
    grid-template-areas: "n title ne" ". who year";
    gap: 10px 10px; padding: 22px 0;
  }
  .pr-n { grid-area: n; }
  .pr-title { grid-area: title; }
  .prow .ne { grid-area: ne; }
  .pr-who { grid-area: who; font-size: 13.5px; }
  .pr-who span { display: inline; }
  .pr-who span::before { content: " · "; }
  .pr-type { display: none; }
  .pr-year { grid-area: year; justify-self: end; font-size: 13.5px; color: var(--fg-3); }
  .group-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .person .who { font-size: 15px; }
  .person .role { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy .l, .reveal { animation: none; opacity: 1; filter: none; transform: none; transition: none; }
  .grain { animation: none; }
}
