/* Bifold website. Paper & Ink, built on the app's generated tokens (tokens.css).
   Rules carried over from the app: paper surfaces, ink text and fills, one highlighter
   accent with one job per page, New York for content, SF for UI, SF Rounded for numerals. */

@import url("tokens.css");

:root {
  /* Site-only derived tokens. Everything else comes from tokens.css. */
  --measure: 34rem;                /* body copy line length */
  --content-max: 1180px;
  --gutter: clamp(16px, 5vw, 48px);
  --section: clamp(64px, 12vw, 152px);
  --nav-h: 60px;
  --ease-reveal: cubic-bezier(.2,.7,.2,1);
  --ink-fill: #1B1915;             /* critique #7: a dimmer ink for big fills in dark */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ink-fill: #D8D2C5; --bezel-edge: rgba(243,239,231,0.16); --mark-ink: var(--accent-highlight-ink); }
}
:root[data-theme="dark"] { --ink-fill: #D8D2C5; --bezel-edge: rgba(243,239,231,0.16); --mark-ink: var(--accent-highlight-ink); }
:root { --bezel-edge: transparent; --mark-ink: #1B1915; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--ink-primary);
  font-family: var(--font-sf-pro);
  font-size: 1.0625rem;            /* 17px, the app's body size */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .14em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink-primary); outline-offset: 3px; border-radius: 4px; }
mark {
  /* The highlighter: one job per page. A full band, the way the app marks a source sentence. */
  background: var(--accent-highlight);
  color: var(--mark-ink);
  padding: .04em .14em;
  margin: 0 -.04em;
  border-radius: 2px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
hr { border: 0; border-top: 1px solid var(--line-hair); margin: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--ink-primary); color: var(--ink-on-ink);
  padding: 10px 16px; border-radius: var(--radius-row); font-weight: 600;
}
.skip-link:focus { top: 10px; }

/* ---------- Type ---------- */
h1, h2, h3, .serif {
  font-family: var(--font-new-york);
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.125rem, 7.2vw, 5.25rem); line-height: 1.02; }
h2 { font-size: clamp(2rem, 4.6vw, 3.25rem); line-height: 1.08; }
h3 { font-size: clamp(1.375rem, 2.4vw, 1.75rem); line-height: 1.2; }
h4 { font-family: var(--font-sf-pro); font-size: 1.0625rem; font-weight: 600; margin: 0; }
p { margin: 0; }
p + p { margin-top: 1em; }
.lede {
  font-size: clamp(1.1875rem, 1.3vw + .8rem, 1.4375rem);
  line-height: 1.42;
  color: var(--ink-secondary);
  max-width: var(--measure);
  text-wrap: pretty;
}
.measure { max-width: var(--measure); text-wrap: pretty; }
.eyebrow {
  font-family: var(--type-label-font);
  font-size: .75rem; font-weight: 600;
  letter-spacing: var(--type-label-tracking); text-transform: uppercase;
  color: var(--ink-secondary);
  margin: 0 0 var(--space-4);
}
.numeral { font-family: var(--font-sf-rounded); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.secondary { color: var(--ink-secondary); }
.tertiary { color: var(--ink-tertiary); }
.small { font-size: .9375rem; }
.footnote { font-size: .8125rem; color: var(--ink-secondary); }
.tag {
  /* "(at launch)" and other honesty tags: text, never colour */
  display: inline-block; font-family: var(--font-sf-pro); font-size: .75rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-secondary);
  border: 1px solid var(--line-hair); border-radius: var(--radius-chip);
  padding: 1px 7px; vertical-align: middle; margin-left: .35em; white-space: nowrap;
}

/* ---------- Layout ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--content-max)); margin-inline: auto; }
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * .6); }
.section + .section { padding-top: 0; }
.section-head { max-width: 46rem; margin-bottom: clamp(32px, 6vw, 64px); }
.section-head .lede { margin-top: var(--space-5); }
.grid { display: grid; gap: clamp(20px, 3vw, 40px); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.split {
  display: grid; gap: clamp(28px, 5vw, 72px); align-items: center;
  grid-template-columns: minmax(0, 1fr);
}
.split > *, .pair > *, .grid > * { min-width: 0; }
@media (min-width: 880px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .split--flip > :first-child { order: 2; }
}
.stack > * + * { margin-top: var(--space-4); }
.stack-l > * + * { margin-top: var(--space-6); }

/* ---------- Paper ---------- */
.paper {
  background: var(--surface-paper);
  border: 1px solid var(--line-hair);
  border-radius: var(--radius-card);
  padding: clamp(20px, 3vw, 32px);
}
.paper-raised {
  background: var(--surface-paper-raised);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-paper);
  padding: clamp(20px, 3vw, 32px);
}
.paper h3 + p, .paper-raised h3 + p { margin-top: var(--space-3); }
.paper .eyebrow { margin-bottom: var(--space-3); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--layout-button-height); padding: 0 22px;
  border-radius: var(--radius-row); font: 600 1.0625rem/1 var(--font-sf-pro);
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .12s ease, opacity .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); opacity: .85; }
.btn-ink { background: var(--ink-fill); color: var(--ink-on-ink); }
.btn-paper { background: var(--surface-paper-raised); color: var(--ink-primary); border-color: var(--ink-tertiary); }
.btn-text { background: transparent; color: var(--ink-primary); padding-inline: 6px; text-decoration: underline; text-underline-offset: .18em; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:active { transform: none; } }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface-page) 88%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line-hair);
}
.nav .wrap { display: flex; align-items: center; min-height: var(--nav-h); gap: var(--space-5); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 1.0625rem; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav-links { display: none; list-style: none; margin: 0 0 0 auto; padding: 0; gap: var(--space-6); }
.nav-links a { text-decoration: none; color: var(--ink-secondary); font-size: .9375rem; font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink-primary); }
.nav-cta { display: none; }
.nav-toggle {
  margin-left: auto; width: 44px; height: 44px; border: 0; background: transparent; color: inherit;
  display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-row); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .x { display: none; }
.nav[data-open="true"] .nav-toggle .bars { display: none; }
.nav[data-open="true"] .nav-toggle .x { display: block; }
.nav-sheet {
  display: none; border-top: 1px solid var(--line-hair); padding: var(--space-4) 0 var(--space-6);
}
.nav[data-open="true"] .nav-sheet { display: block; }
.nav-sheet ul { list-style: none; margin: 0; padding: 0; }
.nav-sheet li a { display: block; padding: 12px 0; font-size: 1.125rem; text-decoration: none; border-bottom: 1px solid var(--line-hair); }
.nav-sheet .btn { margin-top: var(--space-5); width: 100%; }
@media (min-width: 880px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; min-height: 40px; padding-inline: 16px; font-size: .9375rem; }
  .nav-toggle, .nav-sheet { display: none !important; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(48px, 9vw, 112px); padding-bottom: clamp(40px, 7vw, 96px); }
.hero .eyebrow { margin-bottom: var(--space-5); }
.hero h1 { max-width: 12ch; }
.hero .lede { margin-top: var(--space-6); }
.hero .btn-row { margin-top: var(--space-7); }
.hero-visual { margin-top: clamp(40px, 7vw, 88px); }
.hero-note { margin-top: var(--space-4); }

/* ---------- Screens and renders ---------- */
.display {
  /* A Duo-style display frame: dark bezel, continuous corners, no fake hardware. */
  background: #0E0D0B;
  border: 1px solid var(--bezel-edge);
  padding: clamp(8px, 1.2vw, 14px);
  border-radius: clamp(20px, 3vw, 34px);
  box-shadow: var(--shadow-card-lift);
  overflow: hidden;
}
.display img { border-radius: clamp(12px, 2vw, 22px); width: 100%; }
.display--phone { max-width: 360px; margin-inline: auto; }
.display--spread { max-width: 960px; margin-inline: auto; }
.display--tall { max-width: 420px; margin-inline: auto; }
.display--spread img { aspect-ratio: 1902 / 1338; object-fit: cover; }
.display--phone img { aspect-ratio: 932 / 1356; object-fit: cover; }
figure { margin: 0; }
figcaption { margin-top: var(--space-3); font-size: .875rem; color: var(--ink-secondary); text-align: center; text-wrap: balance; }

.render-slot {
  /* Where a 3D render goes. Another agent delivers into assets/renders/; until then the
     fallback screen inside shows the real app. Remove .is-placeholder once the render lands. */
  position: relative;
}
.render-slot.is-placeholder::before {
  content: attr(data-label);
  display: block; width: max-content; max-width: 100%;
  margin: 0 auto 10px;
  font: 600 .6875rem/1.3 var(--font-sf-pro); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-secondary); background: var(--surface-paper-raised);
  border: 1px dashed var(--ink-tertiary); border-radius: var(--radius-chip); padding: 6px 8px;
}
.render-slot.is-placeholder > .display { outline: 1px dashed var(--ink-tertiary); outline-offset: 6px; }

/* A pair of phone screens side by side (closed outer display, then open) */
.pair { display: grid; gap: clamp(16px, 3vw, 32px); grid-template-columns: minmax(0, 1fr); align-items: end; }
@media (min-width: 720px) { .pair { grid-template-columns: minmax(0, 1fr) minmax(0, 2.25fr); } }

/* ---------- Feature rows ---------- */
.feature { padding-block: clamp(40px, 7vw, 96px); border-top: 1px solid var(--line-hair); }
.feature:first-of-type { border-top: 0; }
.feature h2, .feature h3 { max-width: 20ch; }
.feature .copy > p { margin-top: var(--space-5); color: var(--ink-secondary); max-width: var(--measure); font-size: 1.125rem; }
.feature .copy > .btn-row { margin-top: var(--space-6); }
.feature ul.plain { margin-top: var(--space-5); }

/* Checklist and plain lists */
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 10px 0; border-bottom: 1px solid var(--line-hair); color: var(--ink-primary); }
ul.plain li:last-child { border-bottom: 0; }
ul.plain li .secondary { display: block; }
ul.checks { list-style: none; margin: 0; padding: 0; }
ul.checks li { position: relative; padding: 6px 0 6px 28px; }
ul.checks li::before {
  content: ""; position: absolute; left: 0; top: 13px; width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 8.5l3.5 3.5 7.5-8'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 8.5l3.5 3.5 7.5-8'/></svg>") center / contain no-repeat;
}
ul.checks li.no::before {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='black' stroke-width='2' stroke-linecap='round' d='M3 8h10'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='black' stroke-width='2' stroke-linecap='round' d='M3 8h10'/></svg>");
  color: var(--ink-tertiary);
}
ul.checks li.no { color: var(--ink-secondary); }

/* ---------- Index card (the AI stream row, rebuilt in HTML) ---------- */
.index-card {
  background: var(--surface-paper-raised); border-radius: var(--radius-card); box-shadow: var(--shadow-paper);
  padding: var(--space-5);
}
.index-card .q { font-family: var(--font-new-york); font-size: 1.375rem; line-height: 1.25; }
.index-card .fold { border-top: 1px solid var(--line-hair); margin: var(--space-4) 0; }
.index-card .a { color: var(--ink-primary); }
.index-card .cite { margin-top: var(--space-3); font-size: .8125rem; color: var(--ink-secondary); }

/* ---------- Stat strip ---------- */
.stats { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.stat { background: var(--surface-paper); border: 1px solid var(--line-hair); border-radius: var(--radius-card); padding: var(--space-5); }
.stat .eyebrow { margin-bottom: var(--space-2); }
.stat .numeral { font-size: 2.5rem; line-height: 1; }
.stat .sub { color: var(--ink-secondary); font-size: .875rem; margin-top: var(--space-2); }

/* ---------- Pricing ---------- */
.plans { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
.plan { background: var(--surface-paper); border: 1px solid var(--line-hair); border-radius: var(--radius-card); padding: clamp(24px, 3vw, 32px); }
.plan--pro { background: var(--surface-paper-raised); box-shadow: var(--shadow-card-lift); border-color: transparent; }
.plan .price { display: flex; align-items: baseline; gap: 6px; margin-top: var(--space-4); }
.plan .price .numeral { font-size: 2.75rem; line-height: 1; }
.plan .price .per { color: var(--ink-secondary); }
.plan .alt { margin-top: var(--space-2); color: var(--ink-secondary); font-size: .9375rem; }
.plan .btn { width: 100%; margin-top: var(--space-6); }
.plan ul.checks { margin-top: var(--space-6); }
.plan .note { margin-top: var(--space-4); font-size: .8125rem; color: var(--ink-secondary); }

.compare { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.compare th, .compare td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line-hair); vertical-align: top; }
.compare th { font-weight: 600; }
.compare thead th { font-family: var(--type-label-font); font-size: .75rem; letter-spacing: var(--type-label-tracking); text-transform: uppercase; color: var(--ink-secondary); }
.compare td:not(:first-child), .compare th:not(:first-child) { text-align: center; width: 22%; }
.compare-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare td .y { font-weight: 600; }
.compare td .n { color: var(--ink-tertiary); }

/* ---------- FAQ ---------- */
.faq details { border-top: 1px solid var(--line-hair); }
.faq details:last-child { border-bottom: 1px solid var(--line-hair); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 44px 18px 0; position: relative;
  font-weight: 600; font-size: 1.0625rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
  transition: transform .2s var(--ease-reveal);
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq .answer { padding: 0 0 20px; color: var(--ink-secondary); max-width: var(--measure); }
.faq .answer p + p { margin-top: .75em; }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }

/* ---------- Prose pages (privacy, press) ---------- */
.prose { max-width: 42rem; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-top: var(--space-9); }
.prose h3 { font-size: 1.25rem; margin-top: var(--space-7); }
.prose p, .prose li { color: var(--ink-primary); }
.prose h2 + p, .prose h3 + p { margin-top: var(--space-3); }
.prose p + p { margin-top: 1em; }
.prose ul, .prose ol { padding-left: 1.25em; margin: var(--space-3) 0 0; }
.prose li + li { margin-top: .4em; }
.notice {
  background: var(--surface-cover); border-radius: var(--radius-row); padding: var(--space-4) var(--space-5);
  font-size: .9375rem;
}
.notice strong { font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: .9375rem; }
.kv dt { color: var(--ink-secondary); }
.kv dd { margin: 0; }
@media (max-width: 480px) { .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 10px; } }

/* ---------- Closing CTA ---------- */
.cta-band { text-align: center; padding-block: var(--section); border-top: 1px solid var(--line-hair); }
.cta-band h2 { margin-inline: auto; }
.cta-band .lede { margin: var(--space-5) auto 0; }
.cta-band .btn-row { justify-content: center; margin-top: var(--space-7); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line-hair); padding: var(--space-8) 0 var(--space-9); font-size: .875rem; color: var(--ink-secondary); }
.footer .cols { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.footer h4 { color: var(--ink-primary); margin-bottom: var(--space-3); font-size: .875rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li + li { margin-top: 8px; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer .legal { margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid var(--line-hair); display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); align-items: center; }
.footer .legal .brand { color: var(--ink-primary); }

/* ---------- Motion ---------- */
.rise { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease-reveal), transform .6s var(--ease-reveal); }
.rise.in { opacity: 1; transform: none; }
.no-js .rise { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rise { transition: opacity .16s ease-in-out; transform: none; }
}

/* ---------- 404 ---------- */
.lost { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: var(--section); }
.lost .numeral { font-size: clamp(5rem, 18vw, 10rem); line-height: 1; color: var(--ink-tertiary); }

/* ---------- Print ---------- */
@media print { .nav, .footer, .cta-band, .btn { display: none !important; } body { background: #fff; } }

/* ---------- Hero, centered (home) ---------- */
.hero--center { text-align: center; }
.hero--center h1 { max-width: none; margin-inline: auto; }
.hero--center .lede { margin-inline: auto; }
.hero--center .btn-row { justify-content: center; }
.hero--center .hero-visual { text-align: left; }
.grid--narrow { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

/* A finished 3D render: no bezel frame, just continuous corners and a soft lift. */
.render img { border-radius: clamp(16px, 2.6vw, 28px); box-shadow: var(--shadow-card-lift); width: 100%; }
