/* ─────────────────────────────────────────
   ChronoScope — Minimal stylesheet
   ───────────────────────────────────────── */

/* Tokens */
:root {
  --bg: #0d0d0d;
  --surface: #141414;
  --surface2: #1c1c1c;
  --border: #242424;
  --accent: #e8e8e8;
  --muted: #666;
  --text: #d4d4d4;
  --text-strong: #f0f0f0;
  --highlight: #a442f5;   /* lime accent */
  --radius: 8px;
  --nav-h: 60px;
  --font: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ─── Typography ─── */
h1, h2, h3, h4 {
  color: var(--text-strong);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }

p { color: var(--text); }
a { color: var(--highlight); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { padding-left: 1.4rem; }
li { margin-bottom: .35rem; }

code {
  font-family: var(--mono);
  font-size: .85em;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: .1em .4em;
  border-radius: 4px;
  color: var(--highlight);
}

/* ─── Utility ─── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--highlight);
  font-weight: 600;
  margin-bottom: .5rem;
}
.section { padding: 80px 0; }
.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 48px;
  text-align: center;
}

/* ─── NAV ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(13,13,13,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-strong);
  text-decoration: none;
}
.nav-logo img { width: 26px; height: 26px; border-radius: 6px; }
.nav-links {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 32px;
}
.nav-links a {
  color: var(--muted);
  font-size: .9rem;
  text-decoration: none;
  transition: color .2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text-strong); }

/* ─── HERO ─── */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 40px;
  gap: 48px;
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 700px; }
.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--text-strong);
  margin-bottom: 20px;
}
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--muted);
  margin-bottom: 36px;
  line-height: 1.6;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-screenshot {
  width: 100%;
  max-width: 900px;
}
.hero-screenshot img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 40px 80px rgba(0,0,0,.5);
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-block;
  padding: .65rem 1.4rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .2s, background .2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--highlight);
  color: #0d0d0d;
}
.btn-primary:hover { opacity: .85; text-decoration: none; }
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--accent); text-decoration: none; }

/* ─── FEATURES ─── */
.features { background: var(--surface); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color .2s;
}
.feature-card:hover { border-color: #333; }
.feature-icon { font-size: 1.5rem; display: block; margin-bottom: 12px; }
.feature-card h3 { font-size: 1rem; margin-bottom: 8px; }
.feature-card p { font-size: .9rem; color: var(--muted); }

/* ─── STEPS (WORKFLOW) ─── */
.workflow { background: var(--bg); }
.steps { list-style: none; padding: 0; max-width: 680px; margin: 0 auto; }
.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }
.step-num {
  font-size: .75rem;
  font-family: var(--mono);
  color: var(--highlight);
  font-weight: 700;
  letter-spacing: .05em;
  padding-top: 3px;
  min-width: 28px;
}
.step h3 { font-size: 1rem; margin-bottom: 6px; }
.step p { font-size: .9rem; color: var(--muted); }
.steps--compact .step { padding: 16px 0; }

/* ─── SCREENSHOTS ─── */
.screenshots { background: var(--surface); }
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.screenshot-grid figure {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}
.screenshot-grid figure img {
  width: 100%;
  height: 220px; /* consistent visual height */
  object-fit: cover; /* crop while preserving focal area */
  object-position: center center;
  cursor: zoom-in;
}

/* ─── FOOTER ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--muted);
}

/* ─────────────────────────────────────────
   DOCS PAGE
   ───────────────────────────────────────── */

.docs-page { background: var(--bg); }

.docs-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - var(--nav-h));
}

/* Sidebar */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 32px 0;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  padding: 0 24px 8px;
  font-weight: 600;
}
.sidebar-nav ul { list-style: none; padding: 0; }
.sidebar-nav > ul > li { margin: 0; }
.sidebar-nav ul ul { padding-left: 14px; }
.sidebar-nav a {
  display: block;
  padding: 6px 24px;
  font-size: .85rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
  border-left: 2px solid transparent;
}
.sidebar-nav ul ul a { font-size: .8rem; padding: 4px 24px; }
.sidebar-nav a:hover { color: var(--text-strong); }
.sidebar-nav a.active {
  color: var(--highlight);
  border-left-color: var(--highlight);
}

/* Docs content */
.docs-content {
  flex: 1;
  min-width: 0;
  padding: 48px 56px 80px;
}

.docs-header { margin-bottom: 56px; padding-bottom: 40px; border-bottom: 1px solid var(--border); }
.docs-header h1 { margin-bottom: 16px; }
.docs-lead { font-size: 1.1rem; color: var(--muted); max-width: 600px; }

.doc-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.doc-section:last-child { border-bottom: none; }
.doc-section > h2 {
  margin-bottom: 24px;
}
.doc-section > h3 {
  margin: 32px 0 14px;
  color: var(--text-strong);
}
.doc-section > h4 {
  margin: 24px 0 10px;
}
.doc-section p { margin-bottom: 14px; color: var(--text); }
.doc-section ul, .doc-section ol { margin-bottom: 14px; }
.doc-section li { margin-bottom: .4rem; font-size: .95rem; }

/* Callout */
.callout {
  background: var(--surface2);
  border-left: 3px solid var(--highlight);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: .9rem;
  color: var(--text);
}
.callout ul { margin: 8px 0 0; }
.callout a { color: var(--highlight); }

/* Figures */
.doc-figure {
  margin: 20px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-block;
  max-width: 100%;
}

/* New: ensure images keep consistent visual weight regardless of aspect ratio */
.doc-figure img,
.screenshot-grid figure img {
  display: block;
  width: 100%;
  height: 220px; /* consistent visual height */
  object-fit: cover; /* crop while preserving focal area */
  object-position: center center;
  cursor: zoom-in;
}

.doc-figure figcaption {
  padding: 8px 14px;
  font-size: .78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  text-align: center;
}
.screenshot-grid figcaption {
  padding: 10px 14px;
  font-size: .8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* Updated: modern, minimal figcaption styles */
.doc-figure figcaption,
.screenshot-grid figcaption {
  padding: 8px 14px;
  font-size: .82rem;
  color: var(--muted);
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(0,0,0,0.02));
  border-top: none; /* remove hard border */
  margin-top: 0;
  display: block;
  letter-spacing: .02em;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.015);
}

/* Make caption label slightly bolder and uppercased for small captions */
.doc-figure figcaption::first-letter { text-transform: none; }
.doc-figure figcaption { font-weight: 600; color: var(--text-strong); }
.screenshot-grid figcaption { font-weight: 600; color: var(--muted); }

/* Smaller, subtle secondary caption style for tiny figures */
.doc-figure--small figcaption { font-size: .75rem; color: var(--muted); font-weight: 500; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .docs-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
  }
  .docs-content { padding: 32px 24px 60px; }
  .figure-row { flex-direction: column; }
}

@media (max-width: 600px) {
  .hero { padding: 60px 16px 32px; }
  .hero-cta { flex-direction: column; align-items: center; }
  .nav-links { gap: 20px; }
  .section { padding: 56px 0; }
}

/* Lightbox / Modal for maximizing images */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox.visible { display: flex; }
.lightbox img {
  display: block;
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0,0,0,.8);
  cursor: default;
}
.lightbox .close {
  position: fixed;
  top: 18px;
  right: 24px;
  color: var(--text-strong);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  z-index: 10000;
}
.lightbox .close:hover { background: var(--border); }
.lightbox .caption {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: .85rem;
  background: rgba(0,0,0,.6);
  padding: 6px 16px;
  border-radius: 20px;
  white-space: nowrap;
}
