/* Agonso — agonso.com
   System fonts only, no external assets. Light and dark via prefers-color-scheme. */

:root {
  --bg: #fafaf9;
  --bg-alt: #f2f2ef;
  --surface: #ffffff;
  --fg: #15171c;
  --muted: #545a65;
  --line: #e2e2dd;
  --line-strong: #c9c9c2;
  --accent: #0b6b63;
  --accent-strong: #08554f;
  --accent-soft: #e2f1ee;
  --on-accent: #ffffff;
  --code-bg: #efefeb;
  --shadow: 0 1px 2px rgb(20 22 28 / 0.05), 0 4px 16px rgb(20 22 28 / 0.04);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 14px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-pad: clamp(64px, 9vw, 112px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --bg-alt: #13161a;
    --surface: #171a1f;
    --fg: #e9ebef;
    --muted: #a3a9b4;
    --line: #262a31;
    --line-strong: #363b44;
    --accent: #52d1bf;
    --accent-strong: #7fe0d2;
    --accent-soft: #11302d;
    --on-accent: #06201d;
    --code-bg: #1e2228;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  }
}

/* Base */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 650;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--bg); }

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container.narrow { max-width: 760px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 650;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand:hover { color: var(--fg); }
.brand-mark { width: 28px; height: 28px; color: var(--fg); flex: none; }
.mark-dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
}
.site-nav a:hover { color: var(--fg); background: var(--bg-alt); }
.site-nav .nav-cta {
  color: var(--fg);
  border: 1px solid var(--line-strong);
  margin-left: 6px;
}

@media (max-width: 640px) {
  .nav-section { display: none; }
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.button-primary { background: var(--fg); color: var(--bg); }
.button-primary:hover { background: var(--accent); color: var(--on-accent); }
.button-ghost { color: var(--fg); border-color: var(--line-strong); }
.button-ghost:hover { color: var(--fg); background: var(--bg-alt); }

/* Hero */
.hero {
  padding-block: clamp(40px, 7vw, 88px) clamp(16px, 3vw, 32px);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 24px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.hero h1 {
  font-size: clamp(2.25rem, 5.4vw, 3.75rem);
  letter-spacing: -0.03em;
  line-height: 1.04;
  font-weight: 700;
}

.lede {
  margin-top: 24px;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--muted);
  max-width: 36em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-note {
  margin-top: 20px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.hero-figure { margin: 0; }
.hero-figure figcaption {
  margin-top: 8px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-figure { max-width: 460px; margin-inline: auto; width: 100%; }
}

/* Diagram (colors follow the theme tokens) */
.circle-diagram { display: block; width: 100%; height: auto; overflow: visible; }
.d-ring-base { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.d-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 4 10;
  stroke-linecap: round;
  animation: ring-flow 24s linear infinite;
}
.d-node { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.d-node-main { stroke: var(--accent); stroke-width: 2; }
.d-device { fill: none; stroke: var(--fg); stroke-width: 2; stroke-linejoin: round; }
.d-slot { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.d-led { fill: var(--accent); }
.d-pill { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.25; }
.d-pill-text {
  fill: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  text-anchor: middle;
}
.d-label {
  fill: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 650;
  text-anchor: middle;
}
.d-sublabel {
  fill: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  text-anchor: middle;
}

@keyframes ring-flow {
  to { stroke-dashoffset: -280; }
}

/* Sections */
.section { padding-block: var(--section-pad); }
.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}

.eyebrow {
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  letter-spacing: -0.025em;
  max-width: 22em;
}

.section-lede {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.125rem;
  max-width: 40em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}
.steps li {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 16px;
}
.steps h3 { font-size: 1.125rem; }
.steps p { margin-top: 8px; color: var(--muted); }

/* Pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 48px;
}
.pillar { padding: 28px; }
.pillar h3 { font-size: 1.375rem; }
.pillar > p { margin-top: 10px; color: var(--muted); }

.checks {
  margin: 20px 0 0;
  padding: 20px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  font-size: 0.96875rem;
}
.checks li {
  position: relative;
  padding-left: 26px;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

.swap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 0.9375rem;
}
.swap-old code { text-decoration: line-through; color: var(--muted); }
.swap-new code { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.swap-arrow { color: var(--muted); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.875rem;
  font-weight: 600;
}

.subhead {
  margin-top: 56px;
  font-size: 1.125rem;
  color: var(--muted);
  font-weight: 600;
}

.extras {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 16px;
}
.extra { padding: 24px 28px; }
.extra h4 { font-size: 1.125rem; }
.extra p { margin-top: 8px; color: var(--muted); }

/* Security principles */
.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: principle;
  border-top: 1px solid var(--line);
}
.principles li {
  counter-increment: principle;
  padding: 28px 28px 28px 0;
  border-bottom: 1px solid var(--line);
}
.principles li::before {
  content: counter(principle, decimal-leading-zero);
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
}
.principles h3 { font-size: 1.125rem; }
.principles p { margin-top: 8px; color: var(--muted); }

/* Tech */
.tech {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
  margin: 40px 0 0;
}
.tech > div {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.tech dt { font-weight: 650; }
.tech dd { margin: 0; color: var(--muted); }

.license-note {
  margin-top: 32px;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
  max-width: 48em;
}

/* Compare table */
.table-wrap {
  margin-top: 40px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.compare th,
.compare td {
  padding: 18px 24px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare thead th {
  font-size: 0.8125rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-alt);
}
.compare tbody th { font-weight: 650; width: 32%; }
.compare td { color: var(--muted); }

/* FAQ */
.faq { margin-top: 32px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  font-weight: 600;
  font-size: 1.0625rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font-size: 1.375rem;
  line-height: 1;
  font-weight: 400;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--muted); max-width: 40em; }

/* CTA */
.cta { text-align: center; }
.cta-inner { display: grid; justify-items: center; gap: 16px; }
.cta h2 { margin-inline: auto; }
.cta p { color: var(--muted); font-size: 1.125rem; margin-bottom: 8px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 32px;
  font-size: 0.9375rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.brand-small { font-size: 1rem; }
.brand-small .brand-mark { width: 22px; height: 22px; }
.footer-text { flex: 1 1 280px; }
.footer-links a { color: var(--fg); }

/* 404 */
.notfound {
  min-height: calc(100vh - 160px);
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 80px;
}
.notfound-inner { display: grid; justify-items: center; gap: 16px; }
.notfound-code {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
}
.notfound h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; }
.notfound p { color: var(--muted); font-size: 1.125rem; max-width: 30em; }
.notfound .button { margin-top: 8px; }

/* Responsive */
@media (max-width: 960px) {
  .pillars { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tech { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .extras { grid-template-columns: minmax(0, 1fr); }
  .principles { grid-template-columns: minmax(0, 1fr); }
  .principles li { padding-right: 0; }
  .tech > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .compare th,
  .compare td { padding: 14px 16px; }
  .compare tbody th { width: 38%; }
}

@media (max-width: 420px) {
  body { font-size: 1rem; }
  .hero-actions .button { width: 100%; }
  .pillar, .extra { padding: 22px; }
  .compare thead { display: none; }
  .compare tr { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .compare tbody tr:last-child { border-bottom: 0; }
  .compare th,
  .compare td { display: block; width: auto; padding: 0; border: 0; }
  .compare tbody th { width: auto; margin-bottom: 4px; }
}

/* Motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .d-ring { animation: none; }
}

/* Windows high contrast / forced colors */
@media (forced-colors: active) {
  .d-ring, .d-ring-base, .d-node, .d-device, .d-pill { stroke: CanvasText; }
  .d-label, .d-sublabel, .d-pill-text { fill: CanvasText; }
  .button { border-color: ButtonText; }
}

/* ---------- Download page ---------- */
.dl-hero { padding-bottom: clamp(40px, 6vw, 72px); }
.dl-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.08; letter-spacing: -0.02em; margin: 18px 0 14px; }
.dl-notice {
  margin-top: 28px; max-width: 44em; padding: 16px 18px;
  border: 1px solid var(--line-strong); border-left: 4px solid var(--accent);
  border-radius: var(--radius); background: var(--surface); color: var(--muted);
}
.dl-notice strong { color: var(--fg); display: block; margin-bottom: 4px; }
.dl-steps { margin: 28px 0 0; padding-left: 1.3em; display: grid; gap: 14px; max-width: 44em; }
.dl-steps li { padding-left: 4px; color: var(--muted); }
.dl-steps strong { color: var(--fg); }
.dl-grid { display: grid; gap: clamp(24px, 4vw, 48px); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.dl-card h3 { margin-top: 0; }
.dl-card ul { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; color: var(--muted); }
.dl-code {
  margin: 0; padding: 14px 16px; overflow-x: auto; border-radius: 10px;
  background: var(--code-bg); font-family: var(--font-mono); font-size: 0.85rem; line-height: 1.6;
}
.dl-card .dl-code { background: transparent; padding: 0; }
.dl-notes { max-width: 44em; color: var(--muted); }
.dl-notes ul { padding-left: 1.2em; display: grid; gap: 8px; }
.dl-sums { margin: 24px 0; max-width: 100%; }
.dl-sums summary { cursor: pointer; color: var(--muted); margin-bottom: 10px; }
.dl-sums .dl-code { font-size: 0.75rem; white-space: pre; }
