:root {
  color-scheme: light;

  /* Bridj palette — same system as the app (docs/ux/NEST_UX_COLOUR_SCHEMA.md):
     Cold-and-Dark + Seaside on a calm white base, warm-paper and pale-seafoam
     surfaces for separation. The website should feel like the tool. */
  --bg: #fffffe;
  --surface: #ffffff;
  --surface-warm: #f6f1e7;
  --sunken: #eef6f5;
  --ink: #153d4a;
  --muted: #5f7075;
  --faint: #8b9ca0;
  --line: #d7e1df;
  --guide: #bcd2cf;

  --accent: #2f7f8d;
  --accent-dark: #245f6b;
  --accent-soft: #dff1f3;
  --focus: #2f7f8d;
  --mist: #9ec7cd;
  --sand: #cdb083;

  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 12px;
  --radius-sm: 9px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.site-header,
.site-footer,
main {
  margin: 0 auto;
  max-width: 1080px;
  padding-left: 28px;
  padding-right: 28px;
}

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

.site-header {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding-bottom: 24px;
  padding-top: 26px;
}

.brand {
  align-items: center;
  display: inline-flex;
  flex: none;
  font-size: 21px;
  font-weight: 700;
  gap: 10px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.logomark {
  flex: none;
  height: 34px;
  width: 34px;
}

.site-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: flex-end;
}

.site-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav .button {
  min-height: 38px;
  padding: 7px 14px;
}

/* ---------- Type ---------- */

h1,
h2,
h3,
p,
dl {
  margin-top: 0;
}

h1 {
  font-size: clamp(36px, 4.6vw, 56px);
  letter-spacing: -0.015em;
  line-height: 1.04;
  margin-bottom: 20px;
}

h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 14px;
}

h3 {
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.hero-lede,
.lead,
.section-heading p,
.copy-stack p {
  color: var(--muted);
  font-size: 18px;
}

.fine-print {
  color: var(--faint);
  font-size: 14px;
  max-width: 540px;
}

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

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  display: inline-flex;
  font-weight: 650;
  justify-content: center;
  min-height: 46px;
  padding: 11px 20px;
  text-decoration: none;
  transition: background-color 130ms ease, border-color 130ms ease;
}

.button.primary {
  background: var(--accent);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--accent-dark);
}

.button.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.button.secondary:hover {
  border-color: var(--guide);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 16px;
}

.cta-note {
  background: var(--surface-warm);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
  margin: 12px 0 0;
  max-width: 460px;
  padding: 10px 14px;
}

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

.hero {
  align-items: center;
  display: grid;
  gap: 56px;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.95fr);
  padding-bottom: 56px;
  padding-top: 40px;
}

/* ---------- App-window demo ---------- */

.app-window {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(21, 61, 74, 0.1);
  overflow: hidden;
}

.window-titlebar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 12px 16px;
}

.window-titlebar .window-app {
  align-items: center;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
}

.window-titlebar .logomark {
  height: 20px;
  width: 20px;
}

.window-titlebar .window-meta {
  color: var(--faint);
  font-size: 12px;
}

/* The animated stage — adapted from the app's own welcome animation:
   messy pile -> carried bundle -> folder frame fills with organised bars. */
.demo-stage {
  --demo-dur: 6s;
  /* Bundle travel: land centred on the nest regardless of stage width.
     Nest centre = 100cqw - 38px - 64px; bundle centre starts at 46px + 32px. */
  --carry-x: calc(100cqw - 180px);
  background: var(--surface-warm);
  container-type: inline-size;
  height: 264px;
  overflow: hidden;
  position: relative;
}

.demo-file {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(21, 61, 74, 0.09);
  height: 80px;
  position: absolute;
  width: 64px;
}

.demo-file::before {
  background: var(--accent);
  border-radius: 3px;
  content: "";
  height: 5px;
  left: 11px;
  position: absolute;
  top: 13px;
  width: 28px;
}

.demo-file::after {
  background: var(--sunken);
  border-radius: 3px;
  box-shadow: 0 9px 0 var(--sunken), 0 18px 0 var(--sunken);
  content: "";
  height: 5px;
  left: 11px;
  position: absolute;
  right: 11px;
  top: 27px;
}

.demo-scatter {
  left: 38px;
  position: absolute;
  top: 96px;
}

.demo-scatter .demo-file {
  left: 0;
  top: 0;
}

.s1 { opacity: 0.5; transform: rotate(-13deg) translate(-2px, 10px); }
.s2 { opacity: 0.68; transform: rotate(8deg) translate(16px, -2px); }
.s3 { opacity: 0.85; transform: rotate(-3deg) translate(7px, 3px); }

.demo-nest {
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  height: 128px;
  justify-content: center;
  padding: 0 20px;
  position: absolute;
  right: 38px;
  top: 76px;
  width: 128px;
}

.demo-bar {
  border-radius: 6px;
  height: 12px;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  width: 100%;
}

.nb1 { animation: demoFill var(--demo-dur) ease-out infinite; background: var(--accent); }
.nb2 { animation: demoFill var(--demo-dur) ease-out -0.18s infinite; background: var(--mist); }
.nb3 { animation: demoFill var(--demo-dur) ease-out -0.36s infinite; background: var(--sand); width: 62%; }

.demo-ring {
  animation: demoRing var(--demo-dur) ease-out infinite;
  border: 2px solid var(--accent);
  border-radius: 32px;
  inset: -7px;
  opacity: 0;
  position: absolute;
}

.demo-bundle {
  animation: demoCarry var(--demo-dur) cubic-bezier(0.5, 0, 0.2, 1) infinite;
  height: 80px;
  left: 46px;
  position: absolute;
  top: 90px;
  width: 64px;
}

.demo-bundle .demo-file { left: 0; top: 0; }
.b1 { animation: demoStraighten1 var(--demo-dur) ease-in-out infinite; }
.b2 { animation: demoStraighten2 var(--demo-dur) ease-in-out infinite; }
.b3 { animation: demoStraighten3 var(--demo-dur) ease-in-out infinite; }

.demo-cursor {
  animation: demoClick var(--demo-dur) ease-out infinite;
  filter: drop-shadow(0 2px 3px rgba(21, 61, 74, 0.28));
  height: 23px;
  left: 40px;
  position: absolute;
  top: 52px;
  width: 23px;
}

.stage-label {
  bottom: 16px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  position: absolute;
  text-transform: uppercase;
}

.stage-label.start { left: 38px; }
.stage-label.end { right: 38px; }

@keyframes demoCarry {
  0%   { opacity: 0; transform: translate(0, 0); }
  6%   { opacity: 1; transform: translate(0, 0); }
  14%  { opacity: 1; transform: translate(0, -7px) scale(0.97); }
  26%  { opacity: 1; transform: translate(calc(var(--carry-x) * 0.57), -30px); }
  46%  { opacity: 1; transform: translate(var(--carry-x), -2px); }
  70%  { opacity: 1; transform: translate(var(--carry-x), -2px); }
  80%  { opacity: 0; transform: translate(var(--carry-x), -2px); }
  100% { opacity: 0; transform: translate(0, 0); }
}

@keyframes demoStraighten1 {
  0%, 18% { transform: rotate(-14deg) translate(-6px, 5px); }
  44%, 100% { transform: rotate(0deg) translate(0, 0); }
}
@keyframes demoStraighten2 {
  0%, 18% { transform: rotate(10deg) translate(9px, -3px); }
  44%, 100% { transform: rotate(0deg) translate(0, -2px); }
}
@keyframes demoStraighten3 {
  0%, 18% { transform: rotate(-5deg) translate(3px, 7px); }
  44%, 100% { transform: rotate(0deg) translate(0, -4px); }
}

@keyframes demoFill {
  0%, 44%   { opacity: 0; transform: scaleX(0); }
  52%       { opacity: 1; transform: scaleX(1); }
  78%       { opacity: 1; transform: scaleX(1); }
  86%, 100% { opacity: 0; transform: scaleX(0); }
}

@keyframes demoRing {
  0%, 46% { opacity: 0; transform: scale(0.9); }
  54%     { opacity: 0.55; transform: scale(1); }
  72%     { opacity: 0; transform: scale(1.18); }
  100%    { opacity: 0; transform: scale(1.18); }
}

@keyframes demoClick {
  0%, 10% { transform: translate(0, 0); }
  14%     { transform: translate(2px, 4px); }
  20%     { transform: translate(0, 0); }
  100%    { transform: translate(0, 0); }
}

.window-output {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
}

.window-output .output-label {
  color: var(--faint);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  margin-right: 4px;
  text-transform: uppercase;
}

.window-output code {
  background: var(--sunken);
  border-radius: 6px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 8px;
}

.window-caption {
  color: var(--faint);
  font-size: 13px;
  margin: 12px 2px 0;
  text-align: center;
}

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

.section {
  padding-bottom: 80px;
  padding-top: 80px;
}

.section-heading {
  max-width: 680px;
}

.steps {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 36px;
}

.steps article {
  border-top: 2px solid var(--line);
  padding-top: 18px;
}

.step-number {
  color: var(--sand);
  display: block;
  font-weight: 800;
  margin-bottom: 16px;
}

.steps p,
.pricing-panel li,
.legal-copy p,
.account-panel dd,
.faq-list p {
  color: var(--muted);
}

/* ---------- What you get ---------- */

.folder-section {
  align-items: start;
  display: grid;
  gap: 56px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1fr);
}

.folder-tree-panel {
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.9;
  padding: 22px 26px;
}

.folder-tree-panel .dir {
  color: var(--accent-dark);
  font-weight: 650;
}

.folder-tree-panel .tree-guide {
  color: var(--guide);
}

.folder-notes {
  display: grid;
  gap: 18px;
}

.folder-notes div {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.folder-notes dt {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 4px;
}

.folder-notes dd {
  color: var(--muted);
  margin: 0;
}

/* ---------- Local-first ---------- */

.split {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
}

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

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

.pricing-panel {
  background: var(--surface-warm);
  border-radius: var(--radius);
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 36px;
  padding: 32px 36px;
}

.pricing-panel h3 {
  font-size: 21px;
}

.pricing-panel ul {
  color: var(--muted);
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.pricing-panel li::before {
  color: var(--accent);
  content: "—";
  margin-right: 10px;
}

.pricing-panel .cta-note {
  background: var(--surface);
  grid-column: 1 / -1;
  margin: 0;
}

.pricing-cta {
  align-self: center;
  display: grid;
  gap: 10px;
  justify-items: stretch;
  min-width: 230px;
}

.pricing-price {
  font-size: 15px;
  font-weight: 650;
  margin: 0;
  text-align: center;
}

.pricing-price span {
  color: var(--faint);
  display: block;
  font-size: 13px;
  font-weight: 400;
}

/* ---------- FAQ ---------- */

.faq-list {
  margin-top: 28px;
  max-width: 760px;
}

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

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

.faq-list summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 650;
  list-style: none;
  padding: 18px 36px 18px 2px;
  position: relative;
}

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

.faq-list summary::after {
  color: var(--accent);
  content: "+";
  font-size: 22px;
  font-weight: 400;
  position: absolute;
  right: 8px;
  top: 14px;
}

.faq-list details[open] summary::after {
  content: "\2013";
}

.faq-list p {
  margin: 0 0 20px;
  max-width: 660px;
  padding-left: 2px;
}

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

.site-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-bottom: 36px;
  padding-top: 30px;
}

.footer-brand {
  align-items: center;
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  margin-right: auto;
}

.footer-brand .logomark {
  height: 22px;
  width: 22px;
}

.site-footer a {
  font-size: 14px;
  text-decoration: none;
}

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

.footer-note {
  color: var(--faint);
  font-size: 13px;
}

/* ---------- Inner pages ---------- */

.narrow-page {
  max-width: 720px;
  padding-bottom: 80px;
  padding-top: 56px;
}

.standalone {
  align-content: center;
  display: grid;
  justify-items: start;
  min-height: 70vh;
}

.account-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 34px;
  padding: 28px;
}

.status-list {
  display: grid;
  gap: 14px;
  margin: 22px 0 26px;
}

.status-list div {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: 190px minmax(0, 1fr);
  padding-top: 13px;
}

.status-list dt {
  font-weight: 650;
}

.status-list dd {
  margin: 0;
}

.legal-copy p {
  font-size: 17px;
}

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

@media (max-width: 900px) {
  .hero,
  .split,
  .folder-section {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 40px;
    padding-top: 24px;
  }

  .folder-section {
    gap: 32px;
  }

  /* Heading and notes first on small screens, tree below. */
  .folder-section > .folder-tree-panel {
    order: 1;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .pricing-panel {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .pricing-cta {
    justify-items: start;
    min-width: 0;
  }

  .pricing-price {
    text-align: left;
  }
}

@media (max-width: 600px) {
  .site-header,
  .site-footer,
  main {
    padding-left: 18px;
    padding-right: 18px;
  }

  /* Keep the small-screen header to one row: brand, Account, primary CTA. */
  .site-nav {
    gap: 14px;
  }

  .site-nav a[href^="#"]:not(.button) {
    display: none;
  }

  .section {
    padding-bottom: 56px;
    padding-top: 56px;
  }

  .demo-stage {
    /* Nest centre = 100cqw - 22px - 56px; bundle centre starts at 30px + 32px. */
    --carry-x: calc(100cqw - 140px);
    height: 232px;
  }

  .demo-scatter { left: 22px; }
  .demo-bundle { left: 30px; }
  .demo-nest { right: 22px; width: 112px; }
  .stage-label.start { left: 22px; }
  .stage-label.end { right: 22px; }

  .status-list div {
    grid-template-columns: 1fr;
  }
}

/* Respect reduced motion: freeze the demo at its organised end-state. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .demo-bundle,
  .demo-cursor,
  .demo-ring {
    animation: none;
    display: none;
  }

  .demo-bar {
    animation: none;
    opacity: 1;
    transform: scaleX(1);
  }
}
