:root {
  /* the same seven colours as the home page; lines and veils are the text colour at low opacity */
  --bg: #011130; --surface: #0A1C45; --ink: #EEF2F9; --muted: #A7B6CF; --accent: #7FD3F5; --brand: #4B9CD3; --green: #7EBF6A;
  --soft: color-mix(in srgb, var(--muted) 70%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 10%, transparent);
  --carolina: var(--brand); --cyan: var(--accent);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F5F3EE; --surface: #FFFFFF; --ink: #13294B; --muted: #5B6B86; --accent: #2F6FAF; --brand: #4B9CD3; --green: #4F9A3E;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { transition: background-color .6s var(--ease), color .6s var(--ease); background: var(--bg); color: var(--ink); font-family: Manrope, system-ui, sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--ease); }
a:hover .i, button:hover .i { transform: translateX(4px); }

/* nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 18px 48px; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 94%, transparent) 30%, color-mix(in srgb, var(--bg) 0%, transparent)); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.brand img { width: 34px; }
.nav nav { display: flex; gap: 28px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.nav nav a { text-decoration: none; position: relative; transition: color .3s var(--ease); }
.nav nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px; background: var(--cyan); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.nav nav a:hover { color: var(--ink); }
.nav nav a:hover::after { transform: scaleX(1); }

/* ---------------------------------------------------------------- rows: text on one side, art on the other */
.row { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr); align-items: center; gap: 2vw; padding: 120px max(48px, 6vw) 80px; position: relative; }
.row.flip { grid-template-columns: minmax(0, 1.16fr) minmax(0, 0.84fr); }
.row.flip .text { order: 2; }
.row.flip .art { order: 1; }
.text { max-width: 600px; position: relative; z-index: 2; }
/* hero: the scene leads; it is wider than its column and runs off the right edge */
.row.hero { grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr); padding-right: 0; gap: 0; }
.hero .art { align-self: center; }
.hero .frame { width: min(108%, calc(90vh * var(--r))); margin: 0 -4% 0 auto; }
.hero .big { font-size: clamp(64px, 7vw, 120px); }
.row.flip .text { justify-self: end; }

.kicker { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); }
.big { font-weight: 600; letter-spacing: -0.035em; line-height: 1; font-size: clamp(40px, 4.1vw, 66px); margin-top: 20px; }
.hero .big { font-size: clamp(72px, 8.4vw, 132px); }
.big .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .06em; }
.big .w > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease) calc(var(--k) * 70ms + 80ms); }
.lead { font-size: 19px; line-height: 1.65; color: var(--muted); margin-top: 28px; max-width: 460px; font-weight: 400; }
.body { font-size: 17px; line-height: 1.75; color: var(--muted); margin-top: 26px; max-width: 470px; font-weight: 400; }
.num { display: flex; align-items: center; gap: 16px; font-size: 14px; font-weight: 600; letter-spacing: .16em; color: var(--cyan); }
.num i { display: block; width: 72px; height: 1px; background: var(--cyan); transform: scaleX(0); transform-origin: left; transition: transform 1s var(--ease) .1s; }
.go { display: inline-flex; align-items: center; gap: 10px; margin-top: 34px; font-size: 15px; font-weight: 600; text-decoration: none; padding-bottom: 6px; background: linear-gradient(var(--cyan), var(--cyan)) left bottom / 0 1px no-repeat, linear-gradient(color-mix(in srgb, var(--ink) 25%, transparent), color-mix(in srgb, var(--ink) 25%, transparent)) left bottom / 100% 1px no-repeat; transition: background-size .6s var(--ease); }
.go:hover { background-size: 100% 1px, 100% 1px; }
.scroll { display: inline-flex; align-items: center; gap: 12px; margin-top: 44px; font-size: 13px; color: var(--soft); text-decoration: none; }
.scroll span { width: 44px; height: 1px; background: color-mix(in srgb, var(--ink) 20%, transparent); position: relative; overflow: hidden; }
.scroll span::after { content: ''; position: absolute; inset: 0; background: var(--cyan); animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* the illustration: edges dissolve into the page, a slow drift, a gentle lift on hover */
.art { position: relative; will-change: transform; }
/* a scene: the base illustration, an SVG of effects in image pixels, and leaves on top; edges dissolve into the page */
.frame { position: relative; width: min(110%, calc(82vh * var(--r))); margin: 0 auto 0 0;
}
.art { display: flex; justify-content: flex-start; }
.row.flip .art { justify-content: flex-end; } /* wide scenes spill toward the page edge, never under the text */
.frame { flex: none; margin: 0 !important; }
.hero .art { justify-content: flex-end; }
.hero .frame { margin-right: -4% !important; }
.frame { transition: transform 1s var(--ease), filter 1s var(--ease); animation: drift 9s ease-in-out infinite; }
.art:hover .frame { transform: translateY(-6px) scale(1.012); filter: brightness(1.04); }
.frame .base, .frame .fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx { pointer-events: none; overflow: visible; }
/* boards draw in, strip by strip, once the scene arrives */
.cover polygon { transition: opacity .6s ease calc(var(--k) * 70ms + var(--b) * 650ms + 650ms); }
.scene.in .cover polygon { opacity: 0; }
/* leaves sway on their stems */
.leaf { position: absolute; height: auto; max-width: none; animation: sway var(--s) ease-in-out infinite alternate; will-change: transform; }
@keyframes sway { 0% { transform: rotate(-1.8deg); } 100% { transform: rotate(1.6deg); } }
/* lamps switch on after the drawing, then breathe */
.lamp { opacity: 0; mix-blend-mode: screen; transition: opacity 1.4s ease 2.1s; }
.scene.in .lamp { opacity: .9; animation: lampb 6s ease-in-out 3.5s infinite; }
@keyframes lampb { 0%, 100% { opacity: .9; } 50% { opacity: .65; } }
/* screens glow softly */
.scr { fill: #D6F1FF; opacity: 0; mix-blend-mode: screen; animation: scr 4.5s ease-in-out infinite; }
@keyframes scr { 0%, 100% { opacity: 0; } 50% { opacity: .22; } }
.leds circle { fill: #C9F5D2; opacity: .2; animation: blink var(--t) steps(2, jump-none) var(--d) infinite; }
.leds circle:nth-child(3n) { fill: #FFE7A0; }
@keyframes blink { 0% { opacity: .2; } 100% { opacity: 1; } }
.dp { fill: none; }
.pk { fill: #F2FBFF; filter: drop-shadow(0 0 4px #7FD3F5); opacity: 0; }

/* project text: label, quoted line from the lead paper, representative papers */
.num em { font-style: normal; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--soft); font-weight: 600; }
.quote { margin-top: 28px; padding-left: 20px; border-left: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); max-width: 520px; }
.quote p { font-size: 18px; line-height: 1.7; font-weight: 300; color: var(--muted); }
.quote cite { display: block; margin-top: 10px; font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.plist { list-style: none; margin-top: 30px; max-width: 540px; border-top: 1px solid var(--line); }
.plist a { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.plist .pt { font-size: 15px; line-height: 1.45; font-weight: 500; color: var(--ink); transition: color .3s var(--ease); }
.plist .pv { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--soft); letter-spacing: .02em; }
.plist a:hover .pt { color: var(--cyan); }
.plist a:hover .i { transform: translateX(4px); }
.all { padding: 120px 0 140px; text-align: left; }
.all h2 { font-size: clamp(36px, 4.4vw, 64px); font-weight: 600; letter-spacing: -0.03em; margin-top: 14px; }
.all .links { font-size: 16px; }
@keyframes drift { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

/* reveal: text rises, art eases up out of a soft inset */
.rv { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.art.rv { transform: translateY(40px) scale(.97); clip-path: inset(-10% -10% 100% -10%); transition: opacity 1.2s var(--ease), transform 1.4s var(--ease), clip-path 1.4s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.art.rv.in { clip-path: inset(-10% -10% -10% -10%); }
.big.rv { opacity: 1; transform: none; }
.big.rv.in .w > span { transform: none; }
.num.rv.in i { transform: scaleX(1); }
.text .rv:nth-child(2) { transition-delay: .06s; } .text .rv:nth-child(3) { transition-delay: .18s; } .text .rv:nth-child(4) { transition-delay: .3s; }

/* ---------------------------------------------------------------- publications */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 48px; }
.papers { padding: 120px 0 140px; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.head-row h2 { font-size: clamp(34px, 3.8vw, 52px); letter-spacing: -0.03em; font-weight: 600; margin-top: 12px; }
.ctrl { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--soft); }
.ctrl b { color: var(--ink); font-weight: 600; }
.arrow { width: 48px; height: 48px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background .3s var(--ease), border-color .3s var(--ease); }
.arrow:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); border-color: color-mix(in srgb, var(--ink) 40%, transparent); }
.arrow.prev .i { transform: rotate(180deg); }
.arrow.prev:hover .i { transform: rotate(180deg) translateX(4px); }
.slider { margin-top: 44px; overflow: hidden; }
.track { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; }
.track::-webkit-scrollbar { display: none; }
.paper { flex: 0 0 min(430px, 82vw); scroll-snap-align: start; text-decoration: none; user-select: none; }
.paper-img { aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; background: #fff; }
.paper-img img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform 1.1s var(--ease); }
.paper:hover .paper-img img { transform: scale(1.035); }
.paper-body { padding: 20px 2px 0; display: flex; flex-direction: column; gap: 8px; }
.pn { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--cyan); }
.venue { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.paper h3 { font-size: 19px; line-height: 1.4; font-weight: 600; }
.more { display: inline-flex; align-items: center; gap: 6px; color: var(--cyan); font-size: 14px; font-weight: 600; margin-top: 4px; }
.bar { height: 1px; background: var(--line); margin-top: 32px; }
.bar i { display: block; height: 100%; width: 25%; background: var(--cyan); transition: width .45s var(--ease); }
.links { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 30px; font-size: 14px; font-weight: 600; }
.links a { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; color: var(--muted); transition: color .3s; }
.links a:hover { color: var(--ink); }
.foot { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13px; color: var(--soft); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.foot a { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }

@media (max-width: 900px) {
  .nav { padding: 14px 18px; } .nav nav { display: none; }
  .row, .row.flip { grid-template-columns: 1fr; min-height: auto; padding: 96px 18px 56px; gap: 18px; }
  .row.flip .text, .row .text { order: 2; justify-self: start; }
  .row .art, .row.flip .art { order: 1; }
  .hero .text { order: 1; } .hero .art { order: 2; }
  .big { font-size: clamp(44px, 12vw, 64px); } .hero .big { font-size: 72px; }
  .body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .head-row { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .rv, .art.rv { opacity: 1; transform: none; clip-path: none; transition: none; }
  .big .w > span { transform: none; transition: none; }
  .frame, .leaf, .lamp, .scr, .leds circle, .scroll span::after { animation: none; }
  .cover polygon { opacity: 0; transition: none; }
}

/* theme switch and logos per mode */
.theme-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background .3s var(--ease), transform .5s var(--ease); }
.theme-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); transform: rotate(-12deg); }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.theme-btn .sun { display: none; } :root[data-theme="light"] .theme-btn .sun { display: block; } :root[data-theme="light"] .theme-btn .moon { display: none; }
.nav-right { display: flex; align-items: center; gap: 26px; }
.brand .logo-l { display: none; } :root[data-theme="light"] .brand .logo-l { display: block; } :root[data-theme="light"] .brand .logo-d { display: none; }
/* on paper the scenes sit on a soft shadow so the navy rooms do not float harshly */
:root[data-theme="light"] .frame .base { filter: drop-shadow(0 30px 40px color-mix(in srgb, var(--ink) 18%, transparent)); }
