/* ============================================================
   tsundere.day — styles.css
   Palette: Dopamine Neon Against Void
   ============================================================ */

/* --- Custom Properties --- */
:root {
    --bg-void: #080810;
    --bg-plum: #120820;
    --pink: #FF2D78;
    --cyan: #00F5FF;
    --lime: #C8FF00;
    --orange: #FF8C00;
    --ghost: #888899;
    --white: #F0F0FF;
    --fafafa: #FAFAFA;
    --glass: rgba(255, 255, 255, 0.03);
    --frost: rgba(0, 245, 255, 0.08);
    --font-display: 'Nunito', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

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

html {
    scroll-snap-type: y proximity;
    overflow-y: scroll;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-void);
    color: var(--white);
    font-family: var(--font-display);
    font-size: 18px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Sections --- */
.section {
    min-height: 100vh;
    position: relative;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--white);
}

.mono-text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ghost);
    letter-spacing: 0.05em;
}

.neon-pink {
    color: var(--pink);
    text-shadow: 0 0 8px var(--pink), 0 0 16px rgba(255, 45, 120, 0.4);
}

.neon-cyan {
    color: var(--cyan);
    text-shadow: 0 0 8px var(--cyan), 0 0 16px rgba(0, 245, 255, 0.4);
}

.neon-lime {
    color: var(--lime);
    text-shadow: 0 0 8px var(--lime), 0 0 16px rgba(200, 255, 0, 0.4);
}

/* ============================================================
   Hexagonal System
   ============================================================ */
.hex-cell {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    position: relative;
    overflow: hidden;
    background: var(--glass);
}

.hex-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Hex border via sibling element */
.hex-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-border-glow {
    position: absolute;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: transparent;
    border: 1.5px solid transparent;
    pointer-events: none;
    z-index: 0;
    transition: all 0.4s ease;
}

/* ============================================================
   Section 1: Cold Front — Hero
   ============================================================ */
#cold-front {
    background: var(--bg-void);
}

.hero-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hex-wrapper.hex-hero {
    width: 60vmin;
    height: calc(60vmin * 1.1547);
    max-width: 600px;
    max-height: calc(600px * 1.1547);
    z-index: 2;
}

.hex-border-glow {
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    background: linear-gradient(135deg, var(--cyan) 0%, var(--pink) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hex-wrapper.hex-hero:hover .hex-border-glow {
    opacity: 0.6;
    animation: hex-perimeter 2s linear infinite;
}

@keyframes hex-perimeter {
    0% { filter: hue-rotate(0deg) blur(1px); }
    50% { filter: hue-rotate(60deg) blur(2px); }
    100% { filter: hue-rotate(0deg) blur(1px); }
}

.hex-cell--hero {
    width: 60vmin;
    height: calc(60vmin * 1.1547);
    max-width: 600px;
    max-height: calc(600px * 1.1547);
    z-index: 2;
    cursor: default;
    transition: background 0.5s ease;
}

.hex-cell--hero:hover {
    background: var(--frost);
}

.hero-photo-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.15) brightness(0.7) grayscale(0.6);
    transition: filter 600ms ease-in-out;
}

.hex-cell--hero:hover .hero-photo {
    filter: saturate(0.8) brightness(0.85) grayscale(0);
}

.hero-photo-fallback {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, var(--bg-plum) 0%, #0a0a18 40%, #050508 100%);
}

.hero-overlay {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 2rem;
}

.hero-title {
    font-size: clamp(40px, 8vmin, 96px);
    font-weight: 800;
    color: var(--white);
    line-height: 1;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 40px rgba(240, 240, 255, 0.1);
}

.hero-dot {
    font-size: inherit;
}

.hero-sub {
    margin-top: 1rem;
    font-size: 12px;
    color: var(--ghost);
    letter-spacing: 0.08em;
    opacity: 0.7;
}

/* Void particles (decorative background floaters) */
.cold-front-void {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.void-particle {
    position: absolute;
    width: 6px;
    height: calc(6px * 1.1547);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: var(--cyan);
    opacity: 0.04;
    animation: void-drift 18s ease-in-out infinite;
}
.void-particle--1 { left: 15%; bottom: 20%; animation-delay: 0s; animation-duration: 22s; }
.void-particle--2 { left: 80%; bottom: 35%; animation-delay: 7s; animation-duration: 18s; }
.void-particle--3 { left: 50%; bottom: 10%; animation-delay: 13s; animation-duration: 25s; }

@keyframes void-drift {
    0% { transform: translateY(0) scale(1); opacity: 0.04; }
    50% { transform: translateY(-30px) scale(1.3); opacity: 0.08; }
    100% { transform: translateY(0) scale(1); opacity: 0.04; }
}

.section-scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--ghost);
    font-size: 11px;
    letter-spacing: 0.15em;
    opacity: 0.4;
    animation: hint-pulse 3s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% { opacity: 0.2; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.5; transform: translateX(-50%) translateY(4px); }
}

/* ============================================================
   Section 2: Cluster Grid
   ============================================================ */
#cluster-grid {
    background: var(--bg-void);
    padding: 4rem 2rem;
}

.cluster-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.hex-grid-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

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

.hex-row--middle {
    transform: none;
    margin: -20px 0;
    z-index: 2;
    position: relative;
}

.hex-row--top,
.hex-row--bottom {
    transform: translateX(calc(160px / 2 + 4px));
    z-index: 1;
}

.hex-cluster-wrap {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 500ms cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hex-cluster-wrap.revealed {
    opacity: 1;
    transform: scale(1);
}

.hex-cell--cluster {
    width: 150px;
    height: calc(150px * 1.1547);
    background: var(--glass);
    border: none;
    position: relative;
    transition: background 0.4s ease;
}

/* Neon glow border via outline trick on wrapper */
.hex-cluster-wrap {
    position: relative;
}

.hex-cluster-wrap::before {
    content: '';
    position: absolute;
    inset: -2px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: var(--cell-neon, var(--cyan));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.hex-cluster-wrap:hover::before {
    opacity: 0.5;
}

.hex-cell--cluster:hover {
    background: var(--frost);
}

.hex-cell--center {
    width: 170px;
    height: calc(170px * 1.1547);
    background: linear-gradient(145deg, rgba(0, 245, 255, 0.05) 0%, var(--glass) 100%);
}

.center-photo-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.center-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.15) brightness(0.6) grayscale(0.6);
    transition: filter 600ms ease-in-out;
}

.hex-cell--center:hover .center-photo {
    filter: saturate(1) brightness(0.85) grayscale(0);
}

.center-photo-fallback {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 245, 255, 0.08) 0%, var(--bg-plum) 70%);
}

.center-title {
    position: relative;
    z-index: 2;
    font-size: 18px;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 0.08em;
    text-transform: lowercase;
    opacity: 0.6;
}

.cell-content {
    padding: 1rem;
    text-align: center;
    z-index: 2;
    position: relative;
}

.cell-content--center {
    padding: 0;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-text {
    font-size: 12px;
    line-height: 1.5;
    color: var(--ghost);
    font-family: var(--font-display);
    font-weight: 400;
}

.cell-text em {
    color: var(--white);
    font-style: normal;
}

.cell-glyph {
    font-size: 24px;
    display: block;
    color: var(--ghost);
}

.cell-wave {
    width: 100%;
}

.cell-wave-svg {
    width: 100%;
    height: 40px;
    display: block;
}

/* ============================================================
   Section 3: Wave Confessional
   ============================================================ */
#wave-confessional {
    background: var(--bg-void);
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

.confessional-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.confession-text-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    width: 100%;
    max-width: 800px;
}

.confession-line {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.confession-typewriter {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 400;
    color: var(--white);
    line-height: 1.5;
    min-height: 1.5em;
}

.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--pink);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 1.1s step-end infinite;
    box-shadow: 0 0 4px var(--pink), 0 0 12px var(--pink), 0 0 28px rgba(255, 45, 120, 0.4);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.wave-area {
    width: 100%;
    height: 200px;
    position: absolute;
    bottom: 0;
    left: 0;
}

.main-wave-svg {
    width: 100%;
    height: 200px;
    display: block;
}

/* Neon hex particles drifting upward */
.hex-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.hex-particle {
    position: absolute;
    width: 6px;
    height: calc(6px * 1.1547);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: var(--pink);
    opacity: 0.15;
    bottom: 0;
    animation: float-up linear infinite;
}

.hex-particle:nth-child(1) { left: 8%;  animation-duration: 12s; animation-delay: 0s; }
.hex-particle:nth-child(2) { left: 18%; animation-duration: 15s; animation-delay: 2s; }
.hex-particle:nth-child(3) { left: 28%; animation-duration: 11s; animation-delay: 4s; }
.hex-particle:nth-child(4) { left: 38%; animation-duration: 17s; animation-delay: 1s; }
.hex-particle:nth-child(5) { left: 48%; animation-duration: 13s; animation-delay: 5s; }
.hex-particle:nth-child(6) { left: 58%; animation-duration: 16s; animation-delay: 3s; }
.hex-particle:nth-child(7) { left: 68%; animation-duration: 14s; animation-delay: 6s; }
.hex-particle:nth-child(8) { left: 78%; animation-duration: 10s; animation-delay: 2.5s; }
.hex-particle:nth-child(9) { left: 88%; animation-duration: 18s; animation-delay: 7s; }
.hex-particle:nth-child(10){ left: 94%; animation-duration: 12s; animation-delay: 1.5s; }

@keyframes float-up {
    0%   { transform: translateY(0);     opacity: 0.15; }
    80%  { opacity: 0.15; }
    100% { transform: translateY(-100vh); opacity: 0; }
}

/* ============================================================
   Section 4: Duality Split
   ============================================================ */
#duality-split {
    background: var(--bg-void);
    padding: 0;
    overflow: hidden;
}

.split-container {
    width: 100%;
    height: 100vh;
    display: flex;
    position: relative;
}

.split-left {
    flex: 0 0 50%;
    background: var(--fafafa);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 4rem 3rem 4rem 2rem;
    transition: flex 0.4s ease;
}

.split-right {
    flex: 0 0 50%;
    background: var(--bg-void);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 4rem 2rem 4rem 3rem;
    transition: flex 0.4s ease;
}

.split-divider {
    width: 2px;
    height: 100%;
    background: var(--pink);
    box-shadow: 0 0 4px var(--pink), 0 0 12px var(--pink), 0 0 28px rgba(255, 45, 120, 0.4);
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.split-divider.wobbling {
    animation: split-wobble 2.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes split-wobble {
    0%   { transform: translateX(0); }
    25%  { transform: translateX(-60px); }
    60%  { transform: translateX(60px); }
    80%  { transform: translateX(-20px); }
    100% { transform: translateX(0); }
}

.split-content {
    max-width: 320px;
}

.split-content--cold {
    text-align: right;
}

.split-content--warm {
    text-align: left;
}

.split-line {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 0.5rem;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.split-line.visible {
    opacity: 1;
    transform: translateX(0);
}

.split-content--cold .split-line {
    font-family: var(--font-mono);
    font-size: 13px;
    color: #1a1a2e;
    letter-spacing: 0.02em;
}

.split-content--warm .split-line {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--white);
    font-weight: 400;
}

.split-content--warm .split-line em {
    font-style: normal;
    color: var(--cyan);
    text-shadow: 0 0 8px var(--cyan), 0 0 16px rgba(0, 245, 255, 0.4);
}

/* ============================================================
   Section 5: Signal Close
   ============================================================ */
#signal-close {
    background: var(--bg-void);
}

.signal-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
}

.hex-wrapper.hex-signal {
    width: 44vmin;
    height: calc(44vmin * 1.1547);
    max-width: 420px;
    max-height: calc(420px * 1.1547);
}

.hex-border-glow--cyan {
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    background: var(--cyan);
    opacity: 0.15;
    animation: signal-pulse 3s ease-in-out infinite;
}

@keyframes signal-pulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.3; }
}

.hex-cell--signal {
    width: 44vmin;
    height: calc(44vmin * 1.1547);
    max-width: 420px;
    max-height: calc(420px * 1.1547);
    background: linear-gradient(160deg, rgba(0, 245, 255, 0.04) 0%, var(--glass) 100%);
}

.signal-content {
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.signal-typewriter {
    font-family: var(--font-display);
    font-size: clamp(16px, 2.5vmin, 22px);
    font-weight: 400;
    color: var(--white);
    line-height: 1.6;
    display: block;
    min-height: 3em;
}

.typewriter-cursor--signal {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--cyan);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink-cyan 1.1s step-end infinite;
    box-shadow: 0 0 4px var(--cyan), 0 0 12px var(--cyan), 0 0 28px rgba(0, 245, 255, 0.4);
}

@keyframes blink-cyan {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ============================================================
   Neon Glow Utilities
   ============================================================ */
.neon-glow-pink {
    box-shadow:
        0 0 4px var(--pink),
        0 0 12px var(--pink),
        0 0 28px rgba(255, 45, 120, 0.4);
}

.neon-glow-cyan {
    box-shadow:
        0 0 4px var(--cyan),
        0 0 12px var(--cyan),
        0 0 28px rgba(0, 245, 255, 0.4);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .hex-row--top,
    .hex-row--bottom {
        transform: translateX(calc(130px / 2 + 4px));
    }

    .hex-cell--cluster {
        width: 120px;
        height: calc(120px * 1.1547);
    }

    .hex-cell--center {
        width: 140px;
        height: calc(140px * 1.1547);
    }

    .hero-title {
        font-size: clamp(32px, 10vmin, 56px);
    }

    .split-content {
        max-width: 200px;
    }

    .split-line {
        font-size: 12px;
    }
}
