:root {
    --bg: #f4f4f4;
    --paper: #ffffff;
    --paper-alt: #ededed;
    --ink: #111111;
    --ink-soft: #343434;
    --muted: #666666;
    --line: #111111;
    --hairline: #d4d4d4;
    --accent: #ff4b32;
    --accent-blue: #0057ff;
    --success: #0d7a45;
    --danger: #c92222;
    --radius: 3px;
    --shadow-hard: 7px 7px 0 rgba(17, 17, 17, 0.09);
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(17, 17, 17, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 17, 17, 0.045) 1px, transparent 1px);
    background-size: 38px 38px;
    font-family: Inter, "Noto Sans KR", "Noto Sans JP", Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
.button-link,
input,
select,
textarea {
    border-radius: var(--radius);
}

.shell {
    width: min(1220px, calc(100% - 36px));
    margin: 0 auto;
    padding: 18px 0 56px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    font-size: 0.98rem;
    font-weight: 900;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 12px;
    border: 1px solid transparent;
    color: var(--ink-soft);
    font-size: 0.92rem;
    font-weight: 700;
}

.nav a.active,
.nav a:hover {
    border-color: var(--line);
    background: var(--ink);
    color: var(--paper);
}

.hero,
.panel,
.card,
.table-wrap,
.summary {
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow-hard);
}

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    gap: 28px;
    margin-bottom: 22px;
    padding: 34px;
    overflow: hidden;
}

.home-hero {
    min-height: min(660px, calc(100vh - 118px));
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    padding: clamp(32px, 7vw, 86px);
    border: 0;
    color: var(--paper);
    background:
        linear-gradient(90deg, rgba(7, 9, 12, 0.94) 0%, rgba(7, 9, 12, 0.74) 45%, rgba(7, 9, 12, 0.28) 100%),
        url("/img/neuro-memory-bg.png") center / cover no-repeat;
    box-shadow: none;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 9px;
    background: var(--accent);
}

.home-hero::before {
    width: 11px;
}

.home-hero::after {
    content: "";
    position: absolute;
    right: 34px;
    bottom: 34px;
    width: min(34vw, 420px);
    height: 2px;
    background: var(--accent);
}

.hero > div:first-child {
    display: grid;
    align-content: start;
    gap: 16px;
    padding-left: 6px;
}

.home-hero-copy {
    position: relative;
    z-index: 1;
    display: grid;
    max-width: 820px;
    gap: 18px;
}

.hero h1 {
    max-width: 900px;
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 5.35rem);
    font-weight: 900;
    line-height: 0.96;
}

.home-hero h1 {
    max-width: 860px;
    font-size: clamp(3rem, 7.6vw, 6.6rem);
    letter-spacing: 0;
}

.hero p {
    max-width: 760px;
    margin: 0;
    color: var(--ink-soft);
    font-size: 1.04rem;
    line-height: 1.72;
}

.home-hero p {
    color: rgba(255, 255, 255, 0.82);
}

.home-kicker {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    width: fit-content;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    padding: 8px 11px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
}

.home-kicker span {
    color: var(--paper);
    font-weight: 900;
}

.home-hero .eyebrow {
    color: var(--accent);
}

.home-hero .button-link {
    border-color: rgba(255, 255, 255, 0.95);
}

.home-hero .primary {
    background: var(--paper);
    color: var(--ink);
}

.home-hero .primary:hover {
    background: var(--accent);
    color: var(--ink);
}

.home-hero .secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--paper);
}

.home-hero .secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.hero-aside {
    display: grid;
    gap: 12px;
}

.home-proof-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    width: min(100%, 780px);
    margin-top: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.52);
    background: rgba(255, 255, 255, 0.52);
}

.home-proof-row article {
    display: grid;
    gap: 7px;
    min-height: 128px;
    padding: 16px;
    background: rgba(8, 10, 14, 0.66);
}

.home-proof-row span {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
}

.home-proof-row strong {
    color: var(--paper);
    font-size: 1.08rem;
}

.home-proof-row small {
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.45;
}

.home-equation {
    position: absolute;
    z-index: 1;
    right: clamp(22px, 5vw, 72px);
    bottom: clamp(24px, 5vw, 62px);
    display: grid;
    max-width: 360px;
    gap: 7px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    background: rgba(8, 10, 14, 0.64);
    color: var(--paper);
}

.home-equation span {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.home-equation strong {
    font-size: 1.08rem;
    line-height: 1.15;
}

.home-equation small {
    color: rgba(255, 255, 255, 0.66);
    line-height: 1.45;
}

.home-feature-strip {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 18px;
    align-items: end;
    margin-bottom: 16px;
    padding: 12px 0 18px;
    border-bottom: 2px solid var(--line);
}

.home-feature-strip h2 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(1.7rem, 4vw, 3.65rem);
    font-weight: 900;
    line-height: 1.02;
}

.home-feature-strip p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 1rem;
    line-height: 1.72;
}

.summary {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-width: 1.5px;
    box-shadow: none;
}

.summary:nth-child(2) {
    border-left: 9px solid var(--accent-blue);
}

.summary:nth-child(3) {
    border-left: 9px solid var(--success);
}

.summary:nth-child(4) {
    border-left: 9px solid var(--accent);
}

.summary h3,
.panel h2,
.table-header h2,
.card h3 {
    margin: 0;
    font-size: 1.26rem;
    line-height: 1.18;
}

.summary p,
.muted,
.table-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.grid.home-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-grid .card {
    min-height: 210px;
}

.card {
    display: grid;
    gap: 12px;
    min-height: 190px;
    padding: 22px;
    box-shadow: none;
}

.card:hover {
    border-color: var(--accent);
    box-shadow: 5px 5px 0 rgba(255, 75, 50, 0.16);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
}

.layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 18px;
}

.panel {
    padding: 24px;
}

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

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

label {
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1.5px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    padding: 12px 13px;
    outline: none;
}

textarea {
    min-height: 128px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #8a8a8a;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.18);
}

.button-row,
.filters,
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1.5px solid var(--line);
    padding: 10px 15px;
    color: var(--ink);
    background: var(--paper);
    box-shadow: 3px 3px 0 rgba(17, 17, 17, 0.12);
    cursor: pointer;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
}

button:hover,
.button-link:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 rgba(17, 17, 17, 0.16);
}

button:disabled,
button:disabled:hover {
    color: #999999;
    background: #e6e6e6;
    border-color: #bcbcbc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.primary {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper);
}

.primary:hover {
    background: var(--accent);
    color: var(--ink);
}

.secondary {
    background: var(--paper);
    color: var(--ink);
}

.secondary:hover {
    background: var(--paper-alt);
}

.danger {
    border-color: var(--danger);
    background: #fff6f4;
    color: var(--danger);
}

.danger:hover {
    background: var(--danger);
    color: var(--paper);
}

.table-wrap {
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 22px 0;
}

.table-header.compact {
    padding: 0;
}

.table-header.bottom {
    margin-top: 16px;
}

.word-browser {
    display: grid;
    gap: 18px;
}

.auth-shell {
    display: grid;
    min-height: 62vh;
    place-items: center;
}

.auth-panel {
    width: min(100%, 460px);
}

.level-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.level-tab {
    min-width: 62px;
    background: var(--paper);
    color: var(--ink-soft);
}

.level-tab.active {
    border-color: var(--ink);
    background: var(--accent);
    color: var(--ink);
    box-shadow: 3px 3px 0 rgba(255, 75, 50, 0.3);
}

.table-wrap.embedded {
    border-width: 1.5px;
    box-shadow: none;
}

.page-meta {
    justify-items: end;
}

.status-select {
    min-width: 165px;
    padding: 9px 10px;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: var(--paper);
}

th,
td {
    padding: 17px 22px;
    border-top: 1px solid var(--hairline);
    text-align: left;
    vertical-align: top;
}

th {
    border-top: 2px solid var(--line);
    background: var(--ink);
    color: var(--paper);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

tbody tr:hover {
    background: #f7f7f7;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border: 1.5px solid var(--line);
    border-radius: 2px;
    padding: 4px 8px;
    background: var(--paper);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 900;
}

.stack {
    display: grid;
    gap: 6px;
}

.message {
    padding: 13px 14px;
    border: 1.5px solid var(--line);
    border-left: 7px solid var(--accent-blue);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--muted);
}

.message.success {
    border-left-color: var(--success);
    color: var(--success);
}

.message.error {
    border-left-color: var(--danger);
    color: var(--danger);
}

.empty {
    padding: 32px 22px 38px;
    color: var(--muted);
}

.list-panel {
    display: grid;
    gap: 14px;
}

.list-item {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1.5px solid var(--line);
    border-left: 8px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    cursor: pointer;
}

.list-item:hover {
    border-left-color: var(--accent);
    background: #f8f8f8;
}

.list-item.active {
    border-left-color: var(--accent-blue);
    background: #f3f7ff;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.detail-card {
    display: grid;
    gap: 18px;
    padding: 22px;
}

.comment-list {
    display: grid;
    gap: 12px;
}

.comment-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
}

.comment-card.reply {
    margin-left: 24px;
    border-left: 8px solid var(--accent);
    background: #fff6f4;
}

.section-divider {
    height: 2px;
    background: var(--line);
}

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

.stat {
    display: grid;
    gap: 8px;
    padding: 16px 0 0;
    border-top: 2px solid var(--line);
    background: transparent;
}

.stat strong {
    display: block;
    font-size: 2.05rem;
    font-weight: 900;
    line-height: 1;
}

.progress-grid {
    margin-top: 0;
}

.level-progress {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.level-progress-item {
    display: grid;
    gap: 7px;
    padding: 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
}

.level-progress-item progress {
    width: 100%;
    height: 9px;
    accent-color: var(--accent-blue);
}

.review-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-width: 220px;
    gap: 8px;
}

.review-actions button {
    min-height: 34px;
    padding: 7px 10px;
}

.score-cell {
    display: grid;
    min-width: 190px;
    gap: 8px;
}

.score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.score-row strong {
    font-size: 1.26rem;
    line-height: 1;
}

.score-meter {
    width: 100%;
    height: 9px;
    border: 1.5px solid var(--line);
    background: var(--paper-alt);
}

.score-meter span {
    display: block;
    height: 100%;
    background: var(--danger);
}

.score-meter.mid span {
    background: var(--accent);
}

.score-meter.high span {
    background: var(--success);
}

@media (max-width: 960px) {
    .hero,
    .layout,
    .grid,
    .home-feature-strip,
    .level-progress {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 28px;
    }

    .home-hero {
        min-height: 640px;
    }

    .home-equation {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        max-width: 100%;
        margin-top: 12px;
    }

    .table-wrap {
        overflow-x: auto;
    }
}

@media (max-width: 640px) {
    .shell {
        width: min(100% - 20px, 1220px);
        padding-top: 12px;
    }

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

    .nav {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
    }

    .nav a {
        justify-content: center;
        min-width: 0;
        padding-inline: 8px;
    }

    .hero,
    .panel,
    .card,
    .summary {
        padding: 18px;
    }

    .home-hero {
        padding: 22px;
    }

    .hero h1 {
        font-size: clamp(2.1rem, 14vw, 3.4rem);
    }

    .home-hero h1 {
        font-size: clamp(2.62rem, 15vw, 4.55rem);
    }

    .home-proof-row {
        grid-template-columns: 1fr;
    }

    .home-proof-row article {
        min-height: auto;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    th,
    td {
        padding: 14px 16px;
    }

    .page-meta {
        justify-items: start;
    }

    .comment-card.reply {
        margin-left: 12px;
    }
}
