/* Dittoly introductory site: minimal base, spatial depth in the hero. No external fonts or scripts. */
:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-alt: #eef3f8;
  --text: #101c30;
  --muted: #5c6f87;
  --border: #dce5ef;
  --accent: #008f83;
  --accent-text: #ffffff;
  --accent-soft: rgba(0, 143, 131, 0.12);
  --warn: #c98a12;
  --shadow: 0 1px 2px rgba(16, 28, 48, 0.06), 0 24px 48px -24px rgba(16, 28, 48, 0.28);
  --sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #041424;
    --surface: #0c1d30;
    --surface-alt: #071829;
    --text: #d7e5fb;
    --muted: #91a3b8;
    --border: #20354a;
    --accent: #37d5c3;
    --accent-text: #002d29;
    --accent-soft: rgba(55, 213, 195, 0.12);
    --warn: #f0b54a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 30px 60px -30px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); font-weight: 700; }
h1 span { color: var(--accent); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 680; max-width: 22ch; }
h3 { font-size: 1.1rem; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.eyebrow { font: 600 0.75rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.1em; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.fine { font-size: 0.85rem; color: var(--muted); margin-top: 1.4em; }
.mono { font-family: var(--mono); font-size: 0.82rem; }
.small { font-size: 0.74rem; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-text); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 0.8em 1.3em; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-weight: 600; text-decoration: none; border: 1px solid var(--accent); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -10px var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: none; }
.btn-small { padding: 0.5em 0.95em; font-size: 0.9rem; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1.8em; }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.brand svg { color: var(--accent); }
.nav nav { display: flex; align-items: center; gap: 24px; }
.nav nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav nav a:not(.btn):hover { color: var(--text); }

/* Hero */
.hero { padding: clamp(56px, 9vw, 112px) 0 clamp(56px, 8vw, 96px); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }

/* Spatial scene: three layered panels at different depths */
.scene { perspective: 1400px; height: 600px; }
.stage { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(var(--rx, 14deg)) rotateY(var(--ry, -22deg)); transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.card { position: absolute; width: 74%; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 8px; font: 600 0.72rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot-warn { background: var(--warn); }
.dot-ok { background: var(--accent); }
.card-back { top: 0; left: 0; transform: translateZ(-120px); opacity: 0.9; }
.card-mid { top: 125px; left: 14%; transform: translateZ(0); }
.card-front { top: 400px; left: 26%; transform: translateZ(110px); }
.steps { list-style: none; margin: 0 0 12px; padding: 0; font-size: 0.9rem; }
.steps li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); }
.steps li:last-child { border-bottom: 0; }
.steps b { font: 600 0.72rem var(--mono); color: var(--accent); }
.pill { display: inline-block; font: 600 0.72rem var(--mono); padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.bar { height: 8px; border-radius: 4px; background: var(--surface-alt); margin: 8px 0; overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: 4px; }
.floor { position: absolute; left: 5%; right: 5%; bottom: -10px; height: 70%; transform: translateZ(-160px) rotateX(90deg) translateY(120px); background: radial-gradient(closest-side, var(--accent-soft), transparent); }

/* Sections */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt { background: var(--surface-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* How it works: four panels rising toward the viewer, joined by a lit path */
.flow-scene { perspective: 1600px; margin-top: 48px; padding: 24px 0 40px; }
.flow { --rx: 12deg; --ry: -10deg; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; position: relative; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.flow::before { content: ''; position: absolute; left: 6%; right: 6%; top: 58px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent) 12%, var(--accent) 88%, transparent); opacity: 0.55; transform: translateZ(-2px); box-shadow: 0 0 18px var(--accent); }
.flow li { --z: calc(var(--i) * 34px); --lift: calc(var(--i) * -14px); position: relative; padding: 24px 22px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transform: translate3d(0, var(--lift), var(--z)); transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s ease, opacity 0.6s ease, border-color 0.3s ease; }
.flow li:nth-child(1) { --i: 0; }
.flow li:nth-child(2) { --i: 1; }
.flow li:nth-child(3) { --i: 2; }
.flow li:nth-child(4) { --i: 3; }
.flow li:hover { transform: translate3d(0, calc(var(--lift) - 8px), calc(var(--z) + 40px)); border-color: var(--accent); }
.flow .num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font: 600 0.8rem var(--mono); color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); margin-bottom: 18px; position: relative; z-index: 1; }
.flow li:last-child .num { background: var(--accent); color: var(--accent-text); }
.flow p { color: var(--muted); font-size: 0.95rem; margin: 0; }
/* Fly in when scrolled to (only once the script has marked the page; without it, the panels just show) */
.reveal .flow li { opacity: 0; transform: translate3d(0, calc(var(--lift) + 40px), calc(var(--z) - 160px)); }
.reveal .flow.in li { opacity: 1; transform: translate3d(0, var(--lift), var(--z)); transition-delay: calc(var(--i) * 110ms); }
.reveal .flow.in li:hover { transform: translate3d(0, calc(var(--lift) - 8px), calc(var(--z) + 40px)); transition-delay: 0s; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature p { color: var(--muted); font-size: 0.95rem; margin: 0; }

.trust { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { position: relative; padding: 16px 0 16px 34px; border-bottom: 1px solid var(--border); }
.checks li::before { content: ''; position: absolute; left: 4px; top: 22px; width: 14px; height: 8px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

.start { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.start p { color: var(--muted); max-width: 48ch; }
.terminal { margin: 0; padding: 22px 24px; background: #0b1622; color: #d7e5fb; border-radius: var(--radius); font: 0.82rem/1.7 var(--mono); overflow-x: auto; box-shadow: var(--shadow); border: 1px solid #1c2c3e; }
.terminal .c { color: #6f8aa6; }

.footer { padding: 32px 0; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Smaller screens: the scene flattens and stacks below the copy */
@media (max-width: 900px) {
  .hero-inner, .trust, .start { grid-template-columns: 1fr; }
  .scene { height: 600px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: 1fr 1fr; gap: 16px; }
  .flow::before { display: none; }
  .flow-scene { perspective: none; padding: 0; }
  .flow, .flow li, .reveal .flow li, .reveal .flow.in li { transform: none; }
}
@media (max-width: 600px) {
  .nav nav a:not(.btn) { display: none; }
  .grid, .flow { grid-template-columns: 1fr; }

  .scene { height: 610px; }
  .card { width: 86%; }
  .card-mid { left: 7%; }
  .card-mid { top: 130px; }
  .card-front { top: 420px; left: 12%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage, .btn, .feature, .flow, .flow li { transition: none; }
  .flow li:hover { transform: translate3d(0, var(--lift), var(--z)); }
}

/* Questions */
.faq details { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:first-of-type { border-top: 1px solid var(--border); margin-top: 32px; }
.faq summary { list-style: none; cursor: pointer; padding: 20px 36px 20px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font: 400 1.4rem var(--mono); color: var(--accent); }
.faq details[open] summary::after { content: '–'; }
.faq summary h3 { display: inline; margin: 0; font-size: 1.05rem; }
.faq details p { color: var(--muted); margin: 0 0 20px; max-width: 68ch; }

/* Why: the AI-every-time panel recedes, the Flow panel stands forward */
.why-scene { perspective: 1600px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; margin-top: 44px; transform-style: preserve-3d; }
.why-panel { padding: 24px 26px 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.why-panel ul { list-style: none; margin: 0; padding: 0; }
.why-panel li { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 13px 0; border-top: 1px solid var(--border); font-size: 0.95rem; }
.why-k { font: 600 0.72rem/1.9 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.why-ai { transform: rotateY(14deg) translateZ(-60px); opacity: 0.78; }
.why-ai .why-v { color: var(--muted); }
.why-dty { transform: rotateY(-8deg) translateZ(30px); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--shadow), 0 0 0 1px var(--accent-soft), 0 30px 80px -40px var(--accent); }
.why-dty .card-head { color: var(--accent); }
.why-ai:hover { transform: rotateY(8deg) translateZ(-30px); opacity: 0.9; }
.why-dty:hover { transform: rotateY(-4deg) translateZ(50px); }
#why .fine { max-width: 72ch; margin-top: 28px; }
@media (max-width: 900px) {
  .why-scene { grid-template-columns: 1fr; perspective: none; gap: 16px; }
  .why-ai, .why-dty, .why-ai:hover, .why-dty:hover { transform: none; }
}
@media (max-width: 600px) { .why-panel li { grid-template-columns: 1fr; gap: 2px; } }
@media (prefers-reduced-motion: reduce) { .why-panel { transition: none; } .why-ai:hover { transform: rotateY(14deg) translateZ(-60px); } .why-dty:hover { transform: rotateY(-8deg) translateZ(30px); } }

/* Docs: five setup steps, then a guide per feature */
.quickstart { list-style: none; margin: 40px 0 48px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.quickstart a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: transform 0.2s ease, border-color 0.2s ease; }
.quickstart a:hover { transform: translateY(-3px); border-color: var(--accent); }
.quickstart span:not(.step-n) { color: var(--muted); font-size: 0.88rem; }
.step-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font: 600 0.78rem var(--mono); color: var(--accent); background: var(--accent-soft); margin-bottom: 6px; }
.doc-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 56px; }
.doc-group h3 { font: 600 0.75rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.doc-group ul { list-style: none; margin: 0; padding: 0; }
.doc-group li { padding: 10px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.doc-group a { color: var(--text); font-weight: 600; text-decoration: none; }
.doc-group a:hover { color: var(--accent); }
.doc-group li span { color: var(--muted); font-size: 0.88rem; }
#docs .fine a { color: var(--accent); }
@media (max-width: 900px) { .quickstart { grid-template-columns: 1fr 1fr; } .doc-groups { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .quickstart, .doc-groups { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .quickstart a { transition: none; } }

/* Guides page (docs.html): sidebar with search, short step-by-step guides */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.guides-layout { display: grid; grid-template-columns: 260px 1fr; gap: 56px; align-items: start; padding-top: 40px; padding-bottom: 80px; }
.guides-side { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; padding-right: 8px; }
.search input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.side-group { font: 600 0.72rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 24px 0 8px; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 0.93rem; }
.side-nav a:hover, .side-nav a.active { color: var(--text); background: var(--accent-soft); }
.guides-main h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.group-title { font: 600 0.8rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 56px 0 0; max-width: none; }
.guide { padding: 28px 0 32px; border-bottom: 1px solid var(--border); scroll-margin-top: 84px; }
.guide h3 { font-size: 1.45rem; margin-bottom: 10px; }
.guide .what { font-size: 1.05rem; max-width: 70ch; }
.guide .when { color: var(--muted); max-width: 70ch; }
.guide .when b, .guide .tip b { color: var(--text); margin-right: 4px; }
.steps-list { counter-reset: step; list-style: none; margin: 18px 0; padding: 0; max-width: 72ch; }
.steps-list li { counter-increment: step; position: relative; padding: 10px 0 10px 44px; }
.steps-list li::before { content: counter(step); position: absolute; left: 0; top: 8px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font: 600 0.8rem var(--mono); color: var(--accent); background: var(--accent-soft); }
.guide code { font: 0.85em var(--mono); background: var(--surface-alt); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.guide .tip { padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; max-width: 72ch; }
.guide .ref { font-weight: 600; color: var(--accent); text-decoration: none; }
.guide .ref:hover { text-decoration: underline; }
.no-results { padding: 16px; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
@media (max-width: 900px) {
  .guides-layout { grid-template-columns: 1fr; gap: 24px; }
  .guides-side { position: static; max-height: none; overflow: visible; }
  .side-toggle { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 4px 14px 8px; background: var(--surface); }
  .side-toggle summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
}
@media (min-width: 901px) { .side-toggle > summary { display: none; } }
