/* ============================================
   rinji.net - Emergency Broadcast Design
   ============================================ */

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

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

body {
    background-color: #0a0a0a;
    color: #f0f0f0;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 1.2vw, 1rem);
    letter-spacing: 0.02em;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Ticker Column (fixed right edge) --- */
.ticker-column {
    position: fixed;
    top: 0;
    right: 0;
    width: 3rem;
    height: 100vh;
    z-index: 100;
    overflow: hidden;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    background: transparent;
    pointer-events: none;
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.02em;
    color: rgba(255, 208, 0, 0.4);
    animation: ticker-scroll 40s linear infinite;
}

.ticker-content span {
    display: inline;
}

@keyframes ticker-scroll {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-50%);
    }
}

/* --- Hero Zone --- */
.hero-zone {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0a0a0a;
    overflow: hidden;
}

/* Scan Line - #00E5FF cyan */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #00E5FF;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.6), 0 0 40px rgba(0, 229, 255, 0.3);
    z-index: 10;
    animation: scan-sweep 1.2s ease-in-out 0.8s forwards;
    opacity: 0;
}

@keyframes scan-sweep {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 1;
        transform: translateY(100vh);
    }
}

/* Hero Overlay - covers content until scan line passes */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0a0a0a;
    z-index: 5;
    animation: overlay-reveal 1.2s ease-in-out 0.8s forwards;
}

@keyframes overlay-reveal {
    0% {
        clip-path: inset(0 0 100% 0);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

.hero-content {
    position: relative;
    z-index: 6;
    text-align: center;
    opacity: 0;
    animation: hero-appear 0.01s ease 2s forwards;
}

@keyframes hero-appear {
    to {
        opacity: 1;
    }
}

.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(5rem, 15vw, 14rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f0f0f0;
    line-height: 1;
    opacity: 0;
    animation: title-reveal 0.6s ease-out 2s forwards;
}

@keyframes title-reveal {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle-wrapper {
    margin-top: 1.5rem;
    overflow: hidden;
}

.hero-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.75rem, 1.2vw, 1rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    color: #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
    animation: typewriter 2.5s steps(35) 2.6s forwards;
}

.subtitle-jp {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Blinking Cursor */
.blink-cursor {
    color: #ffd000;
    animation: blink 1s steps(1) infinite;
}

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

/* --- Section Shared Styles --- */
.section-signal,
.section-origin,
.section-expiry {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.section-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 7vw, 6rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
}

/* --- Section 1: SIGNAL --- */
.section-signal {
    background-color: #0d0d0d;
    clip-path: polygon(0 0, 100% 3%, 100% 97%, 0 100%);
    padding: 6rem 2rem;
    flex-direction: column;
}

.section-inner {
    max-width: 1100px;
    width: 100%;
    padding-right: 3rem;
}

.signal-heading {
    color: #f0f0f0;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.8s ease;
}

.signal-heading.visible {
    transform: translateX(0);
    opacity: 1;
}

.waveform-svg {
    width: 100%;
    height: 200px;
    margin: 2rem 0;
}

.section-body {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.75rem, 1.2vw, 1rem);
    color: #f0f0f0;
    letter-spacing: 0.02em;
    margin-top: 1rem;
}

/* --- Section 2: ORIGIN --- */
.section-origin {
    flex-direction: column;
    clip-path: polygon(0 3%, 100% 0, 100% 100%, 0 97%);
    min-height: 100vh;
    padding: 0;
}

.origin-split {
    display: flex;
    width: 100%;
    flex: 1;
    min-height: 60vh;
}

.origin-left {
    flex: 1;
    background-color: #ffd000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.origin-left-inner {
    text-align: center;
}

.origin-kanji {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: clamp(5rem, 15vw, 14rem);
    font-weight: 700;
    color: #0a0a0a;
    line-height: 1;
}

.origin-right {
    flex: 1;
    background-color: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.origin-right-inner {
    text-align: center;
}

.origin-romaji {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(5rem, 15vw, 14rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    color: #ffd000;
    line-height: 1;
}

.origin-etymology {
    width: 100%;
    padding: 4rem 2rem;
    background: linear-gradient(to right, #ffd000 50%, #0a0a0a 50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.etymology-line {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.85rem, 1.5vw, 1.2rem);
    color: #0a0a0a;
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    text-align: center;
    background-color: #ffd000;
    padding: 0.3rem 1.5rem;
}

.etymology-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.etymology-kanji {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
}

/* --- Section 3: EXPIRY --- */
.section-expiry {
    background-color: #0a0a0a;
    clip-path: polygon(0 3%, 100% 0, 100% 100%, 0 100%);
    flex-direction: column;
    padding: 6rem 2rem;
}

.expiry-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.expiry-rec-dot {
    position: absolute;
    top: 2rem;
    right: 5rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ff3b30;
    animation: rec-blink 1s steps(1) infinite;
    z-index: 10;
}

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

.expiry-heading {
    color: #f0f0f0;
    margin-bottom: 3rem;
}

.countdown-display {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.countdown-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-digits {
    display: flex;
    gap: 0.1em;
}

.digit {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(6rem, 20vw, 18rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    color: #f0f0f0;
    line-height: 1;
    display: inline-block;
    min-width: 0.6em;
    text-align: center;
    overflow: hidden;
    position: relative;
}

.digit.cycling {
    animation: digit-cycle 0.15s steps(1) infinite;
}

@keyframes digit-cycle {
    0% { content: '0'; }
    10% { content: '1'; }
    20% { content: '2'; }
    30% { content: '3'; }
    40% { content: '4'; }
    50% { content: '5'; }
    60% { content: '6'; }
    70% { content: '7'; }
    80% { content: '8'; }
    90% { content: '9'; }
}

.countdown-separator {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(4rem, 14vw, 12rem);
    font-weight: 400;
    color: #4a4a4a;
    line-height: 1;
    align-self: flex-start;
}

.countdown-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: #4a4a4a;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

.expiry-message {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.75rem, 1.2vw, 1rem);
    color: #4a4a4a;
    letter-spacing: 0.02em;
    margin-top: 3rem;
}

/* --- Footer Zone --- */
.footer-zone {
    padding: 4rem 2rem 6rem;
    text-align: center;
    min-height: 20vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.footer-line {
    width: 100%;
    max-width: 1100px;
    height: 1px;
    background-color: #1a1a1a;
    margin-bottom: 2rem;
}

.footer-domain {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.3em;
    color: #4a4a4a;
    text-transform: lowercase;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .origin-split {
        flex-direction: column;
    }

    .origin-left,
    .origin-right {
        min-height: 40vh;
    }

    .origin-etymology {
        background: #ffd000;
    }

    .countdown-display {
        gap: 0.25rem;
    }

    .countdown-separator {
        font-size: clamp(3rem, 10vw, 8rem);
    }

    .ticker-column {
        display: none;
    }

    .expiry-rec-dot {
        right: 2rem;
    }
}
