:root {
  --bg: #f7f6f1;
  --bg-grid: rgba(20,21,25,.055);
  --surface: #ffffff;
  --surface-2: #efeee9;
  --ink: #17181d;
  --muted: #70717a;
  --line: rgba(23,24,29,.13);
  --accent: #c9ff43;
  --gold: #ffbe42;
  --teal: #0d6f75;
  --danger: #e74d55;
  --success: #1ba66a;
  --shadow: 0 24px 72px rgba(23,24,29,.12);
  --shadow-soft: 0 12px 34px rgba(23,24,29,.08);
  --radius-xl: 34px;
  --radius-lg: 25px;
  --radius-md: 18px;
  --page: min(1180px, calc(100vw - 40px));
  --header-h: 76px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0d0f13;
  --bg-grid: rgba(255,255,255,.035);
  --surface: #171a21;
  --surface-2: #20242d;
  --ink: #f6f7f9;
  --muted: #a6abb5;
  --line: rgba(255,255,255,.11);
  --shadow: 0 26px 82px rgba(0,0,0,.38);
  --shadow-soft: 0 14px 40px rgba(0,0,0,.24);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 38px 38px;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.app-view { max-width: 520px; margin-inline: auto; box-shadow: 0 0 0 1px var(--line), 0 0 100px rgba(0,0,0,.15); }
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { color: inherit; }
code { padding: .12em .38em; border-radius: 7px; background: var(--surface-2); }

.skip-link { position: fixed; top: -70px; left: 16px; z-index: 999; padding: 12px 16px; background: var(--accent); color: #111; border-radius: 12px; font-weight: 800; }
.skip-link:focus { top: 14px; }

.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(18px) saturate(145%); }
.header-inner { width: var(--page); height: 100%; margin: 0 auto; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand-mark { width: 43px; height: 43px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: #111; font-weight: 950; letter-spacing: -.08em; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 24%, transparent); }
.brand-copy { line-height: 1; letter-spacing: -.03em; }
.brand-copy strong { display: block; font-size: 18px; }
.brand-copy small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; letter-spacing: .22em; font-weight: 800; }
.desktop-nav { display: flex; align-items: center; gap: 3px; margin-left: 18px; }
.nav-link { padding: 10px 13px; border-radius: 11px; color: var(--muted); font-size: 14px; font-weight: 720; transition: .2s ease; }
.nav-link:hover, .nav-link.active { color: var(--ink); background: var(--surface-2); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.view-switch { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.view-button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 800; cursor: pointer; }
.view-button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }
.icon-button, .install-button { min-height: 44px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; font-weight: 800; }
.icon-button { width: 44px; font-size: 20px; }
.install-button { padding: 0 15px; }
.icon-button:hover, .install-button:hover { transform: translateY(-1px); }

.page { width: var(--page); margin: 0 auto; padding: 42px 0 96px; }
.intro-grid { display: grid; grid-template-columns: .72fr 1.14fr .64fr; gap: 24px; align-items: stretch; min-height: 560px; }
.intro-copy { align-self: center; padding: 30px 0; }
.intro-actions { display: flex; gap: 10px; margin-bottom: 112px; }
.pill { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 19px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 850; letter-spacing: .07em; }
.pill-dark { background: #17181d; color: var(--accent); border-color: #17181d; }
.pill-light { background: color-mix(in srgb, var(--surface) 58%, transparent); }
.eyebrow { margin: 0 0 12px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .25em; }
.intro-copy h1 { margin: 0; font-size: clamp(46px, 5.3vw, 78px); line-height: .94; letter-spacing: -.065em; }
.intro-lead { max-width: 35ch; margin: 24px 0 0; color: var(--muted); font-size: 17px; }

.featured-card { position: relative; min-height: 560px; overflow: hidden; border-radius: 29px; background: #111; color: white; box-shadow: var(--shadow); cursor: pointer; isolation: isolate; transition: transform .24s ease, box-shadow .24s ease; }
.featured-card:hover { transform: translateY(-5px); box-shadow: 0 34px 90px rgba(23,24,29,.2); }
.featured-card:focus-visible { outline: 4px solid var(--accent); outline-offset: 4px; }
.featured-card > img { width: 100%; height: 100%; object-fit: cover; object-position: 55% center; position: absolute; inset: 0; z-index: -2; transform: scale(1.04); }
.featured-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8,9,12,.03) 32%, rgba(8,9,12,.92) 92%); }
.featured-top { display: flex; justify-content: space-between; padding: 22px; }
.premium-badge { padding: 7px 13px; border-radius: 999px; background: var(--gold); color: #2b210b; font-size: 12px; font-weight: 850; }
.read-time { padding: 7px 10px; border-radius: 999px; background: rgba(0,0,0,.36); backdrop-filter: blur(9px); font-size: 12px; font-weight: 800; }
.featured-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 28px 28px; }
.category-chip { display: inline-flex; padding: 7px 12px; border-radius: 999px; background: #ffbd93; color: #2b1609; font-size: 11px; font-weight: 800; }
.featured-bottom h2 { max-width: 17ch; margin: 16px 0 20px; font-size: clamp(25px, 2.4vw, 37px); line-height: 1.02; letter-spacing: -.035em; }
.author-row { display: flex; align-items: center; gap: 11px; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #0f6970; border: 1px solid rgba(255,255,255,.35); }
.author-row strong, .author-row small { display: block; }
.author-row strong { font-size: 13px; }
.author-row small { margin-top: 2px; color: rgba(255,255,255,.66); font-size: 11px; }

.trend-panel { align-self: center; padding: 28px 22px; border-radius: 24px; background: color-mix(in srgb, var(--surface) 74%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow-soft); backdrop-filter: blur(12px); }
.trend-head { display: flex; justify-content: space-between; align-items: end; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.trend-head span { color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .2em; }
.trend-head strong { font-size: 42px; line-height: .8; }
.trend-item { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.trend-item:last-child { border-bottom: 0; padding-bottom: 0; }
.trend-item span { color: var(--muted); font-size: 12px; font-weight: 800; }
.trend-item strong { font-size: 14px; line-height: 1.35; }

.section { padding-top: 96px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.section-heading h2, .video-copy h2, .about-section h2 { margin: 0; font-size: clamp(34px, 4vw, 54px); line-height: 1; letter-spacing: -.055em; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-button { min-height: 40px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 800; cursor: pointer; }
.filter-button.active { background: #17181d; color: white; border-color: #17181d; }
.story-grid { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 22px; }
.story-card { grid-column: span 4; overflow: hidden; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-soft); cursor: pointer; transition: transform .22s ease, box-shadow .22s ease; }
.story-card-wide { grid-column: span 8; display: grid; grid-template-columns: 1.25fr .75fr; }
.story-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.story-card:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; }
.story-media { min-height: 230px; position: relative; overflow: hidden; }
.story-card-wide .story-media { min-height: 360px; }
.story-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.story-card:hover .story-media img { transform: scale(1.035); }
.story-lock, .story-free { position: absolute; top: 15px; left: 15px; padding: 7px 11px; border-radius: 999px; font-size: 11px; font-weight: 850; }
.story-lock { background: var(--gold); color: #2b2109; }
.story-free { background: var(--accent); color: #132008; }
.story-body { padding: 22px; }
.story-card-wide .story-body { display: flex; flex-direction: column; justify-content: flex-end; padding: 30px; }
.story-body p { margin: 0 0 11px; color: var(--muted); font-size: 11px; font-weight: 850; letter-spacing: .16em; }
.story-body h3 { margin: 0 0 24px; font-size: clamp(22px,2.4vw,34px); line-height: 1.08; letter-spacing: -.035em; }
.story-card:not(.story-card-wide) .story-body h3 { font-size: 23px; }
.story-body span { color: var(--muted); font-size: 13px; font-weight: 750; }
.story-card[hidden] { display: none; }

.video-section { display: grid; grid-template-columns: .72fr 1.28fr; gap: 44px; align-items: center; }
.video-copy > p:not(.eyebrow) { color: var(--muted); font-size: 17px; }
.feature-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.feature-list li { position: relative; padding-left: 25px; font-weight: 720; }
.feature-list li::before { content: ""; position: absolute; left: 0; top: .5em; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb,var(--accent) 20%,transparent); }
.video-frame { overflow: hidden; border-radius: 28px; background: #101216; color: white; box-shadow: var(--shadow); }
.video-frame video { width: 100%; aspect-ratio: 16/9; background: #0b0c0f; }
.video-caption { display: flex; justify-content: space-between; padding: 18px 20px; }
.video-caption span { color: #a8adb7; }
.about-section { display: grid; grid-template-columns: .75fr 1.25fr; gap: 60px; align-items: end; margin-top: 96px; padding: 54px; border-radius: 30px; background: #17181d; color: white; }
.about-section p:last-child { margin: 0; color: #c9cbd1; font-size: 17px; }
.about-section code { background: rgba(255,255,255,.12); }

.site-footer { width: var(--page); margin: 0 auto; padding: 36px 0 110px; display: flex; justify-content: space-between; gap: 25px; border-top: 1px solid var(--line); color: var(--muted); }
.site-footer strong, .site-footer span { display: block; }
.site-footer strong { color: var(--ink); }
.site-footer span { margin-top: 6px; }
.site-footer p { margin: 0; }
.mobile-bottom-nav { display: none; }

/* Dialogs */
dialog { padding: 0; border: 0; background: transparent; color: var(--ink); }
dialog::backdrop { background: rgba(10,11,14,.72); backdrop-filter: blur(9px); }
.dialog-shell { position: relative; background: var(--surface); box-shadow: 0 36px 110px rgba(0,0,0,.35); }
.dialog-close { position: absolute; z-index: 3; top: 14px; right: 14px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: color-mix(in srgb,var(--surface) 82%,transparent); color: var(--muted); font-size: 26px; cursor: pointer; backdrop-filter: blur(9px); }
.article-dialog { width: min(920px, calc(100vw - 30px)); max-height: calc(100dvh - 30px); }
.article-shell { border-radius: 30px; overflow: auto; max-height: calc(100dvh - 30px); }
.article-cover { height: 390px; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-content { max-width: 690px; margin: 0 auto; padding: 56px 30px 72px; }
.article-content h2 { margin: 0; font-size: clamp(36px,5vw,62px); line-height: 1; letter-spacing: -.055em; }
.article-meta { display: flex; flex-wrap: wrap; gap: 15px; margin: 20px 0 38px; color: var(--muted); font-size: 13px; font-weight: 700; }
.article-content > p { font-family: Georgia, "Times New Roman", serif; font-size: 20px; line-height: 1.75; }
.paywall-card { margin: 42px 0; padding: 34px 26px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-soft); text-align: center; }
.lock-orb { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 50%; background: #fff4cf; color: var(--gold); font-size: 27px; }
.paywall-card h3 { margin: 0; font-size: 23px; }
.paywall-card p { max-width: 46ch; margin: 9px auto; color: var(--muted); }
.paywall-card > strong { display: block; margin: 10px 0 15px; font-size: 34px; }
.pay-button, .check-payment-button { min-height: 48px; padding: 0 28px; border: 0; border-radius: 999px; background: #17181d; color: white; font-weight: 850; cursor: pointer; }
.premium-content blockquote { margin: 34px 0; padding: 24px 28px; border-left: 5px solid var(--accent); background: var(--surface-2); border-radius: 0 18px 18px 0; font-size: 20px; }
.premium-content video { width: 100%; margin-top: 18px; border-radius: 20px; background: #111; }
.payment-dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.payment-shell { max-height: calc(100dvh - 24px); overflow: auto; border-radius: 29px; padding: 32px; }
.payment-header { text-align: center; }
.payment-header p { margin: 0; font-size: 22px; font-weight: 850; }
.payment-header strong { display: block; margin: 3px 0 14px; font-size: 34px; }
.payment-header span { color: var(--muted); font-size: 14px; }
.qr-card { width: min(270px, 85%); margin: 22px auto 18px; padding: 13px; border-radius: 20px; background: white; box-shadow: var(--shadow-soft); text-align: center; }
.qr-card img { width: 100%; }
.qr-card span { display: block; padding: 8px 4px 2px; color: #60626a; font-size: 11px; font-weight: 750; }
.check-payment-button { width: 100%; min-height: 52px; font-size: 15px; }
.payment-status { min-height: 24px; margin: 12px 0 18px; text-align: center; color: var(--muted); font-size: 13px; }
.payment-status.success { color: var(--success); font-weight: 800; }
.account-card { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px; border-radius: 18px; background: var(--surface-2); }
.account-card div span, .account-card div strong { display: block; }
.account-card div span { color: var(--muted); font-size: 11px; }
.account-card div strong { margin-top: 3px; font-size: 13px; }
.account-card button { grid-column: 1/-1; min-height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 800; }
.bank-title { margin: 22px 0 12px; text-align: center; color: var(--muted); font-size: 13px; }
.bank-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.bank-grid button { min-height: 63px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.bank-grid button:hover, .bank-grid button.selected { border-color: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb,var(--success) 16%,transparent); }
.bank-grid img { max-width: 70px; max-height: 42px; margin: auto; object-fit: contain; }
.demo-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb,var(--gold) 14%,transparent); color: color-mix(in srgb,var(--gold) 55%,var(--ink)); text-align: center; font-size: 12px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 120; max-width: 370px; padding: 14px 18px; border-radius: 15px; background: #17181d; color: white; box-shadow: 0 18px 55px rgba(0,0,0,.3); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1020px) {
  .desktop-nav { display: none; }
  .intro-grid { grid-template-columns: .75fr 1.25fr; }
  .trend-panel { display: none; }
  .story-card { grid-column: span 6; }
  .story-card-wide { grid-column: span 12; }
}

@media (max-width: 720px) {
  :root { --page: min(100% - 28px, 520px); --header-h: 66px; }
  body { background-size: 30px 30px; padding-bottom: 70px; }
  body.app-view { max-width: none; box-shadow: none; }
  .brand-copy strong { font-size: 16px; }
  .brand-copy small { font-size: 8px; }
  .view-switch, .install-button { display: none !important; }
  .page { padding-top: 24px; }
  .intro-grid { display: flex; flex-direction: column; min-height: 0; gap: 20px; }
  .intro-copy { padding: 0; }
  .intro-actions { margin-bottom: 112px; }
  .intro-copy h1 { font-size: 39px; }
  .intro-lead { display: none; }
  .featured-card { min-height: 420px; order: 2; border-radius: 24px; }
  .featured-bottom { padding: 24px 20px 22px; }
  .featured-bottom h2 { font-size: 25px; max-width: 18ch; }
  .section { padding-top: 72px; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading h2, .video-copy h2, .about-section h2 { font-size: 38px; }
  .filter-row { width: 100%; overflow: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter-button { flex: 0 0 auto; }
  .story-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; padding: 0 2px 14px; }
  .story-card, .story-card-wide { flex: 0 0 87%; display: block; scroll-snap-align: start; }
  .story-card-wide .story-media, .story-media { min-height: 245px; }
  .story-card-wide .story-body { padding: 22px; }
  .video-section { grid-template-columns: 1fr; gap: 26px; }
  .video-frame { border-radius: 22px; }
  .about-section { grid-template-columns: 1fr; gap: 20px; margin-top: 72px; padding: 30px 24px; }
  .site-footer { flex-direction: column; padding-bottom: 32px; }
  .mobile-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(68px + env(safe-area-inset-bottom)); padding: 7px max(14px,env(safe-area-inset-left)) env(safe-area-inset-bottom) max(14px,env(safe-area-inset-right)); display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid var(--line); background: color-mix(in srgb,var(--bg) 91%,transparent); backdrop-filter: blur(18px); }
  .mobile-bottom-nav a, .mobile-bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 750; }
  .mobile-bottom-nav span { color: var(--ink); font-size: 19px; }
  .article-cover { height: 260px; }
  .article-content { padding: 40px 20px 58px; }
  .article-content h2 { font-size: 38px; }
  .article-content > p { font-size: 18px; }
  .payment-shell { padding: 28px 18px 24px; }
  .account-card { grid-template-columns: 1fr; }
  .account-card button { grid-column: auto; }
}

@media (max-width: 440px) {
  .header-actions { gap: 5px; }
  .icon-button { width: 40px; min-height: 40px; }
  .brand-mark { width: 39px; height: 39px; }
  .intro-actions { margin-bottom: 92px; }
  .pill { padding: 0 16px; }
  .featured-card { min-height: 405px; }
  .bank-grid { gap: 8px; }
  .bank-grid button { min-height: 58px; }
}

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