:root {
    --navy-950: #050d1b;
    --navy-900: #08162b;
    --navy-850: #0c1c35;
    --navy-800: #112442;
    --gold-500: #c9a65d;
    --gold-300: #ead9ad;
    --text: #f5f7fb;
    --muted: #b8c3d6;
    --border: rgba(234, 217, 173, .18);
    --success: #65d58b;
    --danger: #ff8c86;
    --heading: 'Cinzel', 'Noto Serif JP', serif;
    --japanese: 'Noto Serif JP', serif;
    --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --header-height: 76px;
    --container: 1180px;
    --section-space: clamp(76px, 9vw, 128px);
    --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--navy-900);
    color: var(--text);
    font-family: var(--body);
    line-height: 1.7;
    overflow-x: hidden;
}
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.hidden { display: none !important; }
.container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
.section-anchor { scroll-margin-top: calc(var(--header-height) + 20px); }

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 2000;
    padding: 10px 14px;
    background: var(--text);
    color: var(--navy-950);
    border-radius: 6px;
    transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
    outline: 3px solid var(--gold-300);
    outline-offset: 4px;
}

.scroll-progress {
    position: fixed;
    inset: 0 auto auto 0;
    z-index: 1200;
    width: 0;
    height: 3px;
    background: var(--gold-300);
}

.header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1100;
    height: var(--header-height);
    background: rgba(5, 13, 27, .9);
    border-bottom: 1px solid rgba(234, 217, 173, .1);
    backdrop-filter: blur(16px);
}
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.logo, .footer-brand {
    color: var(--gold-300);
    font: 700 1.4rem/1 var(--heading);
    letter-spacing: .06em;
    text-transform: uppercase;
}
.nav-links { display: flex; align-items: center; gap: 30px; margin: 0; padding: 0; list-style: none; }
.nav-links a { color: #d7dfec; font-size: .94rem; font-weight: 600; }
.nav-links a:hover { color: var(--gold-300); }
.nav-cta {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 8px 18px;
    border: 1px solid var(--gold-500);
    border-radius: 7px;
    color: var(--gold-300) !important;
}
.nav-cta:hover { background: rgba(201, 166, 93, .12); }
.hamburger { display: none; width: 44px; height: 44px; padding: 11px 8px; border: 0; background: transparent; cursor: pointer; }
.hamburger-line { display: block; width: 28px; height: 2px; margin: 5px auto; background: var(--gold-300); transition: transform .25s ease, opacity .25s ease; }
.hamburger.active .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger.active .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hero {
    position: relative;
    min-height: min(880px, 100svh);
    padding-top: var(--header-height);
    display: grid;
    align-items: center;
    overflow: hidden;
    background: radial-gradient(circle at 75% 25%, #18304f 0, transparent 42%), var(--navy-900);
}
#particles-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-content { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .82fr); gap: clamp(48px, 8vw, 112px); align-items: center; padding-block: 72px 60px; }
.hero-text h1 {
    margin: 0 0 24px;
    max-width: 700px;
    font: 600 clamp(3rem, 5.4vw, 5.1rem)/1.24 var(--japanese);
    letter-spacing: -.035em;
}
.hero-text > p:first-of-type { margin: 0 0 28px; max-width: 600px; color: #cbd4e3; font-size: clamp(1.05rem, 1.4vw, 1.22rem); }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 0 0 28px; padding: 0; list-style: none; color: var(--gold-300); font-weight: 700; }
.hero-points li::before { content: '✓'; margin-right: 8px; color: var(--success); }
.app-store-btn { display: inline-block; border-radius: 9px; transition: transform .25s var(--ease), filter .25s ease; }
.app-store-btn:hover { transform: translateY(-3px); filter: brightness(1.08); }
.app-store-btn img { width: 190px; height: auto; }
.primary-download img { width: 210px; }
.hero-note { margin: 14px 0 0 !important; color: var(--muted) !important; font-size: .85rem !important; }
.hero-image { display: flex; justify-content: center; }
.phone-mockup { position: relative; width: min(320px, 100%); aspect-ratio: 471 / 1024; padding: 7px; border: 2px solid rgba(234, 217, 173, .28); border-radius: 42px; background: #02050a; box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 60px rgba(201, 166, 93, .08); }
.phone-mockup::before { content: ''; position: absolute; z-index: 2; top: 8px; left: 50%; width: 42%; height: 26px; transform: translateX(-50%); border-radius: 0 0 16px 16px; background: #02050a; }
.screen-img { width: 100%; height: 100%; object-fit: cover; border-radius: 34px; }

.proof-strip { border-block: 1px solid var(--border); background: var(--navy-950); }
.proof-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.proof-grid div { display: grid; gap: 2px; padding: 27px 24px; text-align: center; border-right: 1px solid var(--border); }
.proof-grid div:last-child { border-right: 0; }
.proof-grid strong { color: var(--gold-300); font: 700 clamp(1.35rem, 2.3vw, 2rem)/1 var(--heading); }
.proof-grid span { color: var(--muted); font-size: .82rem; }

.features, .quiz-section, .gallery-section, .how-it-works, .faq-section { padding-block: var(--section-space); }
.features, .faq-section { background: var(--navy-900); }
.quiz-section, .how-it-works { background: var(--navy-950); }
.gallery-section { background: var(--navy-850); }
.section-label { margin: 0 0 12px; color: var(--gold-500); font: 700 .78rem/1 var(--body); letter-spacing: .18em; text-transform: uppercase; }
.section-title { margin: 0 0 clamp(40px, 5vw, 64px); max-width: 820px; font: 600 clamp(2rem, 4vw, 3.7rem)/1.35 var(--japanese); letter-spacing: -.025em; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.feature-card { min-width: 0; padding: clamp(28px, 4vw, 48px); background: var(--navy-850); }
.feature-index { display: block; margin-bottom: 42px; color: var(--gold-500); font: 700 .78rem/1 var(--heading); letter-spacing: .16em; }
.feature-card h3 { margin: 0 0 16px; font: 600 clamp(1.25rem, 1.8vw, 1.55rem)/1.5 var(--japanese); }
.feature-card p { margin: 0; color: var(--muted); font-size: .96rem; }

.quiz-layout { display: grid; grid-template-columns: minmax(240px, .75fr) minmax(480px, 1.25fr); gap: clamp(48px, 8vw, 110px); align-items: start; }
.quiz-heading { position: sticky; top: calc(var(--header-height) + 36px); }
.quiz-heading .section-title { margin-bottom: 24px; }
.quiz-heading > p:last-child { color: var(--muted); }
.quiz-shell { max-width: 650px; width: 100%; justify-self: end; }
.quiz-progress { margin-bottom: 15px; }
.quiz-progress-text { display: block; margin-bottom: 10px; color: var(--gold-300); font-weight: 700; font-size: .85rem; }
.quiz-progress-bar { height: 5px; overflow: hidden; border-radius: 3px; background: rgba(234, 217, 173, .15); }
.quiz-progress-fill { width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-500), var(--gold-300)); transition: width .3s ease; }
.quiz-card, .quiz-score { min-height: 440px; padding: clamp(26px, 4vw, 44px); border: 1px solid var(--border); border-radius: 18px; background: var(--navy-800); box-shadow: 0 24px 70px rgba(0, 0, 0, .25); }
.category-tag { display: inline-block; margin-bottom: 18px; color: var(--gold-300); font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.quiz-question h3 { margin: 0 0 30px; font: 700 clamp(1.35rem, 2.4vw, 1.8rem)/1.4 var(--body); }
.quiz-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quiz-option { min-height: 58px; padding: 13px 16px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; background: rgba(255, 255, 255, .045); color: var(--text); text-align: left; font-weight: 600; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.quiz-option:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--gold-500); background: rgba(201, 166, 93, .1); }
.quiz-option:disabled { cursor: default; opacity: .72; }
.quiz-option.correct { border-color: var(--success); background: rgba(101, 213, 139, .16); color: #bff4d0; opacity: 1; }
.quiz-option.wrong { border-color: var(--danger); background: rgba(255, 140, 134, .14); color: #ffd0cd; opacity: 1; }
.quiz-explanation { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.quiz-explanation h4 { margin: 0 0 8px; color: var(--success); font-size: 1rem; }
.quiz-explanation h4.incorrect { color: var(--danger); }
.quiz-explanation p { margin: 0; color: #dce4f0; }
.vocab-box { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline; margin-top: 16px; padding: 13px 15px; border-radius: 9px; background: rgba(5, 13, 27, .46); }
.vocab-box span { color: var(--gold-300); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.vocab-box strong { color: var(--text); }
.vocab-box small { color: var(--muted); }
.quiz-next-btn, .quiz-retry-btn { width: 100%; min-height: 52px; margin-top: 22px; border: 1px solid var(--gold-500); border-radius: 9px; background: var(--gold-500); color: var(--navy-950); font-weight: 800; cursor: pointer; }
.quiz-next-btn:hover, .quiz-retry-btn:hover { background: var(--gold-300); }
.quiz-score { display: grid; align-content: center; text-align: center; }
.score-label { margin: 0; color: var(--gold-300); font: 700 .82rem/1 var(--heading); letter-spacing: .12em; text-transform: uppercase; }
.quiz-score h3 { margin: 22px 0; font: 700 clamp(3.2rem, 7vw, 5.4rem)/1 var(--heading); }
.score-message { min-height: 2em; margin: 0; color: var(--muted); }

.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(18px, 3vw, 34px); align-items: start; }
.gallery-item { margin: 0; }
.gallery-item img { width: 100%; border: 2px solid rgba(234, 217, 173, .2); border-radius: clamp(18px, 2.2vw, 28px); box-shadow: 0 24px 60px rgba(0, 0, 0, .32); transition: transform .35s var(--ease), border-color .35s ease; }
.gallery-item:hover img { transform: translateY(-8px); border-color: rgba(234, 217, 173, .5); }
.gallery-item figcaption { display: grid; gap: 3px; margin-top: 18px; }
.gallery-item strong { color: var(--gold-300); font: 600 1rem/1.4 var(--japanese); }
.gallery-item span { color: var(--muted); font-size: .8rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: steps; }
.step { padding: 18px clamp(24px, 4vw, 46px) 24px; border-left: 1px solid var(--border); }
.step:first-child { border-left: 0; padding-left: 0; }
.step-number { display: block; margin-bottom: 48px; color: rgba(234, 217, 173, .42); font: 700 2.8rem/1 var(--heading); }
.step h3 { margin: 0 0 13px; font: 600 1.35rem/1.4 var(--japanese); }
.step p { margin: 0; color: var(--muted); }

.faq-list { max-width: 820px; }
.faq-item { border-top: 1px solid var(--border); }
.faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-item h3 { margin: 0; }
.faq-question { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; min-height: 72px; padding: 20px 0; border: 0; background: transparent; color: var(--text); text-align: left; font-weight: 700; cursor: pointer; }
.faq-question:hover { color: var(--gold-300); }
.faq-icon { flex: 0 0 auto; color: var(--gold-300); font-size: 1.5rem; transition: transform .25s ease; }
.faq-question[aria-expanded='true'] .faq-icon { transform: rotate(45deg); }
.faq-answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
.faq-answer p { min-height: 0; overflow: hidden; margin: 0; color: var(--muted); }
.faq-item.active .faq-answer { grid-template-rows: 1fr; }
.faq-item.active .faq-answer p { padding-bottom: 24px; }

.cta-section { position: relative; padding-block: clamp(90px, 11vw, 150px); text-align: center; background: linear-gradient(rgba(5, 13, 27, .82), rgba(5, 13, 27, .94)), url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?auto=format&fit=crop&w=1800&q=80') center/cover; }
.cta-content { max-width: 820px; }
.cta-content .section-label { color: var(--gold-300); }
.cta-section h2 { margin: 0 0 22px; font: 600 clamp(2.2rem, 4.5vw, 4.2rem)/1.35 var(--japanese); }
.cta-section p:not(.section-label) { margin: 0 auto 30px; max-width: 620px; color: #d0d9e7; }
.cta-section .app-store-btn img { width: 220px; }

.sticky-cta { display: none; }
.footer { padding-block: 42px; border-top: 1px solid var(--border); background: var(--navy-950); text-align: center; }
.footer-brand { margin-bottom: 22px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 28px; }
.footer-links a { color: var(--muted); font-size: .9rem; }
.footer-links a:hover { color: var(--gold-300); }
.copyright { margin: 20px 0 0; color: #91a1b9; font-size: .76rem; }

@media (max-width: 900px) {
    .hero-content { grid-template-columns: 1fr minmax(270px, .65fr); gap: 36px; }
    .hero-text h1 { font-size: clamp(2.7rem, 7vw, 4.2rem); }
    .feature-grid { grid-template-columns: 1fr; }
    .feature-index { margin-bottom: 22px; }
    .quiz-layout { grid-template-columns: 1fr; }
    .quiz-heading { position: static; }
    .quiz-heading .section-title { margin-bottom: 18px; }
    .quiz-shell { justify-self: start; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root { --header-height: 68px; --section-space: 72px; }
    .container { width: min(calc(100% - 32px), var(--container)); }
    .hamburger { display: block; }
    .nav-links { position: fixed; inset: var(--header-height) 0 auto; display: grid; gap: 0; padding: 10px 16px 22px; background: rgba(5, 13, 27, .98); border-bottom: 1px solid var(--border); transform: translateY(-125%); opacity: 0; visibility: hidden; transition: transform .3s var(--ease), opacity .2s ease, visibility .2s; }
    .nav-links.active { transform: translateY(0); opacity: 1; visibility: visible; }
    .nav-links a { display: flex; align-items: center; min-height: 52px; padding-inline: 10px; border-bottom: 1px solid rgba(234, 217, 173, .1); }
    .nav-links li:last-child { margin-top: 12px; }
    .nav-cta { justify-content: center; border-bottom: 1px solid var(--gold-500) !important; }
    .hero { min-height: auto; }
    .hero-content { grid-template-columns: 1fr; gap: 50px; padding-block: 64px 70px; text-align: left; }
    .hero-text h1 { font-size: clamp(2.7rem, 13vw, 4rem); }
    .hero-text > p:first-of-type { font-size: 1rem; }
    .hero-points { display: grid; gap: 5px; }
    .hero-image { justify-content: center; }
    .phone-mockup { width: min(290px, 83vw); }
    .proof-grid { grid-template-columns: repeat(2, 1fr); }
    .proof-grid div:nth-child(2) { border-right: 0; }
    .proof-grid div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
    .section-title { font-size: clamp(2rem, 9vw, 3rem); margin-bottom: 36px; }
    .feature-card { padding: 30px 26px; }
    .quiz-card, .quiz-score { min-height: 0; padding: 26px 20px; }
    .quiz-options { grid-template-columns: 1fr; }
    .vocab-box { grid-template-columns: 1fr; gap: 2px; }
    .gallery-grid { gap: 34px 16px; }
    .gallery-item figcaption { margin-top: 12px; }
    .steps { grid-template-columns: 1fr; }
    .step, .step:first-child { padding: 28px 0; border-left: 0; border-top: 1px solid var(--border); }
    .step-number { margin-bottom: 20px; font-size: 2rem; }
    .sticky-cta { position: fixed; z-index: 1050; inset: auto 10px 10px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 10px 10px 16px; border: 1px solid var(--border); border-radius: 14px; background: rgba(5, 13, 27, .95); box-shadow: 0 14px 40px rgba(0, 0, 0, .45); backdrop-filter: blur(14px); transform: translateY(140%); visibility: hidden; transition: transform .3s var(--ease), visibility .3s; }
    .sticky-cta.visible { transform: translateY(0); visibility: visible; }
    .sticky-cta span { font-size: .82rem; font-weight: 700; }
    .sticky-cta a { flex: 0 0 auto; padding: 9px 13px; border-radius: 8px; background: var(--gold-500); color: var(--navy-950); font-size: .8rem; font-weight: 800; }
    body.has-sticky-cta { padding-bottom: 78px; }
}

@media (max-width: 430px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-item { width: min(300px, 84vw); margin-inline: auto; }
    .hero-note { max-width: 310px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
    #particles-canvas { display: none; }
}
