
  /* CUSTOM SELECTION HIGHLIGHT */
    ::selection {
      background: var(--red);
      color: var(--black);
      text-shadow: none;
    }
    
    /* INTERACTIVE CHAT BUBBLES */
    .bot-message { 
        cursor: copy; /* change cursor to show it's interactable */
        transition: all 0.2s;
    }
    .bot-message:hover {
        background: #1a0505; /* subtle glow on hover */
        border-color: var(--red);
    }
    .bot-message:active {
        background: var(--red);
        color: black;
    }

  :root { 
    --red: #ff0033; 
    --black: #050505; 
    --white: #ffffff;
    --grey: #1a1a1a;
    --text-main: #ffffff;
    --font-sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
  }

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

  body {
    background-color: var(--black);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow-x: hidden;
    width: 100vw;
  }

  /* --- 1. LEFT RAIL (System: Logo + AI) --- */
  .left-rail {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 280px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between Logo and AI */
  }

  /* Logo */
  .inkrealm-logo { width: 100%; mix-blend-mode: difference; }
  .inkrealm-logo path { fill: var(--text-main); transition: fill 0.3s; }
  .inkrealm-logo:hover path { fill: var(--red); }
  .ghost-trigger { fill: transparent; cursor: pointer; }

  /* Hermes AI (Under Logo) */
  #nous-interface {
    width: 100%;
    font-family: var(--font-mono);
  }

  #nous-toggle {
    width: 100%;
    background: rgba(0,0,0,0.8);
    color: var(--red);
    border: 1px solid var(--red);
    padding: 8px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 2px;
    text-align: left;
    backdrop-filter: blur(5px);
    transition: 0.2s;
  }
  #nous-toggle:hover { background: var(--red); color: black; box-shadow: 0 0 15px rgba(255,0,51,0.3); }

  #nous-panel {
    display: none;
    width: 100%;
    background: rgba(5, 5, 5, 0.95);
    border: 1px solid var(--red);
    border-top: none; /* Connects to button */
    padding: 15px;
    backdrop-filter: blur(10px);
  }

  #nous-output {
    height: 180px; background: #000; color: #ccc;
    border: 1px solid #333; padding: 10px; font-size: 10px;
    overflow-y: auto; white-space: pre-wrap; margin-bottom: 10px;
  }
  
  textarea.nous-input {
    width: 100%; height: 50px; background: #111; color: #fff;
    border: 1px solid #333; padding: 8px; font-size: 11px;
    font-family: var(--font-mono); resize: none; outline: none;
  }
  textarea.nous-input:focus { border-color: var(--red); }

  .nous-btn {
    width: 100%; padding: 8px; background: #000; color: #888;
    border: 1px solid #333; cursor: pointer; text-transform: uppercase;
    font-size: 10px; margin-top: 5px; font-weight: bold;
  }
  .nous-btn:hover { color: #fff; border-color: #fff; }


  /* --- 2. RIGHT RAIL (Navigation) --- */
  .right-rail {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
  }

 .menu-btn {
    background: rgba(0,0,0,0.8);
    border: 1px solid var(--red); /* The Red Border */
    color: var(--red); /* The Red Text */
    padding: 8px 12px;
    font-family: var(--font-mono); /* Switched to Courier to match Hermes */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.menu-btn:hover {
    background: var(--red);
    color: var(--black);
    box-shadow: 0 0 15px rgba(255,0,51,0.3); /* The Neon Glow */
}

/* --- 3. BACKGROUND --- */
.anchor-star {
  position: fixed; top: 50%; left: 60%;
  transform: translate(-50%, -50%); width: 80vh; opacity: 0.15;
  z-index: 0; pointer-events: none; will-change: transform;
}

/* --- FIXED KEYFRAMES --- */
@keyframes hologram-twitch {
    0% { 
        opacity: 0.15; 
        filter: none; 
    }
    /* --- ORIGINAL GLITCH (Blue/Inverted) --- */
    5% { 
        opacity: 0.5; 
        filter: hue-rotate(90deg) invert(1) blur(2px); 
    }
    10% { 
        opacity: 0.15; 
        filter: none; 
    }
    
    /* --- NEW RED FLASH (Briefly at the end of cycle) --- */
    90% {
        opacity: 0.15;
        filter: none;
    }
    92% { 
        opacity: 0.8; /* Spike opacity to make the red visible */
        /* This filter combo forces the SVG to Red */
        filter: sepia(1) saturate(20) hue-rotate(-50deg) contrast(1.2); 
    }
    95% { 
        opacity: 0.15; 
        filter: none; 
    }
    
    /* --- END CYCLE --- */
    100% { 
        opacity: 0.15; 
    }
}

/* The Class - Updated duration to 3s */
.glitch-active {
    animation: hologram-twitch 3s infinite;
}

  /* --- 4. CONTENT --- */
  main { position: relative; z-index: 2; width: 100%; }

  section {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Content pushed slightly right to clear the Left Rail */
    padding-left: 320px; 
    padding-right: 50px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  h1.headline {
    font-size: clamp(3rem, 6vw, 7rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
  }
  p.lead {
    font-size: 1.1rem; color: #888; line-height: 1.6;
    border-left: 2px solid var(--red); padding-left: 20px; max-width: 600px;
  }


  /* --- 5. FOOTER (Double Layer) --- */
  .footer-white {
    background: var(--white);
  padding: 40px 20px;
    text-align: center;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative; z-index: 2;
  }
  .footer-grey {
    background-color: var(--grey);
    color: #555;
    padding: 40px 20px;
    text-align: center;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative; z-index: 2;
  }
  .footer-grey a { color: #888; text-decoration: none; margin: 0 10px; }
  .footer-grey a:hover { color: #fff; }


  /* --- 6. MENU OVERLAY (The Cube Riot) --- */
  .menu-overlay {
    position: fixed; inset: 0; background: rgba(5,5,5,0.98);
    z-index: 2000; display: none;
    flex-direction: column; align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
  }
  .menu-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 60px; }
  
  /* 3D Prisms */
  .prism-wrapper { position: relative; }
  .prism-label { text-align:center; font-size:10px; color:var(--red); margin-bottom:15px; letter-spacing: 3px; }
  .prism-scene { width: 120px; height: 80px; perspective: 800px; }
  .prism {
    width: 100%; height: 100%; position: relative;
    transform-style: preserve-3d;
    transform: translateZ(-35px);
    animation: spinPrism 8s infinite linear;
  }
  .prism:hover { animation-play-state: paused; }
  
  .face {
    position: absolute; width: 120px; height: 80px;
    border: 1px solid var(--red); background: rgba(0,0,0,0.9);
    color: white; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: bold; text-transform: uppercase; cursor: pointer;
    box-shadow: 0 0 10px rgba(255,0,51,0.2);
  }
  /* 3-Sided Logic */
  .face-1 { transform: rotateY(0deg) translateZ(35px); }
  .face-2 { transform: rotateY(120deg) translateZ(35px); }
  .face-3 { transform: rotateY(240deg) translateZ(35px); }
  @keyframes spinPrism { 0% { transform: rotateY(0deg); } 100% { transform: rotateY(360deg); } }


  /* --- MOBILE ADAPTATION --- */
  @media(max-width: 768px) {
    .left-rail { width: 200px; top: 10px; left: 10px; }
    .right-rail { top: 10px; right: 10px; }
    .anchor-star { left: 50%; width: 90vw; opacity: 0.1; }
    section { padding: 80px 20px; text-align: left; justify-content: flex-start; }
    /* Push content down so it doesn't hide behind logo/menu */
    main { margin-top: 150px; } 
    .menu-grid { gap: 40px; }
  }

	#log-ticker {
  height: 45px;          /* Fixed height for 1-2 lines of logs */
  padding: 5px 20px;     /* Internal spacing */
  border-top: 1px solid #1a1a1a;
  background: #080808;
  font-size: 10px;       /* Smaller for ticker vibe */
  color: #444;
  overflow: hidden;      /* Keeps it strictly to its height */
}

	/* --- 1. THE RED SCROLLBAR --- */
::-webkit-scrollbar {
    width: 16px; /* Thin and slick */
}
::-webkit-scrollbar-track {
    background: var(--black); 
}
::-webkit-scrollbar-thumb {
    background: var(--red); 
    border-radius: 0; /* Keep it square/sharp for the tech feel */
}
::-webkit-scrollbar-thumb:hover {
    background: #ff3355; /* Slight glow on hover */
}
	/* --- ARTIFACT TERMINAL MODULE --- */

/* Import VT323 for the screen if not already imported */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

.artifact-section {
    /* Uses your global section rules but ensures content centers */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start; /* Aligns with your Left Rail logic */
}

.artifact-terminal {
    width: 100%;
    max-width: 800px; /* Prevents infinite stretching on wide screens */
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--grey);
    backdrop-filter: blur(5px);
    margin-top: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* 1. Header */
.terminal-header {
    background: var(--grey);
    color: var(--white);
    padding: 8px 15px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid #000;
}
.blink { animation: blinker 1s linear infinite; color: var(--red); }
@keyframes blinker { 50% { opacity: 0; } }

/* 2. The Screen */
.terminal-screen {
    height: 350px; /* Fixed height for consistency */
    background: #000;
    color: var(--red); /* The "Virtual Boy" look */
    padding: 20px;
    overflow-y: auto;
    font-family: 'VT323', monospace; 
    font-size: 14px; /* Slightly larger for readability */
    line-height: 1;
    white-space: pre; 
    letter-spacing: 0px;
    border-bottom: 1px solid var(--grey);
    
    /* Scrollbar specific to this element */
    scrollbar-width: thin;
    scrollbar-color: var(--red) #000;
}
	
/* 3. Controls Area */
.terminal-controls {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Inputs */
.input-group {
    display: flex;
    gap: 10px;
}

.tech-input {
    flex: 1; /* Takes remaining space */
    background: #050505;
    border: 1px solid #333;
    color: var(--white);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    outline: none;
    transition: 0.3s;
}
.tech-input:focus { border-color: var(--red); box-shadow: 0 0 10px rgba(255, 0, 51, 0.1); }

.select-wrapper { position: relative; width: 150px; }
.tech-select {
    width: 100%;
    height: 100%;
    background: #050505;
    border: 1px solid #333;
    color: #888;
    padding: 0 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    appearance: none; /* Hides default arrow */
    cursor: pointer;
    outline: none;
}
.tech-select:focus { border-color: var(--red); color: var(--white); }

/* Buttons */
.btn-group {
    display: flex;
    gap: 10px;
}

.tech-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 1px solid #333;
    color: #888;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tech-btn:hover {
    border-color: var(--red);
    color: var(--white);
    box-shadow: 0 0 8px rgba(255, 0, 51, 0.2);
}

.tech-btn.btn-primary {
    border-color: var(--white);
    color: var(--white);
}
.tech-btn.btn-primary:hover {
    background: var(--red);
    border-color: var(--red);
    color: #000;
}
	.witch-symbol {
  animation: witch-glow 3s ease-in-out infinite;
}

@keyframes witch-glow {
  0%, 100% {
    opacity: 0.6;
    filter: drop-shadow(0 0 2px var(--red));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 8px var(--red));
  }
}

/* Mobile Tweak */
@media(max-width: 600px) {
    .input-group { flex-direction: column; }
    .select-wrapper { width: 100%; height: 40px; }
    .terminal-screen { font-size: 10px; } /* Shrink ASCII on phones */
}

	.tts-trigger {
    transition: all 0.3s ease;
    user-select: none;
    font-family: 'Verdana', sans-serif; /* Or your preferred terminal font */
    color: #888;
}

.tts-trigger:hover {
    color: #fff !important;
    border-color: #fff !important;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

      /* ORB CONTAINER */
.orb-container {
    display: inline-block;
    vertical-align: middle;
    margin-right: 15px; /* Spacing between orb and title */
    width: 50px;
    height: 50px;
    position: relative;
}

/* THE SVG SHAPE */
.glitch-orb {
    width: 100%;
    height: 100%;
    fill: none;
    stroke-width: 3;
    overflow: visible;
}

/* PARTS COLORS */
.orb-circle { stroke: #ff0033; } /* Red Circle */
.orb-triangle { stroke: #ffffff; } /* White Triangle */

/* IDLE ANIMATION (Slow breathe/rotate) */
.orb-container svg {
    animation: slow-spin 10s linear infinite;
    filter: drop-shadow(0 0 5px rgba(255, 0, 51, 0.4));
    transition: all 0.2s ease;
}

/* HOVER STATE (The Glitch) */
.orb-container:hover svg {
    animation: glitch-shake 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    filter: drop-shadow(2px 2px 0px rgba(255, 255, 255, 0.5)) 
            drop-shadow(-2px -2px 0px rgba(255, 0, 51, 0.8));
}

.orb-container:hover .orb-triangle {
    fill: rgba(255, 255, 255, 0.1);
}

/* KEYFRAMES */
@keyframes slow-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes glitch-shake {
    0% { transform: translate(0) rotate(0deg); }
    20% { transform: translate(-2px, 2px) rotate(-5deg); }
    40% { transform: translate(-2px, -2px) rotate(5deg); }
    60% { transform: translate(2px, 2px) rotate(-5deg); }
    80% { transform: translate(2px, -2px) rotate(5deg); }
    100% { transform: translate(0) rotate(0deg); }
}
/* ======================================================
   UNIVERSAL CUSTOM DROPDOWN (RED THEME)
   ====================================================== */

.custom-select-container {
    position: relative;
    width: 100%;
    margin-bottom: 0.8rem;
}

/* Hide the original select but keep it functional */
.custom-select-container select {
    display: none;
}

/* The custom display button */
.select-selected {
    background-color: #0a0a0a;
    border: 1px solid #333;
    color: #ff0033;
    padding: 10px 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.3s;
    letter-spacing: 1px;
}

/* Arrow */
.select-selected:after {
    position: absolute;
    content: "▼";
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: #ff0033;
}

/* Active/Open state */
.select-selected.select-arrow-active:after {
    content: "▲";
}

.select-selected:hover {
    border-color: #ff0033;
    box-shadow: 0 0 10px rgba(255, 0, 51, 0.2);
}

/* Options container */
.select-items {
    position: absolute;
    background-color: #000;
    border: 1px solid #333;
    border-top: none;
    z-index: 9999;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

/* Individual options */
.select-items div {
    color: #aaa;
    padding: 10px 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid #222;
    transition: all 0.2s;
}

/* Hover state (RED) */
.select-items div:hover {
    background-color: #ff0033;
    color: #000;
}

/* Currently selected item */
.select-items div.same-as-selected {
    background-color: #ff0033;
    color: #000;
}

/* Hide the options by default */
.select-hide {
    display: none;
}

	/* --- VHS RED JUMP/BOUNCE EFFECT --- */
/* --- 1. THE RED FLASH (Global Tint) --- */
/* Keeps the screen flash, but slightly more subtle to let lines pop */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #ff0000;
  mix-blend-mode: hard-light; 
  opacity: 0;
  z-index: 9998;
  pointer-events: none;
  animation: vhs-red-bloom 8s infinite linear;
}

/* --- 2. THE BROKEN TRACKING LINES (The "Bounce") --- */
body::after {
  content: "";
  position: fixed;
  left: 0;
  width: 100%;
  height: 5vh; /* Much thinner container */
  
  /* 
     We paint 3 distinct lines using multiple background gradients.
     Format: linear-gradient(...) Position / Size No-Repeat 
  */
  background: 
    /* A. Main Center Line: White-hot, spans 80% of width, 2px thick */
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.95) 40%, rgba(255, 255, 255, 0.95) 60%, transparent 100%) 
    center center / 80% 2px no-repeat,
    
    /* B. Top Adornment: Sharp Red, Left side, Short (200px), 1px thick */
    linear-gradient(90deg, transparent, #ff0000, transparent) 
    20% 10% / 200px 1px no-repeat,
    
    /* C. Bottom Adornment: Faint Red, Right side, Medium (350px), 1px thick */
    linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.6), transparent) 
    70% 90% / 350px 1px no-repeat;

  top: -10vh; /* Start off screen */
  z-index: 9999;
  pointer-events: none;
  mix-blend-mode: screen; /* Makes the lines glow */
  opacity: 0;
  
  /* 8s loop, same as the flash */
  animation: vhs-tracking-bounce 8s infinite linear;
}

/* --- KEYFRAMES --- */

@keyframes vhs-red-bloom {
  0%, 90% { opacity: 0; }
  91% { opacity: 0.4; } /* Quick red flash */
  93% { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes vhs-tracking-bounce {
  0%, 90% { 
    top: -10vh;
    opacity: 0;
  }
  91% { 
    opacity: 1;
  }
  /* The lines slide rapidly down */
  96% { 
    top: 110vh; 
    opacity: 1;
  }
  100% { 
    top: 110vh;
    opacity: 0;
  }
}
		  /* ----------  CRT overlay  ---------- */
        #crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  /* Inner shadow creates the curved screen vignette look */
  box-shadow: inset 0 0 100px rgba(0,0,0,0.9);
}

.scanline {
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 50%, rgba(0,0,0,0.5) 50%);
  background-size: 100% 4px;
  /* Combines the rolling movement with a flicker */
  animation: scanline 10s linear infinite, flicker 0.15s infinite;
}

/* Moves the lines */
@keyframes scanline {
  0% { background-position: 0 0; }
  100% { background-position: 0 100%; }
}

/* Creates the electrical flicker */
@keyframes flicker {
  0% { opacity: 0.3; }
  50% { opacity: 0.4; }
  100% { opacity: 0.3; }
}
#ton-qr {
  width: 108px;
  border: 1px solid var(--white);
  padding: 2px;
  background: #000;
  cursor: zoom-in;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 10001;
}

#ton-qr:hover,
#to-qr:active {
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
  border-color: var(--red);
}

#ton-qr.expanded {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(3.5);
  z-index: 999999;
  border-color: var(--white);
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.9), 0 0 50px rgba(255, 255, 255, 0.8);
  cursor: zoom-out;
}

#toq-qr {
  width: 188px;
  border: 1px solid var(--white);
  padding: 2px;
  background: #000;
  cursor: zoom-in;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 10001;
}

#toq-qr:hover,
#toq-qr:active {  /* ← Fixed: changed #to-qr to #toq-qr */
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
  border-color: var(--red);
}

#toq-qr.expanded {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(3.5);
  z-index: 999999;
  border-color: var(--white);
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.9), 0 0 50px rgba(255, 255, 255, 0.8);
  cursor: zoom-out;
}

		#power-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: redWhiteAlternate 1s infinite;
}

@keyframes redWhiteAlternate {
  0%, 50% { 
    background-color: #ef4444;
    box-shadow: 0 0 10px #ef4444;
  }
  51%, 100% { 
    background-color: white;
    box-shadow: 0 0 10px white;
  }
}
