/* ─────────────────────────────────────────────────────────────
   Vostego — Refined Marketing System
   Built on tokens.css. Shared chrome + components across all pages.
   ───────────────────────────────────────────────────────────── */

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

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

body {
  margin: 0;
  background: var(--paper-0);
  color: var(--ink-1);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01' 1, 'cv11' 1;
  transition: background 320ms ease, color 320ms ease;
}

::selection { background: var(--clay-soft); color: var(--clay-deep); }
[data-theme="dark"] ::selection { background: var(--clay-soft); color: var(--clay); }

a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }

/* ── Display / editorial type helpers ─────────────────────────── */
.display { font-family: var(--font-display); letter-spacing: -0.025em; font-weight: 500; color: var(--ink-0); }
.serif   { font-family: var(--font-serif); }
.mono    { font-family: var(--font-mono); font-feature-settings: 'tnum' 1; }
.tnum    { font-variant-numeric: tabular-nums; }

/* ── Layout primitives ────────────────────────────────────────── */
.rm-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px);
}
.rm-container--narrow { max-width: 880px; }

.rm-section { padding: clamp(64px, 9vw, 128px) 0; }
.rm-section--tight { padding: clamp(36px, 5vw, 64px) 0; }
.rm-section--paper { background: var(--paper-1); }
.rm-section--ink {
  background:
    radial-gradient(circle at 84% 0%, color-mix(in srgb, var(--clay) 16%, transparent), transparent 42%),
    linear-gradient(160deg, var(--panel-dark) 0%, var(--brand-deep) 150%);
  color: var(--on-ink);
}
.rm-section--ink h1, .rm-section--ink h2, .rm-section--ink h3 { color: var(--on-ink); }

/* Section heads */
.rm-section-head { max-width: 720px; margin: 0 auto clamp(36px, 5vw, 64px); text-align: center; }
.rm-section-head--left { margin-left: 0; text-align: left; }

.rm-eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay-deep);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.rm-eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--clay);
  display: inline-block;
}
.rm-eyebrow--ink { color: var(--brand); }
.rm-section--ink .rm-eyebrow { color: color-mix(in srgb, var(--clay) 70%, white); }
.rm-section--ink .rm-eyebrow::before { background: color-mix(in srgb, var(--clay) 70%, white); }
.rm-eyebrow--center { justify-content: center; }

.rm-display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-6xl);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink-0);
  text-wrap: balance;
}
.rm-h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-4xl);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink-0);
  text-wrap: balance;
}
.rm-h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-xl);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink-0);
}
.rm-lede {
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 60ch;
  text-wrap: pretty;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.rm-btn {
  --btn-bg: var(--ink-0);
  --btn-fg: var(--on-ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-sm);
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}
.rm-btn:hover { transform: translateY(-1px); }
.rm-btn:active { transform: translateY(0); }

.rm-btn--primary { background: var(--brand); color: #fff; }
.rm-btn--primary:hover { background: var(--brand-deep); box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 32%, transparent); }

.rm-btn--clay { background: var(--clay); color: var(--on-accent); }
.rm-btn--clay:hover { background: color-mix(in srgb, var(--clay) 88%, black); box-shadow: 0 8px 22px color-mix(in srgb, var(--clay) 36%, transparent); }

.rm-btn--ink { background: var(--ink-0); color: var(--on-ink); }
.rm-btn--ink:hover { background: var(--ink-1); }

.rm-btn--ghost {
  background: transparent;
  color: var(--ink-0);
  border-color: var(--line-strong);
}
.rm-btn--ghost:hover { background: var(--card); border-color: var(--ink-3); }
.rm-section--ink .rm-btn--ghost { color: #fff; border-color: rgba(255,255,255,0.28); }
.rm-section--ink .rm-btn--ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.5); }

.rm-btn--lg { padding: 15px 28px; font-size: var(--text-base); }
.rm-btn--sm { padding: 8px 15px; font-size: var(--text-xs); }
.rm-btn--block { width: 100%; justify-content: center; }

.rm-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  transition: border-color 160ms ease;
}
.rm-link:hover { border-color: var(--brand); }

.rm-textlink {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-0); text-decoration: none; font-weight: 600; font-size: var(--text-sm);
}
.rm-textlink .arr { transition: transform 200ms ease; }
.rm-textlink:hover .arr { transform: translateX(4px); }

/* ── Pills / tags ─────────────────────────────────────────────── */
.rm-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: var(--radius-full);
  font: 600 11.5px/1 var(--font-sans);
  letter-spacing: 0.01em;
  background: var(--paper-2); color: var(--ink-2);
  width: max-content;
}
.rm-pill .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.rm-pill--brand { background: var(--brand-soft); color: var(--brand-deep); }
.rm-pill--sage  { background: var(--sage-soft); color: #2c5d57; }
.rm-pill--clay  { background: var(--clay-soft); color: var(--clay-deep); }
.rm-tag {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 4px 9px; border-radius: var(--radius-full); font-weight: 600;
  background: var(--brand-soft); color: var(--brand-deep);
}

/* ── Cards & grids ────────────────────────────────────────────── */
.rm-grid { display: grid; gap: clamp(16px, 2vw, 24px); }
.rm-grid--2 { grid-template-columns: repeat(2, 1fr); }
.rm-grid--3 { grid-template-columns: repeat(3, 1fr); }
.rm-grid--4 { grid-template-columns: repeat(4, 1fr); }

.rm-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(22px, 2.4vw, 30px);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  display: flex; flex-direction: column; gap: 10px;
}
a.rm-card { text-decoration: none; color: inherit; }
.rm-card--hover:hover, a.rm-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}
.rm-card p { color: var(--ink-2); font-size: var(--text-sm); line-height: 1.6; }

.rm-step-num {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clay);
  letter-spacing: 0.1em;
}

/* Icon chip (replaces doodles where needed) */
.rm-icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand-deep);
  margin-bottom: 4px;
}
.rm-icon svg { width: 22px; height: 22px; }
.rm-icon--sage { background: var(--sage-soft); color: #2c5d57; }
.rm-icon--clay { background: var(--clay-soft); color: var(--clay-deep); }

/* Prose */
.rm-prose { max-width: 64ch; }
.rm-prose p { margin: 0 0 18px; font-size: var(--text-lg); line-height: 1.66; color: var(--ink-1); }
.rm-prose p:last-child { margin-bottom: 0; }
.rm-prose strong { color: var(--ink-0); font-weight: 600; }
.rm-prose--serif p { font-family: var(--font-serif); }

/* ── Hero (shared) ────────────────────────────────────────────── */
.rm-hero { padding: clamp(72px, 11vw, 150px) 0 clamp(48px, 7vw, 96px); position: relative; overflow: hidden; }
.rm-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: clamp(36px, 5vw, 80px);
  align-items: center;
}
.rm-hero-copy { max-width: 640px; }
.rm-hero-copy .rm-display { margin-top: 22px; }
.rm-hero-copy .rm-lede { margin-top: 22px; }
.rm-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.rm-hero-subtext { margin-top: 16px; font-size: var(--text-sm); color: var(--ink-3); }

/* Hero signal panel */
.rm-hero-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  padding: clamp(22px, 2.4vw, 30px);
  box-shadow: var(--shadow-lg);
}
.rm-hero-panel-label, .rm-panel-label {
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 16px;
}
.rm-signal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rm-signal { display: flex; gap: 14px; align-items: flex-start; }
.rm-signal-icon {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper-1); border: 1px solid var(--line);
}
.rm-signal-icon svg { width: 18px; height: 18px; }
.rm-signal-text { font-size: var(--text-sm); color: var(--ink-1); line-height: 1.45; padding-top: 7px; }
.rm-hero-panel-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }

/* ── Navigation ───────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper-0) 86%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px);
  height: 68px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-0); }
.nav-brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--ink-0); color: var(--paper-0);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
}
.nav-brand .name { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }
.nav-brand .name::after { content: "."; color: var(--clay); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-link { text-decoration: none; color: var(--ink-1); font-weight: 500; font-size: var(--text-sm); transition: color 160ms ease; }
.nav-link:hover { color: var(--ink-0); }
.nav-link.is-active { color: var(--ink-0); }
.nav-link.is-active::after { content: ""; display: block; height: 2px; background: var(--clay); border-radius: 2px; margin-top: 4px; }
.nav-cta { display: flex; align-items: center; gap: 12px; }
@media (max-width: 860px) {
  .nav-links { display: none; }
}

/* ── Doorways (homepage emotional router) ─────────────────────── */
.doorways { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.doorway {
  position: relative;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 26px 24px 22px;
  min-height: 230px;
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.doorway::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--door-accent, var(--brand));
  transform: scaleX(0); transform-origin: left;
  transition: transform 260ms ease;
}
.doorway:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.doorway:hover::after { transform: scaleX(1); }
.doorway-mood {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--door-accent, var(--brand));
}
.doorway-title {
  font-family: var(--font-display); font-weight: 500; font-size: 22px;
  letter-spacing: -0.02em; color: var(--ink-0);
  margin: 14px 0 10px; line-height: 1.1;
}
.doorway-sub { font-size: var(--text-sm); color: var(--ink-2); line-height: 1.5; flex: 1; }
.doorway-go {
  margin-top: 18px; font-weight: 600; font-size: var(--text-sm);
  color: var(--ink-0); display: inline-flex; align-items: center; gap: 6px;
}
.doorway-go .arr { transition: transform 200ms ease; }
.doorway:hover .doorway-go .arr { transform: translateX(4px); }
@media (max-width: 920px) { .doorways { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .doorways { grid-template-columns: 1fr; } }

/* ── In-system UI mockup tiles ────────────────────────────────── */
.mock {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.mock-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 18px; background: var(--paper-1);
  border-bottom: 1px solid var(--line);
}
.mock-bar .dot { width: 10px; height: 10px; border-radius: 999px; background: var(--paper-2); }
.mock-bar .title {
  margin-left: 10px; font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); letter-spacing: 0.04em;
}
.mock-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.mock-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; background: var(--paper-0);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.mock-row .label { font-family: var(--font-serif); font-style: italic; font-size: var(--text-sm); color: var(--ink-1); }
.mock-row .spacer { flex: 1; }
.mock-row .meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }

/* ── Footer ───────────────────────────────────────────────────── */
.footer {
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--clay) 18%, transparent), transparent 30%),
    linear-gradient(150deg, var(--panel-dark) 0%, var(--brand-deep) 160%);
  color: var(--on-ink);
  padding: clamp(56px, 7vw, 96px) 0 36px;
  margin-top: 0;
}
.footer-top {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: clamp(28px, 4vw, 56px);
  padding-bottom: 44px; margin-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand-text { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; color: #fff; }
.footer-brand-text::after { content: "."; color: var(--clay); }
.footer-desc { margin-top: 14px; font-size: var(--text-sm); color: rgba(255,255,255,0.62); line-height: 1.6; max-width: 30ch; }
.footer-col h4 { font-size: var(--text-sm); font-weight: 700; color: #fff; margin: 0 0 16px; letter-spacing: 0.01em; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: rgba(255,255,255,0.62); text-decoration: none; font-size: var(--text-sm); transition: color 160ms ease, transform 160ms ease; display: inline-block; }
.footer-links a:hover { color: #fff; transform: translateX(3px); }
.footer-note { font-family: var(--font-serif); font-style: italic; font-size: var(--text-sm); color: rgba(255,255,255,0.72); line-height: 1.6; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 8px; }
.footer-bottom p { font-size: 12.5px; color: rgba(255,255,255,0.5); }
.footer-bottom a { color: rgba(255,255,255,0.7); }
@media (max-width: 860px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-top { grid-template-columns: 1fr; } }

/* ── Strip band (home founder/enterprise) ─────────────────────── */
.rm-strip {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-2xl); padding: clamp(28px, 4vw, 48px);
  display: grid; grid-template-columns: minmax(0, 1.5fr) auto; gap: clamp(20px, 3vw, 40px); align-items: center;
}
.rm-strip h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-2xl); letter-spacing: -0.02em; color: var(--ink-0); }
.rm-strip p { margin-top: 10px; color: var(--ink-2); font-size: var(--text-base); line-height: 1.55; max-width: 60ch; }
@media (max-width: 760px) { .rm-strip { grid-template-columns: 1fr; } }

/* ── Responsive hero ──────────────────────────────────────────── */
@media (max-width: 920px) {
  .rm-hero-grid { grid-template-columns: 1fr; }
  .rm-grid--3, .rm-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .rm-grid--2, .rm-grid--3, .rm-grid--4 { grid-template-columns: 1fr; }
}

/* ── Preview controls (cross-page, vanilla) ───────────────────── */
.pc {
  position: fixed; right: 18px; bottom: 18px; z-index: 4000;
  font-family: var(--font-sans);
}
.pc-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink-0); color: var(--paper-0);
  border: none; border-radius: var(--radius-full);
  padding: 11px 16px; font-weight: 600; font-size: 13px; cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}
.pc-toggle .gear { width: 15px; height: 15px; }
.pc-panel {
  position: absolute; right: 0; bottom: 54px;
  width: 308px; background: var(--card); color: var(--ink-1);
  border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 16px; display: none;
  max-height: 78vh; overflow-y: auto;
}
.pc.is-open .pc-panel { display: block; }
.pc-group { margin-bottom: 16px; }
.pc-group:last-child { margin-bottom: 0; }
.pc-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 9px;
}
.pc-seg { display: flex; gap: 6px; background: var(--paper-1); border-radius: var(--r-md); padding: 4px; }
.pc-seg button {
  flex: 1; border: none; background: transparent; cursor: pointer;
  font: 600 12px/1 var(--font-sans); color: var(--ink-2);
  padding: 8px 6px; border-radius: var(--r-sm); transition: all 140ms ease;
}
.pc-seg button.on { background: var(--card); color: var(--ink-0); box-shadow: var(--shadow-sm); }
.pc-hint { margin-top: 8px; font-size: 11px; color: var(--ink-3); line-height: 1.4; }

/* Palette swatches */
.pc-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pc-swatch {
  border: 1px solid var(--line); background: var(--paper-1);
  border-radius: var(--r-md); padding: 7px; cursor: pointer;
  display: flex; flex-direction: column; gap: 7px; align-items: stretch;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.pc-swatch:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.pc-swatch.on { border-color: var(--ink-0); box-shadow: 0 0 0 1.5px var(--ink-0); }
.pc-sw-chips { display: flex; height: 24px; border-radius: 5px; overflow: hidden; border: 1px solid var(--line); }
.pc-sw-chips i { flex: 1; }
.pc-sw-name { font: 600 11px/1 var(--font-sans); color: var(--ink-1); text-align: center; }

/* Type picker */
.pc-types { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pc-type {
  border: 1px solid var(--line); background: var(--paper-1);
  border-radius: var(--r-md); padding: 10px 11px; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.pc-type:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.pc-type.on { border-color: var(--ink-0); box-shadow: 0 0 0 1.5px var(--ink-0); }
.pc-type-aa { font-size: 19px; line-height: 1; color: var(--ink-0); }
.pc-type-name { font: 600 11px/1 var(--font-sans); color: var(--ink-2); }

@media print { .pc { display: none !important; } }

/* Reveal-on-scroll safety: never hide content for reduced-motion users */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
}
