:root {
    color-scheme: light;
    --navy: #071a4c;
    --navy-soft: #102a68;
    --blue: #0b47ff;
    --blue-soft: #eaf0ff;
    --ink: #17213b;
    --muted: #5c6880;
    --line: #dce3ef;
    --surface: #f4f7fb;
    --white: #ffffff;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--surface);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--white); }
a { color: inherit; }
button, input { font: inherit; }

.skip-link { position: fixed; top: -80px; left: 1rem; z-index: 100; padding: .75rem 1rem; color: white; background: var(--navy); }
.skip-link:focus { top: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { position: sticky; top: 0; z-index: 20; color: white; background: rgba(7, 26, 76, .97); backdrop-filter: blur(12px); }
.nav-shell { width: min(1180px, calc(100% - 2.5rem)); min-height: 72px; margin: auto; display: flex; align-items: center; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand img { width: 138px; height: auto; display: block; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .95rem; letter-spacing: .08em; }
.brand small { margin-top: 1px; color: #b8c7ef; font-size: .72rem; }
.nav-links { display: flex; gap: 1.5rem; margin-left: auto; }
.nav-links a { color: #d8e1fa; font-size: .9rem; font-weight: 650; text-decoration: none; }
.nav-links a:hover, .nav-links a:focus-visible { color: white; }

.hero { width: min(1180px, calc(100% - 2.5rem)); min-height: 610px; margin: auto; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: clamp(2rem, 7vw, 7rem); align-items: center; padding: 6rem 0; }
.hero-copy { max-width: 760px; }
.eyebrow { margin: 0 0 .85rem; color: var(--blue); font-size: .76rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.light { color: #9db5ff; }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(3.2rem, 7vw, 6.7rem); line-height: .93; letter-spacing: -.06em; }
.hero-lede { max-width: 690px; margin: 1.6rem 0 2rem; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.65; }
.help-search { min-height: 64px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: 0 1rem; background: white; border: 1px solid #b9c5d8; border-radius: 12px; box-shadow: 0 18px 45px rgb(7 26 76 / 12%); }
.help-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgb(11 71 255 / 12%), 0 18px 45px rgb(7 26 76 / 12%); }
.help-search > span { color: var(--blue); font-size: 1.75rem; transform: rotate(-20deg); }
.help-search input { width: 100%; border: 0; outline: 0; color: var(--ink); font-size: 1rem; }
.help-search kbd { padding: .3rem .5rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; font-size: .72rem; }
.search-status { min-height: 1.3rem; margin: .6rem 0 0; color: var(--muted); font-size: .85rem; }
.hero-note { position: relative; padding: 2rem; color: white; background: linear-gradient(150deg, var(--navy), var(--navy-soft)); border-radius: 22px; box-shadow: 0 28px 70px rgb(7 26 76 / 24%); }
.hero-note::after { content: "?"; position: absolute; right: 1.2rem; bottom: -.6rem; color: rgb(255 255 255 / 6%); font-size: 9rem; font-weight: 900; line-height: 1; }
.hero-note .shortcut { display: inline-grid; min-width: 3rem; height: 2.3rem; place-items: center; color: var(--navy); background: white; border-radius: 7px; font-weight: 850; }
.hero-note h2 { margin: 2.5rem 0 .75rem; font-size: 1.55rem; line-height: 1.15; }
.hero-note p { position: relative; z-index: 1; margin: 0; color: #c9d6f4; line-height: 1.6; }

.section { width: min(1180px, calc(100% - 2.5rem)); margin: auto; padding: 6rem 0; }
.section-heading { max-width: 720px; margin-bottom: 2.5rem; }
.section-heading h2, .quick-start h2 { margin: 0; font-size: clamp(2.2rem, 4vw, 3.8rem); line-height: 1.02; letter-spacing: -.045em; }
.section-heading > p:last-child { color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.topic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.topic-card { min-height: 285px; display: flex; flex-direction: column; padding: 1.5rem; text-decoration: none; background: white; border: 1px solid var(--line); border-radius: 16px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.topic-card:hover, .topic-card:focus-visible { transform: translateY(-4px); border-color: #9ab0ef; box-shadow: 0 18px 40px rgb(7 26 76 / 10%); outline: none; }
.topic-card.featured { color: white; background: var(--blue); border-color: var(--blue); }
.topic-card.featured p, .topic-card.featured .topic-number { color: #dce5ff; }
.topic-number { color: var(--blue); font-size: .74rem; font-weight: 850; letter-spacing: .12em; }
.topic-card h3 { margin: auto 0 .7rem; font-size: 1.65rem; }
.topic-card p { margin: 0 0 1.5rem; color: var(--muted); line-height: 1.55; }
.card-link { font-size: .87rem; font-weight: 800; }
.no-results { padding: 2rem; text-align: center; background: var(--surface); border-radius: 14px; }
.no-results p { color: var(--muted); }

.quick-start { padding: 6rem max(1.25rem, calc((100% - 1180px) / 2)); color: white; background: var(--navy); }
.quick-start { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(3rem, 8vw, 8rem); }
.quick-start ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.quick-start li { display: grid; grid-template-columns: 42px 1fr; gap: 1rem; padding: 1.2rem 0; border-top: 1px solid #2d427c; }
.quick-start li > span { display: grid; width: 32px; height: 32px; place-items: center; color: var(--navy); background: #9db5ff; border-radius: 50%; font-weight: 850; }
.quick-start strong { font-size: 1.05rem; }
.quick-start li p { margin: .35rem 0 0; color: #b8c7e8; line-height: 1.5; }

.faq-section { max-width: 900px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { padding: 1.35rem 2rem 1.35rem 0; cursor: pointer; font-size: 1.05rem; font-weight: 750; }
.faq-list details p { max-width: 760px; margin: 0 0 1.5rem; color: var(--muted); line-height: 1.65; }

.site-footer { display: flex; justify-content: space-between; gap: 2rem; padding: 3rem max(1.25rem, calc((100% - 1180px) / 2)); color: #b8c7e8; background: #041236; }
.site-footer strong { color: white; letter-spacing: .08em; }
.site-footer p { margin: .35rem 0 0; font-size: .84rem; }

.guide-shell { width: min(1180px, calc(100% - 2.5rem)); margin: auto; display: grid; grid-template-columns: 240px minmax(0, 760px); gap: clamp(2rem, 7vw, 6rem); align-items: start; padding: 4.5rem 0 7rem; }
.guide-sidebar { position: sticky; top: 105px; }
.guide-nav-title { margin: 0 0 .7rem; color: var(--muted); font-size: .72rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.guide-sidebar nav { display: grid; border-top: 1px solid var(--line); }
.guide-sidebar nav a { padding: .8rem 0; color: var(--ink); border-bottom: 1px solid var(--line); font-size: .9rem; font-weight: 700; text-decoration: none; }
.guide-sidebar nav a:hover, .guide-sidebar nav a:focus-visible { color: var(--blue); }
.offline-reminder { margin-top: 2rem; padding: 1rem; color: var(--navy); background: var(--blue-soft); border-radius: 10px; }
.offline-reminder p { margin: .45rem 0 0; font-size: .82rem; line-height: 1.5; }
.back-link { display: inline-block; margin-bottom: 2.5rem; color: var(--muted); font-size: .86rem; font-weight: 700; text-decoration: none; }
.back-link:hover, .back-link:focus-visible { color: var(--blue); }
.guide-article h1 { max-width: 720px; margin: 0; font-size: clamp(2.8rem, 6vw, 5rem); line-height: .95; letter-spacing: -.055em; }
.guide-lede { margin: 1.4rem 0 3rem; color: var(--muted); font-size: 1.16rem; line-height: 1.65; }
.guide-article section { margin-top: 3.5rem; }
.guide-article h2 { margin: 0 0 1.35rem; font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.025em; }
.guide-article section > p { color: var(--muted); line-height: 1.7; }
.instruction-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.instruction-list li { display: grid; grid-template-columns: 44px 1fr; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.instruction-list li > span { display: grid; width: 34px; height: 34px; place-items: center; color: white; background: var(--blue); border-radius: 50%; font-size: .82rem; font-weight: 850; }
.instruction-list strong { font-size: 1rem; }
.instruction-list p { margin: .35rem 0 0; color: var(--muted); line-height: 1.55; }
.instruction-list.compact { margin-top: 2rem; }
.callout { margin: 2.5rem 0; padding: 1.25rem 1.4rem; border-left: 4px solid; border-radius: 0 10px 10px 0; }
.callout p { margin: .45rem 0 0; line-height: 1.6; }
.callout.info { color: #153268; background: #eef4ff; border-color: var(--blue); }
.callout.warning { color: #713b0c; background: #fff8e7; border-color: #e29a19; }
.definition-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: 1.5rem; }
.definition-grid > div { padding: 1.15rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.definition-grid p { margin: .45rem 0 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.movement-types { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 900px) {
    .hero, .quick-start { grid-template-columns: 1fr; }
    .hero { min-height: auto; padding: 4.5rem 0; }
    .hero-note { max-width: 520px; }
    .topic-grid { grid-template-columns: repeat(2, 1fr); }
    .guide-shell { grid-template-columns: 1fr; }
    .guide-sidebar { position: static; }
    .guide-sidebar nav { grid-template-columns: repeat(4, 1fr); gap: .5rem; border: 0; }
    .guide-sidebar nav a { padding: .65rem; text-align: center; background: var(--surface); border: 0; border-radius: 8px; }
    .offline-reminder { display: none; }
}

@media (max-width: 620px) {
    .nav-links { display: none; }
    .hero h1 { font-size: clamp(3rem, 16vw, 4.7rem); }
    .topic-grid { grid-template-columns: 1fr; }
    .topic-card { min-height: 230px; }
    .site-footer { flex-direction: column; }
    .help-search kbd { display: none; }
    .guide-sidebar nav, .definition-grid, .movement-types { grid-template-columns: 1fr 1fr; }
}

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