/* ─── eyesopen.io — "optician's office" ─────────────────────────── */

@font-face {
  font-family: "Archivo";
  src: url(/fonts/archivo.woff2) format("woff2-variations"), url(/fonts/archivo.woff2) format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url(/fonts/instrument-serif-italic.woff2) format("woff2");
  font-style: italic; font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url(/fonts/instrument-serif.woff2) format("woff2");
  font-style: normal; font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url(/fonts/jetbrains-mono.woff2) format("woff2-variations"), url(/fonts/jetbrains-mono.woff2) format("woff2");
  font-weight: 100 800; font-display: swap;
}

:root {
  --paper: #f2ede2;
  --paper-2: #ebe4d5;
  --card: #f8f5ee;
  --ink: #17150f;
  --ink-2: #5d574b;
  --ink-3: #8f8778;
  --rule: #d3c9b5;
  --red: #e0412a;
  --red-soft: #f6d3c9;
  --ok: #2c7a4b;
  --warn: #c0840e;
  --screen: #12110d;

  --sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 14px;
  --shadow: 0 1px 0 rgba(23, 21, 15, .06), 0 10px 30px -18px rgba(23, 21, 15, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  /* faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.05 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
h1, h2, h3 { margin: 0; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }

/* ─── masthead ─────────────────────────────────────────────────── */
.masthead {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-eyes { display: flex; gap: 2px; }
.logo-eyes svg { width: 30px; height: auto; display: block; }
.wordmark {
  font-weight: 800; font-stretch: 125%; font-size: 20px; letter-spacing: -.01em;
}
.wordmark span { color: var(--red); }

.tabs { display: flex; gap: 4px; margin-left: auto; }
.tabs a {
  display: flex; align-items: baseline; gap: 7px;
  padding: 8px 12px; border-radius: 999px;
  text-decoration: none; font-weight: 550; font-size: 14.5px;
  color: var(--ink-2);
  transition: background .2s, color .2s;
}
.tabs a i { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.tabs a:hover { color: var(--ink); background: var(--paper-2); }
.tabs a[aria-current="page"] { color: var(--paper); background: var(--ink); }
.tabs a[aria-current="page"] i { color: var(--red); }

.cam-pill {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--rule); background: var(--card);
  border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.cam-pill b { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.cam-pill[data-state="on"] b { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); animation: pulse 2s infinite; }
.cam-pill[data-state="error"] b { background: var(--warn); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }

/* ─── layout ───────────────────────────────────────────────────── */
main { padding: 0 clamp(16px, 4vw, 48px); max-width: 1320px; margin: 0 auto; }
.view { padding: 40px 0 24px; animation: rise .45s cubic-bezier(.2, .7, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.view-head { max-width: 780px; margin-bottom: 28px; }
.kicker {
  margin: 0 0 10px; font-family: var(--mono); font-size: 12px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--red);
}
.view-head h1 {
  font-size: clamp(36px, 5.4vw, 64px); line-height: 1; letter-spacing: -.02em;
  font-weight: 800; font-stretch: 112%;
}
.view-head h1 em { font-size: 1.08em; letter-spacing: -.01em; }
.lede { font-size: 18px; color: var(--ink-2); margin: 16px 0 0; max-width: 640px; }

.card {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.card h3 {
  font-size: 12px; font-family: var(--mono); font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
  margin-bottom: 14px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-head h3 { margin: 0; }

/* ─── buttons & fields ─────────────────────────────────────────── */
.btn {
  appearance: none; cursor: pointer;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  border-radius: 999px; padding: 9px 18px; font-weight: 650; font-size: 15px;
  transition: transform .12s, background .2s, color .2s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; background: transparent; color: var(--ink); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }
.btn-primary:disabled { background: var(--red); color: #fff; }
.btn-lg { padding: 13px 26px; font-size: 17px; }

.chip {
  appearance: none; cursor: pointer; border: 1px solid var(--rule); background: var(--card);
  border-radius: 999px; padding: 6px 13px; font-size: 13.5px; font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover:not(:disabled) { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chip-stop:not(:disabled) { color: var(--red); border-color: var(--red-soft); }
.chip-stop:hover:not(:disabled) { background: var(--red); color: #fff; border-color: var(--red); }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
select {
  appearance: none; border: 1px solid var(--rule); background: var(--card);
  border-radius: 10px; padding: 8px 34px 8px 12px; font-size: 14px; font-weight: 550;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
  max-width: 100%; text-overflow: ellipsis;
}
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--red); width: 16px; height: 16px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ─── the stage (video frame) ──────────────────────────────────── */
.stage {
  position: relative; aspect-ratio: 16 / 10; width: 100%;
  border-radius: var(--radius); overflow: hidden;
  background: var(--paper-2); border: 1px solid var(--rule);
  isolation: isolate;
}
.stage[data-live="true"] { background: var(--screen); border-color: var(--screen); }
.stage video, .stage canvas.overlay {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
.stage video { opacity: 0; transition: opacity .4s; }
.stage[data-live="true"] video { opacity: 1; }
.mirror { transform: scaleX(-1); }
.stage canvas.overlay { pointer-events: none; }
.stage:fullscreen { border-radius: 0; aspect-ratio: auto; }

.crop { position: absolute; width: 22px; height: 22px; border: 2px solid var(--ink); z-index: 3; opacity: .7; pointer-events: none; }
.stage[data-live="true"] .crop { border-color: rgba(255, 255, 255, .75); }
.crop.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.crop.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.crop.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; }
.crop.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }

.grid-overlay {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .2s;
  background:
    linear-gradient(to right, transparent calc(33.33% - .5px), rgba(255,255,255,.45) calc(33.33% - .5px) calc(33.33% + .5px), transparent calc(33.33% + .5px) calc(66.66% - .5px), rgba(255,255,255,.45) calc(66.66% - .5px) calc(66.66% + .5px), transparent calc(66.66% + .5px)),
    linear-gradient(to bottom, transparent calc(33.33% - .5px), rgba(255,255,255,.45) calc(33.33% - .5px) calc(33.33% + .5px), transparent calc(33.33% + .5px) calc(66.66% - .5px), rgba(255,255,255,.45) calc(66.66% - .5px) calc(66.66% + .5px), transparent calc(66.66% + .5px));
}
.grid-overlay::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%);
  background: linear-gradient(var(--red), var(--red)) center / 2px 100% no-repeat, linear-gradient(var(--red), var(--red)) center / 100% 2px no-repeat;
}
.stage[data-grid="true"] .grid-overlay { opacity: 1; }

.flash { position: absolute; inset: 0; background: #fff; opacity: 0; z-index: 4; pointer-events: none; }
.flash.go { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: .9; } 100% { opacity: 0; } }

.hud {
  position: absolute; left: 44px; top: 16px; z-index: 3; display: none; gap: 10px;
  font-family: var(--mono); font-size: 12px; color: #fff; letter-spacing: .04em;
}
.hud span { background: rgba(0, 0, 0, .45); padding: 3px 8px; border-radius: 6px; }
.hud .rec { color: #fff; background: var(--red); font-weight: 700; }
.stage[data-live="true"] .hud { display: flex; }

/* placeholder: the eye chart */
.placeholder {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 20px; text-align: center;
}
.stage[data-live="true"] .placeholder { display: none; }
.chart { display: grid; gap: clamp(2px, .6vw, 8px); width: min(100%, 480px); }
.chart .row { display: grid; grid-template-columns: 2.2em 1fr 3.8em; align-items: center; }
.chart .row s {
  text-decoration: none; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
}
.chart .row s:last-child { text-align: right; }
.chart .row span {
  font-weight: 800; font-stretch: 100%; line-height: .95; letter-spacing: .06em; text-align: center;
}
.chart .r1 span { font-size: clamp(46px, 8vw, 92px); }
.chart .r2 span { font-size: clamp(32px, 5.2vw, 58px); }
.chart .r3 span { font-size: clamp(24px, 3.7vw, 40px); }
.chart .r4 { position: relative; padding-bottom: 6px; }
.chart .r4 span { font-size: clamp(18px, 2.6vw, 28px); }
.chart .r4::after { content: ""; position: absolute; left: 2.2em; right: 3.8em; bottom: 0; height: 2px; background: var(--red); }
.chart .r5 span { font-size: 11px; letter-spacing: .14em; color: var(--ink-2); padding-top: 4px; }
.placeholder-note { margin: 0; font-size: 13px; color: var(--ink-2); max-width: 440px; }
.placeholder-note.error { color: var(--red); font-weight: 600; }

/* gate (for tracking stages when camera is off / model loading) */
.gate {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 24px; background: var(--paper-2);
}
.gate:empty { display: none; }
.gate p { margin: 0; color: var(--ink-2); max-width: 360px; }
.gate .gate-title { font-weight: 800; font-stretch: 112%; font-size: 22px; color: var(--ink); }
.stage[data-live="true"] .gate { background: rgba(18, 17, 13, .72); color: #fff; }
.stage[data-live="true"] .gate p { color: rgba(255, 255, 255, .8); }
.stage[data-live="true"] .gate .gate-title { color: #fff; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }

.stage-caption {
  position: absolute; left: 0; right: 0; bottom: 10px; margin: 0; z-index: 3; text-align: center;
  font-family: var(--mono); font-size: 12px; color: rgba(255, 255, 255, .85);
}
.stage[data-live="false"] .stage-caption { display: none; }

/* ─── 01 camera check ──────────────────────────────────────────── */
.cam-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 12px; }
.toolbar .field { flex: 1 1 180px; }
.toolbar .field:nth-child(2) { flex: 0 1 170px; }
.tool-buttons { display: flex; flex-wrap: wrap; gap: 6px; }

.specs { margin: 0; display: grid; gap: 0; }
.specs > div {
  display: flex; align-items: baseline; gap: 8px; padding: 7px 0;
  border-bottom: 1px dotted var(--rule);
}
.specs dt { color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.specs dd {
  margin: 0 0 0 auto; font-family: var(--mono); font-size: 13.5px; font-weight: 600; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.specs.tight > div { padding: 4px 0; }

.meter-block { margin-top: 16px; }
.meter-label { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; }
.meter-label span:last-child { font-family: var(--mono); font-size: 12.5px; color: var(--ink); font-weight: 600; }
.meter { position: relative; height: 10px; border-radius: 99px; background: var(--paper-2); border: 1px solid var(--rule); overflow: hidden; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink); border-radius: 99px; transition: width .35s ease; z-index: 1; }
.meter .zone { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(44, 122, 75, .18) 0 4px, transparent 4px 8px); }
.zone-light { left: 28%; width: 50%; }
.zone-sharp { left: 40%; width: 60%; }
.zone-smooth { left: 60%; width: 40%; }
.meter.warn i { background: var(--warn); }
.meter.bad i { background: var(--red); }
.meter.ok i { background: var(--ok); }

.lower-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.lower-grid .caps { grid-column: 1 / -1; }

.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.findings li {
  display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 10px 0;
  border-bottom: 1px dotted var(--rule);
}
.findings li:last-child { border-bottom: 0; }
.findings .mark {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: #fff; margin-top: 1px;
}
.findings [data-level="ok"] .mark { background: var(--ok); }
.findings [data-level="warn"] .mark { background: var(--warn); }
.findings [data-level="bad"] .mark { background: var(--red); }
.findings [data-level="info"] .mark { background: var(--ink-3); }
.findings b { display: block; font-weight: 650; }
.findings p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }

.mic .field { margin: 12px 0; }
.vu { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 34px; margin: 6px 0 12px; }
.vu i { border-radius: 3px; background: var(--paper-2); border: 1px solid var(--rule); transition: background .06s; }
.vu i.on { background: var(--ink); border-color: var(--ink); }
.vu i.on.hot { background: var(--warn); border-color: var(--warn); }
.vu i.on.clip { background: var(--red); border-color: var(--red); }
.vu i.peak { background: var(--ink-2); }
.mic-row { display: flex; align-items: center; gap: 14px; }
.mic-verdict { margin: 10px 0 0; font-size: 14px; min-height: 1.5em; }

.caps summary { display: flex; align-items: baseline; gap: 12px; cursor: pointer; list-style: none; }
.caps summary::-webkit-details-marker { display: none; }
.caps summary h3 { margin: 0; }
.caps summary h3::before { content: "+ "; color: var(--red); }
.caps[open] summary h3::before { content: "− "; }
.caps pre { margin: 14px 0 0; font-size: 12.5px; white-space: pre-wrap; color: var(--ink-2); max-height: 360px; overflow: auto; }

/* ─── 02 eye tracking ──────────────────────────────────────────── */
.eyes-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.eyes-side { display: grid; gap: 16px; }
.big-stat { display: flex; align-items: baseline; gap: 10px; }
.big-stat .num { font-size: 76px; line-height: .9; font-weight: 800; font-stretch: 125%; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.big-stat .unit { font-family: var(--serif); font-style: italic; font-size: 26px; color: var(--ink-2); }
.big-stat .num.bump { animation: bump .25s ease-out; color: var(--red); }
@keyframes bump { 40% { transform: scale(1.08); } }
.sub-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 10px; padding-top: 14px; border-top: 1px dotted var(--rule); }
.sub-stats b { display: block; font-family: var(--mono); font-size: 17px; }
.sub-stats span { font-size: 12px; color: var(--ink-2); }

.open-bars { display: grid; gap: 10px; }
.open-bar { display: grid; grid-template-columns: 76px 1fr 44px; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.open-bar .meter { height: 14px; }
.open-bar .meter i { transition: width .08s linear; }
.open-bar b { font-size: 13px; text-align: right; color: var(--ink); }

.gaze-wrap { display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: center; }
.gaze-grid {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  aspect-ratio: 16 / 10; width: 132px;
}
.gaze-grid span { border-radius: 5px; background: var(--paper-2); border: 1px solid var(--rule); transition: background .15s; }
.gaze-grid span.on { background: var(--ink); border-color: var(--ink); }
.gaze-grid i {
  position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 3px rgba(224, 65, 42, .25); left: 50%; top: 50%;
  transition: left .08s linear, top .08s linear;
}
.gaze-text b { display: block; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 28px; line-height: 1.1; margin-bottom: 6px; }

/* ─── 03 gaze lab ──────────────────────────────────────────────── */
.lab-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 38px 1fr; gap: 10px; color: var(--ink-2); }
.steps li::before {
  content: counter(s); font-weight: 800; font-stretch: 125%; font-size: 24px; color: var(--red); line-height: 1.1;
}
.steps b { color: var(--ink); }
.lab-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 10px; }
.frame-guide {
  position: absolute; left: 50%; top: 48%; width: 26%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%);
  border: 2px dashed rgba(255, 255, 255, .55); border-radius: 50%; z-index: 2; pointer-events: none;
  transition: border-color .2s;
}
.frame-guide.good { border-color: #6fd29a; border-style: solid; }
.stage[data-live="false"] .frame-guide { display: none; }

.calib { position: fixed; inset: 0; z-index: 100; background: var(--paper); cursor: none; }
.calib canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.calib-intro {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 12px; padding: 24px; cursor: default;
}
.calib-intro h2 { font-size: clamp(32px, 5vw, 56px); font-weight: 800; font-stretch: 112%; letter-spacing: -.02em; line-height: 1; }
.calib-intro p { margin: 0; color: var(--ink-2); max-width: 460px; }
.calib-face { font-family: var(--mono); font-size: 13px; padding: 6px 12px; border-radius: 99px; background: var(--paper-2); margin: 8px 0; }
.calib-face.good { background: #d7ecdc; color: var(--ok); }
.calib-bar {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 999px; box-shadow: var(--shadow);
  cursor: default; opacity: .35; transition: opacity .2s;
}
.calib-bar:hover { opacity: 1; }
.calib-bar .mono { font-size: 12px; color: var(--ink-2); margin-right: 6px; }
.calib-chart {
  position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr);
  place-items: center; pointer-events: none; z-index: 1;
}
.calib-chart span {
  font-weight: 800; font-size: clamp(60px, 12vw, 180px); color: var(--rule); transition: color .25s, transform .25s;
}
.calib-chart span.hit { color: var(--ink); transform: scale(1.08); }

/* ─── 04 staring contest ───────────────────────────────────────── */
.stare-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px) minmax(0, 1fr); gap: 28px; align-items: center; }
.stare-you .stage { aspect-ratio: 4 / 3; }
.stare-label { text-align: center; font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--ink-2); margin: 10px 0 0; }
.stare-center { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.stare-state { font-family: var(--serif); font-style: italic; font-size: 26px; min-height: 1.3em; }
.stare-state.lose { color: var(--red); }
.stare-state.win { color: var(--ok); }
.stare-timer { font-size: clamp(56px, 7vw, 92px); font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.stare-records { width: 100%; max-width: 260px; }
.the-eye { display: grid; place-items: center; aspect-ratio: 4 / 3; }
.the-eye svg { width: 100%; height: auto; max-width: 460px; }

/* ─── footer & toast ───────────────────────────────────────────── */
.footer {
  max-width: 1320px; margin: 40px auto 0; padding: 28px clamp(16px, 4vw, 48px) 40px;
  border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-size: 14px;
}
.footer p { margin: 0; max-width: 680px; }
.seal { color: var(--red); margin-right: 4px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ─── svg eyes ─────────────────────────────────────────────────── */
.eye-svg .sclera { fill: #fffdf7; }
.eye-svg .outline { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linejoin: round; }
.eye-svg .iris { fill: var(--ink); }
.eye-svg .iris-ring { fill: none; stroke: var(--red); stroke-width: 2.5; }
.eye-svg .iris-lines { stroke: rgba(255, 255, 255, .18); stroke-width: 1.2; }
.eye-svg .pupil { fill: #000; }
.eye-svg .glint { fill: #fff; }
.eye-svg .lid { fill: var(--paper-2); }
.eye-svg .lid-edge { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; }
.eye-svg .veins { fill: none; stroke: var(--red); stroke-width: 1.1; stroke-linecap: round; }
.logo-eyes .eye-svg .outline, .logo-eyes .eye-svg .lid-edge { stroke-width: 7; }
.logo-eyes .eye-svg .iris-ring, .logo-eyes .eye-svg .iris-lines, .logo-eyes .eye-svg .glint { display: none; }

/* ─── responsive ───────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .cam-grid, .eyes-grid { grid-template-columns: 1fr; }
  .eyes-side { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .stare-grid { grid-template-columns: 1fr 1fr; }
  .stare-center { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 820px) {
  .masthead { flex-wrap: wrap; gap: 10px 16px; }
  .tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .tabs a { white-space: nowrap; }
  .cam-pill { margin-left: auto; }
  .lower-grid, .lab-grid { grid-template-columns: 1fr; }
  .stage { aspect-ratio: 4 / 3; }
}
@media (max-width: 560px) {
  .tabs a i { display: none; }
  #camStage[data-live="false"] { aspect-ratio: auto; min-height: 380px; }
  .placeholder { position: relative; inset: auto; min-height: 380px; padding: 40px 20px; }
  .chart .row { grid-template-columns: 0 1fr 0; }
  .chart .row s { visibility: hidden; }
  .chart .r4::after { left: 15%; right: 15%; }
  .caps summary { flex-direction: column; gap: 2px; }
  .stare-grid { grid-template-columns: 1fr; }
  .gaze-wrap { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
