/* =============================================
   RETRO MODE (1997-ish GeoCities home page)
   Starfield background, link pane down the left, text in columns, no hero.
   Everything here is scoped to html.retro, so the regular site is untouched.
   The class is set before first paint by the inline script in index.html and
   toggled by the #style-toggle button. Uses !important on purpose: this sheet
   has to beat Bootstrap and the ID-based rules in styles.css.
   Blinking / scrolling bits only run when the visitor has not asked for
   reduced motion.
   ============================================= */

/* Retro-only extras (banner, ticker, counter, badges): hidden unless retro is on */
.retro-only { display: none; }
html.retro .retro-only { display: block; }

/* ---------- Toggle button: regular look ---------- */
#style-toggle {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 1100;
  font: 600 0.75rem/1 'Segoe UI', system-ui, -apple-system, sans-serif;
  letter-spacing: 0.03em;
  color: #00d4ff;
  background: rgba(13, 27, 42, 0.9);
  border: 1px solid rgba(0, 212, 255, 0.6);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}
#style-toggle:hover { background: #00d4ff; color: #0d1b2a; }
#style-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---------- Global reset: flat and square ---------- */
html.retro { scroll-behavior: auto !important; }

html.retro *,
html.retro *::before,
html.retro *::after {
  border-radius: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transition: none !important;
  backdrop-filter: none !important;
}

/* Tiled "outer space" background, white Times text */
html.retro body {
  background-color: #000022 !important;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 90px 120px, #ff0, transparent),
    radial-gradient(2px 2px at 150px 60px, #fff, transparent),
    radial-gradient(1px 1px at 60px 170px, #0ff, transparent),
    radial-gradient(1px 1px at 180px 150px, #fff, transparent),
    radial-gradient(1px 1px at 120px 20px, #f9f, transparent) !important;
  background-size: 200px 200px !important;
  color: #fff !important;
  font-family: "Times New Roman", Times, serif !important;
  font-size: 16px;
  line-height: 1.25;
  margin: 0;
}
html.retro p, html.retro li, html.retro span { font-family: "Times New Roman", Times, serif !important; }

/* Icons are a modern touch; hide them */
html.retro i[class*="fa-"],
html.retro .scroll-hint { display: none !important; }

/* ---------- Page layout ---------- */
/* Phones: everything stacks (nav bar on top, then the content) */
html.retro section {
  background: #000033 !important;
  color: #fff !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  border: 0 !important;
}
html.retro .section-light,
html.retro .section-dark { padding: 0 0 10px !important; }
html.retro .container { padding-left: 12px !important; padding-right: 12px !important; }

/* Rainbow bar across the top of every section */
html.retro section::before {
  content: "";
  display: block;
  height: 6px;
  margin-bottom: 4px;
  background: linear-gradient(90deg,
    #f00 0 16.6%, #f80 0 33.3%, #ff0 0 50%, #0c0 0 66.6%, #09f 0 83.3%, #c0f 0 100%);
}

/* Desktop: left link pane + main area, centered fixed-width table */
@media (min-width: 768px) {
  html.retro body {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    max-width: 1000px;
    margin: 0 auto;
    align-items: start;
  }
  html.retro .retro-banner,
  html.retro .retro-marquee,
  html.retro .site-footer { grid-column: 1 / -1; }
  html.retro #main-nav { grid-column: 1; grid-row: 3 / span 10; }
  html.retro #hero,
  html.retro section,
  html.retro .parallax-band { grid-column: 2; }
}

/* ---------- Hero is not a hero: just the top of the page ---------- */
html.retro #hero { background: #000033 !important; }
html.retro .hero-overlay { background: transparent !important; min-height: 0 !important; display: block !important; }
html.retro #hero .container { height: auto !important; padding: 8px 12px !important; }
html.retro .terminal-tag { display: none !important; }

html.retro h1, html.retro h2, html.retro h3 { letter-spacing: 0 !important; }
html.retro .hero-name {
  color: #ffff00 !important;
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", Verdana, sans-serif !important;
  font-size: 2.4em !important;
  font-weight: bold !important;
  margin: 0.1em 0 !important;
  text-align: center !important;
}
html.retro .hero-title {
  color: #00ff00 !important;
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", Verdana, sans-serif !important;
  font-size: 1.05em !important;
  font-weight: bold !important;
  text-align: center !important;
}
html.retro .hero-lead {
  color: #fff !important;
  font-size: 1em !important;
  line-height: 1.25 !important;
  max-width: none !important;
  text-align: left;
}

/* Old photo bands: collapse (the rainbow bars do the dividing now) */
html.retro .parallax-band { display: none !important; }

/* ---------- Headings ---------- */
html.retro .section-title,
html.retro .section-title.text-light {
  color: #ff66ff !important;
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", Verdana, sans-serif !important;
  font-size: 1.7em !important;
  font-weight: bold !important;
  text-align: center !important;
  margin: 6px 0 6px !important;
}
html.retro .section-title::before { content: "*~ "; color: #ffff00; }
html.retro .section-title::after  { content: " ~*"; color: #ffff00; }
html.retro .section-sub,
html.retro .text-muted-light,
html.retro .text-light {
  color: #fff !important;
  max-width: none !important;
  font-size: 1em !important;
  text-align: left !important;
  margin: 0 0 8px !important;
}

/* ---------- Links ---------- */
html.retro a:not(.btn) { color: #00ffff !important; text-decoration: underline !important; }
html.retro a:not(.btn):visited { color: #ff99ff !important; }
html.retro a:not(.btn):hover { color: #00ff00 !important; }

/* ---------- Navigation: the left link pane ---------- */
html.retro #main-nav {
  position: static !important;
  background: #660099 !important;
  border: 3px outset #cc66ff !important;
  padding: 0 !important;
}
html.retro #main-nav .container { max-width: none !important; display: block; padding: 6px 8px !important; }
html.retro .brand-text {
  display: block;
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", Verdana, sans-serif !important;
  font-size: 1.25em !important;
  font-weight: bold !important;
  letter-spacing: 0 !important;
  margin: 0 0 6px !important;
  white-space: normal;
}
html.retro .brand-text::before { content: none !important; }
html.retro #main-nav a.brand-text { color: #ffff00 !important; }
html.retro #main-nav .nav-link,
html.retro #main-nav .dropdown-item {
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", Verdana, sans-serif !important;
  font-size: 0.8125rem !important;
  letter-spacing: 0 !important;
  color: #ffff66 !important;
  text-decoration: underline !important;
  background: transparent !important;
}
html.retro #main-nav .nav-link:visited,
html.retro #main-nav .dropdown-item:visited { color: #ffccff !important; }
html.retro #main-nav .nav-link:hover,
html.retro #main-nav .nav-link.active,
html.retro #main-nav .dropdown-item:hover,
html.retro #main-nav .dropdown-item:focus { color: #fff !important; }
html.retro #main-nav .dropdown-toggle::after { display: none !important; }

/* Phones: Bootstrap's collapsed menu, with plain gray dropdown boxes */
html.retro #main-nav .nav-link { padding: 0.35rem 0.5rem !important; }
html.retro #main-nav .dropdown-menu {
  background: #660099 !important;
  border: 2px outset #cc66ff !important;
  padding: 2px !important;
  margin-top: 0 !important;
  max-height: 60vh;
  overflow-y: auto;
}
html.retro #main-nav .dropdown-item { padding: 0.2rem 0.6rem !important; white-space: normal; }

html.retro .navbar-toggler {
  background: #c0c0c0 !important;
  border: 2px outset #fff !important;
  color: #000 !important;
  padding: 2px 10px !important;
}
html.retro .navbar-toggler:active { border-style: inset !important; }
html.retro .navbar-toggler-icon { display: none !important; }
html.retro .navbar-toggler::after {
  content: "Menu";
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1em;
  color: #000;
}

/* Desktop: a plain vertical list; Games and Coursework are always open */
@media (min-width: 768px) {
  html.retro #main-nav .navbar-collapse { display: block !important; }
  html.retro #main-nav .navbar-nav { flex-direction: column; }
  html.retro #main-nav .nav-link { display: block; padding: 1px 0 !important; }
  html.retro #main-nav .nav-link::before { content: "\2022\00a0"; color: #fff; }
  html.retro #main-nav .dropdown-toggle {
    color: #00ff00 !important;
    font-weight: bold;
    text-decoration: none !important;
    pointer-events: none;
    margin-top: 8px;
  }
  html.retro #main-nav .dropdown-toggle::before { content: none; }
  html.retro #main-nav .dropdown-menu {
    display: block !important;
    position: static !important;
    transform: none !important;
    background: transparent !important;
    border: 0 !important;
    padding: 0 0 0 8px !important;
    max-height: none;
    overflow: visible;
  }
  html.retro #main-nav .dropdown-item { padding: 0 !important; }
  html.retro #main-nav .dropdown-item:hover,
  html.retro #main-nav .dropdown-item:focus { background: transparent !important; }
}

/* ---------- Buttons: Windows 98 gray bevel ---------- */
html.retro .btn,
html.retro #style-toggle {
  background: #c0c0c0 !important;
  color: #000 !important;
  border: 2px outset #fff !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 13px !important;
  font-weight: normal !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  padding: 3px 14px !important;
}
html.retro .btn:hover,
html.retro #style-toggle:hover { background: #d4d0c8 !important; color: #000 !important; }
html.retro .btn:active,
html.retro #style-toggle:active { border-style: inset !important; }
html.retro .btn:focus-visible,
html.retro #style-toggle:focus-visible,
html.retro a:focus-visible { outline: 1px dotted #fff !important; outline-offset: 2px; }

/* ---------- Skills and projects: plain text flowing in columns ---------- */
html.retro .row.g-4 {
  display: block !important;
  margin: 0 !important;
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
}
html.retro .row.g-4 > * {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 0 12px !important;
  break-inside: avoid;
}
@media (min-width: 992px) {
  html.retro .row.g-4 { column-count: 2; column-gap: 28px; column-rule: 2px dotted #9966cc; }
}

html.retro .skill-card,
html.retro .project-card {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  height: auto !important;
  transform: none !important;
}
html.retro .skill-card h3,
html.retro .project-card h3 {
  color: #ffff00 !important;
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", Verdana, sans-serif !important;
  font-size: 1.05em !important;
  font-weight: bold !important;
  text-align: left !important;
  margin: 0 !important;
}
/* headings cycle through the 90s palette so it isn't all one color */
html.retro .row > div:nth-child(3n+2) h3 { color: #00ff99 !important; }
html.retro .row > div:nth-child(3n+3) h3 { color: #ff99cc !important; }
html.retro .skill-card p,
html.retro .project-card p {
  color: #fff !important;
  font-size: 1em !important;
  line-height: 1.25 !important;
  margin: 0 0 4px !important;
}
html.retro .project-tag {
  background: transparent !important;
  color: #ff9900 !important;
  font: bold 11px Arial, Helvetica, sans-serif !important;
  letter-spacing: 0 !important;
  padding: 0 !important;
}
html.retro .project-tag::before { content: "["; }
html.retro .project-tag::after  { content: "]"; }
html.retro .project-tech { display: block !important; }
html.retro .project-tech span {
  display: inline !important;
  background: transparent !important;
  border: 0 !important;
  color: #66ffff !important;
  font-size: 0.85em !important;
  font-style: italic;
  padding: 0 !important;
}
html.retro .project-tech span::after { content: " | "; color: #cc99ff; font-style: normal; }
html.retro .project-tech span:last-child::after { content: none; }

html.retro code,
html.retro .project-card code {
  background: transparent !important;
  color: #fff !important;
  font-family: "Courier New", Courier, monospace !important;
  padding: 0 !important;
}

/* ---------- About / location / contact ---------- */
html.retro .about-lead,
html.retro .location-detail { color: #fff !important; font-size: 1em !important; line-height: 1.25 !important; font-weight: normal !important; }
html.retro .location-city {
  color: #00ff00 !important;
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", Verdana, sans-serif !important;
  font-size: 1.15em !important;
  font-weight: bold !important;
}
html.retro #about .col-lg-7,
html.retro #location .col-lg-5 { text-align: left; }
html.retro .about-stat-grid { gap: 0 !important; }
html.retro .about-stat {
  background: #000066 !important;
  border: 2px outset #9999ff !important;
  padding: 4px 2px !important;
}
html.retro .about-stat span {
  color: #ffff00 !important;
  font-size: 0.9em !important;
  font-weight: bold !important;
  letter-spacing: 0 !important;
}
html.retro .location-map {
  border: 4px ridge #ffcc00 !important;
  width: 420px;
  max-width: 100%;
  height: auto;
}

/* ---------- Footer ---------- */
html.retro .site-footer {
  background: #000033 !important;
  color: #fff !important;
  padding: 8px !important;
  font-size: 1em !important;
}
html.retro .site-footer::before {
  content: "";
  display: block;
  height: 6px;
  margin-bottom: 8px;
  background: linear-gradient(90deg,
    #f00 0 16.6%, #f80 0 33.3%, #ff0 0 50%, #0c0 0 66.6%, #09f 0 83.3%, #c0f 0 100%);
}
html.retro .site-footer p { color: #fff !important; }

/* ---------- Retro-only decorations ---------- */
html.retro .retro-banner {
  text-align: center;
  padding: 3px 8px;
  background: repeating-linear-gradient(45deg, #ffff00 0 14px, #000 14px 28px);
}
html.retro .retro-banner .msg {
  display: inline-block;
  background: #ffff00;
  color: #000;
  border: 2px solid #000;
  font: bold 14px "Comic Sans MS", "Comic Sans", Verdana, sans-serif;
  padding: 1px 12px;
}

html.retro .retro-marquee {
  overflow: hidden;
  white-space: nowrap;
  background: #000;
  color: #00ff00;
  font: 14px "Courier New", Courier, monospace;
  padding: 2px 0;
  text-align: center;
}
html.retro .retro-marquee span { display: inline-block; font-family: "Courier New", Courier, monospace !important; }

html.retro .retro-counter { text-align: center; margin: 0.5rem 0; }
html.retro .retro-counter .digits {
  display: inline-block;
  background: #000;
  color: #00ff00;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 3px;
  padding: 1px 8px;
  border: 2px inset #fff;
}

html.retro .retro-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0.5rem 0 0;
}
html.retro .retro-badges span {
  background: #c0c0c0;
  color: #000;
  border: 2px outset #fff;
  font: bold 11px Arial, Helvetica, sans-serif !important;
  padding: 2px 8px;
}
html.retro .retro-netscape { text-align: center; font-size: 0.85em; margin: 0.5rem 0 0; color: #fff; }

/* Blinking + scrolling only when motion is welcome */
@media (prefers-reduced-motion: no-preference) {
  html.retro .retro-blink { animation: retro-blink 1s steps(1) infinite; }
  html.retro .retro-marquee span { padding-left: 100%; animation: retro-scroll 22s linear infinite; }
}
@keyframes retro-blink { 50% { visibility: hidden; } }
@keyframes retro-scroll { to { transform: translateX(-100%); } }

/* ---------- Small screens: keep it usable ---------- */
@media (max-width: 576px) {
  html.retro .hero-name { font-size: 1.8em !important; }
  /* g-5 rows have 3rem gutters that overflow the phone viewport; tighten them */
  html.retro .row.g-5 { --bs-gutter-x: 1.5rem; --bs-gutter-y: 1.5rem; }
}
