/* Roundtable Labs — roundtable.inc
   One stylesheet, no build step. Palette comes from the brand symbol and the
   Assembly film: ivory #eeeade on near-black, warm brass for accents, and a
   restrained blue-violet light behind the sculpture. */

:root {
  --bg: #050607;
  --bg-2: #0b0d0e;
  --ink: #eeeade;
  --ink-2: rgba(238, 234, 222, 0.64);
  --ink-3: rgba(238, 234, 222, 0.36);
  --ink-4: rgba(238, 234, 222, 0.16);
  --line: rgba(238, 234, 222, 0.12);
  --line-2: rgba(238, 234, 222, 0.06);
  --glow: rgba(238, 234, 222, 0.32);
  --brass: #c8b887;
  --brass-2: rgba(200, 184, 135, 0.55);
  --violet: rgba(70, 78, 160, 0.30);
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
  --text: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: 0.45; cursor: default; }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; }
::selection { background: var(--ink); color: var(--bg); }
img, svg { display: block; }

.skip { position: fixed; top: -100px; left: 16px; z-index: 50; padding: 10px 16px; background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 12px; }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- backdrop layers ---------- */
#field { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 20%, transparent 80%);
}
.vignette { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(ellipse 80% 70% at 50% 45%, transparent 40%, var(--bg) 100%); }
.scan {
  position: fixed; left: 0; right: 0; top: -2px; height: 2px; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--brass-2), transparent);
  opacity: 0;
  animation: scan 1.6s var(--ease) 0.2s 1;
}
@keyframes scan { 0% { top: -2px; opacity: 0; } 10% { opacity: 0.9; } 100% { top: 100%; opacity: 0; } }
.noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- HUD corners ---------- */
.hud {
  position: fixed; z-index: 4; pointer-events: none;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-3); line-height: 1.6;
}
.hud::before { content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--ink-4); }
.hud.tl { top: calc(var(--gutter) + 64px); left: var(--gutter); padding-left: 24px; }
.hud.tl::before { left: 0; top: 2px; border-right: 0; border-bottom: 0; }
.hud.bl { bottom: var(--gutter); left: var(--gutter); padding-left: 24px; }
.hud.bl::before { left: 0; bottom: 2px; border-right: 0; border-top: 0; }
.hud .live { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brass); margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 10px var(--brass-2); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
body:not([data-page="index"]) .hud.bl { display: none; }
@media (max-width: 720px) { .hud { display: none; } }

/* ---------- header ---------- */
.site-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--gutter) * 0.75) var(--gutter);
  mix-blend-mode: difference;
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.brand svg { width: 26px; height: 26px; }
.brand .word { font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: 0.26em; text-transform: uppercase; }
.nav { display: flex; gap: clamp(14px, 3vw, 36px); }
.nav a {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-2); padding: 6px 0; min-height: 44px; display: inline-flex; align-items: center; position: relative; transition: color 0.3s;
}
.nav a i { font-style: normal; color: var(--brass); margin-right: 8px; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: 8px; height: 1px; width: 0; background: var(--ink); transition: width 0.4s var(--ease); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { width: 100%; }
@media (max-width: 720px) { .brand .word { display: none; } .nav a i { display: none; } .eyebrow { font-size: 10px; letter-spacing: 0.2em; } .hide-s { display: none; } }

/* ---------- splash ---------- */
.splash {
  position: relative; z-index: 2;
  min-height: 100svh;
  max-width: 1360px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center;
  gap: clamp(24px, 4vw, 72px);
  padding: calc(var(--gutter) * 2 + 32px) var(--gutter) calc(var(--gutter) * 2);
}
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 22px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 10px var(--brass-2); flex: none; }
h1.title {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(44px, 6.4vw, 96px); line-height: 0.98; letter-spacing: -0.04em;
  margin: 0; text-wrap: balance;
}
h1.title .thin { display: block; font-weight: 300; color: var(--ink-2); }
.lede { max-width: 42ch; margin: 28px 0 0; font-size: clamp(16px, 1.5vw, 19px); color: var(--ink-2); line-height: 1.55; text-wrap: pretty; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 40px; }
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink); padding: 14px 22px; min-height: 44px;
  border: 1px solid var(--line); background: rgba(5, 6, 7, 0.4);
  backdrop-filter: blur(6px);
  transition: border-color 0.3s, background 0.3s, transform 0.4s var(--ease);
}
.btn::before, .btn::after { content: ""; position: absolute; width: 8px; height: 8px; border: 1px solid var(--brass-2); transition: all 0.3s var(--ease); }
.btn::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.btn::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.btn:hover { border-color: var(--ink-2); background: rgba(238, 234, 222, 0.06); transform: translateY(-1px); }
.btn:hover::before, .btn:hover::after { width: 100%; height: 100%; }
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn .play { width: 18px; height: 18px; border: 1px solid var(--brass-2); border-radius: 50%; display: grid; place-items: center; font-size: 7px; padding-left: 1px; color: var(--brass); }
.btn.solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.solid::before, .btn.solid::after { display: none; }
.btn.solid:hover { background: #fff; }

/* the sculpture */
.stage-col { min-width: 0; }
.stage {
  position: relative; aspect-ratio: 1; width: min(100%, 600px); margin: 0 auto;
  cursor: grab; touch-action: pan-y; isolation: isolate; outline-offset: -6px;
}
.stage:active { cursor: grabbing; }
.stage::before {
  content: ""; position: absolute; inset: 14%; z-index: -1; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, var(--violet), transparent 62%);
  filter: blur(10px);
}
.stage canvas, .stage .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage canvas { opacity: 0; transition: opacity 0.8s var(--ease); }
.stage .poster { opacity: 1; transition: opacity 0.8s var(--ease); filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55)); }
.stage.ready canvas { opacity: 1; }
.stage.ready .poster { opacity: 0; pointer-events: none; }
.stage.static .poster { opacity: 1; }
.stage.static canvas { opacity: 0; }
.stage .corner { position: absolute; width: 14px; height: 14px; border: 1px solid var(--ink-4); pointer-events: none; }
.stage .c1 { top: 4%; left: 4%; border-right: 0; border-bottom: 0; }
.stage .c2 { top: 4%; right: 4%; border-left: 0; border-bottom: 0; }
.stage .c3 { bottom: 4%; left: 4%; border-right: 0; border-top: 0; }
.stage .c4 { bottom: 4%; right: 4%; border-left: 0; border-top: 0; }
.stage-index {
  position: absolute; left: 4%; right: 4%; bottom: -22px; display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); pointer-events: none;
}
.stage-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  width: min(100%, 600px); margin: 34px auto 0; padding-top: 16px; border-top: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
}
.unfold { display: flex; align-items: center; gap: 12px; min-height: 40px; color: var(--ink); user-select: none; -webkit-user-select: none; }
.unfold .ring { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--ink-4); border-radius: 50%; color: var(--brass); font-size: 16px; transition: transform 0.3s var(--ease), border-color 0.3s; }
.unfold[aria-pressed="true"] .ring { transform: rotate(90deg); border-color: var(--brass); }
.transport { display: flex; gap: 22px; color: var(--ink-3); }
.transport button { min-height: 40px; letter-spacing: inherit; text-transform: inherit; transition: color 0.3s; }
.transport button:hover { color: var(--ink); }
.transport #motion[aria-pressed="false"] { color: var(--brass); }
.stage-instructions { width: min(100%, 600px); margin: 8px auto 0; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; color: var(--ink-3); }

@media (max-width: 980px) {
  .splash { grid-template-columns: 1fr; gap: 28px; padding-top: calc(var(--gutter) * 2 + 56px); }
  .stage { width: min(100%, 460px); }
  h1.title { font-size: clamp(42px, 10.5vw, 84px); }
}

/* ---------- film dialog ---------- */
dialog#film-dialog {
  width: min(880px, 94vw); padding: 18px; margin: auto;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
}
dialog#film-dialog::backdrop { background: rgba(3, 5, 7, 0.86); backdrop-filter: blur(10px); }
.film-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); }
#close-film { padding: 8px 0; color: var(--ink); font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; min-height: 40px; }
#close-film span { font-size: 20px; margin-left: 10px; vertical-align: middle; }
dialog#film-dialog video { display: block; width: 100%; max-height: 70svh; aspect-ratio: 1; object-fit: contain; background: #080b10; }
dialog#film-dialog > p { margin: 14px 0 0; font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- inner pages ---------- */
.page { position: relative; z-index: 2; padding: calc(var(--gutter) * 3 + 40px) var(--gutter) calc(var(--gutter) * 2); max-width: 1200px; margin: 0 auto; }
.hero { padding-bottom: clamp(40px, 8vw, 96px); border-bottom: 1px solid var(--line); margin-bottom: clamp(40px, 7vw, 88px); }
.hero h1 { font-family: var(--display); font-weight: 500; font-size: clamp(40px, 7.5vw, 104px); line-height: 0.98; letter-spacing: -0.035em; margin: 0; max-width: 14ch; text-wrap: balance; }
.hero h1 .thin { font-weight: 300; color: var(--ink-2); }
.hero .lede { margin: 28px 0 0; max-width: 52ch; }
.hero .cta-row { margin-top: 32px; }

.section { display: grid; grid-template-columns: 180px 1fr; gap: 32px; padding: clamp(28px, 4vw, 56px) 0; border-top: 1px solid var(--line-2); }
.section:first-of-type { border-top: 0; padding-top: 0; }
.section .n { font-family: var(--mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-3); padding-top: 6px; }
.section .n b { display: block; color: var(--brass); font-weight: 500; margin-bottom: 6px; }
.section h2 { font-family: var(--display); font-weight: 500; letter-spacing: -0.02em; font-size: clamp(26px, 3.4vw, 44px); line-height: 1.08; margin: 0 0 18px; text-wrap: balance; }
.section p { margin: 0 0 16px; max-width: 62ch; color: var(--ink-2); font-size: clamp(16px, 1.3vw, 18px); }
.section p strong { color: var(--ink); font-weight: 500; }
.section p:last-child { margin-bottom: 0; }
.section .cta-row { margin-top: 24px; }
@media (max-width: 760px) { .section { grid-template-columns: 1fr; gap: 14px; } }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); margin-top: 8px; }
.pillar { background: rgba(5, 6, 7, 0.75); padding: 28px 24px; backdrop-filter: blur(4px); transition: background 0.3s; }
.pillar:hover { background: rgba(238, 234, 222, 0.035); }
.pillar .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--brass); margin-bottom: 18px; }
.pillar h3 { font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: -0.01em; margin: 0 0 10px; }
.pillar p { font-size: 15px; color: var(--ink-2); margin: 0; }
@media (max-width: 760px) { .pillars { grid-template-columns: 1fr; } }

.statement, .section p.statement { font-family: var(--display); font-weight: 300; font-size: clamp(26px, 4.2vw, 56px); line-height: 1.12; letter-spacing: -0.025em; margin: 0; max-width: 24ch; text-wrap: balance; color: var(--ink-2); }
.statement strong { font-weight: 500; color: var(--ink); }

.stack { display: grid; gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); }
.row { display: grid; grid-template-columns: 160px 1fr auto; gap: 20px; align-items: center; padding: 22px 24px; background: rgba(5, 6, 7, 0.75); transition: background 0.3s; }
.row:hover { background: rgba(238, 234, 222, 0.035); }
.row .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--brass); }
.row .v { font-family: var(--display); font-size: clamp(18px, 2vw, 24px); font-weight: 500; letter-spacing: -0.01em; }
.row .v small { display: block; font-family: var(--text); font-size: 14px; font-weight: 400; color: var(--ink-2); margin-top: 4px; letter-spacing: 0; }
.row .act { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line); padding: 8px 12px; min-height: 36px; background: transparent; transition: all 0.3s; }
.row .act:hover { color: var(--ink); border-color: var(--ink-2); }
.row .act[data-done="1"] { color: var(--bg); background: var(--brass); border-color: var(--brass); }
@media (max-width: 760px) { .row { grid-template-columns: 1fr; gap: 10px; } }

/* ---------- footer ---------- */
.site-foot {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap;
  padding: var(--gutter); border-top: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3);
}
.site-foot a { min-height: 32px; display: inline-flex; align-items: center; }
.site-foot a:hover { color: var(--ink); }
.site-foot .links { display: flex; gap: 22px; }

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(18px); filter: blur(6px); animation: rv 1.1s var(--ease) forwards; }
.rv.d1 { animation-delay: 0.10s; } .rv.d2 { animation-delay: 0.22s; } .rv.d3 { animation-delay: 0.34s; }
.rv.d4 { animation-delay: 0.46s; } .rv.d5 { animation-delay: 0.58s; } .rv.d6 { animation-delay: 0.72s; }
@keyframes rv { to { opacity: 1; transform: none; filter: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; animation-delay: 0s !important; transition-duration: 0.001s !important; }
  .scan { display: none; }
  .rv { opacity: 1; transform: none; filter: none; }
}
