/* =========================================
   1. VARIABLES (:ROOT)
   ========================================= */
:root {
  /* Colors - Monochrome & Base */
  --brightwhite: rgb(255, 255, 255);
  --white: rgba(255, 255, 255, 0.85);
  --black: rgba(0, 0, 0, 0.85);
  --reading: rgb(200, 200, 235);
  --txtblock: rgba(40, 43, 99, 0.45);
  
  /* Colors - Accents & Gradients */
  --gradient-color1: rgba(138, 81, 245, 0.5); /* Purple */
  --gradient-color2: rgba(86, 195, 234, 0.5); /* Blue/Teal */
  --gradient-color3: rgba(138, 81, 245, 0.8); /* Stronger Purple */
  --gradient-color4: rgba(86, 195, 234, 0.8); /* Stronger Teal */
  
  /* Backgrounds */
  --nav-bg: rgba(43, 23, 89, 0.1);
  --hover-bg: rgba(138, 81, 245, 0.1);
  --icon-bg: rgba(20, 20, 20, 0.8);
  --coolstuff-hover-bg: rgba(0, 0, 0, 0.2);
  --link-bg: rgba(86, 195, 234, 0.3);
  --whoami-bg: rgba(138, 81, 245, 0.2);
  --footer-bg: rgba(0, 0, 0, 0.5);
  --contraster: rgba(255, 255, 255, 0.15);

  /* Shadows */
  --shadow-color: black;
  --shadow-grey: grey;
  --shadow-lightgrey: rgba(43, 23, 89, 0.5);
  --shadow-darkgrey: rgba(83, 43, 169, 0.8);

  /* Settings */
  --transition: 0.5s;
}

/* =========================================
   2. RESET & BASE STYLES
   ========================================= */
* {
  margin: 0;
  padding: 0;
  font-size: 1.1rem;
  font-display: swap;
  letter-spacing: 0.1rem;
  line-height: 1.5em;
  box-sizing: border-box;
}

html, body {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 75%, rgba(0,0,0,1) 100%), url("../img/blurbg.jpg");
  background-attachment: scroll;
  scroll-behavior: smooth;
  font-family: "Saira Condensed", sans-serif;
  font-weight: 400;
  font-style: normal;
  overflow-x: hidden;
  color: var(--reading);
}

a {
  text-decoration: none;
  border-radius: 50px;
  color: var(--white);
  transition: var(--transition);
}

a:hover {
  color: var(--brightwhite);
}

/* =========================================
   3. UTILITIES & TYPOGRAPHY helpers
   ========================================= */
.white { color: var(--white); }
.purple { color: var(--gradient-color3); }
.teal { color: var(--gradient-color4); }
.black { color: var(--black); }

.shadow {
  filter: drop-shadow(0 0 0.75rem var(--shadow-color));
  text-shadow: 2px 2px var(--shadow-color);
}

/* Spacing & Layout Utilities */
.p4 { padding: 3rem 2rem !important; }
img.p4 { margin: auto; padding: 0 0 4rem 0 !important; }
.p3 { padding-top: 6rem; }
.p2 { padding-bottom: 2rem; }
.p05 { padding-bottom: 0.5rem; }
.m3 { margin: 3rem; }
.m4 { margin-bottom: 4rem; }
.rounded { border-radius: 2rem !important; }

.show { display: revert; }
.hide { display: none; }
.visually-hidden {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Text Styles */
h1.headline {
  font-size: 1.8rem;
  margin: 0.75rem 0;
  color: var(--white);
  text-shadow: none;
}

h4 {
  font-size: 1.2rem;
  font-weight: normal;
  color: var(--reading);
  opacity: 0.8;
  margin-bottom: 1rem;
}

.ingress {
  font-size: 1.05rem;
  color: var(--reading);
  opacity: 0.9;
  margin-bottom: 1rem;
}

.breadtext {
  display: grid;
  gap: 1.5rem;
}

.legible {
  background-color: var(--txtblock);
  padding: 2rem;
  margin-bottom: 2rem;
  line-height: 1.6;
  color: var(--white);
}

.date {
  font-size: 0.8rem;
  color: var(--reading);
  opacity: 0.5;
  margin-top: 1rem;
  display: block;
}

/* =========================================
   4. COMPONENTS (Buttons, Forms, Tables)
   ========================================= */

/* --- Buttons --- */
.cyber-button-alt {
  background: transparent;
  color: var(--gradient-color2);
  border: 1px solid var(--gradient-color2);
  padding: 1rem 2rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  border-radius: 0.5rem;
  text-align: center;
}

.cyber-button-alt:hover {
  background: var(--gradient-color2);
  color: var(--black);
  box-shadow: 0 0 15px var(--gradient-color2);
}

.glowonhover {
  border: none;
  outline: none;
  padding: 0.3rem 0.6rem;
  padding-left: 2.8rem;
  padding-right: 0.8rem;
  color: var(--white);
  background: var(--footer-bg);
  cursor: pointer;
  position: relative;
  z-index: 0;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.glowonhover:before {
  content: '';
  background: linear-gradient(45deg, var(--gradient-color1), var(--gradient-color2), var(--gradient-color3), var(--gradient-color4));
  position: absolute;
  top: -2px; left: -2px;
  background-size: 400%;
  z-index: -1;
  filter: blur(5px);
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  animation: glowing 20s linear infinite;
  opacity: 0;
  transition: opacity .3s ease-in-out;
  border-radius: 1rem;
}

.glowonhover:hover:before { opacity: 1; }
.glowonhover:after {
  z-index: -1;
  content: '';
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 1rem;
  left: 0; top: 0;
}

@keyframes glowing {
  0% { background-position: 0 0; }
  50% { background-position: 400% 0; }
  100% { background-position: 0 0; }
}

/* --- Forms --- */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

input, textarea {
  width: 100%;
  display: flex;
  border: 1px solid var(--shadow-grey);
  padding: 0.5rem 1rem;
  box-shadow: 0 0 15px 4px rgba(0,0,0,0.06);
  border-radius: 5px;
  background-color: var(--contraster);
  color: var(--white);
  font-family: inherit;
}

input { height: 2.75rem; }

input:focus, textarea:focus {
  outline: none;
  border: 1px solid var(--gradient-color3);
  box-shadow: 0 0 10px var(--gradient-color1);
  background-color: rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}

/* --- Tables --- */
table {
  max-width: 60%;
  padding: 2rem;
  margin: 25px auto;
  background-color: var(--gradient-color2);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 10px 30px 5px var(--gradient-color1);
}

thead tr { border-bottom: 1px dashed var(--shadow-grey); }
thead tr td { font-size: 16px; letter-spacing: 1px; color: var(--shadow-grey); padding: 2rem; }
tbody tr td { padding: 2rem; }
tr:nth-child(even) { background-color: rgba(0,0,0,0.1); }
tr:nth-child(odd) { background-color: rgba(0,0,0,0.2); }

/* =========================================
   5. LAYOUT (Navbar, Footer, Grid)
   ========================================= */

/* Navbar */
nav#navbar {
  width: 100%;
  min-height: 6rem;
  background-color: var(--nav-bg);
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: center;
  position: relative;
  text-transform: uppercase;
  z-index: 100;
}

nav#navbar>div#tobias {
  position: absolute;
  left: 2rem;
}

nav#navbar>div#tobias>a {
  background-image: url('../img/tobiassolem.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  display: block;
  width: 16rem;
  height: 1rem;
  cursor: pointer;
  padding: 1rem 2rem;
}

nav#navbar>div#tobias>a:hover {
  transition: .5s;
  background-image: url('../img/tobiassolem_bw.png');
  border: 1px dashed var(--coolstuff-hover-bg);
}

#navbar a { color: rgba(255,255,255,0.7); }

#navbar a:hover {
  transition: .5s;
  color: var(--white);
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 1), 2px 2px 32px rgba(0, 0, 0, 1);
  padding: 2rem;
  background-color: var(--hover-bg);
}

#navbar ul {
  display: flex;
  justify-content: center;
  list-style-type: none;
}
nav#navbar ul#mobile { display: none; }
#navbar li { padding: 0 1rem; }

/* CTA Navbar Button */
.nav-cta {
  background: var(--gradient-color1) !important;
  color: var(--brightwhite) !important;
  padding: 0.6rem 1.2rem !important;
  border-radius: 5px !important;
  font-weight: bold;
  border: 1px solid var(--gradient-color2) !important;
  box-shadow: 0 0 10px var(--gradient-color1);
  margin-left: 1rem;
  vertical-align: middle;
  animation: pulse 2s infinite;
  text-transform: uppercase;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(138, 81, 245, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(138, 81, 245, 0); }
  100% { box-shadow: 0 0 0 0 rgba(138, 81, 245, 0); }
}

#navbar .nav-cta:hover {
  background: var(--gradient-color2) !important;
  box-shadow: 0 0 20px var(--gradient-color2);
  color: var(--black) !important;
  padding: 0.6rem 1.2rem !important;
  text-shadow: none !important;
}

/* Page Content & Grid */
#centerme {
  margin: auto;
  max-width: 80rem;
  backdrop-filter: blur(5px);
}

#pagecontent {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  background: linear-gradient(180deg, rgba(138,81,245,0.1) 5%, rgba(86,195,234,0.1) 15%, rgba(138,81,245,0.1) 25%, rgba(86,195,234,0.1) 50%, rgba(138,81,245,0.1) 100%);
  padding: 0rem;
  border-radius: 2.5rem;
}

.grid {
  display: grid;
  grid-template-columns: 60% 35%;
  padding: 1rem;
  gap: 2rem;
}

#textcol {
  background-color: var(--txtblock);
  border-radius: 2rem;
  padding: 2rem;
  margin: 1rem;
}

/* Footer */
footer {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  align-items: center;
  width: 100%;
  background-color: var(--footer-bg);
  min-height: 8rem;
  border-radius: 0 0 2rem 2rem;
  padding-bottom: 4rem;
}

/* =========================================
   7. SCROLL TO TOP BUTTON
   ========================================= */
#maincontent {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  z-index: 99;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-align: center;
  background: rgba(28, 20, 35, 0.8);
  border-radius: 50%;
}

#maincontent img {
  width: 100%;
  height: auto;
  display: block;
}

#maincontent.show {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================
   8. LIGHTBOX Z-INDEX FIX (GLightbox)
   ========================================= */
.glightbox-container {
  z-index: 999999 !important;
}

/* =========================================
   9. GLOBAL MEDIA QUERIES
   ========================================= */
@media screen and (max-width: 930px) {
  body { overflow-x: hidden; }

  /* --- NAVBAR --- */
  nav#navbar ul#desktop { display: none; }
  nav#navbar ul#mobile {
    display: flex;
    flex-direction: column;
    margin-left: 0;
    padding: 2rem 2rem 2rem 3rem;
    width: 100%;
  }
  nav#navbar ul#mobile li { padding: 0.4rem 0; }
  nav#navbar ul#mobile .nav-cta {
    margin-left: 0;
    margin-top: 1rem;
    text-align: center;
    width: fit-content;
    display: inline-block;
  }
  nav#navbar {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 1rem;
  }
  nav#navbar > div#tobias {
    position: static;
    padding: 0.5rem 2rem;
  }
  nav#navbar > div#tobias > a {
    width: 14rem;
    height: 1.5rem;
    padding: 0.75rem 0;
  }

  /* --- LAYOUT RESETS --- */
  .grid { grid-template-columns: 100%; }
  .m3 { margin: 0; }
  p.white { padding: 1rem 2rem; }
  div#textcol { margin: 0; }
  
  #maincontent { display: none; }
}

@media screen and (max-width: 429px) {
  body { overflow-x: hidden; }
  .m3 { margin: 0; }
  .legible { padding: 1rem; margin: 0.5rem; }
  div.legible.rounded { margin: 1rem; }
  .p3 { padding-top: 3rem; }
}

/* Animations & Effects */
@keyframes blink { 50% { background-color: transparent; } }
@keyframes blinker { 50% { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.blink { animation: blinker 1.5s linear infinite; }
.cursor {
  background-color: var(--gradient-color2);
  width: 8px; height: 1em; display: inline-block;
  animation: blink 1s infinite;
}

.crt-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 9999; pointer-events: none;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%);
  background-size: 100% 4px;
  box-shadow: inset 0 0 150px rgba(0,0,0,0.9);
}

.grecaptcha-badge { right: 10px !important; }
div.legible > a { color: rgba(138,81,245,1); }
p.articlenav { background-color: var(--gradient-color1); padding: 0.5rem; margin-top: 0.5rem; }
p.articlenav.rounded:hover, p.articlenav.rounded > a.white:hover { color: var(--gradient-color3); }
