:root {
    --bg: #0b1120;
    --bg-elevated: #121a2e;
    --bg-elevated-2: #182036;
    --text: #e7ebf5;
    --text-muted: #99a3bf;
    --accent: #5eead4;
    --accent-strong: #2dd4bf;
    --accent-warm: #fbbf24;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.55);
    --radius: 16px;
    --max-width: 880px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 76px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(600px circle at 15% -10%, rgba(94, 234, 212, 0.12), transparent 60%),
        radial-gradient(500px circle at 90% 10%, rgba(251, 191, 36, 0.08), transparent 55%);
}

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

a:hover {
    text-decoration: underline;
}

.wrap {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(11, 17, 32, 0.75);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-width: 1040px;
}

.logo {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text);
    text-decoration: none;
    font-size: 1.05rem;
}

.logo:hover {
    text-decoration: none;
    color: var(--accent);
}

.logo .dot {
    color: var(--accent);
}

.site-nav {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.92rem;
    transition: color 0.15s ease, background 0.15s ease;
}

.site-nav a:hover {
    color: var(--text);
    background: var(--bg-elevated);
    text-decoration: none;
}

.site-nav a.is-active {
    color: var(--bg);
    background: var(--accent);
}

.nav-toggle {
    display: none;
}

/* Hero */
.hero {
    max-width: 1040px;
    margin: 0 auto;
    padding: 96px 24px 64px;
}

.hero-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

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

.hero-photo {
    flex-shrink: 0;
    width: 260px;
    height: auto;
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(94, 234, 212, 0.35);
    box-shadow: 0 0 0 8px rgba(94, 234, 212, 0.08), var(--shadow);
}

.eyebrow {
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0 0 12px;
    font-weight: 600;
}

.hero h1 {
    font-size: clamp(2.1rem, 5vw, 3.2rem);
    margin: 0 0 18px;
    line-height: 1.25;
}

.hero .lead {
    color: var(--text-muted);
    font-size: 1.08rem;
    max-width: 56ch;
    margin: 0 0 32px;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent);
    color: #06231f;
}

.btn-primary:hover {
    background: var(--accent-strong);
}

.btn-ghost {
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Sections */
main {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 24px;
}

section.panel {
    padding: 64px 0;
    border-top: 1px solid var(--border);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

section.panel.is-visible {
    opacity: 1;
    transform: none;
}

.section-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 32px;
}

.section-head h2 {
    font-size: 1.6rem;
    margin: 0;
}

.section-head .section-num {
    color: var(--accent);
    font-family: monospace;
    font-size: 0.95rem;
}

/* About */
#about h3,
#grappling h3 {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin: 28px 0 12px;
    font-weight: 600;
}

.tag-group {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.tag-group .tag-label {
    width: 84px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tags li {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    color: var(--text);
}

/* Works */
.work-card {
    display: flex;
    gap: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}

.work-card + .work-card {
    margin-top: 20px;
}

.work-icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: linear-gradient(145deg, #2dd4bf, #fbbf24);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.work-body {
    min-width: 0;
}

.work-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.work-title-row h3 {
    margin: 0;
    font-size: 1.15rem;
}

.badge {
    font-size: 0.75rem;
    color: var(--accent-warm);
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.08);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.work-body p {
    color: var(--text-muted);
    margin: 0 0 18px;
}

.work-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

/* Grappling */
.discipline-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: start;
    gap: 16px;
    margin-bottom: 32px;
}

.discipline-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.discipline-card h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    color: var(--text);
    font-weight: 600;
}

.discipline-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 12px;
}

.badge-accent {
    color: var(--accent);
    border-color: rgba(94, 234, 212, 0.35);
    background: rgba(94, 234, 212, 0.1);
}

.belt-history {
    list-style: none;
    margin: 14px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.belt-history li {
    display: flex;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.belt-history time {
    flex-shrink: 0;
    width: 118px;
    font-family: monospace;
    white-space: nowrap;
}

.belt-history li:last-child {
    color: var(--accent);
    font-weight: 600;
}

.result-badge {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--bg-elevated-2);
    padding: 2px 10px;
    border-radius: 999px;
    margin-left: 8px;
    white-space: nowrap;
}

.result-badge.is-win {
    color: var(--accent);
    border-color: rgba(94, 234, 212, 0.35);
    background: rgba(94, 234, 212, 0.1);
}

.result-badge.is-runnerup {
    color: #cbd5e1;
    border-color: rgba(203, 213, 225, 0.35);
    background: rgba(203, 213, 225, 0.1);
}

.record-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.record-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.record-row dt {
    width: 84px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.record-row dd {
    margin: 0;
    color: var(--text);
    font-size: 0.95rem;
}

/* Resume timeline */
.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--border);
}

.timeline li {
    position: relative;
    padding: 0 0 32px 28px;
}

.timeline li:last-child {
    padding-bottom: 0;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--bg);
}

.timeline time {
    display: block;
    font-size: 0.85rem;
    color: var(--accent);
    font-family: monospace;
    margin-bottom: 4px;
}

.timeline .event {
    color: var(--text);
    font-size: 1rem;
}

.timeline .event-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: 4px 0 0;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 24px 48px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.site-footer a {
    color: var(--text-muted);
}

.site-footer a:hover {
    color: var(--accent);
}

/* Mobile */
@media (max-width: 640px) {
    /* Base (no-JS) fallback: the nav sits in normal flow as a plain,
       always-visible, always-focusable stacked list, so the header has to
       wrap and grow to fit it instead of clipping it at 64px. Once
       main.js confirms JS is running (html.js), the nav switches to a
       fixed-position overlay that doesn't affect header height, so the
       header goes back to its fixed-height row layout. */
    .site-header .wrap {
        max-width: none;
        flex-wrap: wrap;
        height: auto;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    html.js .site-header .wrap {
        flex-wrap: nowrap;
        height: 64px;
        padding-top: 0;
        padding-bottom: 0;
    }

    .site-nav {
        flex-direction: column;
        flex-basis: 100%;
        gap: 2px;
        margin-top: 12px;
    }

    .site-nav a {
        border-radius: 10px;
        padding: 10px 14px;
    }

    html.js .site-nav {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        margin-top: 0;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        padding: 8px;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s ease, transform 0.15s ease;
    }

    html.js .site-nav.is-open {
        transform: none;
        opacity: 1;
        pointer-events: auto;
    }

    /* The toggle button is only useful once JS can drive it; without JS
       the nav is already fully visible, so keep the button out of the way. */
    html.js .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        border: 1px solid var(--border);
        background: transparent;
        color: var(--text);
        font-size: 1.1rem;
        cursor: pointer;
    }

    .hero {
        padding: 72px 24px 48px;
    }

    .hero-layout {
        flex-direction: column;
        align-items: flex-start;
        gap: 28px;
    }

    .hero-photo {
        order: -1;
        width: 140px;
        border-radius: 50%;
    }

    .work-card {
        flex-direction: column;
    }

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

    .tag-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .tag-group .tag-label {
        width: auto;
    }

    .record-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .record-row dt {
        width: auto;
    }
}
