/* --------------------------------------------
   GWAY "Glitchpunk" Theme – Layout-Safe Edition
-------------------------------------------- */

/* Root colors for easy accent swap */
:root {
  --bg: #090a10;
  --bg-alt: #16151e;
  --main-bg: #090a10;
  --fg: #e0e0e0;
  --accent: #00fff3;
  --accent-alt: #ff0080;
  --muted: #888;
  --error: #ffb300;
}

/* Neon-glow and glitch animations */
@keyframes neon-flicker {
  0%, 19%, 21%, 23%, 54%, 56%, 100% {
    text-shadow: 0 0 6px #00fff3, 0 0 14px #00fff3, 0 0 24px #5200ff;
  }
  20%, 22%, 55% { text-shadow: none; }
}
@keyframes link-glitch {
  0% { text-shadow: 2px 0 #ff0080, -2px 0 #00ffff; opacity: 1; }
  10% { transform: translate(1px, -1px); }
  20% { text-shadow: none; opacity: 0.8; transform: translate(-1px, 1px); }
  30% { text-shadow: -2px 0 #ff0080, 2px 0 #00ffff; transform: translate(2px, 0); }
  40% { text-shadow: none; opacity: 0.9; transform: translate(-2px, 0); }
  50%, 100% { text-shadow: 2px 0 #ff0080, -2px 0 #00ffff; opacity: 1; }
}

/* Body and backgrounds */
body, .page-wrap {
  background: var(--bg) !important;
  color: var(--fg);
  font-family: 'Roboto Mono', 'Fira Mono', 'Consolas', monospace;
}

/* Sidebar */
aside {
  background: var(--bg-alt);
  color: var(--fg);
  border-right: 2px solid var(--accent-alt);
  box-shadow: 2px 0 24px #00fff344;
  padding-top: 1.2rem;
}
aside ul {
  margin: 0;
  padding: 0;
}
aside ul li a {
    color: var(--accent-alt);
    font-weight: bold;
    padding: 0.6em 0;
    font-size: 0.93em;
    border-radius: 8px;
    text-shadow: 0 0 5px #ff0080, 0 0 2px #00fff3;
    background: transparent;
  transition: background 0.15s, color 0.15s;
  animation: link-glitch 3.5s infinite alternate-reverse;
}
aside ul li a.active,
aside ul li a:hover {
    color: var(--accent);
    background: #21214a55;
    animation-duration: 1.1s;
}

aside ul.sub-links {
    list-style: none;
    padding-left: 1em;
    margin: 0.2em 0 0.4em;
    font-size: 0.85em;
}

aside ul.sub-links li a {
    text-transform: none;
    padding: 0.2em 0;
}
aside .compass,
aside img.compass {
  background: rgba(0, 255, 243, 0.07);
  border-radius: 12px;
  margin-top: 1em;
  box-shadow: 0 0 16px #00fff333;
}
form.navbar {
  margin-bottom: 1em;
}

/* Neon glitch headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--accent);
  animation: neon-flicker 1.5s infinite alternate;
  letter-spacing: 2px;
  position: relative;
}
h1 {
  font-size: 2.8em;
  margin: 1.2em 0 1em 0;
  overflow: hidden;
}
h1::before {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 3px;
  width: 100%;
  color: var(--accent-alt);
  opacity: 0.17;
  pointer-events: none;
  animation: neon-flicker 2.2s infinite alternate-reverse;
}

/* Glitch links */
a {
  color: var(--accent-alt);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s;
  position: relative;
}
a:hover {
  color: var(--accent);
}
a::before, a::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  opacity: 0.7;
  pointer-events: none;
}
a::before {
  color: var(--accent);
  z-index: -2;
  animation: link-glitch 2.5s infinite alternate-reverse;
}
a::after {
  color: var(--accent-alt);
  z-index: -3;
  animation: link-glitch 3.2s infinite step-end alternate;
}
a:hover::before, a:hover::after {
  animation-duration: 1s;
}

/* Code blocks and monospace */
pre {
  background: #16161a;
  color: #00fff3;
  border-radius: 10px;
  box-shadow: 0 0 12px #00fff333;
  padding: 1em;
}
code {
  background: #21214a;
  color: #e0e0e0;
  border-radius: 6px;
  padding: 2px 6px;
}

/* Inputs */
input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  background: #13131a;
  color: var(--fg);
  border: 1px solid #333;
  border-radius: 7px;
  padding: 0.6em 1em;
  width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
  transition: box-shadow 0.15s, border-color 0.15s;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg fill='%23e0e0e0' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1em center;
  background-size: 14px;
  padding-right: 2.2em;
}

/* Checkbox / Radio */
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--accent);
  transform: scale(1.17);
  margin-right: 0.5em;
}

/* Buttons */
button {
  background: #1a1b25;
  color: var(--fg);
  border: 2px solid var(--accent);
  border-radius: 7px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 8px #00fff333;
}
button:hover {
  background: var(--accent);
  color: #151522;
  box-shadow: 0 0 16px var(--accent), 0 0 32px var(--accent-alt);
}

/* Footer */
footer {
  background: #0a0a0a;
  color: var(--muted);
  font-size: 0.95rem;
  border-top: 1px solid #1f1f1f;
  padding: 2rem 0 1.2rem 0;
  text-align: center;
  box-shadow: 0 -2px 24px #00fff311;
}
footer a {
  color: var(--accent);
  text-shadow: 0 0 5px #00fff3cc;
}
footer a:hover {
  color: var(--accent-alt);
}

/* Error message */
p.error {
  color: var(--error);
  font-weight: bold;
  text-shadow: 0 0 6px #ffb30099;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--accent);
  color: #a0a0a0;
  font-style: italic;
  background: #18182533;
  margin: 1em 0;
  padding: 0.7em 1.2em;
}

/* Glitch overlays for fun */
.section-glitch {
  position: relative;
  overflow: hidden;
}
.section-glitch::before,
.section-glitch::after {
  content: '';
  position: absolute;
  top: 0;
  left: -10%;
  width: 120%;
  height: 100%;
  pointer-events: none;
}
.section-glitch::before {
  background: linear-gradient(to bottom, rgba(255,0,128,0.09), rgba(0,255,243,0.09));
  animation: neon-flicker 2.5s infinite linear alternate-reverse;
}
.section-glitch::after {
  background: linear-gradient(to top, rgba(255,0,128,0.05), rgba(0,255,243,0.05));
  animation: neon-flicker 3s infinite linear alternate;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #090a10;
}
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-alt);
}

/* Utility tweaks */
hr {
  border: 0;
  border-top: 2px dashed var(--accent-alt);
  margin: 2em 0;
}
