:root {
    --bg: #faf5ff;
    --surface: #ffffff;
    --ink: #2e1065;
    --text: #453a63;
    --primary: #7c3aed;
    --primary-dark: #5b21b6;
    --soft: #ede9fe;
    --border: #ddd6fe;
    --on-dark: #ede9fe;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1000px; margin: 0 auto; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 20; }
.skip:focus { left: 8px; }

.nav {
    position: sticky; top: 0; z-index: 5;
    background: rgba(250, 245, 255, 0.85);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--soft);
    padding: 14px 24px;
}
.nav .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.logo { font-size: 26px; font-weight: 800; letter-spacing: -0.04em; color: var(--primary); text-decoration: none; margin-right: auto; }
.links { display: flex; align-items: center; gap: 18px; padding: 6px 0; }
.links a { font-size: 15px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; transition: color 0.15s ease; }
.links a[aria-current="page"] { color: var(--primary); }
.links a.cta { background: var(--primary); color: #fff; padding: 0 18px; border-radius: 999px; transition: background 0.15s ease; }
@media (hover: hover) {
    .links a:hover { color: var(--primary); }
    .links a.cta:hover { background: var(--primary-dark); color: #fff; }
}

.intro { padding: 72px 24px 40px; }
.eyebrow { display: inline-block; background: var(--soft); color: var(--primary-dark); font-size: 15px; font-weight: 700; padding: 8px 16px; border-radius: 999px; margin: 0 0 20px; }
h1 { font-size: clamp(36px, 6.4vw, 56px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); margin: 0 0 20px; max-width: 820px; text-wrap: balance; }
.lead { font-size: 19px; line-height: 1.5; margin: 0; max-width: 680px; text-wrap: pretty; }

.tool { padding: 0 24px 72px; }
#app { min-height: 480px; }

.rules { background: var(--surface); padding: 72px 24px; }
.rules h2 { font-size: clamp(28px, 4.4vw, 40px); line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 32px; }
.rules-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.rule { background: var(--bg); border: 1px solid var(--border); border-radius: 24px; padding: 24px; }
.rule .num { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.rule h3 { font-size: 20px; line-height: 1.3; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.rule p { margin: 0; text-wrap: pretty; }

footer { background: var(--ink); color: var(--on-dark); padding: 56px 24px; }
footer .logo { color: #fff; display: inline-block; margin: 0 0 16px; }
footer .emergency { color: #fff; font-weight: 700; font-size: 15px; margin: 0 0 16px; }
footer .disclaimer { max-width: 720px; margin: 0 0 16px; text-wrap: pretty; }
footer a.more { color: #fff; font-weight: 700; font-size: 15px; text-underline-offset: 3px; }

footer .foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
footer .legal { font-size: 14px; margin: 24px 0 0; padding-top: 20px; border-top: 1px solid rgba(237, 233, 254, 0.25); max-width: 720px; }

.prose { padding: 0 24px 72px; }
.prose .wrap > * { max-width: 720px; }
.prose h2 { font-size: 22px; line-height: 1.3; font-weight: 800; color: var(--ink); margin: 36px 0 10px; }
.prose p, .prose ul { margin: 0 0 14px; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--primary-dark); font-weight: 700; text-underline-offset: 3px; }
.prose .updated { font-size: 14px; color: #6b6385; }
.prose .callout { background: var(--soft); border-radius: 16px; padding: 16px 18px; color: var(--ink); font-weight: 600; }

dialog.gate { border: none; border-radius: 24px; padding: clamp(22px, 5vw, 32px); width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; color: var(--text); font: inherit; box-shadow: 0 24px 64px rgba(46, 16, 101, 0.35); }
dialog.gate::backdrop { background: rgba(46, 16, 101, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog.gate h2 { font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 12px; }
dialog.gate p { margin: 0 0 12px; }
dialog.gate ul { margin: 0 0 14px; padding-left: 20px; }
dialog.gate li { margin-bottom: 8px; }
dialog.gate a { color: var(--primary-dark); font-weight: 700; text-underline-offset: 3px; }
.gate-small { font-size: 14px; }
.gate-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 18px; }
.gate-yes { font: inherit; font-size: 16px; font-weight: 700; min-height: 52px; padding: 0 24px; border: none; border-radius: 999px; background: var(--primary); color: #fff; cursor: pointer; }

.tap { transition: transform 0.12s ease-out, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.tap:active { transform: scale(0.96); }
.fade { animation: fade-in 0.28s ease-out both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .tap, .fade { transition: none; animation: none; }
    .tap:active { transform: none; }
}
