@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --color-bg: #fff;
  --color-text: #222;
  --color-header: #efefef;
  --color-nav: #eee;
  --color-accent: #f9a825;
  --color-accent-dark: #e65100;
  --color-card: #f5f5f5;
  --color-card-border: #e0e0e0;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --radius: 10px;
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Nunito', Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
}

/* ---- Sticky Footer ---- */
main {
  flex: 1;
  padding: 2em;
  animation: fadeInUp 0.5s ease both;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.85); }
  70%  { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-3px); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ---- Header ---- */
header {
  background: var(--color-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5em 2em;
  border-bottom: 3px solid var(--color-accent);
  flex-wrap: nowrap;
  animation: fadeIn 0.4s ease both;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  gap: 0.8em;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.6em;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.logo-container { flex-shrink: 0; }

#logo {
  display: block;
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  animation: float 4s ease-in-out infinite;
  transition: opacity 0.2s;
}
#logo:hover { opacity: 0.8; }

.site-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.1em;
  font-weight: normal;
  color: var(--color-text);
  white-space: nowrap;
  letter-spacing: -1px;
  transition: color var(--transition);
}

/* ---- Nav ---- */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin-left: auto;
}

.header-nav > a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1em;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 7px;
  transition: background var(--transition), color var(--transition);
}
.header-nav > a:hover {
  background: var(--color-accent);
  color: #fff;
}

/* ---- Dropdown ---- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: var(--color-nav);
  color: var(--color-text);
  border: 2px solid transparent;
  cursor: pointer;
  font-family: 'Nunito', Arial, sans-serif;
  font-size: 1em;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 7px;
  transition: background var(--transition), color var(--transition);
  line-height: 1.4;
  white-space: nowrap;
}
.dropbtn:hover,
.dropbtn:focus {
  background: var(--color-accent);
  color: #fff;
  outline: none;
}
.dropbtn:hover .arrow-icon,
.dropbtn:focus .arrow-icon { color: #fff; }

/* Arrow: Unicode character, rotates, zero height impact */
.arrow-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 0.75em;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform var(--transition);
  transform: rotate(0deg);
  /* Render as ▾ down arrow */
  line-height: 1;
  overflow: hidden;
}
.dropbtn[aria-expanded="true"] .arrow-icon {
  transform: rotate(180deg);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background-color: var(--color-header);
  min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13);
  border-radius: 10px;
  z-index: 200;
  overflow: hidden;
  border: 1.5px solid var(--color-card-border);
}
.dropdown-content.show {
  display: block;
  animation: slideDown 0.18s ease both;
}
.dropdown-content a {
  color: var(--color-text);
  padding: 10px 18px;
  text-decoration: none;
  display: block;
  font-size: 0.97em;
  font-weight: 600;
  border-bottom: 1px solid var(--color-card-border);
  transition: background var(--transition), color var(--transition), padding-left var(--transition);
}
.dropdown-content a:last-child { border-bottom: none; }
.dropdown-content a:hover {
  background: var(--color-accent);
  color: #fff;
  padding-left: 24px;
}

/* ---- Hamburger (mobile) ---- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 7px;
  margin-left: auto;
  flex-shrink: 0;
  transition: background var(--transition);
}
.hamburger:hover { background: var(--color-nav); }
.hamburger span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--color-text);
  border-radius: 3px;
  transition: transform 0.25s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---- Header Controls ---- */
.header-controls {
  display: flex;
  gap: 0.5em;
  flex-shrink: 0;
}
.header-controls select {
  font-size: 0.92em;
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 7px;
  border: 2px solid transparent;
  background: var(--color-nav);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--transition);
}
.header-controls select:hover,
.header-controls select:focus {
  border-color: var(--color-accent);
  outline: none;
}

/* ---- Footer ---- */
footer {
  background: var(--color-header);
  text-align: center;
  padding: 0.45em 1.5em;
  font-size: 0.8em;
  color: #888;
  border-top: 2px solid var(--color-accent);
  animation: fadeIn 0.5s ease both;
  line-height: 1.7;
}
footer p { margin: 0.1em 0; }

/* ---- Hero Section ---- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4em 2em 3em;
  position: relative;
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(249,168,37,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(249,168,37,0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

.hero-logo {
  width: 110px;
  height: 110px;
  image-rendering: pixelated;
  animation: float 4s ease-in-out infinite, popIn 0.6s ease both;
  margin-bottom: 1.2em;
  filter: drop-shadow(0 6px 18px rgba(249,168,37,0.3));
}
.hero h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1em, 3vw, 1.8em);
  font-weight: normal;
  margin: 0 0 0.5em;
  line-height: 1.5;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-dark), var(--color-accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}
.hero-subtitle {
  font-size: 1.12em;
  color: var(--color-text);
  opacity: 0.72;
  max-width: 520px;
  margin: 0 auto 2em;
  line-height: 1.7;
}
.hero-cta {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.72em;
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
  box-shadow: 0 4px 18px rgba(249,168,37,0.3);
  letter-spacing: 0.5px;
}
.hero-cta:hover {
  background: var(--color-accent-dark);
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 28px rgba(249,168,37,0.4);
}

/* ---- Feature Cards ---- */
.features-section {
  padding: 2em 2em 3em;
}
.features-section h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.9em;
  font-weight: normal;
  text-align: center;
  margin-bottom: 1.5em;
  color: var(--color-accent);
  letter-spacing: 1px;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2em;
  max-width: 1100px;
  margin: 0 auto;
}
.card {
  background: var(--color-card);
  border: 2px solid var(--color-card-border);
  border-radius: var(--radius);
  padding: 1.5em 1.3em;
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeInUp 0.5s ease both;
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.30s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.40s; }
.card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 30px rgba(249,168,37,0.18);
  border-color: var(--color-accent);
}
.card-icon { font-size: 2em; margin-bottom: 0.2em; }
.card-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.63em;
  font-weight: normal;
  color: var(--color-accent);
  line-height: 1.6;
}
.card-desc { font-size: 0.88em; opacity: 0.73; line-height: 1.6; }

/* ---- Info Strip (homepage) ---- */
.info-strip {
  display: flex;
  justify-content: center;
  gap: 2em;
  flex-wrap: wrap;
  padding: 2em 2em 0;
  max-width: 900px;
  margin: 0 auto;
}
.info-item {
  text-align: center;
  animation: fadeInUp 0.5s ease both;
}
.info-item:nth-child(1) { animation-delay: 0.1s; }
.info-item:nth-child(2) { animation-delay: 0.2s; }
.info-item:nth-child(3) { animation-delay: 0.3s; }
.info-num {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.4em;
  color: var(--color-accent);
  display: block;
}
.info-label { font-size: 0.85em; opacity: 0.65; }

/* ---- About Section (homepage) ---- */
.about-strip {
  max-width: 860px;
  margin: 2.5em auto 0;
  padding: 1.8em 2em;
  background: var(--color-card);
  border: 2px solid var(--color-card-border);
  border-radius: var(--radius);
  animation: fadeInUp 0.5s ease both;
  animation-delay: 0.2s;
}
.about-strip h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.82em;
  font-weight: normal;
  color: var(--color-accent);
  margin: 0 0 0.8em;
}
.about-strip p {
  font-size: 0.97em;
  line-height: 1.8;
  opacity: 0.82;
  margin: 0 0 0.6em;
}
.about-strip p:last-child { margin-bottom: 0; }

/* ---- General Sections (About, etc.) ---- */
section {
  margin-bottom: 2em;
  animation: fadeInUp 0.45s ease both;
}
section h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 1em;
  font-weight: normal;
  border-left: 4px solid var(--color-accent);
  padding-left: 0.7em;
  margin-bottom: 0.8em;
  line-height: 1.5;
}
section h3 {
  font-size: 1.1em;
  font-weight: 800;
  border-bottom: 2px solid var(--color-card-border);
  padding-bottom: 0.3em;
  margin-bottom: 0.6em;
}
section p, section ul, section li { line-height: 1.8; }
section a {
  color: var(--color-accent-dark);
  font-weight: 700;
  text-decoration: underline;
  transition: color var(--transition);
}
section a:hover { color: var(--color-accent); }
ul { padding-left: 1.3em; }

/* ---- Themes ---- */
body.theme-light {
  --color-bg: #fff;
  --color-text: #222;
  --color-header: #efefef;
  --color-nav: #e8e8e8;
  --color-accent: #f9a825;
  --color-accent-dark: #e65100;
  --color-card: #f7f7f7;
  --color-card-border: #e0e0e0;
}
body.theme-dark {
  --color-bg: #181818;
  --color-text: #f0f0f0;
  --color-header: #222;
  --color-nav: #2e2e2e;
  --color-accent: #e8a020;
  --color-accent-dark: #c97a10;
  --color-card: #242424;
  --color-card-border: #303030;
}
body.theme-grey {
  --color-bg: #c9c9c9;
  --color-text: #222;
  --color-header: #e0e0e0;
  --color-nav: #d0d0d0;
  --color-accent: #d4900f;
  --color-accent-dark: #a06808;
  --color-card: #d8d8d8;
  --color-card-border: #bbb;
}
body.theme-amoled {
  --color-bg: #000;
  --color-text: #f0f0f0;
  --color-header: #0e0e0e;
  --color-nav: #161616;
  --color-accent: #e8a020;
  --color-accent-dark: #c97a10;
  --color-card: #0a0a0a;
  --color-card-border: #1e1e1e;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  header {
    padding: 0.6em 1em;
    flex-wrap: wrap;
    gap: 0;
  }
  .header-left { flex: 1; min-width: 0; }
  .hamburger { display: flex; }

  .header-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-top: 0.5em;
    gap: 0.2em;
    order: 10;
  }
  .header-nav.open { display: flex; }
  .header-nav > a {
    padding: 10px 12px;
    border-radius: 6px;
  }
  .dropdown { width: 100%; }
  .dropbtn { width: 100%; justify-content: space-between; }
  .dropdown-content {
    position: static;
    box-shadow: none;
    border-radius: 0 0 8px 8px;
    border: none;
    border-top: 1px solid var(--color-card-border);
    background: var(--color-nav);
  }

  .header-controls {
    order: 5;
    margin-left: auto;
    align-self: center;
  }

  .site-title { font-size: 0.82em; }
  .hero h1 { font-size: 1em; }
  .hero { padding: 3em 1.2em 2.5em; }
  .features-section { padding: 1.5em 1em 2em; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8em; }
  main { padding: 1.2em 1em; }
  .info-strip { gap: 1.2em; padding: 1.5em 1em 0; }
  .about-strip { margin: 1.5em 0 0; padding: 1.2em 1em; }
}

@media (max-width: 480px) {
  .site-title { font-size: 0.65em; }
  #logo { width: 36px; height: 36px; }
  .cards-grid { grid-template-columns: 1fr 1fr; gap: 0.6em; }
  .hero-logo { width: 80px; height: 80px; }
  .info-num { font-size: 1.1em; }
}
