/* Frondhop — site styles */
:root {
  --forest-900: #06180f;
  --forest-800: #0a2219;
  --forest-700: #0f3324;
  --forest-600: #174a34;
  --lime: #c3f27f;
  --lime-dim: #9fd65c;
  --sage: #235c40;
  --cream: #f6f8f1;
  --ink: #10221a;
  --ink-soft: #4a5d53;
  --text: #e8f1e6;
  --text-soft: #a9bdb0;
  --radius: 22px;
  --max: 1160px;
  --pad: clamp(20px, 5vw, 56px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--forest-800);
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .h3 { margin: 0 0 .4em; line-height: 1.08; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(44px, 7.4vw, 92px); letter-spacing: -.04em; }
h2 { font-size: clamp(32px, 4.6vw, 56px); letter-spacing: -.03em; }
h3, .h3 { font-size: 21px; }
p { margin: 0 0 1em; }
.lime { color: var(--lime); }
.muted { color: var(--text-soft); }
.small { font-size: 14px; }
.center { text-align: center; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: 13px; font-weight: 700;
  color: var(--lime); margin-bottom: 14px;
}
.lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--text-soft); max-width: 40em; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--lime); color: var(--ink); padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 12px; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 6px; }

/* Buttons */
.pill, .ghost {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 650; border-radius: 999px; cursor: pointer;
  padding: 14px 26px; border: 0; transition: transform .3s var(--spring), background .2s, opacity .2s;
  text-decoration: none !important; min-height: 44px;
}
.pill { background: var(--lime); color: var(--forest-900); }
.pill:hover { transform: translateY(-2px); }
.pill:active { transform: scale(.97); }
.pill:disabled { opacity: .4; cursor: default; transform: none; }
.ghost { background: transparent; color: var(--lime); padding-inline: 6px; }
.ghost:hover span { transform: translateX(4px); }
.ghost span { display: inline-block; transition: transform .3s var(--spring); }
.pill.small, .ghost.small { padding: 9px 18px; font-size: 15px; min-height: 40px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: calc(env(safe-area-inset-top) + 12px) var(--pad) 12px;
  background: color-mix(in srgb, var(--forest-800) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid rgba(195, 242, 127, .08);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.brand img { border-radius: 8px; }
.brand:hover { text-decoration: none; }
.nav nav { display: flex; gap: 22px; margin-left: auto; }
.nav nav a { color: var(--text-soft); font-size: 15px; font-weight: 500; }
.nav nav a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 860px) { .nav nav { display: none; } .nav .pill { margin-left: auto; } }

/* Hero */
.hero {
  max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto;
  padding: clamp(48px, 8vw, 110px) var(--pad) clamp(56px, 8vw, 100px);
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center;
  position: relative;
}
.hero::before {
  content: ""; position: absolute; inset: -10% -20% auto auto; width: 70%; aspect-ratio: 1;
  background: radial-gradient(circle, rgba(195, 242, 127, .14), transparent 62%);
  pointer-events: none; z-index: -1;
}
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin: 28px 0 26px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 13.5px; font-weight: 600; color: var(--text-soft);
  border: 1px solid rgba(195, 242, 127, .2); border-radius: 999px; padding: 6px 12px;
}
.hero-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.stage-caption { color: var(--text-soft); font-size: 14px; margin: 0; min-height: 1.5em; text-align: center; }
.fold-toggle {
  font: inherit; font-weight: 650; font-size: 15px; color: var(--lime); cursor: pointer;
  background: rgba(195, 242, 127, .1); border: 1px solid rgba(195, 242, 127, .3);
  border-radius: 999px; padding: 9px 20px; min-height: 40px;
}
.fold-toggle:hover { background: rgba(195, 242, 127, .18); }
.when-unfolded { display: none; }
.fold-toggle[aria-pressed="true"] .when-folded { display: none; }
.fold-toggle[aria-pressed="true"] .when-unfolded { display: inline; }

/* The animated device. Folded: 5.4" outer display, wide-ish and short. Unfolded: 7.6" near-square. */
.duo {
  --w: 300px; --h: 380px;
  width: var(--w); height: var(--h);
  border-radius: 40px; padding: 10px;
  background: linear-gradient(145deg, #2c3a33, #121a16);
  box-shadow: 0 0 0 1.5px #3c4b43 inset, 0 40px 80px -20px rgba(0, 0, 0, .7), 0 0 120px -30px rgba(195, 242, 127, .25);
  transition: width .9s var(--ease), height .9s var(--ease), border-radius .9s var(--ease), transform .9s var(--ease);
  transform: rotate(-4deg);
}
.duo[data-state="unfolded"] { --w: 460px; --h: 400px; border-radius: 34px; transform: rotate(0deg); }
@media (max-width: 1000px) {
  .duo { --w: 250px; --h: 320px; }
  .duo[data-state="unfolded"] { --w: min(86vw, 400px); --h: min(75vw, 350px); }
}
.duo-screen {
  position: relative; width: 100%; height: 100%; border-radius: 31px; overflow: hidden;
  background: #f4f6ef; display: flex;
  transition: border-radius .9s var(--ease);
}
.duo[data-state="unfolded"] .duo-screen { border-radius: 25px; }
/* Frondhop's side toolbar: a floating glass capsule, vertically centred against the edge */
.duo-bar {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 38px; padding: 5px 0; border-radius: 999px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: #1b1f1d;
  background: rgba(255, 255, 255, .7);
  backdrop-filter: blur(14px) saturate(1.8); -webkit-backdrop-filter: blur(14px) saturate(1.8);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 6px 18px rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .8);
}
.bi { width: 17px; height: 17px; margin: 6.5px 0; display: block; }
.bi-tabs {
  width: 17px; height: 17px; margin: 6.5px 0; border: 1.6px solid currentColor; border-radius: 5px;
  display: grid; place-items: center; font: 700 9.5px/1 ui-rounded, -apple-system, sans-serif;
}
/* Outer display: camera in the top corner. The bar stays centred, clear of it. */
.duo-cam {
  position: absolute; right: 16px; top: 14px; width: 11px; height: 11px; border-radius: 50%; z-index: 3;
  background: #0c0d0c; box-shadow: 0 0 0 2px #262826; transition: opacity .4s;
}
.duo[data-state="unfolded"] .duo-cam { opacity: 0; }
.duo-page { flex: 1; padding: 16px 52px 16px 16px; display: flex; flex-direction: column; gap: 9px; overflow: hidden; }
.pg-hero { height: 32%; border-radius: 12px; background: linear-gradient(135deg, #1e5b3f, #8cc95b); flex-shrink: 0; }
.pg-line { height: 9px; border-radius: 5px; background: #cdd5c8; }
.w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; } .w95 { width: 95%; }
.pg-cols { display: grid; grid-template-columns: 1fr; gap: 9px; margin: 4px 0; transition: all .6s var(--ease); }
.pg-card { height: 34px; border-radius: 8px; background: #dfe6d8; }
.pg-cols .pg-card:nth-child(n+2) { display: none; }
.duo[data-state="unfolded"] .pg-cols { grid-template-columns: repeat(3, 1fr); }
.duo[data-state="unfolded"] .pg-cols .pg-card { display: block; height: 60px; }
/* Inner display in landscape: bar along the vertical edge, crease down the middle */
.duo-hinge {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%);
  background: linear-gradient(transparent, rgba(0, 0, 0, .1) 20%, rgba(0, 0, 0, .1) 80%, transparent);
  opacity: 0; transition: opacity .6s;
}
.duo[data-state="unfolded"] .duo-hinge { opacity: 1; }

/* Band */
.band { border-block: 1px solid rgba(195, 242, 127, .1); background: var(--forest-900); }
.trio {
  max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; padding: 52px var(--pad);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px;
}
.trio p { color: var(--text-soft); margin: 0; }

/* Sections */
.section { padding: clamp(72px, 10vw, 136px) var(--pad); }
.section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section-head { margin-bottom: 52px; }
.section.alt { background: var(--cream); color: var(--ink); }
.section.alt .lede, .section.alt .muted { color: var(--ink-soft); }
.section.alt .eyebrow, .section.alt a { color: var(--sage); }
.section.dark { background: var(--forest-900); }

/* Compare cards */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.compare-card {
  background: linear-gradient(160deg, var(--forest-700), var(--forest-800));
  border: 1px solid rgba(195, 242, 127, .12); border-radius: var(--radius); padding: 32px;
}
.compare-card h3 { font-size: 28px; margin-top: 22px; margin-bottom: 4px; }
.mini { position: relative; border: 2.5px solid var(--lime); border-radius: 14px; }
.mini-folded { width: 78px; height: 98px; }
.mini-unfolded { width: 132px; height: 112px; }
.mini-bar { position: absolute; right: 7px; top: 10px; bottom: 10px; width: 6px; border-radius: 3px; background: rgba(195, 242, 127, .5); }
.mini-cam { position: absolute; right: 7px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.mini-folded .mini-bar { top: 18px; }
.mini-fold { position: absolute; left: 50%; top: 6px; bottom: 6px; border-left: 2px dashed rgba(195, 242, 127, .45); }

.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 28px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .45em; width: 14px; height: 14px;
  background: var(--lime); border-radius: 0 10px 0 10px; opacity: .85;
}
.section.alt .ticks li::before { background: var(--sage); }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 56px; }
.feature { padding: 26px; border-radius: var(--radius); background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .06); }
.feature h3 { font-size: 18px; }
.feature p { color: var(--text-soft); margin: 0; font-size: 15.5px; }
.ficon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; margin-bottom: 18px;
  background: rgba(195, 242, 127, .12); color: var(--lime); font-size: 21px;
}

/* Split + demos */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 84px); align-items: center; }
.split.reverse > :first-child { order: 2; }
.try { font-weight: 650; margin-top: 26px; }
.section.alt .try { color: var(--sage); }
.section:not(.alt) .try { color: var(--lime); }

.demo-shell {
  position: relative; border-radius: 28px; padding: 18px;
  background: #fff; color: var(--ink);
  box-shadow: 0 30px 70px -30px rgba(6, 24, 15, .45), 0 0 0 1px rgba(6, 24, 15, .06);
}
.section:not(.alt) .demo-shell { background: #f4f6ef; }
.demo-page { border-radius: 16px; overflow: hidden; background: #fbfcf8; border: 1px solid #e3e8dd; position: relative; }
.demo-article { padding: 18px 20px 8px; }
.demo-kicker { color: var(--sage); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.demo-title { font-size: 22px; margin-bottom: 10px; }
.demo-text { font-size: 15px; color: #3c4c43; }
.prunable {
  position: relative; cursor: pointer; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: max-height .5s var(--ease), opacity .35s, padding .5s var(--ease), margin .5s var(--ease), outline-color .15s;
  max-height: 120px; overflow: hidden; outline: 3px solid transparent; outline-offset: -3px;
}
.prunable:hover { outline-color: rgba(35, 92, 64, .35); }
.prunable.selected { outline: 3px solid var(--sage); background-image: linear-gradient(rgba(35, 92, 64, .14), rgba(35, 92, 64, .14)); }
.prunable.selected::after {
  content: "✂"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: var(--sage); color: #fff; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px;
}
.prunable.selected b { visibility: hidden; }
.prunable.pruned { max-height: 0; opacity: 0; padding-top: 0 !important; padding-bottom: 0 !important; margin-top: 0 !important; margin-bottom: 0 !important; outline: 0; }
.banner { background: #ffe066; padding: 12px 18px; }
.banner b { background: #1b1b1b; color: #ffe066; padding: 4px 12px; border-radius: 999px; font-size: 12px; }
.promo { background: #e8f0ff; color: #1d3f91; padding: 14px 16px; border-radius: 12px; margin-bottom: 14px; }
.ad { background: repeating-linear-gradient(45deg, #fde2e2, #fde2e2 10px, #fbd3d3 10px, #fbd3d3 20px); color: #a02929; padding: 22px 16px; border-radius: 12px; margin-bottom: 14px; justify-content: center; }
.cookie { background: #1f2a24; color: #e8f1e6; padding: 12px 18px; }
.cookie b { background: #fff; color: #1f2a24; padding: 4px 12px; border-radius: 999px; font-size: 12px; white-space: nowrap; }

.demo-controls { display: flex; align-items: center; gap: 12px; padding: 16px 4px 2px; flex-wrap: wrap; }
.demo-controls > span { flex: 1; font-size: 14.5px; color: var(--ink-soft); font-weight: 550; min-width: 10em; }
.demo-shell .pill { background: var(--sage); color: #fff; }
.demo-shell .ghost { color: var(--sage); }

/* Root & Shed */
.sites { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sites li {
  display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 16px; padding: 12px 12px 12px 14px;
  border: 1px solid #e3e8dd; transition: transform .6s var(--ease), opacity .5s, max-height .6s var(--ease), padding .6s var(--ease), margin .6s, border-color .3s;
  max-height: 90px;
}
.fav { flex: 0 0 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--c); }
.site-name { flex: 1; font-weight: 650; line-height: 1.25; }
.site-name small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 13px; }
.root-btn {
  font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; border-radius: 999px; min-height: 36px;
  padding: 7px 14px; border: 1.5px solid var(--sage); background: transparent; color: var(--sage);
  display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s;
}
.root-btn[aria-pressed="true"] { background: var(--sage); color: #fff; }
.root-btn[aria-pressed="true"]::before { content: ""; width: 10px; height: 10px; background: currentColor; border-radius: 0 8px 0 8px; }
.sites li[data-rooted="true"] { border-color: rgba(35, 92, 64, .45); }
.sites li.shed { transform: translateY(40px) rotate(4deg); opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: -8px; border-width: 0; }
.leaves { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: 28px; }
.leaf {
  position: absolute; top: -20px; width: 16px; height: 16px; background: var(--lime-dim); border-radius: 0 14px 0 14px;
  animation: fall 1.8s var(--ease) forwards;
}
@keyframes fall {
  to { transform: translate(var(--dx), 520px) rotate(var(--r)); opacity: 0; }
}

/* Privacy */
.grid-privacy { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pcard { padding: 28px; border-radius: var(--radius); background: var(--forest-800); border: 1px solid rgba(195, 242, 127, .1); }
.pcard h3 { font-size: 19px; color: var(--lime); }
.pcard p { color: var(--text-soft); margin: 0; font-size: 15.5px; }
.section.dark .center { margin-top: 44px; }

/* FAQ */
.faq { max-width: 820px !important; display: grid; gap: 10px; }
.faq details { background: #fff; border-radius: 18px; padding: 4px 24px; border: 1px solid #e3e8dd; }
.faq summary {
  cursor: pointer; font-weight: 650; font-size: 18px; padding: 16px 0; list-style: none;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 24px; font-weight: 400; color: var(--sage); transition: transform .3s var(--spring); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-soft); padding-bottom: 8px; }

/* Final CTA */
.cta-final { text-align: center; background: radial-gradient(ellipse at 50% 0%, rgba(195, 242, 127, .16), transparent 60%); }
.cta-final img { margin: 0 auto 28px; border-radius: 26px; box-shadow: 0 20px 60px -10px rgba(195, 242, 127, .3); }
.cta-final .lede { margin: 0 auto 28px; }

/* Footer */
.footer {
  display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center;
  padding: 36px var(--pad) calc(36px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(195, 242, 127, .1); background: var(--forest-900);
}
.footer nav { display: flex; gap: 20px; }
.footer nav a { color: var(--text-soft); font-size: 15px; }
.footer p { margin: 0; flex-basis: 100%; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---- Responsive: folded-phone widths (Duo outer display, regular iPhones) ---- */
@media (max-width: 1000px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .grid-privacy { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; text-align: left; padding-top: 36px; }
  .hero-stage { order: -1; }
  .trio, .compare, .split, .grid-privacy, .features { grid-template-columns: 1fr; }
  .trio { gap: 26px; padding-block: 40px; }
  .split.reverse > :first-child { order: 0; }
  .compare-card, .pcard, .feature { padding: 22px; }
  .section-head { margin-bottom: 34px; }
  .features { margin-top: 32px; }
  .demo-shell { padding: 12px; border-radius: 22px; }
}

/* ---- Unfolded / partially folded: viewport segments (fold-aware browsers) ----
   When the inner display is half-folded like a book, put content on each side of the crease. */
@media (horizontal-viewport-segments: 2) {
  .hero, .split, .compare {
    grid-template-columns: env(viewport-segment-width 0 0, 1fr) env(viewport-segment-width 1 0, 1fr);
    column-gap: calc(env(viewport-segment-left 1 0, 0px) - env(viewport-segment-right 0 0, 0px));
  }
}
@media (vertical-viewport-segments: 2) {
  .hero { grid-template-columns: 1fr; min-height: 100vh; align-content: space-between; }
}

/* Motion & contrast preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
@media (prefers-color-scheme: light) {
  /* The site is dark-first; keep it, but soften shadows for light-mode browsers. */
  .duo { box-shadow: 0 0 0 1.5px #3c4b43 inset, 0 40px 80px -24px rgba(0, 0, 0, .55); }
}

/* Policy page */
.doc { max-width: 760px; margin: 0 auto; padding: clamp(48px, 8vw, 96px) var(--pad); }
.doc h1 { font-size: clamp(38px, 6vw, 60px); }
.doc h2 { font-size: 26px; margin-top: 2em; }
.doc p, .doc li { color: var(--text-soft); }
.doc li { margin-bottom: .5em; }
