:root {
  --bg: #08090a;
  --bg-raised: #111214;
  --bg-card: #16171a;
  --bg-card-2: #1c1e21;
  --border: #ffffff17;
  --border-soft: #ffffff0d;
  --text: #f5f5f7;
  --text-2: #f5f5f7a3;
  --text-3: #f5f5f766;
  --accent: #2fe3c4;
  --accent-strong: #12b592;
  --accent-soft: #2fe3c424;
  --accent-ink: #05271f;
  --ok: #6fcf97;
  --ok-soft: #6fcf9724;
  --r-lg: 28px;
  --r-md: 16px;
  --r-sm: 10px;
  --r-pill: 999px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }

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

/* ---------- Ambient background: glow blobs + grid + grain ---------- */

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(620px 460px at 14% -6%, #2fe3c43d, transparent 62%),
    radial-gradient(560px 440px at 90% 4%, #7c5cff2e, transparent 60%),
    radial-gradient(900px 620px at 50% -4%, #12b5921f, transparent 68%),
    radial-gradient(640px 520px at 100% 70%, #2fe3c418, transparent 60%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, #ffffff0a 1px, transparent 1px),
    linear-gradient(to bottom, #ffffff0a 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(1100px 780px at 50% 0%, black, transparent 78%);
  mask-image: radial-gradient(1100px 780px at 50% 0%, black, transparent 78%);
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

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

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

.kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.02em; }

.accent-word {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.15;
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head p {
  margin: 16px 0 0;
  color: var(--text-2);
  font-size: 1.05rem;
  line-height: 1.6;
}

.section-head.centered {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--r-pill);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: var(--accent-ink);
}
.btn-primary:hover { opacity: 0.92; }

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--bg-card-2); }

.btn-small { padding: 9px 16px; font-size: 0.85rem; }

.btn svg { width: 16px; height: 16px; }

/* ---------- Nav: macOS 26 Liquid Glass floating bar ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 20px 0;
}

.nav-inner {
  position: relative;
  max-width: var(--container);
  margin: 0 auto;
  padding: 10px 10px 10px 18px;
  display: flex;
  align-items: center;
  gap: 32px;
  border-radius: 20px;
  isolation: isolate;
  background:
    linear-gradient(180deg, #ffffff17 0%, #ffffff08 42%, #1a1c2066 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid #ffffff1f;
  box-shadow:
    inset 0 1px 0 #ffffff33,
    inset 0 -1px 0 #ffffff0a,
    inset 0 0 0 1px #ffffff08,
    0 18px 40px -18px #000000c0,
    0 2px 14px -4px #00000080;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.nav-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(140% 120% at 16% -30%, #ffffff3d, transparent 55%);
  mix-blend-mode: overlay;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin-right: auto;
}

.brand-mark {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 26px;
}
.nav-links a {
  font-size: 0.9rem;
  color: var(--text-2);
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-burger {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #ffffff1f;
  background: #ffffff0d;
  align-items: center;
  justify-content: center;
}
.nav-burger svg { width: 16px; height: 16px; }

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin: 8px 20px 0;
  padding: 8px 18px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff14 0%, #ffffff07 40%, #1a1c2066 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid #ffffff1f;
  box-shadow: inset 0 1px 0 #ffffff26, 0 18px 40px -18px #000000c0;
}
.nav-mobile a {
  padding: 12px 4px;
  font-size: 0.95rem;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-soft);
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile.open { display: flex; }

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

.hero {
  padding: 96px 0 72px;
  text-align: center;
}

.hero-icon {
  width: 68px;
  height: 68px;
  object-fit: contain;
  margin: 0 auto 26px;
  filter: drop-shadow(0 16px 30px #2fe3c42e);
}

.hero h1 {
  font-size: clamp(2.6rem, 6.6vw, 4.6rem);
  line-height: 1.04;
}

.hero .lede {
  max-width: 560px;
  margin: 22px auto 0;
  color: var(--text-2);
  font-size: 1.1rem;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.terminal {
  max-width: 560px;
  margin: 40px auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  text-align: left;
}

.terminal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}

.terminal-prompt { color: var(--accent); font-family: var(--mono); font-size: 0.85rem; }

.terminal-cmd {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-2);
  overflow-x: auto;
  white-space: nowrap;
}

.copy-btn {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.copy-btn:hover { color: var(--text); border-color: var(--text-3); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); }

.terminal-caption {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.82rem;
  color: var(--text-3);
  line-height: 1.5;
}

.badge-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 44px;
}

.badge-pill {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: var(--r-pill);
}

/* ---------- Menu bar demo (matches the real Patchly popover) ---------- */

.demo-wrap { padding-top: 8px; }

.demo-frame {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.menubar-strip {
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #000000d9;
  border: 1px solid var(--border);
  padding: 6px 12px 6px 10px;
  border-radius: var(--r-pill);
}
.menubar-logo { width: 17px; height: 17px; object-fit: contain; }
.menubar-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.62rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 #2fe3c466; }
  50% { box-shadow: 0 0 0 6px #2fe3c400; }
}

.demo-caret {
  align-self: flex-end;
  width: 0; height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 9px solid #f1f1f3;
  margin: 8px 22px 0 0;
}

.demo-shell {
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #f5f5f7 0%, #e9e9ec 100%);
  border: 1px solid #00000014;
  overflow: hidden;
  box-shadow: 0 40px 90px -30px #000000a6, 0 20px 45px -15px #2fe3c422;
  color: #111214;
}

.demo-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 14px;
}
.demo-head-title { display: flex; align-items: baseline; gap: 7px; }
.demo-head-title strong { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.demo-head-version { font-size: 0.78rem; font-weight: 600; color: #8b8b91; }
.demo-head-sub { font-size: 0.78rem; color: #8b8b91; margin-top: 3px; }

.demo-refresh-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid #00000014;
  display: flex; align-items: center; justify-content: center;
  color: #111214;
  flex-shrink: 0;
  transition: transform 0.5s ease, background 0.15s ease;
}
.demo-refresh-btn svg { width: 14px; height: 14px; }
.demo-refresh-btn:hover { background: #00000008; }
.demo-refresh-btn.spinning { transform: rotate(320deg); }

.demo-divider { height: 1px; background: #00000013; }

.demo-list { padding: 6px 10px; }

.demo-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.demo-row:hover { background: #00000008; }

.demo-check {
  width: 17px; height: 17px;
  border-radius: 5px;
  border: 1.5px solid #00000026;
  flex-shrink: 0;
}

.demo-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  object-fit: cover;
  background: #ffffff;
}

.demo-row-main { flex: 1; min-width: 0; }
.demo-row-name { font-size: 0.9rem; font-weight: 600; color: #111214; }
.demo-row-meta {
  font-size: 0.76rem;
  color: #8b8b91;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-row-side {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.source-chip {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 3px 8px;
  border-radius: 6px;
  background: #00000010;
  color: #6a6a70;
}

.demo-update-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0a84ff;
}

.demo-alert-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ff3b30;
}

.demo-more-row {
  padding: 10px 12px 4px;
  text-align: center;
  font-size: 0.78rem;
  color: #8b8b91;
}

.demo-actions { padding: 6px 0 8px; }
.demo-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  font-size: 0.85rem;
  color: #111214;
}
.demo-action-row .kbd { font-size: 0.78rem; color: #8b8b91; }

/* ---------- Feature layouts ---------- */

.feature-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.feature-split.reverse .feature-visual { order: -1; }

.feature-text .kicker { margin-bottom: 12px; }
.feature-text h2 { margin-bottom: 16px; }
.feature-text p {
  color: var(--text-2);
  font-size: 1.02rem;
  line-height: 1.65;
}

.feature-visual {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* folder tree visual */
.tree {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--text-2);
}
.tree-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
}
.tree-row:last-child { border-bottom: none; }
.tree-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tree-icon svg { width: 12px; height: 12px; }


/* finder reveal visual */
.finder-mock {
  width: 100%;
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}
.finder-mock-head {
  display: flex; gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.finder-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.finder-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  font-size: 0.85rem;
  color: var(--text-2);
}
.finder-row.highlight {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.finder-row .demo-icon { width: 22px; height: 22px; border-radius: 6px; font-size: 0.6rem; }

/* schedule visual */
.schedule-mock { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.schedule-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px;
  background: var(--bg-raised);
  border-radius: var(--r-sm);
  font-size: 0.86rem;
  color: var(--text-2);
}
.toggle {
  width: 34px; height: 20px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
}
.toggle.on::after { left: auto; right: 2px; background: var(--accent-ink); }

/* ---------- Sources hub diagram ---------- */

.hub-visual { min-height: 340px; }

.hub {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1;
}

.hub-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 30px 60px -20px #2fe3c440;
}
.hub-center img { width: 58px; height: 58px; object-fit: contain; }

.hub-pill {
  position: absolute;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
}
.hub-pill.accent {
  background: var(--accent-soft);
  border-color: #2fe3c440;
  color: var(--accent);
}

/* ---------- Source list ---------- */

.source-list {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.source-list li {
  position: relative;
  padding-left: 22px;
  color: var(--text-2);
  font-size: 0.98rem;
  line-height: 1.6;
}
.source-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.source-list strong { color: var(--text); font-weight: 650; }

/* ---------- Before / after comparison ---------- */

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.compare-card {
  border-radius: var(--r-lg);
  padding: 32px 28px;
  border: 1px solid var(--border);
}
.compare-before { background: var(--bg-card); }
.compare-after {
  background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 100%), var(--bg-card);
  border-color: #2fe3c440;
}

.compare-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  color: var(--text-3);
}
.compare-after .compare-label { color: var(--accent); }

.compare-list { display: flex; flex-direction: column; gap: 16px; }
.compare-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.55;
}
.compare-x, .compare-check { font-weight: 700; flex-shrink: 0; }
.compare-x { color: #ff6b6b; }
.compare-check { color: var(--accent); }
.compare-list code {
  font-family: var(--mono);
  background: var(--bg-raised);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.85em;
}

/* ---------- Trust grid ---------- */

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.trust-card {
  background: var(--bg);
  padding: 32px 28px;
}
.trust-card h3 { font-size: 1rem; margin-bottom: 10px; }
.trust-card p { color: var(--text-2); font-size: 0.9rem; line-height: 1.6; margin: 0; }

/* ---------- Architecture callout ---------- */

.arch-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 48px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}
.arch-card p { color: var(--text-2); line-height: 1.65; margin: 16px 0 0; }
.stack-list { display: flex; flex-direction: column; gap: 10px; }
.stack-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--bg-raised);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-family: var(--mono);
  color: var(--text-2);
}
.stack-row span.tag {
  font-family: var(--font);
  font-weight: 700;
  color: var(--accent);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Final CTA ---------- */

.cta-final {
  text-align: center;
  padding: 110px 0 100px;
}
.cta-final h2 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.12; }
.cta-final .lede {
  max-width: 480px;
  margin: 18px auto 0;
  color: var(--text-2);
}
.cta-final .hero-cta { margin-top: 30px; }

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

footer {
  border-top: 1px solid var(--border-soft);
  padding: 44px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--text-2); font-size: 0.88rem; }
.footer-links a:hover { color: var(--text); }
.footer-tag { color: var(--text-3); font-size: 0.82rem; text-align: right; }

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

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

@media (max-width: 900px) {
  .feature-split { grid-template-columns: 1fr; gap: 36px; }
  .feature-split.reverse .feature-visual { order: 0; }
  .compare-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .arch-card { grid-template-columns: 1fr; padding: 32px; }
  .section { padding: 80px 0; }
}

@media (max-width: 720px) {
  .nav { padding: 12px 14px 0; }
  .nav-inner { padding: 8px 8px 8px 14px; gap: 12px; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-burger { display: flex; margin-left: auto; }
  .footer-inner { flex-direction: column; align-items: flex-start; text-align: left; }
  .footer-tag { text-align: left; }
}
