/*
  Theme: Dark Occultic Gothy Cyberpunk
  Inspired by: Serial Experiments Lain, NGE, Ghost in the Shell, Nous Hermes 4
  Author: Gemini
*/

/* 1. SETUP & VARIABLES */
/* =================================== */

:root {
  /* Color Palette */
  --color-bg: #020202; /* Pure Black */
  --color-text: rgb(230, 241, 248); /* Off-white for readability */
  --color-accent: #A0C4FF; /* Muted, glowing blue */
  --color-accent-dark: #3a5e8c;
  --color-interactive-bg: #222222;
  --color-border: #333333;

  /* Typography */
  --font-heading: "univers", sans-serif;
  --font-body: "helvetica", "verdana", sans-serif;

  /* Layout */
  --max-width: 80ch; /* Max-width for readability */
  /* --border-radius: 2px; /* Sharp edges */ /* Removed */
  --transition-speed: 0.3s;
}

/* 2. BASE & RESET */
/* =================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 100%; /* 16px default */
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 19.6px;
  position: relative;
  overflow-x: hidden;
  text-align: justify;
  word-wrap: break-word;
  hyphens: auto;
}

/* Subtle scanline effect */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px
  );
  background-size: 100% 3px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
}

/* 3. TYPOGRAPHY */
/* =================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  margin: 2.5rem 0 1.5rem 0;
  line-height: 1.2;
  text-align: center; /* Changed to center */
}

h1 {
  font-size: 3rem;
  color: var(--color-text);
  text-shadow: 0 0 5px var(--color-accent-dark), 0 0 10px var(--color-accent-dark);
  text-align: center;
  transition: color var(--transition-speed);
  letter-spacing: -0.05em;
  transform: scaleX(1.2);
  transform-origin: center;
}

h2 {
  font-size: 2rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.5rem;
  color: var(--color-text);
}

p {
  margin-bottom: 1.5rem;
}

/* 4. LAYOUT & COMPONENTS */
/* =================================== */

header, main, footer {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

header {
  padding-top: 4rem;
  padding-bottom: 2rem;
  text-align: center;
}

nav {
  padding: 1rem 1.5rem;
  border: 1px solid var(--color-border); /* Changed border-bottom to full border */
  margin-bottom: 2rem;
  background-color: rgba(0, 0, 0, 0.2); /* Very subtle dark background */
}

nav ul {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping */
  justify-content: center; /* Center horizontally */
  align-items: center; /* Center vertically if wrapped */
  list-style: none;
  gap: 2rem; /* Spacing between items */
}

nav a {
  font-family: var(--font-heading);
  font-weight: 900;
  text-transform: uppercase;
  display: inline-block;
  color: var(--color-bg);
  background-color: var(--color-text);
  padding: 0.5rem 1rem;
  margin: 0.5rem; /* Uniform margin for horizontal layout */
  transform: scale(1); /* Start with 1, scale on hover if desired */
  transition: all var(--transition-speed) ease-in-out;
  text-decoration: none; /* Remove underline */
}

nav a:hover {
  color: var(--color-text);
  background-color: var(--color-bg);
  transform: scale(1.05); /* Slightly scale up on hover */
}

main {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

hr {
  border: 0;
  height: 1px;
  background-color: var(--color-border);
  margin: 3rem 0;
}

/* Links & Buttons */
a {
  color: var(--color-text);
  text-decoration: underline;
  transition: color var(--transition-speed), text-shadow var(--transition-speed);
}

a:hover, a:focus {
  color: var(--color-accent);
  text-shadow: 0 0 8px var(--color-accent);
}


/* Blockquotes */
blockquote {
  border-left: 2px solid var(--color-accent);
  margin: 1.5rem 0;
  padding: 0.5rem 1.5rem;
  font-style: italic;
  color: #aaa;
}

/* Definition Lists */
dl {
  margin: 2rem 0;
}

dt:not(:empty) {
  color: var(--color-bg); /* Swapped */
}

dt:not(:empty):hover {
  color: var(--color-text);
}

dd {
  margin-bottom: 1rem;
  padding-left: 1rem;
  color: var(--color-text);
}

dt a {
  font-family: var(--font-heading); /* Moved from dt */
  font-weight: 900; /* Moved from dt */
  text-transform: uppercase; /* Moved from dt */
  display: block; /* Added */
  width: 100%; /* Added */
  text-decoration: none;
  color: inherit !important;
  background-color: var(--color-text);
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  transform: scale(1.3);
  transition: all var(--transition-speed) ease-in-out;
}

dt a:hover {
  color: inherit !important;
  text-decoration: none;
  background-color: var(--color-bg); /* Moved from dt:hover */
}



/* 5. RESPONSIVENESS & ACCESSIBILITY */
/* =================================== */

@media (max-width: 768px) {
  html {
    font-size: 93.75%; /* 15px */
  }

  h1 {
    font-size: 2.25rem;
    letter-spacing: 0.2em;
  }

  h2 {
    font-size: 1.75rem;
  }

  header, main, footer {
    padding: 0 1rem;
  }
  
  header {
    padding-top: 3rem;
  }

  nav ul {
    flex-direction: column; /* Stack vertically */
    align-items: center; /* Center horizontally when stacked */
    gap: 1rem; /* Adjust vertical gap */
  }

  nav a {
    margin: 0.5rem 0; /* Adjust margin for vertical layout */
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Focus Styles */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
ne-offset: 2px;
}
ine: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Search Page Specific Styles */
.search-container {
    display: flex;
    flex-direction: column; /* Changed back to column */
    margin: 0 auto 2rem auto;
    width: 100%;
    max-width: var(--max-width);
    background-color: rgba(0, 0, 0, 0.2); /* Added background */
    border: 1px solid var(--color-border); /* Added border */
    /* border-radius: var(--border-radius); /* Added border-radius */ /* Removed */
    padding: 1.5rem; /* Added padding */
}

.search-input-group {
    display: flex;
    flex-direction: row;
    width: 100%;
    margin-bottom: 1rem; /* To separate from results */
}

#searchInput {
    flex-grow: 1; /* Takes up available space */
    background-color: var(--color-interactive-bg);
    border: none; /* Removed border */
    color: var(--color-text);
    font-size: 1rem;
    font-family: var(--font-body);
    /* Removed border-radius properties */
    padding: 0.8rem 1rem; /* Keep padding for input text */
}

#searchInput:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 5px var(--color-accent);
}

#searchButton {
    display: inline-block;
    color: var(--color-bg);
    background-color: var(--color-text);
    padding: 0.5rem 1rem; /* Keep padding for button text */
    transform: scale(1);
    transition: all var(--transition-speed) ease-in-out;
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    border: none; /* Removed border */
    /* Removed border-radius properties */
}

#searchButton:hover {
    color: var(--color-text);
    background-color: var(--color-bg);
    transform: scale(1.05);
}

#searchResults {
    /* Removed background-color, border, padding, border-radius */
    width: 100%; /* Ensure it takes full width within container */
}

#searchResults ul {
    list-style: none;
    padding: 0;
}

#searchResults li {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed var(--color-border);
}

#searchResults li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#searchResults li a {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-accent);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

#searchResults li a:hover {
    text-decoration: underline;
    color: var(--color-text);
}

#searchResults li p {
    font-size: 0.9rem;
    color: var(--color-text);
    line-height: 1.4;
}

#searchResults li p mark {
    background-color: rgba(160, 196, 255, 0.3); /* Lighter accent for highlight */
    color: inherit;
    padding: 0 2px;
    /* Removed border-radius: 2px; */
}
