:root {
    --color-primary: #08b6b9;
    --color-secondary: #2e4456;
    --color-accent: #5eead4;
    --color-text-light: #e5f6f7;
    --color-text-light-muted: #b5dbe3;
    --color-bg-dark: #000000;
    --color-bg-deep-midnight: #00001a; /* Deep midnight blue for breathing effect */

    /* Node variables */
    --node-bg: rgba(46, 68, 86, 0.2);
    --node-border: var(--color-primary);
    --node-shadow-color: var(--color-accent);
    --node-hover-bg: rgba(94, 234, 212, 0.15);

    /* Spark Color */
    --spark-color: #00bfff; /* Deep Sky Blue / Bright Electric Blue */
}

@keyframes breathingBackground {
    0% {
        background-color: var(--color-bg-dark);
    }
    50% {
        background-color: var(--color-bg-deep-midnight);
    }
    100% {
        background-color: var(--color-bg-dark);
    }
}

body {
    position: relative;
    background-color: var(--color-bg-dark); /* Fallback and initial color */
    overflow-x: hidden; /* Prevent horizontal scroll from far-flying sparks */
    animation: breathingBackground 20s infinite ease-in-out; /* Added breathing animation */
    font-family: 'Roboto', Arial, Helvetica, sans-serif; /* Ensuring base font */
    color: var(--color-text-light); /* Ensuring base text color */
    margin: 0; /* Resetting default margin */
    padding: 0; /* Resetting default padding */
}

.background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.site-container {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box; /* Added for consistency */
}
@media (max-width: 600px) {
  .site-container {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Paragraph styling */
.narrow-paragraph {
  width: 80%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: 1.5em;
}
@media (max-width: 600px) {
  .narrow-paragraph {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Heading styling for the fun page title */
h1.fun-page-title { /* Targeting the specific class used in HTML */
  font-family: 'Roboto', Arial, Helvetica, sans-serif !important; /* Retaining important if needed for overrides */
  font-weight: 700 !important;
  text-align: center !important;
  background: linear-gradient(90deg,#00fff7 0%,#5efcf1 18%,#4eead4 36%,#24e0e0 60%,#06b6d4 85%,#178ca4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* color: transparent; Redundant with -webkit-text-fill-color */
  margin: 2em 0 1em 0; /* Default h1 margin from original CSS */
  line-height: 1.3; /* Default h1 line-height from original CSS */
  font-size: 3rem; /* Default h1 font-size from original CSS */
}

.navigation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(20px, 3vw, 40px);
    width: 100%; /* Takes width of its container (.site-container) */
    max-width: 1000px; /* Or adjust as per your design */
    margin: 40px auto; /* Centering and spacing */
    padding: 20px 0; /* Padding top/bottom */
}

.link-node {
    position: relative;
    padding: 30px 25px;
    background: var(--node-bg);
    border: 1px solid var(--node-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--color-text-light);
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    font-weight: 400;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 0 10px rgba(var(--node-shadow-color), 0.3),
                0 0 20px rgba(var(--node-shadow-color), 0.2);
    transform-style: preserve-3d;
    text-align: center;
}

.link-node::before, .link-node::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.4s ease-out;
    z-index: 1;
}
.link-node::before { top: 5px; left: 50%; transform: translateX(-50%); }
.link-node::after { bottom: 5px; right: 50%; transform: translateX(50%); }

.link-node .node-inner-border-top, .link-node .node-inner-border-bottom {
    display: block;
    position: absolute;
    height: 1px;
    width: 60%;
    background: rgba(var(--color-accent), 0.2);
    left: 50%;
    transform: translateX(-50%);
}
.link-node .node-inner-border-top { top: 12px; }
.link-node .node-inner-border-bottom { bottom: 12px; }

.link-node:hover {
    background: var(--node-hover-bg);
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 0 20px var(--node-shadow-color),
                0 0 35px var(--node-shadow-color),
                0 5px 15px rgba(0,0,0,0.3);
    border-color: var(--color-accent);
}

.link-node:hover::before, .link-node:hover::after {
    width: 70%;
}

.link-node .node-title {
    font-family: 'Orbitron', 'Roboto', sans-serif;
    font-weight: 700;
    display: block;
    margin-bottom: 10px;
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: var(--color-accent);
    transition: color 0.3s ease;
    letter-spacing: 0.5px;
}

.link-node .node-description {
    font-size: clamp(0.8rem, 1.2vw, 0.9rem);
    color: var(--color-text-light-muted);
    line-height: 1.5;
}

.link-node:hover .node-title {
    color: #fff;
    text-shadow: 0 0 8px var(--color-accent);
}

/* Spark Styles - Updated for Sharp Lines */
.spark {
    position: fixed; /* Changed to fixed for positioning relative to viewport */
    width: 2px;
    height: 30px; /* Slightly longer sparks */
    background: var(--spark-color);
    pointer-events: none;
    opacity: 1;
    box-shadow: 0 0 5px var(--spark-color), 0 0 8px var(--spark-color);
    transform-origin: 50% 100%;
    z-index: 1000; /* Ensure sparks are on top of most other content */
}

@keyframes spark-line-animation {
    0% {
        transform: rotate(var(--spark-angle-deg)) translateY(0px) scaleY(1);
        opacity: 1;
    }
    100% {
        transform: rotate(var(--spark-angle-deg)) translateY(calc(var(--spark-distance-px) * -1)) scaleY(0);
        opacity: 0;
    }
}
