html {
  /*display: table;*/
  margin: auto;
}


body {
  position:relative;
  min-height:100vh;
  padding-bottom: 100px;
  line-height: 1.8;
  max-width: 80ch;
  min-height: 100vh;
  overflow-x: hidden;
  margin: 0 auto;
  padding: 2rem 1.25rem;

  counter-reset: theorem;
  counter-reset: definition;
  counter-reset: sidenote-counter;

  text-rendering: optimizeLegibility;

  color: #222;
  font-family: 'Libertinus';
  line-height: 1.5;
  /*font-family: 'Libertinus', Georgia, serif;*/
  max-width: 800px;
  margin: auto;
}

/*
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 80vh;
}
*/

header {
  margin-bottom: 1rem;
}

main {
  margin-top: 40px;
  flex: 1;
}

/*
main, footer {
  margin-left: 20px;
}
*/

h1 {
  display: none;
}

h2 {
  color: black;
  font-weight: normal;
  font-size: 20px;
}

#section h2 {
  margin-top: 40px;
}

h3 {
  color: black;
  font-size: 16px;
  padding-top: 5px;
}

h4 {
  color: gray;
  font-size: 12px;
  font-weight: normal;
  text-align: right;
}

nav {
  color: white;
  font-size: 0.9rem;
  text-align: right;
  font-weight: bold;
  color: white;
  margin-bottom: 80px;
}

ul {
  list-style-type: none;
}

#underground {
  margin-top: 10px;
  display: inline-block;
  color: rgba(100, 100, 100, 0.1);
  text-shadow: 0 0 1px rgba(150, 150, 150, 0.2);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  display: inline-block;
  transition: all 0.3s ease;
}

#underground:hover {
  color: rgba(80, 80, 80, 0.9);
  text-shadow: 
    0 0 5px rgba(150, 150, 150, 0.6),
    0 0 10px rgba(150, 150, 150, 0.4),
    0 0 15px rgba(150, 150, 150, 0.2);
}


p {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  margin-top: 1rem;
}

/*
.quote p {
  text-indent: 2em;
  margin: 0;
}


.quote p:first-of-type {
  text-indent: 0;
}
*/

.quote a {
  text-decoration: none;
}

.quote p {
  line-height: 10px;
}

a {
  color: #575757;
  text-decoration: none;
}

a:visited {
  color: #7f7f7f;
  text-decoration: none;
}

a:hover {
  color: black;
  text-decoration: none;
}

a:active {
  text-decoration: underline;
}

li {
  color: grey;
}

#section img, #page img {
  height: auto;
  display: block;
  max-width: 80%;
  margin-bottom: 50px;
}

@media (max-width: 600px) {
  img {
    display: block;       /* prevents inline spacing issues */
    max-width: 100%;      /* never exceed container width */
    width: 100%;          /* shrink to fit container */
    height: auto;         /* maintain aspect ratio */
    box-sizing: border-box; /* includes padding in width */
  }

  #section, #page, body {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden; /* prevents horizontal scroll */
  }
}

video {
  height: auto;
  display: block;
  max-width: 98%;
  margin-bottom: 50px;
}

blockquote {
  margin: 1.5em 2em;
  padding-left: 1em;
  border-left: 4px solid #555;
  color: #444;
  font-style: italic;
  background-color: transparent;
  font-family: serif;
  line-height: 1.4;
  font-size: 15px;
}

footer {
    margin-top: 70px;
    font-size: 15px;
    font-size: 25px;
}

@media (prefers-color-scheme: dark) {
  html {
    background-color: #181a1b;
  }
  body {
    background-color: #181a1b;
    color: #e0e0e0;
  }
  a,
  a:visited {
    color: #7f7f7f;
  }
  a:hover {
    color: #b5b5b5;
  }
  .verse a:visited {
    color: #7f7f7f;
    text-decoration: none;
  }
  h1:first-child {
    text-align: right;
    color: #7f7f7f;
  }
  h2 {
    color: white;
  }
  h3 {
    color: #e0e0e0;
  }
  blockquote {
      color: #bbb;
}
}

/* -------------------------------------------------
   Page background – dark terminal vibe
   ------------------------------------------------- */
body {
  background:#0a0a0a;
  color:#00ff00;
  font-family:
    "Courier New",
    "Consolas",
    "Lucida Console",
    "Monaco",
    "Ubuntu Mono",
    "Source Code Pro",
    monospace;
}

/* -------------------------------------------------
   Container – muted gray / metal frame
   ------------------------------------------------- */
.effect-box {
  display:inline-block;
  position:relative;
  padding:4px;
  background:#111;
  border:2px solid #555;               /* muted gray */
  box-shadow:
      0 0 8px #777,
      inset 0 0 4px #777;
}

/* -------------------------------------------------
   Image – dimmed by default, brightens on hover
   ------------------------------------------------- */
.effect-box img {
  display:block;
  max-width:100%;
  height:auto;
  filter:brightness(0.85) contrast(1.1);   /* dimmed when idle */
  transition:filter .2s ease, transform .2s ease;
}

/* Hover – brighter (optional) */
.effect-box:hover img {
  filter:brightness(1.2) contrast(1.2);
}

/* -------------------------------------------------
   TV‑static animation – plays when NOT hovered
   ------------------------------------------------- */
.effect-box img {
  animation:tvStatic 0.6s steps(10) infinite;   /* idle animation */
}
.effect-box:hover img {
  animation:none;                               /* stop on hover */
}

/* -------------------------------------------------
   Old‑TV “static” keyframes (unchanged)
   ------------------------------------------------- */
@keyframes tvStatic {
  0%   { opacity:1; transform: translateY(0px)   scaleY(1); }
  10%  { opacity:0.9; transform: translateY(-1px) scaleY(0.98); }
  20%  { opacity:0.85; transform: translateY(1px)  scaleY(1.02); }
  30%  { opacity:0.9; transform: translateY(-2px) scaleY(0.97); }
  40%  { opacity:0.8; transform: translateY(2px)  scaleY(1.03); }
  50%  { opacity:0.85; transform: translateY(0px)   scaleY(1); }
  60%  { opacity:0.9; transform: translateY(-1px) scaleY(0.99); }
  70%  { opacity:0.88; transform: translateY(1px)  scaleY(1.01); }
  80%  { opacity:0.92; transform: translateY(-1px) scaleY(0.98); }
  90%  { opacity:0.86; transform: translateY(2px)  scaleY(1.02); }
  100% { opacity:1; transform: translateY(0px)   scaleY(1); }
}

/* -------------------------------------------------
   Overlay text – **visible only on hover**
   ------------------------------------------------- */
.overlay {
  position:absolute;
  top:10%; left:50%;
  transform:translate(-50%,-50%);
  color:#bfbfbf;                     /* green‑gray */
  font-size:1.4rem;
  font-weight:bold;
  line-height:1.2;
  font-family:
    "Courier New",
    "Consolas",
    "Lucida Console",
    "Monaco",
    "Ubuntu Mono",
    "Source Code Pro",
    monospace;
  text-shadow:
    0 0 4px rgba(0,255,0,0.7),
    0 0 8px rgba(0,255,0,0.5);
  background:rgba(0,0,0,0.6);
  padding:0.4rem 0.8rem;
  border-radius:4px;
  opacity:0;                         /* hidden when idle */
  transition:opacity .2s ease;
  pointer-events:none;
}

/* Show overlay **only** when hovering the container */
.effect-box:hover .overlay {
  opacity:1;
}

/* -------------------------------------------------
   Optional scan‑line overlay (keeps retro vibe)
   ------------------------------------------------- */
.effect-box::after {
  content:"";
  position:absolute;
  top:0; left:0; right:0; bottom:0;
  pointer-events:none;
  background:linear-gradient(rgba(0,255,0,.02) 50%,transparent 50%);
  background-size:100% 4px;
}
