/* Quadcs — quadcs.in */

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --bg: #050506;
  --ink: #ece8df;
  --muted: rgba(236, 232, 223, .62);
  --faint: rgba(236, 232, 223, .34);
  --line: rgba(236, 232, 223, .16);
  --signal: #ff4a22;
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(20px, 5.2vw, 84px);
  --ease: cubic-bezier(.19, .7, .12, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  scrollbar-width: none;
}
html::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--signal); color: #050506; }

a { color: inherit; text-decoration: none; }
p, h1, h2, dl, dd { margin: 0; }
em { font-style: italic; }

.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  line-height: 1.6;
}

/* ---------- stage ---------- */

#scene {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  z-index: 0;
}

#veil { display: none; }
.js #veil {
  display: block;
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  pointer-events: none;
  transition: opacity 1.6s ease .1s;
}
.js.ready #veil { opacity: 0; }

main { position: relative; z-index: 2; }

/* ---------- fixed chrome ---------- */

.bar {
  position: fixed; z-index: 10;
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(18px, 3vh, 30px) var(--gutter);
  pointer-events: none;
  transition: opacity 1.4s ease 1.2s;
}
.js .bar { opacity: 0; }
.js.ready .bar { opacity: 1; }
.bar > * { pointer-events: auto; }

.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: .34em; text-transform: uppercase;
}
.brand svg { display: block; overflow: visible; }
.brand-dots { fill: var(--signal); }
.brand-dots circle { transform-origin: 16px 16px; transition: transform .6s var(--ease); }
.brand:hover .brand-dots circle { transform: scale(.72) rotate(90deg); }

.status { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.status i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 rgba(255, 74, 34, .7);
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 74, 34, .65); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(255, 74, 34, 0); }
}

.rail {
  position: fixed; z-index: 10;
  left: 0; right: 0; bottom: 0;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: clamp(18px, 3vh, 30px) var(--gutter);
  pointer-events: none;
  color: var(--faint);
  opacity: 0; transition: opacity 1s ease;
}
.js.ready .rail { opacity: 1; transition-delay: 1.8s; }
.js.ready.at-end .rail { opacity: 0; transition-delay: 0s; }

#counter { display: flex; align-items: baseline; gap: 10px; }
#counter b { font-weight: 500; color: var(--ink); }
#counter em { font-style: normal; margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--line); }

#scroll-cue { display: flex; align-items: center; gap: 12px; transition: opacity .6s ease; }
#scroll-cue i { display: block; width: 1px; height: 34px; background: var(--line); position: relative; overflow: hidden; }
#scroll-cue i::after {
  content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 12px;
  background: var(--ink);
  animation: drip 2.2s cubic-bezier(.6, 0, .3, 1) infinite;
}
@keyframes drip { 0% { transform: translateY(-14px); } 100% { transform: translateY(36px); } }
.scrolled #scroll-cue { opacity: 0; }

/* ---------- the layer that only exists inside the lens ---------- */

#unseen {
  position: fixed; inset: 0; z-index: 3;
  pointer-events: none;
  --lx: -999px; --ly: -999px; --lr: 120px;
  -webkit-mask-image: radial-gradient(circle at var(--lx) var(--ly), #000 0, #000 calc(var(--lr) * .8), transparent calc(var(--lr) * .97));
          mask-image: radial-gradient(circle at var(--lx) var(--ly), #000 0, #000 calc(var(--lr) * .8), transparent calc(var(--lr) * .97));
}
.note {
  position: absolute;
  font-family: var(--mono); font-size: 10.5px; line-height: 1.7;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--signal);
  white-space: nowrap;
  opacity: 0; transition: opacity .8s ease;
}
.note.on { opacity: .95; }

#lens-label {
  position: fixed; z-index: 4; left: 0; top: 0;
  display: flex; flex-direction: column;
  font-size: 9px; letter-spacing: .22em; line-height: 1.75;
  color: var(--muted);
  pointer-events: none; white-space: nowrap;
  opacity: 0; transition: opacity .8s ease;
  will-change: transform;
}
.ready #lens-label { opacity: 1; transition-delay: 2.4s; }
.shut #lens-label, .no-gl #lens-label { opacity: 0; transition-delay: 0s; }

/* ---------- panels ---------- */

.panel {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  padding: 0 var(--gutter);
  display: flex;
}
.panel.side { min-height: 125vh; min-height: 125svh; align-items: center; }

.eyebrow { color: var(--muted); margin-bottom: clamp(18px, 3vh, 30px); }

h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -.022em;
  line-height: 1;
  text-wrap: balance;
}
h1 > span, h2 > span { display: block; }
h1 em, h2 em { color: var(--signal); letter-spacing: -.01em; padding-right: .06em; }

.lede {
  color: var(--muted);
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.38;
  max-width: 30em;
  text-wrap: pretty;
}

/* reveal choreography */
.js .rv {
  opacity: 0;
  transform: translate3d(0, .5em, 0);
  filter: blur(10px);
  transition: opacity 1.2s var(--ease), transform 1.4s var(--ease), filter 1.2s var(--ease);
}
.js .in .rv { opacity: 1; transform: none; filter: none; }
.in .rv:nth-child(2) { transition-delay: .12s; }
.in .rv:nth-child(3) { transition-delay: .24s; }
.in .rv:nth-child(4) { transition-delay: .36s; }
.in h1 .rv:nth-child(1), .in h2 .rv:nth-child(1) { transition-delay: .1s; }
.in h1 .rv:nth-child(2), .in h2 .rv:nth-child(2) { transition-delay: .24s; }
.in h1 .rv:nth-child(3), .in h2 .rv:nth-child(3) { transition-delay: .38s; }
.in h1 ~ .rv, .in h2 ~ .rv { transition-delay: .56s; }
.in h2 ~ .rv ~ .rv { transition-delay: .7s; }

/* hero: the headline sits in the pupil */
.hero { align-items: center; justify-content: center; text-align: center; }
.hero-inner { display: flex; flex-direction: column; align-items: center; }
.hero h1 { font-size: min(6.2vh, 10.2vw); }
.hero .eyebrow { margin-bottom: min(3.4vh, 5vw); font-size: clamp(9px, 1.25vh, 11px); }
.hint { margin-top: min(4vh, 6vw); color: var(--faint); font-size: clamp(8.5px, 1.15vh, 10px); letter-spacing: .18em; max-width: 30em; }
.hint .coarse { display: none; }
@media (hover: none), (pointer: coarse) {
  .hint .fine { display: none; }
  .hint .coarse { display: inline; }
}

/* side panels */
.copy { width: min(46vw, 660px); }
.side h2 { font-size: clamp(34px, 3.7vw, 62px); margin-bottom: clamp(22px, 3.4vh, 36px); }

.spec {
  margin-top: clamp(26px, 4.4vh, 46px);
  max-width: 520px;
  border-top: 1px solid var(--line);
  letter-spacing: .14em;
}
.spec > div {
  display: grid; grid-template-columns: 11.5em 1fr; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.spec dt { color: var(--faint); }
.spec dd { color: var(--ink); }
.sig { color: var(--signal); }
.redact { letter-spacing: .04em; color: var(--ink); opacity: .82; }

/* final */
.final { flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; padding-bottom: 0; }
.final-inner { display: flex; flex-direction: column; align-items: center; margin-top: 54vh; margin-top: 54svh; }
.final h2 { font-size: clamp(44px, 6.4vw, 104px); margin-bottom: clamp(18px, 2.6vh, 28px); }
.final .lede { max-width: 27em; margin-bottom: clamp(24px, 3.6vh, 40px); }

.cta {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 15px 26px 15px 28px;
  border: 1px solid var(--faint);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(5, 5, 6, .35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease);
}
.cta span { display: inline-block; transition: transform .5s var(--ease); }
.cta:hover, .cta:focus-visible { background: var(--ink); color: #050506; border-color: var(--ink); }
.cta:hover span, .cta:focus-visible span { transform: translateX(5px); }

a:focus-visible { outline: 1px solid var(--signal); outline-offset: 6px; border-radius: 4px; }
.cta:focus-visible { border-radius: 999px; }

.foot {
  width: 100%;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: auto;
  padding: clamp(28px, 6vh, 64px) 0 clamp(18px, 3vh, 30px);
  color: var(--faint); font-size: 10px;
}

/* ---------- capture easter egg ---------- */

#shutter {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  text-align: center; padding: 0 var(--gutter);
  pointer-events: none;
  opacity: 0; transition: opacity .25s ease;
}
#shutter .mono { color: var(--signal); }
#shutter .serif { font-size: clamp(34px, 5vw, 72px); line-height: 1; letter-spacing: -.02em; }
.shut #shutter { opacity: 1; transition-delay: .12s; }
.shut main, .shut .bar, .shut .rail, .shut #unseen { opacity: 0 !important; transition: opacity .12s linear !important; }

/* ---------- the lens is the cursor ---------- */

@media (hover: hover) and (pointer: fine) {
  .gl, .gl a { cursor: none; }
}

/* ---------- narrow / portrait ---------- */

@media (max-aspect-ratio: 1/1), (max-width: 760px) {
  .panel.side { align-items: flex-end; padding-bottom: 21vh; padding-bottom: 21svh; }
  .spec { margin-top: 22px; }
  .spec > div { padding: 8px 0; }
  #lens-label { display: none; }
  .copy { width: 100%; }
  .side h2 { font-size: clamp(30px, 8vw, 54px); }
  .lede { font-size: 18px; }
  .spec > div { grid-template-columns: 9.5em 1fr; }
  .status { font-size: 9.5px; letter-spacing: .16em; }
  .final-inner { margin-top: 50vh; margin-top: 50svh; }
  .final h2 { font-size: clamp(40px, 12vw, 72px); }
  .foot { justify-content: center; text-align: center; }
  #counter em { display: none; }
  .note { font-size: 9px; }
}

/* ---------- fallbacks ---------- */

.no-gl body, body.no-gl {
  background:
    radial-gradient(60vmax 60vmax at 50% 42%, rgba(255, 74, 34, .10), transparent 60%),
    radial-gradient(90vmax 90vmax at 50% 50%, rgba(236, 232, 223, .05), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
.no-gl #scene, .no-gl #unseen, .no-gl .hint { display: none; }


@media print {
  main, .bar, .rail, #scene, #unseen, #lens-label, #veil { display: none !important; }
  #shutter { opacity: 1; position: static; min-height: 90vh; color: #111; }
  html, body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  .rv { transition-duration: .01s !important; transition-delay: 0s !important; filter: none; transform: none; }
  .status i, #scroll-cue i::after { animation: none; }
  #veil { transition-duration: .3s; }
}
