/* ============================================================================
   drDRO documentation site — design system
   Dark, DRO-inspired theme: near-black surfaces, signature amber accents,
   seven-segment display motif. Dependency-free (no external fonts/CDNs).
   ========================================================================== */

:root {
  --bg:        #0a0c0f;
  --bg-2:      #0e1116;
  --surface:   #14181e;
  --surface-2: #1a1f27;
  --surface-3: #212833;
  --border:    #262d38;
  --border-2:  #38424f;

  --text:      #e8eaed;
  --text-dim:  #a7b0bb;
  --text-faint:#6b7480;

  --amber:     #f7a41b;
  --amber-2:   #ffc257;
  --amber-soft:rgba(247, 164, 27, 0.13);
  --amber-line:rgba(247, 164, 27, 0.35);

  --blue:      #5b8cff;
  --blue-soft: rgba(91, 140, 255, 0.13);
  --green:     #37c871;
  --green-soft:rgba(55, 200, 113, 0.12);
  --red:       #ff6060;
  --red-soft:  rgba(255, 96, 96, 0.12);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1120px;
  --nav-h: 60px;

  --shadow: 0 10px 40px rgba(0,0,0,0.45);
  --shadow-sm: 0 4px 18px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(247,164,27,0.07), transparent 60%),
    radial-gradient(800px 600px at 0% 0%, rgba(91,140,255,0.06), transparent 55%);
  pointer-events: none;
}

a { color: var(--amber-2); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .5rem; }
h3 { font-size: 1.25rem; margin: 2rem 0 .6rem; }
h4 { font-size: 1.02rem; margin: 1.4rem 0 .4rem; }
p  { margin: 0 0 1rem; color: var(--text-dim); }
strong { color: var(--text); }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.12em 0.42em;
  border-radius: 6px;
  color: var(--amber-2);
}

/* Layout helpers ----------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section-tight { padding: 44px 0; }
.center { text-align: center; }
.lead { font-size: 1.14rem; color: var(--text-dim); max-width: 44rem; }
.muted { color: var(--text-faint); }
.hr { height: 1px; background: var(--border); border: 0; margin: 0; }

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.8rem;
}

/* Navbar ------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  backdrop-filter: blur(12px);
  background: rgba(10,12,15,0.82);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px; height: 100%;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 1.06rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; flex: none; }
.brand b { color: var(--amber); }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  color: var(--text-dim); font-size: 0.92rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--amber-2); background: var(--amber-soft); }
.nav-cta {
  border: 1px solid var(--border-2) !important;
  display: inline-flex; align-items: center; gap: 7px;
}
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border-2); color: var(--text); width: 40px; height: 38px; border-radius: 8px; cursor: pointer; font-size: 1.2rem; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    padding: 12px 16px; margin: 0;
    transform: translateY(-140%); transition: transform .25s ease;
    box-shadow: var(--shadow);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
}

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600;
  padding: 12px 20px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: transform .12s ease, background .15s ease, border-color .15s;
  text-decoration: none !important; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--amber); color: #1a1206; box-shadow: 0 6px 22px rgba(247,164,27,0.28); }
.btn-primary:hover { background: var(--amber-2); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--text-faint); }
.btn-lg { padding: 15px 26px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* Seven-segment DRO display motif ------------------------------------------ */
.dro {
  font-family: var(--mono);
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-shadow: 0 0 22px rgba(247,164,27,0.35);
}

/* Hero --------------------------------------------------------------------- */
.hero { padding: 88px 0 40px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.5rem); margin: 0 0 1rem; }
.hero h1 .amber { color: var(--amber); }
.hero .lead { font-size: 1.2rem; margin-bottom: 1.8rem; }
.hero-shot {
  border-radius: 14px; border: 1px solid var(--border-2);
  box-shadow: var(--shadow); overflow: hidden;
  background: #000;
}
.hero-shot img { display: block; width: 100%; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.6rem; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero { padding-top: 56px; }
}

/* Badges / chips ----------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
}
.chip.amber { color: var(--amber-2); background: var(--amber-soft); border-color: var(--amber-line); }
.chip.green { color: var(--green); background: var(--green-soft); border-color: rgba(55,200,113,.3); }
.chip.blue  { color: var(--blue);  background: var(--blue-soft);  border-color: rgba(91,140,255,.3); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Cards / grids ------------------------------------------------------------ */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--border-2); }
.card h3, .card h4 { margin-top: 0; }
.card .ico {
  width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 14px;
  background: var(--amber-soft); color: var(--amber);
  border: 1px solid var(--amber-line);
}
.card .ico svg { width: 22px; height: 22px; }
.card p:last-child { margin-bottom: 0; }

/* Feature block (screenshot + text) ---------------------------------------- */
.feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
  padding: 40px 0;
}
.feature:nth-child(even) .feature-media { order: 2; }
.feature-media {
  border-radius: 12px; border: 1px solid var(--border-2);
  overflow: hidden; background: #000; box-shadow: var(--shadow-sm);
}
.feature-media img { width: 100%; cursor: zoom-in; }
.feature h3 { margin-top: 0; font-size: 1.5rem; }
.feature ul { margin: 1rem 0 0; padding-left: 1.1rem; color: var(--text-dim); }
.feature ul li { margin-bottom: .4rem; }
@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; gap: 20px; }
  .feature:nth-child(even) .feature-media { order: 0; }
}

/* Tables ------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; min-width: 520px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.03em; text-transform: uppercase; }
td { color: var(--text-dim); }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.tick { color: var(--green); font-weight: 700; }
.cross { color: var(--red); font-weight: 700; }
.warnmark { color: var(--amber); font-weight: 700; }

/* Code blocks -------------------------------------------------------------- */
.code {
  position: relative;
  background: #06080b;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  overflow: hidden;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface); color: var(--text-faint);
  font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em;
}
.code pre { margin: 0; padding: 16px; overflow-x: auto; }
.code pre code {
  background: none; border: 0; padding: 0; color: #d7e0ea; font-size: 0.86rem; line-height: 1.6;
}
.code .cmt { color: #6b7480; }
.code .tok { color: var(--amber-2); }
.copy-btn {
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text-dim);
  font-size: 0.72rem; font-family: var(--mono); padding: 4px 10px; border-radius: 6px; cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--text-faint); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

/* Callouts ----------------------------------------------------------------- */
.callout {
  display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); margin: 1.4rem 0;
}
.callout .ci { flex: none; font-size: 1.2rem; line-height: 1.5; }
.callout p { margin: 0; color: var(--text-dim); }
.callout p + p { margin-top: .5rem; }
.callout.info  { border-color: rgba(91,140,255,.3);  background: var(--blue-soft); }
.callout.warn  { border-color: var(--amber-line);    background: var(--amber-soft); }
.callout.good  { border-color: rgba(55,200,113,.3);  background: var(--green-soft); }
.callout.danger{ border-color: rgba(255,96,96,.3);   background: var(--red-soft); }
.callout b { color: var(--text); }

/* Steps -------------------------------------------------------------------- */
.steps { counter-reset: step; margin: 1.4rem 0; padding: 0; list-style: none; }
.steps > li {
  position: relative; padding: 0 0 26px 52px; margin: 0;
}
.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-line);
  font-family: var(--mono); font-weight: 700; font-size: 0.95rem;
}
.steps > li::after {
  content: ""; position: absolute; left: 16px; top: 38px; bottom: 4px; width: 1px;
  background: var(--border);
}
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps h4 { margin: 4px 0 6px; }
.steps p { margin: 0 0 .5rem; }

/* Tabs --------------------------------------------------------------------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin: 1.2rem 0 0; flex-wrap: wrap; }
.tab-btn {
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-dim); font-family: var(--sans); font-size: 0.92rem; font-weight: 600;
  padding: 10px 14px; cursor: pointer;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--amber-2); border-bottom-color: var(--amber); }
.tab-panel { display: none; padding-top: 6px; }
.tab-panel.active { display: block; }

/* Screenshot gallery ------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .gallery { grid-template-columns: 1fr; } }
.shot {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color .2s, transform .2s;
}
.shot:hover { border-color: var(--amber-line); transform: translateY(-3px); }
.shot .thumb { background: #000; aspect-ratio: 1024 / 600; overflow: hidden; }
.shot .thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.shot .cap { padding: 12px 15px; }
.shot .cap h4 { margin: 0 0 3px; font-size: 0.98rem; }
.shot .cap p { margin: 0; font-size: 0.83rem; color: var(--text-faint); }

/* Lightbox ----------------------------------------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(3,4,6,0.9); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 30px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 88vh; border-radius: 10px; border: 1px solid var(--border-2); box-shadow: var(--shadow); }
.lightbox .lb-cap { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: var(--text-dim); font-size: 0.9rem; }
.lightbox .lb-close { position: absolute; top: 18px; right: 24px; color: var(--text); font-size: 2rem; background: none; border: 0; cursor: pointer; line-height: 1; }

/* Release/download panel --------------------------------------------------- */
.release {
  background: linear-gradient(180deg, var(--surface-2), var(--bg-2));
  border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm);
}
.release .rel-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.release .ver { font-family: var(--mono); font-size: 1.7rem; color: var(--amber); font-weight: 700; }
.release .meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 16px 0 20px; color: var(--text-dim); font-size: 0.9rem; }
.release .meta b { color: var(--text); font-family: var(--mono); }
.rel-hash { font-family: var(--mono); font-size: 0.76rem; color: var(--text-faint); word-break: break-all; margin-top: 14px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-2); border-top-color: var(--amber); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Anchored section headings ------------------------------------------------ */
.anchor-h { scroll-margin-top: calc(var(--nav-h) + 24px); }

/* Table of contents (sidebar on doc pages) --------------------------------- */
.doc-layout { display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: start; }
.toc { position: sticky; top: calc(var(--nav-h) + 24px); }
.toc h5 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 12px; }
.toc a { display: block; color: var(--text-dim); font-size: 0.88rem; padding: 5px 0 5px 12px; border-left: 2px solid var(--border); }
.toc a:hover { color: var(--text); text-decoration: none; border-left-color: var(--text-faint); }
.toc a.active { color: var(--amber-2); border-left-color: var(--amber); }
@media (max-width: 900px) { .doc-layout { grid-template-columns: 1fr; } .toc { display: none; } }

/* Stat row ----------------------------------------------------------------- */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 720px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
.stat { text-align: center; padding: 22px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat .n { font-family: var(--mono); font-size: 1.9rem; font-weight: 700; color: var(--amber); }
.stat .l { font-size: 0.82rem; color: var(--text-faint); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

/* Footer ------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding: 44px 0 60px; margin-top: 40px; color: var(--text-faint); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.footer h5 { color: var(--text); font-size: 0.9rem; margin: 0 0 12px; }
.footer a { color: var(--text-dim); font-size: 0.9rem; display: block; padding: 3px 0; }
.footer a:hover { color: var(--amber-2); }
.footer .fnote { font-size: 0.82rem; margin-top: 28px; }

/* CTA banner --------------------------------------------------------------- */
.cta {
  text-align: center;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(247,164,27,0.1), transparent 70%),
    var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 18px; padding: 54px 28px;
}
.cta h2 { margin-bottom: .6rem; }

/* Pill list (feature ticks) ------------------------------------------------ */
.ticks { list-style: none; padding: 0; margin: 1rem 0; }
.ticks li { position: relative; padding-left: 30px; margin-bottom: .6rem; color: var(--text-dim); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--amber-soft); border: 1px solid var(--amber-line); }
.ticks li::after { content: ""; position: absolute; left: 5px; top: 10px; width: 4px; height: 8px; border-right: 2px solid var(--amber); border-bottom: 2px solid var(--amber); transform: rotate(40deg); }

.small { font-size: 0.86rem; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }

/* Videos ------------------------------------------------------------------- */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .video-grid { grid-template-columns: 1fr; } }

.video-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color .2s, transform .2s; display: flex; flex-direction: column;
}
.video-card:hover { border-color: var(--amber-line); transform: translateY(-3px); }

/* 16:9 play facade — a button showing the YouTube thumbnail; swapped for an
   iframe only on click, so 14 videos don't load 14 players up front. */
.video-thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  border: 0; padding: 0; cursor: pointer;
  background: #000 center/cover no-repeat;
  background-image:
    linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.35)),
    radial-gradient(120% 120% at 50% 40%, #1a1f27, #0a0c0f);
}
.video-thumb[style*="background-image"] { background-blend-mode: normal; }
.video-play {
  position: absolute; inset: 0; margin: auto; width: 62px; height: 62px; border-radius: 50%;
  background: rgba(10,12,15,0.72); border: 2px solid rgba(255,255,255,.85);
  transition: transform .15s ease, background .15s ease;
}
.video-play::after {
  content: ""; position: absolute; top: 50%; left: 54%; transform: translate(-50%,-50%);
  border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff;
}
.video-thumb:hover .video-play { transform: scale(1.08); background: var(--amber); border-color: var(--amber); }
.video-thumb:hover .video-play::after { border-left-color: #1a1206; }

.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.video-meta { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.video-meta h4 { margin: 0; font-size: 0.98rem; line-height: 1.35; }
.video-sub { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.video-sub .chip { font-size: 0.72rem; padding: 4px 9px; }
.video-sub a { font-size: 0.82rem; white-space: nowrap; }
