/*
 * The palette is lifted from the app (frontend/src/styles.css) so the site and the thing
 * it sells are recognisably the same object. Same rule as over there: colour lives in
 * these two blocks and nowhere else.
 */
:root {
  --bg: #0d0e11;
  --panel: #131519;
  --panel-2: #191c21;
  --line: #262a31;
  --line-soft: #1e2228;
  --line-hover: #3a3f48;
  --text: #e9e7e4;
  --muted: #9195a0;
  --dim: #6b6f79;

  --accent: #d97757;
  --accent-soft: rgba(217, 119, 87, 0.14);
  --accent-hover: #e08765;
  --accent-fg: #1a0f0a;

  --marker: #f2d75c;
  --marker-fg: #1f1904;

  --shadow: rgba(0, 0, 0, 0.45);

  color-scheme: dark;
}

/* Paper rather than white, and the accent darkens — #d97757 on paper is too pale to carry
 * text or a border. Both values match the app's light theme exactly. */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f4ef;
    --panel: #efeae1;
    --panel-2: #e5dfd4;
    --line: #ddd5c8;
    --line-soft: #e8e2d8;
    --line-hover: #c6bbaa;
    --text: #26221e;
    --muted: #6f6a62;
    --dim: #918a80;

    --accent: #b9522f;
    --accent-soft: rgba(185, 82, 47, 0.12);
    --accent-hover: #a5471f;
    --accent-fg: #fdf9f3;

    --shadow: rgba(56, 44, 30, 0.14);

    color-scheme: light;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: min(100% - 2.5rem, 62rem);
  margin-inline: auto;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.9rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 550;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--line-hover);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

:where(a, .btn):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(2.5rem, 6vw, 4rem);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.022em;
  font-weight: 620;
  max-width: 18ch;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero .lede {
  margin: 1.35rem 0 0;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--muted);
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 2rem;
}

/* ---------- the tree figure ---------- */

.tree-figure {
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 18px 44px -28px var(--shadow);
  overflow: hidden;
}

.tree-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel-2);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dim);
}

.tree-body {
  padding: 1.1rem 0.5rem 1.35rem;
  overflow-x: auto;
}

.tree {
  list-style: none;
  margin: 0;
  padding-left: 1rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.83rem;
  line-height: 2.05;
  white-space: nowrap;
  min-width: max-content;
}

.tree ul {
  list-style: none;
  margin: 0;
  padding-left: 1.15rem;
  border-left: 1px solid var(--line);
}

.tree li {
  padding-left: 0.55rem;
  color: var(--muted);
}

.tree .dir {
  color: var(--text);
}

.tree .new {
  color: var(--accent);
}

.tree .new::after {
  content: "written just now";
  margin-left: 0.9rem;
  padding: 0.08rem 0.45rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 0.08em;
}

.tree .stub {
  color: var(--dim);
}

.tree .stub::after {
  content: " — not written yet";
  color: var(--dim);
  font-size: 0.75rem;
}

.figure-note {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  color: var(--dim);
  text-align: center;
}

/* ---------- sections ---------- */

section {
  padding-block: clamp(3rem, 7vw, 4.75rem);
  border-top: 1px solid var(--line-soft);
}

.section-label {
  margin: 0 0 0.85rem;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
}

h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 600;
  max-width: 24ch;
}

.section-lede {
  margin: 0 0 2.25rem;
  color: var(--muted);
  max-width: 56ch;
}

/* ---------- the three complaints ---------- */

.gripes {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.gripe {
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.gripe p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.gripe p strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--text);
  font-weight: 580;
}

/* ---------- how it works ---------- */

.steps {
  display: grid;
  gap: 2.5rem;
}

.step {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0 1.1rem;
  align-items: start;
}

.step-n {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.step h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.step p {
  margin: 0;
  color: var(--muted);
  max-width: 58ch;
}

.step > :is(h3, p) {
  grid-column: 2;
}

/* ---------- the two extras ---------- */

.extras {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.extra {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.extra h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.extra p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.mark {
  background: var(--marker);
  color: var(--marker-fg);
  padding: 0.02em 0.22em;
  border-radius: 2px;
}

/* ---------- closing ---------- */

.closing {
  text-align: center;
}

.closing h2 {
  max-width: none;
  margin-inline: auto;
}

.closing .section-lede {
  margin-inline: auto;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding-block: 2rem 2.5rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--dim);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}
