/*
 * Shared styling for herdrchat.cobanov.dev.
 *
 * Structure is herdr.dev's — the monospace wordmark at -0.04em, hairline
 * rules, near-square corners, the 1160px measure, the Inter / JetBrains Mono
 * stack — because HerdrChat is a client for herdr and should read as family.
 *
 * The ground is not. This is dark, and the palette comes from the app's own
 * dark theme (src/theme/tokens.ts) rather than being invented here: the accent
 * is `tint` on dark, a periwinkle brightened to hold up against a dark ground,
 * and the greys are the same label opacities the app uses. The logo sits on a
 * dark square, so on this ground it belongs instead of floating on a card.
 *
 * Dark only. `color-scheme: dark` is declared so form controls, scrollbars and
 * the browser's own chrome follow, rather than a light widget appearing in the
 * middle of a dark page.
 */

:root {
  color-scheme: dark;

  --bg: #0e0e14;
  --bg-elevated: #16161d;
  --panel: #17171f;

  /* Not pure white: at body size on a dark ground it glares. */
  --ink: #f2f2f7;
  --ink-soft: rgba(235, 235, 245, 0.78);
  --muted: rgba(235, 235, 245, 0.55);
  --muted-2: rgba(235, 235, 245, 0.38);
  --line: rgba(235, 235, 245, 0.12);
  --line-strong: rgba(235, 235, 245, 0.22);

  /* The app's dark-mode tint. Plain #6E74E6 is the light-mode value and goes
     muddy here; this is the same hue lifted to carry on a dark ground. */
  --accent: #8288f0;
  --accent-ink: #ffffff;

  --term-text: #d4d6dd;
  --term-dim: rgba(235, 235, 245, 0.42);

  --radius-lg: 6px;
  --radius-md: 4px;
  --radius-sm: 2px;

  --max: 1160px;
  --measure: 46rem;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/*
 * A page that is entirely prose centres its own column. At the full 1160px the
 * text sat against the left edge with a third of the page empty beside it.
 *
 * Only the ARTICLE narrows — not `--max`, which the header and footer also read.
 * Narrowing the variable moved the masthead too, so the logo sat further in on
 * this page than on the home page and jumped as you moved between them. Chrome
 * that shifts when the content changes reads as a rendering fault, not layout.
 *
 * 49rem = the 46rem measure plus the 1.5rem gutters, so the text fills the
 * column exactly rather than stopping short inside it.
 */
.wrap.prose { max-width: 49rem; }

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

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

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-weight: 700;
  /* Tight, so the wordmark reads as one object rather than as letters. */
  letter-spacing: -0.04em;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
}

.brand img {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-md);
  display: block;
}

.nav-spacer { flex: 1; }

.nav-links {
  display: flex;
  gap: 1.15rem;
  font-size: 0.9rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
}

.nav-links a:hover { color: var(--ink); }

/* A hairline rather than a "|" glyph: a pipe inherits the link colour and font
   metrics and reads as a sixth item you cannot click. This is the same weight
   as every other rule on the page and sits at text height. */
.nav-rule {
  width: 1px;
  align-self: stretch;
  margin: 0.35rem -0.25rem;
  background: var(--line-strong);
}

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

.hero {
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--line);
}

.hero-mark {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  display: block;
  margin-bottom: 1.75rem;
}

.display {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  margin: 0;
  color: var(--ink);
}

.lede {
  max-width: 560px;
  margin: 1.25rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.6;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: var(--bg-elevated);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.btn:hover { border-color: var(--muted-2); }

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

.btn-primary:hover { opacity: 0.9; }

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

section { padding: 3.25rem 0; }

section + section { border-top: 1px solid var(--line); }

h2 {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.035em;
  font-size: 1.35rem;
  margin: 0 0 1.25rem;
}

h3 {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1rem;
  margin: 0 0 0.4rem;
  color: var(--ink);
}

p { margin: 0 0 1rem; max-width: var(--measure); color: var(--ink-soft); }

a { color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem 2rem;
}

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

ul { padding-left: 1.15rem; max-width: var(--measure); color: var(--ink-soft); }
li { margin: 0.4rem 0; }
strong { color: var(--ink); }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.35em;
  color: var(--ink);
}

/* ---------- transcript panel ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--term-text);
  overflow-x: auto;
  max-width: var(--measure);
}

.panel .dim { color: var(--term-dim); }
.panel .you { color: var(--accent); }

/* Speaker in its own track, so a wrapped line hangs under the text and not
   under the name — the thing that makes a transcript readable at a glance. */
.transcript .meta { margin: 0 0 1rem; color: var(--term-dim); }

.transcript .turn {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0 0.75rem;
  margin-bottom: 1rem;
}

.transcript .turn:last-child { margin-bottom: 0; }
.transcript .turn span:last-child { color: var(--term-text); }
.transcript .turn .dim { color: var(--term-dim); }
.transcript .who { white-space: nowrap; }

@media (max-width: 520px) {
  /* Below this the two columns leave too little for the text, so the speaker
     becomes a line of its own rather than squeezing the turn into a gutter. */
  .transcript .turn { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ---------- prose (privacy) ---------- */

.prose { padding: 3.25rem 0 5rem; }
.prose h1 {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 0.35rem;
  color: var(--ink);
}
.prose .stamp { color: var(--muted); font-size: 0.9rem; margin: 0 0 2.5rem; }
.prose h2 { margin-top: 2.5rem; }

.callout {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.15rem;
  margin: 0 0 1.5rem;
  max-width: var(--measure);
}

.callout p:last-child { margin-bottom: 0; }

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.foot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 620px) {
  .nav-links { display: none; }
  .hero { padding: 3rem 0 2.5rem; }
}
