/* ============================================================
   Air&Ember — Retro / Vintage design example ("Rad Central")
   Three era themes (70s print / 80s neon / 90s web) are driven
   by a body class + CSS custom properties. The era switcher
   buttons just swap the class; these variables do the rest.
   ============================================================ */

@font-face {
    font-family: Krusty;
    src: url(../assets/fonts/krustycraft.otf);
}

@font-face {
    font-family: oneUp;
    src: url(../assets/fonts/designFonts/1up.ttf);
}

@font-face {
    font-family: PIXEL;
    src: url(../assets/fonts/designFonts/PIXEL.TTF);
}

@font-face {
    font-family: ThreeD;
    src: url(../assets/fonts/designFonts/3DIsometric-Regular.ttf);
}

@font-face {
    font-family: MondayCoffee;
    src: url(../assets/fonts/MondayCoffee.ttf);
}

@font-face {
    font-family: Feronia;
    src: url(../assets/fonts/Feronia.ttf);
}

@font-face {
    font-family: DigitalSystem;
    src: url(../assets/fonts/DigitalSystem.ttf);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---- Era themes -------------------------------------------------- */

/* 1980s Neon (default) */
body.era-80s {
    --bg: #120826;
    --bg-accent: radial-gradient(circle at 50% -20%, #2d1357 0%, #120826 60%);
    --panel-bg: #1d1040;
    --text: #e8e6ff;
    --heading: #ffffff;
    --accent: #ff2bd6;
    --accent2: #19e3ff;
    --panel-border: 2px solid #ff2bd6;
    --panel-shadow: 0 0 14px rgba(255, 43, 214, 0.55), 0 0 30px rgba(25, 227, 255, 0.25);
    --radius: 10px;
    --font-title: 'PIXEL', monospace;
    --font-display: 'ThreeD', 'Impact', sans-serif;
    --font-nav: 'oneUp', monospace;
    --font-body: 'Trebuchet MS', 'Segoe UI', sans-serif;
    --link: #19e3ff;
}

/* 1970s Print */
body.era-70s {
    --bg: #ecdcb8;
    --bg-accent: linear-gradient(180deg, #f2e4c4 0%, #e6d2a6 100%);
    --panel-bg: #f7eed7;
    --text: #4a2c12;
    --heading: #7a3b10;
    --accent: #c1531b;
    --accent2: #d99e2b;
    --panel-border: 3px solid #7a3b10;
    --panel-shadow: 6px 6px 0 rgba(122, 59, 16, 0.35);
    --radius: 18px;
    --font-title: 'MondayCoffee', cursive;
    --font-display: 'Feronia', 'Georgia', serif;
    --font-nav: 'Feronia', 'Georgia', serif;
    --font-body: 'Georgia', 'Times New Roman', serif;
    --link: #c1531b;
}

/* 1990s Web */
body.era-90s {
    --bg: #c0c0c0;
    --bg-accent: linear-gradient(#c0c0c0, #c0c0c0);
    --panel-bg: #d4d0c8;
    --text: #000000;
    --heading: #000080;
    --accent: #000080;
    --accent2: #ff0000;
    --panel-border: 3px outset #ffffff;
    --panel-shadow: none;
    --radius: 0px;
    --font-title: 'Times New Roman', Times, serif;
    --font-display: 'Times New Roman', Times, serif;
    --font-nav: 'Times New Roman', Times, serif;
    --font-body: 'Times New Roman', Times, serif;
    --link: #0000ee;
}

html {
    background-color: #000;
}

body {
    background: var(--bg-accent), var(--bg);
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    min-height: 100vh;
    width: 100%;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ---- Return link -------------------------------------------------- */

.returnCont {
    display: flex;
    justify-content: center;
}

.Return {
    position: fixed;
    bottom: 1rem;
    background-color: #a74918;
    width: 60vw;
    display: flex;
    justify-content: center;
    border-radius: 50px;
    padding: 0.5rem;
    color: white;
    font-weight: 200;
    letter-spacing: 0.15rem;
    text-decoration: none;
    font-family: 'Krusty', sans-serif;
    z-index: 200000;
}

/* ---- CRT overlay --------------------------------------------------- */

.crt {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100000;
    display: none;
}

body.scanlines-on .crt {
    display: block;
}

.crt::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.14) 2px,
        rgba(0, 0, 0, 0.14) 4px
    );
}

.crt::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
}

/* ---- Shared panel chrome -------------------------------------------- */

.panel {
    background: var(--panel-bg);
    border: var(--panel-border);
    box-shadow: var(--panel-shadow);
    border-radius: var(--radius);
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.section-heading {
    font-family: var(--font-display);
    color: var(--heading);
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    margin-bottom: 0.75rem;
}

/* ---- Header ----------------------------------------------------------- */

.site-header {
    text-align: center;
    padding: 20px;
    margin: 12px 12px 24px;
}

.chrome-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 7vw, 4.5rem);
    margin-bottom: 12px;
    color: var(--heading);
}

body.era-80s .chrome-title {
    background: linear-gradient(180deg, #ffffff 0%, #bfe9ff 35%, #2a7bd4 50%, #dff6ff 55%, #7f4dff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 8px rgba(25, 227, 255, 0.6));
}

nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

nav ul li a {
    display: inline-block;
    text-decoration: none;
    color: var(--text);
    font-size: 1.1rem;
    padding: 6px 14px;
    border: var(--panel-border);
    border-radius: var(--radius);
    font-family: var(--font-nav);
    transition: background 0.2s, color 0.2s;
}

nav ul li a:hover {
    background-color: var(--accent);
    color: var(--panel-bg);
}

/* ---- Layout ----------------------------------------------------------- */

.mainCont {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 12px 90px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ---- Era switcher ------------------------------------------------------- */

.era-switcher {
    padding: clamp(1.25rem, 3vw, 2rem);
    text-align: center;
}

.era-intro {
    max-width: 640px;
    margin: 0 auto 1.25rem;
    line-height: 1.6;
}

.era-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

/* Each era button keeps its own era's look at all times — it's a preview */
.era-btn {
    font-size: 1.05rem;
    padding: 0.9rem 1.4rem;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: transform 0.15s ease;
}

.era-btn:hover {
    transform: translateY(-2px);
}

.era-btn:active {
    transform: translateY(1px);
}

.era-btn-70s {
    font-family: 'MondayCoffee', cursive;
    background: #f7eed7;
    color: #7a3b10;
    border: 3px solid #7a3b10;
    border-radius: 16px;
    box-shadow: 4px 4px 0 rgba(122, 59, 16, 0.4);
}

.era-btn-80s {
    font-family: 'PIXEL', monospace;
    background: #1d1040;
    color: #19e3ff;
    border: 2px solid #ff2bd6;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(255, 43, 214, 0.6);
}

.era-btn-90s {
    font-family: 'Times New Roman', Times, serif;
    font-weight: bold;
    background: #d4d0c8;
    color: #000080;
    border: 3px outset #ffffff;
    border-radius: 0;
}

.era-btn.is-active {
    outline: 3px dashed var(--accent2);
    outline-offset: 3px;
}

.era-caption {
    max-width: 640px;
    margin: 0 auto;
    font-size: 0.95rem;
    line-height: 1.6;
    font-style: italic;
}

/* ---- Title + starburst ---------------------------------------------------- */

.title-block {
    position: relative;
    text-align: center;
    padding: 0.5rem 0;
}

.RetroTitle {
    font-family: var(--font-title);
    color: var(--heading);
    font-size: clamp(1.6rem, 6vw, 5rem);
    letter-spacing: 0.04em;
}

body.era-80s .RetroTitle.glow {
    color: #fff;
    text-shadow:
        0 0 6px #ff2bd6,
        0 0 18px #ff2bd6,
        0 0 36px #19e3ff;
}

.starburst {
    position: absolute;
    top: -28px;
    right: clamp(0px, 6vw, 80px);
    width: 92px;
    height: 92px;
    background: var(--accent2);
    color: #1a0b00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-nav);
    font-weight: bold;
    font-size: 1.05rem;
    clip-path: polygon(
        50% 0%, 61% 13%, 77% 6%, 79% 23%, 96% 24%, 89% 40%,
        100% 50%, 89% 60%, 96% 76%, 79% 77%, 77% 94%, 61% 87%,
        50% 100%, 39% 87%, 23% 94%, 21% 77%, 4% 76%, 11% 60%,
        0% 50%, 11% 40%, 4% 24%, 21% 23%, 23% 6%, 39% 13%
    );
    animation: spin 14s linear infinite;
}

.starburst span {
    animation: counterspin 14s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes counterspin {
    to { transform: rotate(-360deg); }
}

/* ---- Carousel ----------------------------------------------------------------- */

.carousel {
    padding: 1.25rem;
}

.carousel-window {
    position: relative;
    height: 170px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1.5rem;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.6s ease, transform 0.6s ease;
    font-family: var(--font-title);
    color: var(--heading);
    font-size: clamp(1.1rem, 4.5vw, 2.4rem);
    pointer-events: none;
}

.slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.carousel-btn {
    font-family: var(--font-nav);
    font-size: 1rem;
    padding: 0.5rem 0.9rem;
    background: var(--panel-bg);
    color: var(--accent);
    border: var(--panel-border);
    border-radius: var(--radius);
    cursor: pointer;
}

.carousel-btn:hover {
    background: var(--accent);
    color: var(--panel-bg);
}

.carousel-dots {
    display: flex;
    gap: 0.6rem;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.dot.is-active {
    background: var(--accent);
}

/* ---- Content ----------------------------------------------------------------------- */

.content {
    padding: clamp(1.25rem, 4vw, 2.5rem);
}

.contentPImg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.contentPImg p {
    line-height: 1.9;
    max-width: 60ch;
}

.retro-figure {
    text-align: center;
}

.retro-figure img {
    width: 100%;
    max-width: 480px;
    border: var(--panel-border);
    border-radius: var(--radius);
}

.retro-figure figcaption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-style: italic;
}

/* ---- Widgets: hit counter + CRT toggle ------------------------------------------------ */

.widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.hit-counter,
.crt-control {
    padding: 1.5rem;
    text-align: center;
}

.counter-label {
    font-family: var(--font-display);
    color: var(--heading);
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
}

.odometer {
    display: inline-flex;
    gap: 4px;
    padding: 8px 10px;
    background: #000;
    border: 2px inset #555;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.digit {
    font-family: 'DigitalSystem', monospace;
    font-size: 1.8rem;
    color: #3dff5e;
    background: #051405;
    padding: 2px 6px;
    border-radius: 3px;
    min-width: 1.1ch;
    text-align: center;
}

.widget-caption {
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.5;
    max-width: 38ch;
    margin: 0 auto;
}

.chunky-toggle {
    font-family: var(--font-nav);
    font-size: 1.2rem;
    padding: 0.7rem 2.2rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    background: var(--panel-bg);
    color: var(--accent2);
    border: var(--panel-border);
    border-radius: var(--radius);
}

.chunky-toggle.is-on {
    background: var(--accent);
    color: var(--panel-bg);
}

/* ---- Footer marquee --------------------------------------------------------------------- */

footer {
    text-align: center;
    padding: 12px 0;
    margin: 24px 12px 12px;
    overflow: hidden;
}

.marquee {
    white-space: nowrap;
    overflow: hidden;
}

.marquee span {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 18s linear infinite;
    font-family: var(--font-nav);
    color: var(--text);
}

@keyframes marquee {
    to { transform: translateX(-100%); }
}

/* ---- Konami easter egg --------------------------------------------------------------------- */

body.rad-mode {
    animation: radmode 0.6s linear infinite;
}

@keyframes radmode {
    0% { filter: hue-rotate(0deg) saturate(1.6); }
    100% { filter: hue-rotate(360deg) saturate(1.6); }
}

/* ---- Motion preferences ----------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .starburst,
    .starburst span,
    .marquee span,
    body.rad-mode {
        animation: none !important;
    }

    .marquee span {
        padding-left: 0;
    }

    .slide {
        transition: none;
    }
}

/* ---- Responsive ------------------------------------------------------------------------------- */

@media screen and (min-width: 721px) {
    nav ul {
        flex-direction: row;
    }

    .Return {
        position: fixed;
        background-color: #a74918;
        top: 15px;
        right: 25px;
        bottom: auto;
        height: 3rem;
        width: 10rem;
        display: flex;
        justify-content: center;
        border-radius: 50px;
        padding: 0.5rem;
        color: white;
        font-weight: 200;
        letter-spacing: 0.15rem;
        text-decoration: none;
        font-family: 'Krusty', sans-serif;
        align-items: center;
        box-shadow: 2px 2px 5px black;
    }
}

@media screen and (min-width: 1160px) {
    .contentPImg {
        flex-direction: row;
        gap: 2.5rem;
    }
}
@media screen and (max-width: 480px) {
    .Return {
        visibility: hidden;
    }
}