:root {
  --bg: #0a0a0a;
  --bg2: #101010;
  --yellow: #f9d923;
  --yellow-soft: rgba(249, 217, 35, 0.08);
  --text: #f8f8f8;
  --muted: #aaaaaa;
  --border: rgba(249, 217, 35, 0.25);
  --radius: 14px;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #181818 0%, #050505 55%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(5, 5, 5, 0.95);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(249, 217, 35, 0.2);
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 1.2rem;
}

.brand {
  display: flex;
  gap: 0.15rem;
  align-items: center;
  text-decoration: none;
}

.brand-main {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1.17rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
}

.brand-tag {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.05rem;
  text-transform: uppercase;

  background: var(--yellow);
  color: #000;
  border-radius: 999px;
  padding: 0.1rem 0.55rem 0.2rem;
}

.nav-links {
  display: flex;
  align-items: center;
  /* gap: 1.1rem; */
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  opacity: 1;
  transition: 0.15s ease;

  padding: 0.8rem 1.4rem;

  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
}

.nav-links a:hover {
  opacity: 1;
  color: var(--yellow);
}

/* --- Dropdown additions --- */
/* Make mixed children (anchors + dropdown container) play nice in the row */
.nav-links > .nav-item {
  position: relative;
  display: inline-flex;
}

/* Caret */
.nav-link-has-sub {
  position: relative;
  padding-right: 1.2rem;
}
.nav-link-has-sub::after {
  content: "▾";
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-48%);
  font-size: 0.8em;
  opacity: 0.8;
  transition: transform 0.15s ease;
}

/* Submenu base (hidden) */
.submenu {
  position: absolute;
  left: 0;
  top: 100%;
  display: none;
  flex-direction: column;
  background: rgba(7, 7, 7, 0.98);
  border: 1px solid rgba(249, 217, 35, 0.6);
  border-radius: 6px;
  padding: 0rem 0;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* Items */
.submenu-link {
  display: block;
  padding: 0.55rem 0.9rem;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.submenu-link:hover,
.submenu-link:focus {
  color: var(--yellow);
  background: rgba(255, 184, 3, 0.08);
}

/* Show on hover or keyboard focus */
.has-sub:hover > .submenu,
.has-sub:focus-within > .submenu {
  display: flex;
}
.has-sub:hover > .nav-link-has-sub::after,
.has-sub:focus-within > .nav-link-has-sub::after {
  transform: translateY(-48%) rotate(180deg);
}

/* --- Mobile behavior --- */
@media (max-width: 960px) {
  /* Keep dropdown full-width inside your existing mobile panel */
  .nav-links > .nav-item {
    display: block;
  }

  .nav-link-has-sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.6rem 1.2rem; /* matches your mobile item padding */
  }

  /* Ensure your existing top-level mobile borders don't hit submenu items */
  .submenu-link {
    border: 0;
  }

  .submenu {
    position: static; /* stacks under parent */
    display: none;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* Open on hover or when tabbing into submenu links */
  .has-sub:hover > .submenu,
  .has-sub:focus-within > .submenu {
    display: flex;
  }

  /* Optional dividers inside submenu on mobile */
  .submenu .submenu-link:not(:last-child) {
    border-bottom: 1px solid rgba(255, 184, 3, 0.3);
  }
}

/* mobile toggle */
.nav-toggle {
  width: 42px;
  height: 34px;
  background: transparent;
  border: none;
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}
.nav-toggle span {
  background: var(--text);
  height: 3px;
  border-radius: 4px;
  transition: 0.15s ease;
}

/* HERO */
.hero {
  max-width: 1160px;
  margin: 3.4rem auto 1.6rem;
  padding: 0 0.1rem;
  display: flex;
  justify-content: space-between;
  gap: 2.4rem;
  align-items: center;
}
.hero-content h1 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(1.85rem, 3.1vw, 2.4rem);
  margin: 0 0 0.35rem;
  letter-spacing: 0.05rem;
}
.hero-content p {
  max-width: 600px;
  color: var(--muted);
}
.hero-actions {
  display: inline-block;
  margin-top: 0.8rem;
}
.hero-btn {
  display: inline-block;
  background: linear-gradient(140deg, #f9d923 0%, #ffb703 100%);
  color: #000;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-weight: 500;
  text-decoration: none;
}
.hero-meta {
  background: rgba(249, 217, 35, 0.06);
  border: 1px solid rgba(249, 217, 35, 0.14);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  max-width: 380px;
  color: rgba(248, 248, 248, 0.7);
}

.meta-notice {
  cursor: pointer;
  color: rgba(214, 183, 6, 0.651);
}

.meta-notice summary::marker {
  content: "⮟";
}
.meta-notice[open] summary::marker {
  content: "⮝";
}

/* MAIN */
.main-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.1rem 3.2rem;
}

.layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.4rem;
  margin-bottom: 1.4rem;
}

.card {
  background: radial-gradient(
    circle at top,
    rgba(249, 217, 35, 0.05) 0%,
    rgba(6, 6, 6, 1) 38%,
    rgba(6, 6, 6, 1) 100%
  );
  border: 1px solid rgba(249, 217, 35, 0.04);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.05rem 1.15rem 1rem;
}

.section-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.04rem;
  font-family: "Space Grotesk", system-ui, sans-serif;
}

.section-subtext {
  margin: 0.4rem 0 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.section-subtext.small {
  font-size: 0.7rem;
  margin-top: 0.2rem;
}

.label {
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
  display: block;
}

.input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(249, 217, 35, 0.3);
  background: rgba(6, 6, 6, 0.4);
  color: var(--text);
  outline: none;
  transition: 0.15s ease;
  font-size: 0.82rem;
}
.input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(249, 217, 35, 0.16);
}

.section-subtitle {
  margin: 1.1rem 0 0.6rem;
  font-size: 0.73rem;
  text-transform: uppercase;
  color: rgba(248, 248, 248, 0.65);
  letter-spacing: 0.08rem;
}

/* CHECKBOXES */
.checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 0.4rem 0.55rem;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(6, 6, 6, 0.12);
  border: 1px solid rgba(249, 217, 35, 0.03);
  border-radius: 10px;
  padding: 0.3rem 0.4rem;
  font-size: 0.7rem;
  cursor: pointer;
  user-select: none;
}
.checkbox-item input {
  display: none;
}
.checkbox-item .check {
  width: 15px;
  height: 15px;
  border: 1px solid rgba(249, 217, 35, 0.5);
  border-radius: 4px;
  position: relative;
}
.checkbox-item input:checked + .check {
  background: var(--yellow);
  border-color: var(--yellow);
}
.checkbox-item input:checked + .check::after {
  content: "";
  width: 7px;
  height: 7px;
  background: #000;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 2px;
}

/* BUTTONS */
.actions {
  margin-top: 1rem;
}
.w100 {
  width: 100%;
}
.secondary-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.55rem;
  flex-wrap: wrap;
}
.btn {
  border: 1px solid rgba(249, 217, 35, 0.4);
  background: rgba(6, 6, 6, 0.2);
  color: var(--text);
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.15s ease;
  font-size: 0.76rem;
}
.btn:hover {
  background: rgba(249, 217, 35, 0.08);
}
.btn.primary {
  background: linear-gradient(140deg, #f9d923 0%, #ffb703 100%);
  color: #000;
  font-weight: 600;
}
.btn.ghost {
  background: rgba(0, 0, 0, 0.1);
}

/* RESULTS */
.results-card {
  display: flex;
  flex-direction: column;
  min-height: 350px;
}
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.count-pill {
  background: rgba(249, 217, 35, 0.18);
  border: 1px solid rgba(249, 217, 35, 0.5);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.7rem;
}
.results-box {
  background: #030303;
  border: 1px solid rgba(249, 217, 35, 0.1);
  border-radius: 10px;
  margin-top: 0.7rem;
  padding: 0.6rem 0.65rem;
  height: 100%;
  min-height: 250px;
  max-height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, menlo, monaco, consolas,
    "Courier New", monospace;
  font-size: 0.7rem;
  line-height: 1.3;
}

/* RESULT SCROOLBAR */
.results-box::-webkit-scrollbar {
  width: 4px;
  background: #181818;
  border-radius: 5px;
}

.results-box::-webkit-scrollbar-thumb {
  background: #f9d923;
  border-radius: 5px;
}

/* SETTINGS CARD */
.settings-card .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.settings-card .hint {
  font-size: 0.65rem;
  color: rgba(250, 250, 250, 0.32);
  margin-top: 0.25rem;
}
.settings-save {
  width: fit-content;
}
.settings-status {
  font-size: 0.7rem;
  margin-top: 0.6rem;
  min-height: 1rem;
}

/* FOOTER */
.footer-inner span {
  text-align: center;
}

.footer-inner span .links {
  display: flex;
  /* justify-content: center; have to take a look later */
  gap: 0.94rem;
  flex-wrap: wrap;

  /* Temp Fix */
  margin-left: 3px;
}
.footer-link {
  color: var(--yellow);
  text-decoration: none;
  font-size: 1.25rem;

  display: inline-block;
}

.footer-inner span a {
  color: var(--yellow);
  text-decoration: none;

  display: inline-block;
}

.site-footer {
  border-top: 1px solid rgba(249, 217, 35, 0.15);
  background: rgba(3, 3, 3, 0.3);
  padding: 0.8rem 1.1rem 1.1rem;
}
.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  color: rgba(248, 248, 248, 0.4);
  font-size: 0.65rem;
}
.footer-links a {
  color: rgba(248, 248, 248, 0.6);
  text-decoration: none;
  font-size: 0.65rem;
}
.footer-links span {
  opacity: 0.3;
  margin: 0 0.25rem;
}

/* RESPONSIVE */
@media (max-width: 960px) {
  .nav-inner {
    padding: 0.55rem 1.2rem;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .hero {
    flex-direction: column;
  }
  .hero-content {
    margin: 0 1.2rem;
  }
  .nav-links {
    position: absolute;
    top: 52px;
    right: 1rem;
    background: rgba(7, 7, 7, 0.98);
    border: 1px solid rgba(249, 217, 35, 0.6);
    border-radius: 6px;
    display: none;
    flex-direction: column;
    gap: 0;
  }

  .nav-links a {
    text-align: center;
    padding: 0.6rem 1.2rem;
  }

  .nav-links a:not(:last-child) {
    border-bottom: 1px solid rgba(255, 184, 3, 0.3);
  }
  .nav-links.show {
    display: flex;
    align-items: stretch;
  }
  .nav-toggle {
    display: flex;
  }

  /* FOOTER*/

  .footer-inner span .links {
    margin-left: 6px;
  }
}

@media (max-width: 560px) {
  .secondary-actions {
    flex-direction: column;
  }
  .results-box {
    min-height: 210px;
  }
}

/* EFFECTS */

:root {
  --bg: #0b0b10; /* background */
  --fg: #eaeaea; /* main text color */
  --c1: #00e5ff; /* cyan ghost */
  --c2: #ff00b3; /* magenta ghost */
  --speed: 3s; /* animation duration */
}

.glitch {
  color: var(--fg);
  font-weight: 900;
  letter-spacing: 0.02em;
  font-size: clamp(2.5rem, 9vw, 6rem);
  /* The effect lives here */
  text-shadow: 0 0 0 transparent;
  animation: glitch-shift var(--speed) infinite steps(1, end);
  /* tiny motion to sell the glitch */
  will-change: text-shadow, transform;
}

.glitch:hover {
  animation-duration: calc(var(--speed) * 0.6);
}

@keyframes glitch-shift {
  0% {
    text-shadow: 0 0 0 transparent;
    transform: none;
  }
  6% {
    text-shadow: 2px 0 var(--c1), -2px 0 var(--c2);
  }
  10% {
    text-shadow: -2px 0 var(--c1), 2px 0 var(--c2);
    transform: translateY(-0.5px);
  }
  14% {
    text-shadow: 4px -1px var(--c1), -4px 1px var(--c2);
  }
  18% {
    text-shadow: -1px 1px var(--c1), 1px -1px var(--c2);
    transform: translateX(0.2px);
  }
  22% {
    text-shadow: 3px 0 var(--c1), -3px 0 var(--c2);
  }
  26% {
    text-shadow: -3px 0 var(--c1), 3px 0 var(--c2);
    transform: translateY(0.4px);
  }
  30% {
    text-shadow: 1px -2px var(--c1), -1px 2px var(--c2);
  }
  34% {
    text-shadow: -4px 1px var(--c1), 4px -1px var(--c2);
  }
  38% {
    text-shadow: 2px 0 var(--c1), -2px 0 var(--c2);
    transform: none;
  }
  42% {
    text-shadow: 0 0 transparent;
  }
  60% {
    text-shadow: 3px 0 var(--c1), -3px 0 var(--c2);
    transform: translateY(-0.3px);
  }
  70% {
    text-shadow: -2px -1px var(--c1), 2px 1px var(--c2);
  }
  80% {
    text-shadow: 4px 0 var(--c1), -4px 0 var(--c2);
  }
  90% {
    text-shadow: -1px 2px var(--c1), 1px -2px var(--c2);
  }
  100% {
    text-shadow: 0 0 transparent;
    transform: none;
  }
}

/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .glitch {
    animation: none;
  }
}