/* ---------------------------------------------------------------------------
 * rednelllabs.com — public site styles.
 *
 * Brand (docs/foundation.md): black, white and red #D33E36. Neutrals are pure
 * greys. Components use semantic tokens only; hex values live in the two theme
 * blocks below. The theme follows the device (prefers-color-scheme).
 *
 * Breakpoints (rednelllabs-layout-foundations): narrow ≤ 640px, stacked ≤ 960px.
 * No third-party requests: system fonts only (the CSP allows 'self' alone).
 * ------------------------------------------------------------------------- */

:root {
  --brand-300: #f29b95;
  --brand-400: #e8665e;
  --brand-500: #d33e36;
  --brand-600: #b8322b;
  --logo-red: #e63b2e;

  /* Dark theme (default). */
  --bg-canvas: #0a0a0a;
  --bg-secondary: #111111;
  --surface: #161616;
  --border: #2a2a2a;
  --border-soft: #1f1f1f;
  --text: #f5f5f3;
  --text-muted: #a8a8a8;
  --text-dim: #8a8a8a;
  --accent: var(--brand-500);
  --accent-hover: var(--brand-600);
  --accent-text: var(--brand-400);
  --on-accent: #ffffff;
  --glow: rgba(211, 62, 54, 0.16);
  --shadow-color: rgba(0, 0, 0, 0.7);

  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 8px;
  --radius-pill: 999px;
  --page-gutter: max(clamp(16px, 4vw, 32px), env(safe-area-inset-left), env(safe-area-inset-right));
  --wrap: 1120px;

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-canvas: #fafaf9;
    --bg-secondary: #f1f1ef;
    --surface: #ffffff;
    --border: #dcdcd8;
    --border-soft: #e8e8e5;
    --text: #111111;
    --text-muted: #4a4a4a;
    --text-dim: #666666;
    --accent-text: var(--brand-600);
    --glow: rgba(211, 62, 54, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.18);
    color-scheme: light;
  }
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg-canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: calc(8px + env(safe-area-inset-top));
  z-index: 20;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: var(--page-gutter);
}

.wrap {
  width: min(var(--wrap), 100%);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out;
}

.button--ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
}

.button--small {
  min-height: 44px;
  padding: 0 18px;
  font-size: 15px;
}

@media (hover: hover) {
  .button:hover {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
  }

  .button--ghost:hover {
    border-color: var(--text-dim);
    background: var(--bg-secondary);
  }

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

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg-canvas) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
}

.brand__mark {
  width: 26px;
  height: 28px;
}

.brand__mark rect {
  fill: var(--text);
}

.brand__mark circle {
  fill: var(--logo-red);
}

.brand__word {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand__word span {
  font-weight: 400;
}

.topnav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.topnav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text-muted);
  font-size: 15px;
  text-decoration: none;
  transition: color 160ms ease-out;
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(56px, 10vw, 120px) 0 clamp(56px, 9vw, 104px);
  background: radial-gradient(ellipse 70% 60% at 50% -10%, var(--glow), transparent 70%);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: 48px;
}

.hero h1 {
  max-width: 16ch;
  font-size: clamp(36px, 5.6vw, 64px);
  font-weight: 800;
}

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

.lead {
  max-width: 54ch;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: clamp(18px, 2vw, 20px);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* The session card: a cybercafé-style meter, illustrative only. */

.session {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 60px -32px var(--shadow-color);
  font-family: var(--font-mono);
}

.session__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.session__live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-text);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.session__live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--logo-red);
}

@media (prefers-reduced-motion: no-preference) {
  .session__live i {
    animation: pulse 1.6s ease-in-out infinite;
  }
}

@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

.session__app {
  color: var(--text-muted);
}

.session__clock {
  margin: 20px 0;
  font-size: clamp(44px, 6vw, 60px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.session__lines {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 16px 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  list-style: none;
  font-size: 14px;
}

.session__lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
}

.session__lines b {
  color: var(--text);
  font-weight: 600;
}

.session__foot {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 13px;
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(56px, 9vw, 104px) 0;
  border-top: 1px solid var(--border-soft);
}

.section--alt {
  background: var(--bg-secondary);
}

.section__head {
  max-width: 680px;
  margin-bottom: 40px;
}

.section__head h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 750;
}

.section__lead {
  max-width: 64ch;
  margin-top: 16px;
  color: var(--text-muted);
}

.steps,
.principles,
.apps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card h3 {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 700;
}

.card p {
  color: var(--text-muted);
  font-size: 16px;
}

.card__step {
  display: block;
  margin-bottom: 16px;
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Price equation ---------- */

.equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-family: var(--font-mono);
}

.equation__term {
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
}

.equation__term--result {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.equation__op {
  color: var(--accent-text);
  font-size: 22px;
  font-weight: 600;
}

/* ---------- Apps ---------- */

.app {
  display: grid;
  align-content: start;
  gap: 4px;
}

.badge {
  justify-self: start;
  margin-bottom: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge__version {
  text-transform: none;
}

.app__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.app__note {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 14px;
}


/* ---------- Open lab ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 32px 48px;
}

.split .section__head {
  margin-bottom: 0;
}

.split__body {
  display: grid;
  gap: 24px;
  color: var(--text-muted);
  font-size: 18px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 8px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
}

/* ---------- Closing call to action ---------- */

.cta {
  padding: clamp(56px, 9vw, 96px) 0;
  border-top: 1px solid var(--border-soft);
  background: radial-gradient(ellipse 60% 80% at 50% 120%, var(--glow), transparent 70%);
  text-align: center;
}

.cta__inner {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.cta h2 {
  max-width: 22ch;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 750;
}

.cta p {
  margin-bottom: 8px;
  color: var(--text-muted);
}

/* ---------- Footer ---------- */

.footer {
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-size: 15px;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}

.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-muted);
  transition: color 160ms ease-out;
}

/* ---------- Not found page ---------- */

.notfound {
  display: grid;
  align-content: center;
  min-height: 70dvh;
  padding: 64px 0;
}

.notfound h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
}

.notfound p {
  margin: 16px 0 28px;
  color: var(--text-muted);
}

/* ---------- Stacked: ≤ 960px ---------- */

@media (max-width: 960px) {
  .hero__grid,
  .steps,
  .principles,
  .apps,
  .split {
    grid-template-columns: 1fr;
  }

  .session {
    max-width: 440px;
  }

  .topnav {
    display: none;
  }

  .topbar__inner > .button {
    margin-left: auto;
  }
}

/* ---------- Narrow: ≤ 640px ---------- */

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .topbar__inner {
    gap: 12px;
    min-height: 60px;
  }

  .brand__word {
    font-size: 19px;
  }

  .button--small {
    padding: 0 14px;
    font-size: 14px;
  }

  .actions .button {
    flex: 1 1 100%;
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 380px) {
  .brand__word {
    display: none;
  }
}
