@import url("https://fonts.googleapis.com/css2?family=Gowun+Dodum&family=Nunito:wght@500;700;800&display=swap");

:root {
    --ink: #443b57;
    --muted: #756d86;
    --coral: #ff718a;
    --coral-dark: #e95470;
    --lavender: #8e78d8;
    --line: rgba(116, 91, 154, 0.14);
    --surface: rgba(255, 255, 255, 0.78);
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 32px 20px;
    color: var(--ink);
    font-family: "Nunito", "Gowun Dodum", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 10% 12%, rgba(255, 211, 137, 0.72), transparent 25%),
        radial-gradient(circle at 88% 15%, rgba(203, 188, 255, 0.76), transparent 27%),
        radial-gradient(circle at 84% 88%, rgba(255, 184, 199, 0.58), transparent 26%),
        linear-gradient(145deg, #fffaf0 0%, #fff7fb 48%, #f4f0ff 100%);
    background-attachment: fixed;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(2px);
}

body::before { width: 150px; height: 150px; left: -45px; bottom: 12%; background: rgba(135, 222, 202, 0.28); }
body::after { width: 110px; height: 110px; right: 5%; top: 6%; background: rgba(255, 255, 255, 0.55); }

.app {
    width: min(100%, 960px);
    margin: 0 auto;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(105, 80, 140, 0.14), inset 0 1px 0 #fff;
    backdrop-filter: blur(18px);
}

.topbar { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 20px; }
.topbar > a:not(.lang-link) { color: var(--muted); font-weight: 800; text-decoration: none; }
.topbar > a:not(.lang-link):hover { color: var(--coral-dark); }
.language-menu { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; width: 100%; padding-top: 4px; }
.language-menu > span { margin-right: 2px; color: var(--muted); font-size: .82rem; font-weight: 800; }
.language-select { display: flex; align-items: center; gap: 0; width: auto; color: var(--muted); font-size: 0; font-weight: 800; }
.language-select select { min-width: 150px; padding: 8px 34px 8px 12px; color: var(--ink); border: 1px solid #ded4f7; border-radius: 12px; background: #fff; font: 800 .86rem "Nunito", "Gowun Dodum", "Segoe UI", sans-serif; cursor: pointer; }
.language-select select:focus-visible { outline: 3px solid rgba(255, 113, 138, .35); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.lang-link {
    padding: 6px 10px;
    color: var(--lavender);
    border: 1px solid #ded4f7;
    border-radius: 999px;
    background: #fff;
    font-weight: 800;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}
.lang-link:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(142, 120, 216, .18); }
.lang-link.active { color: #fff; border-color: var(--lavender); background: var(--lavender); }

h1 { margin: 4px 0 10px; font-size: clamp(2rem, 5vw, 3.15rem); line-height: 1.15; letter-spacing: -.04em; }
h2 { color: #514260; font-size: clamp(1.55rem, 4vw, 2.2rem); }
h1, h2, h3, .test-title { overflow-wrap: anywhere; }
.intro { max-width: 650px; margin: 0 0 28px; color: var(--muted); font-size: 1.04rem; line-height: 1.75; }
.hero { position: relative; overflow: hidden; margin-bottom: 30px; padding: clamp(28px, 6vw, 54px); border: 1px solid rgba(255,255,255,.92); border-radius: 28px; background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,239,245,.9) 48%, rgba(240,235,255,.94)); box-shadow: 0 20px 45px rgba(105,80,140,.12); }
.hero::after { content: "✦"; position: absolute; right: clamp(18px, 5vw, 46px); top: 18px; color: rgba(142,120,216,.22); font-size: clamp(4rem, 12vw, 8rem); line-height: 1; transform: rotate(12deg); }
.hero-kicker { position: relative; z-index: 1; margin: 0 0 14px; color: var(--lavender); font-size: .82rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.hero h1 { position: relative; z-index: 1; max-width: 720px; margin: 0; color: #30273f; font-size: clamp(2.35rem, 7vw, 4.9rem); line-height: .98; letter-spacing: -.065em; }
.hero h1 span { color: transparent; background: linear-gradient(100deg, var(--coral-dark), #8a68d7 72%); background-clip: text; -webkit-background-clip: text; }
.hero-tagline { position: relative; z-index: 1; display: inline-block; margin: 24px 0 12px; padding: 9px 14px; color: #654e7d; border: 1px solid rgba(142,120,216,.18); border-radius: 999px; background: rgba(255,255,255,.74); font-size: clamp(1rem, 2vw, 1.15rem); font-weight: 800; }
.hero .intro { position: relative; z-index: 1; margin: 5px 0 0; }
.screen { padding-top: 8px; }
.quiz-anchor { display: block; width: 100%; height: 1px; scroll-margin-top: 72px; }
.hidden { display: none; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.test-card {
    display: block;
    position: relative;
    overflow: hidden;
    min-height: 168px;
    padding: 20px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 10px 28px rgba(96, 74, 128, .08);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.test-card::after { content: "→"; position: absolute; right: 18px; bottom: 14px; color: #c2b3d7; font-size: 1.2rem; }
.test-card:nth-child(3n+1) { background: linear-gradient(145deg, #fff, #fff6df); }
.test-card:nth-child(3n+2) { background: linear-gradient(145deg, #fff, #f5efff); }
.test-card:nth-child(3n) { background: linear-gradient(145deg, #fff, #fff0f4); }
.test-card:hover { transform: translateY(-6px); border-color: rgba(255, 113, 138, .35); box-shadow: 0 18px 35px rgba(96, 74, 128, .14); }
.test-card:focus-visible, .option-btn:focus-visible, .btn:focus-visible, .lang-link:focus-visible { outline: 3px solid rgba(255, 113, 138, .35); outline-offset: 3px; }
.test-emoji { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 16px; background: rgba(255,255,255,.78); font-size: 1.8rem; box-shadow: 0 6px 16px rgba(95, 70, 125, .1); }
.test-title, .test-desc { display: block; }
.test-title { margin-bottom: 7px; font-size: 1.06rem; font-weight: 800; }
.test-desc { padding-right: 10px; color: var(--muted); font-size: .92rem; line-height: 1.55; }

.quiz-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; color: var(--lavender); font-weight: 800; }
.option-list { display: grid; gap: 13px; margin-top: 22px; }
.option-btn {
    width: 100%;
    padding: 17px 18px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 6px 18px rgba(94, 70, 125, .06);
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.option-btn:hover { transform: translateX(5px); border-color: #ffb0be; background: #fff7f9; }

.btn { padding: 11px 17px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 800; transition: transform .18s ease, box-shadow .18s ease; }
.btn:hover { transform: translateY(-2px); }
.primary { color: #fff; background: linear-gradient(135deg, var(--coral), #ff8f72); box-shadow: 0 9px 20px rgba(233, 84, 112, .25); }
.secondary { color: #6b5789; border: 1px solid #e3d9f2; background: #fff; }

.result-card { padding: clamp(22px, 5vw, 38px); border: 1px solid rgba(255,255,255,.9); border-radius: 25px; background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(255,241,246,.86)); box-shadow: 0 18px 45px rgba(107, 78, 137, .12); }
.result-card h2 { margin-top: 0; }
.result-badge { display: inline-block; margin: 4px 0 14px; padding: 9px 14px; color: #c34560; border-radius: 999px; background: #ffe5eb; font-weight: 800; }
.result-advice { color: #685d78; line-height: 1.7; }
.result-block { margin-top: 12px; padding: 14px 16px; border: 1px solid rgba(142,120,216,.1); border-radius: 15px; background: rgba(255,255,255,.7); line-height: 1.55; }
.result-label { margin-bottom: 5px; color: var(--lavender); font-weight: 800; }
.result-mbti { margin-top: 10px; color: var(--coral-dark); font-weight: 800; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.actions a { display: inline-flex; align-items: center; text-decoration: none; }
.share-panel { margin-top: 28px; padding: 20px; border: 1px solid rgba(142,120,216,.18); border-radius: 20px; background: linear-gradient(135deg, #fff8e8, #f6f0ff); }
.share-panel h3 { margin: 0 0 6px; color: #514260; font-size: 1.15rem; }
.share-panel p { margin: 0 0 14px; color: var(--muted); line-height: 1.55; }
.share-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.share-actions a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.share-native { color: #fff; background: linear-gradient(135deg, var(--lavender), #6f5ec4); }
.share-copy, .share-social { color: #63517e; border: 1px solid #ded4f7; background: #fff; }
.share-icon { width: 44px; min-width: 44px; height: 44px; padding: 10px; color: #111; border: 1px solid rgba(17,17,17,.18); border-radius: 50%; background: #fff; line-height: 1; box-shadow: 0 4px 12px rgba(68,59,87,.09); }
.share-icon:hover { color: #111; border-color: #111; background: #fff; }
.share-icon i { color: #111; font-size: 1.22rem; line-height: 1; }
.share-feedback { min-height: 1.4em; margin: 10px 0 0 !important; color: var(--coral-dark) !important; font-weight: 800; }

.editorial { display: grid; gap: 16px; margin-top: 42px; }
.editorial section { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.66); }
.editorial h2 { margin: 0 0 8px; font-size: 1.3rem; }
.editorial p, .content-page p, .content-page li { color: var(--muted); line-height: 1.78; }
.site-footer { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; text-align: center; }
.site-footer div { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a, .content-page a { color: #725bb5; }
.home-share { margin: 0 0 22px; padding: 20px; border: 1px solid rgba(142,120,216,.18); border-radius: 20px; background: linear-gradient(135deg, #fff8e8, #f6f0ff); box-shadow: 0 10px 26px rgba(96,74,128,.08); text-align: center; }
.home-share > p { margin: 0 0 11px; color: var(--ink); font-weight: 800; }
.home-share-controls { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 8px; width: 100%; }
.home-share-controls .btn { flex: 0 1 auto; min-width: 0; padding: 10px 14px; white-space: nowrap; }
.home-share .share-icon { display: inline-flex; align-items: center; justify-content: center; color: #111; cursor: pointer; text-decoration: none; }
.home-share-feedback { display: block; min-height: 1.35em; margin-top: 9px; color: var(--coral-dark); font-size: .82rem; font-weight: 800; }
.result-page-share { margin: 8px 0 36px; }
.content-page { max-width: 760px; margin: 0 auto; }
.content-page h1 { margin-top: 20px; }
.content-page h2 { margin: 30px 0 8px; font-size: 1.35rem; }
.content-page .updated { margin-bottom: 28px; color: #8d8498; font-size: .9rem; }
.notice { padding: 16px 18px; border-left: 4px solid #ff8aa0; border-radius: 10px; background: #fff5f7; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 22px; color: var(--muted); font-size: .84rem; }
.breadcrumb a { color: #725bb5; text-decoration: none; }
.seo-content { max-width: 880px; margin: 0 auto; }
.seo-hero { margin-bottom: 30px; padding: clamp(26px, 5vw, 46px); border: 1px solid rgba(255,255,255,.92); border-radius: 26px; background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,242,247,.91), rgba(243,239,255,.95)); box-shadow: 0 18px 42px rgba(105,80,140,.1); }
.seo-hero h1 { max-width: 760px; margin: 0 0 14px; font-size: clamp(2.2rem, 6vw, 4.25rem); }
.seo-lead { max-width: 700px; color: var(--muted); font-size: 1.08rem; line-height: 1.75; }
.quiz-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.quiz-facts span { padding: 6px 10px; color: #6b5789; border: 1px solid #e3d9f2; border-radius: 999px; background: rgba(255,255,255,.8); font-size: .8rem; font-weight: 800; }
.seo-copy { margin: 0 0 34px; }
.seo-copy h2, .related-tests h2 { margin: 30px 0 8px; font-size: 1.45rem; }
.seo-copy p, .result-article p { color: var(--muted); line-height: 1.82; }
.seo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.seo-card { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.78); box-shadow: 0 8px 24px rgba(96,74,128,.07); }
.seo-card h2 { margin: 0 0 8px; font-size: 1.18rem; }
.seo-card h2 a { color: #514260; text-decoration: none; }
.seo-card p { color: var(--muted); line-height: 1.6; }
.seo-grid.compact { gap: 22px; }
.seo-grid.compact .seo-card { padding: 24px; }
.seo-grid.compact .seo-card p { margin: 0 0 18px; }
.seo-grid.compact .seo-card .btn { display: inline-block; margin-top: 4px; text-decoration: none; }
.seo-grid.compact .seo-card .quiz-facts { display: none; }
.related-tests { margin: 44px 0 26px; }
.result-article .seo-copy { max-width: 760px; margin: 0 auto; }
.result-article .btn { display: inline-block; margin: 5px 6px 5px 0; text-decoration: none; }

@media (max-width: 760px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .seo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topbar { justify-content: center; }
    .hero { padding: 32px 26px; }
}

@media (max-width: 520px) {
    body { padding: 14px; }
    .app { padding: 20px 17px; border-radius: 23px; }
    .grid { grid-template-columns: 1fr; }
    .test-card { min-height: 145px; }
    .quiz-header { align-items: flex-start; }
    .actions .btn { flex: 1; }
    .topbar { justify-content: flex-start; }
    .topbar > a { font-size: .9rem; }
    .language-select { width: 100%; }
    .language-select select { flex: 1; min-width: 0; }
    .seo-grid { grid-template-columns: 1fr; }
    .seo-hero { padding: 24px 20px; }
    .quiz-anchor { scroll-margin-top: 52px; }
    .home-share-controls { gap: 6px; }
    .home-share-controls .btn { flex: 1 1 auto; padding: 9px 8px; font-size: .82rem; }
    .home-share-controls .share-icon { flex: 0 0 38px; width: 38px; min-width: 38px; height: 38px; padding: 8px; }
    .home-share { padding: 17px 12px; }
    .content-page { min-width: 0; }
}

@media (max-width: 360px) {
    body { padding: 9px; }
    .app { padding: 18px 13px; }
    .home-share-controls { gap: 4px; }
    .home-share-controls .btn { padding-inline: 6px; font-size: .76rem; }
    .home-share-controls .share-icon { flex-basis: 34px; width: 34px; min-width: 34px; height: 34px; }
    .home-share { padding-inline: 9px; }
}

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