/* ================================================
   ESTIMSTATION — SPACE STATION ATMOSPHERE CSS
   Updated with: glitch, ticker, page hero band,
   signal separators, orbit globe, portrait HUD,
   7-segment countdown, scroll-reveal.
   ================================================
   A single shared stylesheet layering space-station
   ambience across the whole site. Import after Tailwind.
   All effects use pointer-events: none and are purely
   cosmetic — nothing here breaks layout or interaction.
   ================================================ */


/* ------------------------------------------------
   1. SCANLINE MONITOR OVERLAY
   Mimics the horizontal scan lines of a space-station
   control panel monitor. Very low opacity — ambient,
   not distracting. position:fixed means it covers the
   full viewport at all times regardless of scroll.
   ------------------------------------------------ */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9000;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(0, 0, 0, 0.055) 3px,
        rgba(0, 0, 0, 0.055) 4px
    );
}


/* ------------------------------------------------
   2. HERO — DEEP-SPACE NEBULA ATMOSPHERE
   Adds purple and blue gradient blooms behind the
   hero text. The ::before darkening is lightened
   so the canvas starfield beneath it stays visible.
   ::after adds the coloured nebula on top of stars.
   ------------------------------------------------ */
.hero-bg::before {
    /* Lighten the existing darkening overlay so stars
       show through, especially at the edges. */
    background: radial-gradient(
        ellipse at center,
        rgba(10, 10, 10, 0.15) 0%,
        rgba(10, 10, 10, 0.55) 100%
    ) !important;
    z-index: 1;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(ellipse 65% 55% at 8% 88%,  rgba(100, 20, 200, 0.28) 0%, transparent 60%),
        radial-gradient(ellipse 50% 45% at 92% 12%,  rgba(15, 55, 180, 0.22) 0%, transparent 60%),
        radial-gradient(ellipse 35% 35% at 55% 45%,  rgba(50,  8, 100, 0.12) 0%, transparent 65%);
}

/* Hero content sits above both pseudo-element layers */
.hero-bg .content {
    position: relative;
    z-index: 5;
}


/* ------------------------------------------------
   3. FEATURE CARD — HUD CORNER BRACKETS
   Small L-shaped bracket decorations at the corners
   of every .feature-card, mimicking a heads-up-display
   panel on a space-station interface. They animate
   outward slightly on hover.
   ------------------------------------------------ */
.feature-card {
    position: relative;
}

.feature-card::before,
.feature-card::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-style: solid;
    border-color: rgba(250, 204, 21, 0.28);
    transition: border-color 0.3s ease, width 0.3s ease, height 0.3s ease;
    pointer-events: none;
}

/* Top-left bracket */
.feature-card::before {
    top: -1px;
    left: -1px;
    border-width: 2px 0 0 2px;
    border-radius: 2px 0 0 0;
}

/* Bottom-right bracket */
.feature-card::after {
    bottom: -1px;
    right: -1px;
    border-width: 0 2px 2px 0;
    border-radius: 0 0 2px 0;
}

.feature-card:hover::before,
.feature-card:hover::after {
    border-color: rgba(250, 204, 21, 1);
    width: 20px;
    height: 20px;
}


/* ------------------------------------------------
   4. ORBITRON HEADINGS — STATION READOUT GLOW
   A faint warm halo on every Orbitron heading, as if
   the text is an illuminated label on a control panel.
   ------------------------------------------------ */
.font-orbitron {
    text-shadow: 0 0 28px rgba(250, 204, 21, 0.10);
}


/* ------------------------------------------------
   5. YELLOW ACCENT TEXT — LIVE SIGNAL GLOW
   Yellow text reads like an active readout or
   indicator light on the station dashboard.
   ------------------------------------------------ */
.text-yellow-400 {
    text-shadow: 0 0 14px rgba(250, 204, 21, 0.40);
}


/* ------------------------------------------------
   6. GLOWING SECTION DIVIDERS
   Top-bordered sections get a gradient glow line
   that peaks yellow at the centre — like a signal
   transmission bar — instead of a flat grey rule.
   ------------------------------------------------ */
section.border-t {
    position: relative;
}

section.border-t::before {
    content: '';
    position: absolute;
    top: -1px;       /* sits exactly on the border */
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent    0%,
        rgba(250, 204, 21, 0.10) 25%,
        rgba(250, 204, 21, 0.30) 50%,
        rgba(250, 204, 21, 0.10) 75%,
        transparent   100%
    );
    pointer-events: none;
    z-index: 1;
}


/* ------------------------------------------------
   7. SECTION AMBIENT DOT GRID
   A very faint dot-grid on the dark-navy content
   sections, like the gridded floor panels of a
   real space station. Low enough opacity to feel
   subliminal rather than decorative.
   ------------------------------------------------ */
#features,
#merch,
#safety-summary,
.bg-gray-900 {
    background-image:
        radial-gradient(circle, rgba(250, 204, 21, 0.045) 1px, transparent 1px);
    background-size: 36px 36px;
}


/* ------------------------------------------------
   8. HEADER — SUBTLE VERTICAL GRID LINES
   Ultra-faint column lines in the sticky header,
   evoking the grid of a cockpit instrument panel.
   ------------------------------------------------ */
header {
    background-image: repeating-linear-gradient(
        90deg,
        transparent           0px,
        transparent           59px,
        rgba(250, 204, 21, 0.018) 59px,
        rgba(250, 204, 21, 0.018) 60px
    );
}


/* ------------------------------------------------
   9. RED ACCENT TEXT — ALERT SIGNAL GLOW
   Matches the same treatment as yellow but for the
   red alert / Safety colour used across the site.
   ------------------------------------------------ */
.text-red-500,
.text-red-600 {
    text-shadow: 0 0 14px rgba(220, 38, 38, 0.35);
}


/* ================================================
   10. HERO GLITCH / SIGNAL FLICKER
   Periodic clip-path + transform glitch on the
   main hero headings, mimicking a damaged signal.
   Two durations so h1/h2 don't fire simultaneously.
   ================================================ */
@keyframes hero-glitch {
    0%, 86%, 100% {
        transform: none; filter: none; opacity: 1; clip-path: none;
    }
    /* Subtle brightness flicker at 35 % */
    35%  { filter: brightness(1.06); }
    35.4%{ filter: none; }
    /* Micro-shift at 62 % */
    62%  { transform: translateX(1px); }
    62.3%{ transform: none; }
    /* Main glitch burst */
    87%  { transform: translateX(-3px) skewX(-0.4deg); filter: brightness(1.5); }
    88%  { transform: translateX(2px); filter: none; opacity: 1; }
    89%  { filter: brightness(0.5) contrast(3); opacity: 0.88; transform: none; }
    89.5%{ filter: none; opacity: 1; }
    /* Clip-path slice passes */
    91%  { clip-path: polygon(0 0,   100% 0,   100% 28%,  0 28%);  transform: translateX(5px);  opacity: 0.9; }
    92%  { clip-path: polygon(0 52%, 100% 52%, 100% 100%, 0 100%); transform: translateX(-4px); }
    92.8%{ clip-path: polygon(0 18%, 100% 18%, 100% 72%,  0 72%);  transform: translateX(3px); }
    93.5%{ clip-path: none; transform: none; opacity: 1; filter: none; }
}

.hero-glitch {
    animation: hero-glitch 11s infinite;
}

/* h2 fires out-of-phase so both headings don't glitch together */
h2.hero-glitch {
    animation-duration: 13s;
    animation-delay: -4s;
}


/* ================================================
   11. BROADCAST TICKER
   A thin scrolling status strip below the nav on
   every page, like a space-station comms ticker.
   ================================================ */
.broadcast-ticker {
    background: #000;
    border-bottom: 1px solid rgba(250, 204, 21, 0.18);
    height: 26px;
    overflow: hidden;
    position: relative;
    z-index: 49;
    flex-shrink: 0;
}

.broadcast-ticker .ticker-label {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: rgba(250, 204, 21, 0.13);
    border-right: 1px solid rgba(250, 204, 21, 0.28);
    font-family: 'Orbitron', monospace;
    font-size: 0.52rem;
    letter-spacing: 0.18em;
    color: rgba(250, 204, 21, 0.92);
    z-index: 2;
    white-space: nowrap;
    pointer-events: none;
}

.broadcast-ticker .ticker-track {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    animation: ticker-scroll 55s linear infinite;
    padding-left: 170px;          /* clear the label badge */
}

.broadcast-ticker .ticker-track span {
    font-family: 'Orbitron', monospace;
    font-size: 0.57rem;
    letter-spacing: 0.1em;
    color: rgba(250, 204, 21, 0.6);
    padding: 0 2.8rem;
}

.broadcast-ticker .ticker-track span.alert {
    color: rgba(220, 38, 38, 0.8);
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}


/* ================================================
   12. INNER PAGE HERO BAND
   A compact atmospheric strip at the top of inner
   pages showing the current station module name,
   a glowing line and a "SYSTEMS NOMINAL" status.
   ================================================ */
.page-hero-band {
    border-bottom: 1px solid rgba(250, 204, 21, 0.1);
    padding: 0.6rem 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.05) 0%, transparent 100%);
}

.page-hero-band::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(250, 204, 21, 0.032) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}

.page-hero-band-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    position: relative;
}

.page-hero-band-breadcrumb {
    font-family: 'Orbitron', monospace;
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    color: rgba(250, 204, 21, 0.55);
    text-transform: uppercase;
    white-space: nowrap;
}

.page-hero-band-breadcrumb .sep {
    color: rgba(220, 38, 38, 0.6);
    margin: 0 0.4em;
}

.page-hero-band-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(250, 204, 21, 0.18), transparent);
}

.page-hero-band-status {
    font-family: 'Orbitron', monospace;
    font-size: 0.48rem;
    letter-spacing: 0.18em;
    color: rgba(74, 222, 128, 0.65);
    text-transform: uppercase;
    white-space: nowrap;
}

.page-hero-band-status::before {
    content: '● ';
    color: rgba(74, 222, 128, 0.8);
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}


/* ================================================
   13. SIGNAL WAVE SEPARATORS
   Canvas-backed animated sine-wave dividers that
   appear between major sections of the page.
   ================================================ */
.signal-separator {
    width: 100%;
    height: 44px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.signal-separator canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}


/* ================================================
   14. ORBIT GLOBE (safety section)
   ================================================ */
/* Transparent overlay canvas — sits on top of the GIF */
#orbit-globe {
    display: block;
    width: 100%;
    border-radius: 0.5rem;
    background: transparent;
}

/* GIF image gets the blue glow treatment */
#orbit-globe-img {
    border-radius: 0.5rem;
    box-shadow:
        0 0 0 1px rgba(50, 130, 255, 0.2),
        0 0 40px rgba(50, 130, 255, 0.15),
        0 25px 50px rgba(0, 0, 0, 0.8);
}


/* ================================================
   15. SIR THORN PORTRAIT TREATMENT
   Red HUD brackets, scanline overlay, red glow.
   ================================================ */
.portrait-frame {
    position: relative;
    display: block;
    border-radius: 0.5rem;
}

.portrait-frame img {
    border-radius: 0.5rem;
    display: block;
    width: 100%;
}

/* Red glow border */
.portrait-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0.5rem;
    box-shadow:
        0 0 0 1px rgba(220, 38, 38, 0.45),
        0 0 28px rgba(220, 38, 38, 0.22),
        0 0 56px rgba(220, 38, 38, 0.08);
    pointer-events: none;
    z-index: 2;
}

/* Scanline overlay on photo */
.portrait-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0.5rem;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.13) 2px,
        rgba(0, 0, 0, 0.13) 3px
    );
    pointer-events: none;
    z-index: 3;
}

/* HUD corner brackets */
.portrait-hud {
    position: absolute;
    width: 22px;
    height: 22px;
    border-style: solid;
    border-color: rgba(220, 38, 38, 0.9);
    z-index: 4;
    pointer-events: none;
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}

.portrait-frame:hover .portrait-hud {
    width: 30px;
    height: 30px;
    border-color: #dc2626;
}

.portrait-hud.tl { top: 8px;    left: 8px;    border-width: 2px 0 0 2px; }
.portrait-hud.tr { top: 8px;    right: 8px;   border-width: 2px 2px 0 0; }
.portrait-hud.bl { bottom: 8px; left: 8px;    border-width: 0 0 2px 2px; }
.portrait-hud.br { bottom: 8px; right: 8px;   border-width: 0 2px 2px 0; }


/* ================================================
   16. 7-SEGMENT MISSION CLOCK (countdown timer)
   Red active digits on a near-black display board,
   amber labels — red/amber as specified.
   ================================================ */
.seg-display-wrapper {
    display: inline-block;
    background: rgba(4, 0, 0, 0.75);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 10px;
    padding: 1.4rem 2rem 1.2rem;
    box-shadow:
        0 0 0 1px rgba(220, 38, 38, 0.08),
        0 0 30px rgba(220, 38, 38, 0.1),
        inset 0 0 24px rgba(0, 0, 0, 0.6);
}

.seg-title {
    font-family: 'Orbitron', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(251, 191, 36, 0.75);
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
    margin-bottom: 1rem;
}

.seg-digits-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0.6rem;
}

.seg-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.seg-digit {
    font-family: 'Orbitron', monospace;
    font-variant-numeric: tabular-nums;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: #dc2626;
    text-shadow:
        0 0 6px  rgba(220, 38, 38, 1),
        0 0 16px rgba(220, 38, 38, 0.55),
        0 0 26px rgba(220, 38, 38, 0.14);
    background: rgba(10, 0, 0, 0.7);
    border: 1px solid rgba(220, 38, 38, 0.22);
    border-radius: 5px;
    padding: 0.18em 0.35em;
    min-width: 1.7em;
    text-align: center;
    letter-spacing: 0.06em;
    line-height: 1;
    position: relative;
    display: inline-block;
}


.seg-digit-sep {
    font-family: 'Orbitron', monospace;
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    font-weight: 900;
    color: rgba(251, 191, 36, 0.55);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.35);
    line-height: 1;
    padding: 0 0.05em;
    align-self: center;
    margin-bottom: 1.5rem;
    animation: colon-blink 1s step-end infinite;
}

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

.seg-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.48rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(251, 191, 36, 0.62);
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.28);
}


/* ================================================
   17. SCROLL-REVEAL
   Elements with .reveal fade+slide in when they
   enter the viewport. JS adds .in-view via
   IntersectionObserver.
   ================================================ */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.in-view {
    opacity: 1;
    transform: none;
}
