/* QA Leap showcase — page-specific styles. Tokens, container, buttons, header &
   footer come from the shared shell (../shared.css). */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink); letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
p { margin: 0; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Small button variant (showcase-only; base .btn / .btn-primary / .btn-ghost are in ../shared.css) */
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 8px; }

/* Sections */
section { padding: 76px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 76px; }
.eyebrow { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-dark); margin-bottom: 12px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; }
.section-head .lead { color: var(--muted); font-size: 17px; margin-top: 10px; max-width: 640px; }
.lead-muted { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); }
.section-caption { margin-top: 26px; color: var(--muted); font-size: 15px; font-style: italic; }

/* Hero */
.hero { padding: 88px 0 72px; background: radial-gradient(1200px 400px at 50% -80px, rgba(0, 184, 248, 0.10), transparent 70%); border-bottom: 1px solid var(--line); }
.hero h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 800; }
.hero .subhead { font-size: clamp(18px, 2.4vw, 22px); color: var(--text); margin-top: 18px; max-width: 720px; }
.hero .intro { color: var(--muted); margin-top: 16px; max-width: 660px; font-size: 17px; }
.hero .cta-row { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-badges { margin-top: 34px; display: flex; gap: 10px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--muted); box-shadow: var(--shadow); }
.pill b { color: var(--ink); }

/* Markdown content */
.md-content { margin-top: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 34px; }
.md-content h1 { font-size: 26px; font-weight: 800; margin: 0 0 8px; }
.md-content h2 { font-size: 19px; font-weight: 700; margin: 26px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.md-content h2:first-of-type { border-top: none; padding-top: 0; }
.md-content h3 { font-size: 16px; font-weight: 700; margin: 18px 0 8px; }
.md-content p { margin: 10px 0; }
.md-content ul, .md-content ol { margin: 10px 0; padding-left: 22px; }
.md-content li { margin: 4px 0; }
.md-content code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 13px; color: var(--ink); }
.md-content pre { background: var(--ink); color: #e6edf3; border-radius: 10px; padding: 16px; overflow-x: auto; }
.md-content pre code { background: none; border: none; color: inherit; padding: 0; }
.md-content table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.md-content th, .md-content td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md-content th { background: var(--bg-soft); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.md-content hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.md-content strong { color: var(--ink); }
.md-scroll { max-height: 620px; overflow-y: auto; }

/* Test case cards (accordion) */
.cases { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.case { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; flex-shrink: 0; }
.case-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; user-select: none; }
.case-id { font-weight: 700; color: var(--accent-dark); font-size: 13px; font-family: ui-monospace, monospace; }
.case-title { font-weight: 600; color: var(--ink); flex: 1; }
.case-prio { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.case-prio.P1 { background: var(--red-soft); color: var(--red); }
.case-prio.P2 { background: var(--amber-soft); color: var(--amber); }
.case-prio.P3 { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
.case-chev { color: var(--muted); transition: transform 0.2s ease; }
.case.open .case-chev { transform: rotate(90deg); }
.case-body { max-height: 0; overflow: hidden; transition: max-height 0.28s ease; border-top: 0 solid var(--line); }
.case.open .case-body { max-height: 560px; border-top-width: 1px; }
.case-body-inner { padding: 16px 18px; font-size: 14px; }
.case-body-inner .label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 12px 0 4px; }
.case-body-inner .label:first-child { margin-top: 0; }
.case-body-inner ol { margin: 0; padding-left: 20px; }
.case-body-inner .expected { background: var(--green-soft); border-radius: 8px; padding: 8px 12px; color: var(--ink); }

/* Bug report card */
.bugcard { margin-top: 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.bugcard-top { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--bg-soft); flex-wrap: wrap; }
.bug-id { font-family: ui-monospace, monospace; font-weight: 800; color: var(--ink); }
.bug-sev { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--red-soft); color: var(--red); }
.bug-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); }
.bug-title { font-weight: 700; color: var(--ink); flex-basis: 100%; margin-top: 4px; }
.bugcard .md-content { margin: 0; border: none; box-shadow: none; border-radius: 0; }
/* Body scrolls inside the card; the BUG-107 header row stays put, and the meta table +
   summary are visible by default (enough to size up the bug before scrolling for detail). */
.bugcard .md-content.md-scroll { max-height: 540px; }

/* Workers / test runner */
.runner { margin-top: 28px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.worker-toggle { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.worker-btn { border: none; background: transparent; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); padding: 9px 16px; border-radius: 8px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.worker-btn:hover { color: var(--ink); }
.worker-btn.active { background: var(--ink); color: #fff; }
.worker-hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.runner-meta { display: flex; align-items: center; gap: 16px; margin: 18px 0; flex-wrap: wrap; }
.runner-meta .time { font-size: 15px; font-weight: 700; color: var(--ink); }
.runner-meta .time .num { color: var(--accent-dark); }
.runner-meta .note { font-size: 14px; color: var(--muted); }
.runner-meta .badge-parallel { font-size: 13px; font-weight: 700; color: var(--accent-dark); background: rgba(0,184,248,0.12); padding: 5px 12px; border-radius: 999px; }

/* Lanes — each shows the test its worker is running right now (UI clip or API console) */
#video-pool { display: none; }
.video-grid { display: grid; gap: 12px; margin-bottom: 8px; }
.video-grid.w1 { grid-template-columns: 1fr; max-width: 600px; }
.video-grid.w2 { grid-template-columns: 1fr 1fr; }
.video-grid.w4 { grid-template-columns: 1fr 1fr; }
.lane { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.lane.running { border-color: rgba(0, 184, 248, 0.55); box-shadow: 0 0 0 3px rgba(0, 184, 248, 0.12); }
.lane.passed { border-color: rgba(34, 168, 108, 0.45); }
.lane-screen { position: relative; aspect-ratio: 16 / 10; background: var(--ink); overflow: hidden; }
.lane-video { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--ink); }
.lane-idle { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; color: rgba(255, 255, 255, 0.4); font-size: 12px; font-family: ui-monospace, monospace; }
.lane-cap { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); font-size: 12px; min-width: 0; }
.lane-proj { font-size: 10px; font-weight: 800; letter-spacing: 0.04em; padding: 2px 6px; border-radius: 5px; flex-shrink: 0; }
.lane-proj.ui { background: rgba(0, 184, 248, 0.14); color: var(--accent-dark); }
.lane-proj.api { background: rgba(34, 168, 108, 0.16); color: var(--green); }
.lane-name { flex: 1; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane-stat { color: var(--muted); font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.lane.running .lane-stat { color: var(--accent-dark); }
.lane.passed .lane-stat { color: var(--green); }

/* API request/response console (API tests have no screen to record) */
.api-console { position: absolute; inset: 0; background: #0d1220; color: #d7e0ee; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; display: flex; flex-direction: column; }
.api-bar { display: flex; align-items: center; gap: 6px; padding: 6px 9px; background: #141b2e; border-bottom: 1px solid #222b41; flex-shrink: 0; }
.api-bar .dot { width: 9px; height: 9px; border-radius: 50%; }
.api-bar .dot.r { background: #ff5f57; }
.api-bar .dot.y { background: #febc2e; }
.api-bar .dot.g { background: #28c840; }
.api-bar-title { margin-left: 6px; color: #8a97ad; font-size: 11px; font-weight: 600; }
.api-body { flex: 1; padding: 9px 12px; display: flex; flex-direction: column; justify-content: center; gap: 4px; overflow: hidden; font-size: 12.5px; line-height: 1.35; }
.api-line { opacity: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.api-console.reveal .api-line { animation: apiIn 0.28s ease both; }
@keyframes apiIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.api-line .verb { font-weight: 800; }
.api-line .verb.GET { color: #6cc6ff; }
.api-line .verb.POST { color: #59d99a; }
.api-line .verb.PUT { color: #febc2e; }
.api-line .verb.PATCH { color: #c39bff; }
.api-line .verb.DELETE { color: #ff7a7a; }
.api-line .path { color: #cdd7e6; }
.api-line.hdr, .api-line.body, .api-line.resbody { color: #7f8ca3; }
.api-line .status.ok { color: #59d99a; font-weight: 800; }
.api-line .status.err { color: #ff8f8f; font-weight: 800; }
.api-line .ms { color: #5f6b82; }
.api-line.assert { margin-top: 3px; color: #8a97ad; }
.api-line.assert.ok::before { content: '✓ '; color: #59d99a; font-weight: 800; }
.video-grid.w4 .api-body { font-size: 11px; padding: 7px 9px; }

.run-row { display: flex; align-items: center; gap: 14px; margin: 16px 0 6px; flex-wrap: wrap; }
.tape { position: relative; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; height: 420px; overflow-y: auto; font-size: 13.5px; }
.tape-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.tape-row { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-bottom: 1px solid var(--line); opacity: 0.35; transition: opacity 0.2s ease, background 0.2s ease; font-family: ui-monospace, monospace; }
.tape-row:last-child { border-bottom: none; }
.tape-row.pending .icon { color: var(--line); }
.tape-row.running { opacity: 1; background: rgba(0,184,248,0.06); }
.tape-row.running .icon { color: var(--accent); animation: spin 0.8s linear infinite; }
.tape-row.passed { opacity: 1; }
.tape-row.passed .icon { color: var(--green); }
.tape-row .tname { flex: 1; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tape-row .tproj { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.tape-row .tdur { color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes spin { to { transform: rotate(360deg); } }
.run-counter { font-weight: 700; color: var(--ink); }
.run-counter .done { color: var(--green); }
.footnote { margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.footnote a { font-weight: 600; }

/* Runner two-column body: video left, live results right */
.runner-body { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 20px; align-items: start; margin: 8px 0 4px; }
.runner-left { min-width: 0; }
.runner-right { min-width: 0; }
.tape-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 8px; }
@media (max-width: 760px) { .runner-body { grid-template-columns: 1fr; } }

/* Run phase caption + slow-motion toggle */
.run-phase { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 12px; min-height: 22px; }
.run-phase b { color: var(--accent-dark); }
.speed-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; margin-left: auto; }
.speed-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.speed-toggle .switch { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--line); transition: background 0.15s ease; flex: none; }
.speed-toggle .switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(11, 15, 25, 0.25); transition: transform 0.15s ease; }
.speed-toggle input:checked + .switch { background: var(--accent); }
.speed-toggle input:checked + .switch::after { transform: translateX(16px); }
.speed-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.slow-note { margin-top: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; max-width: 520px; }
.slow-note.hidden { display: none; }
.slow-note b { color: var(--ink); font-weight: 700; }

/* Test-cases scroll panel */
.cases.scroll-panel { max-height: 560px; overflow-y: auto; padding: 4px 8px 4px 2px; }

/* Bug test-case chip + report callout */
.bug-tc { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(0, 184, 248, 0.12); color: var(--accent-dark); font-family: ui-monospace, monospace; }
.md-content blockquote { margin: 14px 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--bg-soft); border-radius: 0 8px 8px 0; color: var(--text); }
.md-content blockquote p { margin: 4px 0; }

/* Slack */
.slack-tabs { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.slack-tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; transition: all 0.15s; }
.slack-tab:hover { color: var(--ink); }
.slack-tab.active { color: var(--ink); border-color: var(--ink); }
.slack-wrap { margin-top: 20px; min-height: 260px; }

/* Slack channel window */
.slack-window { max-width: 580px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(11, 15, 25, 0.10); overflow: hidden; }
.slack-topbar { display: flex; align-items: center; gap: 6px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.slack-hash { color: #611f69; font-weight: 800; font-size: 17px; line-height: 1; }
.slack-channel { font-weight: 800; color: var(--ink); font-size: 15px; }
.slack-ws { margin-left: auto; font-size: 12px; color: var(--muted); }
.slack-feed { padding: 12px 14px 16px; }

.slack-msg { display: flex; gap: 12px; padding: 10px 12px; border-radius: 8px; border-left: 3px solid var(--line); animation: slackIn 0.5s cubic-bezier(0.2, 0.9, 0.2, 1), slackFlash 1.6s ease-out; }
.slack-msg.success { border-left-color: var(--green); }
.slack-msg.failure { border-left-color: var(--red); }
.slack-msg.warning { border-left-color: var(--amber); }
.slack-msg.resolved { border-left-color: var(--accent); }
@keyframes slackIn { 0% { opacity: 0; transform: translateY(26px) scale(0.98); } 65% { opacity: 1; transform: translateY(-3px) scale(1.004); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes slackFlash { 0% { background: rgba(0, 184, 248, 0.10); } 100% { background: transparent; } }

.slack-avatar { width: 38px; height: 38px; border-radius: 9px; background: rgba(0,184,248,0.14); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.slack-main { flex: 1; min-width: 0; }
.slack-hdr { display: flex; align-items: baseline; gap: 8px; }
.slack-bot { font-weight: 700; color: var(--ink); }
.slack-tag { font-size: 10px; font-weight: 700; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--muted); text-transform: uppercase; }
.slack-time { font-size: 12px; color: var(--muted); }
.slack-title { font-weight: 700; color: var(--ink); margin: 6px 0 2px; display: flex; align-items: center; gap: 8px; }
.slack-fields { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0; font-size: 13px; }
.slack-fields .f b { color: var(--ink); }
.slack-fields .f { color: var(--muted); }
.slack-list { margin: 8px 0 4px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; }
.slack-list .item { display: flex; align-items: center; gap: 7px; padding: 3px 0; color: var(--text); flex-wrap: wrap; }
.slack-list .item .mono { font-family: ui-monospace, monospace; font-size: 12px; }
.slack-list .bugtag { font-family: ui-monospace, monospace; font-weight: 700; color: var(--accent-dark); }
.slack-list .i { font-weight: 800; }
.slack-list .i-fail { color: var(--red); }
.slack-list .i-ok { color: var(--green); }
.sev { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 1px 7px; border-radius: 999px; }
.sev-high { background: var(--red-soft); color: var(--red); }
.sev-medium { background: var(--amber-soft); color: var(--amber); }
.sev-low { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }

.slack-report { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.slack-report-link { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent-dark); }
.slack-report-note { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

.slack-caption { margin-top: 16px; font-size: 15px; color: var(--muted); }
.slack-caption b { color: var(--ink); font-style: normal; }

/* Allure */
.allure-frame { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--bg-soft); }
.allure-frame iframe { width: 100%; height: 560px; border: none; display: block; }
.allure-actions { margin-top: 14px; }

/* Code */
.code-grid { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.code-card { background: var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid #222a3d; }
.code-card .code-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #222a3d; }
.code-card .dot { width: 11px; height: 11px; border-radius: 50%; }
.code-card .dot.r { background: #ff5f56; } .code-card .dot.y { background: #ffbd2e; } .code-card .dot.g { background: #27c93f; }
.code-card .code-file { margin-left: 8px; font-size: 12px; color: #8b95a8; font-family: ui-monospace, monospace; }
.code-card pre { margin: 0; padding: 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.7; color: #e6edf3; }
.c-com { color: #6b7488; font-style: italic; }
.c-str { color: #7ee787; }
.c-kw { color: #ff7b72; }
.c-type { color: #79c0ff; }
.c-num { color: #f0a35e; }

/* CTA */
/* "This is a template — we adapt to you" callout, right before the CTA */
#adapt { background: var(--bg-soft); }
.adapt-band { background: linear-gradient(180deg, rgba(0, 184, 248, 0.08), rgba(0, 184, 248, 0.03)); border: 1px solid rgba(0, 184, 248, 0.28); border-radius: var(--radius); padding: 34px 38px; box-shadow: var(--shadow); }
.adapt-band h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
.adapt-band p { color: var(--text); font-size: 17px; line-height: 1.6; margin-top: 12px; max-width: 780px; }
.adapt-cta { margin-top: 22px; }

.cta { background: var(--ink); border-bottom: none; text-align: center; }
.cta h2 { color: #fff; font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.cta p { color: rgba(255,255,255,0.72); margin-top: 14px; font-size: 18px; max-width: 620px; margin-left: auto; margin-right: auto; }
.cta .cta-row { margin-top: 28px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta .btn-ghost { background: rgba(255,255,255,0.06); color: #fff; border-color: rgba(255,255,255,0.22); }
.cta .btn-ghost:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.4); }

/* Responsive (showcase-specific; the shell's responsive rules are in ../shared.css) */
@media (max-width: 860px) {
  .code-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  section { padding: 56px 0; }
  .video-grid.w2 { grid-template-columns: 1fr; }
  .md-content { padding: 22px 18px; }
}
