/* =========================================================
   Pulse — editorial / premium-tech theme
   Palette: deep teal + coral on cool bone. No warm beige.
   Type: system sans (San Francisco / Segoe UI / Roboto).
   ========================================================= */

:root {
  /* Surface */
  --bg: #F2F4F3;            /* cool bone — NOT warm cream */
  --surface: #FFFFFF;       /* card surface */
  --surface-alt: #ECEFEC;   /* secondary panels, also off-white */
  --border: #D8DDD8;
  --border-strong: #B8C2BD;

  /* Type */
  --ink: #0A1717;           /* near-black with teal cast */
  --ink-mid: #2D4141;       /* secondary headings */
  --mid: #5C6E6E;           /* body color */
  --faint: #A8B5B0;         /* meta, timestamps, eyebrow */
  --disabled: #C9D1CD;

  /* Primary — deep teal, Caribbean ocean */
  --brand-deep: #0F3D3E;
  --brand: #1A5E5F;
  --brand-hover: #2D7E80;
  --brand-soft: #DAE6E5;    /* tinted bg for accent panels */

  /* Single-purpose accent — coral, one per viewport max */
  --coral: #FF6F61;
  --coral-soft: #FBE4E0;

  /* States */
  --focus: #1A5E5F;
  --selected: #DAE6E5;

  /* Type stack — system sans for body, JetBrains-mono-class for mono */
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter Tight", "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

/* ── Reset light ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" 1, "cv11" 1;
}

body { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

img { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

h1, h2, h3, h4, h5, h6, p { margin: 0; }

/* ── Layout primitives ─────────────────────────────── */
.shell {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.row { display: flex; }
.col { display: flex; flex-direction: column; }

::selection { background: var(--coral); color: #fff; }

/* ── Nav ────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(242, 244, 243, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand img { height: 22px; width: auto; }

.brand-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft);
  padding: 3px 8px;
  border-radius: 999px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: var(--mid);
}

.nav-links a {
  position: relative;
  padding: 4px 0;
  transition: color 0.15s;
}

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

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 2px;
  background: var(--coral);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}

.nav-cta:hover { background: var(--ink-mid); }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .container { padding: 0 20px; }
}

/* ── Hero — editorial, asymmetric ─────────────────── */
.hero {
  padding: 96px 0 96px;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--brand);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 64px;
  align-items: start;
}

@media (max-width: 900px) {
  .hero { padding: 64px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.hero-title {
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 28px;
}

.hero-title em {
  font-style: italic;
  font-weight: 500;
  color: var(--brand);
  /* italic descender clearance — pb-1 reserve */
  padding-bottom: 0.08em;
}

.hero-sub {
  font-size: 18px;
  line-height: 1.55;
  color: var(--mid);
  max-width: 60ch;
  margin-bottom: 40px;
}

/* Ask form */
.ask {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 6px;
  max-width: 620px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ask:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 94, 95, 0.12);
}

.ask-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--ink);
  outline: 0;
  font-family: inherit;
}

.ask-input::placeholder { color: var(--faint); }

.ask-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.15s;
}

.ask-button:hover { background: var(--ink-mid); }

.ask-button .arrow {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.ask-button:hover .arrow { transform: translateX(2px); }

/* hero side prop — pulls a real answer card out, no fake phone frame */
.hero-prop {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(10, 23, 23, 0.06);
}

.prop-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.prop-meta .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
  margin-right: 6px;
  vertical-align: middle;
}

.prop-q {
  font-size: 15px;
  color: var(--mid);
  line-height: 1.5;
  position: relative;
  padding-left: 14px;
  border-left: 2px solid var(--coral);
}

.prop-a {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}

.prop-a strong { color: var(--ink); font-weight: 600; }

.prop-sources {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.prop-source {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

/* hero micro footer */
.hero-meta {
  margin-top: 64px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.hero-meta a { color: var(--brand); }
.hero-meta a:hover { color: var(--ink); }

/* ── Section helpers ──────────────────────────────── */
.section {
  padding: 120px 0;
  border-bottom: 1px solid var(--border);
}

.section:last-child { border-bottom: 0; }

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 24px;
}

.section-title em {
  font-style: italic;
  color: var(--ink-mid);
  padding-bottom: 0.06em;
}

.section-sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--mid);
  max-width: 64ch;
  margin-bottom: 56px;
}

@media (max-width: 900px) {
  .section { padding: 64px 0; }
}

/* ── Demos — three identical-shaped example cards ─────── */
.demo-block { padding: 24px 0; }

.demo-block + .demo-block { margin-top: 48px; }

.demo-wide {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: start;
  padding: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
}

.demo-wide .demo-eyebrow { color: var(--coral); }

.demo-wide .demo-q {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--ink);
  margin: 12px 0 20px;
}
.demo-wide .demo-q em { font-style: italic; color: var(--brand); padding-bottom: 0.04em; }

.demo-wide .demo-a {
  font-size: 16px;
  line-height: 1.65;
  color: var(--mid);
  margin-bottom: 8px;
}
.demo-wide .demo-a strong { color: var(--ink); font-weight: 600; }

/* "The question" small blockquote */
.demo-quote-line {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-mid);
  padding-left: 14px;
  border-left: 2px solid var(--brand-soft);
  margin: 0 0 20px;
}
.demo-quote-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 4px;
}

/* "What this shows" tinted callout */
.demo-callout {
  margin: 20px 0 0;
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--mid);
}
.demo-callout strong { color: var(--ink); font-weight: 600; }

.demo-wide-shot { border-radius: 14px; border: 1px solid var(--border); overflow: hidden; align-self: start; position: sticky; top: 24px; }

.demo-wide-shot img {
  width: 100%;
  display: block;
  /* tight portrait crop — drops the wide white margins baked into the
     original iOS shell screenshots */
  aspect-ratio: 380 / 639;
  object-fit: cover;
  object-position: center;
}

/* ── demo shared pieces ───────────────────────────── */
.demo-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.demo-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--mid);
  background: var(--bg);
}

.demo-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  padding: 12px 20px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.demo-cta:hover { background: var(--ink); color: #fff; }

.demo-cta .arrow {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.demo-cta:hover .arrow { transform: translateX(2px); }

/* source list */
.source-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.source-list li::before { content: "/  "; color: var(--faint); }

/* responsive demo cards */
@media (max-width: 900px) {
  .demo-wide {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 24px;
  }
  .demo-callout { margin-top: 16px; }
}

/* ── Engine architecture page ──────────────────────── */
.engine {
  display: grid;
  gap: 24px;
}

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

.engine-card-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}

.engine-card-h {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 14px;
}

.engine-card-p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--mid);
}

.engine-card code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-mid);
}

/* KG visualisation image */
.kg-figure {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
  align-items: center;
  margin-top: 24px;
}

@media (max-width: 900px) { .kg-figure { grid-template-columns: 1fr; } }

.kg-figure-img {
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: #0A1717;
  padding: 16px;
}

.kg-figure-img img {
  width: 100%;
  display: block;
  border-radius: 6px;
}

.kg-figure-text .num {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.kg-figure-text .num strong { color: var(--coral); font-weight: 600; }

.kg-figure-text p {
  font-size: 14px;
  color: var(--mid);
  line-height: 1.55;
  margin-top: 12px;
}

.kg-figure-text .stat {
  display: flex;
  gap: 32px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

/* ── Footer ────────────────────────────────────────── */
.footer {
  padding: 56px 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}

.footer-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.footer-mark img { height: 18px; }

.footer-text {
  font-size: 13px;
  color: var(--mid);
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: right;
}

@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-meta { text-align: left; }
}

/* ── Visually-hidden helper ────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
