/* Riftway site. Neutral greys plus the app's blue (#0a64e8 light, #4b93ff dark), 8px panes, 4px gaps. */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e3e3e8;
  --accent: #0a64e8;
  --accent-hover: #0853c4;
  --accent-soft: rgba(10, 100, 232, 0.1);
  /* Accent text on an --accent-soft tint, nudged toward --text so small labels clear 4.5:1 in both themes. */
  --accent-on-soft: color-mix(in srgb, var(--accent) 80%, var(--text));
  --on-accent: #ffffff;
  --win: #e9e9ec;
  --win-bar: #dedee2;
  --pane: #ffffff;
  --skel: #e6e6ea;
  --skel-strong: #d2d2d8;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.1);
  --warn-bg: #fff6d6;
  --warn-text: #5c4500;
  --radius: 14px;
  --wrap: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e10;
    --bg-soft: #161618;
    --card: #19191c;
    --text: #f2f2f4;
    --muted: #98989f;
    --line: #2c2c30;
    --accent: #4b93ff;
    --accent-hover: #6fa8ff;
    --accent-soft: rgba(75, 147, 255, 0.16);
    --on-accent: #0b1a33;
    --win: #111113;
    --win-bar: #1b1b1e;
    --pane: #1f1f23;
    --skel: #2b2b30;
    --skel-strong: #3a3a40;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 48px rgba(0, 0, 0, 0.5);
    --warn-bg: #3a2f0b;
    --warn-text: #f3dc95;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Anchor jumps land below the sticky header. */
  scroll-padding-top: 76px;
  accent-color: var(--accent);
}

::selection {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

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

h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

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

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lede {
  max-width: 640px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.center {
  text-align: center;
}

.center .lede {
  margin-left: auto;
  margin-right: auto;
}

/* Draft banner (config.showDraftBanner) */
.draft-banner {
  padding: 8px 24px;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 0.85rem;
  text-align: center;
}

.draft-banner[hidden] {
  display: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--card);
}

[hidden] {
  display: none !important;
}

.nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  align-items: center;
}

.nav a {
  color: var(--text);
  font-size: 0.95rem;
}

.nav a[aria-current='page']:not(.btn) {
  color: var(--accent);
}

.nav a.btn {
  color: var(--on-accent);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 10px 0;
  }

  .nav .btn {
    margin-top: 8px;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.btn.small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn.secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.btn.secondary:hover {
  background: var(--bg-soft);
}

.btn[aria-disabled='true'] {
  border-color: var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  cursor: default;
  pointer-events: none;
}

.btn.block {
  width: 100%;
}

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

.center .actions {
  justify-content: center;
}

/* Sections */
section {
  padding: 96px 0;
}

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

.section-head {
  margin-bottom: 48px;
}

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

/* Hero */
.hero {
  padding: 80px 0 64px;
  overflow: hidden;
}

.hero h1 {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.hero .note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.88rem;
  text-wrap: balance;
}

/* The app window mock-up */
.window {
  max-width: 1040px;
  margin: 56px auto 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--win);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: left;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 40px;
  padding: 0 14px;
  background: var(--win-bar);
}

.lights {
  display: flex;
  gap: 7px;
}

.lights i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--skel-strong);
}

.tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
}

.tab {
  padding: 5px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.tab.active {
  background: var(--pane);
  color: var(--text);
  font-weight: 500;
}

.window-tools {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.window-tools i {
  width: 22px;
  height: 14px;
  border-radius: 4px;
  background: var(--skel-strong);
}

.window-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  height: clamp(320px, 52vw, 560px);
  padding: 4px;
}

.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--pane);
  overflow: hidden;
}

.pane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}

.pane-head .addr {
  flex: 1;
  min-width: 0;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pane-head .badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-on-soft);
  font-weight: 600;
}

.chat {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  padding: 14px 16px;
  min-height: 0;
  overflow: hidden;
}

/* Short panes clip the extra lines instead of squashing them all to nothing. */
.chat > * {
  flex-shrink: 0;
}

.line {
  height: 8px;
  border-radius: 4px;
  background: var(--skel);
}

.bubble {
  align-self: flex-end;
  width: 46%;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--accent-soft);
}

.bubble .line {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
}

.bubble .line + .line {
  margin-top: 6px;
}

.w90 { width: 90%; }
.w80 { width: 80%; }
.w70 { width: 70%; }
.w60 { width: 60%; }
.w45 { width: 45%; }

.composer {
  margin: auto 12px 12px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}

.typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .typing span {
    animation: none;
    opacity: 0.6;
  }
}

@media (max-width: 720px) {
  .window-tools,
  .tab:not(.active),
  .pane-head .badge {
    display: none;
  }

  .chat {
    padding: 10px;
    gap: 7px;
  }
}

/* Cards and feature grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

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

.card p:last-child {
  margin-bottom: 0;
}

.card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.card .icon svg {
  width: 22px;
  height: 22px;
}

.card p {
  color: var(--muted);
  font-size: 0.96rem;
}

/* Highlight trio under the hero */
.trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.trio h2 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.trio p {
  color: var(--muted);
}

@media (max-width: 800px) {
  .trio {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Layout diagrams */
.layouts {
  --cols: 5;
  --gap: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px var(--gap);
}

.layout {
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  margin: 0;
  text-align: center;
}

@media (max-width: 900px) {
  .layouts {
    --cols: 3;
  }
}

@media (max-width: 560px) {
  .layouts {
    --cols: 2;
    --gap: 16px;
  }
}

.layout .diagram {
  display: grid;
  gap: 4px;
  aspect-ratio: 16 / 10;
  padding: 4px;
  border-radius: 10px;
  background: var(--win);
  border: 1px solid var(--line);
}

.layout .diagram i {
  border-radius: 5px;
  background: var(--pane);
  border: 1px solid var(--line);
}

.layout figcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.layout .tag {
  display: inline-block;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
}

.tag.free {
  background: var(--bg-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

.tag.pro {
  background: var(--accent-soft);
  color: var(--accent-on-soft);
}

/* Split feature rows */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.checks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  padding: 8px 0 8px 30px;
  border-top: 1px solid var(--line);
}

.checks li:first-child {
  border-top: 0;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 15px;
  width: 14px;
  height: 8px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* Pricing */
.billing-toggle {
  display: inline-flex;
  padding: 4px;
  margin-bottom: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
}

.billing-toggle button {
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
}

.billing-toggle button[aria-pressed='true'] {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 400px));
  justify-content: center;
  gap: 24px;
  text-align: left;
}

@media (max-width: 760px) {
  .plans {
    grid-template-columns: minmax(0, 1fr);
  }
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.plan.featured {
  border: 2px solid var(--accent);
  padding: 31px;
}

.plan h3 {
  font-size: 1.3rem;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 8px 0 4px;
}

.price strong {
  font-size: 2.8rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.price-note {
  min-height: 1.6em;
  color: var(--muted);
  font-size: 0.9rem;
}

.savings {
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-on-soft);
  font-weight: 600;
  font-size: 0.8rem;
}

.plan .checks {
  margin: 20px 0 28px;
  font-size: 0.95rem;
}

.plan .btn {
  margin-top: auto;
}

.plan .fine {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
}

.compare th,
.compare td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.compare thead th {
  font-size: 1rem;
}

.compare tbody th {
  font-weight: 500;
}

.compare td:nth-child(3) {
  color: var(--text);
  font-weight: 500;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.table-scroll .compare tr:last-child th,
.table-scroll .compare tr:last-child td {
  border-bottom: 0;
}

/* Numbered steps */
.steps {
  counter-reset: step;
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 20px 22px 20px 70px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 22px;
  top: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

.steps strong {
  display: block;
  margin-bottom: 2px;
}

/* FAQ */
.faq {
  max-width: 780px;
  margin: 0 auto;
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  position: relative;
  padding: 20px 40px 20px 0;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 16px;
  color: var(--muted);
  font-size: 1.5rem;
  font-weight: 400;
  transition: transform 0.2s;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq .answer {
  padding: 0 0 20px;
  color: var(--muted);
}

.faq .answer p:last-child {
  margin-bottom: 0;
}

/* Download */
.download-hero {
  padding: 80px 0 48px;
}

.os-primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.os-primary .btn {
  padding: 16px 30px;
  font-size: 1.05rem;
}

.os-primary .meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.platforms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
}

@media (max-width: 820px) {
  .platforms {
    grid-template-columns: 1fr;
  }
}

.platform {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.platform.detected {
  border-color: var(--accent);
}

.platform h3 {
  margin: 0;
}

.platform .os-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  color: var(--text);
}

.platform p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.platform .btn {
  margin-top: auto;
}

.coming {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-on-soft);
  font-weight: 600;
}

.callout {
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.pending {
  padding: 16px 20px;
  border: 1px dashed color-mix(in srgb, var(--warn-text) 50%, transparent);
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 0.94rem;
}

/* Prose pages (legal, support) */
.prose {
  max-width: 760px;
  margin: 0 auto;
}

.prose h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.prose h2 {
  margin-top: 2em;
  font-size: 1.5rem;
}

.prose ul {
  padding-left: 1.2em;
}

.prose li {
  margin-bottom: 0.6em;
}

.prose .updated {
  color: var(--muted);
  font-size: 0.9rem;
}

/* CTA band */
.cta-band {
  padding: 88px 0;
  text-align: center;
}

.cta-band .actions {
  justify-content: center;
}

.cta-band .lede {
  margin: 0 auto 28px;
}

.cta-band .card {
  padding: 56px 32px;
  border: 0;
  background:
    radial-gradient(120% 120% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--bg-soft);
}

/* Footer */
.site-footer {
  padding: 56px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 32px;
}

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

  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

.site-footer h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 0.9rem;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  margin-bottom: 8px;
}

.site-footer a {
  color: var(--muted);
}

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

.site-footer .blurb {
  max-width: 300px;
  margin-top: 12px;
}

.site-footer .legal-line {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
