:root {
  color-scheme: light;
  --canvas: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.9);
  --label: #1c1c1e;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, 0.16);
  --blue: #007aff;
  --green: #1f9d55;
  --red: #d70015;
  --orange: #c96e00;
  --shadow: 0 18px 50px rgba(25, 36, 55, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--label);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: inherit; }
button { font: inherit; }

.hero {
  padding: 24px clamp(22px, 5vw, 80px) 72px;
  background:
    radial-gradient(circle at 50% 10%, rgba(0, 122, 255, 0.13), transparent 42%),
    linear-gradient(180deg, #fff 0%, var(--canvas) 100%);
}
.nav {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.brand-mark {
  width: 42px; height: 38px; display: block; object-fit: contain;
}
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--blue); }
.hero-copy { max-width: 960px; margin: 96px auto 0; text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--blue); text-transform: uppercase; letter-spacing: .1em; font-size: 13px; font-weight: 750; }
h1 { margin: 0; font-size: clamp(48px, 8vw, 92px); line-height: 1.02; letter-spacing: -.055em; }
.lede { max-width: 720px; margin: 28px auto 0; color: var(--muted); font-size: clamp(18px, 2.2vw, 24px); }
.metric-grid { margin-top: 50px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.metric { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.metric strong { display: block; font-size: 34px; color: var(--blue); }
.metric.safe strong { color: var(--green); }
.metric.warning strong { color: var(--orange); }
.metric span { color: var(--muted); font-size: 14px; }

main { padding: 20px clamp(22px, 5vw, 80px) 90px; }
.section { max-width: 1180px; margin: 90px auto 0; }
.section-heading { max-width: 760px; margin-bottom: 34px; }
.section-heading h2 { margin: 0; font-size: clamp(34px, 5vw, 56px); line-height: 1.08; letter-spacing: -.04em; }
.section-heading > p:last-child { color: var(--muted); font-size: 18px; }
.workflow { display: block; width: 100%; height: auto; border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--shadow); background: white; }

.lab-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.case-list { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 18px; }
.case-button {
  width: 100%; text-align: left; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 14px; color: var(--label); background: rgba(255,255,255,.7); cursor: pointer;
}
.case-button span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.case-button:hover { border-color: rgba(0,122,255,.4); }
.case-button[aria-current="true"] { border-color: var(--blue); background: white; box-shadow: 0 10px 28px rgba(0,122,255,.12); }
.case-detail { padding: clamp(22px, 4vw, 42px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.case-category { margin: 0; color: var(--blue); font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.case-detail h3 { margin: 5px 0 0; font-size: 30px; letter-spacing: -.03em; }
.status-pill { padding: 7px 11px; border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.status-pill.pass { color: #0a7137; background: rgba(31,157,85,.12); }
.status-pill.gap { color: #9c4e00; background: rgba(201,110,0,.13); }
.description { color: var(--muted); }
.message-card { margin-top: 24px; padding: 18px; border-radius: 16px; background: #f0f6ff; border: 1px solid rgba(0,122,255,.18); }
.message-card span, .attempt-grid span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
blockquote { margin: 8px 0 0; font-size: 17px; }
.attempt-grid { display: grid; grid-template-columns: .7fr 1.8fr 1fr; gap: 10px; margin-top: 12px; }
.attempt-grid > div { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.attempt-grid strong, .attempt-grid code { display: block; margin-top: 6px; font-size: 14px; overflow-wrap: anywhere; }
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.condition { padding: 20px; border-radius: 17px; border: 1px solid var(--line); }
.condition.danger { background: rgba(215,0,21,.045); border-color: rgba(215,0,21,.18); }
.condition.protected { background: rgba(31,157,85,.05); border-color: rgba(31,157,85,.22); }
.condition-label { margin: 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.condition h4 { margin: 4px 0; font-size: 20px; }
.condition > p:not(.condition-label) { color: var(--muted); font-size: 14px; }
.outcome { margin-top: 18px; padding: 10px 12px; border-radius: 11px; font-weight: 750; }
.outcome.allow { color: var(--red); background: rgba(215,0,21,.1); }
.outcome.allow.valid { color: #0a7137; background: rgba(31,157,85,.12); }
.outcome.block { color: #0a7137; background: rgba(31,157,85,.12); }
.outcome.gap { color: #9c4e00; background: rgba(201,110,0,.13); }
.explanation { margin-top: 16px; padding: 15px 17px; border-left: 3px solid var(--blue); background: rgba(0,122,255,.05); color: var(--muted); }

.code-panel { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px; border-radius: 18px; background: #1c1c1e; color: #f5f5f7; }
.code-panel code { line-height: 1.8; }
.code-panel button { border: 0; border-radius: 11px; padding: 10px 14px; background: var(--blue); color: white; cursor: pointer; }
.download-panel { display: flex; flex-wrap: wrap; gap: 12px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: var(--shadow); }
.download-panel a { display: inline-flex; align-items: center; min-height: 44px; padding: 11px 16px; border-radius: 12px; color: white; background: var(--blue); font-weight: 700; text-decoration: none; }
.download-panel a:hover, .download-panel a:focus-visible { background: #0066d6; outline: 3px solid rgba(0,122,255,.2); outline-offset: 2px; }
.fine-print { color: var(--muted); }
footer { padding: 32px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }

@media (max-width: 820px) {
  .metric-grid, .comparison-grid { grid-template-columns: 1fr; }
  .lab-layout { grid-template-columns: 1fr; }
  .case-list { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .attempt-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hero { padding-inline: 20px; }
  .nav { align-items: flex-start; flex-direction: column; gap: 18px; }
  .nav-links { gap: 18px; text-align: left; }
  .hero-copy { margin-top: 56px; }
  h1 { font-size: clamp(40px, 12vw, 56px); letter-spacing: -.045em; }
  .eyebrow { line-height: 1.45; }
  main { padding-inline: 20px; }
  .case-list { grid-template-columns: 1fr; }
  .detail-header { flex-direction: column; }
  .code-panel { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
