/* Device tests (/tools/*): photo hero, then the instrument. Uses the tokens from app.css. */
.dt-hero { position: relative; min-height: min(70dvh, 680px); display: grid; align-items: end; overflow: hidden; isolation: isolate; padding: 110px var(--gutter) clamp(28px, 5vh, 56px); }
.dt-hero-bg { position: absolute; inset: 0; z-index: -2; }
.dt-hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.dt-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 11, 13, 0.65) 0%, rgba(10, 11, 13, 0) 30%, rgba(10, 11, 13, 0.3) 55%, rgba(10, 11, 13, 0.96) 100%), linear-gradient(90deg, rgba(10, 11, 13, 0.8), rgba(10, 11, 13, 0) 70%); }
.dt-hero-copy { display: grid; gap: 14px; justify-items: start; max-width: 52rem; }
.dt-hero-copy .back { margin: 0; }
.dt-hero h1 { font-size: clamp(3.4rem, 11vw, 9.5rem); line-height: 0.82; }
.dt-priv { margin: 0; display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font: 500 0.78rem/1.3 var(--mono); color: var(--ink); }
.dt-priv span { color: #3ddc84; font-size: 0.7rem; }

.dt-sec { padding-top: clamp(40px, 6vw, 80px); }
.dt-sec h2 { font-size: clamp(2.2rem, 6vw, 4.6rem); margin-bottom: 20px; }
#test { padding-top: clamp(20px, 3vw, 36px); scroll-margin-top: 80px; }

/* ---------- the instrument shell ---------- */
.dt-panel [hidden], .dt-panel[hidden] { display: none !important; }
.dt-panel { border: 1px solid var(--line); border-radius: 20px; background: var(--bg2); padding: clamp(16px, 3vw, 32px); display: grid; gap: 20px; min-width: 0; }
.dt-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.dt-sel, .dt-vol { display: inline-flex; gap: 10px; align-items: center; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font: 500 0.78rem/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); max-width: 100%; }
.dt-sel select { min-width: 0; max-width: 46vw; background: transparent; color: var(--ink); border: 0; font: 400 0.92rem var(--body); text-transform: none; letter-spacing: 0; padding: 6px 0; }
.dt-sel select option { background: var(--bg2); }
.dt-vol input { width: clamp(100px, 22vw, 200px); accent-color: var(--accent); }
.dt-vol b { color: var(--ink); min-width: 4ch; }
.dt-chk { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; font-size: 0.92rem; color: var(--ink); cursor: pointer; }
.dt-chk input { width: 18px; height: 18px; accent-color: var(--accent); }
.dt-chk small { color: var(--mute); }
.dt-status { margin: 0; font: 400 0.9rem/1.45 var(--mono); color: var(--mute); }
.dt-status.is-err { color: #ff8a8a; }
.dt-read { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.dt-read div { box-shadow: inset -1px -1px 0 var(--line); margin: 0 -1px -1px 0; padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.dt-read dt { font: 500 0.7rem/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.dt-read dd { margin: 0; font: 700 1.25rem/1.15 var(--display); font-stretch: 85%; overflow-wrap: anywhere; }
.dt-result { border-radius: 14px; padding: 18px 20px; border: 1px solid var(--line); background: var(--bg); font-size: 1.05rem; }
.dt-result b { display: block; font: 800 clamp(1.5rem, 3.4vw, 2.3rem)/1 var(--display); font-stretch: 76%; margin-bottom: 8px; }
.dt-result.ok { border-color: rgba(61, 220, 132, 0.6); } .dt-result.ok b { color: #3ddc84; }
.dt-result.warn { border-color: rgba(255, 122, 47, 0.7); } .dt-result.warn b { color: var(--accent); }
.dt-result.bad { border-color: rgba(255, 98, 98, 0.7); } .dt-result.bad b { color: #ff7070; }
.dt-result p { margin: 0; color: rgba(244, 241, 234, 0.85); }
.dt-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.dt-step { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.dt-step > b { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #130a04; font: 700 1rem var(--mono); }
.dt-step h3, .sp-card h3, .kb-combos h3, .kb-log h3, .px-marks h3 { font-size: 1.5rem; margin-bottom: 6px; }
.dt-step p, .sp-card p, .kb-combos p { margin: 0 0 12px; color: var(--mute); font-size: 0.95rem; }
.dt-step audio { display: block; width: 100%; max-width: 320px; margin-top: 12px; }
.dt-panel .btn:disabled, .dt-panel .chip-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.dt-panel canvas { display: block; width: 100%; border-radius: 10px; background: #050607; }
.dt-panel figure { margin: 0; min-width: 0; }
.dt-panel figcaption { margin-top: 6px; font: 400 0.72rem/1.3 var(--mono); color: var(--mute); text-transform: uppercase; letter-spacing: 0.06em; }

/* mic */
.mic-stage { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.mic-meter { position: relative; height: 34px; border-radius: 8px; background: linear-gradient(90deg, #1d3a2a 0 70%, #43391a 70% 90%, #4a1f1f 90%); overflow: visible; margin-bottom: 22px; }
.mic-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 8px; background: linear-gradient(90deg, #3ddc84 0, #3ddc84 70%, #ffc23d 85%, #ff5a5a 100%); background-size: var(--full, 100%) 100%; transition: width 60ms linear; }
.mic-peak { position: absolute; top: -4px; bottom: -4px; width: 3px; left: 0; background: var(--ink); border-radius: 2px; }
.mic-scale { position: absolute; left: 0; right: 0; top: 40px; height: 14px; }
.mic-scale b { position: absolute; transform: translateX(-50%); font: 400 0.7rem/1 var(--mono); color: var(--mute); }
.mic-scale b:first-child { transform: none; } .mic-scale b:last-child { transform: translateX(-100%); }
.mic-big { text-align: right; } .mic-big b { display: block; font: 800 clamp(2.4rem, 6vw, 4rem)/0.9 var(--display); font-stretch: 70%; font-variant-numeric: tabular-nums; }
.mic-big span { font: 400 0.72rem var(--mono); color: var(--mute); text-transform: uppercase; }
.mic-graphs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* webcam */
.cam-stage { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cam-view { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #050607 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5a39c' stroke-width='1.4'%3E%3Cpath d='M15 10l5-3v10l-5-3z'/%3E%3Crect x='3' y='6' width='12' height='12' rx='2'/%3E%3C/svg%3E") center / 56px no-repeat; }
.cam-view video { width: 100%; height: 100%; object-fit: contain; display: block; }
.cam-view.is-mirror video { transform: scaleX(-1); }
.cam-grid { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent calc(33.33% - 1px), rgba(255, 255, 255, 0.5) 33.33%, transparent calc(33.33% + 1px), transparent calc(66.66% - 1px), rgba(255, 255, 255, 0.5) 66.66%, transparent calc(66.66% + 1px)), linear-gradient(180deg, transparent calc(33.33% - 1px), rgba(255, 255, 255, 0.5) 33.33%, transparent calc(33.33% + 1px), transparent calc(66.66% - 1px), rgba(255, 255, 255, 0.5) 66.66%, transparent calc(66.66% + 1px)); }
.cam-badge { position: absolute; left: 10px; top: 10px; padding: 6px 10px; border-radius: 999px; background: rgba(10, 11, 13, 0.72); font: 500 0.75rem/1 var(--mono); }
.cam-side { display: grid; gap: 14px; min-width: 0; }
.cam-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.cam-shot { display: grid; gap: 6px; font: 500 0.78rem var(--mono); color: var(--accent); }
.cam-shot img { border-radius: 10px; }
.cam-ladder { display: grid; gap: 12px; }
.cam-sizes { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 8px; }
.cam-sizes li { display: flex; justify-content: space-between; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font: 500 0.85rem var(--mono); }
.cam-sizes b { font-weight: 500; color: var(--mute); }
.cam-sizes .yes b { color: #3ddc84; } .cam-sizes .no b { color: #ff7070; }

/* keyboard */
.kb-scroll { overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 6px; border-radius: 12px; }
.kb { display: flex; gap: 14px; min-width: 860px; }
.kb-block { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(6, 42px); gap: 4px; }
.kb-main { flex: 60; } .kb-nav { flex: 12; } .kb-num { flex: 16; }
.kk { display: grid; place-items: center; padding: 0 2px; border-radius: 7px; background: #191b20; border: 1px solid rgba(244, 241, 234, 0.08); box-shadow: 0 2px 0 #050607; font: 500 0.68rem/1 var(--mono); color: var(--mute); white-space: nowrap; overflow: hidden; user-select: none; transition: background 0.12s, color 0.12s; }
.kk.done { color: var(--ink); border-color: rgba(61, 220, 132, 0.75); background: rgba(61, 220, 132, 0.12); }
.kk.down { background: var(--accent); color: #130a04; border-color: var(--accent); transform: translateY(1px); box-shadow: none; }
.kk.chat { border-color: #ff5a5a; background: rgba(255, 90, 90, 0.22); color: var(--ink); }
.dt-panel.is-live .kb-scroll { outline: 1px solid rgba(255, 122, 47, 0.5); outline-offset: 4px; }
.kb-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; }
.kb-combos, .kb-log, .px-marks { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--bg); min-width: 0; }
.kb-combos ol, .kb-log ol, .px-marks ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.kb-combos li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.95rem; }
.kb-combos li b { font: 500 0.8rem var(--mono); color: var(--mute); }
.kb-combos li i { font: 500 0.72rem var(--mono); font-style: normal; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mute); min-width: 7ch; text-align: right; }
.kb-combos li.pass i { color: #3ddc84; } .kb-combos li.part i { color: var(--accent); }
.kb-log li { display: flex; justify-content: space-between; gap: 10px; font: 400 0.8rem var(--mono); color: var(--mute); }
.kb-log li b { color: var(--ink); font-weight: 500; }
.kb-empty { color: var(--mute); font-size: 0.9rem; }

/* dead pixel */
.px-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 110px), 1fr)); gap: 8px; }
.px-sw { aspect-ratio: 16 / 10; border-radius: 10px; border: 1px solid var(--line); display: flex; align-items: flex-end; padding: 8px; }
.px-sw span { padding: 4px 8px; border-radius: 999px; background: rgba(10, 11, 13, 0.75); color: var(--ink); font: 500 0.72rem var(--mono); }
.px-marks li { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.px-marks li b { font: 500 0.85rem var(--mono); }
.px-full { position: fixed; inset: 0; z-index: 300; background: #000; cursor: crosshair; touch-action: manipulation; }
.px-full.ramp { background: linear-gradient(90deg, #000, #fff); }
.px-bar { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 6px; align-items: center; padding: 6px; border-radius: 999px; background: rgba(10, 11, 13, 0.82); color: var(--ink); font: 500 0.8rem var(--mono); transition: opacity 0.4s; max-width: calc(100vw - 24px); cursor: default; }
.px-bar.is-hidden { opacity: 0; pointer-events: none; }
.px-bar button { min-height: 40px; padding: 0 14px; border-radius: 999px; background: rgba(244, 241, 234, 0.12); }
.px-bar span { padding: 0 6px; white-space: nowrap; }
.px-dot { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 2px solid #ff2fd0; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5); }

/* speaker */
.sp-stage { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; justify-items: center; }
.sp-cone { display: grid; justify-items: center; gap: 8px; font: 500 0.75rem var(--mono); text-transform: uppercase; color: var(--mute); }
.sp-cone i { width: clamp(64px, 14vw, 120px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #2a2c31 0 18%, #0d0e11 19% 42%, #23252a 43% 64%, #0d0e11 65%); border: 2px solid rgba(244, 241, 234, 0.12); transform: scale(calc(1 + var(--lv, 0) * 0.14)); box-shadow: 0 0 calc(var(--lv, 0) * 40px) rgba(255, 122, 47, calc(var(--lv, 0) * 0.9)); transition: transform 50ms linear; }
.sp-play { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.sp-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--bg); display: grid; gap: 10px; align-content: start; }
.sp-card p { margin: 0; }
.sp-row, .sp-ans { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-out { min-height: 1.4em; color: var(--ink) !important; font-size: 0.95rem; }
.sp-freq { position: relative; display: grid; gap: 6px; }
.sp-freq b { font: 800 2rem/1 var(--display); font-stretch: 76%; font-variant-numeric: tabular-nums; }
.sp-freq i { display: block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--p, 0%), rgba(244, 241, 234, 0.12) var(--p, 0%)); }

/* ---------- reading guide, gear, faq, more ---------- */
.dt-howl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.dt-howl div { border-top: 2px solid var(--accent); padding-top: 12px; }
.dt-howl dt { font: 800 1.35rem/1 var(--display); font-stretch: 80%; margin-bottom: 8px; }
.dt-howl dd { margin: 0; color: var(--mute); }
.dt-gear .disclose { margin-bottom: 16px; }
.dt-gear-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; margin-bottom: 16px; }
.dt-vcard { border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: var(--bg2); display: grid; gap: 10px; align-content: start; }
.dt-vcard h3 { font-size: 2rem; }
.dt-vcard p { margin: 0; color: rgba(244, 241, 234, 0.85); }
.dt-vscore { display: flex; gap: 10px; align-items: center; font: 500 0.8rem var(--mono); text-transform: uppercase; }
.dt-best { font-size: 0.92rem; } .dt-best b { color: var(--mute); font: 500 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 6px; }
.dt-vlinks { display: flex; flex-wrap: wrap; gap: 8px 18px; font: 500 0.82rem var(--mono); }
.dt-vlinks a { color: var(--accent); min-height: 32px; display: inline-flex; align-items: center; }
.dt-rposter { aspect-ratio: 4 / 5; }
.dt-faq details { border-top: 1px solid var(--line); padding: 4px 0; max-width: 60rem; }
.dt-faq summary { cursor: pointer; min-height: 52px; display: flex; align-items: center; font: 700 1.2rem/1.2 var(--display); font-stretch: 90%; }
.dt-faq p { margin: 0 0 18px; color: var(--mute); max-width: 62ch; }
.dt-more-t { font-size: clamp(1.8rem, 4vw, 3rem) !important; }
.dt-others { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dt-others a, .dt-hcard { position: relative; display: block; overflow: hidden; border-radius: 16px; isolation: isolate; background: var(--bg2); }
.dt-others a { aspect-ratio: 4 / 3; }
.dt-others img, .dt-hcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.dt-others a:hover img, .dt-hcard:hover img { transform: scale(1.05); }
.dt-others a::after, .dt-hcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 11, 13, 0) 35%, rgba(10, 11, 13, 0.92)); }
.dt-others span { position: absolute; z-index: 2; left: 14px; bottom: 12px; font: 800 1.4rem/1 var(--display); font-stretch: 80%; }
.dt-credit { margin: 20px 0 0; font: 400 0.75rem var(--mono); color: var(--mute); }
.dt-credit a { text-decoration: underline; }

/* hub */
.dt-hub-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.dt-hcard { grid-column: span 2; aspect-ratio: 4 / 5; }
.dt-hcard-a, .dt-hcard:nth-child(2) { grid-column: span 3; aspect-ratio: 16 / 11; }
.dt-hcopy { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 20px; display: grid; gap: 8px; }
.dt-hcopy strong { font: 800 clamp(2rem, 4vw, 3.4rem)/0.9 var(--display); font-stretch: 76%; }
.dt-hcopy small { color: rgba(244, 241, 234, 0.82); font-size: 0.95rem; max-width: 40ch; }
.dt-vchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.dt-vchips .chip-btn { display: inline-flex; align-items: center; }

@media (max-width: 1000px) {
  .cam-stage, .kb-two { grid-template-columns: 1fr; }
  .dt-others { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dt-hcard, .dt-hcard-a, .dt-hcard:nth-child(2) { grid-column: span 3; aspect-ratio: 4 / 5; }
}
@media (max-width: 760px) {
  .dt-hero { min-height: min(62dvh, 560px); }
  .mic-stage { grid-template-columns: 1fr; } .mic-big { text-align: left; }
  .mic-graphs { grid-template-columns: 1fr; }
  .dt-hub-grid { grid-template-columns: 1fr; }
  .dt-hcard, .dt-hcard-a, .dt-hcard:nth-child(2) { grid-column: auto; aspect-ratio: 4 / 3.4; }
  .sp-stage { grid-template-columns: 1fr 1fr; }
  .sp-play { grid-column: 1 / -1; grid-row: 2; }
  .dt-sel select { max-width: 52vw; }
}
@media (prefers-reduced-motion: reduce) { .dt-others img, .dt-hcard img, .sp-cone i, .mic-fill { transition: none; } }
