/* MangaLens site — design tokens + components.
   Change the accent in one place: --accent. */
:root {
  --bg: #0A0C10;
  --bg-2: #0D0F14;
  --surface: #12151C;
  --surface-2: #181C25;
  --line: #232938;
  --line-2: #2F3648;
  --text: #EDEFF4;
  --text-2: #BAC2D0;
  --text-3: #9CA5B6;
  --accent: #4C8DFF;
  --accent-ink: #04122B;
  --ok: #4ADE80;
  --warn: #F5A524;
  --err: #FF8A8A;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--text-2); text-decoration: none; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { text-wrap: pretty; margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

/* type */
.h-hero { font-family: var(--display); font-weight: 700; font-size: clamp(38px, 6vw, 68px); line-height: 1.04; letter-spacing: -0.025em; }
.h-page { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 5vw, 56px); line-height: 1.06; letter-spacing: -0.025em; }
.h-section { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.015em; }
.lede { font-size: clamp(17px, 2vw, 20px); line-height: 1.55; color: var(--text-2); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 12px 18px; border-radius: var(--r-md); border: 1px solid transparent; font: 600 15px var(--font); cursor: pointer; transition: transform .12s ease, filter .15s ease, background-color .15s ease, color .15s ease; text-align: center; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn[disabled] { cursor: progress; }
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-primary:hover { color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { color: var(--text); }
.btn-lg { font-size: 18px; padding: 18px 30px; }
.btn-block { width: 100%; }
.link-arrow { font-weight: 600; color: var(--text); padding: 12px 4px; }
.spinner { width: 18px; height: 18px; animation: spin .8s linear infinite; display: none; }
.is-busy .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%,100% { transform: none } 25% { transform: translateX(-4px) } 75% { transform: translateX(4px) } }
@keyframes pulse { 0%,100% { opacity: .55 } 50% { opacity: 1 } }
.pop { animation: pop .25s ease-out; }
.shake { animation: shake .25s ease-in-out 2; }

/* header / nav */
.site-header { border-bottom: 1px solid var(--line); }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 20px; padding: 6px 0; }
.logo:hover { color: var(--text); }
.logo svg { margin-top: 1px; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 15px; font-weight: 500; }
.nav-links a:not(.btn) { padding: 12px; }
.nav-links .btn { margin-left: 8px; }
@media (max-width: 640px) { .nav-links .hide-sm { display: none; } }

/* sections */
.section { padding: 112px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 48px; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; }

/* hero */
.hero { padding: 96px 0 48px; }
.hero .lede { max-width: 640px; margin-top: 24px; }
.hero h1 { max-width: 920px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 24px; margin-top: 40px; }
.cta-note { margin-top: 16px; font-size: 14px; color: var(--text-3); }

/* product demo */
.demo { padding-bottom: 112px; }
.demo-frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 8px; }
.demo-window { background: var(--bg); border: 1px solid var(--line); border-radius: calc(var(--r-xl) - 8px); overflow: hidden; }
.demo-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.demo-url { flex: 1; background: var(--surface); border-radius: var(--r-sm); padding: 8px 12px; font-size: 13px; }
.demo-body { display: flex; flex-wrap: wrap; }
.demo-stage { flex: 999 1 520px; min-width: 0; padding: 32px 24px; display: flex; justify-content: center; background: #0E1016; }
/* DEMO SHAPE: aspect-ratio below must match your demo images' width / height */
.compare { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1000 / 1436; border-radius: 4px; overflow: hidden; user-select: none; background: #F3F0E8; touch-action: pan-y; }
.compare > .layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; z-index: 0; isolation: isolate; }
.compare > .after { z-index: 1; }
.compare .handle, .compare .tag, .compare .scan { z-index: 2; }
.compare input[type=range] { z-index: 3; }
.compare .after { clip-path: inset(0 0 0 var(--split, 50%)); transition: clip-path .35s ease; }
.compare.dragging .after { transition: none; }
.compare.hide-after .after { clip-path: inset(0 0 0 100%); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; transition: opacity .2s; }
.compare .handle span { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.compare.hide-after .handle, .compare.hide-after .tag { opacity: 0; }
.compare .tag { position: absolute; bottom: 12px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(10,12,16,.82); padding: 6px 10px; border-radius: 6px; pointer-events: none; transition: opacity .2s; }
.compare .tag.l { left: 12px; } .compare .tag.r { right: 12px; }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare .scan { position: absolute; left: 0; right: 0; height: 3px; background: var(--accent); box-shadow: 0 0 16px var(--accent); display: none; animation: scan 1.6s ease-in-out infinite alternate; }
.compare.working .scan { display: block; }
@keyframes scan { from { top: 0 } to { top: calc(100% - 3px) } }

/* placeholder comic (replace with your own images — see README) */
.comic { position: absolute; inset: 0; padding: 12px; background: #F3F0E8; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 1.25fr 1fr; gap: 10px; }
.comic > div { border: 3px solid #111; position: relative; overflow: hidden; }
.comic .p1 { grid-column: span 2; background: #E4E0D6; }
.comic .p1::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 52%; background: #CFC9BC; }
.comic .p2 { background: #E9E5DC; } .comic .p3 { background: #DCD7CB; }
.comic .b { position: absolute; z-index: 1; background: #fff; border: 2px solid #111; border-radius: 50%; padding: 16px 20px; color: #111; font-size: 16px; }
.comic .jp { font-family: "Noto Sans JP", sans-serif; font-weight: 700; }
.comic .en { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 15px; }
.comic .sfx { position: absolute; z-index: 1; right: 28px; bottom: 20px; font-size: 44px; font-weight: 700; color: #111; transform: rotate(-8deg); }

.panel-ui { flex: 1 1 300px; background: var(--surface); border-left: 1px solid var(--line); padding: 24px; display: flex; flex-direction: column; gap: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-title { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 17px; }
.switch { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 8px 0; min-height: 44px; cursor: pointer; font: 600 14px var(--font); color: var(--text-2); }
.switch .track { position: relative; width: 40px; height: 24px; border-radius: 12px; background: var(--line-2); transition: background-color .18s; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 9px; background: #fff; transition: left .18s ease; }
.switch[aria-checked=true] .track { background: var(--accent); }
.switch[aria-checked=true] .knob { left: 19px; }
.kv { margin: 0; display: flex; flex-direction: column; gap: 14px; font-size: 15px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; font-weight: 600; }
.progress-block { display: flex; flex-direction: column; gap: 10px; padding-top: 24px; border-top: 1px solid var(--line); }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.meter { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .7s cubic-bezier(.2,.8,.2,1), background-color .3s; }
.meter.thin { height: 6px; }
.panel-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--text-3); }
kbd { font-family: var(--mono); font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 6px; }

/* steps + features */
.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 48px; }
.steps li, .feature { display: flex; flex-direction: column; gap: 12px; }
.step-n { font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--accent); }
.steps h3 { font-size: 20px; }
.steps p, .feature p { font-size: 16px; line-height: 1.6; color: var(--text-2); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 48px; }
.feature h3 { font-size: 22px; }
.minor { margin: 64px 0 0; padding: 32px 0 0; border-top: 1px solid var(--line); list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px 32px; font-size: 15px; color: var(--text-2); }
.minor li { display: flex; gap: 12px; align-items: flex-start; }
.minor svg { flex: none; margin-top: 1px; }
.minor b { color: var(--text); font-weight: 600; }

/* pricing */
.toggle { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; margin-top: 40px; }
.toggle button { font: 600 15px var(--font); color: var(--text-2); background: transparent; border: 0; border-radius: calc(var(--r-md) - 4px); padding: 12px 20px; min-height: 44px; cursor: pointer; transition: background-color .15s, color .15s; }
.toggle button[aria-pressed=true] { background: var(--text); color: var(--accent-ink); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--accent); }
.plan h2, .plan h3 { font-size: 20px; }
.plan .desc { margin-top: 8px; font-size: 15px; color: var(--text-2); }
.price { margin-top: 28px; font-family: var(--display); font-size: 52px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.price .cur { font-size: 26px; vertical-align: 18px; margin-right: 2px; }
.price .per { font-family: var(--font); font-size: 15px; font-weight: 500; color: var(--text-3); }
.price-note { margin-top: 10px; font-size: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.plan .btn { margin-top: 28px; }
.ticks { margin: 32px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; font-size: 15px; color: var(--text-2); }
.ticks li { display: flex; gap: 10px; }
.ticks svg { flex: none; }
.ticks b { color: var(--text); font-weight: 600; }
.plan-mini .price { font-size: 36px; margin-top: 16px; }
.plan-mini .price .cur { font-size: 20px; vertical-align: 10px; }
.table-box { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { padding: 14px 20px; text-align: left; }
thead tr { background: var(--surface); }
tbody tr { border-top: 1px solid var(--line); }
tbody th { font-weight: 500; color: var(--text-2); }
.compare-table { min-width: 620px; }
.compare-table td.no { color: var(--text-3); }

/* faq */
.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq summary { font-size: 17px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.faq details p { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--text-2); }
.faq-list { border-top: 1px solid var(--line); margin-top: 32px; }

/* cta box */
.cta-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 72px 32px; gap: 16px; }
.cta-box .btn { margin-top: 16px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 16px; padding-bottom: 16px; font-size: 14px; color: var(--text-3); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.foot nav a { padding: 12px 8px; }

/* auth */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; padding: 24px 24px 64px; }
.auth-center { flex-grow: 1; display: flex; align-items: center; justify-content: center; padding-top: 48px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 32px; }
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; }
.tabs button { font: 600 15px var(--font); color: var(--text-2); background: transparent; border: 0; border-radius: calc(var(--r-md) - 4px); padding: 12px; min-height: 44px; cursor: pointer; transition: background-color .15s, color .15s; }
.tabs button[aria-selected=true] { background: var(--text); color: var(--accent-ink); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.input { font: 400 16px var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 14px; min-height: 48px; width: 100%; }
.input::placeholder { color: #7F889A; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.input[aria-invalid=true] { border-color: var(--err); }
.err { font-size: 14px; color: var(--err); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.divider { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-3); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-side { flex: 1 1 420px; background: var(--surface); border-left: 1px solid var(--line); padding: 64px 48px; display: flex; flex-direction: column; justify-content: center; gap: 32px; }
.auth-side ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; font-size: 16px; color: var(--text-2); }
.auth-side li { display: flex; gap: 12px; align-items: flex-start; }
.auth-side svg { flex: none; margin-top: 2px; }
.success-icon { width: 48px; height: 48px; border-radius: 24px; background: rgba(74,222,128,.14); display: flex; align-items: center; justify-content: center; }
[hidden] { display: none !important; }

/* account */
.app { display: flex; flex-wrap: wrap; max-width: 1280px; margin: 0 auto; }
.side-nav { flex: 1 1 220px; padding: 32px 16px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); font-weight: 500; }
.side-nav a[aria-current=page] { background: var(--surface); color: var(--text); font-weight: 600; }
.side-nav a[aria-current=page] svg { stroke: var(--accent); }
.app-main { flex: 999 1 560px; min-width: 0; padding: 32px 24px 80px; display: flex; flex-direction: column; gap: 48px; }
.app-title { font-family: var(--display); font-size: 32px; letter-spacing: -0.015em; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; }
.card h2 { font-size: 18px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--ok); }
.usage { gap: 24px; }
.usage .big { font-family: var(--display); font-size: 22px; color: var(--text); transition: color .3s; }
.low .big { color: var(--warn); }
.low .meter > i { background: var(--warn); }
.low-note { font-size: 14px; color: var(--warn); }
.topups { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 4px 0; }
.topups .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.device { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.device + .device { border-top: 1px solid var(--line); }
.device b { display: block; font-size: 15px; }
.device span { font-size: 14px; color: var(--text-3); }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; height: 112px; }
.bars i { display: block; background: var(--accent); border-radius: 4px 4px 0 0; }
.bars i.zero { background: var(--line-2); }
.bar-labels { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; font-size: 12px; color: var(--text-3); text-align: center; }
.skel { background: #1C2130; border-radius: 6px; animation: pulse 1.4s ease-in-out infinite; }
.toast { position: fixed; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 14px 18px; font-size: 15px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.4); }

/* legal */
.legal { max-width: 760px; padding: 72px 24px 112px; margin: 0 auto; }
.legal h1 { font-family: var(--display); font-size: 40px; margin-bottom: 8px; }
.legal h2 { font-size: 20px; margin: 40px 0 12px; }
.legal p, .legal li { color: var(--text-2); line-height: 1.7; }
.legal p + p { margin-top: 12px; }
.draft { margin-top: 24px; padding: 16px 18px; border: 1px solid var(--warn); border-radius: var(--r-md); color: var(--text); background: rgba(245,165,36,.08); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
