/* =========================================
   hangul.dev — Seapunk Developer Docs
   ========================================= */

/* Fonts: Noto Sans KR, Nunito, Nunito Sans, Fira Code (Google Fonts) */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    line-height: 1.85;
    font-size: clamp(15px, 1.05vw, 17px);
    color: #E8E4E0;
    background: #0A1A2A;
    overflow-x: hidden;
}

/* --- Cursor-Follow Glow --- */
#cursor-glow {
    position: fixed;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(127, 219, 202, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
}

body:hover #cursor-glow {
    opacity: 1;
}

/* --- Bubble Particles --- */
#bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(160, 208, 224, 0.3);
    bottom: -20px;
    animation: bubbleRise linear infinite;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-110vh) translateX(var(--wobble));
        opacity: 0;
    }
}

/* --- Section 1: Hero --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(170deg, #1A2A4A 0%, #2A4A6A 45%, #1A3A5A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

/* Caustic light patterns */
.caustic-light {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(160, 208, 224, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.caustic-1 {
    width: 35vw;
    height: 35vw;
    top: 10%;
    left: 15%;
    animation: causticDrift1 18s ease-in-out infinite alternate;
}

.caustic-2 {
    width: 28vw;
    height: 28vw;
    top: 40%;
    right: 10%;
    animation: causticDrift2 22s ease-in-out infinite alternate;
}

.caustic-3 {
    width: 40vw;
    height: 40vw;
    bottom: 5%;
    left: 40%;
    animation: causticDrift3 15s ease-in-out infinite alternate;
}

@keyframes causticDrift1 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5vw, 3vh) scale(1.15); }
    100% { transform: translate(-3vw, -5vh) scale(0.9); }
}

@keyframes causticDrift2 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-4vw, 5vh) scale(1.2); }
    100% { transform: translate(3vw, -2vh) scale(0.85); }
}

@keyframes causticDrift3 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(6vw, -4vh) scale(1.1); }
    100% { transform: translate(-5vw, 3vh) scale(0.95); }
}

#hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

#logotype {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(36px, 6vw, 72px);
    letter-spacing: 0.02em;
    color: #E8E4E0;
    opacity: 0;
    transform: scale(0.95);
    animation: logoFadeIn 1200ms ease-out forwards;
}

@keyframes logoFadeIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#subtitle {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1.5vw, 20px);
    color: rgba(160, 208, 224, 0.7);
    margin-top: 8px;
    opacity: 0;
    animation: subtitleFadeIn 800ms ease-out 600ms forwards;
}

@keyframes subtitleFadeIn {
    to {
        opacity: 1;
    }
}

#floating-char {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: clamp(60px, 10vw, 140px);
    color: #7FDBCA;
    margin-top: 20px;
    opacity: 0;
    animation: charDropIn 800ms ease-out 400ms forwards, charBob 4s ease-in-out 1200ms infinite;
}

@keyframes charDropIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes charBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* --- Wave Dividers --- */
.wave-divider {
    position: relative;
    width: 100%;
    height: 60px;
    overflow: hidden;
    z-index: 2;
}

.wave-divider svg {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
}

.wave-divider svg path {
    fill: rgba(74, 138, 138, 0.3);
}

.wave-1 {
    background: linear-gradient(to bottom, #1A3A5A, #1A2A4A);
}

.wave-1 svg path {
    animation: waveShift 8s ease-in-out infinite alternate;
}

.wave-2 {
    background: linear-gradient(to bottom, #1A2A4A, #0A1A2A);
}

.wave-2 svg path {
    animation: waveShift 8s ease-in-out 2s infinite alternate;
}

.wave-3 {
    background: linear-gradient(to bottom, #0A1A2A, #1A2A4A);
}

.wave-3 svg path {
    animation: waveShift 8s ease-in-out 4s infinite alternate;
}

@keyframes waveShift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-30px); }
}

/* --- Section 2: Documentation Masonry --- */
#docs-section {
    position: relative;
    background: #1A2A4A;
    padding: 80px 40px 100px;
    z-index: 2;
}

.section-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: clamp(24px, 4vw, 52px);
    letter-spacing: 0.02em;
    color: #E8E4E0;
    text-align: center;
    margin-bottom: 50px;
}

.section-title-light {
    color: #A0D0E0;
}

#masonry-grid {
    column-count: 3;
    column-gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.masonry-card {
    break-inside: avoid;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(74, 138, 138, 0.2);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: backdrop-filter 0.3s ease, background 0.3s ease;
}

.masonry-card.visible {
    animation: cardFadeRise 500ms ease-out forwards;
}

@keyframes cardFadeRise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.masonry-card.glow-near {
    background: rgba(255, 255, 255, 0.12);
}

.masonry-card h3 {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: #7FDBCA;
    margin-bottom: 10px;
    border-bottom: 1px solid #4A8A8A;
    padding-bottom: 8px;
}

.masonry-card p {
    color: rgba(232, 228, 224, 0.85);
    margin-bottom: 14px;
    font-size: 15px;
    line-height: 1.7;
}

.masonry-card pre {
    background: rgba(10, 16, 32, 0.6);
    border: 1px solid rgba(74, 138, 138, 0.15);
    border-radius: 12px;
    padding: 16px;
    overflow-x: auto;
    margin: 0;
}

.masonry-card code {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: #7FDBCA;
    line-height: 1.6;
}

/* --- Section 3: Character Specimens --- */
#specimens-section {
    position: relative;
    background: #0A1A2A;
    padding: 80px 0 100px;
    z-index: 2;
    overflow: hidden;
}

.specimens-subtitle {
    text-align: center;
    color: rgba(160, 208, 224, 0.6);
    font-size: 16px;
    margin-bottom: 50px;
}

#specimens-scroll {
    display: flex;
    gap: 30px;
    padding: 20px 60px 40px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 138, 138, 0.3) transparent;
}

#specimens-scroll::-webkit-scrollbar {
    height: 6px;
}

#specimens-scroll::-webkit-scrollbar-track {
    background: transparent;
}

#specimens-scroll::-webkit-scrollbar-thumb {
    background: rgba(74, 138, 138, 0.3);
    border-radius: 3px;
}

.specimen {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.specimen:hover {
    transform: translateY(-8px);
}

.pedestal {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(160, 208, 224, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(232, 228, 224, 0.06) 0%, transparent 70%),
        linear-gradient(135deg, rgba(232, 228, 224, 0.12) 0%, rgba(160, 208, 224, 0.08) 100%);
    border: 1px solid rgba(232, 228, 224, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.3s ease;
}

.specimen:hover .pedestal {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 20px rgba(127, 219, 202, 0.1);
}

.specimen-char {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 40px;
    color: #E8E4E0;
}

.specimen-label {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 13px;
    color: rgba(160, 208, 224, 0.6);
    margin-top: 12px;
    text-align: center;
    white-space: nowrap;
}

/* Specimen Tooltip */
#specimen-tooltip {
    position: fixed;
    background: rgba(10, 16, 32, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(127, 219, 202, 0.3);
    border-radius: 14px;
    padding: 16px 20px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
    min-width: 180px;
}

#specimen-tooltip.active {
    opacity: 1;
    transform: translateY(0);
}

.tooltip-char {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #7FDBCA;
    text-align: center;
    margin-bottom: 6px;
}

.tooltip-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #E8E4E0;
    text-align: center;
}

.tooltip-code {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: #A0D0E0;
    text-align: center;
    margin-top: 4px;
}

.tooltip-desc {
    font-size: 13px;
    color: rgba(232, 228, 224, 0.7);
    text-align: center;
    margin-top: 6px;
}

/* --- Section 4: Long-form Documentation --- */
#longform-section {
    position: relative;
    background: linear-gradient(180deg, #1A2A4A 0%, #1A3A5A 100%);
    padding: 100px 40px 120px;
    z-index: 2;
}

#longform-content {
    max-width: 70ch;
    margin: 0 auto;
}

#longform-content h2 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: 0.02em;
    color: #E8E4E0;
    margin-bottom: 30px;
}

#longform-content h3 {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: clamp(20px, 2.5vw, 28px);
    color: #A0D0E0;
    margin-top: 40px;
    margin-bottom: 16px;
}

#longform-content p {
    color: rgba(232, 228, 224, 0.9);
    margin-bottom: 18px;
}

#longform-content ul {
    list-style: none;
    margin-bottom: 18px;
    padding-left: 0;
}

#longform-content li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 10px;
    color: rgba(232, 228, 224, 0.9);
}

#longform-content li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7FDBCA;
    opacity: 0.6;
}

.hangeul-inline {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    color: #7FDBCA;
    padding: 0 2px;
    transition: text-shadow 0.3s ease;
}

.hangeul-inline.glow {
    text-shadow: 0 0 12px rgba(127, 219, 202, 0.4);
}

#longform-content pre {
    background: rgba(10, 16, 32, 0.6);
    border: 1px solid rgba(74, 138, 138, 0.15);
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 24px;
}

#longform-content code {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: #7FDBCA;
    line-height: 1.6;
}

#longform-content strong {
    color: #E08080;
    font-weight: 600;
}

/* --- Footer: Ocean Floor --- */
#footer {
    position: relative;
    background: linear-gradient(180deg, #1A2A4A 0%, #0A1020 100%);
    padding: 80px 40px 50px;
    z-index: 2;
    overflow: hidden;
}

#bioluminescent-dots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.bio-dot {
    position: absolute;
    border-radius: 50%;
    animation: bioPulse ease-in-out infinite alternate;
}

@keyframes bioPulse {
    0% { opacity: 0.2; }
    100% { opacity: 0.8; }
}

#footer-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

#footer-logo {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 28px;
    color: #E8E4E0;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

#footer-tagline {
    color: rgba(160, 208, 224, 0.5);
    font-size: 15px;
    margin-bottom: 28px;
}

#footer-links {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-bottom: 32px;
}

#footer-links a {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    color: #7FDBCA;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s ease;
}

#footer-links a:hover {
    color: #A0D0E0;
}

#footer-copy {
    color: rgba(232, 228, 224, 0.3);
    font-size: 13px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    #masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 640px) {
    #masonry-grid {
        column-count: 1;
    }

    #docs-section {
        padding: 60px 20px 80px;
    }

    #longform-section {
        padding: 60px 20px 80px;
    }

    .pedestal {
        width: 80px;
        height: 80px;
    }

    .specimen-char {
        font-size: 32px;
    }

    #specimens-scroll {
        padding: 20px 30px 40px;
        gap: 20px;
    }
}
