/*
 * Site stylesheet. Loaded after Bootstrap 4, so rules here win.
 * Order: theme variables, base, navigation, footer, home, works, blog/posts,
 * space, about/404, easter eggs.
 */
:root {
    /* Light Mode (Default) */
    --bg-color: #fafafa;
    --text-color: #333;
    --heading-color: #2b2b2b;
    --accent-color: #fbdc75;
    --link-color: #8a8a8a;
    --nav-bg-color: #fbdc75;
    --footer-bg-color: #d1d1d1;
    --card-bg-color: #faf9f6;
    --border-color: #d5d5d5;
    --hover-bg-color: rgba(0,0,0,0.03);
    --toggle-track-bg-light: #e0e0e0;
    --toggle-thumb-bg-light: #ffffff;
    --ink: #2b2b2b;
}

[data-theme="dark"] {
    /* Dark Mode */
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --heading-color: #f0f0f0;
    --accent-color: #d4b04c;
    --link-color: #b0b0b0;
    --nav-bg-color: #1f1f1f;
    --footer-bg-color: #1a1a1a;
    --card-bg-color: #1e1e1e;
    --border-color: #333;
    --hover-bg-color: rgba(255,255,255,0.05);
    --toggle-track-bg-dark: #333;
    --toggle-thumb-bg-dark: #555;
    --ink: #f0f0f0;
}

/* Base styles */
body {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    width: 100%;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    background-color: var(--bg-color); /* Variable background */
    transition: background-color 0.3s ease, color 0.3s ease;
}

a.global:not(.badge):not(.btn),
.global a:not(.badge):not(.btn) {
    text-decoration: none;
    margin: 0.15rem 0;
    color: var(--link-color);
    transition: color 0.2s ease;
}

/* Social links horizontal layout */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    padding-left: 0;
    margin: 0.75rem 0;
}

li.global:not(.badge):not(.btn),
.global li:not(.badge):not(.btn),
.social-links li {
    display: flex;
    align-items: center;
}

.social-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--link-color);
    transition: color 0.2s ease;
}

a.global:hover:not(.badge):not(.btn),
.global a:hover:not(.badge):not(.btn),
.social-links a:hover {
    background: linear-gradient(45deg, #fbdc75, #8a2be2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 2s ease-in-out infinite;
}

img.global:not(.badge):not(.btn),
.global img:not(.badge):not(.btn),
.social-links img {
    flex-shrink: 0;
}

/* Animations */
@keyframes gradientShift {
    0%, 100% {
        background: linear-gradient(45deg, var(--accent-color), #8a2be2);
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    50% {
        background: linear-gradient(45deg, #8a2be2, var(--accent-color));
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #e60073, 0 0 40px #e60073, 0 0 50px #e60073, 0 0 60px #e60073, 0 0 70px #e60073;
    }
    to {
        text-shadow: 0 0 20px #fff, 0 0 30px #ff4da6, 0 0 40px #ff4da6, 0 0 50px #ff4da6, 0 0 60px #ff4da6, 0 0 70px #ff4da6, 0 0 80px #ff4da6;
    }
}

.glowText {
    text-decoration: underline;
    animation: glow 4s ease-in-out infinite alternate;
    animation-delay: 2s;
}

/* Lists */
ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

ul.posts li {
    list-style: none;
}

/* Typography */
h1, .section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-family: 'Helvetica', 'Arial', 'Sans-Serif';
    margin: 0.75rem;
    font-weight: normal;
}

h3, h4, h5, .h3, .h4, .h5 {
    font-family: 'Helvetica', 'Arial', 'Sans-Serif';
    margin: 1rem 0 0.5rem 0;
}

p {
    /* line-height: 1.4em; */
    color: var(--text-color);
    margin: 0.15rem 0;
}

/* Landing page type scale (scoped so posts are unaffected) */
.landing-page p,
.landing-page li,
.landing-page blockquote {
    line-height: 1.4rem;
}

/* Layout */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

body {
    padding-top: 56px; /* room for the fixed navbar */
}

main {
    flex: 1 0 auto;
}

.section {
    padding-bottom: 2rem;
    scroll-margin-top: 1rem;
}

.page {
    padding-top: 1rem;
    padding-bottom: 2rem;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 2000;
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: #2b2b2b;
}

.skip-link:focus {
    left: 0;
}

/* Navigation */
.site-nav {
    background-color: var(--nav-bg-color) !important;
    font-weight: bold;
    font-family: 'Helvetica', 'Arial', 'Sans-Serif';
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

/* Slides away on scroll down, back on scroll up (see assets/js/site.js) */
.site-nav.navbar-hidden {
    transform: translateY(-100%);
}

.site-nav .navbar-collapse {
    justify-content: flex-start;
}

.site-nav .navbar-nav {
    margin-left: 0;
    margin-right: auto;
}

.site-nav .navbar-toggler {
    border: 1px solid rgba(0,0,0,0.1);
}

.site-nav .nav-link {
    transition: color 0.2s ease;
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active {
    color: #6c757d !important;
}

.site-nav .nav-link.active {
    font-weight: bold;
}

/* Dark-mode overrides for Bootstrap navbar (prevent dark-on-dark text) */
[data-theme="dark"] .navbar,
[data-theme="dark"] .navbar .navbar-brand,
[data-theme="dark"] .navbar .nav-link,
[data-theme="dark"] .navbar-toggler {
    color: var(--text-color) !important;
}

[data-theme="dark"] .navbar .nav-link:hover {
    color: var(--accent-color) !important;
}

.site-nav ul, footer ul {
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 0;
}

.site-nav ul li, footer ul li {
    display: inline;
    margin-right: 15px;
}

.site-nav ul li:last-child, footer ul li:last-child {
    margin-right: 0;
}

/* Toggle Button */
.theme-toggle-btn {
    background-color: var(--toggle-track-bg-light);
    border: 1px solid var(--border-color);
    border-radius: 999px; /* Oval shape */
    width: 60px; /* Wider for oval */
    height: 38px; /* Slightly less than width to maintain aspect ratio with thumb */
    display: flex;
    align-items: center;
    position: relative; /* For absolute positioning of thumb */
    overflow: hidden; /* Hide overflow of emoji when sliding */
    transition: background-color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    text-decoration: none !important;
    padding: 0; /* Remove default padding */
}

.theme-toggle-btn .toggle-thumb {
    width: 30px; /* Size of the circular thumb */
    height: 30px;
    border-radius: 50%;
    background-color: var(--toggle-thumb-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
    font-size: 1.2rem; /* Emoji size */
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    position: absolute;
    left: 3px; /* Initial position for light mode */
    top: 3px; /* Center vertically */
}

/* Dark mode states for toggle button */
[data-theme="dark"] .theme-toggle-btn {
    background-color: var(--toggle-track-bg-dark);
}

[data-theme="dark"] .theme-toggle-btn .toggle-thumb {
    transform: translateX(22px); /* Move thumb to the right */
    background-color: var(--toggle-thumb-bg-dark);
}

/* Hover effects for toggle button */
.theme-toggle-btn:hover {
    box-shadow: 0 0 0 2px var(--accent-color); /* Subtle glow on hover */
}

/* Hover effects for thumb (optional, but good UX) */
.theme-toggle-btn .toggle-thumb:hover {
    box-shadow: 0 1px 5px rgba(0,0,0,0.3);
}

/* Ensure emoji is centered within thumb */
.theme-toggle-btn .toggle-thumb::before {
    content: attr(data-emoji); /* Use data-emoji attribute for dynamic emoji */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}



/* Planet navigator arrows */
.arrow-up, .arrow-down {
    border: 0;
    padding: 0;
    cursor: pointer;
}

.arrow-up {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    background-color: var(--text-color);
    -webkit-mask: url("/assets/arrow-alt-circle-up.svg") no-repeat center / contain;
    mask: url("/assets/arrow-alt-circle-up.svg") no-repeat center / contain;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.arrow-down {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    background-color: var(--text-color);
    -webkit-mask: url("/assets/arrow-alt-circle-down.svg") no-repeat center / contain;
    mask: url("/assets/arrow-alt-circle-down.svg") no-repeat center / contain;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.arrow-up:hover, .arrow-down:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
}

/* Footer */
footer {
    width: 100%;
    background-color: var(--footer-bg-color);
    border-top: 1px solid var(--border-color);
    font-size: 0.8em;
    padding: 1rem 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Post styles */
.post h1 {
    text-align: center;
    margin: 0 auto 0.5rem auto; /* Center and provide vertical spacing */
    line-height: 1.2;
}

.post .post-meta {
    text-align: center;
    margin: 0 auto 2rem auto; /* Center and provide vertical spacing */
    display: block;
}

.post {
    margin: 1rem auto; /* Center the post content */
    max-width: 700px; /* Limit line length for readability */
    line-height: 1.6; /* Improve line spacing */
}

.post p {
    margin-bottom: 1rem; /* Space between paragraphs */
}

.post li {
    font-size: 1rem; /* Slightly larger font for list items */
    line-height: 1.5; /* Improve line spacing for list items */
    margin-bottom: 0.5rem; /* Space between list items */
}
.post blockquote {
    font-size: 1rem; /* Slightly larger font for blockquotes */
    line-height: 1.5; /* Improve line spacing for blockquotes */
}

.post blockquote, blockquote {
  margin: 1rem 1.25rem;
  padding: .75rem 1rem;
  border-left: 4px solid var(--border-color);
  background: var(--card-bg-color);
  color: var(--text-color);
  font-style: italic;        /* optional */
}
.post blockquote > :last-child { margin-bottom: 0; }  /* tidy inner p spacing */

table.posts {
  width: 100%;
  border-collapse: collapse;
}
table.posts th, table.posts td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
}
table.posts tbody tr:hover td {
  background: var(--hover-bg-color);
}

/* 1) Theme variables with safe fallbacks */
:root{
  --accent: #f0d35e;            /* close to your nav yellow */
  --ink: #2b2b2b;               /* heading color */
  --ink-muted: #6b7280;
}

/* If your header has the accent bg, let it define the same var */

/* 2) Subtle tagline style */
.tagline-subtle{
  font-size: clamp(1.05rem, 1.2vw + .35rem, 1.6rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--ink);
  display: inline-block;
  position: relative;
  text-wrap: balance;
}

/* thin gradient underline that echoes the site yellow */
.tagline-subtle::after{
  content:"";
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:-.28em;
  width: 42%;
  max-width: 14rem;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    color-mix(in oklab, var(--accent), white 10%),
    color-mix(in oklab, var(--accent), black 12%)
  );
  opacity:.65;
  transition: width .35s ease, opacity .35s ease;
}

.tagline-subtle:hover::after{
  width: 65%;
  opacity:.9;
}

/* Optional: use a very soft text glow to match your card shadows */
.tagline-subtle{
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

/* Tagline adjustments for dark mode to avoid bright white glow */
[data-theme="dark"] .tagline-subtle{
    color: var(--heading-color); /* uses dark theme heading color */
    text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce){
  .tagline-subtle::after{ transition: none; }
}


/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .site-nav {
        padding: 0.25rem 0.5rem;
    }

    .site-nav ul {
        flex-direction: column;
        gap: 10px;
        padding: 0.5rem 0;
    }

    h1, .section-title {
        font-size: 2rem;
        margin: 0.5rem;
    }

    .planet-card {
        width: 100% !important;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 5px;
    }

    h1, .section-title {
        font-size: 1.5rem;
    }

    .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Post content dark-mode compatibility fixes */
[data-theme="dark"] article,
[data-theme="dark"] .post,
[data-theme="dark"] .post-content,
[data-theme="dark"] .global {
    color: var(--text-color) !important;
    background-color: transparent !important;
}

[data-theme="dark"] pre,
[data-theme="dark"] code {
    background-color: #111 !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] blockquote {
    background: transparent !important;
    border-left: 4px solid var(--accent-color) !important;
    color: var(--text-color) !important;
}

/* Neutralize inline backgrounds used in content when in dark mode */
[data-theme="dark"] [style*="background"] {
    background-color: var(--card-bg-color) !important;
    color: var(--text-color) !important;
}

/* Ensure badges, buttons and small UI elements in posts are visible */
[data-theme="dark"] .post-content .badge,
[data-theme="dark"] .post-content .btn,
[data-theme="dark"] .post-content .card {
    background-color: var(--card-bg-color) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

/* Professional gradient text effect for the name */
.hero__name {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 595;
  letter-spacing: 0.314159265359px;
  text-shadow: 1.6180px 3.14159265359px rgba(0,0,0,0.12);
  transition: all 0.3s ease;
}

/* Ensure prominent name gradient is visible in dark mode */
[data-theme="dark"] .hero__name {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(220,220,220,0.9));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.hero__name:hover {
  background: linear-gradient(135deg, #34495e, #2c3e50);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transform: translateY(-0.6931px);
  text-shadow: 1.6180px 3.14159265359px rgba(0,0,0,0.12);
}

/* Planet card alignment and centering */
.planet-card {
  display: flex;
  opacity: 1;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 0;
  max-width: 18rem;
  width: 100%;
  height: auto;
  min-height: 600px; /* Ensure consistent minimum height */
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: opacity 0.15s ease-in-out, transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 1rem;
}

.planet-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.planet-card .card-body {
  width: 100%;
  text-align: left;
  flex: 1; /* Take remaining space */
  display: flex;
  flex-direction: column;
}

.planet-card .card-img-top {
  width: 100%;
  height: 200px; /* Fixed height for consistency */
  object-fit: cover;
  flex-shrink: 0; /* Prevent image from shrinking */
}

.planet-card .card-text {
  flex: 1; /* Take remaining space in card body */
  display: flex;
  flex-direction: column;
}

.planet-card .card-text ul {
  flex: 1; /* Take remaining space */
  margin-bottom: 1rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .planet-card {
    min-height: 500px; /* Smaller minimum height on mobile */
    max-width: 100%;
  }

  .planet-card .card-img-top {
    height: 150px; /* Smaller image height on mobile */
  }
}

@media (max-width: 480px) {
  .planet-card {
    min-height: 450px; /* Even smaller on very small screens */
  }

  .planet-card .card-img-top {
    height: 120px;
  }
}

.space-breadcrumb-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;     /* centers vertically with arrows */
    gap: 0.5rem;             /* clean spacing between items */
    margin: 0.5rem 0;        /* less top/bottom whitespace */
}

.space-breadcrumb-row .badge {
    padding: 0.25rem 0.5rem; /* trims bottom padding */
    margin: 0;               /* remove stray spacing */
    line-height: 1.2;        /* fixes text sitting too high */
    vertical-align: middle;
    font-size: 0.9rem;
}

/* ---------- Cards (Bootstrap overrides) ---------- */
.card {
    background-color: var(--card-bg-color) !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    transition: background-color 0.3s ease;
}

.card-img-top {
    width: 100%;
    height: 30vw;
    object-fit: cover;
}

/* ---------- Home: hero ---------- */
.hero {
    display: flex;
    align-items: center;
    gap: 1.1618rem;
    margin: 1.5rem 0 1rem;
}

.hero__photo {
    width: 160px;
    height: 160px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--card-bg-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.hero__name {
    font-size: 2rem;
    margin: 0 0 1rem;
}

.hero__role {
    font-family: 'Helvetica', 'Arial', 'Sans-Serif';
    font-size: 1.5rem;
    line-height: 1.2;
    margin: 0;
}

@media (max-width: 480px) {
    .hero__photo {
        width: 120px;
        height: 120px;
    }
}

/* Inline links inside the summary bullets */
.summary ul {
    list-style: none;
}

.summary.global li:not(.badge):not(.btn) {
    display: block;
}

.entry-heading {
    font-size: 1rem;
    font-weight: bold;
    margin: 0.5rem 0 0;
}

/* ---------- Home: skills and certifications ---------- */
.skill-heading {
    display: inline-block;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--accent-color);
}

.skill-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.skill-grid > li {
    display: flex;
}

.skill-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 5rem;
    padding: 1.25rem 0.9rem;
    text-align: center;
}

a.skill-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12) !important;
    text-decoration: none;
}

a.skill-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.skill-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
}

/* SVG icons have no intrinsic size, so size them here */
.skill-card img {
    width: 32px;
    height: 32px;
    max-width: none;
    flex-shrink: 0;
}

.skill-card img[width="64"] {
    width: 64px;
}

.skill-card--cert img {
    width: 64px;
    height: 64px;
}

.skill-card .skill-links img {
    width: 16px;
    height: 16px;
    margin-right: 4px;
}

/* ---------- Works ---------- */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.25rem;
    list-style: none;
    margin: 0.75rem 0 2rem;
    padding: 0;
}

.work-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.work-card:hover,
.work-card:focus-within {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15) !important;
}

.work-card--featured {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 2px var(--accent-color) !important;
}

.work-card__media {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    background: linear-gradient(135deg, var(--accent-color), #8a2be2);
}

.work-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-card__media--contain {
    background: var(--hover-bg-color);
}

.work-card__media--contain img {
    object-fit: contain;
    padding: 0.75rem;
}

.work-card__emoji {
    font-size: 3.5rem;
    line-height: 1;
}

.work-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
}

.work-card__title {
    font-size: 1.15rem;
    font-weight: bold;
    margin: 0;
}

.work-card__link {
    color: var(--heading-color);
}

/* The whole card is clickable through the title link */
.work-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.work-card__desc {
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.work-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    margin: auto 0 0;
    padding: 0;
}

.work-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.9rem;
    margin: 0;
}

.work-card__links a {
    position: relative; /* sits above the card-wide link */
    z-index: 1;
    text-decoration: underline;
}

/* ---------- Works: fractals ---------- */
.fractal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.fractal {
    margin: 0;
}

.fractal__frame {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.fractal canvas {
    display: block;
    border: 1px solid var(--border-color);
}

.fractal__loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    background: var(--card-bg-color);
    opacity: 0.92;
}

.spinner {
    width: 30px;
    height: 30px;
    margin: 0 auto 10px;
    border: 4px solid #f3f3f3;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.btn-render {
    display: block;
    margin-top: 0.5rem;
    padding: 8px 16px;
    font-size: 14px;
    color: #fff;
    background: #3498db;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn-render:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-render:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* ---------- Blog ---------- */
.medium-profile img {
    vertical-align: text-bottom;
}

/* ---------- Space ---------- */
.planet-navigator {
    margin: 20px 0;
}

.planet-navigator:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 6px;
}

.planet-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.planet-card[hidden] {
    display: none;
}

.planet-card.is-fading {
    opacity: 0;
}

/* ---------- About and 404 ---------- */
.about-mascot {
    max-width: 150px;
    height: auto;
}

.lost-planet {
    max-width: 300px;
    border-radius: 50%;
}

.contact-item a {
    display: inline-block;
    padding: 0.25rem 0;
}

/* ---------- Easter eggs ---------- */
/* Konami Code Easter Egg Animation */
.barrel-roll {
    -webkit-animation: barrelRoll 2s ease 1 normal;
    animation: barrelRoll 2s ease 1 normal;
}

@-webkit-keyframes barrelRoll {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

@keyframes barrelRoll {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/*
   HALO EASTER EGG ANIMATIONS
   Inspired by: Halo 3 (Grunt Birthday), Reach (Armor Lock), Halo 2 (Super Bounce), Halo 1 (Shields)
*/

/* STAGE 1: GRUNT BIRTHDAY PARTY */
.halo-grunt-yay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    font-size: 4rem;
    font-weight: bold;
    color: #32CD32; /* Lime green */
    text-shadow: 2px 2px 0 #000;
    pointer-events: none;
    z-index: 2000; /* Easter Eggs stay above normal UI (Bootstrap modals ~1050) */
    animation: gruntPop 1s ease-out forwards;
}

@keyframes gruntPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -150%) scale(1); opacity: 0; }
}

.halo-confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    z-index: 1999;
    pointer-events: none;
    animation: confettiExplosion 1.5s ease-out forwards;
}

@keyframes confettiExplosion {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) rotate(720deg); opacity: 0; }
}

/* STAGE 2: ARMOR LOCK (Reach) */
.halo-armor-lock {
    /* Freeze frame visual */
    filter: contrast(1.2) brightness(1.1) drop-shadow(0 0 10px #00ffff);
    /* "Locked" state */
    overflow: hidden;
    /* pointer-events: none; - Removed to allow interaction per review */
    animation: armorLockShake 0.1s infinite;
}

/* Overlay for tint to avoid using !important on body background */
.halo-armor-lock::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(224, 255, 255, 0.8); /* Cyan tint */
    box-shadow: inset 0 0 100px #00ffff;
    z-index: 2005;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.sandtrap-shake {
    animation: armorLockShake 0.1s ease-in-out;
    animation-iteration-count: 5; /* 0.5s duration approx */
}

@keyframes armorLockShake {
    0% { transform: translate(1px, 1px) scale(0.995); }
    50% { transform: translate(-1px, -1px) scale(0.995); }
    100% { transform: translate(1px, -1px) scale(0.995); }
}

/* STAGE 3: SUPER BOUNCE (Halo 2 Glitches) */
.halo-super-bounce {
    /* Simulating active camo + glitched physics */
    animation: superBounce 1.5s ease-in-out;
    filter: blur(2px) opacity(0.8); /* Reduced blur for accessibility */
}

@keyframes superBounce {
    0% { transform: translateY(0); }
    40% { transform: translateY(-30vh) scale(0.9); }
    100% { transform: translateY(0) scale(1); }
}

/* STAGE 4: SHIELD RECHARGE (Halo 1) */
.halo-shield-recharge::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2001;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 215, 0, 0.4) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shieldWipe 1.5s ease-out forwards;
    pointer-events: none;
}

@keyframes shieldWipe {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* SANDTRAP EASTER EGG */
#sandtrap-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2002;
}

.davinci-egg-canvas {
    position: absolute;
    top: 50px;
    width: 80px;
    height: 80px;
    opacity: 0;
    filter: drop-shadow(0 0 10px rgba(100, 100, 255, 0.4));
    animation: eggAppear 1s ease-out forwards;
}

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

.guardian-beam {
    position: absolute;
    top: 50%; /* Center of canvas */
    left: 50%;
    width: 6px; /* Slightly wider beam */
    height: 0;
    background: linear-gradient(to bottom, rgba(255, 69, 0, 0.8), rgba(255, 69, 0, 0.4), transparent);
    transform: translateX(-50%);
    box-shadow: 0 0 25px 8px rgba(255, 69, 0, 0.6); /* Softer, wider glow */
    mix-blend-mode: screen; /* Blend with background for more sci-fi look */
    animation: fireBeam 0.2s linear forwards;
}

@keyframes fireBeam {
    to { height: 150vh; } /* Shoot off screen */
}

.halo-kill-feed {
    position: fixed;
    bottom: 40px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    font-size: 14px;
    z-index: 2003;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid #ff4500;
    animation: feedSlideIn 0.3s ease-out;
}

@keyframes feedSlideIn {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.kill-guardian {
    color: #ffcc00; /* Gold for Guardians */
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .barrel-roll,
    .halo-grunt-yay,
    .halo-confetti,
    .halo-armor-lock,
    .halo-super-bounce,
    .halo-shield-recharge::after,
    .davinci-egg-canvas,
    .guardian-beam,
    .halo-kill-feed,
    .sandtrap-shake {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }

    .halo-armor-lock::after {
        opacity: 0.5; /* Just show static tint */
    }

    /* Fallback visual cues */
    .halo-grunt-yay {
        opacity: 1;
        display: block;
    }
}
