/* ============================================================
   RefractTrack brochure — stylesheet
   Design language: warm dark charcoal, amber "Ember" accent
   (matching the in-app theme used for every screenshot on this
   page), a serif display face for personality, a spectrum motif
   reserved for the hero graphic only.
   ============================================================ */

:root {
  /* Color */
  --bg: #15110c;
  --bg-raised: #1c150e;
  --surface: #1e1712;
  --surface-2: #261c14;
  --border: #3a2c1e;
  --border-soft: #2a2018;
  --text: #f2e9da;
  --text-muted: #a99a85;
  --text-faint: #7c6f5e;
  --accent: #e8a14b;
  --accent-strong: #f5b968;
  --accent-ink: #2a1c0c;
  --spectrum-violet: #9084d6;
  --spectrum-cyan: #5fc4bd;
  --spectrum-rose: #d97a90;

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", ui-serif, Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --content-width: 1120px;
  --radius-sm: 3px;
  --radius-md: 6px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

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

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

a { color: inherit; }

.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 28px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

code, .mono {
  font-family: var(--font-mono);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------------- Nav ---------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(21, 17, 12, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

.nav__brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--accent);
  flex: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14.5px;
  transition: color 0.15s ease;
}

.nav__links a:hover { color: var(--text); }

.nav__cta {
  color: var(--accent) !important;
  font-weight: 600;
}

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 44px;
  height: 40px;
  font-size: 16px;
  cursor: pointer;
}

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

.hero {
  padding: 76px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
  letter-spacing: 0.03em;
  margin-bottom: 18px;
}

.hero__eyebrow span { color: var(--accent); }

.hero h1 {
  font-size: 46px;
  max-width: 15ch;
}

.hero__lede {
  margin-top: 22px;
  font-size: 17px;
  color: var(--text-muted);
  max-width: 46ch;
}

.hero__lede strong { color: var(--text); font-weight: 600; }

.hero__actions {
  margin-top: 30px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: var(--accent-strong); transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero__art {
  position: relative;
  aspect-ratio: 1 / 1;
}

.hero__art svg { width: 100%; height: 100%; }

.hero__art .beam-in,
.hero__art .beam-out {
  stroke-dasharray: 190;
  stroke-dashoffset: 190;
}

.hero__art .prism {
  opacity: 0;
  transform: scale(0.92);
  transform-origin: center;
}

.hero__art--ready .prism {
  animation: pop-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s forwards;
}
.hero__art--ready .beam-in {
  animation: draw-beam 0.6s ease-out 0.6s forwards;
}
.hero__art--ready .beam-out {
  animation: draw-beam 0.6s ease-out 1.2s forwards;
}

@keyframes draw-beam {
  to { stroke-dashoffset: 0; }
}
@keyframes pop-in {
  to { opacity: 1; transform: scale(1); }
}

/* Without JS/animation support, show the finished state immediately */
.hero__art:not(.hero__art--ready) .beam-in,
.hero__art:not(.hero__art--ready) .beam-out {
  stroke-dashoffset: 0;
}
.hero__art:not(.hero__art--ready) .prism {
  opacity: 1;
  transform: none;
}

/* ---------------- Stat strip ---------------- */

.stats {
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 26px 0;
  margin-top: 60px;
}

.stats__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 28px;
  column-gap: 22px;
}

.stat {
  padding-left: 22px;
  border-left: 1px solid var(--border-soft);
}
.stat:nth-child(4n+1) { border-left: none; padding-left: 0; }

.stat__value {
  font-family: var(--font-mono);
  font-size: 24px;
  color: var(--accent);
  font-weight: 500;
}

.stat__label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------------- Section framework ---------------- */

.section {
  padding: 96px 0;
  border-top: 1px solid var(--border-soft);
}

.section--tight { padding: 72px 0; }

.section__tag {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  margin-bottom: 14px;
}

.section__head {
  max-width: 62ch;
}

.section__head h2 {
  font-size: 30px;
}

.section__head p {
  margin-top: 14px;
  font-size: 16px;
  color: var(--text-muted);
}

.feature {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 52px;
  align-items: center;
}

.feature--reverse .feature__media { order: 2; }
.feature--reverse .feature__copy { order: 1; }

.feature__copy p {
  color: var(--text-muted);
  font-size: 15.5px;
  margin-top: 14px;
}

.feature__copy code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--accent-strong);
}

.feature__media {
  position: relative;
}

.shot-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.7);
}

.shot-frame img { width: 100%; height: auto; display: block; }

.shot-caption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-faint);
  font-style: italic;
}

/* Stacked media (two screenshots in one feature) */
.feature__media--stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---------------- Grid of two features (e.g. stages + groups) ---------------- */

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 36px;
}

.pair figure { margin: 0; }

/* ---------------- Concurrent-edit diagram ---------------- */

.merge-demo {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: stretch;
}

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

.merge-card__who {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}

.merge-card__who b { color: var(--accent); }

.merge-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 14px;
}
.merge-row:first-of-type { border-top: none; }

.merge-row__label { color: var(--text-faint); }
.merge-row__value { color: var(--text); text-align: right; }
.merge-row__value--changed { color: var(--accent-strong); font-weight: 600; }

.merge-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 22px;
}

.merge-result {
  grid-column: 1 / -1;
  margin-top: 4px;
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 22px;
}

.merge-result__who {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 14px;
}

.merge-note {
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------------- Theme swatch row (branding section) ---------------- */

.theme-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.theme-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

.theme-chip__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.theme-chip--current {
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* ---------------- Summary grid ---------------- */

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 40px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
}

.summary__item {
  background: var(--bg);
  padding: 26px 24px;
}

.summary__item h3 {
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
}

.summary__item p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------------- Closing ---------------- */

.closing {
  text-align: left;
  padding: 90px 0 50px;
}

.closing h2 {
  font-size: 32px;
  max-width: 24ch;
}

.closing__note {
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--text-faint);
  max-width: 60ch;
}

.footer {
  border-top: 1px solid var(--border-soft);
  padding: 28px 0 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-faint);
}

.footer a { color: var(--text-muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* ---------------- Responsive ---------------- */

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { max-width: 340px; margin: 0 auto; }
  .feature, .feature--reverse { grid-template-columns: 1fr; }
  .feature--reverse .feature__media,
  .feature--reverse .feature__copy { order: initial; }
  .pair { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr; }
  .merge-demo { grid-template-columns: 1fr; }
  .merge-arrow { transform: rotate(90deg); padding: 4px 0; }
  .stats__row { grid-template-columns: repeat(2, 1fr); row-gap: 24px; }
  .stat:nth-child(4n+1) { border-left: 1px solid var(--border-soft); padding-left: 22px; }
  .stat:nth-child(2n+1) { border-left: none; padding-left: 0; }
}

@media (max-width: 700px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }
  .nav.nav--open .nav__links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-raised);
    padding: 10px 28px 18px;
    border-bottom: 1px solid var(--border-soft);
    gap: 4px;
  }
  .nav.nav--open .nav__links a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
  }
  .nav.nav--open .nav__links li:last-child a { border-bottom: none; }
  .hero h1 { font-size: 34px; }
  .section { padding: 64px 0; }
}
