/* Reference layout adapted from the user-requested Bendy site. See project provenance. */

  :root {
    --ink: #111;
    --muted: #6f6f6f;
    --line: #efefef;
    --bg: #f5f5f5;
    --card: #fff;
  }
  * { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  html.lenis, html.lenis body { height: auto; }
  .lenis.lenis-smooth { scroll-behavior: auto !important; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "InterVariable", system-ui, sans-serif;
    font-feature-settings: "cv11", "ss01";
    font-weight: 500;
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: -0.011em;
    -webkit-font-smoothing: antialiased;
  }
  .stage {
    max-width: 640px;
    margin: 0 auto;
    padding: 128px 24px 64px;
  }
  .topbar {
    position: absolute; left: 32px; top: 28px;
  }
  .brand { display: inline-flex; align-items: center; gap: 12px; }
  .brand .os { color: var(--muted); font-size: 13px; }
  .bend-counter {
    position: fixed; top: 28px; right: 32px; z-index: 20;
    margin: 0; pointer-events: none;
  }
  .counter-total::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #78907b; margin-right: 3px; }
  .bend-counter strong { display: inline-block; font-weight: inherit; font-variant-numeric: tabular-nums; }
  @media (max-width: 900px) { .bend-counter { top: auto; bottom: 16px; right: 16px; } }
  .pill, .bend-counter {
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 12px;
    border-radius: 999px; background: var(--card);
    color: var(--ink); text-decoration: none; font-size: 13px; letter-spacing: -0.01em;
  }
  .bend-counter {
    display: block; padding: 0; overflow: hidden;
    transition: width .34s cubic-bezier(.22, 1, .36, 1), height .34s cubic-bezier(.22, 1, .36, 1);
  }
  .counter-content {
    display: flex; align-items: center; gap: 6px;
    width: max-content; max-width: calc(100vw - 16px);
    min-height: 28px; padding: 5px 12px; line-height: 18px;
    transition: opacity .18s ease, filter .18s ease, transform .24s cubic-bezier(.22, 1, .36, 1);
  }
  .counter-total { white-space: nowrap; }
  .counter-total::before { flex-shrink: 0; }
  .counter-purchase { position: absolute; top: 0; left: 0; opacity: 0; filter: blur(5px); transform: translateY(10px); }
  .bend-counter.is-purchase .counter-total { opacity: 0; filter: blur(5px); transform: translateY(-10px); }
  .bend-counter.is-purchase .counter-purchase { opacity: 1; filter: blur(0); transform: translateY(0); transition-delay: .1s; }
  @media (prefers-reduced-motion: reduce) {
    .bend-counter, .counter-content { transition: none; }
    .counter-content { filter: none !important; transform: none !important; }
  }
  .pill {
    margin-left: 4px;
    transition: transform .15s ease;
  }
  .pill:hover { transform: translateY(-1px); }
  .pill:active { transform: scale(.98); }
  .wordmark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--ink);
    letter-spacing: -0.02em;
  }
  .wordmark svg { width: 20px; height: 20px; }
  .actions { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 80px; }
  .purchase-row { display: flex; align-items: center; gap: 16px; width: min(640px, calc(100vw - 48px)); }
  .purchase-row .button { flex-shrink: 0; white-space: nowrap; }
  .purchase-plus { flex-shrink: 0; color: var(--muted); font-size: 20px; font-weight: 400; }
  .keeby-bonus { display: flex; align-items: center; gap: 12px; max-width: 440px; }
  .keeby-bonus img { width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px; }
  .keeby-bonus strong { color: var(--ink); font-weight: 600; }
  .keeby-copy { display: flex; flex-direction: column; gap: 8px; }
  .note { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: -0.005em; }
  .note a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
  .note a:hover { border-color: var(--ink); }
  .intro { margin-bottom: 32px; }
  .press-feature { margin: 0 0 56px; }
  .press-link {
    display: block; width: 100%;
    border-radius: 4.6% / 7.5%;
    transition: transform .2s ease, opacity .2s ease;
  }
  .press-link img {
    display: block; width: 100%; height: auto;
    border-radius: inherit;
  }
  .press-link:hover { transform: translateY(-2px); opacity: .92; }
  .press-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
  .press-caption-link {
    display: inline-flex; align-items: center; gap: 8px;
    color: inherit; text-decoration: none;
    transition: color .2s ease;
  }
  .press-caption-link svg { flex-shrink: 0; }
  .press-caption-link .press-arrow { transition: transform .2s ease; }
  .press-caption-link:hover, .press-caption-link:focus-visible { color: var(--ink); }
  .press-caption-link:hover .press-arrow, .press-caption-link:focus-visible .press-arrow { transform: translate(2px, -2px); }
  .press-caption-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; border-radius: 3px; }
  @media (prefers-reduced-motion: reduce) {
    .press-link { transition: none; }
    .press-link:hover { transform: none; }
    .press-caption-link, .press-caption-link .press-arrow { transition: none; }
    .press-caption-link:hover .press-arrow, .press-caption-link:focus-visible .press-arrow { transform: none; }
  }
  h1 {
    text-wrap: balance;
    font-size: 40px;
    line-height: 1.1;
    letter-spacing: -0.035em;
    font-weight: 500;
    margin: 0 0 16px;
  }
  .lede {
    font-size: 19px;
    line-height: 1.4;
    letter-spacing: -0.02em;
    color: var(--muted);
    margin: 0;
    max-width: 34ch;
  }
  .button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 6px 0 18px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.015em;
    transition: transform .15s ease, opacity .15s ease;
  }
  .button .amount {
    display: inline-flex; align-items: center;
    height: 28px; padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
  }
  .button:hover { opacity: .88; }
  .button:active { transform: scale(.98); }
  .price { color: var(--muted); letter-spacing: -0.01em; }
  .rail-inner { display: flex; flex-direction: column; gap: 16px; }
  /* Breaks out of the text column so the MacBook reads at near-real scale. */
  .figure {
    width: min(880px, calc(100vw - 48px));
    margin: 0 0 56px 50%;
    transform: translateX(-50%);
    padding: 0;
  }
  .film { margin: -16px 0 48px; padding: 0; }
  /* Wide screens: the phone floats at the right edge and glides from the top
     of the viewport to the bottom as the page scrolls. */
  @media (min-width: 1180px) {
    .film {
      position: fixed;
      right: 40px;
      top: 0;
      width: 240px;
      margin: 0;
      will-change: transform;
      pointer-events: none;
    }
    .film video { width: 100%; }
    .film .caption { display: none; }
  }
  .film video {
    display: block;
    width: min(360px, 100%);
    aspect-ratio: 9 / 16;
    margin: 0 auto;
    border-radius: 24px;
    background: transparent;
    object-fit: cover;
    outline: none;
    /* Keeps the rounded clip crisp so no hairline shows at the edge. */
    transform: translateZ(0);
    -webkit-mask-image: -webkit-radial-gradient(#fff, #000);
  }
  .desk { margin: 0 0 56px; padding: 0; }
  .desk video {
    display: block;
    width: min(760px, 100%);
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    border-radius: 20px;
    object-fit: cover;
    outline: none;
    background: #111;
    box-shadow: 0 24px 48px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.08);
    transform: translateZ(0);
    -webkit-mask-image: -webkit-radial-gradient(#fff, #000);
  }
  .shot { margin: 0 0 56px; padding: 0; }
  .shot img {
    display: block;
    width: min(643px, 100%);
    height: auto;
    margin: 0 auto;
    border-radius: 4.6% / 5%;
    border: 1px solid rgba(0,0,0,.28);
    box-shadow: 0 24px 48px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.08);
  }
  .stack-scroll { display: flex; flex-direction: column; gap: 16px; }
  .card { background: var(--card); border-radius: 20px; }
  .caption {
    margin: 20px auto 0;
    max-width: 44ch;
    text-wrap: balance;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: -0.005em;
  }
  section { padding: 24px 24px 12px; }
  h2 {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 8px;
  }
  dl { margin: 0 -24px; padding: 0; }
  .row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
  }
  .row:last-child { border-bottom: 0; }
  dt { margin: 0; letter-spacing: -0.015em; }
  dd { margin: 0; color: var(--muted); }
  footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
  }
  footer a { color: inherit; text-decoration: none; }
  footer .links { display: flex; gap: 20px; }
  footer a:hover { color: var(--ink); }
  /* MacBook, scaled from the in-app preview with container units so every
     part (bezel, notch, deck) keeps the same ratio at any width. */
  .mac {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    container-type: inline-size;
  }
  .lid {
    position: relative;
    margin: 0 3.81cqw;
    aspect-ratio: 1.54;
    background: #121212;
    border-radius: 4.83cqw 4.83cqw 0 0;
    overflow: hidden;
  }
  .screen {
    position: absolute;
    inset: 1.5cqw 1.5cqw 2.2cqw;
    border-radius: 3.4cqw 3.4cqw 0 0;
    overflow: hidden;
    transform-origin: 50% 100%;
    will-change: transform;
    background: #4c5a70;
    /* The top edge is feathered by a mask the script grows with the bend, so
       the silhouette softens along with the pixels. */
  }
  .art { position: absolute; inset: 0; }
  .art svg { width: 100%; height: 100%; display: block; }
  /* Progressive blur: three copies, each blurred harder and masked to a
     shorter band, so sharpness falls off smoothly toward the top. */
  .art.blurred { opacity: 0; transform: scale(1.03); }
  .art.b1 {
    filter: blur(6px);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 30%, transparent 75%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 30%, transparent 75%);
  }
  .art.b2 {
    filter: blur(16px);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 15%, transparent 52%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 15%, transparent 52%);
  }
  .art.b3 {
    filter: blur(36px);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 6%, transparent 34%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 6%, transparent 34%);
  }
  .shade {
    position: absolute; inset: 0;
    opacity: 0;
    background:
      radial-gradient(120% 60% at 0% 0%, rgba(0,0,0,.55), transparent 60%),
      radial-gradient(120% 60% at 100% 0%, rgba(0,0,0,.55), transparent 60%),
      linear-gradient(to bottom, rgba(0,0,0,.35), transparent 45%);
  }
  .clock {
    position: absolute; left: 0; right: 0; top: 13%;
    text-align: center; color: rgba(255,255,255,.9);
    letter-spacing: -0.04em; line-height: 1;
  }
  .clock small { display: block; font-size: 2.2cqw; letter-spacing: -0.01em; opacity: .85; margin-bottom: .5cqw; }
  .clock b { font-weight: 500; font-size: 12.5cqw; }
  .home {
    position: absolute; left: 50%; bottom: 3.45cqw; width: 20%; height: 1.03cqw;
    transform: translateX(-50%); border-radius: 1cqw; background: rgba(255,255,255,.7);
  }
  .notch {
    /* Hangs from the bottom of the bezel into the screen, like the real one. */
    position: absolute; top: 1.5cqw; left: 50%; width: 22.06cqw; aspect-ratio: 64 / 9;
    transform: translateX(-50%); color: #121212;
  }
  .notch svg { display: block; width: 100%; height: 100%; }
  .deck {
    position: relative;
    height: 3.1cqw;
    background: #858585;
    border-radius: 0 0 1.03cqw 1.03cqw;
  }
  .lip {
    position: absolute; top: 0; left: 50%; width: 24.8cqw; height: 1.21cqw;
    transform: translateX(-50%); border-radius: 0 0 1.38cqw 1.38cqw; background: rgba(0,0,0,.35);
  }
  @media (prefers-reduced-motion: reduce) {
    .screen { transform: none !important; }
    .art.blurred, .shade { opacity: 0 !important; }
  }
  @media (max-width: 520px) {
    .topbar { left: 24px; top: 24px; }
    .brand { flex-wrap: wrap; gap: 8px 12px; }
    .pill { margin-left: 0; }
    .stage { padding-top: 96px; }
    h1 { font-size: 32px; }
    .lede { font-size: 17px; }
    .purchase-row { flex-direction: column; align-items: flex-start; gap: 16px; }
    .purchase-plus { align-self: flex-start; margin-left: 16px; line-height: 1; }
    .row { grid-template-columns: 1fr; gap: 4px; }
  }

.wordmark img { width:32px;height:32px;object-fit:contain;vertical-align:middle; }
.language {position:fixed;top:26px;right:32px;z-index:30;font:inherit;padding:8px 12px;border:1px solid #ddd;border-radius:9px;color:#555;background:#fff;}
.button[aria-disabled="true"] {opacity:.6;cursor:default;}
.download-link {color:#666;font-size:14px;white-space:nowrap;}
.art img {position:absolute;inset:0;width:100%;height:100%;object-fit:cover;}
.preview-control {display:flex;gap:12px;align-items:center;justify-content:center;margin:16px 0 0;font-size:13px;color:var(--muted);}
.preview-control input{accent-color:#666;width:150px;}
.demo-film video {object-fit:cover;background:#151515;}
.demo-film .caption {display:block;}
.lang-only {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
:focus-visible{outline:3px solid #1879dc;outline-offset:4px;}
@media(max-width:700px){.language{position:absolute;right:24px;top:22px;}.topbar .os{display:none;}.preview-control{flex-wrap:wrap;}footer .links{gap:14px;flex-wrap:wrap;}}
.legal {max-width:700px;margin:60px auto;padding:0 24px;font-size:16px;line-height:1.7;}.legal h1{font-size:38px;line-height:1.15;}.legal h2{font-size:17px;color:#222;margin-top:28px;}.legal p{color:#555;}body>header{padding:24px 32px;}.legal a{color:#155bcc;}

/* Shared demo activity, with gentle cursor following on a mouse only. */
.bend-counter {top:84px;right:32px;width:max-content;max-width:calc(100vw - 32px);height:auto;overflow:visible;font-size:14px;z-index:40;}
.counter-content {min-height:34px;padding:7px 14px;gap:7px;}
.counter-total::before {width:6px;height:6px;margin-right:3px;}
.bend-counter.following {left:0;top:0;right:auto;bottom:auto;will-change:transform;}
.desk {width:min(760px,calc(100vw - 48px));margin-left:50%;transform:translateX(-50%);}
.desk video {border-radius:24px;box-shadow:none;}
.desk .caption {max-width:48ch;margin-left:auto;margin-right:auto;}
@media(max-width:900px),(pointer:coarse){.bend-counter{top:auto;bottom:max(16px,env(safe-area-inset-bottom));right:16px;}}

.document-page{max-width:688px;margin:0 auto;padding:128px 24px 64px;}
.document-page h1{font-size:36px;font-weight:500;letter-spacing:-.035em;margin:0 0 12px;}
.document-meta{font-size:14px;margin:0 0 28px;}
.document-intro{font-size:17px;line-height:1.6;margin-bottom:32px;}
.document-card{background:#fff;border-radius:22px;padding:22px 26px;margin:0 0 18px;}
.document-card h2{font-size:17px;font-weight:600;line-height:1.4;margin:0 0 10px;}
.document-card p{margin:0 0 16px;}
.document-card p:last-child{margin-bottom:0;}
.document-card>a{font-size:14px;}
.document-card details{margin:18px 0;padding:14px 16px;background:var(--bg);border-radius:12px;}
.document-card summary{cursor:pointer;font-size:15px;}
.document-card details p{margin-top:12px;}
.release-heading{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.release-entry .release-heading h2{font-size:24px;font-weight:500;margin:0;}
.release-tag{border-radius:999px;background:var(--bg);padding:4px 10px;font-size:12px;color:var(--muted);}
.release-entry time{display:block;font-size:14px;color:var(--muted);margin:8px 0 18px;}
.release-entry ul{padding-left:20px;margin:0 0 16px;color:var(--muted);}
.release-entry li{margin:8px 0;}
.release-availability{font-size:14px;}
.document-page footer .links{flex-wrap:wrap;gap:12px 20px;}
@media(max-width:520px){.document-page{padding-top:112px;}.document-page h1{font-size:30px;}.document-card{padding:20px;border-radius:18px;}}
@media print{.language,.topbar,footer{display:none;}.document-page{padding:0;}.document-card{break-inside:avoid;border:1px solid #ddd;}}

.seo-faq{padding:22px 24px;}
.seo-faq h2{font-size:18px;line-height:1.4;margin:0 0 12px;}
.seo-faq details{padding:15px 0;border-top:1px solid var(--line);}
.seo-faq summary{cursor:pointer;font-size:15px;line-height:1.5;}
.seo-faq p{color:var(--muted);font-size:15px;line-height:1.65;margin:12px 0 0;}
.language-links{display:flex;gap:14px;flex-wrap:wrap;width:100%;font-size:13px;}
.language-links a{color:var(--muted);}
