/* =========================================================
   DJSON — Design tokens & base styles
   ========================================================= */
:root {
  /* Type */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Color — paper + ink with a single signal accent */
  --paper: #f7f3ea;        /* warm ivory */
  --paper-2: #eee6d9;      /* card / subtle surface */
  --ink: #15161a;          /* near-black */
  --ink-2: #3a3b40;
  --ink-3: #6b6d75;
  --line: #e3e0d6;
  --line-2: #d4d1c5;
  --accent: #2f6f4f;       /* signal green — identity / verification */
  --accent-2: #1f4d36;
  --gold: #b88a44;
  --code-bg: #14161b;
  --code-ink: #e7e5db;
  --code-key: #9ec5fe;
  --code-str: #b7d99a;
  --code-num: #f0b67f;
  --code-punct: #8a8d96;

  /* Scale */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow-sm: 0 1px 0 rgba(20,22,27,.04), 0 1px 2px rgba(20,22,27,.04);
  --shadow-md: 0 1px 0 rgba(20,22,27,.04), 0 8px 24px rgba(20,22,27,.06);

  --max: 1140px;
  --gutter: clamp(20px, 4vw, 40px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(184, 138, 68, .16), transparent 58%),
    radial-gradient(680px 420px at 95% 8%, rgba(47, 111, 79, .12), transparent 62%),
    var(--paper);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

/* =========================================================
   Layout
   ========================================================= */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-wordmark {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0;
}
.brand-wordmark em {
  font-style: normal;
  color: var(--accent);
}
.nav-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  font-size: 14px;
  color: var(--ink-2);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
}
.nav-link:hover { background: var(--paper-2); color: var(--ink); }

/* Buttons */
.btn {
  --bg: var(--ink);
  --fg: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--bg);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--accent { --bg: var(--ink); --fg: #fff; border-color: var(--ink); }
.btn--accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn--ghost {
  --bg: transparent; --fg: var(--ink);
  border-color: var(--line-2);
}
.btn--ghost:hover { background: var(--paper-2); }
.btn--lg { height: 48px; padding: 0 22px; font-size: 15px; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding: clamp(64px, 11vw, 128px) 0 clamp(48px, 8vw, 96px);
  position: relative;
  overflow: hidden;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  text-transform: lowercase;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 22%, transparent);
}
.hero h1 {
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 18px 0 18px;
  font-weight: 600;
  max-width: 18ch;
}
.hero h1 .accent { color: var(--accent); }
.hero p.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0 0 28px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* =========================================================
   Code block / JSON output
   ========================================================= */
.code-card {
  margin-top: clamp(40px, 6vw, 64px);
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 70px rgba(20,22,27,.13);
  overflow: hidden;
  border: 1px solid #1f2229;
}
.code-card__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #20242c;
  background: #1a1d24;
}
.code-card__bar .dots { display: inline-flex; gap: 6px; }
.code-card__bar .dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: #2a2f38;
}
.code-card__file {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #9aa0aa;
}
.code-card__copy {
  background: transparent;
  border: 1px solid #2a2f38;
  color: #cfd2d8;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.code-card__copy:hover { background: #20242c; }
.code-card pre {
  margin: 0;
  padding: 22px 22px 26px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  overflow-x: auto;
  tab-size: 2;
}
.tok-key   { color: var(--code-key); }
.tok-str   { color: var(--code-str); }
.tok-num   { color: var(--code-num); }
.tok-bool  { color: var(--code-num); }
.tok-null  { color: var(--code-punct); }
.tok-punct { color: var(--code-punct); }

/* =========================================================
   Sections — explainer
   ========================================================= */
section { padding: clamp(56px, 8vw, 96px) 0; }
.section-title {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 12px;
}
.section-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  margin: 0 0 12px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.section-lede {
  font-size: 17px;
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0 0 40px;
}

.divider {
  height: 1px; background: var(--line); margin: 0;
}

/* Features grid */
.features {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, 1fr);
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.feature {
  background: var(--paper);
  padding: 28px 26px 30px;
}
.feature:hover,
.dim:hover {
  background: #fbf8f0;
}
.feature__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
.feature h3 {
  font-size: 17px;
  margin: 10px 0 8px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.feature p {
  font-size: 14.5px;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.6;
}

/* Scorecard — 5 dimensions */
.dimensions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.dim {
  background: var(--paper);
  padding: 24px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dim__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
.dim h3 {
  font-size: 17px;
  margin: 6px 0 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.dim__q {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent-2);
  margin: 2px 0 8px;
  line-height: 1.45;
}
.dim p {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.55;
}

/* Two-column "what / why" */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.two-col h2 { margin-top: 0; }

/* Spec list */
.spec {
  border-top: 1px solid var(--line);
}
.spec__row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.spec__key {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
}
.spec__desc {
  font-size: 15px;
  color: var(--ink-2);
}

/* CTA banner */
.cta {
  margin: clamp(24px, 4vw, 56px) 0 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(28px, 5vw, 48px);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in oklab, var(--gold) 18%, transparent), transparent 60%),
    var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.cta h3 {
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -0.015em;
  margin: 0 0 6px;
  font-weight: 600;
}
.cta p { margin: 0; color: var(--ink-2); }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  margin-top: 40px;
}
.site-footer .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-3);
}
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* =========================================================
   Generator page
   ========================================================= */
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 40px);
  align-items: start;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 22px 24px;
}
.panel h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.panel p.help {
  margin: 0 0 18px;
  color: var(--ink-3);
  font-size: 13.5px;
}

.field { display: block; margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--ink-2);
  margin-bottom: 6px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 11px 13px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-family: var(--font-mono);
}
.field input::placeholder,
.field textarea::placeholder { color: #a8aab2; }
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 18%, transparent);
}
.field .hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 6px;
  font-family: var(--font-mono);
}
.field-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

.toast {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-2);
  opacity: 0;
  transition: opacity .25s ease;
}
.toast.visible { opacity: 1; }

/* =========================================================
   Scorecard tool (generator page)
   ========================================================= */
.scorecard {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 22px 24px;
  margin-top: 22px;
}
.scorecard h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.scorecard p.help {
  margin: 0 0 18px;
  color: var(--ink-3);
  font-size: 13.5px;
}
.scorecard__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 0 0 18px;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  transition: border-color .15s ease, background .15s ease;
}
.check:hover { border-color: var(--ink-3); }
.check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--line-2);
  border-radius: 5px;
  background: #fff;
  margin: 1px 0 0;
  flex: 0 0 auto;
  cursor: pointer;
  position: relative;
  transition: background .15s ease, border-color .15s ease;
}
.check input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check__label { line-height: 1.4; }
.check__hint {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
  letter-spacing: 0.01em;
}

.score {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.score__num {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  min-width: 110px;
}
.score__num small {
  font-size: 16px;
  color: var(--ink-3);
  font-weight: 400;
  margin-left: 2px;
}
.score__meta { display: flex; flex-direction: column; gap: 6px; }
.score__label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.score__badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
}
.score__badge[data-tier="not-ready"] { background: #6b6d75; }
.score__badge[data-tier="basic"]     { background: #b07a2a; color: #fff; }
.score__badge[data-tier="agent-ready"]{ background: var(--accent); color: #fff; }
.score__bar {
  height: 6px;
  width: 100%;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.score__bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .35s ease;
}

.service-cta {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 36px);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in oklab, var(--accent) 12%, transparent), transparent 60%),
    var(--paper-2);
}
.service-cta h3 {
  font-size: clamp(20px, 2.4vw, 24px);
  letter-spacing: -0.015em;
  margin: 0 0 6px;
  font-weight: 600;
}
.service-cta > p {
  margin: 0 0 16px;
  color: var(--ink-2);
  max-width: 60ch;
}
.service-cta ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
}
.service-cta li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.5;
}
.service-cta li::before {
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 10px; height: 10px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: color-mix(in oklab, var(--accent) 15%, transparent);
}
.service-cta__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.service-cta__note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

/* Generator + scorecard combined layout */
.scorecard-grid {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 40px);
  align-items: start;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1080px) {
  .dimensions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 880px) {
  .features { grid-template-columns: 1fr; }
  .dimensions { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .spec__row { grid-template-columns: 1fr; gap: 4px; }
  .tool-grid { grid-template-columns: 1fr; }
  .scorecard-grid { grid-template-columns: 1fr; }
  .nav-link.hide-sm { display: none; }
}
@media (max-width: 720px) {
  .scorecard__list { grid-template-columns: 1fr; }
  .service-cta ul { grid-template-columns: 1fr; }
  .score { grid-template-columns: 1fr; text-align: left; }
  .score__num { min-width: 0; font-size: 38px; }
}
@media (max-width: 620px) {
  .dimensions { grid-template-columns: 1fr; }
  .scorecard-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 520px) {
  .cta { flex-direction: column; align-items: flex-start; }
  .hero h1 { letter-spacing: -0.02em; }
}

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selection */
::selection { background: color-mix(in oklab, var(--accent) 30%, transparent); color: var(--ink); }
