/* ============================================================
   FluentEnglish — style.css
   Warm Academic Editorial Design System
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
    --primary:       #c0392b;
    --primary-dark:  #a93226;
    --primary-light: #f5d0cc;
    --bg:            #f8f6f3;
    --bg-warm:       #f2ede6;
    --bg-dark:       #1c1410;
    --card:          #ffffff;
    --text:          #1a1208;
    --text-muted:    #7a6e5f;
    --text-light:    #b5a99a;
    --border:        #e8e0d4;
    --success:       #27ae60;
    --success-light: #d5f5e3;
    --error:         #e74c3c;
    --error-light:   #fde8e6;
    --warning:       #f39c12;
    --info:          #2980b9;

    --radius-sm:  10px;
    --radius:     18px;
    --radius-lg:  24px;
    --radius-xl:  32px;

    --shadow-sm:  0 1px 4px rgba(0,0,0,0.06);
    --shadow:     0 4px 20px rgba(0,0,0,0.08);
    --shadow-md:  0 8px 32px rgba(0,0,0,0.10);
    --shadow-lg:  0 16px 56px rgba(0,0,0,0.14);

    --nav-h:      70px;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans:  'DM Sans', system-ui, sans-serif;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
input, select { font-family: inherit; }

/* ---- Page Sections (SPA) ---- */
.page { display: none; min-height: 100vh; padding-top: var(--nav-h); }
.page.active { display: block; }

/* ---- Container ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(248, 246, 243, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: box-shadow var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow); }

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-family: var(--font-sans);
    color: var(--text);
    flex-shrink: 0;
}
.nav-logo strong { color: var(--primary); }
.logo-mark {
    color: var(--primary);
    font-size: 1.3rem;
    line-height: 1;
}
.logo-text { letter-spacing: -0.02em; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-links a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    border-radius: var(--radius-sm);
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    background: var(--bg-dark);
    overflow: hidden;
    padding: 80px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px;
    align-items: center;
    min-height: 90vh;
}

.hero-texture {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(192, 57, 43, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(192, 57, 43, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

/* Override: hero is inside .page which has padding-top for nav */
#page-home .hero {
    margin-top: 0;
    padding-top: 100px;
    padding-bottom: 80px;
    min-height: calc(100vh - var(--nav-h));
    max-width: 100%;
    background: var(--bg-dark);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
#page-home .hero > * { max-width: 1200px; }

.hero-content { position: relative; z-index: 2; padding: 0 24px 0 calc((100vw - 1200px) / 2 + 24px); }
.hero-visual { position: relative; z-index: 2; padding: 0 calc((100vw - 1200px) / 2 + 24px) 0 24px; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(192, 57, 43, 0.2);
    color: #f08070;
    border: 1px solid rgba(192, 57, 43, 0.3);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    margin-bottom: 24px;
}
.badge-dot {
    width: 6px; height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.8rem, 5vw, 4.5rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}
.hero-title em {
    font-style: italic;
    color: #f08070;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 440px;
}

.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}
.hs-item { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.hs-item strong { color: white; font-weight: 600; }
.hs-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.2); }

/* Floating Cards */
.hero-visual { display: flex; flex-direction: column; gap: 16px; }

.floating-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 20px 24px;
    animation: floatUp var(--delay, 0s) ease forwards;
    opacity: 0;
    transform: translateY(20px);
}
@keyframes floatUp {
    to { opacity: 1; transform: translateY(0); }
}
.fc-1 { animation-delay: 0.3s; }
.fc-2 { animation-delay: 0.6s; }
.fc-3 { animation-delay: 0.9s; }

.fc-word {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}
.fc-pos {
    display: inline-block;
    background: rgba(192,57,43,0.3);
    color: #f08070;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 8px;
}
.fc-def { color: rgba(255,255,255,0.55); font-size: 0.88rem; line-height: 1.5; }
.fc-label {
    display: block;
    color: #f08070;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.fc-fact { color: rgba(255,255,255,0.7); font-size: 0.95rem; line-height: 1.6; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 80px 0; }
.section.bg-warm { background: var(--bg-warm); }
.section.bg-dark { background: var(--bg-dark); }

.section-head {
    text-align: center;
    margin-bottom: 48px;
}
.section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}
.section-sub { color: var(--text-muted); font-size: 1rem; }

/* Progress Grid */
.progress-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.prog-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
    text-align: center;
}
.prog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.prog-icon { font-size: 2rem; margin-bottom: 12px; width: 56px; height: 56px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.prog-num {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 8px;
}
.prog-label { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.prog-btn {
    background: none;
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--primary-light);
    transition: all var(--transition);
}
.prog-btn:hover { background: var(--primary-light); }

/* Module Cards */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.mod-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.mod-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--border);
    transition: background var(--transition);
}
.mod-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.mod-card:hover::before { background: var(--primary); }
.mod-card.mod-highlight { background: var(--primary); color: white; }
.mod-card.mod-highlight h3 { color: white; }
.mod-card.mod-highlight p { color: rgba(255,255,255,0.75); }
.mod-card.mod-highlight .mod-num { color: rgba(255,255,255,0.3); }
.mod-card.mod-highlight .mod-tag { background: rgba(255,255,255,0.2); color: white; }
.mod-card.mod-highlight .mod-arrow { color: white; }
.mod-card.mod-highlight::before { background: rgba(255,255,255,0.3); }

.mod-num {
    font-family: var(--font-serif);
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 12px;
}
.mod-emoji { font-size: 2rem; margin-bottom: 14px; }
.mod-card h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.mod-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 20px; }
.mod-footer { display: flex; align-items: center; justify-content: space-between; }
.mod-tag {
    display: inline-block;
    background: var(--bg-warm);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.mod-arrow { font-size: 1.1rem; color: var(--primary); font-weight: bold; }

/* Word of Moment */
.wom-block {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}
.wom-label {
    display: inline-block;
    color: rgba(255,255,255,0.5);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.wom-word {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
.wom-pos {
    color: #f08070;
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 16px;
}
.wom-meaning { color: rgba(255,255,255,0.65); font-size: 1.05rem; margin-bottom: 32px; line-height: 1.7; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-sans);
    transition: all var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
}
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(192,57,43,0.3); }

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-outline:hover { border-color: var(--text); }

.btn-ghost {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.2);
}
.btn-ghost:hover { background: rgba(255,255,255,0.18); }

.btn-outline-light {
    background: transparent;
    color: rgba(255,255,255,0.85);
    border: 2px solid rgba(255,255,255,0.3);
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all var(--transition);
}
.btn-outline-light:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }

.action-btn {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-warm);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    border: 1.5px solid var(--border);
}
.action-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-light); }
.action-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.action-btn svg { pointer-events: none; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 40px 0 24px;
    margin-bottom: 40px;
}
.ph-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.ph-text h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.ph-text p { color: var(--text-muted); font-size: 0.95rem; }
.ph-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Search & Select Inputs */
.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}
.search-input {
    width: 240px;
    padding: 10px 14px 10px 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.88rem;
    transition: all var(--transition);
    outline: none;
}
.search-input:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(192,57,43,0.1); }
.search-input::placeholder { color: var(--text-light); }

.sel-input {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
    transition: all var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a6e5f' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.sel-input:focus { border-color: var(--primary); background-color: white; box-shadow: 0 0 0 3px rgba(192,57,43,0.1); }

/* ============================================================
   VOCABULARY LAYOUT
   ============================================================ */
.vocab-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    padding-bottom: 60px;
}

/* Word Card */
.word-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}
.wc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.wc-badges { display: flex; gap: 8px; }

.badge-pos, .badge-diff {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-pos { background: var(--bg-warm); color: var(--text-muted); }
.badge-diff { background: var(--primary-light); color: var(--primary); }
.badge-diff.beginner { background: #d5f5e3; color: #1e8449; }
.badge-diff.intermediate { background: #fef9e7; color: #b7950b; }
.badge-diff.advanced { background: var(--primary-light); color: var(--primary); }

.wc-actions { display: flex; gap: 8px; }

.wc-word {
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    line-height: 1.1;
}

.wc-meaning {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 24px;
}

.wc-divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

.wc-section { margin-bottom: 20px; }
.wc-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 10px;
}
.wc-examples { display: flex; flex-direction: column; gap: 10px; }
.wc-example {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    background: var(--bg);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-light);
}
.ex-num {
    display: inline-flex;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.wc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.wc-half {}

.synonym-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.syn-tag {
    padding: 5px 12px;
    background: var(--bg-warm);
    border-radius: 100px;
    font-size: 0.82rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.syn-tag:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-light); cursor: pointer; }

.wc-used-in { font-size: 0.92rem; color: var(--text-muted); line-height: 1.6; }

.wc-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.wc-count { font-size: 0.85rem; color: var(--text-light); font-weight: 500; }

/* Word Sidebar */
.word-sidebar {
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}
.sidebar-head {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-head h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}
.word-total { font-size: 0.78rem; color: var(--text-light); }

.word-list {
    overflow-y: auto;
    flex: 1;
    padding: 8px;
}
.word-list::-webkit-scrollbar { width: 4px; }
.word-list::-webkit-scrollbar-track { background: transparent; }
.word-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.wl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    gap: 8px;
}
.wl-item:hover { background: var(--bg); }
.wl-item.active { background: var(--primary-light); }

.wl-word {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wl-item.active .wl-word { color: var(--primary); }
.wl-pos {
    font-size: 0.72rem;
    color: var(--text-light);
    flex-shrink: 0;
    font-style: italic;
}
.wl-check { font-size: 0.8rem; color: var(--success); flex-shrink: 0; }

/* ============================================================
   PHRASAL VERBS GRID
   ============================================================ */
.phrasal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-bottom: 40px;
}
.phrasal-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
}
.phrasal-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.pc-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.pc-verb {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.pc-learned-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.1rem;
    transition: all var(--transition);
    line-height: 1;
}
.pc-learned-btn.learned { color: var(--primary); }
.pc-learned-btn:hover { transform: scale(1.2); }

.pc-badges { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.pc-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}
.pc-badge.cat { background: var(--bg-warm); color: var(--text-muted); }
.pc-badge.formal { background: #e8f4fd; color: var(--info); }
.pc-badge.informal { background: #fef9e7; color: var(--warning); }
.pc-badge.neutral { background: var(--bg-warm); color: var(--text-muted); }

.pc-meaning { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 14px; }
.pc-examples { display: flex; flex-direction: column; gap: 6px; }
.pc-ex {
    font-size: 0.83rem;
    color: var(--text-light);
    line-height: 1.5;
    font-style: italic;
    padding-left: 10px;
    border-left: 2px solid var(--border);
}

/* ============================================================
   GRAMMAR QUIZ
   ============================================================ */
.grammar-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    padding-bottom: 60px;
}
.quiz-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    min-height: 480px;
    display: flex;
    flex-direction: column;
}
.qc-header { display: flex; gap: 8px; margin-bottom: 28px; }
.qc-cat, .qc-diff {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: capitalize;
}
.qc-cat { background: var(--primary-light); color: var(--primary); }
.qc-diff { background: var(--bg-warm); color: var(--text-muted); }

.qc-question {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 32px;
}

.qc-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.qc-option {
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg);
}
.qc-option:hover:not(.disabled) { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.qc-option.correct { border-color: var(--success); background: var(--success-light); color: #1e8449; }
.qc-option.wrong { border-color: var(--error); background: var(--error-light); color: var(--error); }
.qc-option.disabled { cursor: not-allowed; }
.opt-letter {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: background var(--transition);
}
.qc-option:hover:not(.disabled) .opt-letter { background: var(--primary); color: white; }
.qc-option.correct .opt-letter { background: var(--success); color: white; }
.qc-option.wrong .opt-letter { background: var(--error); color: white; }

.qc-explanation {
    background: #fffbef;
    border: 1px solid #f7dc6f;
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.exp-icon { font-size: 1.2rem; flex-shrink: 0; }
#exp-text { font-size: 0.9rem; color: #7d6608; line-height: 1.6; }

.qc-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.qc-score-wrap { font-size: 0.9rem; color: var(--text-muted); }
.qc-score-wrap strong { color: var(--text); }

/* Grammar Aside */
.grammar-aside { display: flex; flex-direction: column; gap: 16px; }
.aside-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.aside-card h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    color: var(--text-muted);
}
.stat-row:last-of-type { border-bottom: none; }
.stat-row strong { font-size: 1rem; color: var(--text); }
.text-green { color: var(--success) !important; }
.text-red { color: var(--error) !important; }

.accuracy-bar {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    margin-top: 16px;
    overflow: hidden;
}
.accuracy-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #e74c3c);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip {
    padding: 6px 12px;
    background: var(--bg-warm);
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid var(--border);
}
.cat-chip:hover, .cat-chip.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary-light); }

.tip-card { background: #fffbef; border-color: #f7dc6f; }
.tip-icon { font-size: 1.5rem; margin-bottom: 8px; }
.tip-card h3 { color: #7d6608; }
.tip-card p { font-size: 0.85rem; color: #7d6608; line-height: 1.6; margin: 0; }

/* ============================================================
   SENTENCES GRID
   ============================================================ */
.sentence-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding-bottom: 40px;
}
.sentence-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
}
.sentence-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.sc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sc-badges { display: flex; gap: 8px; }
.sc-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
    background: var(--bg-warm);
    color: var(--text-muted);
}
.sc-practiced-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.sc-practiced-btn:hover { border-color: var(--success); color: var(--success); }
.sc-practiced-btn.practiced { background: var(--success-light); color: var(--success); border-color: var(--success); }

.sc-sentence {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 10px;
}
.sc-situation {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.5;
}
.sc-pv-used {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    margin-bottom: 10px;
}
.sc-explanation {
    font-size: 0.83rem;
    color: var(--text-light);
    line-height: 1.6;
    font-style: italic;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 10px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 24px 0;
    flex-wrap: wrap;
}
.page-btn {
    width: 36px; height: 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.page-btn.ellipsis { cursor: default; border-color: transparent; }

/* ============================================================
   LOADING & EMPTY STATES
   ============================================================ */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
    gap: 16px;
    flex: 1;
}
.loading-state p { font-size: 0.9rem; }
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    gap: 12px;
    flex: 1;
}
.empty-icon { font-size: 3rem; }
.empty-state h3 { font-family: var(--font-serif); font-size: 1.3rem; color: var(--text); }
.empty-state p { color: var(--text-muted); font-size: 0.9rem; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}
.toast {
    background: var(--text);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideInToast 0.3s ease forwards;
    min-width: 260px;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}
.toast.success { background: #1e8449; }
.toast.error { background: var(--error); }
.toast.info { background: var(--info); }
.toast.warning { background: var(--warning); }
@keyframes slideInToast {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOutToast {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}
.toast.hiding { animation: fadeOutToast 0.3s ease forwards; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--text);
    color: rgba(255,255,255,0.7);
    padding: 60px 0 32px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 32px;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    color: white;
    margin-bottom: 14px;
}
.footer-logo .logo-mark { color: var(--primary); font-size: 1.3rem; }
.footer-logo strong { color: var(--primary); }
.footer-brand p { font-size: 0.88rem; line-height: 1.7; max-width: 280px; }
.footer-links-col { display: flex; flex-direction: column; gap: 12px; }
.footer-links-col h4 { color: white; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.footer-links-col a { font-size: 0.88rem; transition: color var(--transition); }
.footer-links-col a:hover { color: white; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    gap: 16px;
    flex-wrap: wrap;
}

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 1024px) {
    .modules-grid { grid-template-columns: repeat(2, 1fr); }
    .progress-grid { grid-template-columns: repeat(2, 1fr); }
    .phrasal-grid { grid-template-columns: repeat(2, 1fr); }
    .vocab-layout { grid-template-columns: 1fr; }
    .word-sidebar { max-height: 400px; }
    .grammar-layout { grid-template-columns: 1fr; }
    .grammar-aside { grid-template-columns: repeat(2, 1fr); display: grid; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px) {
    :root { --nav-h: 62px; }

    .hamburger { display: flex; }

    .nav-links {
        position: fixed;
        top: var(--nav-h);
        left: 0; right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        gap: 0;
        padding: 12px;
        display: none;
        box-shadow: var(--shadow-md);
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 16px; width: 100%; border-radius: var(--radius-sm); }

    #page-home .hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 60px 20px 40px;
        gap: 40px;
    }
    .hero-content { padding: 0; }
    .hero-visual { padding: 0; }

    .hero-title { font-size: 2.2rem; }
    .hero-cta { flex-direction: column; }
    .hero-cta .btn { width: 100%; justify-content: center; }
    .hero-stats { flex-wrap: wrap; gap: 12px; }

    .section { padding: 48px 0; }
    .progress-grid { grid-template-columns: 1fr; }
    .modules-grid { grid-template-columns: 1fr; }

    .ph-row { flex-direction: column; align-items: flex-start; gap: 16px; }
    .ph-controls { width: 100%; flex-direction: column; }
    .search-input { width: 100%; }
    .sel-input { width: 100%; }
    .search-wrap { width: 100%; }

    .word-card { padding: 24px; }
    .wc-word { font-size: 2rem; }
    .wc-row { grid-template-columns: 1fr; }
    .wc-nav { flex-wrap: wrap; justify-content: center; gap: 12px; }

    .phrasal-grid { grid-template-columns: 1fr; }
    .sentence-grid { grid-template-columns: 1fr; }

    .grammar-layout { grid-template-columns: 1fr; }
    .grammar-aside { display: flex; }
    .quiz-card { padding: 24px; }

    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom { flex-direction: column; text-align: center; }

    .floating-card { display: none; }
    .floating-card.fc-1 { display: block; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero-title { font-size: 1.9rem; }
    .page-header { padding: 28px 0 16px; }
    .wc-nav { gap: 8px; }
    .wc-nav .btn { flex: 1; text-align: center; }
    .qc-option { padding: 12px 14px; font-size: 0.88rem; }
    .word-card { padding: 20px; }
    .quiz-card { padding: 20px; }
}