/* Branch.Exchange — shared site styles. No external requests; system fonts only. */

:root {
  --bg: #ffffff;
  --bg-soft: #f8f7fb;
  --bg-card: #ffffff;
  --text: #1c1726;
  --muted: #5d5768;
  --border: #e7e3ef;
  --accent: #7c3aed;
  --accent-strong: #6d28d9;
  --accent-soft: #f3eefd;
  --accent-text: #6d28d9;
  color-scheme: light dark;
}

/* Dark tokens apply in system-dark (unless the user forced light) and when forced dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #131017;
    --bg-soft: #1a1622;
    --bg-card: #1a1622;
    --text: #ece8f2;
    --muted: #a49cb2;
    --border: #2c2638;
    --accent: #8b5cf6;
    --accent-strong: #a78bfa;
    --accent-soft: #251d36;
    --accent-text: #b79cfa;
  }
}

:root[data-theme='dark'] {
  --bg: #131017;
  --bg-soft: #1a1622;
  --bg-card: #1a1622;
  --text: #ece8f2;
  --muted: #a49cb2;
  --border: #2c2638;
  --accent: #8b5cf6;
  --accent-strong: #a78bfa;
  --accent-soft: #251d36;
  --accent-text: #b79cfa;
  color-scheme: dark;
}

:root[data-theme='light'] {
  color-scheme: light;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Someone who asked the OS for less motion means it about page jumps too — the smooth
   scroll above, and every carousel transition below. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.wrap-narrow {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header / nav ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
}

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

.brand .mark {
  display: block;
  flex: none;
}

.brand .company {
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.brand .company span {
  color: var(--muted);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-links a.btn {
  color: #fff;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.theme-toggle .icon-sun {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme='dark'] .theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .icon-sun {
    display: block;
  }

  :root:not([data-theme='light']) .theme-toggle .icon-moon {
    display: none;
  }
}

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

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
}

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

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

.btn-secondary:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
}

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

.hero {
  padding: 5rem 0 4rem;
  background:
    radial-gradient(42rem 22rem at 85% -10%, var(--accent-soft) 0%, transparent 70%), var(--bg);
}

.hero .eyebrow {
  color: var(--accent-text);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  max-width: 46rem;
}

.hero .lede {
  margin-top: 1.25rem;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 40rem;
}

.hero .hero-body {
  margin-top: 1.25rem;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text);
  max-width: 42rem;
}

/* Base layout for every button row (hero, pricing card, CTA band) — defined once so a new
   section that reuses the class cannot fall back to .btn's inline display and lose its gap. */
.cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero .cta-row {
  margin-top: 2rem;
}

.hero .fineprint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

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

section {
  padding: 3.5rem 0;
}

section.alt {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 40rem;
  margin-bottom: 2.25rem;
}

.section-head h2 {
  font-size: 1.7rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.section-head p {
  margin-top: 0.6rem;
  color: var(--muted);
}

/* ---------- Feature groups ---------- */

.feature-groups {
  display: grid;
  gap: 2.5rem;
}

.feature-group h3 {
  font-size: 1.05rem;
  color: var(--accent-text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.feature-group h3 svg {
  flex: none;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
}

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 1.1rem 1.2rem;
}

.feature h4 {
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.feature p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Compact feature list ----------
   The features used to be 21 cards of a paragraph each, which nobody read to the end of.
   A name plus a phrase scans in one pass, and the whole inventory now fits on one screen —
   which is itself the argument: the point is the BREADTH, and a wall of prose hid it. */

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.15rem 2rem;
}

.feature-list div,
.feature-list a {
  display: block;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
}

/* Every feature is a LINK into the carousel above (its anchor to #tour is what still works
   with no script). It has to look pressable, so: a pointer, an accent title on hover, and a
   real focus ring — the row is otherwise indistinguishable from the static list it replaced. */
.feature-list a {
  color: inherit;
  cursor: pointer;
  border-radius: 0.35rem;
  transition: background-color 0.12s ease;
}

.feature-list a:hover {
  text-decoration: none;
  background: var(--accent-soft);
  box-shadow:
    -0.5rem 0 0 var(--accent-soft),
    0.5rem 0 0 var(--accent-soft);
}

.feature-list a:hover b {
  color: var(--accent-text);
}

/* The affordance has to survive not hovering: a row that only looks pressable under the
   cursor reads as plain text to everyone scanning the list. */
.feature-list a b::after {
  content: ' ›';
  color: var(--accent-text);
  opacity: 0.5;
}

.feature-list a:hover b::after,
.feature-list a:focus-visible b::after {
  opacity: 1;
}

.feature-list a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.feature-list dt,
.feature-list b {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.feature-list span {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 0.1rem;
}

/* ---------- Product screenshots ---------- */

.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

.shot figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 46rem;
}

/* ---------- The #tour carousel ----------
   The viewport is a NATIVE scroll-snap strip, so swipe, trackpad and scrollbar all work
   with no script at all, and a no-JS visitor can still reach every slide. index.html's
   script only adds the arrows, the dots and the counter on top of that. */

/* Rule 5, applied to a marketing page: the screenshots ARE the content of this section, and
   at the site's 68rem prose measure a 1440px console screenshot scales to 73% and stops being
   readable. The tour band alone runs wider; every other section keeps the reading width. */
#tour .wrap {
  max-width: 82rem;
}

.carousel {
  position: relative;
}

.carousel-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  /* The strip is the scroller, so hide its bar — the dots and arrows are the affordance. */
  scrollbar-width: none;
  border-radius: 0.75rem;
}

.carousel-viewport::-webkit-scrollbar {
  display: none;
}

.carousel-viewport:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-viewport {
    scroll-behavior: auto;
  }
}

.carousel-track {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.carousel .slide {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.carousel .slide figcaption {
  /* Two lines' worth, so the strip does not change height as you move through it. */
  min-height: 2.9rem;
  max-width: 52rem;
}

.carousel .slide figcaption b {
  color: var(--text);
  font-weight: 600;
}

.carousel-nav {
  position: absolute;
  top: 0;
  /* Sits over the image, not the caption: the caption row is ~3.5rem tall. */
  bottom: 3.5rem;
  width: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.carousel-nav > svg {
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 1px 6px rgb(0 0 0 / 0.14);
  padding: 0.45rem;
  width: 2.4rem;
  height: 2.4rem;
}

.carousel-nav:hover {
  opacity: 1;
}

.carousel-nav:focus-visible {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: -4px;
  border-radius: 0.5rem;
}

.carousel-nav:disabled {
  opacity: 0.18;
  cursor: default;
}

.carousel-prev {
  left: -0.75rem;
}

.carousel-next {
  right: -0.75rem;
}

.carousel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.carousel-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.carousel-dot {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--border);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}

.carousel-dot:hover {
  background: var(--accent-strong);
}

.carousel-dot.is-on {
  background: var(--accent);
  transform: scale(1.45);
}

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

@media (prefers-reduced-motion: reduce) {
  .carousel-dot,
  .carousel-nav,
  .feature-list a {
    transition: none;
  }
}

.carousel-count {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 52rem) {
  .carousel-nav {
    display: none;
  }
}

/* Show the screenshot variant matching the active theme (same pattern as the
   toggle's sun/moon icons). */
.shot .shot-dark {
  display: none;
}

:root[data-theme='dark'] .shot .shot-light {
  display: none;
}

:root[data-theme='dark'] .shot .shot-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .shot .shot-light {
    display: none;
  }

  :root:not([data-theme='light']) .shot .shot-dark {
    display: block;
  }
}

/* ---------- Deploy cards ---------- */

.deploy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
}

.deploy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.6rem;
}

.deploy-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

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

.deploy-card ul {
  margin-top: 0.9rem;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.deploy-card li {
  margin-top: 0.35rem;
}

/* ---------- Pricing ---------- */

.pricing-card {
  max-width: 30rem;
}

.pricing-card .pricing-amount {
  margin-bottom: 0.75rem;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text);
}

.pricing-card .pricing-amount span {
  display: block;
  margin-top: 0.15rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}

.pricing-card .cta-row {
  margin-top: 1.5rem;
}

/* ---------- CTA band ---------- */

.cta-band {
  text-align: center;
  padding: 4.5rem 0;
}

.cta-band h2 {
  font-size: 1.9rem;
  letter-spacing: -0.015em;
}

.cta-band p {
  margin-top: 0.75rem;
  color: var(--muted);
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}

.cta-band .cta-row {
  margin-top: 1.75rem;
  justify-content: center;
}

/* ---------- Prose pages (support / privacy / terms) ---------- */

.page {
  padding: 3.5rem 0 4.5rem;
}

.page h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page .meta {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.page h2 {
  font-size: 1.25rem;
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.page h3 {
  font-size: 1.02rem;
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
}

.page p {
  margin-top: 0.75rem;
  color: var(--text);
}

.page p.soft,
.page li.soft {
  color: var(--muted);
}

.page ul {
  margin-top: 0.75rem;
  padding-left: 1.3rem;
}

.page li {
  margin-top: 0.4rem;
}

.page .callout {
  margin-top: 1.5rem;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
}

.page .callout a {
  font-weight: 600;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.25rem 0 2.75rem;
  background: var(--bg-soft);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-about {
  max-width: 24rem;
}

.footer-inner .copyright {
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-phone {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-phone a {
  color: var(--muted);
  font-weight: 600;
}

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

.footer-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.88rem;
}

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

/* ---------- Small screens ---------- */

@media (max-width: 40rem) {
  .hero {
    padding: 3.25rem 0 2.75rem;
  }

  section {
    padding: 2.5rem 0;
  }

  .nav {
    justify-content: center;
  }

  /* Without the wrap the seven nav items are one un-breakable row, and the whole document
     scrolls sideways on a phone — the header was the only horizontal overflow on the page. */
  .nav-links {
    gap: 0.5rem 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
}
