/* Look and feel from design_handoff_cache_checker (tokens, type, radii). Self-contained: no dependency on that folder. */

:root {
  --font-heading: "Overlock", "Trebuchet MS", system-ui, sans-serif;
  --font-heading-weight: 900;
  --font-body: "Amiko", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;

  --color-bg: #f1f2ee;
  --color-surface: #e6e8e1;
  --color-text: #222420;
  --color-divider: color-mix(in srgb, #222420 16%, transparent);

  --neutral-100: #f8f9f6; --neutral-200: #eceee9; --neutral-300: #dadcd5; --neutral-400: #bcbfb6;
  --neutral-500: #9a9d94; --neutral-600: #7b7e75; --neutral-700: #5d6058; --neutral-800: #42443e; --neutral-900: #2a2c27;

  --accent-100: #eef6ec; --accent-200: #dcebd7; --accent-300: #bfd9b6; --accent-400: #95bf88; --accent-500: #6a9a5f;
  --accent-600: #57844d; --accent-700: #2f5e2a; --accent-800: #244a20; --accent-900: #193316;

  --lime-100: #f3fae8; --lime-200: #e4f3cc; --lime-300: #cde8a3; --lime-400: #aed774; --lime-500: #8cc63f;
  --lime-600: #6fa52c; --lime-700: #548220; --lime-800: #3c5e17; --lime-900: #263c0f;

  --space-1: 4.4px; --space-2: 8.8px; --space-3: 13.2px; --space-4: 17.6px; --space-6: 26.4px; --space-8: 35.2px;
  --radius-sm: 8px; --radius-md: 16px; --radius-lg: 28px; --radius-xl: 56px;

  --muted: color-mix(in srgb, var(--color-text) 72%, transparent);
  --muted-strong: color-mix(in srgb, var(--color-text) 78%, transparent);
  --gutter: clamp(20px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0; background: var(--color-bg); color: var(--color-text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  text-wrap: pretty; overflow-x: clip;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: var(--accent-700); text-underline-offset: 3px; }
a:hover { color: var(--accent-800); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.page { min-height: 100vh; display: flex; flex-direction: column; position: relative; isolation: isolate; overflow-x: clip; }

/* nav */
.nav { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--gutter); }
.nav-brand { margin-right: auto; display: block; line-height: 0; }
.nav-brand img { display: block; height: 60px; width: auto; }
.nav a { color: inherit; text-decoration: none; font-size: 14px; white-space: nowrap; }
.nav a:hover { color: var(--accent-500); }

/* layout */
.main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter); position: relative; }
.blob {
  position: absolute; right: 0; top: -180px; width: 380px; height: 380px; border-radius: 50%;
  background: var(--lime-200); z-index: -1; pointer-events: none;
}

/* hero */
.hero { padding: clamp(56px, 10vw, 112px) 0 48px; }
.hero h1 { font-size: clamp(44px, 6.6vw, 80px); line-height: 1.08; margin-left: -0.028em; }
.hero h1 span { display: block; }
.hero h1 .accent { color: var(--accent-700); }
.sub { font-size: 17px; line-height: 28px; max-width: 54ch; margin-top: 24px; color: var(--muted-strong); }

.check-form { display: flex; flex-wrap: wrap; gap: var(--space-3); max-width: 640px; margin-top: 36px; }
.input {
  flex: 1 1 280px; min-width: 0; min-height: 52px; padding: 6px 24px; font: inherit; font-size: 17px;
  color: var(--color-text); caret-color: var(--accent-500); background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: 999px;
}
.input::placeholder { color: color-mix(in srgb, var(--color-text) 50%, transparent); }
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--accent-500); outline-offset: 0; }
.btn {
  min-height: 52px; padding: 8.8px 32px; font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 19px; line-height: 1.2;
  color: var(--color-bg); background: var(--accent-500); border: 1px solid transparent; border-radius: 999px; cursor: pointer;
}
.btn:hover { background: var(--accent-600); }
.btn:active { background: var(--accent-700); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.error { margin: 12px 0 0 24px; font-size: 14px; color: var(--accent-800); font-weight: 600; }
.hint { margin: 14px 0 0 24px; max-width: 60ch; font-size: 14px; color: var(--muted); }

/* loading */
.loading { display: flex; align-items: center; gap: 16px; padding: 8px 0 72px; font-size: 16px; color: var(--muted); }
.spinner {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-block;
  border: 4px solid var(--accent-200); border-top-color: var(--accent-500); animation: ccspin .8s linear infinite;
}
@keyframes ccspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* results */
.results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; margin-bottom: 72px; }

.panel {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 40px; align-items: center;
  border-radius: var(--radius-xl); padding: clamp(28px, 4vw, 56px); background: var(--neutral-200);
}
.panel.is-hit { background: var(--lime-200); }
.panel:focus-visible { outline-offset: 4px; }
.panel-main { display: flex; align-items: center; gap: 28px; }
.panel-main > div:last-child { min-width: 0; }
.circle {
  flex: none; width: 140px; height: 140px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: var(--neutral-800); color: var(--color-bg);
  font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 38px; line-height: 1;
}
.is-hit .circle { background: var(--accent-700); }
.panel h2 { font-size: clamp(29px, 3.4vw, 40px); line-height: 1.15; margin: 12px 0 8px; }
.panel .summary { font-size: 16px; line-height: 25px; color: var(--muted-strong); max-width: 52ch; }
.panel .url { margin-top: 8px; font-size: 14px; line-height: 22px; word-break: break-all; color: var(--muted); }

.tag {
  display: inline-flex; align-items: center; font-size: 11px; letter-spacing: 0.02em; padding: 3px 10px;
  border-radius: 999px; background: var(--neutral-100); color: var(--neutral-800);
}
.tag-accent { background: var(--accent-100); color: var(--accent-800); }
.tag-warn { background: var(--lime-100); color: var(--lime-800); }
.panel .tag { font-size: 12px; font-weight: 600; padding: 4px 12px; }

.saw { background: var(--color-bg); border-radius: var(--radius-lg); padding: 20px 24px; min-width: 0; }
.label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-700); }
.saw .label { margin-bottom: 8px; }
.row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; font-size: 14px; }
.row + .row { border-top: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent); }
/* Label keeps its natural width (so short names like cf-ray never wrap) but may use at most 60% of the row; a longer label wraps instead of pushing the value out of the card. */
.row .k { font-family: var(--mono); color: var(--muted); flex: none; max-width: 60%; overflow-wrap: anywhere; }
.row .v { font-family: var(--mono); font-weight: 600; text-align: right; flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }

/* layer cards */
.layers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.box { background: var(--color-surface); border-radius: var(--radius-lg); padding: 24px 26px; min-width: 0; }
.box h3 { font-size: 25px; line-height: 1.2; margin-bottom: 12px; }
.box p { color: var(--muted-strong); }
.box p + p, .box .tag + p { margin-top: 12px; }
.box .tag { margin-bottom: 0; }
.box .tag + p { margin-top: 12px; }
.box .tag-accent { font-weight: 600; }
.box-sub { font-size: 14px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--color-bg); color: var(--neutral-800); }
.chip.unverified::after { content: " · unverified rule"; color: var(--muted); }

ul.plain { margin: 8px 0 0; padding-left: 20px; color: var(--muted-strong); }
ul.plain li { margin: 4px 0; }
ul.plain code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.box h4 { font-size: 16px; margin: 18px 0 4px; font-family: var(--font-body); font-weight: 700; letter-spacing: 0; }

details { margin-top: 14px; }
details.flush { margin-top: 0; }
summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent-700); }
summary:hover { color: var(--accent-800); }
.evidence { margin: 8px 0 0; padding-left: 18px; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; color: var(--muted); }
.evidence-title { margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--muted-strong); }

.hdr-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-family: var(--mono); font-size: 13px; }
.hdr-table th, .hdr-table td { text-align: left; vertical-align: top; padding: 5px 8px 5px 0; border-top: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent); overflow-wrap: anywhere; }
.hdr-table th { white-space: nowrap; color: var(--muted); font-weight: 600; width: 1%; padding-right: 16px; }

.cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px;
  background: var(--accent-700); color: var(--color-bg); border-radius: var(--radius-xl); padding: clamp(28px, 4vw, 48px);
}
.cta h3 { font-size: clamp(27px, 3.4vw, 34px); line-height: 1.15; }
.cta p { margin-top: 8px; color: color-mix(in srgb, var(--color-bg) 82%, transparent); max-width: 46ch; }
.cta a.btn-light {
  display: inline-flex; align-items: center; min-height: 52px; padding: 8.8px 32px; border-radius: 999px; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 19px; color: var(--accent-800); background: var(--lime-200);
}
.cta a.btn-light:hover { background: var(--lime-300); color: var(--accent-900); }
.cta a.btn-light:focus-visible { outline-color: var(--lime-200); }

/* how it works */
.how { padding: 24px 0 96px; }
.kicker { display: block; margin-bottom: 28px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-700); }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 40px; }
.how h3 { font-size: 27px; line-height: 31px; margin-bottom: 12px; }
.how p { font-size: 15.5px; line-height: 26px; color: var(--muted-strong); }
.how .how-help { margin-top: 40px; }

.foot { padding: 28px var(--gutter); font-size: 13px; color: color-mix(in srgb, var(--color-text) 70%, transparent); }

@media (max-width: 520px) {
  .panel-main { flex-direction: column; align-items: flex-start; }
  .circle { width: 116px; height: 116px; font-size: 32px; }
  .error, .hint { margin-left: 8px; }
  .btn { width: 100%; }
  .blob { width: 260px; height: 260px; top: -140px; right: -60px; }
}
