/* UnHeroic site — monochrome palette, matches the launcher's default theme. */

:root {
  --bg-primary: #121212;
  --bg-secondary: #1a1a1a;
  --bg-card: #222222;
  --bg-hover: #2e2e2e;
  --text-primary: #f0f0f0;
  --text-secondary: #aaaaaa;
  --accent: #ffffff;
  --accent-hover: #cccccc;
  --border: #333333;
  --radius: 12px;
  --max-width: 980px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* CRT scanlines — same treatment as the launcher's default bgPattern.
   Fixed attachment so the stripes stay still while the page scrolls,
   which reads less nauseating than scrolling bars. */
body {
  background-image: linear-gradient(to bottom, transparent 50%, rgba(255, 255, 255, 0.05) 50%);
  background-size: 100% 4px;
  background-attachment: fixed;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  letter-spacing: -0.02em;
  margin: 0;
}

/* --- Hero --- */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
  text-align: center;
}

/* Hero logo — shield + glitch wordmark. Matches the look used inside the
   launcher's header and onboarding modal. Side-by-side layout via flex. */
.hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 auto 2.5rem;
  padding: 4px 0;
  line-height: 1;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 700;
  color: var(--accent);
}

.hero-shield {
  /* Sized so the shield's *visible* pixels match Silkscreen's cap-height
     (~0.7em). The SVG pixels occupy 24 of 30 viewBox rows, so
     height * 24/30 = 0.7em → height = 0.875em. Width keeps the 24:30
     aspect ratio. */
  width: 0.64em;
  height: 0.8em;
  margin-top: 8px;
  filter: drop-shadow(0 4px 14px rgba(245, 158, 11, 0.3));
}

/* Hidden visually but present for screen readers / SEO — the glitch mark
   is a stylised rendering of "UnHeroic" that doesn't expose plain text. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Glitch wordmark — "UN" outlined, "HEROIC" solid, Silkscreen pixel font.
   Two pseudo-element channel layers (red + cyan) sliced via clip-path
   nudged during a short burst near the end of the 9s loop. Copy of the
   launcher's GlitchWordmark styles so the two UIs match. */
.glitch-wordmark {
  font-family: 'Silkscreen', monospace;
  letter-spacing: 2px;
  font-weight: inherit;
  line-height: 1;
  position: relative;
  display: inline-flex;
  align-items: baseline;
}

.glitch-wordmark-un {
  color: transparent;
  -webkit-text-stroke: 1px currentColor;
}

.glitch-wordmark-heroic {
  color: currentColor;
}

.glitch-wordmark::before,
.glitch-wordmark::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  pointer-events: none;
  mix-blend-mode: screen;
}

.glitch-wordmark::before {
  color: rgba(255, 40, 40, 0.9);
  animation: glitch-wordmark-r 3s steps(1) infinite;
}

.glitch-wordmark::after {
  color: rgba(40, 220, 255, 0.9);
  animation: glitch-wordmark-c 3s steps(1) infinite;
}

@keyframes glitch-wordmark-r {
  0%,  84%, 94%, 100% { transform: translate(-2px, 0); clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%); opacity: 0.85; }
  85% { transform: translate(-6px, 2px);  clip-path: polygon(0 20%, 100% 20%, 100% 55%, 0 55%); opacity: 1; }
  88% { transform: translate(-1px, -1px); clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);     opacity: 1; }
  91% { transform: translate(-8px, 0);    clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%); opacity: 1; }
}

@keyframes glitch-wordmark-c {
  0%,  84%, 94%, 100% { transform: translate(2px, 0); clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%); opacity: 0.85; }
  85% { transform: translate(6px, -2px); clip-path: polygon(0 45%, 100% 45%, 100% 80%, 0 80%); opacity: 1; }
  88% { transform: translate(1px, 1px);  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%); opacity: 1; }
  91% { transform: translate(8px, 0);    clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);  opacity: 1; }
}

.hero .tagline {
  font-family: 'Silkscreen', monospace;
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin: 0 auto 2.25rem;
  max-width: 720px;
  line-height: 1.6;
}

.hero .lead {
  max-width: 640px;
  margin: 0 auto 2rem;
  color: var(--text-primary);
}

.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}
.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

/* --- Features --- */
.features {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--border);
}

.features h2,
.download h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.feature {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  /* Amber accent stripe on the left nods to the shield's gradient and
     makes the card feel part of the game-y hero vibe. Brightens on hover. */
  border-left: 3px solid #F59E0B;
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  transition: border-color 180ms ease, transform 180ms ease;
}

.feature:hover {
  border-color: #F59E0B;
  transform: translateY(-2px);
}

.feature h3 {
  font-family: 'Silkscreen', monospace;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 0.7rem;
  font-weight: 700;
}

.feature p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* --- Download --- */
.download {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--border);
}

.download-intro,
.download-note {
  text-align: center;
  color: var(--text-secondary);
}

.download-intro {
  margin-top: -1rem;
  margin-bottom: 2rem;
}

.download-note {
  margin-top: 2rem;
  font-size: 0.9rem;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.dl-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 2rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-primary);
  transition: border-color 120ms ease;
}

.dl-card:hover {
  border-color: var(--accent);
}

.dl-icon {
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dl-label {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.dl-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.35rem;
}

.btn-secondary {
  padding: 0.55rem 1.1rem;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn-secondary:hover {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
  text-decoration: none;
}

/* --- Footer --- */
.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .hero {
    padding: 3rem 1rem 2rem;
  }
  .features,
  .download {
    padding: 3rem 1rem;
  }
}
