/* AEB shared theme — used by index.html / install.html / usage.html / privacy.html */

* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #0b1020;
    --bg-2: #121a33;
    --card: #161f3a;
    --line: #243056;
    --text: #e8edff;
    --muted: #9aa6cc;
    --brand: #4f8cff;
    --brand-2: #36c2ff;
    --accent: #2db35a;
    --warn: #f0a440;
    --naver: #03c75a;
}
html, body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ---------- Top nav (sticky, shared) ---------- */
.topnav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 16, 32, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.topnav .nav-row {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 56px;
}
.brand-mark {
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.5px;
    color: var(--text);
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-mark:hover { text-decoration: none; }
.nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-width: 0;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: rgba(54, 194, 255, 0.08); text-decoration: none; }
.nav-link.active {
    color: var(--text);
    background: rgba(79, 140, 255, 0.18);
}

.lang-switch {
    display: inline-flex;
    background: rgba(11,16,32,0.7);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
    font-size: 12px;
}
.lang-switch button {
    background: transparent;
    border: 0;
    color: var(--muted);
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: background .15s, color .15s;
}
.lang-switch button.active {
    background: var(--brand);
    color: #061026;
}

/* ---------- Search (topnav) ---------- */
.search {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.search-toggle {
    display: none; /* mobile only */
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    width: 32px; height: 32px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    transition: color .15s, background .15s, border-color .15s;
}
.search-toggle:hover { color: var(--text); background: rgba(54,194,255,0.08); }
.search-input {
    background: rgba(11,16,32,0.7);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-family: inherit;
    width: 220px;
    outline: none;
    transition: border-color .15s, background .15s, width .2s;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { border-color: var(--brand-2); background: rgba(11,16,32,0.85); }
.search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(480px, calc(100vw - 24px));
    max-height: 70vh;
    overflow-y: auto;
    background: rgba(15, 22, 44, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.5);
    z-index: 60;
    padding: 6px;
}
.search-row {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background .12s;
}
.search-row:hover, .search-row.is-active {
    background: rgba(79,140,255,0.18);
    text-decoration: none;
}
.search-row-meta {
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--brand-2);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 2px;
}
.search-row-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    line-height: 1.35;
}
.search-row-body {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.search-row mark {
    background: rgba(54,194,255,0.25);
    color: var(--text);
    padding: 0 2px;
    border-radius: 3px;
}
.search-empty {
    padding: 14px 12px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

/* PC-only refinements: opaque card-toned dropdown that reads cleanly over
   the page content (mobile keeps its own translucent / full-width look). */
@media (min-width: 601px) {
    .search-input {
        background: var(--card);
    }
    .search-input:focus {
        background: var(--card);
        border-color: var(--brand-2);
    }
    .search-results {
        background: var(--card);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        border: 1px solid var(--line);
        box-shadow: 0 18px 48px rgba(0,0,0,0.7), 0 4px 16px rgba(0,0,0,0.5);
    }
    .search-row:hover, .search-row.is-active {
        background: rgba(79,140,255,0.28);
    }
}

/* ---------- Hero (index only) ---------- */
header.hero {
    background: radial-gradient(1200px 500px at 20% -10%, rgba(79,140,255,0.35), transparent 60%),
                radial-gradient(900px 400px at 90% 0%, rgba(54,194,255,0.25), transparent 60%),
                var(--bg);
    padding: 72px 0 56px;
    border-bottom: 1px solid var(--line);
}
.badge {
    display: inline-block;
    font-size: 12px;
    color: var(--brand-2);
    border: 1px solid rgba(54,194,255,0.4);
    background: rgba(54,194,255,0.08);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 18px;
    letter-spacing: 0.4px;
}
h1.title {
    font-size: 44px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 14px;
}
h1.title .grad {
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.lede {
    font-size: 18px;
    color: var(--muted);
    max-width: 680px;
    margin-bottom: 28px;
}

/* compact page header (install/usage/privacy) */
.page-header {
    padding: 56px 0 32px;
    border-bottom: 1px solid var(--line);
}
.page-header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 10px;
}
.page-header .sub {
    color: var(--muted);
    font-size: 16px;
    max-width: 680px;
}

/* ---------- Buttons / CTAs ---------- */
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn.primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-color: transparent;
    color: #061026;
}
.btn.naver {
    background: var(--naver);
    border-color: transparent;
    color: #062613;
}
.btn.brand {
    background: rgba(54,194,255,0.12);
    border-color: rgba(54,194,255,0.4);
    color: var(--brand-2);
}
.btn.ghost { background: transparent; }
.btn .ico { font-weight: 700; }

/* ---------- Sections ---------- */
section { padding: 56px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }
h2.sec {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}
.sec-desc { color: var(--muted); margin-bottom: 28px; }
h3.sub-sec {
    font-size: 18px;
    font-weight: 700;
    margin: 22px 0 10px;
}

/* ---------- Cards / grids ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
}
.card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card p { color: var(--muted); font-size: 14px; }
.card .emoji {
    display: inline-flex;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(79,140,255,0.15);
    color: var(--brand-2);
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* ---------- 3-stage flow ---------- */
.flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 12px;
    align-items: stretch;
}
.flow .node {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}
.flow .node .top { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.flow .node .mid { font-weight: 700; font-size: 16px; }
.flow .node .bot { font-size: 12px; color: var(--muted); margin-top: 6px; }
.flow .arrow {
    display: flex; align-items: center; justify-content: center;
    color: var(--brand-2); font-weight: 700; font-size: 18px;
}
@media (max-width: 720px) {
    .flow { grid-template-columns: 1fr; }
    .flow .arrow { transform: rotate(90deg); }
}

/* ---------- Cafe hero ---------- */
.cafe-hero {
    background: linear-gradient(135deg, rgba(3,199,90,0.12), rgba(3,199,90,0.04));
    border: 1px solid rgba(3,199,90,0.3);
    border-radius: 16px;
    padding: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.cafe-hero .left h3 { font-size: 22px; margin-bottom: 6px; }
.cafe-hero .left p { color: var(--muted); font-size: 14px; max-width: 520px; }

ul.bullets {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px 24px;
    color: var(--muted);
}
ul.bullets li::before {
    content: "✓";
    color: var(--accent);
    margin-right: 8px;
    font-weight: 700;
}
ul.bullets-1col {
    list-style: none;
    color: var(--muted);
    display: grid;
    gap: 8px;
}
ul.bullets-1col li::before {
    content: "•";
    color: var(--brand-2);
    margin-right: 10px;
    font-weight: 700;
}

/* ---------- Steps ---------- */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.step {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    position: relative;
    display: flex;
    flex-direction: column;
}
.step .num {
    position: absolute;
    top: -14px;
    left: 18px;
    width: 28px; height: 28px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #061026;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 14px;
}
.step h3 { font-size: 17px; margin-bottom: 6px; margin-top: 4px; }
.step p { color: var(--muted); font-size: 14px; flex: 1; margin-bottom: 14px; }
.step ul { color: var(--muted); font-size: 13px; margin: 6px 0 14px 18px; }
.step ul li { margin-bottom: 4px; }
.step .btn { width: 100%; justify-content: center; }

/* ---------- Big CTA tiles (index bottom) ---------- */
.cta-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.cta-tile {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, rgba(79,140,255,0.10), rgba(54,194,255,0.04));
    border: 1px solid rgba(54,194,255,0.30);
    border-radius: 16px;
    padding: 28px;
    color: var(--text);
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.cta-tile:hover {
    transform: translateY(-2px);
    border-color: var(--brand-2);
    text-decoration: none;
    background: linear-gradient(135deg, rgba(79,140,255,0.18), rgba(54,194,255,0.08));
}
.cta-tile .ico { font-size: 26px; margin-bottom: 10px; }
.cta-tile h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.cta-tile p { color: var(--muted); font-size: 14px; }
.cta-tile .arrow-right {
    margin-top: 14px;
    color: var(--brand-2);
    font-weight: 700;
}

/* ---------- Callout (PAT bootstrap emphasis, etc.) ---------- */
.callout {
    border-left: 3px solid var(--brand-2);
    background: rgba(54,194,255,0.06);
    border-radius: 0 12px 12px 0;
    padding: 16px 20px;
    color: var(--text);
    font-size: 14px;
    margin: 16px 0;
}
.callout strong { color: var(--brand-2); }
.callout.warn {
    border-left-color: var(--warn);
    background: rgba(240,164,64,0.08);
}
.callout.warn strong { color: var(--warn); }
.callout.success {
    border-left-color: var(--accent);
    background: rgba(45,179,90,0.08);
}
.callout.success strong { color: var(--accent); }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; margin: 12px 0; }
table.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 520px;
}
table.tbl th, table.tbl td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
table.tbl th {
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(36,48,86,0.4);
}
table.tbl td.kbd, table.tbl code, .kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    color: var(--brand-2);
    background: rgba(54,194,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
}
table.tbl .star {
    color: var(--warn);
    font-weight: 700;
    margin-right: 4px;
}

/* ---------- Footer ---------- */
footer {
    padding: 32px 0 64px;
    color: var(--muted);
    font-size: 13px;
}
footer .row {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
    h1.title { font-size: 34px; }
    .lede { font-size: 16px; }
    section { padding: 44px 0; }
    .topnav .nav-row { gap: 8px; height: 52px; }
    .nav-link { padding: 6px 8px; font-size: 13px; }
    .lang-switch { font-size: 11px; padding: 2px; flex-shrink: 0; }
    .lang-switch button { padding: 4px 9px; }
    .page-header { padding: 44px 0 24px; }
    .page-header h1 { font-size: 26px; }
    /* Mobile: drop "두더싱" from the nav — footer + home #cafe section already cover it */
    .nav-link[data-i18n="nav.cafe"] { display: none; }
    /* Mobile: single language-toggle — show only the OTHER language button.
       Hides the button matching the current lang, so a tap always switches. */
    html[lang="ko"] .lang-switch button[data-lang="ko"],
    html[lang="en"] .lang-switch button[data-lang="en"] { display: none; }

    /* Mobile: collapsible search — icon by default, full-width input on toggle. */
    .search-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .search-input { display: none; }
    .topnav.searching .nav-links,
    .topnav.searching .lang-switch,
    .topnav.searching .brand-mark { display: none; }
    .topnav.searching .search { flex: 1; min-width: 0; }
    .topnav.searching .search-input {
        display: block;
        width: 100%;
        padding: 8px 14px;
    }
    .topnav.searching .search-toggle::before { content: '\00d7'; font-size: 20px; }
    .topnav.searching .search-toggle { font-size: 0; }
    .search-results { right: -8px; left: -8px; width: auto; }
}
@media (max-width: 420px) {
    .nav-link { padding: 5px 6px; font-size: 12px; }
    .topnav .nav-row { gap: 6px; }
    .brand-mark { font-size: 13px; }
}
@media (max-width: 360px) {
    .brand-mark { display: none; }
}

/* Per-language content blocks (used by release-notes / quickstart pages).
   Pair the same card twice with data-lang="ko" / data-lang="en"; CSS hides the other.
   :not(button) excludes the lang-switch buttons themselves, which also use data-lang. */
html[lang="ko"] [data-lang="en"]:not(button),
html[lang="en"] [data-lang="ko"]:not(button) { display: none; }
