/* Packetboat marketing + docs site. Uses the app's brand tokens (theme.css) so
   colours + fonts match the desktop app exactly and flip with the theme. */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px; /* clear the sticky header on anchor jumps */
}

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

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

h1,
h2,
h3,
h4 {
  font-family: var(--pb-font-brand);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--pb-text);
}

code,
kbd,
pre {
  font-family: var(--pb-font-data);
}

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

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

.narrow {
  max-width: 780px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--pb-radius);
  border: 1px solid var(--pb-border);
  background: var(--pb-surface-2);
  color: var(--pb-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--pb-transition),
    border-color var(--pb-transition),
    transform var(--pb-transition);
}
.btn:hover {
  border-color: var(--pb-accent);
  color: var(--pb-text);
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--pb-accent);
  border-color: var(--pb-accent);
  color: var(--pb-on-accent);
}
.btn-primary:hover {
  background: var(--pb-accent-hover);
  border-color: var(--pb-accent-hover);
  color: var(--pb-on-accent);
}
.btn-ghost {
  background: transparent;
}
.btn svg {
  width: 18px;
  height: 18px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--pb-bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pb-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pb-font-brand);
  font-weight: 700;
  font-size: 20px;
}
.brand .brand-mark {
  width: 30px;
  height: auto;
}
.pb-logo-1 {
  fill: var(--pb-logo-1);
}
.pb-logo-2 {
  fill: var(--pb-logo-2);
}
.pb-logo-3 {
  fill: var(--pb-logo-3);
}
/* Two-tone wordmark (matches the app). */
.wm-1 {
  color: var(--pb-logo-1);
}
.wm-2 {
  color: var(--pb-text-2);
}
:root[data-theme="light"] .wm-2 {
  color: var(--pb-accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
/* The hamburger is desktop-hidden; the media query below shows it + turns
   .nav-links into a dropdown so the menu never crowds the logo. The extra
   .site-nav qualifier outweighs .icon-btn's own `display: inline-flex`. */
.site-nav .nav-toggle {
  display: none;
}
.site-nav a.navlink {
  color: var(--pb-text-2);
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: var(--pb-radius-sm);
}
.site-nav a.navlink:hover {
  color: var(--pb-text);
  background: var(--pb-surface-2);
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--pb-radius-sm);
  border: 1px solid var(--pb-border);
  background: var(--pb-surface-2);
  color: var(--pb-text-2);
  cursor: pointer;
}
.icon-btn:hover {
  color: var(--pb-text);
  border-color: var(--pb-accent);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
/* Theme toggle: show the sun in dark mode, moon in light mode. */
.icon-btn .i-sun {
  display: none;
}
:root[data-theme="dark"] .icon-btn .i-sun {
  display: block;
}
:root[data-theme="dark"] .icon-btn .i-moon {
  display: none;
}

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 64px;
  text-align: center;
}
.hero .eyebrow {
  display: inline-block;
  font-family: var(--pb-font-data);
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--pb-accent);
  background: var(--pb-selection);
  border: 1px solid var(--pb-border);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 56px);
  letter-spacing: -0.5px;
  margin-bottom: 18px;
}
.hero p.lede {
  font-size: clamp(17px, 2.4vw, 21px);
  color: var(--pb-text-2);
  max-width: 750px;
  margin: 0 auto 30px;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-sub {
  margin-top: 14px;
  font-size: 14px;
  color: var(--pb-text-muted);
}

/* ---------- App mockup (a stylised dual-pane window) ---------- */
.mockup {
  margin: 56px auto 0;
  max-width: 940px;
  border-radius: var(--pb-radius-lg);
  border: 1px solid var(--pb-border);
  background: var(--pb-surface);
  box-shadow: var(--pb-shadow);
  overflow: hidden;
}
.mockup-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--pb-surface-2);
  border-bottom: 1px solid var(--pb-border);
}
.mockup-bar .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--pb-border);
}
.mockup-bar .mockup-title {
  margin-left: 8px;
  font-size: 13px;
  color: var(--pb-text-2);
}
.mockup-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--pb-border);
}
.mockup-pane {
  background: var(--pb-bg);
  padding: 12px 14px;
  min-height: 260px;
}
.mockup-pane h5 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--pb-text-muted);
  font-family: var(--pb-font-ui);
  font-weight: 700;
}
.mockup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--pb-radius-sm);
  font-family: var(--pb-font-data);
  font-size: 13px;
  color: var(--pb-text);
}
.mockup-row.sel {
  background: var(--pb-selection);
}
.mockup-row .ico {
  width: 15px;
  height: 15px;
  color: var(--pb-icon);
  flex: none;
}
.mockup-row .grow {
  flex: 1;
}
.mockup-row .meta {
  color: var(--pb-text-muted);
  font-size: 12px;
}
.mockup-queue {
  border-top: 1px solid var(--pb-border);
  padding: 10px 14px;
  background: var(--pb-surface);
  font-family: var(--pb-font-data);
  font-size: 12.5px;
  color: var(--pb-text-2);
}
.mockup-bar-fill {
  height: 5px;
  border-radius: 3px;
  background: var(--pb-surface-2);
  overflow: hidden;
  margin-top: 5px;
}
.mockup-bar-fill > span {
  display: block;
  height: 100%;
  width: 68%;
  background: var(--pb-accent);
}

/* ---------- Sections ---------- */
section {
  padding: 64px 0;
}
.section-head {
  text-align: center;
  margin-bottom: 44px;
}
.section-head h2 {
  font-size: clamp(26px, 4vw, 36px);
}
.section-head p {
  color: var(--pb-text-2);
  max-width: 675px;
  margin: 10px auto 0;
  font-size: 17px;
}
.alt {
  background: var(--pb-surface);
  border-top: 1px solid var(--pb-border);
  border-bottom: 1px solid var(--pb-border);
}

/* ---------- Screenshot showcase ---------- */
.showcase {
  padding-top: 8px;
}
.showcase .shot {
  max-width: 1040px;
  margin: 0 auto;
  border-radius: var(--pb-radius-lg);
  border: 1px solid var(--pb-border);
  background: var(--pb-surface);
  box-shadow: var(--pb-shadow);
  overflow: hidden;
}
.showcase .shot img {
  display: block;
  width: 100%;
  height: auto;
}
/* Theme-matched swap: only the screenshot for the active theme is shown. The
   attribute is always present (theme.js sets it before first paint), so exactly
   one image is ever visible. */
:root[data-theme="dark"] .shot-light {
  display: none;
}
:root[data-theme="light"] .shot-dark {
  display: none;
}

/* ---------- Feature grid ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.feature {
  background: var(--pb-surface);
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius-lg);
  padding: 22px;
  transition:
    border-color var(--pb-transition),
    transform var(--pb-transition);
}
.alt .feature {
  background: var(--pb-bg);
}
.feature:hover {
  border-color: var(--pb-accent);
  transform: translateY(-2px);
}
.feature .f-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--pb-radius);
  background: var(--pb-selection);
  color: var(--pb-accent);
  margin-bottom: 14px;
}
.feature .f-icon svg {
  width: 22px;
  height: 22px;
}
.feature h3 {
  font-size: 18px;
  margin-bottom: 6px;
}
.feature p {
  margin: 0;
  color: var(--pb-text-2);
  font-size: 15px;
}

/* ---------- Download ---------- */
.downloads {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}
.dl-card {
  text-align: center;
  background: var(--pb-surface);
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius-lg);
  padding: 26px 20px;
}
.dl-card .os {
  color: var(--pb-icon);
  margin-bottom: 10px;
}
.dl-card .os svg {
  width: 34px;
  height: 34px;
  margin: 0 auto;
}
.dl-card h3 {
  font-size: 18px;
  margin-bottom: 4px;
}
.dl-card p {
  color: var(--pb-text-muted);
  font-size: 13.5px;
  margin: 0 0 16px;
}
.dl-note {
  text-align: center;
  color: var(--pb-text-muted);
  font-size: 14px;
}
.dl-note code {
  background: var(--pb-surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* ---------- Support / donate ---------- */
.support-card {
  background: var(--pb-surface);
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius-lg);
  padding: 40px;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.support-card h2 {
  font-size: 30px;
}
.support-card p {
  color: var(--pb-text-2);
  font-size: 17px;
  margin: 8px auto 26px;
  max-width: 540px;
}
.support-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--pb-border);
  padding: 40px 0;
  color: var(--pb-text-muted);
  font-size: 14px;
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--pb-text-2);
}
.footer-links a:hover {
  color: var(--pb-accent);
}

/* ---------- Docs ---------- */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
  padding: 40px 0 80px;
}
.docs-nav {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.docs-nav h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--pb-text-muted);
  margin: 18px 0 8px;
}
.docs-nav h4:first-child {
  margin-top: 0;
}
.docs-nav a {
  display: block;
  color: var(--pb-text-2);
  font-size: 14.5px;
  padding: 5px 10px;
  border-radius: var(--pb-radius-sm);
  border-left: 2px solid transparent;
}
.docs-nav a:hover {
  color: var(--pb-text);
  background: var(--pb-surface-2);
}
.docs-nav a.active {
  color: var(--pb-accent);
  border-left-color: var(--pb-accent);
  background: var(--pb-selection);
}
.docs-content {
  min-width: 0;
  max-width: 760px;
}
.docs-content h2 {
  font-size: 28px;
  margin-top: 8px;
  padding-top: 12px;
}
.docs-content h2:not(:first-child) {
  margin-top: 48px;
  border-top: 1px solid var(--pb-border);
  padding-top: 40px;
}
.docs-content h3 {
  font-size: 19px;
  margin-top: 30px;
}
.docs-content p,
.docs-content li {
  color: var(--pb-text);
  font-size: 16px;
}
.docs-content ul,
.docs-content ol {
  padding-left: 22px;
}
.docs-content li {
  margin: 6px 0;
}
.docs-content strong {
  color: var(--pb-text);
}
.docs-content code {
  background: var(--pb-surface-2);
  border: 1px solid var(--pb-border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 14px;
}
.docs-content pre {
  background: var(--pb-surface);
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}
.docs-content pre code {
  background: none;
  border: none;
  padding: 0;
}
.callout {
  border: 1px solid var(--pb-border);
  border-left: 3px solid var(--pb-accent);
  background: var(--pb-surface);
  border-radius: var(--pb-radius);
  padding: 14px 16px;
  margin: 18px 0;
  color: var(--pb-text-2);
  font-size: 15px;
}
.callout strong {
  color: var(--pb-accent);
}
.docs-content kbd {
  background: var(--pb-surface-2);
  border: 1px solid var(--pb-border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .features,
  .downloads {
    grid-template-columns: 1fr 1fr;
  }
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-nav {
    position: static;
    max-height: none;
    border: 1px solid var(--pb-border);
    border-radius: var(--pb-radius);
    padding: 12px 8px;
    margin-bottom: 20px;
  }
  .mockup-panes {
    grid-template-columns: 1fr;
  }
}
/* Collapse the nav to a hamburger well before the links crowd the logo. */
@media (max-width: 768px) {
  .site-nav .nav-toggle {
    display: inline-flex;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 16px 14px;
    background: var(--pb-surface);
    border-bottom: 1px solid var(--pb-border);
    box-shadow: var(--pb-shadow);
  }
  .nav-links.open {
    display: flex;
  }
  .site-nav a.navlink {
    padding: 11px 12px;
    font-size: 16px;
  }
}
@media (max-width: 620px) {
  .features,
  .downloads {
    grid-template-columns: 1fr;
  }
  .support-card {
    padding: 28px 20px;
  }
}
