/* Keywicket public site. Tokens follow the brand table; dark values approved in Phase 0. */

@font-face { font-family: "Sora"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/sora-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Albert Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/albert-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Albert Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/albert-sans-latin-600-normal.woff2") format("woff2"); }
/* Metric-adjusted fallbacks so the swap doesn't shift layout */
@font-face { font-family: "Sora Fallback"; src: local("Arial"); size-adjust: 112%; ascent-override: 88%; descent-override: 26%; line-gap-override: 0%; }
@font-face { font-family: "Albert Sans Fallback"; src: local("Arial"); size-adjust: 97%; ascent-override: 98%; descent-override: 26%; line-gap-override: 0%; }

:root {
  --bg: #f1f6f4;
  --text: #142f36;
  --primary: #0b685e;
  --on-primary: #ffffff;
  --muted: #e8f0ee;
  --card: #ffffff;
  --border: #cad9d5;
  --control-border: #678680;
  --text-soft: #3b5359;
  --blocked: #8a2f1f;
  --blocked-bg: #f7e9e5;
  --radius: 1rem;
  --font-display: "Sora", "Sora Fallback", Arial, sans-serif;
  --font-body: "Albert Sans", "Albert Sans Fallback", Arial, sans-serif;
  --font-code: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 68ch;
  --wrap: 72rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1d21; --text: #e4efec; --primary: #4cc3b2; --on-primary: #0e1d21; --muted: #1a2f33;
    --card: #15282c; --border: #29434a; --control-border: #5f8a86; --text-soft: #b7cbc6;
    --blocked: #f2a493; --blocked-bg: #3a2420; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1d21; --text: #e4efec; --primary: #4cc3b2; --on-primary: #0e1d21; --muted: #1a2f33;
  --card: #15282c; --border: #29434a; --control-border: #5f8a86; --text-soft: #b7cbc6;
  --blocked: #f2a493; --blocked-bg: #3a2420; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6;
  font-feature-settings: "kern", "liga";
}
img { max-width: 100%; height: auto; }

h1, h2, h3, .h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.6em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.05rem); margin-top: 2.2em; }
h3, .h3 { font-size: 1.2rem; letter-spacing: -0.01em; margin-top: 1.6em; }
p, ul, ol, dl { margin: 0 0 1em; }
a { color: var(--primary); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--font-code); font-size: 0.86em; background: var(--muted); padding: 0.1em 0.35em; border-radius: 0.35rem; overflow-wrap: anywhere; }
strong { font-weight: 600; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 0.25rem; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--card); color: var(--text); padding: 0.6rem 1rem; border-radius: var(--radius); z-index: 10; }
.skip:focus { top: 1rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 48rem) { .wrap { padding: 0 2rem; } }
.muted { color: var(--text-soft); }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 4.25rem; flex-wrap: wrap; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.home-link { text-decoration: none; color: var(--text); margin-right: auto; }
.logo { display: inline-flex; align-items: center; gap: 0.55rem; }
.logo-word { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.02em; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none; } :root:not([data-theme="light"]) .logo-dark { display: inline; } }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline; }
.nav { list-style: none; display: flex; gap: 0.25rem 1.25rem; margin: 0; padding: 0; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; padding: 0.4rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 0.6rem; }
@media (max-width: 47.99rem) {
  .header-inner nav { order: 3; width: 100%; }
  .header-actions .button-small { display: none; }
}

.theme-toggle { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1px solid var(--control-border); background: var(--card); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.theme-toggle-icon { width: 1rem; height: 1rem; border-radius: 50%; background: linear-gradient(90deg, var(--text) 50%, transparent 50%); border: 2px solid var(--text); }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: 0.65rem 1.25rem; border-radius: var(--radius); font-weight: 600; font-size: 1rem; text-decoration: none; border: 2px solid transparent; line-height: 1.2; cursor: pointer; font-family: var(--font-body); }
.button-primary { background: var(--primary); color: var(--on-primary); }
.button-primary:hover { filter: brightness(1.08); }
.button-quiet { color: var(--text); border-color: var(--control-border); background: transparent; }
.button-quiet:hover { border-color: var(--text); }
.button-small { min-height: 2.5rem; padding: 0.45rem 1rem; font-size: 0.95rem; }

/* Hero */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 60rem) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 3.5rem; } }
.hero h1 { max-width: 14ch; }
.lede { font-size: 1.22rem; line-height: 1.55; max-width: var(--measure); }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.75rem 0 1rem; }
.hero-note { color: var(--text-soft); font-size: 0.95rem; }

/* The read-only proof: the one bold element on the page */
.request-log { margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.5); padding: 1.25rem 1.25rem 1.1rem; box-shadow: 0 1px 0 var(--border), 0 18px 40px -28px rgba(20, 47, 54, 0.45); }
.request-log-head { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--border); margin-bottom: 0.6rem; font-size: 0.92rem; }
.request-log-title { font-weight: 600; }
.request-log-tenant { color: var(--text-soft); overflow-wrap: anywhere; text-align: right; }
.request-log-lines { list-style: none; margin: 0 0 1rem; padding: 0; font-family: var(--font-code); font-size: 0.8rem; }
.request-log-lines li { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: baseline; padding: 0.5rem 0.25rem; border-bottom: 1px dashed var(--border); }
.request-log-lines li:last-child { border-bottom: 0; }
.method { font-weight: 700; color: var(--primary); }
.req-url { overflow-wrap: break-word; color: var(--text); min-width: 0; }
.req-host { color: var(--text-soft); }
.req-result { color: var(--text-soft); }
.request-log-lines li.is-blocked { background: var(--blocked-bg); border-radius: 0.5rem; border-bottom-color: transparent; margin-top: 0.35rem; }
.is-blocked .method, .is-blocked .req-result { color: var(--blocked); }
.is-blocked .req-url { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--text-soft); }
.request-log figcaption { font-size: 0.95rem; color: var(--text-soft); max-width: 60ch; }

/* Sections */
.section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section.wrap { padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 48rem) { .section.wrap { padding-left: 2rem; padding-right: 2rem; } }
.section h2 { margin-top: 0; }
.section-tint { background: var(--muted); }
.section-lede { max-width: var(--measure); font-size: 1.1rem; }

/* Steps: a real sequence, so numbered */
.steps { list-style: none; counter-reset: step; padding: 0; display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { .steps:not(.steps-detailed) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; } }
.steps > li { counter-increment: step; position: relative; padding-left: 3.25rem; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0.1rem; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 2px solid var(--primary); color: var(--primary); font-family: var(--font-display); font-weight: 600; display: grid; place-items: center; }
.steps h3 { margin-top: 0.15rem; font-size: 1.1rem; }
.steps p { margin-bottom: 0.5em; }

/* Checks grouped by platform */
.checks { display: grid; gap: 2rem; }
@media (min-width: 60rem) { .checks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.checks-group h3 { margin-top: 0; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding-bottom: 0.6rem; border-bottom: 2px solid var(--text); }
.checks-group ul { list-style: none; padding: 0; margin: 0; }
.checks-group li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.count { font-family: var(--font-body); font-weight: 600; font-size: 0.95rem; color: var(--text-soft); white-space: nowrap; letter-spacing: 0; }

/* Points */
.points { display: grid; gap: 1.75rem 2.5rem; margin: 2rem 0 0; }
@media (min-width: 48rem) { .points { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72rem) { .points { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.points dt { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; margin-bottom: 0.35rem; letter-spacing: -0.01em; }
.points dd { margin: 0; color: var(--text-soft); }

/* Prose pages */
.prose { max-width: 46rem; padding: clamp(2rem, 5vw, 3.5rem) 0 4rem; }
.prose-wide { max-width: 64rem; }
.prose p, .prose li { max-width: var(--measure); }
.prose ul, .prose ol:not(.steps) { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4em; }
.legal-header { margin-bottom: 2rem; }
.legal-meta { color: var(--text-soft); font-size: 0.95rem; }
.legal h2 { font-size: 1.35rem; margin-top: 2em; }
.legal h3 { font-size: 1.08rem; }
.signature { margin-top: 1.5rem; padding: 1rem; border: 1px dashed var(--control-border); border-radius: var(--radius); }

.summary-pair { display: grid; gap: 1rem; margin: 1.5rem 0 1rem; }
@media (min-width: 40rem) { .summary-pair { grid-template-columns: 1fr 1fr; } }
.summary-pair section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.summary-pair section:last-child { border-color: var(--primary); }
.summary-pair h2 { margin-top: 0; }
.summary-pair p { margin: 0; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 1rem 0 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table-scroll .table { min-width: 36rem; }
.prose > .table { margin: 1rem 0 1.5rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); max-width: 24rem; }
.table caption { text-align: left; font-weight: 600; padding: 0.9rem 1rem 0.5rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 0.7rem 1rem; border-top: 1px solid var(--border); }
.table thead th { font-size: 0.85rem; color: var(--text-soft); font-weight: 600; }
.table tbody th { font-weight: 600; }
.table-permissions code { background: none; padding: 0; font-size: 0.88rem; }
.perm-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.tag { font-family: var(--font-body); font-size: 0.75rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid var(--control-border); color: var(--text-soft); white-space: nowrap; }
.tag-optional { border-color: var(--primary); color: var(--primary); }

/* Pricing */
.plans { display: grid; gap: 1rem; margin: 2rem 0; padding: 0; list-style: none; }
.prose .plans { padding-left: 0; }
@media (min-width: 40rem) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .plans { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.plan { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.plan:first-child { border-color: var(--primary); }
.plan h2 { margin-top: 0; }
.plan-price { margin-bottom: 0.25rem; }
.plan-amount { font-family: var(--font-display); font-weight: 600; font-size: 2rem; letter-spacing: -0.03em; }
.plan-cadence, .plan-limit { color: var(--text-soft); }
.plan-limit { font-weight: 600; }

/* Status */
.status-list { display: grid; gap: 0.6rem; margin: 1.5rem 0; }
.status-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.1rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.status-ok { color: var(--primary); font-weight: 600; }
.status-bad { color: var(--blocked); font-weight: 600; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 3rem 0 2rem; margin-top: 2rem; }
.footer-inner { display: grid; gap: 2rem; }
@media (min-width: 48rem) { .footer-inner { grid-template-columns: 1.2fr 1fr; } }
.footer-brand p { max-width: 42ch; margin: 0.75rem 0 0; }
.footer-links { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 2rem; }
.footer-links li { margin-bottom: 0.55rem; break-inside: avoid; }
.footer-legal { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); font-size: 0.88rem; color: var(--text-soft); }
.footer-legal p { margin: 0 0 0.4rem; max-width: 80ch; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

@media print {
  .site-header, .site-footer, .skip, .theme-toggle { display: none; }
  body { background: #fff; color: #000; }
}
