:root {
    color-scheme: light;
    --page-bg: #f8fafc;
    --surface: #ffffff;
    --surface-elevated: rgba(255, 255, 255, 0.9);
    --surface-muted: #f1f5f9;
    --surface-strong: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --primary: #3a5ef0;
    --primary-hover: #2944d8;
    --primary-pressed: #2436ad;
    --primary-soft: #eef4ff;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --discord: #5865f2;
    --discord-hover: #4752c4;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
    --shadow-card: 0 24px 80px -32px rgba(15, 23, 42, 0.32);
    --glow: 0 10px 40px -10px rgba(58, 94, 240, 0.35);
    --focus-ring: rgba(58, 94, 240, 0.16);
}

[data-theme="dark"] {
    color-scheme: dark;
    --page-bg: #090d18;
    --surface: #121827;
    --surface-elevated: rgba(18, 24, 39, 0.9);
    --surface-muted: #1b2436;
    --surface-strong: #263247;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --border: rgba(148, 163, 184, 0.22);
    --border-strong: rgba(148, 163, 184, 0.34);
    --primary: #6f8cff;
    --primary-hover: #91a5ff;
    --primary-pressed: #526ce0;
    --primary-soft: rgba(58, 94, 240, 0.18);
    --success: #34d399;
    --warning: #f59e0b;
    --danger: #f87171;
    --discord: #6670ff;
    --discord-hover: #7b84ff;
    --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 26px 70px rgba(0, 0, 0, 0.42);
    --focus-ring: rgba(111, 140, 255, 0.24);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    color: var(--text-main);
    background: var(--page-bg);
    font-family: Pretendard, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Segoe UI", system-ui, sans-serif;
    letter-spacing: 0;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background:
        linear-gradient(180deg, rgba(238, 244, 255, 0.88) 0, rgba(248, 250, 252, 0) 360px),
        repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.08) 0 1px, transparent 1px 90px);
}

[data-theme="dark"] body::before {
    background:
        linear-gradient(180deg, rgba(58, 94, 240, 0.12) 0, rgba(9, 13, 24, 0) 360px),
        repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.06) 0 1px, transparent 1px 90px);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.floating-navbar {
    position: sticky;
    z-index: 20;
    top: 0;
    width: 100%;
    min-height: 64px;
    display: grid;
    grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
    align-items: center;
    gap: 18px;
    padding: 10px max(20px, calc((100vw - 1120px) / 2));
    background: var(--surface-elevated);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 800;
    white-space: nowrap;
}

.brand-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 12px;
    color: #ffffff;
    background: var(--primary);
    box-shadow: var(--glow);
}

.brand-icon svg,
.nav-dropdown-trigger svg,
.theme-toggle svg,
.discord-icon {
    fill: currentColor;
}

.brand-icon svg {
    width: 21px;
    height: 21px;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.nav-links a,
.nav-dropdown-trigger {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius-sm);
    color: #475569;
    background: transparent;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

[data-theme="dark"] .nav-links a,
[data-theme="dark"] .nav-dropdown-trigger {
    color: var(--text-muted);
}

.nav-links a:hover,
.nav-links a.active,
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.active,
.nav-dropdown:focus-within .nav-dropdown-trigger {
    color: var(--text-main);
    background: var(--surface-muted);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger svg {
    width: 15px;
    height: 15px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    min-width: 198px;
    display: none;
    padding: 8px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transform: translateX(-50%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
    display: grid;
    gap: 4px;
}

.dropdown-menu a {
    justify-content: flex-start;
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.theme-toggle,
.support-button,
.primary-link,
.secondary-link,
.download-panel button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.93rem;
    font-weight: 800;
    white-space: nowrap;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.theme-toggle {
    width: auto;
    min-width: auto;
    margin: 0;
    border: 1px solid var(--border);
    padding: 0 13px;
    color: var(--text-main);
    background: var(--surface);
}

.theme-toggle:hover,
.secondary-link:hover {
    background: var(--surface-muted);
}

.theme-toggle:active,
.support-button:active,
.primary-link:active,
.secondary-link:active,
.download-panel button:active {
    transform: translateY(1px);
}

.theme-toggle svg {
    width: 17px;
    height: 17px;
}

.theme-toggle .moon-icon,
[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: inline-block;
}

.support-button {
    padding: 0 16px;
    color: #ffffff;
    background: var(--discord);
    box-shadow: 0 10px 22px rgba(88, 101, 242, 0.22);
}

.support-button:hover {
    background: var(--discord-hover);
    box-shadow: 0 12px 24px rgba(88, 101, 242, 0.26);
}

.discord-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.app-shell,
.legal-shell {
    flex: 1;
    width: 100%;
}

.app-shell {
    display: grid;
    align-items: center;
    padding: 72px 20px 80px;
}

.hero-section {
    width: min(1120px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.04fr 0.96fr;
    align-items: center;
    gap: 56px;
}

.hero-copy {
    min-width: 0;
}

.pill {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 7px 12px;
    border: 1px solid #bcd0ff;
    border-radius: 999px;
    color: #2436ad;
    background: rgba(238, 244, 255, 0.86);
    font-size: 0.76rem;
    font-weight: 900;
}

[data-theme="dark"] .pill {
    border-color: rgba(111, 140, 255, 0.5);
    color: #dbe6ff;
    background: rgba(58, 94, 240, 0.2);
}

.pill::before {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--primary);
    content: "";
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 4rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.hero-copy h1 span {
    color: var(--primary);
}

.subtext {
    margin: 18px 0 0;
    color: var(--text-muted);
    font-size: 1.08rem;
    line-height: 1.78;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.primary-link,
.secondary-link {
    min-height: 48px;
    padding: 0 22px;
    font-size: 1rem;
}

.primary-link {
    color: #ffffff;
    background: var(--primary);
    box-shadow: var(--shadow-soft);
}

.primary-link:hover {
    background: var(--primary-hover);
}

.secondary-link {
    border: 1px solid var(--border-strong);
    color: #334155;
    background: var(--surface);
}

[data-theme="dark"] .secondary-link {
    color: var(--text-main);
}

.trust-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.trust-list span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 700;
}

.trust-list span::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    content: "";
}

.download-panel,
.legal-document {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.download-panel {
    max-width: 520px;
    justify-self: end;
    padding: 24px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-heading h2 {
    margin: 0;
    font-size: 1.35rem;
}

.panel-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 1.25rem;
    font-weight: 900;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 1.25;
}

h1 {
    font-size: 2rem;
    letter-spacing: 0;
}

h2 {
    margin-top: 30px;
    font-size: 1.14rem;
}

p,
li {
    line-height: 1.72;
}

form {
    display: grid;
    gap: 16px;
}

.field-group {
    display: grid;
    gap: 8px;
}

label {
    color: #334155;
    font-size: 0.9rem;
    font-weight: 800;
}

[data-theme="dark"] label {
    color: var(--text-muted);
}

input,
select,
.download-panel button {
    width: 100%;
    min-height: 46px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

input,
select {
    border: 1px solid var(--border-strong);
    padding: 0 13px;
    color: var(--text-main);
    background: var(--surface);
    outline: 0;
}

input::placeholder {
    color: var(--text-subtle);
}

input:focus,
select:focus,
.download-panel button:focus-visible,
.support-button:focus-visible,
.theme-toggle:focus-visible,
.nav-dropdown-trigger:focus-visible,
.nav-links a:focus-visible,
.primary-link:focus-visible,
.secondary-link:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus-ring);
    outline: none;
}

.download-panel button {
    margin-top: 2px;
    border: 0;
    padding: 0 18px;
    color: #ffffff;
    background: var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

.download-panel button:hover {
    background: var(--primary-hover);
}

.download-panel button:active {
    background: var(--primary-pressed);
}

.download-panel button:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.download-panel button .btn-text {
    display: inline-block;
}

.download-panel button .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.download-panel button.loading .spinner {
    display: inline-block;
}

.status {
    min-height: 26px;
    margin: 16px 0 10px;
    color: var(--primary);
    font-size: 0.92rem;
    font-weight: 750;
}

.status.error {
    color: var(--danger);
}

.status.success {
    color: var(--success);
}

.download-preview {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.file-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.file-row strong {
    display: block;
    overflow: hidden;
    color: var(--text-main);
    font-size: 0.94rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.file-type {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #2436ad;
    background: var(--primary-soft);
    font-size: 0.72rem;
    font-weight: 900;
}

[data-theme="dark"] .file-type {
    color: #dbe6ff;
}

.badge {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0 9px;
    color: #047857;
    background: #ecfdf5;
    font-size: 0.75rem;
    font-weight: 900;
}

[data-theme="dark"] .badge {
    color: #a7f3d0;
    background: rgba(5, 150, 105, 0.2);
}

.hint {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.legal-shell {
    padding: 48px 20px 72px;
}

.legal-document {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
}

.legal-document > .subtext {
    margin-bottom: 28px;
}

.legal-date {
    margin: 8px 0 28px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.legal-document section {
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid var(--border);
}

.legal-document section:first-of-type {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}

.legal-document section:first-of-type h2 {
    margin-top: 0;
}

.legal-document h2 {
    margin-top: 0;
    font-size: 1.18rem;
}

.legal-document p {
    margin: 10px 0 0;
    color: var(--text-muted);
}

.legal-document ul {
    margin: 10px 0 0;
    padding-left: 22px;
    color: var(--text-muted);
}

.legal-document li + li {
    margin-top: 4px;
}

.endpoint-row,
.status-grid > div {
    display: grid;
    gap: 8px;
    padding: 15px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.endpoint-row {
    grid-template-columns: minmax(190px, auto) 1fr;
    align-items: center;
}

.endpoint-row span {
    color: var(--text-muted);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.status-grid strong {
    font-size: 1.15rem;
}

.status-grid span {
    color: var(--text-muted);
    line-height: 1.55;
}

code {
    font-family: "SF Mono", Consolas, "Courier New", monospace;
    font-size: 0.94em;
}

pre {
    overflow-x: auto;
    margin: 14px 0 0;
    padding: 18px;
    background: #0f172a;
    border-radius: var(--radius-md);
    color: #f8fafc;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] pre {
    background: #050816;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 28px max(20px, calc((100vw - 1120px) / 2));
    color: var(--text-muted);
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.site-footer p {
    margin: 0;
    text-align: right;
}

@media (max-width: 960px) {
    .floating-navbar {
        grid-template-columns: 1fr auto;
        gap: 10px;
    }

    .nav-links {
        grid-column: 1 / -1;
        order: 3;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 2px;
    }

    .nav-actions {
        justify-content: flex-end;
    }

    .hero-section {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .download-panel {
        max-width: none;
        justify-self: stretch;
    }

    .endpoint-row,
    .status-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .floating-navbar {
        grid-template-columns: 1fr;
        align-items: stretch;
        padding: 12px;
    }

    .brand,
    .nav-links,
    .nav-actions {
        justify-content: center;
    }

    .brand {
        white-space: normal;
    }

    .nav-links {
        flex-wrap: nowrap;
    }

    .nav-actions {
        flex-wrap: wrap;
    }

    .theme-toggle,
    .support-button {
        flex: 1 1 160px;
    }

    .dropdown-menu {
        left: auto;
        right: 0;
        transform: none;
    }

    .app-shell {
        padding: 48px 16px 56px;
    }

    .hero-copy h1 {
        font-size: 2.25rem;
    }

    .hero-actions,
    .primary-link,
    .secondary-link {
        width: 100%;
    }

    .download-panel,
    .legal-document {
        border-radius: var(--radius-lg);
        padding: 24px;
    }

    .file-row {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .file-type {
        width: 40px;
        height: 40px;
    }

    .badge {
        grid-column: 2;
        width: fit-content;
    }

    .legal-shell {
        padding: 34px 16px 56px;
    }

    h1 {
        font-size: 1.58rem;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-footer p {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .download-panel button,
    .support-button,
    .theme-toggle,
    .primary-link,
    .secondary-link {
        transition: none;
    }

    .download-panel button .spinner {
        animation: none;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
