/* PORTAL · style — one page, one typeface, and the inks of whichever instrument is named. */
@font-face { font-family: 'Martian Mono'; font-weight: 200; font-display: swap; src: url(fonts/martian-mono-latin-200-normal.woff2) format('woff2'); }
@font-face { font-family: 'Martian Mono'; font-weight: 300; font-display: swap; src: url(fonts/martian-mono-latin-300-normal.woff2) format('woff2'); }
@font-face { font-family: 'Martian Mono'; font-weight: 400; font-display: swap; src: url(fonts/martian-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Martian Mono'; font-weight: 500; font-display: swap; src: url(fonts/martian-mono-latin-500-normal.woff2) format('woff2'); }

/* the inks are real colours, so the page can travel between them */
@property --ground { syntax: '<color>'; inherits: true; initial-value: #0c0c0b; }
@property --ink { syntax: '<color>'; inherits: true; initial-value: #e6e2d6; }
@property --dim { syntax: '<color>'; inherits: true; initial-value: #7d796f; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #e6e2d6; }

:root {
  --ground: #0c0c0b; --ink: #e6e2d6; --dim: #7d796f; --accent: #e6e2d6;
  --hair: color-mix(in srgb, var(--ink) 16%, transparent);
  --ease: cubic-bezier(.2, .7, .1, 1);
  transition: --ground .9s var(--ease), --ink .9s var(--ease), --dim .9s var(--ease), --accent .9s var(--ease);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--ground); }
body {
  background: var(--ground); color: var(--ink);
  font: 300 12px/1.75 'Martian Mono', ui-monospace, monospace; letter-spacing: .01em;
  -webkit-font-smoothing: antialiased; min-height: 100svh;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--ground); }

/* ── the stage: fixed on the left, the crowd lives here ── */
#stage { position: fixed; inset: 0 auto 0 0; width: 56vw; z-index: 0; }
#stage::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, var(--hair) 1px, transparent 1.2px); background-size: 24px 24px; background-position: 12px 12px; opacity: .55; }
#stage::after { content: ''; position: absolute; inset: 0 0 0 auto; width: 1px; background: var(--hair); }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.node { position: absolute; width: 11px; height: 11px; pointer-events: none; }
.node::before, .node::after { content: ''; position: absolute; background: var(--ink); }
.node::before { left: 5px; top: 0; width: 1px; height: 11px; }
.node::after { top: 5px; left: 0; height: 1px; width: 11px; }
.node.tl { left: 14px; top: 14px; } .node.tr { right: 14px; top: 14px; }
.node.bl { left: 14px; bottom: 14px; } .node.br { right: 14px; bottom: 14px; }
.hud { position: absolute; left: 36px; right: 36px; display: flex; justify-content: space-between; gap: 16px;
  font-size: 10px; letter-spacing: .06em; color: var(--dim); white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.hud.top { top: 13px; } .hud.bottom { bottom: 13px; }
.hud.top span:first-child { color: var(--ink); }
/* the name in the corner is the way to the rest of the work */
#home { color: var(--ink); text-decoration: none; pointer-events: auto; padding: 6px 8px; margin: -6px -8px; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-position: 8px calc(100% - 4px); background-repeat: no-repeat; transition: background-size .35s cubic-bezier(.2, .7, .1, 1); }
#home:hover, #home:focus-visible { background-size: calc(100% - 16px) 1px; outline: none; }
#h-now { color: var(--accent); text-transform: uppercase; }
#h-line { overflow: hidden; text-overflow: ellipsis; }

/* ── the text: scrolls on the right ── */
#text { position: relative; z-index: 1; margin-left: 56vw; padding: 15vh clamp(24px, 5vw, 80px) 10vh; max-width: calc(44vw + 0px); }
.intro { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; }
.kicker { color: var(--dim); font-size: 10px; letter-spacing: .12em; margin-bottom: 28px; }
h1 { font-weight: 200; font-size: clamp(34px, 4.1vw, 78px); line-height: 1; letter-spacing: -.045em; margin-bottom: 44px; white-space: nowrap; }
.lines p { max-width: 34em; color: var(--ink); }
.lines p + p { margin-top: .55em; }
.lines p:last-child { color: var(--dim); margin-top: 1.6em; }

h2 { display: flex; justify-content: space-between; font-weight: 400; font-size: 10px; letter-spacing: .14em; color: var(--dim);
  padding-bottom: 12px; border-bottom: 1px solid var(--hair); text-transform: uppercase; }
section { margin-top: 14vh; }
section > h2 + ol { margin-top: 6px; }
ol { list-style: none; }

/* a work: number, name, one line; its note and its inks underneath */
.work { position: relative; border-bottom: 1px solid var(--hair); padding: 26px 0 28px; cursor: pointer; }
.work::after { content: ''; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease); }
.work.on::after { transform: scaleX(1); }
.work .head { display: grid; grid-template-columns: 3.2em 1fr auto; align-items: baseline; row-gap: 4px; }
.work .no { color: var(--dim); font-size: 10px; font-variant-numeric: tabular-nums; }
.work .name { font-weight: 300; font-size: clamp(22px, 2.3vw, 34px); letter-spacing: -.02em; line-height: 1.15; transition: color .6s, letter-spacing .9s var(--ease); }
.work.on .name { letter-spacing: .02em; }
.work .year { color: var(--dim); font-size: 10px; }
.work .line { grid-column: 2 / 4; color: var(--dim); transition: color .6s; }
.work.on .line { color: var(--ink); }
.work .more { margin: 18px 0 0 3.2em; }
.work .note { max-width: 36em; color: var(--dim); transition: color .6s; }
.work.on .note { color: var(--ink); }
.work dl { display: grid; grid-template-columns: 6.5em 1fr; gap: 3px 0; margin-top: 16px; font-size: 10.5px; }
.work dt { color: var(--dim); }
.work dd { color: var(--dim); transition: color .6s; }
.work.on dd { color: var(--ink); }
.inks { display: flex; gap: 0; padding-top: 4px; }
.inks i { width: 14px; height: 14px; background: var(--c); outline: 1px solid var(--hair); transition: width .7s var(--ease); }
.inks i + i { margin-left: -1px; }
.work.on .inks i { width: 30px; }
.enter { display: inline-flex; gap: .7em; margin-top: 18px; padding: 7px 0; color: var(--ink); letter-spacing: .06em; }
.enter b { font-weight: 300; display: inline-block; transition: transform .7s var(--ease); }
.work.on .enter, .enter:focus-visible { color: var(--accent); }
.work.on .enter b, .enter:focus-visible b { transform: translateX(10px); }
.enter:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

#notes ol { counter-reset: n; }
#notes li { counter-increment: n; display: grid; grid-template-columns: 3.2em 1fr; padding: 18px 0; border-bottom: 1px solid var(--hair); }
#notes li::before { content: counter(n, decimal-leading-zero); color: var(--dim); font-size: 10px; padding-top: 2px; }
#notes b { font-weight: 400; grid-column: 2; }
#notes p { grid-column: 2; color: var(--dim); max-width: 34em; }

footer { margin-top: 16vh; color: var(--dim); }
footer .sign { display: flex; justify-content: space-between; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--hair); font-size: 10px; letter-spacing: .08em; }
footer .sign span:first-child { color: var(--ink); }

/* things arrive in reading order */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 1s var(--ease), transform 1.2s var(--ease); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }

/* leaving: the instrument's ground opens out of the hand */
#veil { position: fixed; inset: 0; z-index: 10; pointer-events: none; background: var(--v-ground, #000); color: var(--v-ink, #fff);
  display: grid; place-items: center; clip-path: circle(0 at var(--vx, 50%) var(--vy, 50%)); visibility: hidden; }
#veil.go { visibility: visible; clip-path: circle(150vmax at var(--vx) var(--vy)); transition: clip-path .75s cubic-bezier(.7, 0, .2, 1); }
#veil-name { font-weight: 200; font-size: clamp(30px, 6vw, 96px); letter-spacing: -.03em; }

/* ── a phone: the stage sits on top and stays, the text runs under it ── */
@media (max-width: 860px) {
  #stage { position: sticky; top: 0; width: 100%; height: 44svh; z-index: 2; background: var(--ground); }
  #stage::after { inset: auto 0 0 0; width: auto; height: 1px; }
  #text { margin: 0; max-width: none; padding: 9vh 20px 8vh; }
  .intro { min-height: 0; }
  h1 { margin-bottom: 30px; }
  section { margin-top: 10vh; }
  .work .more { margin-left: 0; }
  .hud { left: 30px; right: 30px; }
  .hud.bottom > span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  :root { transition: none; }
  [data-reveal] { transition: none; opacity: 1; transform: none; }
  #veil.go { transition: none; }
}
