/* LaLa-World project page. Type, colours and captions come from the LaLa 3D film (claude-3d-model_v14): Inter, the
   violet → magenta → amber gradient on the key words, ink tones that switch for the night chapters. */
@font-face { font-family: 'Inter V'; src: url('fonts/Inter-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono V'; src: url('fonts/JetBrainsMono-var.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --font: "Inter V", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono V", ui-monospace, Menlo, Consolas, monospace;
  --gold: #F1D17D;
  --ease: cubic-bezier(.2,.75,.25,1);
}
/* the day and night inks: the page's chrome follows the background (html.night); a chapter keeps its own, so a title
   never changes colour while it is on the screen */
:root, .hero, .chapter {
  --ink: #1d1d1f; --ink2: #515154; --ink3: #86868b; --glass: rgba(255,255,255,.66); --glass2: rgba(255,255,255,.9); --line: rgba(0,0,0,.08);
  --on: #1d1d1f; --on-ink: #fff; --lang: #3A2E9E; --ve: #D9481F; --lm: #4B4FE0; --act: #0B8F7A;
  --accent: #6E56CF;
  --grad: linear-gradient(90deg, #6E56CF 0%, #C24BD6 45%, #F0A23B 100%);
}
html.night, .chapter.dark, .credits {
  --ink: #f5f5f7; --ink2: #d4d0e6; --ink3: #a9a4c4; --glass: rgba(30,24,66,.5); --glass2: rgba(40,32,84,.85); --line: rgba(255,255,255,.12);
  --on: #f5f5f7; --on-ink: #151039; --lang: #C9C0FF; --ve: #FF9A6B; --lm: #A9B4FF; --act: #5FE6C9;
  --accent: #F1D17D;
  --grad: linear-gradient(90deg, #A79BFF 0%, #F28BE6 45%, #FFD27D 100%);
}

* { box-sizing: border-box; }
html { background: #e6e6ea; -webkit-text-size-adjust: 100%; transition: background-color .6s; }
html.night { background: #0B0925; }
body { margin: 0; min-width: 320px; font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: #C9C0FF; color: #151039; }
a { color: inherit; }
em { font-style: normal; }
sup { position: relative; top: -.42em; font-size: .62em; line-height: 0; vertical-align: baseline; margin-left: 1px; color: var(--accent); font-weight: 600; }
.nw { white-space: nowrap; }

/* ------------------------------------------------------------------ layers: backdrop · 3D · charts · labels · page · chrome */
/* background b in CSS (white, the faintest violet): what shows until WebGL draws the same thing */
.backdrop { position: fixed; inset: 0; z-index: 0; background: #e7e7ea; overflow: hidden; pointer-events: none; }
.backdrop::before { content: ""; position: absolute; inset: -60px; background: url("poster-blur.jpg") center bottom / cover no-repeat; filter: saturate(1.3) blur(24px); opacity: .06; }
html.night .backdrop { background: linear-gradient(180deg, #0A0823 0%, #0E0A2E 48%, #19113F 100%); }
html.night .backdrop::before { opacity: 0; }
.stage { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; z-index: 1; opacity: 0; transition: opacity 1s ease; }
.stage.on { opacity: 1; }
.stage canvas { display: block; width: 100%; height: 100%; outline: none; cursor: grab; -webkit-tap-highlight-color: transparent; }
.stage canvas:active { cursor: grabbing; }
.charts { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; z-index: 2; pointer-events: none; }   /* the results (lala-charts.js) */
main { position: relative; z-index: 4; pointer-events: none; }   /* a drag anywhere but on a link or a control turns the model */
main a, main button, .paper, .credits-in { pointer-events: auto; }

/* ------------------------------------------------------------------ titles (the film's captions) */
.cap { margin: 0; font-size: clamp(31.2px, 4.08vw, 72px); line-height: 1.08; font-weight: 600; letter-spacing: -.028em; color: var(--ink); }
.cap.wm, .hero-wm { font-size: clamp(40.8px, 6vw, 110.4px); letter-spacing: -.035em; }
.cap small { display: block; margin-top: .5em; font-size: .38em; font-weight: 500; letter-spacing: -.01em; color: var(--ink2); }
.cap em, .hero-wm em, .ln-brand em { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cap .mute { color: var(--ink3); }
.hero-wm .amp, .ln-brand .amp { font-weight: 300; color: var(--ink3); margin: 0 .1em; }
.dark .cap { text-shadow: 0 2px 24px rgba(4,3,18,.45); }   /* legible over the poster */
.dark .cap em { text-shadow: none; filter: drop-shadow(0 2px 12px rgba(4,3,18,.35)); }   /* a text-shadow would cover the clipped gradient */
.dark .cap small { color: #E4DFF2; }

/* 3D-anchored labels with leader lines (the stage places them) */
.labels { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.labels svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.labels line { stroke: var(--ink3); stroke-width: 1; opacity: 0; transition: opacity .5s; }
.labels circle { fill: var(--ink); opacity: 0; transition: opacity .5s; }
.labels .on { opacity: .9; }
.lbl { position: absolute; left: 0; top: 0; font-size: clamp(15.6px, 1.43vw, 24.7px); font-weight: 600; line-height: 1.25; letter-spacing: -.01em; color: var(--ink);
  white-space: nowrap; opacity: 0; transition: opacity .5s; }
.lbl small { display: block; font-weight: 450; color: var(--ink3); font-size: clamp(13px, 1.14vw, 18.9px); letter-spacing: 0; }
.lbl i { font-style: normal; } .lbl .ve { color: var(--ve); } .lbl .lm { color: var(--lm); } .lbl .act { color: var(--act); } .lbl .lang { color: var(--lang); }
.lbl.on { opacity: 1; }

/* ------------------------------------------------------------------ the opening screen */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 8.5vh 5vw max(4vh, 22px); }
.hero-wm { margin: 0; line-height: 1.08; font-weight: 600; color: var(--ink); }
.hero-stage { flex: 1 0 auto; width: 100%; min-height: 34vh; display: grid; place-items: center; }
.loader { display: inline-flex; gap: 7px; transition: opacity .5s; }
.loader i { width: 7px; height: 7px; border-radius: 50%; background: #8B6CF0; animation: dot 1.2s ease-in-out infinite; }
.loader i:nth-child(2) { background: #C24BD6; animation-delay: .15s; } .loader i:nth-child(3) { background: #F0A23B; animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { transform: scale(.55); opacity: .35; } 40% { transform: none; opacity: 1; } }
html.ready .loader, html.nofilm .loader { opacity: 0; }
html.nofilm .hero-stage { flex: 0 0 auto; min-height: 9vh; }   /* no 3D: the paper follows the title */

.paper { width: 100%; max-width: 1100px; }
.paper-title { margin: 0; font-size: clamp(19px, 1.6vw, 29px); line-height: 1.22; font-weight: 600; letter-spacing: -.022em; color: var(--ink); text-wrap: balance; }
.authors { margin-top: 1.1em; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: clamp(14.5px, 1.08vw, 17.5px); font-weight: 500; line-height: 1.5; }
.author-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.35em; }
.authors a { color: var(--ink); text-decoration: none; white-space: nowrap; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .3s var(--ease); }
.authors a:hover, .authors a:focus-visible { background-size: 100% 1px; outline: none; }
.affils { margin: .75em 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.3em; font-size: clamp(12.5px, .92vw, 14.5px); line-height: 1.6; color: var(--ink2); }
.affils sup, .notes sup { margin: 0 3px 0 0; }
.brandline { margin-top: 15px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.lab-logo { display: block; width: auto; height: 23px; }
.notes { margin: 0; display: flex; justify-content: center; gap: 1.4em; font-size: 11.5px; color: var(--ink3); }
.links { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 19px 0 15px; border-radius: 999px; background: var(--on); color: var(--on-ink);
  font-size: 15px; font-weight: 550; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; box-shadow: 0 8px 22px -14px rgba(20,10,60,.6);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn .emoji { font-size: 17px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(70,40,160,.55); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* the opening copy arrives like the film's captions */
.hero-wm, .paper { transition: opacity .9s var(--ease), transform 1.1s var(--ease), filter .9s; }
html.js .hero-wm, html.js .paper { opacity: 0; transform: translateY(16px); filter: blur(6px); }
html.js .paper { transition-delay: .25s; }
html.in .hero-wm, html.in .paper { opacity: 1; transform: none; filter: none; }

/* ------------------------------------------------------------------ chapters: a pin holds the screen while its section scrolls past */
.chapter { position: relative; }
html.film .chapter { height: calc(80vh + var(--pin, 0vh)); height: calc(80svh + var(--pin, 0vh)); }   /* a frame of four fifths of the screen: the next chapter's top shows below it */
html.film #lala-world { margin-top: 75vh; }   /* the poster has a moment to itself between the opening screen and LaLa-World */
.pin { position: sticky; top: 0; height: 80vh; height: 80svh; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 7.5vh 6vw max(3vh, 18px); text-align: center; }
html:not(.film) .chapter { padding: 14vh 6vw; text-align: center; }
html:not(.film) .pin { position: static; height: auto; padding: 0; }

/* ------------------------------------------------------------------ chrome: local nav, chapter dots, drag hint */
.localnav { position: fixed; z-index: 10; top: 0; left: 0; right: 0; height: 50px; padding: 0 max(20px, 2.6vw); display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); border-bottom: 1px solid var(--line);
  transform: translateY(-101%); visibility: hidden; transition: transform .55s var(--ease), background-color .6s, border-color .6s, visibility 0s .55s; }
.localnav.on { transform: none; visibility: visible; transition: transform .55s var(--ease), background-color .6s, border-color .6s, visibility 0s; }
.ln-brand { font-size: 19px; font-weight: 650; letter-spacing: -.025em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.ln-links { display: flex; align-items: center; gap: 24px; }
.ln-links a { font-size: 13px; color: var(--ink2); text-decoration: none; transition: color .2s; }
.ln-links a:hover, .ln-links a:focus-visible { color: var(--ink); }

.chapters { position: fixed; z-index: 8; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end;
  opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; }
.chapters.on { opacity: 1; visibility: visible; }
/* a dot per chapter: the ones passed darker; the current one a bar whose fill follows the scroll through it (--p) */
.chapters a { position: relative; display: block; padding: 7px 9px; }
.chapters a::before { content: ""; display: block; width: 9px; height: 9px; border-radius: 4.5px; background: var(--ink); opacity: .2; transition: height .4s var(--ease), opacity .4s; }
.chapters a::after { content: ""; position: absolute; left: 9px; top: 7px; width: 9px; height: 9px; border-radius: 4.5px; background: var(--ink); opacity: 0; transition: opacity .4s; }
.chapters a.done::before { opacity: .45; }
.chapters a.on::before { height: 30px; opacity: .2; }
.chapters a.on::after { height: calc(9px + var(--p, 0) * 21px); opacity: .85; }
.chapters a:hover::before { opacity: .55; }
.chapters a span { position: absolute; right: 28px; top: 50%; transform: translate(6px, -50%); font-size: 12.5px; font-weight: 500; color: var(--ink2); white-space: nowrap;
  opacity: 0; transition: opacity .25s, transform .25s var(--ease); pointer-events: none; }
.chapters a:hover span, .chapters a:focus-visible span { opacity: 1; transform: translate(0, -50%); }
.chapters a:focus-visible { outline: none; }
.chapters a:focus-visible::before { opacity: .9; }

.drag-hint { position: fixed; z-index: 6; right: 26px; bottom: 24px; margin: 0; display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 500;
  color: var(--ink3); opacity: 0; transition: opacity .6s; pointer-events: none; }
.drag-hint.on { opacity: 1; }
.drag-hint svg { width: 24px; height: 24px; flex: none; }
.when-touch { display: none; }
html.touch .when-touch { display: inline; } html.touch .when-mouse { display: none; }

/* ------------------------------------------------------------------ closing credits over the night sky */
.credits { position: relative; padding: 34vh 6vw 7vh; }
.credits-in { max-width: 880px; margin: 0 auto; text-align: center; }
.eyebrow { margin: 0 0 18px; font-size: 12px; font-weight: 650; letter-spacing: .24em; color: var(--gold); }
.tldr { margin: 0; font-size: clamp(18px, 1.5vw, 23px); line-height: 1.66; font-weight: 450; letter-spacing: -.01em; color: var(--ink2); text-wrap: pretty;
  text-shadow: 0 1px 18px rgba(4,3,18,.5); }
.tldr strong { color: var(--ink); font-weight: 650; }
.tldr .nm { white-space: nowrap; }
.credits .links { margin-top: 36px; }
.credits .btn { box-shadow: 0 10px 30px -16px rgba(167,155,255,.55); }
.bibtex { margin: 11vh auto 0; text-align: left; border-radius: 22px; padding: 20px 24px 22px; background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); }
.bib-head { display: flex; justify-content: space-between; align-items: center; }
.bib-head .eyebrow { margin: 0; }
.bibtex pre { margin: 14px 0 0; overflow-x: auto; font: 13.5px/1.62 var(--mono); color: var(--ink2); tab-size: 2; }
.copy-btn { font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: background .2s; }
.copy-btn:hover { background: rgba(127,127,140,.16); }
.copy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.page-foot { margin-top: 10vh; display: flex; flex-direction: column; align-items: center; gap: 18px; font-size: 12px; color: var(--ink3); }
.to-top { color: var(--ink3); text-decoration: none; } .to-top:hover { color: var(--ink); }
/* the lab logo at night: the symbol in its own colours, the wordmark in white */
.lab-mark { position: relative; display: block; width: 190px; }
.lab-mark img { display: block; width: 100%; height: auto; }
.credits .lab-mark img { filter: brightness(0) invert(1); opacity: .88; clip-path: inset(0 0 0 17%); }
.credits .lab-mark::after { content: ""; position: absolute; inset: 0; background: url("naver-ai-lab.png") center / 100% 100% no-repeat; clip-path: inset(0 83% 0 0); }
html.nofilm .chapter.dark, html.nofilm .credits { background: linear-gradient(180deg, #0A0823 0%, #0E0A2E 48%, #19113F 100%); }   /* without the 3D the night is CSS */

/* ------------------------------------------------------------------ smaller screens */
@media (max-width: 1100px) { .drag-hint { display: none; } }
@media (max-width: 900px) {
  .chapters { display: none; }
  .ln-links { gap: 16px; }
}
@media (max-width: 760px) {
  .hero { padding-top: max(7vh, 46px); }
  .authors { gap: 2px; }
  .author-row { gap: 0 1em; }
  .affils { gap: 0 .9em; }
  .links { gap: 8px; }
  .btn { height: 38px; padding: 0 15px 0 12px; font-size: 14px; gap: 7px; }
  .btn svg { width: 16px; height: 16px; }
  .pin { padding: max(7.5vh, 60px) 5vw max(2.5vh, 14px); }
  .ln-brand { font-size: 16px; }
  .ln-more { display: none; }
  .bibtex { padding: 16px 16px 18px; border-radius: 18px; }
  .bibtex pre { font-size: 11.5px; }
  .lbl { font-size: 12.5px; white-space: normal; width: 6.6em; }   /* labels wrap beside a small model */
  .lbl small { font-size: 11px; }
  .hero-stage { min-height: 30vh; }
}
@media (max-width: 380px) { .ln-links { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero-wm, .paper { transition: opacity .3s; transform: none !important; filter: none !important; }
  .loader i { animation: none; opacity: .6; }
}
