/* ==========================================================================
   Roadmapped — roadmapped.work
   Same visual world as the app: monochrome + one blue, tri-layer
   page/card/rule, zero-radius surfaces, system fonts. No dependencies.
   ========================================================================== */

/* ---------- Tokens ---------- */

:root {
  --page:   #fafafa;
  --card:   #ffffff;
  --rule:   #e5e5e5;
  --ink:    #171717;
  --soft:   #525252;  /* secondary body text */
  --muted:  #737373;  /* contrast floor on page/card */
  --accent: #2563eb;
  --tint:   #eef3fd;
  --hover:  #f5f5f5;
  --edge:   #d4d4d4;
  --panel-shadow: -10px 0 24px rgba(0, 0, 0, 0.06);
  --code-bg: #efefef;
  --btn-bg:    #171717;
  --btn-ink:   #ffffff;
  --btn-hover: #404040;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page:   #0a0a0a;
    --card:   #161616;
    --rule:   #2a2a2a;
    --ink:    #ededed;
    --soft:   #b9b9b9;
    --muted:  #a3a3a3;
    --accent: #60a5fa;
    --tint:   #17233c;
    --hover:  #202020;
    --edge:   #3a3a3a;
    --panel-shadow: -10px 0 24px rgba(0, 0, 0, 0.45);
    --code-bg: #262626;
    --btn-bg:    #ededed;
    --btn-ink:   #0a0a0a;
    --btn-hover: #d4d4d4;
  }
}

/* ---------- Reset (minimal) ---------- */

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, pre { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--tint); color: var(--ink); }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--code-bg);
  color: var(--ink);
  padding: 0.1em 0.35em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  color: var(--ink);
  padding: 0.5rem 1rem;
  border: 1px solid var(--rule);
  z-index: 10;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- Layout ---------- */

.container {
  max-width: 66rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

.section { padding-block: clamp(3.5rem, 8vw, 5.5rem); }

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

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--page);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }

.brand-name {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.mark-bg     { fill: var(--ink); }
.mark-line   { fill: var(--page); }
.mark-accent { fill: var(--accent); }

.header-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
}

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

.hero { padding-block: clamp(4rem, 10vw, 7.5rem) clamp(2.5rem, 5vw, 4rem); }

.hero-title {
  max-width: 24ch;
  font-size: clamp(2.125rem, 5.4vw, 3.625rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}

.hero-beat {
  display: block;
  color: var(--muted);
  margin-top: 0.15em;
}

.hero-sub {
  max-width: 58ch;
  margin-top: 1.5rem;
  font-size: clamp(1.0625rem, 1.8vw, 1.1875rem);
  color: var(--soft);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 6px;
  font-weight: 550;
  font-size: 1rem;
  line-height: 1;
  padding: 0.875rem 1.25rem;
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-ink);
}
.btn-primary:hover {
  background: var(--btn-hover);
  text-decoration: none;
}
.btn-primary code {
  background: color-mix(in srgb, var(--btn-ink) 14%, transparent);
  color: var(--btn-ink);
  padding: 0.2em 0.45em;
  border-radius: 3px;
}

.link-arrow {
  font-weight: 500;
  color: var(--ink);
}

.cta-note {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- Live demo: two windows (terminal + the real app) ---------- */

.demo { padding-block: 0 clamp(3rem, 7vw, 5rem); }

/* The stage is deliberately wider than the text container: the demo is the
   hero, not an illustration inside it. */
.demo-stage {
  max-width: 105rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 2.5vw, 2rem);
}

/* Two distinct windows with a visible gap: the terminal is one app, the
   dashboard is another. The page background between them is the proof. */
.duo {
  display: grid;
  grid-template-columns: minmax(19rem, 24rem) minmax(0, 1fr);
  gap: clamp(1rem, 2.2vw, 1.75rem);
  align-items: stretch;
}

.window {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--edge);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  background: var(--page);
  flex: none;
  min-width: 0;
}

.window-dots {
  display: inline-flex;
  gap: 6px;
  flex: none;
}
.window-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rule);
  border: 1px solid var(--edge);
}

.window-name {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.window-name-mono {
  font-family: var(--mono);
  font-size: 0.75rem;
}

/* The app window sets the height of the row; the terminal stretches to match. */
.window-app { height: clamp(34rem, 78vh, 52rem); }

.app-frame {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 0;
  border: 0;
  /* The app is light-only for now; its own background, not the site's. */
  background: #fafafa;
}

/* --- Terminal --- */

.term {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 2.05;
  padding: 1rem 1.1rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.cl   { white-space: pre-wrap; color: var(--soft); }
.cl-p { color: var(--muted); }
.cl[data-kind="you"] .cl-t { color: var(--ink); font-weight: 600; }
.cl[data-kind="cmd"] { color: var(--muted); padding-left: 1.1rem; }
.cl-progress { color: var(--accent); font-weight: 600; }

/* replay states: keep layout, hide content (no layout shift) */
.term-anim .cl:not(.on) { visibility: hidden; }

.term-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  vertical-align: text-bottom;
  background: var(--ink);
}

.demo-caption {
  max-width: 68ch;
  margin-top: 1.75rem;
  font-size: 0.9375rem;
  color: var(--soft);
}

/* ---------- Sections: eyebrows + titles ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 0.875rem;
}

.eyebrow-out { color: var(--muted); }

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 30ch;
}

.prose { max-width: 62ch; margin-top: 1.25rem; color: var(--soft); }

/* ---------- Features ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 2rem;
}

.feature-card {
  background: var(--card);
  padding: 1.75rem;
}

.feature-file {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.875rem;
}

.feature-title {
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.feature-card p:not(.feature-file) {
  font-size: 0.9688rem;
  color: var(--soft);
}

/* ---------- How it works ---------- */

.how-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  margin-top: 1.5rem;
}

.how-prose p { max-width: 58ch; color: var(--soft); }
.how-prose p + p { margin-top: 1.25rem; }

.callout {
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: inset 2px 0 0 var(--accent);
  padding: 1rem 1.25rem;
  color: var(--ink) !important;
}

.how-tree {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
}

.how-tree pre {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.85;
  color: var(--ink);
}

.tree-note { color: var(--muted); }

/* ---------- Quickstart ---------- */

.code-block {
  background: var(--card);
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.9;
  padding: 1.25rem 1.5rem;
  margin-top: 1.75rem;
  max-width: 46rem;
  overflow-x: auto;
}

.code-block code {
  background: none;
  padding: 0;
  font-size: 1em;
}

.code-comment { color: var(--muted); }

.under-block { margin-top: 1.25rem; }

/* ---------- Privacy / Open source pair ---------- */

.pair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.pair-card {
  background: var(--card);
  padding: clamp(1.75rem, 3vw, 2.5rem);
}

.pair-title { font-size: 1.375rem; margin-bottom: 0.75rem; }

.pair-card > p:not(.eyebrow) {
  font-size: 0.9688rem;
  color: var(--soft);
}

.pair-links { margin-top: 1.25rem; }
.pair-links .link-arrow { color: var(--accent); }
.link-sep { color: var(--muted); margin-inline: 0.5rem; }

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem;
  font-size: 0.9375rem;
  color: var(--soft);
}

.footer-note { color: var(--muted); margin-top: 0.375rem; }

/* ---------- Responsive ---------- */

/* The two windows stack below ~1000px: terminal first, then the app.
   The app window keeps a fixed height and scrolls internally — the page
   itself never scrolls sideways. */
@media (max-width: 62.5rem) {
  .duo { grid-template-columns: 1fr; }

  .term {
    flex: none;
    max-height: 18rem;
  }

  .window-app { height: min(80vh, 38rem); }

  /* The app is a desktop app. Rather than squeeze it into a phone column,
     render it at 2× width and scale it down: the real layout, zoomed out,
     still fully interactive. */
  .window-app { overflow: hidden; }
  .app-frame {
    width: 200%;
    height: 200%;
    flex: none;
    transform: scale(0.5);
    transform-origin: top left;
  }
}

@media (max-width: 760px) {
  .feature-grid,
  .pair-grid { grid-template-columns: 1fr; }

  .how-grid { grid-template-columns: 1fr; }

  .feature-card { padding: 1.375rem; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
