/* ─── Design Tokens ────────────────────────────────────────────────────── */
:root {
    --primary:        #C0392B;   /* Japanese red */
    --primary-dark:   #96281B;
    --ink:            #1A1A1A;   /* near-black text */
    --ink-light:      #555555;
    --paper:          #FAFAF8;   /* warm off-white */
    --paper-mid:      #F2F0EC;
    --border:         #E8E4DC;
    --white:          #FFFFFF;
    --gradient-hero:  linear-gradient(135deg, #1A1A2E 0%, #2D1B1B 60%, #3D1515 100%);
    --spacing:        8px;
    --radius-sm:      8px;
    --radius-md:      16px;
    --radius-lg:      24px;
    --shadow-sm:      0 2px 8px rgba(0,0,0,0.08);
    --shadow-md:      0 8px 32px rgba(0,0,0,0.12);
    --shadow-lg:      0 20px 60px rgba(0,0,0,0.18);
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 calc(var(--spacing) * 3);
}

/* ─── Navigation ─────────────────────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(250, 250, 248, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-kanji {
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 700;
    line-height: 1;
}

.logo-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--ink-light);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--primary); }

.nav-cta {
    background: var(--primary) !important;
    color: var(--white) !important;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 600 !important;
    transition: background 0.2s, transform 0.2s !important;
}

.nav-cta:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px);
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--spacing) * 12) 0 calc(var(--spacing) * 8);
    background: var(--gradient-hero);
    color: var(--white);
    overflow: hidden;
    position: relative;
}

.hero-bg-kanji {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    pointer-events: none;
    overflow: hidden;
}

.hero-bg-kanji span {
    font-size: clamp(6rem, 12vw, 14rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.03);
    user-select: none;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: rgba(192, 57, 43, 0.8);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.15);
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.7;
    margin-bottom: 1.25rem;
    font-style: italic;
}

.hero-description {
    font-size: 1.05rem;
    line-height: 1.7;
    opacity: 0.8;
    max-width: 480px;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.hero-tagline {
    font-size: 0.85rem;
    opacity: 0.5;
    letter-spacing: 0.05em;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.btn-primary {
    background: var(--white);
    color: var(--primary);
}

.btn-secondary {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.4);
    color: var(--white);
}

/* ─── Phone Mockup ───────────────────────────────────────────────────────── */
.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-mockup {
    position: relative;
    max-width: 300px;
    width: 100%;
    filter: drop-shadow(0 24px 48px rgba(0,0,0,0.5));
    transform: perspective(1000px) rotateY(-12deg) rotateX(4deg);
    transition: transform 0.5s ease;
}

.phone-mockup:hover {
    transform: perspective(1000px) rotateY(-6deg) rotateX(2deg) scale(1.02);
}

.app-screenshot {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}

/* Floating kanji cards on hero mockup */
.floating-elements { position: absolute; inset: 0; pointer-events: none; }

.floating-card {
    position: absolute;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: float 6s ease-in-out infinite;
}

.fc-kanji { font-size: 1.5rem; font-weight: 700; color: white; }
.fc-keyword { font-size: 0.65rem; color: rgba(255,255,255,0.7); margin-top: 2px; }
.fc-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    background: white;
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
}

.floating-card-1 { top: 15%; left: -18%; animation-delay: 0s; }
.floating-card-2 { top: 40%; right: -14%; animation-delay: 2s; }
.floating-card-3 { bottom: 18%; left: -16%; animation-delay: 4s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33%       { transform: translateY(-12px) rotate(3deg); }
    66%       { transform: translateY(-8px) rotate(-2deg); }
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
.animate-fade-in { animation: fadeIn 0.9s ease both; }
.animate-slide-in { animation: slideIn 1.1s ease 0.2s both; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px) perspective(1000px) rotateY(-20deg); }
    to   { opacity: 1; transform: translateX(0) perspective(1000px) rotateY(-12deg) rotateX(4deg); }
}

/* ─── Screenshot Showcase ────────────────────────────────────────────────── */
.screenshot-showcase {
    overflow: hidden;
    background: var(--paper-mid);
    padding: calc(var(--spacing) * 8) 0;
    cursor: grab;
    position: relative;
}

.screenshot-showcase:active { cursor: grabbing; }

.screenshot-showcase::before,
.screenshot-showcase::after {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    width: 160px;
    z-index: 2;
    pointer-events: none;
}

.screenshot-showcase::before {
    left: 0;
    background: linear-gradient(to right, var(--paper-mid), transparent);
}

.screenshot-showcase::after {
    right: 0;
    background: linear-gradient(to left, var(--paper-mid), transparent);
}

.screenshot-track {
    display: flex;
    width: calc(280px * 9);
    user-select: none;
    touch-action: pan-x;
}

.screenshot-item {
    width: 260px;
    height: 560px;
    flex-shrink: 0;
    margin: 0 calc(var(--spacing) * 1.5);
    transition: transform 0.3s ease;
}

.screenshot-item:hover {
    transform: translateY(-6px) scale(1.03);
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    pointer-events: none;
}

/* ─── Section Shared Styles ─────────────────────────────────────────────── */
.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.section-description {
    font-size: 1.05rem;
    color: var(--ink-light);
    max-width: 620px;
    margin: 1rem 0 3rem;
    line-height: 1.7;
}

/* ─── Method Section ─────────────────────────────────────────────────────── */
.method {
    padding: calc(var(--spacing) * 14) 0;
    background: var(--white);
}

.method h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    max-width: 640px;
}

.method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: calc(var(--spacing) * 3);
    margin-top: calc(var(--spacing) * 4);
}

.method-step {
    padding: calc(var(--spacing) * 3.5);
    border-radius: var(--radius-md);
    background: var(--paper);
    border: 1px solid var(--border);
    transition: transform 0.3s, box-shadow 0.3s;
}

.method-step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.method-num {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.15;
    line-height: 1;
    margin-bottom: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.method-step h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.method-step p {
    font-size: 0.9rem;
    color: var(--ink-light);
    line-height: 1.6;
}

/* ─── JLPT Levels Section ────────────────────────────────────────────────── */
.jlpt-section {
    padding: calc(var(--spacing) * 14) 0;
    background: var(--paper-mid);
}

.jlpt-section h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.jlpt-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: calc(var(--spacing) * 2);
    margin-top: calc(var(--spacing) * 4);
}

.jlpt-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: calc(var(--spacing) * 3);
    border-top: 4px solid;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
}

.jlpt-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.jlpt-n5 { border-color: #27AE60; }
.jlpt-n4 { border-color: #2980B9; }
.jlpt-n3 { border-color: #8E44AD; }
.jlpt-n2 { border-color: #E67E22; }
.jlpt-n1 { border-color: var(--primary); }

.jlpt-level {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.jlpt-n5 .jlpt-level { color: #27AE60; }
.jlpt-n4 .jlpt-level { color: #2980B9; }
.jlpt-n3 .jlpt-level { color: #8E44AD; }
.jlpt-n2 .jlpt-level { color: #E67E22; }
.jlpt-n1 .jlpt-level { color: var(--primary); }

.jlpt-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ink-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.jlpt-desc {
    font-size: 0.85rem;
    color: var(--ink-light);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.jlpt-examples {
    font-size: 1.2rem;
    letter-spacing: 0.15em;
    color: var(--ink);
    font-weight: 500;
}

/* ─── Features Section ───────────────────────────────────────────────────── */
.features {
    padding: calc(var(--spacing) * 14) 0;
    background: var(--white);
}

.features h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    max-width: 600px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: calc(var(--spacing) * 3);
    margin-top: calc(var(--spacing) * 4);
}

.feature-card {
    background: var(--paper);
    border-radius: var(--radius-md);
    padding: calc(var(--spacing) * 4);
    border: 1px solid var(--border);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--ink-light);
    line-height: 1.6;
}

/* ─── For Who Section ────────────────────────────────────────────────────── */
.for-who {
    padding: calc(var(--spacing) * 14) 0;
    background: var(--paper-mid);
}

.for-who h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.audience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: calc(var(--spacing) * 3);
    margin-top: calc(var(--spacing) * 4);
}

.audience-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: calc(var(--spacing) * 4);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
}

.audience-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.audience-card i {
    color: var(--primary);
    margin-bottom: 1rem;
}

.audience-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.audience-card ul {
    list-style: none;
}

.audience-card ul li {
    font-size: 0.9rem;
    color: var(--ink-light);
    padding: 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.audience-card ul li i {
    color: var(--primary);
    font-size: 0.75rem;
    margin: 0;
    flex-shrink: 0;
}

/* ─── Contact Section ────────────────────────────────────────────────────── */
.contact {
    padding: calc(var(--spacing) * 14) 0;
    background: var(--white);
    text-align: center;
}

.contact h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.contact .section-description {
    margin: 1rem auto 2.5rem;
}

.contact-methods {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--ink-light);
    padding: calc(var(--spacing) * 3);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    min-width: 140px;
    transition: transform 0.2s, color 0.2s, border-color 0.2s;
}

.contact-method i { color: var(--primary); }

.contact-method:hover {
    transform: translateY(-4px);
    color: var(--primary);
    border-color: var(--primary);
}

/* ─── Privacy Section ────────────────────────────────────────────────────── */
.privacy {
    padding: calc(var(--spacing) * 14) 0;
    background: var(--paper-mid);
    text-align: center;
}

.privacy h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.privacy-content {
    max-width: 700px;
    margin: 1.5rem auto 0;
}

.privacy-content > p {
    font-size: 1rem;
    color: var(--ink-light);
    margin-bottom: 2rem;
}

.permission-items {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.permission-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: calc(var(--spacing) * 2.5) calc(var(--spacing) * 2);
    background: var(--white);
    border-radius: var(--radius-md);
    min-width: 160px;
    font-size: 0.875rem;
    color: var(--ink-light);
    border: 1px solid var(--border);
}

.permission-item i { color: var(--primary); }

.privacy-guarantee {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.privacy-guarantee i { color: #27AE60; flex-shrink: 0; }

.privacy-guarantee p {
    font-size: 0.9rem;
    color: var(--ink-light);
    text-align: left;
    margin: 0;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
footer {
    background: var(--ink);
    color: rgba(255,255,255,0.6);
    padding: calc(var(--spacing) * 6) 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.footer-brand .logo-kanji { font-size: 1.5rem; color: var(--primary); }

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    text-decoration: none;
    color: rgba(255,255,255,0.5);
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links a:hover { color: rgba(255,255,255,0.9); }

.footer-copy {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.3);
}

/* ─── Hamburger ──────────────────────────────────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content { order: 1; }
    .hero-image   { order: 2; }

    .hero-description { margin: 0 auto 2rem; }
    .hero-buttons { justify-content: center; }

    .phone-mockup {
        max-width: 260px;
        transform: perspective(800px) rotateY(0) rotateX(0);
    }

    .phone-mockup:hover {
        transform: perspective(800px) rotateY(0) rotateX(0) scale(1.03);
    }

    .jlpt-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }

    .nav-links {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(250,250,248,0.98);
        backdrop-filter: blur(16px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        z-index: 1000;
    }

    .nav-links.active { display: flex; }
    .nav-links a { font-size: 1.2rem; color: var(--ink); }

    .hero { padding: calc(var(--spacing) * 14) 0 calc(var(--spacing) * 8); }
    .hero h1 { font-size: 2.25rem; }

    .jlpt-grid { grid-template-columns: repeat(2, 1fr); }

    .screenshot-item { width: 220px; height: 470px; }
    .screenshot-track { width: calc(220px * 10); }

    .footer-links { gap: 1rem; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 2rem; }
    .jlpt-grid { grid-template-columns: 1fr 1fr; }
    .phone-mockup { max-width: 210px; }
    .floating-card { display: none; }
}
