/*
 * RedlinerHQ site: what every page shares -- fonts, the Blackline tokens (as in the app,
 * web/src/ui.css), base type, the wordmark, buttons, the top bar and the footer.
 * Dark first; light on request or by the visitor's system setting. The signal red is
 * the brand and "what you are doing now"; a person's markup is never red.
 */
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 400; font-display: swap; src: url(fonts/schibsted-grotesk-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 500; font-display: swap; src: url(fonts/schibsted-grotesk-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 700; font-display: swap; src: url(fonts/schibsted-grotesk-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 800; font-display: swap; src: url(fonts/schibsted-grotesk-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-display: swap; src: url(fonts/jetbrains-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url(fonts/jetbrains-mono-latin-500-normal.woff2) format('woff2'); }

:root {
  color-scheme: dark;
  --font: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --bg: #121316;
  --surface: #1b1c20;
  --surface-2: #202125;
  --raised: #2a2c31;
  --line: #2a2c31;
  --line-strong: #3a3c42;
  --text: #ecebe7;
  --text-2: #9a9ea6;
  --accent: #ff5a45;
  --on-accent: #121316;
  --accent-ink: #ff7a68;
  --deep: #0b0c0e;
  --deep-line: #26282d;
  /* A highlighter, as a reviewer's mark looks in the viewer. */
  --mark: rgba(255, 214, 10, 0.3);
  --mark-edge: #e8c200;
  --ok: #57c7a3;
  --warn-ink: #f0b458;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4f4f1; --surface: #ffffff; --surface-2: #f7f7f4; --raised: #eae9e4;
    --line: #e3e2dd; --line-strong: #c9c8c1; --text: #121316; --text-2: #5e626b;
    --accent-ink: #c2321f; --deep: #121316; --deep-line: #2a2c31;
    --mark: rgba(255, 204, 0, 0.42); --mark-edge: #d4a900; --ok: #1f8a68; --warn-ink: #8c5a00;
    --shadow: 0 30px 70px -34px rgba(18, 19, 22, 0.35);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f1; --surface: #ffffff; --surface-2: #f7f7f4; --raised: #eae9e4;
  --line: #e3e2dd; --line-strong: #c9c8c1; --text: #121316; --text-2: #5e626b;
  --accent-ink: #c2321f; --deep: #121316; --deep-line: #2a2c31;
  --mark: rgba(255, 204, 0, 0.42); --mark-edge: #d4a900; --ok: #1f8a68; --warn-ink: #8c5a00;
  --shadow: 0 30px 70px -34px rgba(18, 19, 22, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 24px; }
@media (max-width: 520px) { .wrap { padding-inline: 16px; } }

.mono { font-family: var(--mono); }
.eyebrow {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0 0 14px;
}
h1, h2, h3 { font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.08; }
h3 { font-size: 20px; line-height: 1.25; letter-spacing: -0.015em; font-weight: 700; }
p { margin: 0; }
.lead { font-size: 18px; color: var(--text-2); max-width: 62ch; }

/* ---------------------------------------------------------------- wordmark */
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; text-decoration: none; }
.wordmark svg { width: 26px; height: 26px; }
.wordmark .hq { font: 500 0.58em/1 var(--mono); color: var(--on-accent); background: var(--accent); border-radius: 4px; padding: 3px 5px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 8px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text);
  font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #ff6e5b; }
.btn-quiet { border-color: transparent; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { color: var(--text-2); text-decoration: none; font-size: 15px; padding: 8px 10px; border-radius: 6px; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.topbar .grow { flex: 1; }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
@media (max-width: 820px) { .nav { display: none; } }
@media (max-width: 440px) { .topbar .btn-primary { display: none; } }

/* ---------------------------------------------------------------- footer */
footer { border-top: 1px solid var(--line); padding-block: 40px 56px; color: var(--text-2); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; }
footer .grow { flex: 1; }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
