:root {
    --bg: #0b141f;
    --surface: #16202d;
    --surface-soft: #101a26;
    --ink: #dfe7ef;
    --ink-soft: #b8c7d9;
    --muted: #7d8fa4;
    --line: rgba(103, 140, 174, 0.22);
    --line-strong: rgba(133, 172, 204, 0.34);
    --teal: #66c0f4;
    --blue: #1a9fff;
    --coral: #c7d5e0;
    --gold: #acd532;
    --mint: #75b022;
    --shadow: 0 22px 48px rgba(0, 0, 0, 0.42);
    --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.28);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: #0b141f;
    overscroll-behavior-y: none;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    background:
        radial-gradient(circle at 20% 0%, rgba(102, 192, 244, 0.18), transparent 34%),
        linear-gradient(180deg, #1b2838 0%, #0b141f 48%, #08111b 100%);
    font-family: 'Inter', sans-serif;
    color: var(--ink);
    line-height: 1.5;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(102, 192, 244, 0.07), transparent 24%, rgba(117, 176, 34, 0.05) 72%, transparent),
        linear-gradient(rgba(0, 0, 0, 0.18), transparent 28%);
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 44px 24px 36px;
}

/* Header */
.profile-header {
    position: relative;
    padding: 54px 0 38px;
    margin-bottom: 38px;
    border-bottom: 1px solid var(--line);
}

.profile-header::before {
    display: none;
}

.profile-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 14px;
    padding: 7px 12px;
    border: 1px solid rgba(102, 192, 244, 0.28);
    border-radius: 999px;
    color: var(--teal);
    background: rgba(8, 17, 27, 0.76);
    font-size: 13px;
    font-weight: 700;
}

.profile-header h1 {
    max-width: 980px;
    margin-bottom: 16px;
    color: var(--ink);
    font-size: clamp(44px, 7vw, 76px);
    line-height: 1.04;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.profile-header h1 .nickname {
    display: inline;
}

.profile-header h1 .role-line {
    display: block;
}

.profile-header .tagline {
    max-width: 980px;
    color: var(--ink-soft);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.6;
}

.profile-header .tagline span {
    margin: 0 8px;
    color: var(--teal);
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 46px;
}

.achievement-grid article {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 104px;
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: linear-gradient(145deg, rgba(34, 50, 70, .88), rgba(16, 26, 38, .94));
    box-shadow: var(--shadow-soft);
}

.achievement-section-bar .section-title i,
.achievement-grid i { color: var(--gold); }
.achievement-grid i { flex: 0 0 auto; width: 34px; font-size: 28px; text-align: center; }
.achievement-grid strong,
.achievement-grid span { display: block; }
.achievement-grid strong { color: var(--ink); font-size: 18px; }
.achievement-grid span { margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }

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

.hero-actions .btn {
    flex: 0 0 auto;
    min-width: 156px;
}

/* Design Philosophy Section */
.philosophy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 178px;
    align-items: center;
    gap: 22px;
    margin-bottom: 46px;
}

.philosophy-section {
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    padding: 28px 32px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--teal);
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(22, 32, 45, 0.9), rgba(16, 26, 38, 0.72));
}

.philosophy-section::before {
    content: '"';
    position: absolute;
    top: -26px;
    right: 24px;
    color: rgba(102, 192, 244, 0.1);
    font-family: Georgia, serif;
    font-size: 150px;
    line-height: 1;
}

.philosophy-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--teal);
    font-size: 18px;
    font-weight: 800;
}

.philosophy-title i {
    color: var(--gold);
    font-size: 20px;
}

.philosophy-text {
    position: relative;
    z-index: 1;
    max-width: 980px;
    color: var(--ink-soft);
    font-size: 18px;
    line-height: 1.75;
}

.philosophy-text strong {
    color: var(--ink);
    font-style: normal;
}

.avatar-card {
    position: relative;
    overflow: hidden;
    width: 178px;
    height: 178px;
    max-width: 178px;
    max-height: 178px;
    aspect-ratio: 1;
    justify-self: end;
    border: 1px solid rgba(102, 192, 244, 0.38);
    border-radius: 22px;
    background:
        radial-gradient(circle at 28% 18%, rgba(172, 213, 50, 0.24), transparent 32%),
        linear-gradient(145deg, rgba(22, 32, 45, 0.95), rgba(8, 17, 27, 0.96));
    box-shadow: var(--shadow-soft);
}

.avatar-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%);
}

.avatar-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 28%;
    display: block;
}

/* Section title */
.section-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 42px 0 22px;
}

.section-title {
    color: var(--ink);
    font-size: 25px;
    font-weight: 800;
}

.section-title i {
    margin-right: 10px;
    color: var(--teal);
    font-size: 22px;
}

.game-count {
    flex: 0 0 auto;
    padding: 6px 12px;
    border: 1px solid rgba(172, 213, 50, 0.28);
    border-radius: 999px;
    background: rgba(117, 176, 34, 0.16);
    color: var(--gold);
    font-size: 13px;
    font-weight: 800;
}

/* Game grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.featured-section-bar .section-title i {
    color: var(--gold);
}

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

.featured-grid .game-card {
    display: grid;
    grid-template-columns: minmax(320px, 44%) 1fr;
}

.featured-grid .game-cover,
.featured-grid .game-card[data-game="joyeuse"] .game-cover {
    height: 360px;
    min-height: 330px;
    aspect-ratio: auto;
    border-right: 1px solid rgba(0, 0, 0, 0.55);
    border-bottom: 0;
}

.featured-grid .game-info,
.featured-grid .game-card[data-game="joyeuse"] .game-info {
    padding: 26px 28px;
}

.featured-grid .game-desc {
    display: block;
    overflow: visible;
    font-size: 15px;
    line-height: 1.7;
}

.project-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 2px 0 16px;
}

.project-metrics span {
    padding: 7px 10px;
    border: 1px solid rgba(172, 213, 50, .25);
    border-radius: 3px;
    background: rgba(117, 176, 34, .1);
    color: var(--ink-soft);
    font-size: 12px;
}

.project-metrics strong { color: var(--gold); }
.design-summary strong { color: var(--ink); }
.design-summary ul { margin: 7px 0 0 18px; }
.design-summary li { margin: 3px 0; }

.design-process {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.design-process span { color: #b9cbe0; }
.design-process i { color: rgba(102, 192, 244, .5); font-size: 9px; }

.featured-grid .game-title,
.featured-grid .game-card[data-game="joyeuse"] .game-title {
    font-size: 24px;
}

.game-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(103, 140, 174, 0.22);
    border-radius: 4px;
    background: linear-gradient(180deg, #223246 0%, #111b28 100%);
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.game-card:hover {
    transform: translateY(-3px);
    border-color: rgba(102, 192, 244, 0.72);
    box-shadow: var(--shadow);
}

.game-card[data-game="joyeuse"] {
    grid-column: auto;
    display: flex;
    min-height: 0;
}

.game-cover {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    height: auto;
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 0, 0, 0.55);
    background: #0e151f;
}

.game-card[data-game="joyeuse"] .game-cover {
    height: auto;
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.55);
}

.game-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tower-cover {
    background:
        radial-gradient(circle at 50% 45%, rgba(102, 192, 244, 0.22), transparent 36%),
        linear-gradient(135deg, #0d1b2a, #162c3f 54%, #07121d);
}

.tower-cover img {
    width: 62%;
    height: 82%;
    object-fit: contain;
    filter: drop-shadow(0 20px 24px rgba(0, 0, 0, 0.34));
}

.water-cover {
    background:
        radial-gradient(circle at 28% 26%, rgba(172, 213, 50, 0.24), transparent 26%),
        radial-gradient(circle at 70% 60%, rgba(102, 192, 244, 0.3), transparent 34%),
        linear-gradient(135deg, #071b2d 0%, #0f4d67 48%, #143259 100%);
}

.game-card[data-game="joyeuse"] .game-cover img {
    object-position: center;
}

.game-card:hover .game-cover img {
    transform: scale(1.045);
}

.game-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 52%, rgba(0, 0, 0, 0.42) 100%);
}

.game-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 14px 16px 16px;
    background:
        linear-gradient(90deg, rgba(22, 32, 45, 0.98), rgba(37, 55, 74, 0.96)),
        var(--surface);
}

.game-card[data-game="joyeuse"] .game-info {
    padding: 14px 16px 16px;
}

.game-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.game-title {
    color: var(--ink);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.16;
}

.game-card[data-game="joyeuse"] .game-title {
    font-size: 19px;
}

.game-year {
    flex: 0 0 auto;
    padding: 4px 9px;
    border: 1px solid rgba(102, 192, 244, 0.18);
    border-radius: 3px;
    background: rgba(102, 192, 244, 0.11);
    color: var(--teal);
    font-size: 13px;
    font-weight: 800;
}

.game-tagline {
    margin-bottom: 10px;
    padding-left: 12px;
    border-left: 3px solid var(--teal);
    color: #9fb9cc;
    font-size: 14px;
    font-weight: 700;
}

.game-desc {
    flex: 1;
    margin-bottom: 14px;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.55;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.game-card[data-game="joyeuse"] .game-desc {
    font-size: 14px;
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.game-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid rgba(102, 192, 244, 0.16);
    border-radius: 3px;
    background: rgba(8, 17, 27, 0.44);
    color: #a9bfd1;
    font-size: 12px;
    font-weight: 700;
}

.game-meta i {
    color: var(--gold);
    font-size: 12px;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(103, 140, 174, 0.18);
}

.btn {
    display: inline-flex;
    flex: 1 1 130px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 8px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    background: rgba(103, 140, 174, 0.16);
    color: #d7e4ef;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn i {
    flex: 0 0 auto;
}

.btn-primary {
    border-color: rgba(172, 213, 50, 0.42);
    background: linear-gradient(90deg, #75b022, #a4d007);
    color: #10210b;
    box-shadow: 0 10px 24px rgba(117, 176, 34, 0.22);
}

.btn:hover {
    transform: translateY(-2px);
    border-color: rgba(102, 192, 244, 0.54);
    background: rgba(102, 192, 244, 0.2);
    color: #ffffff;
}

.btn-primary:hover {
    border-color: rgba(190, 230, 64, 0.72);
    background: linear-gradient(90deg, #8bc53f, #b8e63d);
    color: #0b1708;
}

.btn:focus-visible,
.close-modal:focus-visible,
.social-links a:focus-visible {
    outline: 3px solid rgba(244, 183, 64, 0.58);
    outline-offset: 3px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.66);
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    width: min(860px, 100%);
    max-height: 84vh;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #101a26;
    box-shadow: 0 34px 70px rgba(0, 0, 0, 0.48);
    padding: 38px;
}

.close-modal {
    position: absolute;
    top: 18px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #1b2838;
    color: var(--muted);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.close-modal:hover {
    transform: rotate(4deg);
    background: rgba(102, 192, 244, 0.16);
    color: var(--teal);
}

.modal h2 {
    margin-bottom: 24px;
    padding-right: 44px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 32px;
    font-weight: 800;
}

.modal-section {
    margin: 28px 0;
}

.modal-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--teal);
    font-size: 19px;
    font-weight: 800;
}

.modal-section h3 i {
    font-size: 18px;
}

.modal-section p,
.modal-section li {
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.7;
}

.modal-section ul,
.modal-section ol {
    padding-left: 24px;
    margin: 12px 0;
}

.modal-section li {
    margin-bottom: 5px;
}

.modal-section table {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
    font-size: 14px;
}

.modal-section th,
.modal-section td {
    padding: 9px 10px 9px 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.modal-section th {
    color: var(--muted);
    font-weight: 800;
}

.modal-section td {
    color: var(--ink-soft);
}

.modal-close-btn {
    display: none;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.research-grid article {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: linear-gradient(145deg, rgba(34, 50, 70, .88), rgba(16, 26, 38, .94));
}

.research-grid .research-featured {
    grid-column: span 2;
    padding: 26px;
    border-color: rgba(172, 213, 50, .3);
    background:
        radial-gradient(circle at 100% 0%, rgba(172, 213, 50, .12), transparent 38%),
        linear-gradient(145deg, rgba(34, 50, 70, .96), rgba(16, 26, 38, .98));
}

.research-grid .experience-card {
    grid-column: 1 / -1;
}

.research-featured h3 { font-size: 21px; }
.research-featured p { max-width: 760px; color: var(--ink-soft); }
.research-featured .btn-group { margin-top: 18px; }
.research-featured .btn { flex: 0 1 180px; }

.research-grid article > span,
.eyebrow {
    color: var(--teal);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.research-grid h3 { margin: 9px 0; color: var(--ink); font-size: 17px; }
.research-grid p { color: var(--muted); font-size: 13px; line-height: 1.65; }

.about-section {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 40px;
    margin-top: 70px;
    padding: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(16, 26, 38, .82);
}

.about-copy h2 { max-width: 760px; margin: 10px 0 14px; font-size: 28px; line-height: 1.25; }
.about-copy p { color: var(--ink-soft); line-height: 1.75; }
.about-values { display: grid; gap: 20px; }
.about-values div { padding-left: 16px; border-left: 3px solid var(--teal); }
.about-values strong, .about-values span { display: block; }
.about-values strong { margin-bottom: 5px; color: var(--ink); }
.about-values span { color: var(--muted); font-size: 13px; line-height: 1.55; }

.ai-note {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding: 14px 18px;
    border-left: 3px solid var(--muted);
    color: var(--muted);
    background: rgba(16, 26, 38, .5);
    font-size: 12px;
}

.ai-note strong { flex: 0 0 auto; color: var(--ink-soft); }

/* Footer */
.footer {
    margin-top: 86px;
    padding: 32px 0 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-size: 14px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 18px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #16202d;
    color: var(--ink-soft);
    font-size: 19px;
    text-decoration: none;
    transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.social-links a:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 151, 167, 0.46);
    color: var(--teal);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

/* Responsive */
@media (max-width: 980px) {
    .achievement-grid,
    .research-grid { grid-template-columns: repeat(2, 1fr); }

    .about-section { grid-template-columns: 1fr; }
    .philosophy-row {
        grid-template-columns: 1fr;
    }

    .avatar-card {
        justify-self: center;
        width: min(220px, 68vw);
        height: min(220px, 68vw);
        max-width: 220px;
        max-height: 220px;
        aspect-ratio: 1;
    }

    .featured-grid .game-card {
        grid-template-columns: 1fr;
    }

    .featured-grid .game-cover,
    .featured-grid .game-card[data-game="joyeuse"] .game-cover {
        min-height: 0;
        height: auto;
        aspect-ratio: 16 / 9;
        border-right: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.55);
    }

    .profile-header h1 {
        font-size: 44px;
        line-height: 1.1;
    }

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

    .game-card[data-game="joyeuse"] {
        display: flex;
        min-height: 0;
    }

    .game-card[data-game="joyeuse"] .game-cover {
        height: 260px;
        min-height: 0;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .game-card[data-game="joyeuse"] .game-info {
        padding: 24px;
    }

    .game-card[data-game="joyeuse"] .game-title {
        font-size: 24px;
    }
}

@media (max-width: 600px) {
    .achievement-grid,
    .research-grid { grid-template-columns: 1fr; }

    .research-grid .research-featured { grid-column: auto; }

    .about-section { padding: 25px 22px; }

    .ai-note { flex-direction: column; }
    .container {
        padding: 28px 16px 30px;
    }

    .profile-header {
        padding: 42px 0 30px;
        margin-bottom: 30px;
    }

    .profile-header h1 {
        font-size: 32px;
    }

    .profile-header h1 .nickname {
        display: block;
    }

    .profile-header .tagline,
    .philosophy-text {
        font-size: 16px;
        line-height: 1.65;
    }

    .profile-header .tagline span { margin: 0 3px; }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .philosophy-section {
        padding: 24px 22px;
    }

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

    .section-title {
        font-size: 22px;
    }

    .game-cover,
    .game-card[data-game="joyeuse"] .game-cover {
        height: 190px;
    }

    .game-info,
    .game-card[data-game="joyeuse"] .game-info {
        padding: 20px;
    }

    .game-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        flex-basis: auto;
    }

    .modal {
        padding: 14px;
    }

    .modal-content {
        padding: 28px 22px;
    }

    .modal h2 {
        font-size: 24px;
    }
}
