/* ── Design tokens — same as the Korean site ──────────────────── */
:root {
    --ink:       #181b2e;
    --ink-soft:  #2a2e44;
    --ivory:     #f7f2e7;
    --cream:     #fbf7ee;
    --paper:     #fdfaf2;
    --gold:      #b89968;
    --gold-soft: #d4b886;
    --gold-deep: #8c6f3f;
    --text:      #2a2a2a;
    --text-soft: #4a4540;
    --muted:     #756a5e;
    --line:      #ddd1b9;
    --line-soft: #ebe2ce;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: "Inter", "Cormorant Garamond", Georgia, serif;
    background: var(--paper);
    color: var(--text);
    line-height: 1.75;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-deep); text-decoration: none; transition: color .2s; }
a:hover { color: var(--ink); }
em, .serif { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; }
img { max-width: 100%; height: auto; }

/* ── Top bar — language toggle + brand ─────────────────────────── */
.topbar {
    background: var(--ink); color: var(--ivory);
    border-bottom: 1px solid rgba(212,184,134,.18);
}
.topbar-inner {
    max-width: 1080px; margin: 0 auto;
    padding: .7rem 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem;
}
.brand {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.05rem; letter-spacing: .16em;
    color: var(--ivory); text-transform: uppercase;
    text-decoration: none; flex-shrink: 0;
}
.brand:hover { color: var(--gold-soft); }

/* ── Main nav (links + auth + install + toggle) ─────────────────── */
.ennav {
    display: flex; align-items: center; gap: 1.15rem; flex-wrap: wrap;
    justify-content: flex-end;
}
.ennav > a {
    font-family: "Inter", sans-serif;
    font-size: .85rem; letter-spacing: .02em;
    color: var(--gold-soft); text-decoration: none;
    transition: color .15s;
}
.ennav > a:hover { color: var(--ivory); }
.ennav > a.active { color: var(--ivory); }
.ennav .nav-cta {
    background: var(--gold); color: var(--ink) !important;
    padding: .35rem .9rem; border-radius: 9999px; font-weight: 600;
}
.ennav .nav-cta:hover { background: var(--gold-soft); }
.ennav .nav-admin { color: var(--gold-soft); font-weight: 600; }

/* Hamburger (mobile only) */
.ennav-toggle {
    display: none; background: none; border: 0; cursor: pointer;
    width: 30px; height: 26px; padding: 4px 3px; flex-shrink: 0;
}
.ennav-toggle span {
    display: block; height: 2px; background: var(--gold-soft);
    border-radius: 2px; margin: 4px 0; transition: .2s;
}

@media (max-width: 760px) {
    .ennav-toggle { display: block; }
    .ennav {
        display: none;
        position: absolute; top: 100%; right: 0; left: 0;
        background: var(--ink); border-bottom: 1px solid rgba(212,184,134,.18);
        flex-direction: column; align-items: stretch; gap: 0;
        padding: .5rem 0; z-index: 60;
    }
    .ennav.open { display: flex; }
    .ennav > a { padding: .7rem 1.5rem; font-size: .92rem; }
    .ennav .nav-cta { margin: .4rem 1.5rem; text-align: center; }
    .topbar { position: relative; }
}

/* PWA Install button (English) — small pill, matches lang toggle scale */
.pwa-install-en {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    padding: .26rem .7rem;
    border-radius: 9999px;
    background: var(--gold);
    color: var(--ink) !important;
    font-family: "Inter", sans-serif;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-decoration: none;
    line-height: 1.5;
    border: 1px solid var(--gold);
    transition: background .15s, border-color .15s;
}
.pwa-install-en:hover {
    background: var(--gold-soft);
    border-color: var(--gold-soft);
    color: var(--ink) !important;
}
@media (max-width: 540px) {
    .pwa-install-en { padding: .2rem .55rem; font-size: .68rem; }
}

.ls-lang-dd {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}
.ls-lang-dd summary {
    list-style: none !important;
    list-style-type: none !important;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    display: inline-flex !important;
    align-items: center;
    gap: .3rem;
    padding: .3rem .8rem;
    border: 1px solid rgba(212,184,134,.35);
    border-radius: 9999px;
    font-family: "Inter", sans-serif;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--gold-soft);
    background: transparent;
    transition: background .2s, border-color .2s, color .2s;
}
.ls-lang-dd summary::-webkit-details-marker { display: none !important; }
.ls-lang-dd summary::marker { content: '' !important; display: none !important; font-size: 0 !important; }
.ls-lang-dd summary::before { content: none !important; }
.ls-lang-dd summary:hover {
    border-color: var(--gold-soft);
    color: var(--ivory);
    background: rgba(212,184,134,.10);
}
.ls-lang-dd[open] summary {
    border-color: var(--gold-soft);
    color: var(--ivory);
    background: rgba(212,184,134,.14);
}
.ls-lang-dd-arrow {
    font-size: .68em;
    transition: transform .2s;
    opacity: .75;
}
.ls-lang-dd[open] .ls-lang-dd-arrow { transform: rotate(180deg); }

.ls-lang-dd-menu {
    position: absolute;
    top: calc(100% + .4rem);
    right: 0;
    min-width: 9.5rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: 0 8px 24px -4px rgba(24,27,46,.25);
    padding: .3rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.ls-lang-dd-menu a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .7rem;
    border-radius: 3px;
    text-decoration: none;
    color: var(--text);
    font-family: "Inter", sans-serif;
    font-size: .85rem;
    transition: background .15s, color .15s;
}
.ls-lang-dd-menu a:hover,
.ls-lang-dd-menu a:focus {
    background: var(--cream);
    color: var(--gold-deep);
    outline: none;
}
.ls-lang-dd-code {
    display: inline-block;
    min-width: 1.7em;
    font-weight: 700;
    color: var(--gold-deep);
    font-size: .78rem;
    letter-spacing: .04em;
}
.ls-lang-dd-name {
    color: var(--text-soft);
    font-size: .85rem;
    font-family: "Noto Serif KR", "Inter", serif;
}

/* Mobile — slightly smaller summary, menu position adjusted */
@media (max-width: 540px) {
    .ls-lang-dd summary { padding: .25rem .65rem; font-size: .72rem; }
    .ls-lang-dd-menu { min-width: 9rem; }
}

/* ── Nav (page-level) ──────────────────────────────────────────── */
.pagenav {
    background: var(--paper);
    border-bottom: 1px solid var(--line-soft);
}
.pagenav-inner {
    max-width: 1080px; margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex; gap: 1.75rem; flex-wrap: wrap;
    font-family: "Inter", sans-serif;
    font-size: .9rem; letter-spacing: .03em;
}
.pagenav-inner a {
    color: var(--text-soft); padding-bottom: .3rem;
    border-bottom: 2px solid transparent;
}
.pagenav-inner a:hover { color: var(--ink); border-color: var(--gold-soft); }
.pagenav-inner a.active {
    color: var(--ink); font-weight: 600;
    border-color: var(--gold-deep);
}

/* ── Hero ──────────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 5.5rem 1.5rem 4rem;
    background: linear-gradient(180deg, var(--cream) 0%, var(--paper) 100%);
}
.hero .eyebrow {
    font-family: "Cormorant Garamond", serif;
    font-style: italic; font-size: .98rem;
    color: var(--gold-deep); letter-spacing: .15em;
    text-transform: uppercase; margin-bottom: 1.25rem;
}
.hero h1 {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(2.1rem, 5vw, 3.3rem);
    font-weight: 500; line-height: 1.2;
    color: var(--ink); max-width: 720px; margin: 0 auto .5rem;
    letter-spacing: -.01em;
}
.hero h1 em { color: var(--gold-deep); }
.hero .lede {
    font-size: 1.05rem; color: var(--text-soft);
    max-width: 580px; margin: 1.5rem auto 0; line-height: 1.85;
}
.hero .meta {
    margin-top: 2rem; font-size: .85rem; color: var(--muted);
    letter-spacing: .04em;
}

/* ── Generic sections ──────────────────────────────────────────── */
section { padding: 4.5rem 1.5rem; }
section .wrap { max-width: 720px; margin: 0 auto; }
section h2 {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.85rem; font-weight: 500; color: var(--ink);
    letter-spacing: -.005em; margin-bottom: .5rem; line-height: 1.3;
}
section h2 em { color: var(--gold-deep); }
section .sub {
    font-family: "Cormorant Garamond", serif; font-style: italic;
    color: var(--gold-deep); font-size: 1rem; margin-bottom: 2rem;
    letter-spacing: .03em;
}
section p { margin: 1rem 0; color: var(--text-soft); }
section h3 {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.35rem; font-weight: 500; color: var(--ink);
    margin: 2rem 0 .35rem; line-height: 1.4;
}
section h3 .term {
    font-style: italic; color: var(--gold-deep);
    font-size: 1rem; margin-left: .4rem;
}

.divider { border: 0; height: 1px; background: var(--line-soft); margin: 0 auto; max-width: 220px; }

/* ── Numbered list (used on Home: "What you'll see") ───────────── */
.see-list { list-style: none; margin: 1.5rem 0; }
.see-list li {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--line-soft);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem; align-items: baseline;
}
.see-list li:last-child { border-bottom: 0; }
.see-list .num {
    font-family: "Cormorant Garamond", serif; font-style: italic;
    color: var(--gold-deep); font-size: 1.05rem;
    min-width: 1.5rem;
}
.see-list .body strong { color: var(--ink); font-weight: 600; }
.see-list .body .term {
    font-family: "Cormorant Garamond", serif; font-style: italic;
    color: var(--muted); font-size: .92rem; margin-left: .3rem;
}
.see-list .body p { margin: .35rem 0 0; font-size: .94rem; line-height: 1.7; }

/* ── Process steps ─────────────────────────────────────────────── */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-top: 2rem; }
.process .step {
    background: var(--cream);
    border: 1px solid var(--line-soft);
    padding: 1.5rem 1rem;
    text-align: center;
}
.process .step .n {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--gold);
    box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--gold-soft);
    margin: 0 auto 1rem;
    display: flex; align-items: center; justify-content: center;
    font-family: "Cormorant Garamond", serif; font-style: italic;
    color: var(--gold-deep); font-size: 1.2rem;
    background: var(--paper);
}
.process .step h4 { font-size: .95rem; font-weight: 600; color: var(--ink); margin-bottom: .35rem; }
.process .step p { font-size: .83rem; color: var(--text-soft); margin: 0; line-height: 1.6; }
@media (max-width: 640px) {
    .process { grid-template-columns: repeat(2, 1fr); }
}

/* ── Theorist grid (About page) ────────────────────────────────── */
.theorists {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem; margin-top: 1.5rem;
}
.theorists .card {
    background: var(--cream);
    border: 1px solid var(--line-soft);
    padding: 1.5rem 1.25rem;
}
.theorists .card .name {
    font-family: "Cormorant Garamond", serif;
    font-weight: 500; font-size: 1.1rem;
    color: var(--ink); margin-bottom: .15rem;
}
.theorists .card .years {
    font-family: "Cormorant Garamond", serif; font-style: italic;
    color: var(--gold-deep); font-size: .85rem; margin-bottom: .85rem;
}
.theorists .card .contribution {
    font-size: .88rem; color: var(--text-soft); line-height: 1.7;
}
@media (max-width: 720px) {
    .theorists { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .theorists { grid-template-columns: 1fr; }
}

/* ── Sample callout (dark) ─────────────────────────────────────── */
.sample {
    background: var(--ink); color: var(--ivory);
    padding: 4.5rem 1.5rem;
}
.sample .wrap { max-width: 680px; margin: 0 auto; text-align: center; }
.sample .label {
    font-family: "Cormorant Garamond", serif; font-style: italic;
    color: var(--gold-soft); letter-spacing: .15em;
    text-transform: uppercase; font-size: .8rem;
    margin-bottom: 1.5rem;
}
.sample blockquote {
    font-family: "Cormorant Garamond", serif;
    font-style: italic; font-size: 1.3rem;
    line-height: 1.6; color: var(--ivory);
    margin: 0 auto; max-width: 580px;
    text-align: center;
}
.sample .note {
    margin-top: 2rem; font-size: .85rem;
    color: var(--gold-soft); font-style: italic;
}

/* ── CTA ───────────────────────────────────────────────────────── */
.cta {
    text-align: center;
    background: var(--cream);
    padding: 5rem 1.5rem;
    border-top: 1px solid var(--line-soft);
}
.cta h2 { margin-bottom: 1rem; }
.cta p { max-width: 540px; margin: 0 auto 2rem; color: var(--text-soft); }
.btn {
    display: inline-block;
    background: var(--ink); color: var(--ivory);
    padding: .95rem 2.2rem;
    font-family: "Inter", sans-serif;
    font-size: .95rem; font-weight: 500;
    letter-spacing: .04em;
    border: 1px solid var(--ink);
    transition: all .25s;
    text-decoration: none;
}
.btn:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: var(--ivory); }
.btn.ghost {
    background: transparent; color: var(--ink); border-color: var(--ink);
    margin-left: .5rem;
}
.btn.ghost:hover { background: var(--ink); color: var(--ivory); }
@media (max-width: 540px) {
    .btn.ghost { margin: .75rem 0 0; display: block; }
}

/* ── Footer ────────────────────────────────────────────────────── */
footer.site-footer {
    background: var(--ink); color: var(--ivory);
    padding: 3rem 1.5rem 2rem;
    text-align: center;
    font-size: .85rem;
}
footer.site-footer .small {
    font-size: .75rem; color: var(--gold-soft);
    margin-top: 1rem; line-height: 1.85;
}
footer.site-footer a { color: var(--gold-soft); }
footer.site-footer a:hover { color: var(--ivory); }
.crisis {
    background: rgba(212,184,134,.08);
    border: 1px solid rgba(212,184,134,.2);
    padding: 1.25rem 1.5rem;
    max-width: 580px; margin: 1.5rem auto 0;
    font-size: .82rem; color: var(--ivory);
    line-height: 1.85; text-align: left;
}
.crisis strong { color: var(--gold-soft); }

.footer-links {
    margin: 1.5rem auto .25rem;
    font-size: .85rem;
    letter-spacing: .04em;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.4rem;
}
.footer-links a {
    color: var(--gold-soft);
    text-decoration: none;
    border-bottom: 1px dotted rgba(212,184,134,.4);
    padding-bottom: 1px;
}
.footer-links a:hover {
    color: var(--ivory);
    border-bottom-color: var(--ivory);
}

/* ── Auth pages (sign in / register) ───────────────────────────── */
.auth-main {
    min-height: calc(100vh - 200px);
    display: flex; align-items: center; justify-content: center;
    padding: 3.5rem 1.5rem;
    background: #f9f6ee;
}
.auth-wrap { max-width: 400px; width: 100%; }
.auth-title {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.7rem; font-weight: 500; color: var(--ink);
    text-align: center; margin: 0 0 .35rem;
}
.auth-sub {
    text-align: center; color: var(--text-soft);
    font-size: .9rem; margin: 0 0 1.5rem;
}
.auth-error {
    background: #fdf2e9; color: #a52a1a; border: 1px solid #d4a890;
    padding: .75rem 1rem; border-radius: 4px; margin-bottom: 1rem;
    font-size: .88rem;
}
.auth-card {
    background: #fff; padding: 1.85rem 1.85rem 2rem;
    border-radius: 8px; border: 1px solid var(--line);
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.auth-field { margin-bottom: 1rem; }
.auth-field label {
    display: block; font-size: .82rem; color: var(--text-soft);
    font-weight: 600; margin-bottom: .4rem;
    font-family: "Inter", sans-serif;
}
.auth-field .auth-opt {
    font-weight: 400; color: var(--muted); font-size: .76rem;
    margin-left: .25rem;
}
.auth-field input {
    width: 100%; box-sizing: border-box;
    padding: .68rem .85rem;
    border: 1.5px solid var(--line); border-radius: 4px;
    font-size: .95rem; font-family: "Inter", sans-serif; color: var(--ink);
}
.auth-field input:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(184,154,62,.15);
}
.auth-submit {
    width: 100%; margin-top: .35rem; padding: .8rem;
    background: var(--ink); color: var(--ivory);
    border: none; border-radius: 4px;
    font-size: .95rem; font-weight: 600; cursor: pointer;
    font-family: "Inter", sans-serif;
    transition: background .2s;
}
.auth-submit:hover { background: var(--gold-deep); }
.auth-alt {
    text-align: center; font-size: .85rem;
    color: var(--text-soft); margin-top: 1.25rem;
}
.auth-alt a { color: var(--gold-deep); font-weight: 600; text-decoration: underline; }
.auth-alt a:hover { color: var(--ink); }
