@import url('https://fonts.googleapis.com/css2?family=Chivo+Mono:wght@400;500;700&family=Jersey+10&family=Sixtyfour&display=swap');

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: #020617;
}

html {
  background: #020617;
}

body {
  background: #020617;
  color: #fff7d6;
  font-family: "Chivo Mono", "Courier New", Courier, monospace;
  font-size: 15px;
  line-height: 1.5;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath fill='%23ffcc66' stroke='%23000' d='M14 1l3.6 8.4 9.1.8-6.9 6 2.1 8.9-7.9-4.7-7.9 4.7 2.1-8.9-6.9-6 9.1-.8z'/%3E%3C/svg%3E") 14 14, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 153, 204, 0.10), transparent 20%),
    radial-gradient(circle at 82% 31%, rgba(153, 221, 255, 0.08), transparent 22%),
    radial-gradient(circle at 58% 88%, rgba(255, 204, 102, 0.07), transparent 24%);
  z-index: 0;
}

#star-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.star {
  position: absolute;
  width: var(--star-size, 2px);
  height: var(--star-size, 2px);
  background: #ffffff;
  border-radius: 50%;
  opacity: 0.75;
  box-shadow: 0 0 5px #ffffff;
  animation: star-flicker var(--star-speed, 2.5s) ease-in-out infinite alternate;
  animation-delay: var(--star-delay, 0s);
}

.star.big-star {
  background: #ffcc66;
  box-shadow: 0 0 8px #ffcc66, 0 0 14px #ffffff;
}

@keyframes star-flicker {
  0% { opacity: 0.12; transform: scale(0.7); }
  35% { opacity: 0.95; transform: scale(1.2); }
  65% { opacity: 0.38; transform: scale(0.92); }
  100% { opacity: 0.78; transform: scale(1.05); }
}

a,
button {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath fill='%23ff99cc' stroke='%23000' d='M14 1l3.6 8.4 9.1.8-6.9 6 2.1 8.9-7.9-4.7-7.9 4.7 2.1-8.9-6.9-6 9.1-.8z'/%3E%3C/svg%3E") 14 14, pointer;
}

.side-nav {
  width: 140px;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: #0b1040;
  border-right: 4px double #ffcc66;
  padding: 8px 7px;
  text-transform: lowercase;
  z-index: 3;
  max-width: 100%;
}

.nav-title {
  color: #ffcc66;
  font-family: "Jersey 10", "Chivo Mono", "Courier New", monospace;
  font-size: 32px;
  font-weight: normal;
  text-align: center;
  text-shadow: #ff6666 2px 2px, #ffcc66 0 0 6px;
  margin: 8px 0 20px;
  border: 2px dotted #ffffff;
  padding: 10px;
  line-height: 0.9;
  letter-spacing: 1px;
}

.side-nav a {
  display: block;
  color: #ffffff;
  background: #161b55;
  border: 3px outset #b8c6ff;
  padding: 8px 9px;
  margin-bottom: 15px;
  text-decoration: none;
}

.side-nav a:hover,
.side-nav a.active {
  color: #020617;
  background: #ffcc66;
}

.page-wrap {
  position: relative;
  z-index: 1;
  margin-left: 140px;
  width: calc(100% - 140px);
  max-width: calc(100% - 140px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1;
  padding: 34px 28px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.welcome-box {
  max-width: 760px;
  margin: 80px auto 34px;
  text-align: center;
  background: #101336;
  border: 4px solid #ff99cc;
  padding: 20px;
  box-shadow:
    8px 8px 0 #000000,
    0 0 8px rgba(255, 153, 204, 0.45);
  animation: border-glow 5s linear infinite;
}

.welcome-box h1 {
  font-family: "Sixtyfour", "Chivo Mono", "Courier New", monospace;
  font-size: 44px;
  margin: 10px 0;
  color: #ffcc66;
  line-height: 1.15;
  letter-spacing: 1px;
  text-shadow: #ff6666 2px 2px, #ffcc66 0 0 6px;
}

.subtitle {
  color: #d9e2ff;
  margin-bottom: 20px;
}

.home-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.home-buttons a,
.resource-bar {
  color: #000000;
  background: #ffcc66;
  border: 3px outset #ffffff;
  padding: 10px 16px;
  text-decoration: none;
  font-weight: bold;
}

.home-buttons a {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.home-buttons a::before {
  content: "★";
  position: absolute;
  left: -18px;
  top: 50%;
  color: #ffffff;
  text-shadow: 0 0 6px #ffffff;
  transform: translateY(-50%);
}

.home-buttons a:hover,
.home-buttons a:focus-visible {
  background: #ff99cc;
  transform: translateY(-4px) rotate(-2deg);
  box-shadow: 4px 4px 0 #000000, 0 0 12px #ffcc66;
}

.resource-bar {
  display: block;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  background: #99ddff;
}

.resource-bar:hover,
.resource-bar:focus-visible {
  background: #ffcc66;
  outline: 2px dotted #ffffff;
  outline-offset: 4px;
}

.page-title {
  font-family: "Sixtyfour", "Chivo Mono", "Courier New", monospace;
  text-align: center;
  font-size: 56px;
  margin: 12px auto;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow:
    3px 3px #000000,
    0 0 5px currentColor;
  line-height: 1.1;
  max-width: 100%;
  overflow-wrap: break-word;
}

.html-title { color: #ff9966; }
.css-title { color: #99ddff; }
.js-title { color: #fff066; }
.templates-title { color: #d6a0ff; }
.resources-title { color: #99ffcc; }

.intro {
  max-width: 860px;
  margin: 0 auto 30px;
  background: #101336;
  border: 2px dotted #ffffff;
  padding: 12px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 701px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
  }
}

@media (min-width: 1400px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
  }
}

.code-card {
  background: #101336;
  border: 4px solid #ffffff;
  padding: 5px;
  max-width: 100%;
  box-shadow:
    0 0 6px rgba(255, 255, 255, 0.22),
    0 0 10px rgba(255, 204, 102, 0.22);
  animation: border-glow 5s linear infinite;
}

@keyframes border-glow {
  0% {
    box-shadow:
      0 0 5px rgba(255, 153, 204, 0.45),
      0 0 10px rgba(255, 153, 204, 0.22);
  }
  25% {
    box-shadow:
      0 0 5px rgba(255, 204, 102, 0.45),
      0 0 10px rgba(255, 204, 102, 0.22);
  }
  50% {
    box-shadow:
      0 0 5px rgba(153, 221, 255, 0.45),
      0 0 10px rgba(153, 221, 255, 0.22);
  }
  75% {
    box-shadow:
      0 0 5px rgba(214, 160, 255, 0.45),
      0 0 10px rgba(214, 160, 255, 0.22);
  }
  100% {
    box-shadow:
      0 0 5px rgba(255, 153, 204, 0.45),
      0 0 10px rgba(255, 153, 204, 0.22);
  }
}

.code-card.html { border-color: #ff9966; }
.code-card.css { border-color: #99ddff; }
.code-card.js { border-color: #fff066; }
.code-card.templates { border-color: #d6a0ff; }

.inner-border {
  min-height: 100%;
  border: 2px dotted #ffffff;
  padding: 16px;
  max-width: 100%;
}

.code-card h2 {
  text-align: left;
  margin: 0 0 10px;
  font-size: 20px;
  color: #ffcc66;
  text-shadow:
    2px 2px #000000,
    0 0 4px #ffcc66;
}

.code-card p {
  color: #f5edff;
  line-height: 1.45;
}

.sample-image {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 220px;
  overflow: auto;
  object-fit: cover;
  border: 2px solid #99ddff;
  margin: 14px 0;
  background: #353e66;
  padding: 12px;
}

.code-box {
  display: block;
  width: 100%;
  max-width: 100%;
  text-align: left;
  color: #d6ffd6;
  background: #020617;
  border: 2px inset #99ddff;
  padding: 10px;
  margin-top: 14px;
  font-family: "Courier New", Courier, monospace;
  overflow-x: auto;
}

.code-box:hover,
.code-box:focus-visible {
  outline: 2px dotted #ffcc66;
  outline-offset: 3px;
}

.copy-note {
  display: block;
  color: #ffcc66;
  font-size: 12px;
  margin-bottom: 6px;
  font-family: "Chivo Mono", "Courier New", Courier, monospace;
}

pre,
code {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 13px;
  max-width: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

.resource-list {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.resource-box {
  background: #101336;
  border: 3px solid #99ffcc;
  margin-bottom: 14px;
  padding: 12px;
  max-width: 100%;
  overflow-wrap: break-word;
}

.resource-box h2 {
  margin: 0 0 8px;
  color: #ffcc66;
  text-transform: lowercase;
}

.resource-box a {
  color: #99ddff;
  overflow-wrap: anywhere;
}

.resource-box a:hover {
  background: #ffcc66;
  color: #000000;
}

footer {
  margin-top: auto;
  text-align: center;
  padding: 16px;
  background: #0b1040;
  border-top: 4px double #ffcc66;
  margin-left: 0;
  width: 100%;
  max-width: 100%;
  font-family: "Jersey 10", "Chivo Mono", "Courier New", monospace;
  font-size: 28px;
  letter-spacing: 1px;
}

footer a {
  color: #66baff;
  font-weight: normal;
  text-decoration: none;
}

footer a:hover {
  color: #ffcc66;
  text-decoration: underline;
}

/* link colors when using a href tag in the html */

.inline-links {
  color: #99ddff;
}

.inline-links:visited {
  color: #d6a0ff;
}

.inline-links:hover {
  color: #ffcc66;
  background: #0b1040;
}

.inline-links:active {
  color: #ff99cc;
}

.code-details {
  margin-top: 14px;
}

.code-details summary {
  display: inline-block;
  background: #18245c;
  color: #ffcc66;
  border: 2px outset #99ddff;
  padding: 8px 12px;
  font-weight: bold;
  cursor: pointer;
}

.code-details summary:hover {
  background: #24327a;
  color: #ffffff;
}

.code-details .code-box {
  margin-top: 10px;
}

.resource-jump-buttons {
  max-width: 900px;
  margin: 0 auto 24px;
  text-align: center;
  background: #101336;
  border: 2px dotted #ffcc66;
  padding: 12px;
  overflow-wrap: break-word;
}

.resource-jump-buttons a {
  display: inline-block;
  color: #020617;
  background: #99ddff;
  border: 3px outset #ffffff;
  padding: 8px 10px;
  margin: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.resource-jump-buttons a:hover,
.resource-jump-buttons a:focus-visible {
  background: #ff99cc;
  color: #000000;
  transform: translateY(-4px) rotate(-2deg);
  box-shadow: 4px 4px 0 #000000, 0 0 12px #ffcc66;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  color: #ffcc66;
  background: none;
  border: none;
  padding: 0;
  font-size: 34px;
  text-decoration: none;
  text-shadow:
    2px 2px #000000,
    0 0 6px #ffcc66,
    0 0 12px #ff99cc;
  transition: transform 0.18s ease, color 0.18s ease, text-shadow 0.18s ease;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  color: #ff99cc;
  background: none;
  transform: translateY(-4px) rotate(-8deg);
  text-shadow:
    2px 2px #000000,
    0 0 8px #ff99cc,
    0 0 14px #ffcc66;
}

.help-box {
  border-color: #ff99cc;
}

.help-box h2,
.help-box h3 {
  color: #ffcc66;
  text-shadow:
    2px 2px #000000,
    0 0 4px #ffcc66;
}

.help-mini-box {
  background: #0b1040;
  border: 2px dotted #ff99cc;
  padding: 14px;
}

@media (max-width: 700px) {
  body {
    font-size: 14px;
    overflow-x: hidden;
  }

  body::before {
    width: 100%;
    max-width: 100%;
  }

  .side-nav {
    position: static;
    width: 100%;
    min-height: auto;
    border-right: 0;
    border-bottom: 4px double #ffcc66;
  }

  .nav-title {
    margin: 4px 0 12px;
  }

  .side-nav nav {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
  }

  .side-nav a {
    margin-bottom: 0;
    text-align: center;
    padding: 7px 8px;
  }

  .page-wrap {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  main {
    padding: 22px 12px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  footer {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }

  .welcome-box {
    margin: 28px auto 22px;
    padding: 14px;
    box-shadow:
      5px 5px 0 #000000,
      0 0 7px rgba(255, 153, 204, 0.35);
  }

  .welcome-box h1,
  .page-title {
    font-size: 31px;
  }

  .home-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-buttons a,
  .resource-bar {
    width: 100%;
    display: block;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .sample-image {
    max-height: 260px;
  }

  .resource-jump-buttons a:hover,
  .resource-jump-buttons a:focus-visible,
  .home-buttons a:hover,
  .home-buttons a:focus-visible {
    transform: none;
  }
}

@media (max-width: 390px) {
  .side-nav nav {
    grid-template-columns: 1fr;
  }

  .welcome-box h1,
  .page-title {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .star,
  .home-buttons a,
  .home-buttons a::before,
  .welcome-box,
  .code-card {
    animation: none !important;
    transition: none !important;
  }
}