/* Termit — one-page site.
   Brand orange (#C76C25) is an accent only; the page itself is a quiet,
   developer-style dark/light palette that follows the system setting unless
   the visitor picks one (html[data-theme]). */

:root {
  --brand: #c76c25;

  /* Light (default tokens) */
  --bg: #f6f7f9;
  --bg-alt: #eceef2;
  --surface: #ffffff;
  --border: #d9dde3;
  --text: #1c2128;
  --muted: #57606a;
  --accent-text: #a3531b;      /* brand, darkened to 5.1:1 on --bg */
  --btn-bg: #a3531b;
  --btn-fg: #ffffff;
  --focus: #a3531b;

  /* The terminal mock stays dark in both themes, as terminals usually do. */
  --term-bg: #0c0c0c;
  --term-bar: #16181b;
  --term-fg: #cccccc;
  --term-dim: #767676;
  --term-green: #16c60c;
  --term-blue: #3b78ff;
  --term-yellow: #f9f1a5;
  --term-border: #2e3336;

  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --wrap: 1120px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117;
    --bg-alt: #11161d;
    --surface: #161b22;
    --border: #2a313b;
    --text: #e6edf3;
    --muted: #8d96a0;
    --accent-text: #e08a4a;    /* brand, lightened to 7:1 on --bg */
    --btn-bg: #c76c25;
    --btn-fg: #0d1117;
    --focus: #e08a4a;
    --term-bar: #11151a;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d1117;
  --bg-alt: #11161d;
  --surface: #161b22;
  --border: #2a313b;
  --text: #e6edf3;
  --muted: #8d96a0;
  --accent-text: #e08a4a;
  --btn-bg: #c76c25;
  --btn-fg: #0d1117;
  --focus: #e08a4a;
  --term-bar: #11151a;
  color-scheme: dark;
}

/* ── Base ───────────────────────────────────────────────────────────────── */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

code, .mono { font-family: var(--mono); font-size: 0.92em; }
p code, li code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.05em 0.35em;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 10;
  background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 6px;
}
.skip:focus { top: 12px; }

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; line-height: 0; }
.brand img { height: 36px; width: auto; border-radius: 6px; }
.nav { display: flex; gap: 20px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--text); }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; font: 500 0.85rem var(--sans); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-icon { width: 16px; height: 16px; display: inline-block; background: currentColor; }
.theme-toggle[data-mode="system"] .theme-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5h16v11H4zM2 19h20v2H2z' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5h16v11H4zM2 19h20v2H2z' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
}
.theme-toggle[data-mode="light"] .theme-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4.5'/%3E%3Cpath d='M12 1v3M12 20v3M1 12h3M20 12h3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4.5'/%3E%3Cpath d='M12 1v3M12 20v3M1 12h3M20 12h3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat;
}
.theme-toggle[data-mode="dark"] .theme-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 14.5A8.5 8.5 0 0 1 9.5 4a8.5 8.5 0 1 0 10.5 10.5z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 14.5A8.5 8.5 0 0 1 9.5 4a8.5 8.5 0 1 0 10.5 10.5z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */

.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(48px, 7vw, 88px); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px;
  font: 500 0.8rem var(--mono); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }

h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 20px; }
.accent-text { color: var(--accent-text); }
.lede { font-size: 1.12rem; color: var(--muted); margin: 0 0 28px; max-width: 34em; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: 8px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; transition: transform 0.12s ease, border-color 0.12s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-ghost { color: var(--text); border-color: var(--border); background: var(--surface); }
.btn-ghost:hover { border-color: var(--muted); }

.install { margin: 28px 0 0; color: var(--muted); }
.install code { font-size: 0.9rem; }
.prompt { color: var(--accent-text); user-select: none; }

/* ── Terminal mock ──────────────────────────────────────────────────────── */

.terminal {
  margin: 0; background: var(--term-bg); color: var(--term-fg);
  border: 1px solid var(--term-border); border-radius: 12px; overflow: hidden;
  box-shadow: 0 24px 60px -24px rgb(0 0 0 / 0.45);
  font: 13px/1.55 var(--mono);
}
.term-bar { display: flex; align-items: stretch; height: 36px; background: var(--term-bar); border-bottom: 1px solid var(--term-border); }
.term-title { display: flex; align-items: center; padding: 0 14px; font-weight: 700; color: #e6edf3; }
.term-title::before { content: ""; width: 18px; height: 18px; background: var(--brand); -webkit-mask: url("assets/glyph.png") center / contain no-repeat; mask: url("assets/glyph.png") center / contain no-repeat; }
.term-tab { display: flex; align-items: center; gap: 8px; padding: 0 16px; color: var(--term-dim); border-right: 1px solid var(--term-border); font-family: var(--sans); font-size: 12.5px; }
.term-tab.active { background: var(--term-bg); color: var(--term-fg); box-shadow: inset 0 -2px 0 var(--brand); }
.term-tab.add { border-right: 0; font-size: 16px; }
.st { width: 7px; height: 7px; border-radius: 50%; background: var(--term-dim); display: inline-block; }
.st.ok { background: #22c55e; }

.term-body { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 300px; }
.pane { padding: 12px 14px; }
.pane p { margin: 0; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.pane.focused { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 70%, transparent); }
.pane-stack { display: grid; grid-template-rows: 1fr 1fr; border-left: 1px solid var(--term-border); }
.pane-stack .pane + .pane { border-top: 1px solid var(--term-border); }
.c-ok { color: var(--term-green); }
.c-user { color: var(--term-green); font-weight: 700; }
.c-path { color: var(--term-blue); font-weight: 700; }
.c-dim { color: var(--term-dim); }
.c-warn { color: var(--term-yellow); }
.cursor { display: inline-block; width: 0.1em; height: 1.1em; vertical-align: text-bottom; background: var(--term-fg); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ── Sections ───────────────────────────────────────────────────────────── */

.section { padding: clamp(56px, 8vw, 96px) 0; border-top: 1px solid var(--border); }
.section.alt { background: var(--bg-alt); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -0.01em; margin: 0 0 8px; }
.hash { color: var(--accent-text); font-family: var(--mono); font-weight: 500; }
.section-lede { color: var(--muted); margin: 0 0 32px; max-width: 40em; }

.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.features li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.features h3 { margin: 0 0 6px; font-size: 1.05rem; }
.features h3::before { content: "› "; color: var(--accent-text); font-family: var(--mono); }
.features p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.platforms { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.platforms li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.platforms span { color: var(--muted); font-size: 0.88rem; }
.note { margin: 24px 0 0; color: var(--muted); font-size: 0.92rem; }

.security-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(24px, 5vw, 64px); }
.facts { margin: 0; display: grid; gap: 20px; }
.facts div { border-left: 2px solid var(--brand); padding-left: 18px; }
.facts dt { font-weight: 600; margin-bottom: 4px; }
.facts dd { margin: 0; color: var(--muted); }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 0.9rem; }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

/* ── Small screens ──────────────────────────────────────────────────────── */

@media (max-width: 880px) {
  .hero-grid, .security-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .theme-toggle { margin-left: auto; }
  .term-body { grid-template-columns: 1fr; }
  .pane-stack { border-left: 0; border-top: 1px solid var(--term-border); }
  .term-tab:not(.active):not(.add) { display: none; }
}

/* ── Pricing ────────────────────────────────────────────────────────────── */

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 26px; }
.plan header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.plan h3 { margin: 0; font-size: 1.15rem; }
.plan p { margin: 0 0 12px; color: var(--muted); }
.plan .price { margin: 0; font: 700 1.25rem var(--mono); color: var(--text); }
.plan ul { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: 0.95rem; }
.plan li + li { margin-top: 4px; }
.plan li::marker { content: "› "; color: var(--accent-text); font-family: var(--mono); }
.plan-soon { border-style: dashed; }
.plan .muted { font-size: 0.9rem; margin: 0; }
.badge {
  display: inline-block; font: 500 0.78rem var(--mono); color: var(--accent-text);
  border: 1px solid currentColor; border-radius: 999px; padding: 2px 10px;
}
