/* =========================================================
   LOOMTIDE · FEEL LAB
   Styling for the interactive feel toys. Inherits brand
   tokens from loomtide.css; only adds the lab + toy chrome.
   ========================================================= */

/* ---------- global FEEL switch ---------- */
.feel-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  font-family: var(--font-mono);
  user-select: none;
}
.feel-switch .fs-label {
  padding: 0 16px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  align-self: center;
}
.feel-switch button {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 22px;
  border: none;
  border-left: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.feel-switch button.on { background: var(--ink); color: var(--paper); }
.feel-switch button.off-active { background: var(--warn); color: var(--paper); border-color: var(--warn); }
.feel-switch button:not(.on):not(.off-active):hover { background: var(--paper-3); }

/* ---------- a single feel toy ---------- */
.ft {
  border: 1px solid var(--line-strong);
  background: var(--card);
  display: flex;
  flex-direction: column;
}
.ft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ft-head .ft-kicker { color: var(--tide); font-weight: 600; }
.ft-head .ft-file { color: var(--muted); }

.ft-body {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0;
}
@media (max-width: 720px) { .ft-body { grid-template-columns: 1fr; } }

/* ---- the stage (canvas) ---- */
.ft-stage {
  position: relative;
  background:
    radial-gradient(120% 90% at 50% 0%, #1B1626 0%, #141019 70%);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
  border-right: 1px solid var(--line-soft);
}
@media (max-width: 720px) { .ft-stage { border-right: none; border-bottom: 1px solid var(--line-soft); } }
.ft-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ft-stage::after {
  /* faint scanline texture — a quiet nod to the game screen */
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.ft-hint {
  position: absolute;
  bottom: 12px; left: 14px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244,241,234,0.5);
  pointer-events: none;
  display: flex; align-items: center; gap: 8px;
}
.ft-hint::before {
  content: "";
  width: 12px; height: 12px;
  border: 1px solid rgba(244,241,234,0.4);
  border-radius: 50%;
}
.ft-verdict {
  position: absolute;
  top: 12px; right: 14px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  border: 1px solid transparent;
}
.ft-verdict.show { opacity: 1; transform: none; }
.ft-verdict.is-pass { color: var(--paper); background: rgba(47,107,58,0.92); border-color: #6FCF8E; }
.ft-verdict.is-fail { color: var(--paper); background: rgba(181,86,42,0.92); border-color: #C76B43; }

/* ---- the instrument panel ---- */
.ft-panel {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
}
.ft-panel-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.ft-rows { display: flex; flex-direction: column; }
.ft-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  column-gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 13px;
}
.ft-row:last-child { border-bottom: none; }
.ft-label { color: var(--ink-2); }
.ft-val { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.ft-gate {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  min-width: 42px;
  text-align: right;
  color: var(--muted);
}
.ft-gate.is-pass { color: var(--verify); }
.ft-gate.is-fail { color: var(--warn); }
.ft-gate.is-info { color: var(--tide); }

.ft-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---- forgiveness timeline instrument ---- */
.ft-timeline { margin-top: 16px; }
.ftl-track {
  position: relative;
  height: 26px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.ftl-coyote {
  position: absolute;
  top: 0; bottom: 0;
  background: repeating-linear-gradient(45deg, rgba(122,115,99,0.16) 0 5px, transparent 5px 10px);
  border-right: 1px dashed var(--line-strong);
}
.ftl-coyote.on {
  background:
    repeating-linear-gradient(45deg, rgba(47,107,58,0.18) 0 5px, transparent 5px 10px),
    rgba(111,207,142,0.12);
  border-right: 1px solid var(--verify);
}
.ftl-press {
  position: absolute;
  top: -1px; bottom: -1px;
  left: 37.5%;            /* 90ms / 240ms */
  width: 2px;
  background: var(--warn);
}
.ftl-press span {
  position: absolute;
  top: -16px; left: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--warn);
  white-space: nowrap;
}
.ftl-head {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--tide);
  box-shadow: 0 0 6px rgba(31,77,84,0.6);
}
.ftl-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* =========================================================
   SIDE-BY-SIDE COMPARISON (.fc) — feel off | feel on
   ========================================================= */
.fc {
  border: 1px solid var(--line-strong);
  background: var(--card);
}
.fc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 0;
}
.fc-head-l { display: flex; align-items: baseline; gap: 14px; }
.fc-no {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--tide);
  font-weight: 600;
}
.fc-title { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.1; font-weight: 500; white-space: nowrap; }
.fc-file {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 6px;
}
.fc-desc {
  margin: 14px 24px 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 78ch;
  text-wrap: pretty;
}

.fc-stages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 22px 24px 4px;
  cursor: pointer;
}
@media (max-width: 680px) { .fc-stages { grid-template-columns: 1fr; } }

.fc-stage { display: flex; flex-direction: column; }
/* focus is signalled by the active lane lifting forward — no wash over the
   waiting scene, which read as a distracting white overlay. */
.fc-stage .fc-canvas { transition: box-shadow 0.35s ease, border-color 0.35s ease; }
.fc-stage.is-active .fc-canvas { box-shadow: 0 0 0 2px var(--tide), 0 10px 30px -12px rgba(20,16,25,0.5); }
.fc-side-label {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-bottom: 10px;
}
.fc-stage[data-side="off"] .fc-side-label { color: var(--warn); }
.fc-stage[data-side="on"] .fc-side-label { color: var(--verify); }
.fc-dot { width: 9px; height: 9px; border-radius: 50%; }
.fc-stage[data-side="off"] .fc-dot { background: var(--warn); }
.fc-stage[data-side="on"] .fc-dot { background: var(--verify); }
.fc-status {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}
.fc-status.is-play { color: var(--tide); }

.fc-canvas {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #1B1626 0%, #141019 70%);
  border: 1px solid var(--line);
}
.fc-stage[data-side="off"] .fc-canvas { border-color: rgba(199,107,67,0.45); }
.fc-stage[data-side="on"] .fc-canvas { border-color: rgba(47,107,58,0.5); }
.fc-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fc-canvas::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0 1px, transparent 1px 3px);
}
.fc-badge {
  position: absolute;
  left: 50%; top: 14px;
  transform: translateX(-50%) translateY(-8px) scale(0.85);
  z-index: 3;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(20px, 3.4vw, 30px);
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 12px 22px;
  border: 1.5px solid transparent;
  color: var(--paper);
  opacity: 0;
  transition: opacity 0.26s ease, transform 0.34s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 12px 34px -14px rgba(20,16,25,0.7);
}
.fc-badge.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.fc-badge.is-pass { background: rgba(47,107,58,0.95); border-color: #6FCF8E; }
.fc-badge.is-fail { background: rgba(181,86,42,0.95); border-color: #C76B43; }

/* recommended-values table */
.fc-spec { padding: 18px 24px 24px; }
.fc-spec-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  column-gap: 18px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 13px;
}
.fc-spec-row:last-child { border-bottom: none; }
.fc-spec-head {
  border-bottom: 1px solid var(--line-strong);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 12px;
}
.fc-spec-head .fc-c-metric { color: var(--ink); }
.fc-c-metric { color: var(--ink-2); }
.fc-c-off, .fc-c-on { font-variant-numeric: tabular-nums; }
.fc-c-off { color: var(--muted); }
.fc-c-on { color: var(--ink); }
.fc-c-off.is-fail { color: var(--warn); }
.fc-c-on.is-pass { color: var(--verify); font-weight: 500; }
.fc-c-on.is-fail { color: var(--warn); }
.fc-c-off.is-pass { color: var(--verify); }

/* shared coyote timeline (reused under forgiveness spec) */
.fc-timeline { margin-top: 18px; }
.fc-timeline .ftl-track {
  position: relative; height: 26px;
  background: var(--paper-2); border: 1px solid var(--line); overflow: hidden;
}
.fc-timeline .ftl-coyote {
  position: absolute; top: 0; bottom: 0;
  background: repeating-linear-gradient(45deg, rgba(47,107,58,0.18) 0 5px, transparent 5px 10px), rgba(111,207,142,0.12);
  border-right: 1px solid var(--verify);
}
.fc-timeline .ftl-press { position: absolute; top: -1px; bottom: -1px; left: 37.5%; width: 2px; background: var(--warn); }
.fc-timeline .ftl-press span {
  position: absolute; top: -15px; left: 4px;
  font-family: var(--font-mono); font-size: 9px; color: var(--warn); white-space: nowrap;
}
.fc-timeline .ftl-head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--tide); box-shadow: 0 0 6px rgba(31,77,84,0.6); }
.fc-timeline .ftl-axis {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-family: var(--font-mono); font-size: 9px; color: var(--muted);
}

/* sync-replay bar */
.fc-replay {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em;
  padding: 12px 22px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  cursor: pointer; transition: background 0.18s ease;
}
.fc-replay:hover { background: var(--tide); border-color: var(--tide); }

/* =========================================================
   FEEL LAB showcase page scaffold
   ========================================================= */
.lab-nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(244,241,234,0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.lab-nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.lab-back {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 8px;
}
.lab-back:hover { color: var(--tide); }

.lab-hero { padding: 80px 0 34px; }
.lab-hero .eyebrow { margin-bottom: 22px; }
.lab-hero h1 {
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 500;
  max-width: 18ch;
  margin: 0;
}
.lab-hero .lede { margin-top: 26px; max-width: 56ch; }

.lab-controls {
  position: sticky;
  top: var(--nav-h);
  z-index: 40;
  background: rgba(244,241,234,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  margin-top: 18px;
}
.lab-controls .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.lab-controls .lc-cap {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  max-width: 46ch;
  line-height: 1.5;
}
.lab-controls .lc-cap b { color: var(--ink); font-weight: 600; }

.lab-toys { padding: 48px 0 40px; display: flex; flex-direction: column; gap: 64px; }
.toy-block { display: grid; grid-template-columns: 0.8fr 2.2fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .toy-block { grid-template-columns: 1fr; gap: 24px; } }
.toy-intro .ti-no {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tide);
  margin-bottom: 14px;
}
.toy-intro h2 { font-size: clamp(26px, 3.2vw, 38px); line-height: 1.1; margin: 0 0 16px; }
.toy-intro p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.toy-intro .ti-receipt {
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  border-left: 2px solid var(--tide);
  padding-left: 12px;
  line-height: 1.6;
}

.lab-usage { background: var(--ink); color: var(--paper); padding: 80px 0; }
.lab-usage .eyebrow { color: #8FD0BE; }
.lab-usage .eyebrow::before { background: #8FD0BE; }
.lab-usage h2 { font-size: clamp(28px, 3.6vw, 44px); margin: 4px 0 0; color: var(--paper); }
.lab-usage .lede { margin-top: 22px; color: rgba(244,241,234,0.78); max-width: 60ch; }
.lab-usage .code {
  margin-top: 34px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  padding: 22px 24px;
  color: rgba(244,241,234,0.9);
  overflow-x: auto;
}
.lab-usage .code .c { color: #8FD0BE; }
.lab-usage .code .t { color: #C9C4B8; }
.lab-usage .ux-grid {
  margin-top: 34px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
@media (max-width: 760px) { .lab-usage .ux-grid { grid-template-columns: 1fr; } }
.lab-usage .ux {
  border: 1px solid rgba(255,255,255,0.14);
  padding: 20px;
}
.lab-usage .ux .k {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: #8FD0BE; margin-bottom: 10px;
}
.lab-usage .ux code { font-family: var(--font-mono); font-size: 13px; color: var(--paper); }
.lab-usage .ux p { margin: 8px 0 0; font-size: 14px; color: rgba(244,241,234,0.7); line-height: 1.5; }
