/* ==========================================================================
   DukReport landing page — dependency-free, mirrors app tokens (tokens.css)
   Light default; dark via prefers-color-scheme (ADR 0003 var-swap philosophy).
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Surfaces & ink (app light preset) */
  --surface: #fbfbfc;
  --surface-raised: #f6f7f9;
  --surface-sunken: #ebedf0;
  --ink: #1a1d21;
  --ink-muted: #494f5a;
  --accent: #1e40af;
  --accent-ink: #ffffff;
  --accent-subtle: #dbeafe;
  --border: #d3d7de;

  /* Editor canvas (paper stays theme-independent, dimmed in dark mode) */
  --canvas-paper: #ffffff;
  --canvas-paper-ink: #1a1d21;
  --canvas-border: #c4cad3;
  --canvas-badge-bg: #1e40af;
  --canvas-badge-text: #ffffff;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

  --shadow-md: 0 4px 16px -4px rgb(26 29 33 / 0.12);
  --shadow-lg: 0 24px 48px -20px rgb(26 29 33 / 0.28);
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #14171b;
    --surface-raised: #1c2026;
    --surface-sunken: #0f1216;
    --ink: #e7eaee;
    --ink-muted: #a8b1bd;
    --accent: #93b4ff;
    --accent-ink: #0a1830;
    --accent-subtle: #17263f;
    --border: #2b313a;

    --canvas-paper: #252a31;
    --canvas-paper-ink: #f0f2f5;
    --canvas-border: #687586;
    --canvas-badge-bg: #93b4ff;
    --canvas-badge-text: #0a1830;

    --shadow-md: 0 4px 16px -4px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 24px 48px -20px rgb(0 0 0 / 0.6);
  }
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.05rem;
  font-weight: 650;
}

p {
  margin: 0 0 1em;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.08em 0.35em;
}

a {
  color: var(--accent);
}

img,
svg {
  display: block;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 16px;
  border-radius: var(--radius-md);
}

.skip-link:focus {
  left: 16px;
  top: 16px;
}

.container {
  width: min(1120px, 100% - 48px);
  margin-inline: auto;
}

/* ---------- Buttons & chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  border: 1px solid transparent;
  transition:
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-lg {
  padding: 15px 30px;
  font-size: 1.1rem;
}

.chip-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
}

.chip-row li {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  border-radius: 999px;
  padding: 5px 14px;
}

.chip-lg li {
  font-size: 0.9rem;
  padding: 8px 18px;
  color: var(--ink);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 750;
  font-size: 1.1rem;
  margin-right: auto;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.site-nav {
  display: flex;
  gap: 22px;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-muted);
  font-weight: 550;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--accent);
}

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 88px;
  background:
    radial-gradient(60% 55% at 75% 0%, var(--accent-subtle), transparent 70%), var(--surface);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  align-items: center;
}

.hero-copy .lead {
  font-size: 1.15rem;
  color: var(--ink-muted);
  max-width: 34em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 28px 0;
}

.hero-copy .chip-row {
  margin-top: 8px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
  }
}

/* ---------- Designer mockup (pure CSS art) ---------- */

.mock {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-size: 12px;
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.mock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.mock-title {
  margin-left: 10px;
  font-family: var(--font-mono);
  color: var(--ink-muted);
}

.mock-chip {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--intent-success, #15803d);
  background: var(--intent-success-subtle, #e3f4e9);
  border-radius: 999px;
  padding: 2px 10px;
}

.mock-body {
  display: grid;
  grid-template-columns: 40px 1fr;
  min-height: 330px;
}

.mock-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 0;
  border-right: 1px solid var(--border);
}

.rail-btn {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-weight: 700;
  font-size: 13px;
}

.rail-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.4;
}

.rail-btn svg path {
  stroke-width: 1.4;
}

.rail-active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.mock-canvas {
  position: relative;
  margin: 14px;
  padding: 12px 10px;
  background: var(--canvas-paper);
  border: 1px solid var(--canvas-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.band {
  border: 1px dashed var(--canvas-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px 8px;
  position: relative;
}

.band-label {
  position: absolute;
  top: -9px;
  left: 8px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  background: var(--canvas-badge-bg);
  color: var(--canvas-badge-text);
  border-radius: var(--radius-sm);
  padding: 1px 7px;
}

.band-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 6px;
}

.band-rh .band-body {
  align-items: flex-start;
}

.band-rf .band-body {
  align-items: flex-end;
}

.bar {
  height: 7px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--canvas-paper-ink) 18%, transparent);
}

.bar-title {
  width: 30%;
  height: 12px;
}

.bar-25 {
  width: 25%;
}
.bar-30 {
  width: 30%;
}
.bar-40 {
  width: 40%;
}
.bar-50 {
  width: 50%;
  margin-inline: auto;
}
.bar-60 {
  width: 60%;
}
.bar-75 {
  width: 75%;
}
.bar-82 {
  width: 82%;
}
.bar-90 {
  width: 90%;
}

.band-detail {
  flex: 1;
  min-height: 120px;
}

.el-sel {
  position: relative;
  left: 55%;
  width: 34%;
  height: 26px;
  margin: -2px 0;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent-subtle) 55%, transparent);
}

.handle {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--canvas-paper);
  border: 1.5px solid var(--accent);
  border-radius: 2px;
}

.h-tl {
  top: -4.5px;
  left: -4.5px;
}
.h-tr {
  top: -4.5px;
  right: -4.5px;
}
.h-bl {
  bottom: -4.5px;
  left: -4.5px;
}
.h-br {
  bottom: -4.5px;
  right: -4.5px;
}

.el-chip {
  position: absolute;
  top: -20px;
  left: -1px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-sm) 0;
  padding: 1px 7px;
  white-space: nowrap;
}

.el-badge {
  position: absolute;
  bottom: -22px;
  right: -1px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  padding: 1px 7px;
  white-space: nowrap;
}

.guide-v {
  position: absolute;
  top: -46px;
  bottom: -6px;
  left: 55%;
  border-left: 1px dashed var(--accent);
  opacity: 0.7;
}

.mock-props {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-left: 1px solid var(--border);
  min-width: 148px;
}

.props-title {
  font-weight: 700;
  color: var(--ink-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.props-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.props-row i {
  font-style: normal;
  color: var(--ink-muted);
}

.props-row b {
  font-weight: 600;
  color: var(--ink);
}

.mock-status {
  display: flex;
  gap: 20px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
}

@media (min-width: 640px) {
  .mock-body {
    grid-template-columns: 40px 1fr 150px;
  }

  .mock-props {
    display: flex;
  }
}

/* ---------- Sections ---------- */

.section {
  padding: 88px 0;
}

.section-alt {
  background: var(--surface-raised);
  border-block: 1px solid var(--border);
}

.section-lead {
  color: var(--ink-muted);
  font-size: 1.1rem;
  max-width: 44em;
}

[id] {
  scroll-margin-top: 84px;
}

/* ---------- Feature cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 40px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.section-alt .card {
  background: var(--surface);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-subtle);
  color: var(--accent);
  margin-bottom: 16px;
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.card p {
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Workflow steps ---------- */

.steps {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}

.step {
  border-top: 3px solid var(--accent);
  padding-top: 20px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.step p {
  color: var(--ink-muted);
  margin: 0;
}

/* ---------- Data ---------- */

.data-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-top: 40px;
}

.data-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.data-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  padding: 20px;
}

.data-card h3 {
  font-family: var(--font-mono);
  color: var(--accent);
  margin-bottom: 6px;
}

.data-card p {
  color: var(--ink-muted);
  font-size: 0.92rem;
  margin: 0;
}

.data-side {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  padding: 24px 28px;
}

.data-side h3 {
  margin-bottom: 16px;
}

@media (min-width: 900px) {
  .data-grid {
    grid-template-columns: 1.6fr 1fr;
    align-items: start;
  }
}

/* ---------- Check list ---------- */

.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.check-list li {
  position: relative;
  padding-left: 32px;
}

.check-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-subtle);
}

.check-list li::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 9.5px;
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

.check-list b {
  display: block;
}

.check-list li {
  color: var(--ink-muted);
}

.check-list b {
  color: var(--ink);
}

/* ---------- Split layout (format / embed) ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1.1fr 1fr;
  }
}

/* ---------- Code panel ---------- */

.code-panel {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.code-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.code-title {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.code-panel pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
}

.code-panel code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--ink);
}

.c-muted {
  color: var(--ink-muted);
}

/* ---------- Embed band ---------- */

.embed-band {
  background: var(--surface);
}

.embed-list li {
  margin-bottom: 4px;
}

/* ---------- Roadmap ---------- */

#roadmap .chip-row {
  margin-top: 36px;
}

/* ---------- CTA ---------- */

.cta {
  background:
    radial-gradient(55% 80% at 50% 100%, var(--accent-subtle), transparent 70%), var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
}

.cta-inner {
  max-width: 640px;
}

.cta-inner p {
  color: var(--ink-muted);
  font-size: 1.1rem;
}

.cta-inner .btn {
  margin: 12px 0 8px;
}

.cta-note {
  font-size: 0.85rem !important;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-raised);
  padding: 40px 0 32px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand b {
  display: block;
}

.footer-brand span {
  display: block;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-nav a:hover {
  color: var(--accent);
}

.footer-meta {
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin: 0;
}

@media (min-width: 720px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

/* ---------- Mobile nav ---------- */

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

  .section {
    padding: 64px 0;
  }

  .hero {
    padding: 48px 0 64px;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .card {
    transition: none;
  }

  .card:hover {
    transform: none;
  }
}
