:root {
  --ink: #15161a;
  --ink-soft: #3b3f47;
  --muted: #6b7280;
  --surface: #ffffff;
  --surface-2: #f6f6ef;      /* YC cream, used for code / quote surfaces */
  --border: #e7e7e1;
  --accent: #ff6600;
  --accent-ink: #c2410c;
  --danger: #c0362c;
  --ok: #36d98a;
  --amber: #ffb224;
  --stage: #0b0e10;          /* dark demo panel on the right */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --stage-w: 40vw;           /* demo sidebar ~40%, article ~60% */
  --rail-gap: clamp(24px, 4vw, 84px);  /* left gutter so the article floats off the edge */
  --col: 760px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-sans);
  font-size: 18px; line-height: 1.65; color: var(--ink);
  background: linear-gradient(rgba(8, 11, 13, 0.55), rgba(8, 11, 13, 0.72)), url("wall-bg.jpg?v=4") center / cover fixed no-repeat;
  background-color: var(--stage);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  text-wrap: pretty;
}

/* ---------- layout: permanent article (60%) + fixed demo stage (40%) ---------- */
#page {
  width: calc(100% - var(--stage-w) - var(--rail-gap));
  margin-left: var(--rail-gap);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.35);
}
.column {
  max-width: var(--col);
  margin: 0 auto;
  padding: clamp(40px, 6vh, 88px) clamp(24px, 4vw, 72px) 96px;
}

#stage {
  position: fixed; top: 0; right: 0; z-index: 1;
  width: var(--stage-w); height: 100vh;
  background: var(--stage); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
#sim { display: none; }       /* synthetic camera canvas off; the wall is the de-identified stills */

#wall {
  position: absolute; inset: 0; z-index: 0;
  background: var(--stage) url("wall-bg.jpg?v=4") center / cover no-repeat;
}
#wall::after {               /* darken the wall so the board card reads on top */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,11,13,0.45) 0%, rgba(8,11,13,0.66) 55%, rgba(8,11,13,0.82) 100%);
}

/* camera-system caption, top of the stage */
#sys {
  position: absolute; z-index: 2; top: 14px; left: 14px; right: 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: #c9d3d0; font-size: 11px; line-height: 1.5; letter-spacing: 0.04em;
  text-transform: uppercase; pointer-events: none;
}
#sys-label { font-weight: 600; color: #e8efec; }
#sys-sub { color: #8aa29a; letter-spacing: 0.02em; text-transform: none; width: 100%; }
.sys-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); animation: blink 1.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------- article typography ---------- */
.prose h1, .prose h2, .prose h3 { font-weight: 600; letter-spacing: -0.012em; color: var(--ink); }
.prose h1 { font-size: clamp(1.9rem, 3vw, 2.5rem); line-height: 1.15; margin: 0 0 10px; }
.prose h2 { font-size: clamp(1.25rem, 2vw, 1.55rem); line-height: 1.25; margin: 48px 0 14px; }
.prose h3 { font-size: 1.12rem; line-height: 1.3; margin: 32px 0 8px; }
.prose h2, .prose h3 { font-family: "Cinzel", var(--font-sans); text-transform: uppercase; letter-spacing: 0.06em; }
.prose p, .prose li { max-width: 68ch; }
.prose p { margin: 0 0 18px; }
.prose > p:first-of-type { font-size: 1.14em; line-height: 1.6; color: var(--ink-soft); }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 1.3em; }
.prose li { margin: 0 0 9px; padding-left: 4px; }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--accent-ink); text-underline-offset: 2px; text-decoration-thickness: 1px; }
.prose strong, .prose b { font-weight: 600; }
.prose em, .prose i { font-style: italic; }
.prose blockquote {
  margin: 24px 0; padding: 16px 20px;
  border-left: 3px solid var(--accent); background: var(--surface-2);
  border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--ink-soft);
}
.prose blockquote p { margin: 0; }
.prose .pull { font-size: 1.4rem; line-height: 1.35; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.prose figure.diagram { margin: 28px 0; }
.prose figure.seq { margin: 30px 0; }
.prose figure.seq img { display: block; width: 100%; height: auto; border-radius: var(--r-md); box-shadow: 0 14px 34px rgba(11, 14, 16, 0.28); }
.prose figure.seq.tall img { max-width: 460px; margin-inline: auto; } /* tall phone photos: cap width, center (named .tall, NOT .portrait — that's the lobby avatar class) */
.prose figcaption { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.prose figure.diagram svg { display: block; width: 100%; height: auto; }
.prose figure.slot {
  margin: 28px 0; padding: 26px 20px; text-align: center;
  border: 1px dashed #cfcfc8; border-radius: var(--r-md);
  background: repeating-linear-gradient(45deg, #faf9f5, #faf9f5 10px, #f3f2ea 10px, #f3f2ea 20px);
  color: var(--muted); font-size: 14px; font-weight: 600;
}
.prose figure.slot::after { content: attr(data-caption); display: block; max-width: 54ch; margin: 6px auto 0; font-weight: 400; font-size: 12px; color: var(--muted); }
.prose figure.slot code { background: #fff; padding: 1px 5px; border-radius: 4px; }
.prose pre {
  background: var(--surface-2); color: #1f2328; border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px 18px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.55;
}
.prose pre .c { color: #6b7280; }
.prose pre .k { color: var(--accent-ink); }
.prose code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.muted { color: var(--muted); }
.label-caps { display: inline-block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; color: var(--accent-ink); }
.foot { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); max-width: 68ch; }

/* ---------- buttons (clean, modern) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  padding: 10px 16px; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- the lobby board (presentation-sized, in the 40% stage) ---------- */
/* Tall portrait card, like the vertical TV mounted at the office door. */
#board { position: relative; z-index: 2; width: min(calc(var(--stage-w) - 56px), 460px); height: min(calc(100vh - 48px), 900px); display: flex; }
.lobby {
  position: relative; overflow: hidden; border-radius: 20px;
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: clamp(28px, 3vw, 44px);
  background: #f6f6ef; color: #1a1a1a;
  font-family: var(--font-sans);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
  transition: background-color 1.4s ease, color 1.4s ease, filter 1.4s ease;
}

.lobby-dd { position: relative; z-index: 1; align-self: center; margin-bottom: 8px; color: #1a1a1a; transition: color 1.4s ease; }
.dd-num { font-size: clamp(2rem, 2.3vw, 2.6rem); font-weight: 600; line-height: 1; }
.dd-frac { font-size: 1.1rem; margin-left: 4px; }
.dd-label { margin-left: 8px; font-size: 0.95rem; color: #64748b; transition: color 1.4s ease; }

.lobby-stage { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; }
#lobby-idle[hidden], #lobby-greet[hidden] { display: none; }

.lobby-idle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(26px, 5vh, 52px); text-align: center; }
.yc-mark { width: clamp(104px, 10vw, 150px); height: clamp(104px, 10vw, 150px); display: block; animation: fadeIn 2s ease-in-out forwards, floatBig 3s 2s ease-in-out infinite; }
.yc-mark-svg { width: 100%; height: 100%; display: block; }
.lobby-welcome { font-size: clamp(1.9rem, 2.5vw, 2.5rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; max-width: 12ch; }

.lobby-greet { display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 2vh, 24px); text-align: center; width: 100%; }
.portrait-wrap { position: relative; }
.portrait {
  display: block; width: clamp(112px, 10vw, 148px); height: clamp(112px, 10vw, 148px);
  border-radius: 50%; background: #e2e8f0;
  animation: floatSmall 6s ease-in-out infinite;
  box-shadow: 0 18px 26px -20px rgb(15 23 42 / 0.7), 0 6px 12px -9px rgb(15 23 42 / 0.28);
  transition: background-color 1.4s ease, box-shadow 1.4s ease;
}
.co-badge {
  position: absolute; right: -2px; bottom: 2px;
  width: clamp(34px, 3vw, 44px); height: clamp(34px, 3vw, 44px);
  border-radius: 50%; background: #fff; color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: clamp(0.9rem, 1.4vw, 1.1rem);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.22);
  animation: floatSmall 6s ease-in-out infinite;
}
.co-badge[hidden] { display: none; }
.greet-line { font-size: clamp(1.4rem, 1.9vw, 1.85rem); line-height: 1.12; font-weight: 400; }
.greet-line b { font-weight: 700; }
.greet-line.strike { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--danger); }
.greet-detail { font-size: clamp(0.95rem, 1.25vw, 1.2rem); line-height: 1.22; color: #334155; margin-top: 6px; min-height: 1.2em; }
.greet-detail.meetup { color: #f97316; font-weight: 700; }
.greet-note { font-size: clamp(0.82rem, 1.05vw, 1rem); line-height: 1.4; color: #475569; margin-top: 8px; min-height: 1em; }
.greet-note b { font-weight: 600; }
.staff-row { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: clamp(0.95rem, 1.25vw, 1.2rem); color: #f97316; }
.yc-mini { width: 1em; height: 1em; border-radius: 4px; display: inline-block; vertical-align: -0.12em; }

.lobby[data-state="check"] .greet-line { opacity: 0.8; }
.lobby[data-state="abstain"] .greet-line { color: #64748b; }

/* night mode (the real board dims after hours) */
body.night .lobby { background: #1e293b; color: #fdba74; filter: brightness(0.92); }
body.night .lobby-dd { color: #fdba74; }
body.night .dd-label { color: #ffedd5; }
body.night .lobby-welcome { color: #f97316; }
body.night .greet-line { color: #fdba74; }
body.night .greet-detail { color: #fb923c; }
body.night .greet-detail.meetup { color: #f97316; }
body.night .greet-note { color: #fb923c; }
body.night .staff-row { color: #f97316; }
body.night .lobby[data-state="abstain"] .greet-line { color: #fdba74; }
body.night .portrait { background: #334155; box-shadow: 0 18px 26px -20px rgb(253 186 116 / 0.3), 0 6px 12px -9px rgb(253 186 116 / 0.16); }
body.night .co-badge { background: #0f172a; color: #fdba74; }
body.night .yc-mark { animation: fadeIn 2s ease-in-out forwards, floatBigDark 3s 2s ease-in-out infinite; }

@keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes floatSmall { 0% { transform: translateY(0); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0); } }
@keyframes floatBig {
  0% { box-shadow: 0 5px 15px 0 rgba(0, 0, 0, 0.6); transform: translateY(0); }
  50% { box-shadow: 0 25px 15px 0 rgba(0, 0, 0, 0.2); transform: translateY(-20px); }
  100% { box-shadow: 0 5px 15px 0 rgba(0, 0, 0, 0.6); transform: translateY(0); }
}
@keyframes floatBigDark {
  0% { box-shadow: 0 5px 15px 0 rgb(253 186 116 / 0.3); transform: translateY(0); }
  50% { box-shadow: 0 25px 15px 0 rgb(253 186 116 / 0.1); transform: translateY(-20px); }
  100% { box-shadow: 0 5px 15px 0 rgb(253 186 116 / 0.3); transform: translateY(0); }
}

/* ---------- toast ---------- */
#toast {
  position: fixed; z-index: 5; left: 50%; top: 18px; transform: translate(-50%, -12px);
  background: #15161a; color: #f3f4f6; border: 1px solid #2a2d33;
  padding: 11px 16px; border-radius: var(--r-md);
  font-family: var(--font-sans); font-size: 14px; line-height: 1.4;
  opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none;
  max-width: min(560px, calc(100vw - 32px)); text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- tablet + mobile: stack, demo becomes a bottom strip ---------- */
@media (max-width: 900px) {
  :root { --stage-w: 0px; --rail-gap: 0px; }
  #page { width: 100%; margin-left: 0; border-right: 0; box-shadow: none; }
  .column { padding-bottom: calc(min(46vh, 360px) + 48px); }
  #stage { top: auto; bottom: 0; width: 100%; height: min(46vh, 360px); border-top: 1px solid rgba(255,255,255,0.12); }
  #board { width: min(380px, 86%); height: auto; max-height: calc(min(46vh, 360px) - 24px); }
  .lobby { padding: 20px 22px; border-radius: 16px; }
  .dd-num { font-size: 1.9rem; }
  .yc-mark { width: 88px; height: 88px; }
  .lobby-welcome { font-size: 1.8rem; }
  .portrait { width: 108px; height: 108px; }
  .greet-line { font-size: 1.55rem; }
  .lobby-idle { gap: 20px; }
  .lobby-greet { gap: 10px; }
  #sys { left: 16px; right: 16px; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .column { padding-left: 20px; padding-right: 20px; padding-bottom: calc(min(38vh, 300px) + 40px); }
  #stage { height: min(38vh, 300px); }
  .lobby-welcome { font-size: 1.35rem; }
  .greet-line { font-size: 1.2rem; }
  .yc-mark { width: 58px; height: 58px; }
  .portrait { width: 80px; height: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::after { animation: none !important; transition: none !important; }
}

/* ---------- cinematic left column: dark reading surface + title hero + reveal ---------- */
#page { background: rgba(10, 13, 15, 0.66); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #d7dde3; border-right: 0; }
.column { color: #d7dde3; }

.prose h1, .prose h2, .prose h3 { color: #f4f6f8; }
.prose p, .prose li { color: #d7dde3; }
.prose > p:first-of-type { color: #bcc4cd; }
.prose a { color: #ff8a4c; }
.prose strong, .prose b { color: #f4f6f8; }
.prose li::marker { color: var(--accent); }
.prose blockquote { background: rgba(255, 255, 255, 0.05); border-left-color: var(--accent); color: #cfd6dd; }
.prose .pull { color: #f4f6f8; }
.prose pre { background: #0c1014; color: #d7dde3; border-color: rgba(255, 255, 255, 0.08); }
.prose pre .c { color: #7d8792; }
.prose pre .k { color: #ff8a4c; }
.prose code { background: rgba(255, 255, 255, 0.08); color: #e7ebf0; }
.muted { color: #8b949e; }
.prose figcaption { color: #9aa3ad; }
.label-caps { color: #ff8a4c; }
.foot { color: #8b949e; border-top-color: rgba(255, 255, 255, 0.12); }

/* hero: on open, only the title + a down-chevron scroll hint */
.hero { position: relative; min-height: calc(100vh - 2 * clamp(40px, 6vh, 88px)); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.hero h1 { margin: 0; font-family: "Cinzel", var(--font-sans); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: calc(clamp(2.4rem, 4.6vw, 3.7rem) * 0.92); line-height: 1.12; }
.hero .dek { margin: clamp(8px, 1.4vh, 16px) 0 0; font-size: clamp(0.95rem, 1.4vw, 1.25rem); font-weight: 400; line-height: 1.4; color: #9aa3ad; max-width: 34ch; }
.site-mark { position: absolute; top: 0; left: 0; display: block; width: clamp(34px, 3.4vw, 46px); line-height: 0; }
.site-mark svg { width: 100%; height: auto; display: block; }
.scroll-hint { position: fixed; z-index: 4; bottom: clamp(16px, 3vh, 30px); left: var(--rail-gap); width: calc(100% - var(--stage-w) - var(--rail-gap)); padding: 0; border: 0; background: none; cursor: pointer; color: #9aa3ad; display: flex; flex-direction: column; align-items: center; line-height: 0; transition: opacity .5s ease; }
@media (max-width: 900px) { .scroll-hint { display: none; } }
.scroll-hint svg { width: 30px; height: 30px; display: block; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; animation: chevBounce 1.8s ease-in-out infinite; }
.scroll-hint svg:nth-child(2) { margin-top: -15px; opacity: 0.55; animation-delay: 0.22s; }
.scroll-hint:hover { color: #e8eef3; }
.scroll-hint.hide { opacity: 0; pointer-events: none; }
@keyframes chevBounce { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(6px); opacity: 1; } }

/* scroll-reveal: content fades in from the black behind the column */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- try it on yourself: camera button + client-side demo ---------- */
.lobby-cam {
  margin-top: 14px; align-self: center;
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(15, 23, 42, 0.06); color: #1a1a1a;
  border: 1px solid rgba(15, 23, 42, 0.14); border-radius: 999px;
  font: 600 13px var(--font-sans); padding: 8px 15px; cursor: pointer;
  transition: background .15s ease;
}
.lobby-cam:hover { background: rgba(15, 23, 42, 0.1); }
.lobby-cam svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
body.night .lobby-cam { background: rgba(253, 186, 116, 0.12); color: #fdba74; border-color: rgba(253, 186, 116, 0.3); }

body.cam-open { overflow: hidden; }
#cam[hidden] { display: none; }
#cam {
  position: fixed; top: 0; bottom: 0; left: var(--rail-gap); right: var(--stage-w); z-index: 60;
  background: #07090a; color: #e7edf2; font-family: var(--font-sans);
  display: flex; flex-direction: column; gap: 16px; padding: clamp(14px, 2.5vh, 28px);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.35);
}
.cam-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.cam-title { font-size: 1.1rem; font-weight: 600; }
.cam-priv { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: #8b9aa6; }
.cam-top-actions { display: flex; gap: 8px; flex: none; }
.cam-clear, .cam-close {
  background: rgba(255, 255, 255, 0.08); color: #e7edf2; border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-sm); font: 600 13px var(--font-sans); padding: 7px 12px; cursor: pointer;
}
.cam-clear:hover, .cam-close:hover { background: rgba(255, 255, 255, 0.16); }

.cam-main { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.cam-feed { position: relative; width: min(100%, 760px); background: #000; border-radius: var(--r-md); overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.cam-video { display: block; width: 100%; height: auto; transform: scaleX(-1); background: #000; }
.cam-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.cam-sys { position: absolute; top: 10px; left: 12px; display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: #c9d3d0; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); pointer-events: none; }
.cam-rec { width: 7px; height: 7px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 6px #ff4d4d; animation: blink 1.6s steps(1) infinite; }
.cam-status { position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 20px; background: rgba(7, 9, 10, 0.74); color: #e7edf2; font-size: 15px; line-height: 1.5; }
.cam-shoot { font-size: 15px; padding: 12px 24px; }
.cam-shoot:disabled { opacity: 0.5; cursor: default; }

.cam-reel-wrap { flex: none; }
.cam-reel { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; min-height: 92px; }
.cam-reel:empty::after { content: "Try different angles and lighting to see how well the software matches to past photos."; color: #5b6670; font-size: 13px; max-width: 60ch; }
.cam-cell { flex: none; width: 92px; margin: 0; }
.cam-thumb { display: block; width: 92px; height: 92px; border-radius: 8px; border: 2px solid #3a4652; background: #000; }
.cam-cap { margin-top: 4px; font-size: 11px; line-height: 1.3; color: #b7c2cc; }
.cam-cap b { color: #e7edf2; }
.cam-anchor .cam-thumb { border-color: #5bd6ff; }
.cam-match .cam-thumb { border-color: #36d98a; }
.cam-maybe .cam-thumb { border-color: #ffb224; }
.cam-new .cam-thumb { border-color: #ff5247; }
