:root {
    --purple: #7c3aed;
    --purple-dark: #5b21b6;
    --lilac: #ede9fe;
    --blue: #2563eb;
    --green: #16a34a;
    --yellow: #facc15;
    --red: #dc2626;
    --ink: #1e293b;
    --muted: #64748b;
    --line: #dbe3ef;
    --soft: #f8fafc;
    --white: #ffffff;
    --shadow: 0 18px 50px rgba(30, 41, 59, 0.11);
}

body {
    background: var(--soft);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 74px;
    padding: 0.85rem clamp(1rem, 4vw, 3rem);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    color: var(--white);
    background: var(--purple);
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    font-size: 0.8rem;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.top-nav a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.85rem;
    color: var(--muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
}

.top-nav a:hover,
.top-nav a:focus-visible {
    color: var(--purple-dark);
    background: var(--lilac);
    outline: none;
}

.top-nav .nav-button {
    color: var(--white);
    background: var(--purple);
}

.page-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.page-shell.narrow {
    width: min(760px, calc(100% - 2rem));
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 0.18rem 0.55rem;
    border-radius: 8px;
    color: var(--purple-dark);
    background: var(--lilac);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.72rem 1rem;
    border: 0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-1px);
    outline: 3px solid rgba(124, 58, 237, 0.24);
}

.button.primary {
    color: var(--white);
    background: var(--purple);
    box-shadow: 0 12px 24px rgba(124, 58, 237, 0.24);
}

.button.ghost {
    color: var(--purple-dark);
    background: var(--white);
    border: 1px solid var(--line);
}

.button.soft {
    color: var(--purple-dark);
    background: var(--lilac);
}

.button.muted {
    color: #64748b;
    background: #e2e8f0;
}

.button.full {
    width: 100%;
}

.button:disabled {
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.flash {
    width: min(920px, calc(100% - 2rem));
    margin: 1rem auto 0;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--white);
    box-shadow: var(--shadow);
    font-weight: 700;
}

.flash-success {
    border-color: #bbf7d0;
    color: #166534;
    background: #f0fdf4;
}

.flash-error {
    border-color: #fecaca;
    color: #991b1b;
    background: #fef2f2;
}

.flash-info {
    border-color: #bfdbfe;
    color: #1d4ed8;
    background: #eff6ff;
}

.hero {
    position: relative;
    min-height: calc(100svh - 150px);
    display: grid;
    align-items: center;
    overflow: hidden;
    padding: clamp(3rem, 7vh, 5rem) clamp(1rem, 5vw, 4rem);
    background: #f5f3ff;
    border-bottom: 1px solid var(--line);
}

.hero::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 34%;
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0.12) 0 2px, transparent 2px 100%),
        linear-gradient(0deg, rgba(124, 58, 237, 0.12) 0 2px, transparent 2px 100%);
    background-size: 56px 56px;
}

.hero-copy {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.hero h1 {
    margin: 1rem 0 0.85rem;
    max-width: 11ch;
    font-size: 3.9rem;
    line-height: 1;
}

.hero p {
    max-width: 560px;
    color: #334155;
    font-size: 1.18rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.6rem;
}

.hero-board {
    position: absolute;
    right: clamp(1rem, 5vw, 4rem);
    bottom: clamp(1rem, 5vh, 3rem);
    width: min(520px, 43vw);
    min-height: 360px;
    opacity: 0.95;
}

.map-path {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: end;
    gap: 1rem;
}

.map-node {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 8px;
    color: var(--muted);
    background: #e2e8f0;
    border: 4px solid var(--white);
    box-shadow: var(--shadow);
    font-size: 1.5rem;
    font-weight: 900;
}

.map-node.done {
    color: var(--white);
    background: var(--green);
}

.map-node.active {
    align-self: center;
    color: var(--white);
    background: var(--purple);
}

.map-node.boss {
    align-self: start;
    color: #713f12;
    background: var(--yellow);
}

.mini-preview {
    position: absolute;
    right: 1rem;
    top: 1rem;
    width: min(330px, 100%);
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.window-dot-row {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.window-dot-row span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--line);
}

.mini-preview h2 {
    margin: 0 0 0.5rem;
    color: var(--purple-dark);
}

.mini-preview p {
    margin: 0 0 0.8rem;
    font-size: 0.95rem;
}

.mini-preview a {
    color: var(--blue);
    font-weight: 800;
}

.feature-band {
    width: min(1180px, calc(100% - 2rem));
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.2rem auto 4rem;
}

.feature-band article,
.auth-card,
.notice-card,
.profile-card {
    padding: 1.3rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.feature-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    color: var(--white);
    background: var(--blue);
    font-weight: 900;
}

.feature-band h2,
.auth-card h1,
.notice-card h1,
.profile-card h1 {
    margin: 0.8rem 0 0.5rem;
}

.feature-band p,
.auth-card p,
.notice-card p,
.profile-card p {
    color: var(--muted);
}

.auth-shell {
    min-height: calc(100svh - 74px);
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: min(480px, 100%);
}

.stack-form {
    display: grid;
    gap: 0.85rem;
    margin-top: 1.3rem;
}

.stack-form label {
    display: grid;
    gap: 0.35rem;
    color: var(--ink);
    font-weight: 800;
}

.stack-form input,
.stack-form textarea {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
}

.stack-form input:focus,
.stack-form textarea:focus {
    border-color: var(--purple);
    outline: 3px solid rgba(124, 58, 237, 0.16);
}

.form-errors {
    display: grid;
    gap: 0.35rem;
    margin-top: 1rem;
    padding: 0.8rem;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    background: #fef2f2;
}

.form-errors p,
.auth-switch {
    margin: 0;
}

.auth-switch {
    margin-top: 1rem;
    text-align: center;
}

.auth-switch a,
.back-link {
    color: var(--blue);
    font-weight: 800;
}

.page-title {
    margin-bottom: 1.4rem;
}

.page-title h1 {
    margin: 0.7rem 0 0.4rem;
    font-size: 2.2rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 1.3rem 0 0;
}

.profile-stats div {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.profile-stats dt {
    color: var(--muted);
    font-size: 0.9rem;
}

.profile-stats dd {
    margin: 0.2rem 0 0;
    font-size: 1.25rem;
    font-weight: 900;
}

@media (max-width: 900px) {
    .hero-board {
        position: relative;
        right: auto;
        bottom: auto;
        width: 100%;
        min-height: 320px;
        margin-top: 2rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .feature-band {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-nav {
        width: 100%;
    }

    .top-nav a {
        flex: 1 1 auto;
    }

    .hero {
        padding-top: 2rem;
    }

    .hero h1 {
        font-size: 2.45rem;
    }

    .hero-actions .button {
        flex: 1 1 100%;
    }

    .mini-preview {
        right: 0;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }
}
