/* ============================================
   yongjoon.net -- Broadcast Transmission Design
   ============================================ */

/* --- CSS Variables (Color Palette from DESIGN.md) --- */
:root {
    --signal-black: #0C0C14;
    --phosphor-dark: #12131F;
    --scan-white: #E8E6F0;
    --chroma-magenta: #E94490;
    --sync-cyan: #44D4E9;
    --blanking-amber: #E9A844;
    --snow-static: #2A2B3D;
    --interlace-gray: #5B5C72;
}

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

html {
    scroll-behavior: auto;
}

/* --- Body & Scan Lines --- */
body {
    background: var(--signal-black);
    color: var(--scan-white);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    letter-spacing: 0.04em;
    line-height: 1.7;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
    z-index: 10000;
}

/* --- CRT Blanking Overlay --- */
.crt-blanking {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: none;
}

.crt-blanking.active {
    animation: crt-blank 120ms ease-out forwards;
}

@keyframes crt-blank {
    0% { opacity: 0; }
    33% { opacity: 1; }
    66% { opacity: 1; }
    100% { opacity: 0; }
}

/* --- Scroll Container --- */
.scroll-container {
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

/* --- Channel (Section) Base --- */
.channel {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Channel Number (ghostly large numeral) --- */
.channel-number {
    position: absolute;
    top: 0.05em;
    left: 0.05em;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: clamp(6rem, 15vw, 20rem);
    line-height: 1;
    opacity: 0.05;
    color: var(--sync-cyan);
    mix-blend-mode: screen;
    pointer-events: none;
    user-select: none;
    z-index: 1;
}

/* --- Registration Marks --- */
.reg-mark {
    position: absolute;
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 2;
    opacity: 0.15;
}

.reg-mark::before,
.reg-mark::after {
    content: '';
    position: absolute;
    background: var(--sync-cyan);
}

.reg-mark::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 0.5px;
    transform: translateY(-50%);
}

.reg-mark::after {
    left: 50%;
    top: 0;
    height: 100%;
    width: 0.5px;
    transform: translateX(-50%);
}

.reg-mark-visible {
    opacity: 0.25;
}

/* --- Channel Indicator (fixed bottom-right) --- */
.channel-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 9998;
}

.channel-dot {
    width: 12px;
    height: 4px;
    background: var(--interlace-gray);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: block;
}

.channel-dot:hover {
    background: var(--scan-white);
}

.channel-dot.active {
    background: var(--chroma-magenta);
}

/* --- SMPTE Color Bar Strip --- */
.smpte-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    display: flex;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.smpte-bar-bottom {
    position: relative;
    top: auto;
    margin-top: 3rem;
}

.smpte-bar span {
    flex: 1;
    display: block;
}

.smpte-white { background: #FFFFFF; }
.smpte-yellow { background: #FFFF00; }
.smpte-cyan { background: #00FFFF; }
.smpte-green { background: #00FF00; }
.smpte-magenta { background: #FF00FF; }
.smpte-red { background: #FF0000; }
.smpte-blue { background: #0000FF; }

/* --- Static Noise Background --- */
.static-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 300px 300px;
}

/* ============================================
   CHANNEL 01: SIGNAL ACQUIRED (HERO)
   ============================================ */
.channel-hero {
    background: var(--signal-black);
    flex-direction: column;
}

/* Hero Name - Kinetic Typography */
.hero-name {
    position: relative;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 12vw, 14rem);
    letter-spacing: -0.03em;
    line-height: 0.95;
    color: var(--scan-white);
    z-index: 5;
    white-space: nowrap;
    display: flex;
}

.hero-letter {
    display: inline-block;
    opacity: 0;
    position: relative;
}

.hero-letter.animate {
    animation: letter-converge 1800ms cubic-bezier(0.16, 1, 0.3, 1) forwards,
               letter-color-phase 1800ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes letter-converge {
    0% {
        opacity: 1;
        transform: translate(var(--scatter-x), var(--scatter-y));
    }
    70% {
        opacity: 1;
        transform: translate(0, 0);
    }
    85% {
        transform: translate(calc(var(--overshoot-x) * -0.08), calc(var(--overshoot-y) * -0.08));
    }
    100% {
        opacity: 1;
        transform: translate(0, 0);
    }
}

@keyframes letter-color-phase {
    0% {
        color: var(--scan-white);
    }
    25% {
        color: var(--chroma-magenta);
    }
    50% {
        color: var(--sync-cyan);
    }
    75% {
        color: var(--chroma-magenta);
    }
    100% {
        color: var(--scan-white);
    }
}

/* Hero Subtitle */
.hero-subtitle {
    font-family: 'Bodoni Moda', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 2.5rem);
    letter-spacing: 0.06em;
    line-height: 1.4;
    color: var(--interlace-gray);
    margin-top: 2rem;
    opacity: 0;
    z-index: 5;
    transition: opacity 0.8s ease;
}

.hero-subtitle.visible {
    opacity: 1;
}

/* ============================================
   CHANNEL 02: BROADCAST LOG (WORK/PROJECTS)
   ============================================ */
.channel-work {
    background: var(--phosphor-dark);
}

.work-content {
    width: 100%;
    padding: 0 8%;
}

.channel-content {
    z-index: 3;
    position: relative;
}

.channel-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 5rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--sync-cyan);
    margin-bottom: 3rem;
}

.work-heading {
    white-space: nowrap;
    margin-right: -15%;
}

.broadcast-log {
    list-style: none;
    padding: 0;
}

.log-entry {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(91, 92, 114, 0.2);
    transform: translateX(-40px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    position: relative;
}

.log-entry::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 30%;
    height: 1px;
    background: var(--chroma-magenta);
    transition: width 0.3s ease;
}

.log-entry:hover::after {
    width: 100%;
}

.log-entry.visible {
    transform: translateX(0);
    opacity: 1;
}

.log-entry:hover .log-name {
    color: var(--chroma-magenta);
}

.log-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.6rem);
    color: var(--scan-white);
    transition: color 0.2s ease;
}

.log-year {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.04em;
    color: var(--interlace-gray);
    flex-shrink: 0;
    margin-left: 2rem;
}

/* ============================================
   CHANNEL 03: TEST PATTERN (ABOUT/PHILOSOPHY)
   ============================================ */
.channel-about {
    background: var(--signal-black);
    align-items: center;
    justify-content: center;
}

.about-content {
    padding: 0 8%;
    max-width: 100%;
}

.about-text {
    max-width: 55ch;
    margin-left: 12.5%;
    margin-bottom: 4rem;
}

.about-text p {
    margin-bottom: 1.2rem;
    color: var(--scan-white);
}

.about-text p:last-child {
    margin-bottom: 0;
}

.pull-quote {
    font-family: 'Bodoni Moda', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 2.5rem);
    letter-spacing: 0.06em;
    line-height: 1.4;
    color: var(--blanking-amber);
    margin-left: 12.5%;
    max-width: 55ch;
    border: none;
    padding: 0;
    position: relative;
}

.quote-text {
    visibility: hidden;
}

.quote-text.typing {
    visibility: visible;
}

.typewriter-cursor {
    color: var(--blanking-amber);
    animation: cursor-blink 530ms step-end infinite;
    font-style: normal;
}

.typewriter-cursor.hidden {
    display: none;
}

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

/* ============================================
   CHANNEL 04: FREQUENCY INDEX (SKILLS/INTERESTS)
   ============================================ */
.channel-skills {
    background: var(--phosphor-dark);
}

.skills-content {
    width: 100%;
    padding: 0 8%;
}

.freq-columns {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    width: 100%;
}

.freq-column {
    flex: 1;
    padding: 0 2rem;
}

.freq-divider {
    width: 1px;
    background: rgba(91, 92, 114, 0.15);
    align-self: stretch;
    min-height: 250px;
}

.freq-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.04em;
    color: var(--sync-cyan);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.freq-list {
    list-style: none;
    padding: 0;
}

.freq-item {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    letter-spacing: 0.04em;
    line-height: 1.8;
    color: var(--scan-white);
    position: relative;
    cursor: default;
    padding-bottom: 2px;
}

.freq-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--sync-cyan);
    transition: width 0.2s ease;
}

.freq-item:hover::after {
    width: 100%;
}

/* Column-specific accent colors */
.freq-column:nth-child(1) .freq-item::after {
    background: var(--chroma-magenta);
}

.freq-column:nth-child(3) .freq-item::after {
    background: var(--sync-cyan);
}

.freq-column:nth-child(5) .freq-item::after {
    background: var(--blanking-amber);
}

/* ============================================
   CHANNEL 05: END OF BROADCAST (CONTACT/FOOTER)
   ============================================ */
.channel-contact {
    background: var(--signal-black);
    flex-direction: column;
}

.contact-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 5rem);
    letter-spacing: 0.12em;
    line-height: 1.1;
    color: var(--scan-white);
    margin-bottom: 3rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 3rem;
}

.contact-link {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    letter-spacing: 0.04em;
    color: var(--sync-cyan);
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--sync-cyan);
    transition: width 0.3s ease;
}

.contact-link:hover::after {
    width: 100%;
}

.contact-link:hover {
    color: var(--chroma-magenta);
}

.contact-link:hover::after {
    background: var(--chroma-magenta);
}

.broadcast-footer {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.04em;
    color: var(--interlace-gray);
    margin-top: 2rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .freq-columns {
        flex-direction: column;
        gap: 2rem;
    }

    .freq-divider {
        width: 100%;
        height: 1px;
        min-height: 0;
    }

    .freq-column {
        padding: 0;
    }

    .about-text {
        margin-left: 0;
    }

    .pull-quote {
        margin-left: 0;
    }

    .work-heading {
        margin-right: 0;
    }

    .channel-indicator {
        bottom: 1rem;
        right: 1rem;
    }

    .log-entry {
        flex-direction: column;
        gap: 0.3rem;
    }

    .log-year {
        margin-left: 0;
    }
}
