/* Code Deck — shared site styles */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-alt: #f6f5f3;
  --card: #ffffff;
  --border: #e7e3dd;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #d97a4e;
  --accent-strong: #c25f31;
  --accent-soft: rgba(217, 122, 78, 0.10);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --radius: 14px;
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f10;
    --bg-alt: #161617;
    --card: #1a1a1c;
    --border: #2a2a2d;
    --text: #ececec;
    --muted: #9a9a9a;
    --accent: #e29a73;
    --accent-strong: #efb392;
    --accent-soft: rgba(226, 154, 115, 0.12);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

@media (prefers-color-scheme: dark) { a { color: var(--accent); } }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* ---- Site header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .mark {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 26px; height: 26px;
  padding: 3px;
  border-radius: 7px;
  background: var(--accent);
}
.brand .mark span { background: rgba(255,255,255,.92); border-radius: 1.5px; }
.nav { display: flex; gap: 22px; align-items: center; }
.nav a { color: var(--muted); font-size: .95rem; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 560px) { .nav a.hide-sm { display: none; } }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-alt); }

/* ---- Hero ---- */
.hero { padding: 84px 0 56px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 56px 0 32px; }
}
.eyebrow {
  display: inline-block;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}
@media (prefers-color-scheme: dark) { .eyebrow { color: var(--accent); } }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.hero p.lead { font-size: 1.2rem; color: var(--muted); margin: 0 0 30px; max-width: 34ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.fineprint { margin-top: 18px; font-size: .9rem; color: var(--muted); }

/* Phone frame in hero */
.phone {
  justify-self: center;
  width: min(300px, 78vw);
  aspect-ratio: 9 / 19.5;
  border-radius: 40px;
  padding: 10px;
  background: linear-gradient(160deg, #2a2a2d, #4a4a4d);
  box-shadow: var(--shadow);
  position: relative;
}
.phone::before {
  content: "";
  position: absolute;
  top: 18px; left: 50%;
  transform: translateX(-50%);
  width: 90px; height: 22px;
  background: #1b1b1d;
  border-radius: 12px;
  z-index: 2;
}
.phone img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 31px;
  display: block;
}

/* ---- Sections ---- */
section.band { padding: 72px 0; }
section.band.alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.section-head p { color: var(--muted); font-size: 1.1rem; margin: 0; }

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 820px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.feature .ico {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 1.35rem;
  margin-bottom: 14px;
}
@media (prefers-color-scheme: dark) { .feature .ico { color: var(--accent); } }
.feature h3 { margin: 0 0 6px; font-size: 1.08rem; }
.feature p { margin: 0; color: var(--muted); font-size: .97rem; line-height: 1.55; }

/* Screenshot strip */
.shots {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 8px 4px 20px;
  scroll-snap-type: x mandatory;
}
.shots figure {
  margin: 0;
  flex: 0 0 auto;
  width: 220px;
  scroll-snap-align: center;
  text-align: center;
}
.shots img {
  width: 100%;
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: block;
}
.shots figcaption { margin-top: 12px; color: var(--muted); font-size: .9rem; }

/* iPad screenshots are landscape — wider figures, no portrait constraint */
.shots-ipad figure { width: 420px; }
@media (max-width: 520px) { .shots-ipad figure { width: 300px; } }
.shots-ipad img { border-radius: 16px; }

/* ---- Diagrams (inline SVG, theme-aware) ---- */
.figure-wrap { max-width: 880px; margin: 4px auto 0; }
.diagram { width: 100%; height: auto; display: block; }
.diagram text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.dg-box { fill: var(--card); stroke: var(--border); stroke-width: 1.5; }
.dg-hub { fill: var(--accent); stroke: none; }
.dg-title { fill: var(--text); font-size: 15px; font-weight: 600; }
.dg-sub { fill: var(--muted); font-size: 11.5px; }
.dg-hub-title { fill: #fff; font-size: 17px; font-weight: 700; }
.dg-hub-sub { fill: rgba(255,255,255,.9); font-size: 11.5px; }
.dg-line { stroke: var(--border); stroke-width: 2; fill: none; }
.dg-line-accent { stroke: var(--accent); stroke-width: 2; fill: none; }
.dg-caption { fill: var(--muted); font-size: 11px; letter-spacing: .04em; }
.dg-dash { fill: none; stroke: var(--border); stroke-width: 1.5; stroke-dasharray: 6 6; }

/* Stream Deck grid graphic */
.deck-key { fill: var(--bg-alt); stroke: var(--border); stroke-width: 1; }
.deck-key-status { fill: color-mix(in srgb, var(--text) 8%, var(--bg-alt)); stroke: var(--border); stroke-width: 1; }
.deck-key-soft { fill: var(--accent-soft); stroke: var(--border); stroke-width: 1; }
.deck-key-accent { fill: var(--accent); stroke: none; }
.deck-key-perf { fill: color-mix(in srgb, var(--accent) 16%, var(--bg-alt)); stroke: var(--border); stroke-width: 1; }
.deck-glyph { fill: #fff; font-size: 26px; text-anchor: middle; dominant-baseline: central; }

/* Browser mock graphic */
.bw-window { fill: var(--card); stroke: var(--border); stroke-width: 1.5; }
.bw-dot { fill: var(--border); }
.bw-pill { fill: var(--bg); stroke: var(--border); stroke-width: 1; }
.bw-sep { stroke: var(--border); stroke-width: 1; }
.bw-tile { fill: var(--bg-alt); stroke: var(--border); stroke-width: 1; }
.bw-accent { fill: var(--accent); }
.bw-muted { fill: var(--muted); }
.bw-term { fill: #15171c; }
.bw-term-line { fill: #59d38a; }
.bw-term-dim { fill: #8a8f98; }
.bw-key { fill: var(--card); stroke: var(--border); stroke-width: 1; }
.bw-key-on { fill: var(--accent); }
.bw-label { fill: var(--muted); font-size: 11px; }

/* Privacy callout list */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
@media (max-width: 720px) { .pillars { grid-template-columns: 1fr; } }
.pillar { text-align: left; }
.pillar h3 { margin: 0 0 6px; font-size: 1.05rem; }
.pillar p { margin: 0; color: var(--muted); font-size: .97rem; }

/* Steps */
.steps { counter-reset: step; display: grid; gap: 16px; max-width: 640px; margin: 0 auto; }
.step {
  position: relative;
  padding-left: 52px;
  min-height: 36px;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.step h3 { margin: 4px 0 2px; font-size: 1.02rem; }
.step p { margin: 0; color: var(--muted); font-size: .96rem; }

/* ---- Article pages (privacy / support) ---- */
.article { padding: 56px 0 72px; }
.article h1 { font-size: clamp(1.9rem, 4vw, 2.4rem); letter-spacing: -0.02em; margin: 0 0 6px; }
.article h2 { font-size: 1.2rem; margin: 2.2rem 0 .5rem; }
.article ul, .article ol { padding-left: 1.3rem; }
.article li { margin: .3rem 0; }
.article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em;
  background: var(--bg-alt);
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--border);
}
.muted { color: var(--muted); font-size: .92rem; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 40px 0;
  color: var(--muted);
  font-size: .92rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
