/* ============================================================================
   fivenova.org
   ========================================================================== */

/* ============================================================== BOOT ===== */
/* Staged: flare → mark → wordmark wipe → readout → flash → iris open.
   Each stage is a class toggled from JS; all timing lives here, and every
   animated property is transform/opacity/filter so nothing hits layout. */

body.booting { overflow: hidden; }

#boot {
  position: fixed; inset: 0; z-index: 999;
  display: grid; place-items: center;
  background: var(--bg);
  font-family: var(--f-mono);
  isolation: isolate;
  overflow: hidden;
}

/* --- iris: two halves that part on exit --------------------------------- */
#boot .shutter {
  position: absolute; left: -2%; right: -2%; height: 50.4%;
  background: var(--bg);
  z-index: 3;
  transition: transform 1s cubic-bezier(.76, 0, .18, 1);
}
#boot .shutter.top    { top: 0;    border-bottom: 2px solid var(--acc); }
#boot .shutter.bottom { bottom: 0; border-top:    2px solid var(--acc); }
#boot.open .shutter.top    { transform: translate3d(0, -101%, 0); }
#boot.open .shutter.bottom { transform: translate3d(0,  101%, 0); }

/* --- violet flare behind the mark --------------------------------------- */
#boot .flare {
  position: absolute; left: 50%; top: 50%;
  width: 62vmin; height: 62vmin;
  translate: -50% -50%;
  z-index: 2;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--acc) 62%, transparent), transparent 62%);
  opacity: 0; scale: .3;
  filter: blur(28px);
}
#boot.in .flare { animation: flare 1.5s var(--e-out) forwards; }
@keyframes flare {
  0%   { opacity: 0;   scale: .25; }
  22%  { opacity: .95; scale: 1.05; }
  100% { opacity: .3;  scale: 1.35; }
}

/* Expanding ring, drawn once as the mark lands. */
#boot .ring {
  position: absolute; left: 50%; top: 50%;
  width: 26vmin; height: 26vmin;
  translate: -50% -50%;
  z-index: 2;
  border: 2px solid var(--acc);
  border-radius: 50%;
  opacity: 0;
}
#boot.in .ring   { animation: ring 1.25s var(--e-out) .12s forwards; }
#boot.in .ring.b { animation-delay: .3s; }
@keyframes ring {
  0%   { opacity: .85; scale: .4;  border-width: 3px; }
  100% { opacity: 0;   scale: 2.6; border-width: 1px; }
}

#boot .stage {
  position: relative; z-index: 4;
  width: min(680px, 86vw);
  text-align: center;
  transition: opacity 240ms var(--e-io), scale 500ms var(--e-io), filter 240ms var(--e-io);
}
#boot.open .stage { opacity: 0; scale: 1.12; filter: blur(6px); }

/* --- the mark punches in ------------------------------------------------ */
#boot .mark {
  width: clamp(96px, 13vw, 148px);
  margin: 0 auto 26px;
  opacity: 0;
  scale: .2;
  rotate: -22deg;
  filter: drop-shadow(0 0 34px color-mix(in oklab, var(--acc) 80%, transparent));
}
#boot.in .mark { animation: mark-punch .95s cubic-bezier(.2, 1.5, .35, 1) forwards; }
@keyframes mark-punch {
  0%   { opacity: 0; scale: .2;   rotate: -22deg; }
  55%  { opacity: 1; scale: 1.14; rotate: 4deg; }
  100% { opacity: 1; scale: 1;    rotate: 0deg; }
}
#boot .mark img { width: 100%; }

/* --- wordmark wipes open from the centre -------------------------------- */
#boot .word {
  width: min(420px, 74vw);
  margin: 0 auto 30px;
  clip-path: inset(0 50% 0 50%);
  opacity: 0;
}
#boot.in .word { animation: word-wipe .95s var(--e-out) .5s forwards; }
@keyframes word-wipe {
  from { clip-path: inset(0 50% 0 50%); opacity: 0; }
  to   { clip-path: inset(0 0 0 0);     opacity: 1; }
}
#boot .word img { width: 100%; filter: drop-shadow(0 0 26px color-mix(in oklab, var(--acc) 45%, transparent)); }

/* --- readout ------------------------------------------------------------ */
#boot .readout { opacity: 0; }
#boot.in .readout { animation: fade-up .7s var(--e-out) .95s forwards; }
@keyframes fade-up {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: none; }
}

#boot .count {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 300; line-height: 1; letter-spacing: -.03em;
  color: var(--ink);
}
#boot .count sup { font-size: .34em; vertical-align: super; color: var(--acc); margin-left: .35em; }

#boot .bar {
  position: relative; height: 2px; margin: 18px auto 14px;
  width: min(420px, 74vw);
  background: var(--line-hi);
  overflow: hidden;
}
#boot .bar i {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--acc-lo), var(--acc));
  transform: scaleX(0); transform-origin: left;
  transition: transform 300ms var(--e-out);
  box-shadow: 0 0 16px var(--acc);
}

#boot .log {
  min-height: 1.4em;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-mute);
  transition: opacity 80ms linear, transform 80ms linear;
}
#boot .log[data-state="out"] { opacity: 0; transform: translateY(-4px); }
#boot .log[data-state="in"]  { opacity: 1; transform: none; }

#boot .skip {
  margin-top: 26px;
  font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-mute); opacity: .45;
}

/* --- corner frame ------------------------------------------------------- */
#boot .frame { position: fixed; inset: clamp(14px, 2.6vw, 32px); z-index: 5; pointer-events: none; }
#boot.open .frame { opacity: 0; transition: opacity 260ms var(--e-io); }
#boot .frame i {
  position: absolute; width: 24px; height: 24px;
  border: 0 solid var(--acc);
  opacity: 0;
}
#boot.in .frame i { animation: frame-in .7s var(--e-out) forwards; }
#boot .frame i:nth-child(1) { top: 0; left: 0;     border-top-width: 2px; border-left-width: 2px;    animation-delay: .18s; }
#boot .frame i:nth-child(2) { top: 0; right: 0;    border-top-width: 2px; border-right-width: 2px;   animation-delay: .26s; }
#boot .frame i:nth-child(3) { bottom: 0; left: 0;  border-bottom-width: 2px; border-left-width: 2px; animation-delay: .34s; }
#boot .frame i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px;animation-delay: .42s; }
@keyframes frame-in { from { opacity: 0; scale: .3; } to { opacity: .9; scale: 1; } }

/* --- the flash before the iris ------------------------------------------ */
#boot::after {
  content: "";
  position: absolute; inset: 0; z-index: 6;
  background: var(--acc);
  opacity: 0; pointer-events: none;
}
#boot.flash::after { animation: boot-flash .5s var(--e-out) forwards; }
@keyframes boot-flash {
  0%   { opacity: 0; }
  12%  { opacity: .85; }
  100% { opacity: 0; }
}

/* The page itself settles in behind the opening iris. */
body.booted main, body.booted .masthead, body.booted .foot {
  animation: settle .9s var(--e-out) backwards;
}
@keyframes settle {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.995); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================== HERO ===== */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 140px var(--gut) 96px;
  overflow: hidden;
  isolation: isolate;
}

/* Vertical ticker behind the mark. Type only — no mono, no log lines. */
.tick {
  position: absolute; inset: -8% 0; z-index: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: clamp(10px, 3vw, 48px);
  pointer-events: none;
  mask-image: radial-gradient(ellipse 70% 58% at 50% 50%, transparent 22%, #000 76%),
              linear-gradient(to bottom, transparent, #000 14% 86%, transparent);
  -webkit-mask-image: radial-gradient(ellipse 70% 58% at 50% 50%, transparent 22%, #000 76%),
                      linear-gradient(to bottom, transparent, #000 14% 86%, transparent);
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
  opacity: .2;
}
.tick-col { overflow: hidden; }
.tick-track {
  display: flex; flex-direction: column; gap: 10px;
  will-change: transform;
  animation: tick-run var(--dur, 40s) linear infinite;
  animation-direction: var(--dir, normal);
}
@keyframes tick-run {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(0, -50%, 0); }
}
.tick-track span {
  display: block;
  font-family: var(--f-display);
  font-size: clamp(20px, 2.4vw, 36px);
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: 1.08;
  color: var(--ink-mute);
  white-space: nowrap;
}
.tick-track span:nth-child(3n) { color: var(--acc-lo); }

.hero-in {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 26px;
  text-align: center;
  max-width: 1040px;
}

.hero .eyebrow { animation: rise-in 800ms var(--e-out) 180ms backwards; }

.wordmark-wrap { display: block; width: min(92vw, 1000px); }
.wordmark {
  width: 100%; height: auto;
  filter: drop-shadow(0 14px 0 rgba(0,0,0,.55)) drop-shadow(0 0 70px color-mix(in oklab, var(--acc) 42%, transparent));
  animation: mark-in 1.2s var(--e-out) 280ms backwards;
}
@keyframes mark-in {
  from { opacity: 0; transform: translate3d(0, 34px, 0) scale(.94) rotate(-1.4deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to   { opacity: 1; transform: none; }
}

.hero .lede { text-align: center; animation: rise-in 900ms var(--e-out) 820ms backwards; }
.hero .btns { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; animation: rise-in 900ms var(--e-out) 1s backwards; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; z-index: 2;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--f-display); font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-mute);
  animation: rise-in 900ms var(--e-out) 1.3s backwards;
}
.scroll-hint i { display: block; width: 3px; height: 40px; background: linear-gradient(var(--acc), transparent); }

/* ========================================================== SECTIONS ===== */

.band { position: relative; z-index: 4; padding: clamp(70px, 11vh, 132px) 0; }

.band-head { display: flex; flex-direction: column; gap: 16px; margin-bottom: clamp(34px, 5vh, 60px); }
.band-head .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; flex-wrap: wrap; }
.band-head .note { font-size: 14.5px; color: var(--ink-mute); max-width: 40ch; }

/* ========================================================== MANIFEST ===== */

.manifest { border-top: 3px solid var(--edge); }

.entry {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: clamp(14px, 3vw, 40px);
  align-items: center;
  padding: clamp(22px, 3vw, 38px) clamp(10px, 1.6vw, 22px);
  border-bottom: 3px solid var(--edge);
  overflow: hidden;
  isolation: isolate;
  transition: background var(--t-med) var(--e-out);
}
.entry:nth-child(odd) { background: color-mix(in oklab, var(--bg-1) 55%, transparent); }
.entry:hover { background: var(--bg-1); }

.entry-art {
  position: absolute; inset: 0; z-index: -1;
  opacity: 0; transform: scale(1.08);
  transition: opacity 460ms var(--e-out), transform 900ms var(--e-out);
  pointer-events: none;
}
.entry-art img { width: 100%; height: 100%; object-fit: cover; }
.entry-art::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(96deg, var(--bg) 14%, color-mix(in oklab, var(--bg) 76%, transparent) 48%, color-mix(in oklab, var(--acc-deep) 62%, transparent) 100%);
}
.entry:hover .entry-art { opacity: 1; transform: scale(1); }

.entry-art.blank { background: var(--bg-1); }
.entry-art.blank::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(-54deg,
    color-mix(in oklab, var(--acc) 16%, transparent) 0 3px,
    transparent 3px 15px);
}

.entry-no {
  font-family: var(--f-display);
  font-size: clamp(30px, 3.6vw, 52px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px var(--line-hi);
  transition: -webkit-text-stroke-color var(--t-med) var(--e-out), transform var(--t-med) var(--e-out);
}
.entry:hover .entry-no { -webkit-text-stroke-color: var(--acc); transform: translateX(4px); }

.entry-main { min-width: 0; display: flex; flex-direction: column; gap: 9px; }

.entry-name {
  font-family: var(--f-display);
  font-size: clamp(30px, 5vw, 66px);
  text-transform: uppercase;
  line-height: .95;
  letter-spacing: .004em;
  color: var(--ink);
  transition: transform var(--t-med) var(--e-out), color var(--t-med) var(--e-out);
}
.entry:hover .entry-name { transform: translateX(10px); color: var(--acc-hi); }

.entry-tag {
  font-size: clamp(14px, 1.35vw, 17px);
  color: var(--ink-dim);
  max-width: 50ch;
  transition: transform var(--t-med) var(--e-out) 40ms;
}
.entry:hover .entry-tag { transform: translateX(10px); }

.entry-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }

.entry-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.entry-kind { font-family: var(--f-display); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-mute); }
.entry-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.entry-link { position: absolute; inset: 0; z-index: 1; }
.entry-btns, .entry-side .status { position: relative; z-index: 2; }

.entry-go {
  position: absolute; right: clamp(10px, 1.6vw, 22px); bottom: 14px; z-index: 2;
  font-family: var(--f-display); font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--acc);
  opacity: 0; transform: translateX(-10px);
  transition: opacity var(--t-med) var(--e-out), transform var(--t-med) var(--e-out);
  pointer-events: none;
}
.entry:hover .entry-go { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .entry { grid-template-columns: 52px minmax(0, 1fr); }
  .entry-side { grid-column: 2; align-items: flex-start; }
  .entry-btns { justify-content: flex-start; }
  .entry-go { display: none; }
}

/* ============================================================ STUDIO ===== */

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .85fr);
  gap: clamp(26px, 4vw, 68px);
  align-items: start;
}
@media (max-width: 900px) { .studio-grid { grid-template-columns: 1fr; } }

.studio-copy { display: flex; flex-direction: column; gap: 20px; }
.studio-copy p { color: var(--ink-dim); font-size: clamp(15px, 1.35vw, 18px); line-height: 1.68; max-width: 54ch; }

.readout { padding: 26px; }
.readout .line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 18px;
  padding: 13px 0;
  border-bottom: 2px solid var(--line);
}
.readout .line:last-child { border-bottom: 0; }
.readout .k { font-size: 13px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .1em; font-family: var(--f-display); }
.readout .v { font-family: var(--f-display); font-size: 26px; color: var(--ink); line-height: 1; }
.readout .v.acc { color: var(--acc-hi); }
.readout .v.sm { font-size: 15px; letter-spacing: .04em; }

/* ===================================================== TICKER RATE ======= */
/* --rate is driven from scroll velocity in runtime.js, so the backdrop reacts
   to the page instead of looping past it independently. */
.tick-track { animation-duration: calc(var(--dur, 40s) / var(--rate, 1)); }
.tick { --rate: 1; }

/* ===================================================== ENTRY LOGO ======== */
/* Projects carry two images: a square mark shown persistently, and the wide
   banner that reveals behind the row on hover. */

.entry { grid-template-columns: 62px 92px minmax(0, 1fr) auto; }

.entry-logo {
  position: relative;
  width: 92px; height: 92px;
  border: 2px solid var(--edge);
  box-shadow: 5px 5px 0 var(--edge);
  background: var(--bg-2);
  overflow: hidden;
  transition: transform var(--t-med) var(--e-out), box-shadow var(--t-med) var(--e-out);
}
.entry-logo img { width: 100%; height: 100%; object-fit: cover; }
.entry:hover .entry-logo { transform: translate(-3px, -3px) rotate(-2deg); box-shadow: 9px 9px 0 var(--acc); }

/* No logo supplied: an initial tile rather than a broken image. */
.entry-logo.letter {
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--acc-lo), var(--acc-deep));
}
.entry-logo.letter span {
  font-family: var(--f-display);
  font-size: 44px; line-height: 1;
  color: color-mix(in oklab, var(--ink) 78%, transparent);
  text-transform: uppercase;
}

/* Banner drifts slightly as the row moves through the viewport. */
.entry-art img { transform: translate3d(0, var(--par, 0px), 0) scale(1.12); }

@media (max-width: 900px) {
  .entry { grid-template-columns: 44px 64px minmax(0, 1fr); }
  .entry-logo { width: 64px; height: 64px; box-shadow: 3px 3px 0 var(--edge); }
  .entry-logo.letter span { font-size: 30px; }
  .entry-side { grid-column: 3; }
}
