/* Study Buddy website — one stylesheet, mobile first, system fonts only. */
:root {
  --cream: #fffaf2;
  --cream-2: #fff1dc;
  --peach: #ffd9a8;
  --sun: #ffc83d;
  --sun-soft: #fff0bd;
  --mint: #ddf2e7;
  --mint-ink: #1f6b47;
  --lilac: #ece2fb;
  --pink: #ffe1ea;
  --primary: #5a3ea8;
  --primary-dark: #3f2a80;
  --ink: #2b2140;
  --muted: #5e546b;
  --line: #e6dccd;
  --white: #fff;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 6px 24px rgba(63, 42, 128, .10);
  --wrap: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; color: var(--ink); background: var(--cream); }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: .6em 1em; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; color: #fff; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .92rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 250, 242, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; padding-top: .55rem; padding-bottom: .55rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand svg { width: 38px; height: 38px; }
.nav { display: flex; flex-wrap: wrap; gap: .1rem .2rem; width: 100%; order: 3; overflow-x: auto; }
.nav a { padding: .45rem .7rem; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.nav a:hover { background: var(--lilac); }
.nav a[aria-current="page"] { background: var(--lilac); color: var(--primary-dark); }
.header-cta { order: 2; }
@media (min-width: 860px) {
  .nav { width: auto; order: 2; }
  .header-cta { order: 3; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .7rem 1.35rem; border-radius: 999px; border: 2px solid transparent; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2; transition: transform .12s ease, background .12s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-sun:hover { background: #ffb800; color: var(--ink); }
.btn-ghost { background: var(--white); color: var(--primary); border-color: var(--primary); }
.btn-ghost:hover { background: var(--lilac); }
.btn-small { min-height: 40px; padding: .45rem 1rem; font-size: .95rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* Sections */
section { padding: 3.5rem 0; }
.section-alt { background: var(--white); }
.section-sun { background: var(--sun-soft); }
.section-mint { background: var(--mint); }
.eyebrow { display: inline-block; font-weight: 800; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); background: var(--lilac); padding: .25rem .75rem; border-radius: 999px; margin-bottom: .8rem; }
.lead { font-size: 1.15rem; color: var(--muted); }
.page-head { padding: 2.5rem 0 1.5rem; position: relative; overflow: hidden; }
.page-head p { max-width: 640px; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 2.25rem 0 3rem; }
.hero .blob { position: absolute; z-index: -1; pointer-events: none; }
.hero .blob-1 { width: 520px; right: -180px; top: -140px; }
.hero .blob-2 { width: 360px; left: -160px; bottom: -120px; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero h1 span { color: var(--primary); }
.hero .lead { max-width: 560px; }
.ticks { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .4rem; }
.ticks li { display: flex; gap: .55rem; align-items: flex-start; }
.ticks li::before { content: ""; flex: 0 0 22px; height: 22px; margin-top: .15rem; border-radius: 50%; background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%231f6b47' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.hero-media { position: relative; justify-self: center; width: 100%; max-width: 380px; }
.video-frame { position: relative; border-radius: 24px; overflow: hidden; background: var(--ink); box-shadow: var(--shadow); aspect-ratio: 9 / 16; max-height: 72vh; margin: 0 auto; }
.video-frame img, .video-frame video { width: 100%; height: 100%; object-fit: cover; }
.video-frame .play { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; }
.video-frame .play svg { width: 30px; height: 30px; margin-left: 4px; }
.video-frame .play:hover { background: #fff; transform: scale(1.05); }
.hero-media .sticker { position: absolute; left: -8px; top: 16px; background: var(--sun); color: var(--ink); font-weight: 800; padding: .45rem .85rem; border-radius: 14px; box-shadow: var(--shadow); transform: rotate(-4deg); font-size: .95rem; }
@media (min-width: 860px) {
  .hero { padding: 4rem 0 4.5rem; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; }
  .hero-media { max-width: none; }
  .hero-media .video-frame { aspect-ratio: 16 / 9; max-height: none; }
}

/* Cards and grids */
.grid { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 640px) and (max-width: 959px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--white); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid #f1e8da; }
.card h3 { margin-top: .75rem; }
.card p:last-child { margin-bottom: 0; }
.icon-bubble { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; }
.icon-bubble svg { width: 34px; height: 34px; }
.bg-lilac { background: var(--lilac); } .bg-mint { background: var(--mint); } .bg-sun { background: var(--sun-soft); } .bg-pink { background: var(--pink); } .bg-peach { background: var(--cream-2); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step-card { position: relative; padding-top: 2.25rem; }
.step-card::before { counter-increment: step; content: counter(step); position: absolute; top: -18px; left: 1.5rem; width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: 1.2rem; display: grid; place-items: center; box-shadow: var(--shadow); }
.step-card svg.illus { width: 100%; max-width: 220px; height: auto; margin: 0 auto .5rem; }

/* Video cards */
.video-cards { display: grid; gap: 1.25rem; grid-auto-flow: column; grid-auto-columns: minmax(230px, 72%); overflow-x: auto; padding: .5rem .25rem 1rem; scroll-snap-type: x mandatory; }
.video-cards > * { scroll-snap-align: start; }
@media (min-width: 860px) { .video-cards { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; } }
.video-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.video-card .video-frame { border-radius: 0; box-shadow: none; max-height: none; }
.video-card .cap { padding: .9rem 1.1rem 1.1rem; }
.video-card .cap h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.video-card .cap p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Pricing */
.plans { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
@media (min-width: 700px) { .plans { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
.plan { position: relative; display: flex; flex-direction: column; background: var(--white); border-radius: var(--radius); padding: 1.6rem 1.5rem; box-shadow: var(--shadow); border: 2px solid #f1e8da; }
.plan.popular { border-color: var(--primary); }
.plan.selected { outline: 4px solid var(--sun); outline-offset: 2px; }
.plan .badge { position: absolute; top: -14px; left: 1.25rem; background: var(--primary); color: #fff; font-size: .8rem; font-weight: 800; padding: .25rem .75rem; border-radius: 999px; }
.plan h3 { margin: 0 0 .25rem; }
.plan .tagline { color: var(--muted); margin-bottom: .75rem; }
.plan .price { font-size: 2.2rem; font-weight: 800; color: var(--primary-dark); line-height: 1.1; }
.plan .per { color: var(--muted); font-weight: 600; margin-bottom: 1rem; }
.plan ul { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .4rem; flex: 1; }
.plan li { padding-left: 1.6rem; position: relative; }
.plan li::before { content: ""; position: absolute; left: 0; top: .4em; width: 16px; height: 16px; border-radius: 50%; background: var(--mint); box-shadow: inset 0 0 0 4px var(--mint), inset 0 0 0 9px var(--mint-ink); }
.plan .btn { width: 100%; }
.skeleton { background: linear-gradient(90deg, #f3ece2 25%, #faf5ee 50%, #f3ece2 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.plan.loading { min-height: 300px; }
.plan.loading .skeleton { height: 1.1rem; margin-bottom: .8rem; }
.plan.loading .skeleton.big { height: 2.4rem; width: 55%; }
.plans-note { margin-top: 1rem; color: var(--muted); font-size: .95rem; }
.notice { background: var(--white); border-radius: var(--radius); padding: 1.5rem; border: 2px dashed var(--primary); text-align: center; }

.test-ribbon { background: repeating-linear-gradient(45deg, #ffe066, #ffe066 14px, #ffd43b 14px, #ffd43b 28px); color: #3a2a00; text-align: center; font-weight: 800; padding: .5rem 1rem; letter-spacing: .03em; }
.test-ribbon[hidden] { display: none; }

/* FAQ */
.faq details { background: var(--white); border-radius: var(--radius-sm); border: 1px solid var(--line); margin-bottom: .75rem; }
.faq summary { cursor: pointer; padding: 1rem 3rem 1rem 1.2rem; font-weight: 700; list-style: none; position: relative; min-height: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--lilac); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 1.2rem 1.1rem; }
.faq details > div > :last-child { margin-bottom: 0; }
.faq h2 { margin-top: 2rem; font-size: 1.4rem; }

/* How-to-use guide */
.guide { list-style: none; padding: 0; margin: 0; counter-reset: g; }
.guide > li { counter-increment: g; display: grid; gap: 1.5rem; align-items: center; padding: 2rem 0; border-bottom: 1px dashed var(--line); }
.guide > li:last-child { border-bottom: 0; }
.guide h2 { font-size: clamp(1.35rem, 4vw, 1.8rem); display: flex; gap: .75rem; align-items: center; }
.guide h2::before { content: counter(g); flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 1.15rem; }
.shots { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.phone { margin: 0; width: 200px; }
.phone img { border-radius: 22px; border: 6px solid var(--ink); background: var(--ink); box-shadow: var(--shadow); width: 100%; }
.phone figcaption { font-size: .88rem; color: var(--muted); text-align: center; margin-top: .5rem; }
.phone.wide { width: 240px; }
.tip { background: var(--sun-soft); border-radius: var(--radius-sm); padding: .8rem 1rem; font-size: .97rem; }
.tip strong { color: var(--ink); }
@media (min-width: 860px) {
  .guide > li { grid-template-columns: 1.1fr 1fr; gap: 3rem; }
  .guide > li:nth-child(even) .guide-text { order: 2; }
}

/* Download */
.download-box { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 860px) { .download-box { grid-template-columns: 1.2fr 1fr; } }
.store-soon { display: inline-flex; align-items: center; gap: .6rem; padding: .6rem 1rem; border-radius: 12px; border: 2px dashed var(--muted); color: var(--muted); font-weight: 700; background: var(--white); }
.store-soon svg { width: 26px; height: 26px; }
.numbered { padding-left: 1.3rem; }
.numbered li { margin-bottom: .55rem; }
.version-line { font-weight: 600; color: var(--muted); min-height: 1.6em; }

/* Legal */
.legal h2 { font-size: 1.35rem; margin-top: 2rem; }
.legal table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: .95rem; background: var(--white); }
.legal th, .legal td { border: 1px solid var(--line); padding: .6rem .7rem; text-align: left; vertical-align: top; }
.legal th { background: var(--lilac); }
.table-scroll { overflow-x: auto; }
.updated { color: var(--muted); font-weight: 600; }

/* Account */
.panel { background: var(--white); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid #f1e8da; margin-bottom: 1.5rem; }
.form { display: grid; gap: .9rem; max-width: 440px; }
.form label { font-weight: 700; display: block; margin-bottom: .3rem; }
.input { width: 100%; min-height: 50px; padding: .65rem .9rem; border-radius: 12px; border: 2px solid #cfc3b2; font: inherit; background: #fff; color: var(--ink); }
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--lilac); }
.input.code { letter-spacing: .4em; font-size: 1.4rem; font-weight: 700; text-align: center; max-width: 260px; }
.error { color: var(--danger); background: var(--danger-bg); border-radius: 10px; padding: .6rem .85rem; font-weight: 600; }
.error:empty, .ok:empty { display: none; }
.ok { color: var(--mint-ink); background: var(--mint); border-radius: 10px; padding: .6rem .85rem; font-weight: 600; }
.linkbtn { background: none; border: 0; padding: .25rem 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; min-height: 32px; }
.linkbtn[disabled] { color: var(--muted); text-decoration: none; cursor: default; }
.status-grid { display: grid; gap: 1rem; }
@media (min-width: 700px) { .status-grid { grid-template-columns: repeat(3, 1fr); } }
.stat { background: var(--cream-2); border-radius: var(--radius-sm); padding: 1rem; }
.stat .label { font-size: .85rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.2rem; font-weight: 800; word-break: break-word; }
.banner { background: var(--sun-soft); border-left: 6px solid var(--sun); border-radius: 12px; padding: .9rem 1rem; margin-top: 1rem; }
.banner strong { display: block; }
.receipts { width: 100%; border-collapse: collapse; font-size: .95rem; }
.receipts th, .receipts td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); text-align: left; }
.receipts th { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pill { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.pill.paid { background: var(--mint); color: var(--mint-ink); }
.pill.created { background: var(--sun-soft); color: #6b4e00; }
.pill.failed { background: var(--danger-bg); color: var(--danger); }
.success-box { text-align: center; padding: 2rem 1.5rem; }
.success-box svg { width: 96px; height: 96px; margin: 0 auto 1rem; }
dialog { border: 0; border-radius: var(--radius); padding: 1.5rem; max-width: 420px; width: calc(100% - 2rem); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(43, 33, 64, .55); }
.signed-in-bar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
[hidden] { display: none !important; }

/* CTA band + footer */
.cta-band { background: var(--primary); color: #fff; border-radius: 28px; padding: 2.25rem 1.5rem; display: grid; gap: 1rem; align-items: center; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; margin: 0; }
.cta-band p { margin: 0; color: #efe9ff; }
@media (min-width: 860px) { .cta-band { grid-template-columns: 1.5fr auto; padding: 2.5rem 3rem; } }
.site-footer { background: var(--ink); color: #e9e3f5; padding: 2.5rem 0 2rem; margin-top: 0; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.site-footer h2 { color: #fff; font-size: 1rem; margin-bottom: .6rem; }
.site-footer .fine { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 2rem; padding-top: 1rem; font-size: .9rem; color: #cfc6e2; }

/* JOB96: the account views swap in after /api calls; reserve the height so the footer does not jump (CLS) */
.account-main{min-height:110vh}
#test-ribbon{position:fixed;left:0;right:0;bottom:0;z-index:50;margin:0}
