/* PageShelf — marketing site. Palette mirrors the app's ShelfColor tokens (light + Night). */

:root {
  --page: #F4F3FB;
  --surface: #FFFFFF;
  --tint: #EFEDFC;
  --sunken: #E7E4F6;
  --hairline: #E2E0EE;
  --indigo: #2E2C6E;
  --indigo-mid: #454093;
  --indigo-deep: #1B1A4A;
  --violet: #5B4BD8;
  --violet-light: #9A8CF5;
  --violet-soft: #C9C1FB;
  --action: #2C6DE8;
  --ink: #14141B;
  --body: #232333;
  --secondary: #4A4A57;
  --muted: #6E6E7C;
  --success: #3C8C4A;
  --warning: #C98A12;

  --hl-important: #F5C542;
  --hl-definition: #9AD36A;
  --hl-formula: #7FC8F5;
  --hl-doubt: #F58A7F;
  --hl-example: #C9B8F5;

  --shadow-lg: 0 30px 80px -20px rgba(46, 44, 110, .35), 0 12px 30px -12px rgba(46, 44, 110, .25);
  --shadow-md: 0 14px 40px -16px rgba(46, 44, 110, .30);
  --shadow-sm: 0 4px 14px -6px rgba(46, 44, 110, .22);

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", var(--sans);

  --radius: 22px;
  --radius-sm: 14px;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #16153A;
    --surface: #211F52;
    --tint: #262462;
    --sunken: #2C2A66;
    --hairline: #343173;
    --violet: #9A8CF5;
    --violet-light: #B4A9FA;
    --action: #5B8DF0;
    --ink: #F2F1FA;
    --body: #DCDAF0;
    --secondary: #A9A6C8;
    --muted: #8F8CB3;
    --success: #6FCB7E;
    --warning: #F0B84A;
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .6), 0 12px 30px -12px rgba(0, 0, 0, .45);
    --shadow-md: 0 14px 40px -16px rgba(0, 0, 0, .55);
    --shadow-sm: 0 4px 14px -6px rgba(0, 0, 0, .45);
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--body);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 600; letter-spacing: -.015em; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.45rem); line-height: 1.25; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 .8rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  color: var(--violet);
}
.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--secondary); max-width: 38ch; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--page) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--hairline); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 1.2rem/1 var(--serif); color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--secondary); font-size: .95rem; font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; color: var(--ink); cursor: pointer; }
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--page); border-bottom: 1px solid var(--hairline);
    padding: 8px var(--gutter) 18px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; font-size: 1.05rem; }
  .nav-links .btn { margin-top: 8px; justify-content: center; }
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 600 1rem/1 var(--sans); white-space: nowrap;
  border: 0; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--action); color: #fff; box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--action) 80%, transparent); }
.btn-primary:hover { box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--action) 90%, transparent); }
.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline); }
.btn-small { min-height: 38px; padding: 0 16px; font-size: .9rem; }

/* App Store button — becomes a live link when APP_STORE_URL is set in main.js. */
.store-btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 22px 8px 18px; border-radius: 16px;
  background: #0B0B12; color: #fff; box-shadow: var(--shadow-md);
  transition: transform .2s, box-shadow .2s;
}
.store-btn:hover { text-decoration: none; transform: translateY(-2px); }
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn .small { display: block; font-size: .7rem; letter-spacing: .02em; opacity: .8; line-height: 1.2; }
.store-btn .big { display: block; font: 600 1.18rem/1.15 var(--sans); }
.store-btn[aria-disabled="true"] { cursor: default; }
.store-btn[aria-disabled="true"]:hover { transform: none; }
@media (prefers-color-scheme: dark) { .store-btn { background: #fff; color: #0B0B12; } }

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

.hero { position: relative; padding: clamp(40px, 7vw, 90px) 0 clamp(60px, 8vw, 110px); overflow: hidden; isolation: isolate; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(32px, 5vw, 64px); }
.hero-copy { display: grid; gap: 24px; justify-items: start; }
.hero h1 .accent {
  background: linear-gradient(100deg, var(--violet) 10%, var(--action) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.hero-note { font-size: .92rem; color: var(--muted); }

/* Blobs live in a layer that fades out before the hero ends, so there's no hard edge. */
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent); mask-image: linear-gradient(to bottom, #000 60%, transparent); }
.blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .55; animation: drift 18s ease-in-out infinite alternate; pointer-events: none; }
.blob.b1 { width: 520px; height: 520px; background: var(--violet-light); top: -160px; right: -120px; }
.blob.b2 { width: 420px; height: 420px; background: #7FC8F5; bottom: -180px; left: -140px; opacity: .35; animation-duration: 22s; }
.blob.b3 { width: 300px; height: 300px; background: #F5C542; top: 40%; right: 30%; opacity: .18; animation-duration: 26s; }
@media (prefers-color-scheme: dark) { .blob { opacity: .35; } .blob.b3 { opacity: .1; } }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.08); } }

.hero-stage { position: relative; height: clamp(520px, 62vw, 680px); display: grid; place-items: center; }
.hero-stage .phone.front { --w: clamp(240px, 22vw, 300px); z-index: 2; animation: rise 1.1s cubic-bezier(.2, .8, .2, 1) both, bob 7s ease-in-out 1.2s infinite; }
.hero-stage .phone.back { --w: clamp(200px, 18.5vw, 252px); position: absolute; right: 0; top: 13%; transform: rotate(5deg); z-index: 1; animation: rise-back 1.2s .15s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(60px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes rise-back { from { opacity: 0; transform: translate(40px, 60px) rotate(12deg); } to { opacity: 1; transform: rotate(5deg); } }
@keyframes bob { 50% { transform: translateY(-10px); } }

.float-card {
  position: absolute; z-index: 3;
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--hairline); border-radius: 16px;
  padding: 12px 16px; box-shadow: var(--shadow-md);
  font-size: .88rem; line-height: 1.3; color: var(--body);
  animation: pop .7s cubic-bezier(.2, 1.3, .4, 1) both, bob 6s ease-in-out infinite;
}
.float-card strong { display: block; color: var(--ink); font-size: .95rem; }
.float-card .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff; }
.float-card .ic svg { width: 20px; height: 20px; }
.fc-1 { left: -4%; top: 46%; animation-delay: .7s, 1.4s; }
.fc-2 { right: -2%; bottom: 12%; animation-delay: .95s, 2.2s; }
.fc-3 { left: 4%; bottom: 7%; animation-delay: 1.2s, .6s; }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.85); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-copy { justify-items: center; text-align: center; }
  .hero-copy .lede { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .hero-stage { height: 560px; }
  .fc-1 { left: 0; } .fc-2 { right: 0; }
}
@media (max-width: 480px) {
  .hero-stage { height: 500px; }
  .hero-stage .phone.front { --w: 230px; }
  .hero-stage .phone.back { --w: 190px; right: -12%; }
  .float-card { font-size: .8rem; padding: 10px 12px; }
  .float-card .ic { width: 32px; height: 32px; }
  .fc-3 { display: none; }
}

/* ---------- Phone frame ---------- */

/* Every measurement is a fraction of --w, the phone's own width, so the frame keeps iPhone proportions
   at any size: ~3.6% black bezel, a titanium band, concentric corner radii, the Dynamic Island, and side
   buttons. The screen area has the screenshots' exact 1206 × 2622 ratio, so nothing is cropped. */
.phone {
  --w: 280px;
  --bezel: calc(var(--w) * .036);
  --screen-r: calc(var(--w) * .135);
  position: relative; flex: none;
  width: var(--w); padding: var(--bezel);
  border-radius: calc(var(--screen-r) + var(--bezel));
  background: #050508;
  box-shadow:
    inset 0 0 0 calc(var(--w) * .011) #3d3d47,          /* titanium band */
    inset 0 0 0 calc(var(--w) * .014) #1b1b22,          /* its inner edge */
    inset 0 1px 1px calc(var(--w) * .011) rgba(255, 255, 255, .16),
    var(--shadow-lg);
}
/* Action button + volume up/down on the left, side button on the right. */
.phone::before, .phone::after {
  content: ""; position: absolute; width: calc(var(--w) * .012);
  background: linear-gradient(90deg, #26262e, #4a4a55 50%, #26262e);
}
.phone::before {
  left: calc(var(--w) * -.009); top: calc(var(--w) * .40); height: calc(var(--w) * .075);
  border-radius: 2px 0 0 2px;
  box-shadow: 0 calc(var(--w) * .16) 0 0 #3a3a44, 0 calc(var(--w) * .33) 0 0 #3a3a44;
}
.phone::after { right: calc(var(--w) * -.009); top: calc(var(--w) * .56); height: calc(var(--w) * .22); border-radius: 0 2px 2px 0; }
.phone .island {
  position: absolute; z-index: 3; left: 50%; transform: translateX(-50%);
  top: calc(var(--bezel) + var(--w) * .027);
  width: calc(var(--w) * .29); height: calc(var(--w) * .085);
  border-radius: 999px; background: #000;
  box-shadow: inset calc(var(--w) * -.03) 0 calc(var(--w) * .012) -2px rgba(40, 50, 90, .35); /* camera lens hint */
}
.phone picture { display: contents; }
.phone img, .phone .screen {
  display: block; width: 100%; height: auto; aspect-ratio: 1206 / 2622;
  border-radius: var(--screen-r); background: var(--page);
}
.phone .screen { position: relative; overflow: hidden; }

/* ---------- Proof strip ---------- */

.proof { padding: 0 0 20px; }
.proof ul {
  list-style: none; margin: 0; padding: 18px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 34px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.proof li { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); font-size: .96rem; }
.proof svg { width: 20px; height: 20px; color: var(--violet); }
@media (max-width: 640px) { .proof ul { border-radius: var(--radius); } }

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

section { scroll-margin-top: 72px; }
.section { padding: clamp(70px, 10vw, 130px) 0; }
.section-head { display: grid; gap: 16px; justify-items: center; text-align: center; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head .lede { max-width: 56ch; }

.feature { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(32px, 6vw, 90px); }
.feature + .feature { margin-top: clamp(80px, 11vw, 140px); }
.feature.flip .feature-media { order: 2; }
.feature-copy { display: grid; gap: 18px; }
.feature-copy .lede { max-width: 44ch; }
.feature-media { display: grid; place-items: center; position: relative; }
.feature-media .phone { --w: min(290px, 72vw); }
.checks { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 12px; }
.checks li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; color: var(--body); }
.checks li::before {
  content: ""; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%;
  background: var(--tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B4BD8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
}
@media (max-width: 860px) {
  .feature, .feature.flip { grid-template-columns: 1fr; }
  .feature.flip .feature-media { order: 0; }
  .feature-copy { text-align: center; justify-items: center; }
  .checks { text-align: left; }
}

/* Glow behind media */
.glow::before {
  content: ""; position: absolute; inset: 10% 5%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--violet-light) 55%, transparent), transparent);
  filter: blur(30px);
}

/* ---------- Scan demo ---------- */

.scan-demo {
  position: relative; width: min(420px, 100%); aspect-ratio: 4 / 5;
  perspective: 1200px;
}
.paper {
  position: absolute; inset: 6% 10%;
  background: #FFFDF6; border-radius: 6px;
  box-shadow: 0 30px 60px -25px rgba(20, 20, 40, .45);
  padding: 9% 9%; color: #2a2a35;
  transform: rotate(-4deg) skewX(-2deg);
  animation: straighten 6s cubic-bezier(.6, 0, .2, 1) infinite;
  overflow: hidden;
}
.paper h4 { margin: 0 0 6%; font: 600 clamp(.9rem, 2.4vw, 1.15rem)/1.2 "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive; color: #1c2a6b; }
.paper .line { height: 7px; border-radius: 4px; background: #c9cad8; margin: 0 0 7.5%; position: relative; }
.paper .line.w80 { width: 80%; } .paper .line.w60 { width: 60%; } .paper .line.w90 { width: 92%; } .paper .line.w70 { width: 70%; } .paper .line.w50 { width: 50%; }
.paper .line::after { /* recognised-text outline */
  content: ""; position: absolute; inset: -5px -6px; border-radius: 6px;
  border: 2px solid var(--violet); background: color-mix(in srgb, var(--violet-light) 22%, transparent);
  opacity: 0; animation: recognise 6s infinite;
}
.paper .line:nth-of-type(2)::after { animation-delay: .08s; } .paper .line:nth-of-type(3)::after { animation-delay: .16s; }
.paper .line:nth-of-type(4)::after { animation-delay: .24s; } .paper .line:nth-of-type(5)::after { animation-delay: .32s; }
.paper .line:nth-of-type(6)::after { animation-delay: .4s; } .paper .line:nth-of-type(7)::after { animation-delay: .48s; }
.scan-beam {
  position: absolute; left: 4%; right: 4%; height: 70px; top: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--action) 30%, transparent) 70%, var(--action) 96%, transparent);
  border-radius: 8px; opacity: 0;
  animation: beam 6s cubic-bezier(.5, 0, .5, 1) infinite;
}
.corner { position: absolute; width: 34px; height: 34px; border: 4px solid var(--action); z-index: 3; opacity: 0; animation: corners 6s infinite; }
.corner.tl { top: 3%; left: 7%; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.corner.tr { top: 3%; right: 7%; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.corner.bl { bottom: 3%; left: 7%; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.corner.br { bottom: 3%; right: 7%; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.scan-badge {
  position: absolute; right: -2%; bottom: 6%; z-index: 4;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--hairline);
  padding: 10px 14px; border-radius: 999px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-md);
  opacity: 0; animation: badge 6s infinite;
}
.scan-badge .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); }
@keyframes straighten { 0%, 18% { transform: rotate(-4deg) skewX(-2deg) scale(.97); } 30%, 100% { transform: none; } }
@keyframes corners { 0%, 10% { opacity: 0; transform: scale(1.15); } 18%, 30% { opacity: 1; transform: none; } 38%, 100% { opacity: 0; } }
@keyframes beam { 0%, 30% { opacity: 0; top: 0; } 34% { opacity: 1; } 62% { opacity: 1; top: calc(100% - 70px); } 66%, 100% { opacity: 0; top: calc(100% - 70px); } }
@keyframes recognise { 0%, 58% { opacity: 0; } 64%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes badge { 0%, 66% { opacity: 0; transform: translateY(10px); } 72%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- Search typing chip ---------- */

.search-chip {
  position: absolute; left: -6%; top: 16%; z-index: 3;
  display: flex; align-items: center; gap: 10px; min-width: 230px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px;
  padding: 12px 18px; box-shadow: var(--shadow-md); color: var(--ink); font-weight: 500;
}
.search-chip svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search-chip .caret { display: inline-block; width: 2px; height: 1.1em; background: var(--action); margin-left: 1px; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
.results-chip {
  position: absolute; right: -4%; bottom: 18%; z-index: 3;
  background: var(--indigo); color: #fff; border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow-md);
  font-size: .88rem; line-height: 1.35;
}
.results-chip strong { display: block; font: 600 1.4rem/1.1 var(--rounded); }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 480px) { .search-chip { left: 0; min-width: 0; } .results-chip { right: 0; } }

/* ---------- Highlight demo ---------- */

.hl-card {
  width: min(460px, 100%); background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: clamp(22px, 4vw, 34px); box-shadow: var(--shadow-lg);
  font: 1.06rem/1.9 var(--serif); color: var(--body);
}
.hl-card .src { display: block; margin-top: 18px; font: 500 .85rem/1.3 var(--sans); color: var(--muted); }
.hl {
  --c: var(--hl-important);
  background-image: linear-gradient(color-mix(in srgb, var(--c) 70%, transparent), color-mix(in srgb, var(--c) 70%, transparent));
  background-repeat: no-repeat; background-size: 0% 88%; background-position: 0 60%;
  border-radius: 3px; padding: 0 2px;
  transition: background-size .9s cubic-bezier(.6, 0, .2, 1);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hl.on { background-size: 100% 88%; }
@media (prefers-color-scheme: dark) { .hl.on { color: #16153A; transition: background-size .9s cubic-bezier(.6, 0, .2, 1), color .3s .4s; } }
.hl.important { --c: var(--hl-important); } .hl.definition { --c: var(--hl-definition); }
.hl.formula { --c: var(--hl-formula); } .hl.doubt { --c: var(--hl-doubt); } .hl.example { --c: var(--hl-example); }
.roles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.role {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--hairline);
  font-weight: 600; font-size: .88rem; color: var(--ink);
}
.role i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); }

/* ---------- Plan ring ---------- */

.ring-card {
  position: absolute; left: -8%; bottom: 14%; z-index: 3;
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 18px;
  padding: 14px 18px; box-shadow: var(--shadow-md);
}
.ring-card svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.ring-card .track { stroke: var(--sunken); }
.ring-card .bar { stroke: var(--success); stroke-dasharray: 151; stroke-dashoffset: 151; transition: stroke-dashoffset 1.6s cubic-bezier(.3, 0, .2, 1) .3s; }
.in .ring-card .bar { stroke-dashoffset: 48; }
.ring-card strong { display: block; color: var(--ink); font: 600 1.25rem/1.1 var(--rounded); }
.ring-card span { font-size: .85rem; color: var(--success); font-weight: 600; }
@media (max-width: 480px) { .ring-card { left: 0; } }

/* ---------- Bento grid ---------- */

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.tile {
  grid-column: span 2; position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 26px; display: grid; gap: 10px; align-content: start;
  box-shadow: var(--shadow-sm); transition: transform .3s, box-shadow .3s;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.tile.wide { grid-column: span 3; }
.tile.dark { background: linear-gradient(160deg, var(--indigo-mid), var(--indigo) 55%, var(--indigo-deep)); border-color: transparent; color: #DCDAF0; }
.tile.dark h3 { color: #fff; }
.tile .tile-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--tint); color: var(--violet); margin-bottom: 6px; }
.tile.dark .tile-ic { background: rgba(255, 255, 255, .12); color: #fff; }
.tile .tile-ic svg { width: 24px; height: 24px; }
.tile p { color: var(--secondary); font-size: .97rem; }
.tile.dark p { color: #C9C1FB; }
@media (max-width: 960px) { .tile, .tile.wide { grid-column: span 3; } }
@media (max-width: 620px) { .bento { grid-template-columns: 1fr; } .tile, .tile.wide { grid-column: auto; } }

/* revision timeline */
.timeline { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; background: rgba(255, 255, 255, .18); }
.timeline::after { content: ""; position: absolute; left: 6px; top: 50%; height: 2px; width: 0; background: var(--violet-soft); transition: width 2s ease .3s; }
.in .timeline::after { width: calc(100% - 12px); }
.timeline span {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--indigo); border: 2px solid rgba(255, 255, 255, .25);
  font: 600 .8rem/1 var(--rounded); color: #fff;
  transition: background .3s, border-color .3s, transform .3s;
}
.in .timeline span { background: var(--violet); border-color: var(--violet-soft); transform: scale(1.05); }
.in .timeline span:nth-child(1) { transition-delay: .4s; } .in .timeline span:nth-child(2) { transition-delay: .8s; }
.in .timeline span:nth-child(3) { transition-delay: 1.2s; } .in .timeline span:nth-child(4) { transition-delay: 1.6s; }
.in .timeline span:nth-child(5) { transition-delay: 2s; }
.timeline-caption { font-size: .8rem; color: #C9C1FB; margin-top: 8px; text-align: right; }

/* sound wave */
.wave { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin-top: 12px; }
.wave i { width: 5px; border-radius: 3px; background: var(--violet); animation: wave 1.1s ease-in-out infinite; }
.wave i:nth-child(odd) { animation-duration: .9s; }
.wave i:nth-child(3n) { animation-delay: -.3s; } .wave i:nth-child(4n) { animation-delay: -.6s; }
@keyframes wave { 0%, 100% { height: 20%; } 50% { height: 100%; } }

/* paper tones */
.tones { display: flex; gap: 10px; margin-top: 12px; }
.tones i { width: 38px; height: 50px; border-radius: 6px; border: 1px solid var(--hairline); box-shadow: var(--shadow-sm); transition: transform .3s; }
.tile:hover .tones i:nth-child(1) { transform: translateY(-6px) rotate(-4deg); }
.tile:hover .tones i:nth-child(2) { transform: translateY(-9px); }
.tile:hover .tones i:nth-child(3) { transform: translateY(-6px) rotate(4deg); }
.tile:hover .tones i:nth-child(4) { transform: translateY(-3px) rotate(7deg); }

/* small tile visuals */
.split { display: flex; gap: 6px; margin-top: 12px; height: 54px; }
.split i { flex: 1; border-radius: 8px; background: var(--tint); border: 1px solid var(--hairline); position: relative; overflow: hidden; }
.split i::before { content: ""; position: absolute; left: 10px; right: 10px; top: 10px; height: 4px; border-radius: 2px; background: var(--sunken); box-shadow: 0 10px 0 var(--sunken), 0 20px 0 var(--sunken), 0 30px 0 var(--sunken); }
.split b { position: absolute; left: 12px; right: 30%; top: 22px; height: 12px; border-top: 2.5px solid var(--violet); border-radius: 50%; transform: rotate(-4deg); }
.mini-widgets { display: flex; gap: 8px; margin-top: 12px; }
.mini-widgets span { flex: 1; background: var(--tint); border-radius: 12px; padding: 8px 10px; font-size: .72rem; color: var(--secondary); line-height: 1.2; }
.mini-widgets b { display: block; font: 600 1.3rem/1.1 var(--rounded); color: var(--violet); }
.backup-bar { margin-top: 16px; height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.backup-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--violet), var(--action)); transition: width 2.2s cubic-bezier(.3, 0, .2, 1) .4s; }
.in .backup-bar i { width: 100%; }
.lookup { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--tint); font-size: .82rem; color: var(--secondary); line-height: 1.4; }
.lookup b { font-family: var(--serif); color: var(--ink); font-size: .95rem; }

/* ---------- Day / Night compare ---------- */

.compare-wrap { display: grid; justify-items: center; gap: 22px; }
.phone.compare { --w: min(310px, 78vw); }
.compare .screen img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
.compare .screen .night { clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 3px; margin-left: -1.5px;
  background: #fff; box-shadow: 0 0 12px rgba(0, 0, 0, .4); pointer-events: none;
}
.compare .divider::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; transform: translate(-50%, -50%);
  border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E2C6E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l-5 6 5 6M15 6l5 6-5 6'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.compare input[type=range] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 5;
}
.compare-labels { display: flex; gap: 28px; font-weight: 600; color: var(--secondary); font-size: .95rem; }
.compare-labels span { display: inline-flex; align-items: center; gap: 8px; }
.compare-labels svg { width: 18px; height: 18px; }

/* ---------- Privacy band ---------- */

.privacy-band {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, #454093 0%, #2E2C6E 45%, #1B1A4A 100%);
  color: #DCDAF0; border-radius: clamp(24px, 4vw, 40px);
  padding: clamp(44px, 7vw, 86px) clamp(22px, 6vw, 80px);
}
.privacy-band h2 { color: #fff; }
.privacy-band .eyebrow { color: var(--violet-soft); }
.privacy-band .lede { color: #C9C1FB; }
.privacy-band .shield {
  position: absolute; right: -60px; top: -40px; width: 380px; height: 380px; z-index: -1; opacity: .08; color: #fff;
  animation: spin 60s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.privacy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 44px; }
.privacy-grid div { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius-sm); padding: 22px; }
.privacy-grid h3 { color: #fff; font-size: 1.15rem; margin-bottom: 8px; }
.privacy-grid p { color: #C9C1FB; font-size: .95rem; }
.privacy-band .btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); margin-top: 34px; }
@media (max-width: 860px) { .privacy-grid { grid-template-columns: 1fr; } }

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

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 900px; margin-inline: auto; }
.plan { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: clamp(26px, 4vw, 38px); display: grid; gap: 16px; align-content: start; box-shadow: var(--shadow-sm); }
.plan.pro { position: relative; border: 2px solid var(--violet); box-shadow: var(--shadow-lg); }
.plan .tag { justify-self: start; font: 700 .75rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; padding: 7px 12px; border-radius: 999px; background: var(--tint); color: var(--violet); }
.plan.pro .tag { background: var(--violet); color: #fff; }
.plan .price { font: 600 2.2rem/1 var(--serif); color: var(--ink); }
.plan .price small { font: 500 .95rem/1 var(--sans); color: var(--muted); margin-left: 6px; }
.plan .checks li { font-size: .98rem; }
.plan-foot { text-align: center; margin-top: 26px; color: var(--muted); font-size: .92rem; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }

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

.faq { max-width: 780px; margin-inline: auto; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-sm); padding: 0 22px; transition: box-shadow .25s; }
.faq details[open] { box-shadow: var(--shadow-md); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 34px 20px 0; position: relative; font-weight: 600; color: var(--ink); font-size: 1.04rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 0; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 2.5px solid var(--violet); border-bottom: 2.5px solid var(--violet); transform: rotate(45deg); transition: transform .3s;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq details p { padding: 0 0 20px; color: var(--secondary); }

/* ---------- Final CTA + footer ---------- */

.cta { text-align: center; display: grid; justify-items: center; gap: 22px; }
.cta img.big-icon { width: 108px; height: 108px; border-radius: 26px; box-shadow: var(--shadow-lg); animation: bob 6s ease-in-out infinite; }

footer { border-top: 1px solid var(--hairline); padding: 40px 0 50px; margin-top: 40px; font-size: .92rem; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 30px; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 22px; }
footer nav a { color: var(--secondary); }

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

.reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s cubic-bezier(.2, .8, .2, 1), transform .9s cubic-bezier(.2, .8, .2, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .1s; } .reveal.d2 { transition-delay: .2s; } .reveal.d3 { transition-delay: .3s; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Legal pages ---------- */

.legal-hero { padding: clamp(50px, 8vw, 90px) 0 30px; text-align: center; }
.legal-hero p { color: var(--muted); margin-top: 14px; }
.legal { max-width: 780px; margin-inline: auto; padding-bottom: 60px; }
.legal .summary {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: clamp(22px, 4vw, 32px); box-shadow: var(--shadow-sm); margin-bottom: 40px;
}
.legal .summary h2 { font-size: 1.4rem; margin-bottom: 14px; }
.legal h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); margin: 44px 0 14px; }
.legal h3 { font-size: 1.12rem; margin: 26px 0 8px; }
.legal p, .legal li { color: var(--body); }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 1.2em; display: grid; gap: 8px; }
.legal .table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--hairline); border-radius: var(--radius-sm); }
.legal table { width: 100%; border-collapse: collapse; font-size: .93rem; background: var(--surface); min-width: 560px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--hairline); }
.legal th { background: var(--tint); color: var(--ink); font-weight: 600; }
.legal tr:last-child td { border-bottom: 0; }
.legal .toc { display: grid; gap: 6px; padding-left: 1.2em; }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .paper .line::after { opacity: 1; }
  .hl { background-size: 100% 88%; }
}
