/* === CSS Custom Properties === */
:root {
    --void: #0b1120;
    --deep-ocean: #122040;
    --current: #1a3060;
    --signal: #3d6098;
    --pulse: #5e8cc8;
    --glow: #8bb4e0;
    --mist: #c8ddf0;
    --ember: #d4775a;

    --hex-size: clamp(60px, 8vw, 120px);
    --hex-gap: 4px;
    --title-weight: clamp(400, calc(400 + 500 * ((100vw - 320px) / 1600)), 900);

    --font-display: 'Orbitron', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Instrument Sans', sans-serif;
    --font-jp: 'Zen Kaku Gothic New', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* === Reset === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void);
    color: var(--mist);
    font-family: var(--font-body);
    line-height: 1.72;
    overflow-x: hidden;
}

/* === Sections === */
.section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

/* === Section Labels === */
.section-label {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.7rem;
    color: var(--glow);
    opacity: 0.45;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.coord {
    font-family: var(--font-mono);
    font-weight: 300;
    color: var(--pulse);
}

/* === Hero Section === */
#hero {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(180deg, var(--void) 0%, var(--deep-ocean) 50%, var(--void) 100%);
}

#hero-grid {
    position: absolute;
    inset: 0;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: var(--hex-gap);
    pointer-events: none;
    z-index: 0;
}

.hex-cell {
    width: var(--hex-size);
    aspect-ratio: 1 / 1.1547;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background-color: var(--deep-ocean);
    transition: background-color 0.3s ease-in;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    cursor: crosshair;
}

.hex-cell .hex-coord {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: rgba(200, 221, 240, 0.12);
    user-select: none;
    pointer-events: none;
}

.hex-cell.ripple-active {
    background-color: var(--pulse);
}

.hex-cell.ripple-fade {
    background-color: var(--deep-ocean);
    transition: background-color 0.6s ease-out;
}

.hex-row {
    display: flex;
    gap: var(--hex-gap);
    justify-content: center;
    width: 100%;
}

.hex-row.odd {
    margin-left: calc(var(--hex-size) / 2);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    pointer-events: none;
}

.logotype {
    font-family: var(--font-display);
    font-size: clamp(4rem, 12vw, 10rem);
    font-variation-settings: 'wght' var(--title-weight);
    letter-spacing: 0.25em;
    color: var(--mist);
    text-shadow: 0 0 60px rgba(94, 140, 200, 0.3);
    line-height: 1;
}

.logotype-jp {
    font-family: var(--font-jp);
    font-weight: 400;
    font-size: clamp(1rem, 3vw, 2rem);
    color: var(--glow);
    opacity: 0.5;
    letter-spacing: 0.5em;
    margin-top: 0.5rem;
}

.tagline {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    color: var(--signal);
    letter-spacing: 0.3em;
    text-transform: lowercase;
    margin-top: 1.5rem;
}

/* === Games Section === */
.section-games {
    background: var(--deep-ocean);
    padding: 8vh 5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    width: 100%;
    margin-top: 2rem;
}

.game-cluster {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.game-hex {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: background-color 0.4s ease, transform 0.3s ease;
}

.game-hex-main {
    width: clamp(100px, 15vw, 160px);
    aspect-ratio: 1 / 1.1547;
    background: var(--current);
    box-shadow: 0 4px 20px rgba(11, 17, 32, 0.5);
}

.game-hex-main:hover {
    background: var(--signal);
}

.game-hex-info {
    width: clamp(120px, 18vw, 200px);
    aspect-ratio: 1 / 1.1547;
    background: rgba(26, 48, 96, 0.4);
    padding: 1.5rem;
}

.game-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--ember);
}

.game-genre {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.7rem;
    color: var(--glow);
    opacity: 0.6;
    letter-spacing: 0.1em;
}

.game-year {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.8rem;
    color: var(--pulse);
}

.game-desc {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--mist);
    opacity: 0.7;
    max-width: 38ch;
    line-height: 1.5;
}

.iso-icon {
    width: 48px;
    height: 48px;
}

/* === About Section === */
.section-about {
    background: var(--void);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

#wave-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.about-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 1100px;
    padding: 5vh 5vw;
    flex-wrap: wrap;
}

.about-text {
    flex: 1 1 55%;
    min-width: 280px;
}

.section-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--mist);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.about-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    color: var(--mist);
    max-width: 38ch;
    margin-bottom: 1.2rem;
    opacity: 0.85;
}

.about-icons {
    flex: 1 1 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    min-width: 100px;
}

.iso-icon-large {
    width: 64px;
    height: 64px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.iso-icon-large:hover {
    opacity: 1;
}

/* === Members Section === */
.section-members {
    background: linear-gradient(180deg, var(--void) 0%, var(--deep-ocean) 50%, var(--void) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8vh 5vw;
    position: relative;
}

.connection-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.connection-svg line {
    stroke: var(--signal);
    stroke-width: 1;
    opacity: 0.4;
}

.members-grid {
    display: flex;
    gap: clamp(2rem, 6vw, 5rem);
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 1;
    margin-top: 2rem;
}

.member-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
}

.member-hex {
    width: clamp(80px, 12vw, 120px);
    aspect-ratio: 1 / 1.1547;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--current);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.member-node:hover .member-hex {
    background: var(--signal);
    box-shadow: 0 0 30px rgba(94, 140, 200, 0.3);
}

.member-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--mist);
}

.member-role {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.7rem;
    color: var(--glow);
    opacity: 0.45;
}

/* === Footer Section === */
.section-footer {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--void);
    position: relative;
}

#footer-wave-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.footer-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.footer-name {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--mist);
    letter-spacing: 0.15em;
}

.ember {
    color: var(--ember);
}

.footer-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--glow);
    opacity: 0.5;
    margin-top: 0.5rem;
}

.footer-links {
    margin-top: 1.5rem;
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--signal);
}

.footer-link {
    transition: color 0.3s ease;
    cursor: pointer;
}

.footer-link:hover {
    color: var(--pulse);
}

.footer-sep {
    margin: 0 0.8rem;
    opacity: 0.3;
}

.footer-year {
    margin-top: 1.5rem;
    font-size: 0.7rem;
    opacity: 0.3;
}

/* === Animations === */
@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

@keyframes line-dash {
    0% { stroke-dashoffset: 40; }
    100% { stroke-dashoffset: 0; }
}

.connection-svg line {
    stroke-dasharray: 8 12;
    animation: line-dash 2s linear infinite;
}

/* === Responsive === */
@media (max-width: 600px) {
    .about-content {
        flex-direction: column;
    }
    .about-icons {
        flex-direction: row;
    }
    .games-grid {
        grid-template-columns: 1fr;
    }
    .hex-row.odd {
        margin-left: calc(var(--hex-size) / 4);
    }
}
