/* ═══════════════════════════════════════════════════════════════════
   Joyfon — tokens
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --void:      #07030d;
  --deck:      #150a24;
  --deck-2:    #1e0e33;
  --edge:      #3b1a5e;
  --hot:       #ff2d9b;
  --hot-soft:  #ff7ac2;
  --hot-dim:   #7d0a49;
  --ice:       #4de8ff;
  --amber:     #ffc24d;
  --text:      #e9e0f5;
  --text-dim:  #9d8fb8;

  --display: "Tourney", "Arial Narrow", Impact, sans-serif;
  --body:    "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono:    "Share Tech Mono", ui-monospace, "SFMono-Regular", monospace;

  --gut:  clamp(1.25rem, 4vw, 4rem);
  --maxw: 1180px;
  --rail: 1px solid var(--edge);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* magenta wash behind everything */
body::before {
  content: "";
  position: fixed;
  inset: -20vh -10vw auto;
  height: 90vh;
  background:
    radial-gradient(60% 55% at 22% 0%, rgba(255, 45, 155, 0.22), transparent 70%),
    radial-gradient(45% 45% at 88% 12%, rgba(77, 232, 255, 0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--hot-soft); text-decoration-color: var(--hot-dim); text-underline-offset: 3px; }
a:hover { color: #fff; text-decoration-color: var(--hot); }

:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 3px;
  border-radius: 2px;
}

code, pre { font-family: var(--mono); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* CRT scanline veil over the whole page */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.028) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
}

/* ═══════════════════════════════════════════════════════════════════
   Top bar
   ═══════════════════════════════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem var(--gut);
  border-bottom: var(--rail);
  background: rgba(7, 3, 13, 0.78);
  backdrop-filter: blur(14px);
}

.topbar__mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  color: var(--text);
  text-decoration: none;
  text-shadow: 0 0 14px rgba(255, 45, 155, 0.7);
}

.topbar__nav {
  display: flex;
  gap: 1.4rem;
  margin-inline-start: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.topbar__nav a { color: var(--text-dim); text-decoration: none; }
.topbar__nav a:hover { color: var(--hot); }

.topbar__repo {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--void);
  background: var(--hot);
  padding: 0.35rem 0.9rem;
  border-radius: 2px;
  text-decoration: none;
  box-shadow: 0 0 18px rgba(255, 45, 155, 0.45);
}
.topbar__repo:hover { color: var(--void); background: var(--hot-soft); }

@media (max-width: 720px) {
  .topbar__nav { display: none; }
  .topbar__repo { margin-inline-start: auto; }
}

/* ═══════════════════════════════════════════════════════════════════
   Hero
   ═══════════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(3rem, 8vw, 6rem) var(--gut) clamp(2.5rem, 6vw, 4rem);
}

.eyebrow {
  margin: 0 0 1.4rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--hot);
}

.wordmark {
  position: relative;
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.6rem, 12vw, 8.5rem);
  line-height: 0.86;
  letter-spacing: 0.01em;
}

.wordmark__face {
  position: relative;
  display: block;
  background: linear-gradient(
    177deg,
    #ffffff 0%, #efe6ff 22%, #9d90c4 43%,
    #4a3f6b 51%, #b9aee0 60%, #ffffff 78%, #d9cdf5 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 45, 155, 0.55);
}

.wordmark__glow {
  position: absolute;
  inset: 0;
  color: var(--hot);
  filter: blur(22px);
  opacity: 0.75;
  z-index: -1;
}

.tagline {
  margin: 1.1rem 0 0;
  font-family: var(--mono);
  font-size: clamp(0.9rem, 1.9vw, 1.2rem);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ice);
  text-shadow: 0 0 18px rgba(77, 232, 255, 0.5);
}

.hero__lede {
  max-width: 46ch;
  margin: 1.6rem 0 0;
  color: var(--text-dim);
}
.hero__lede a { color: var(--text); }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2.2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: 2px;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:active { transform: translateY(1px); }

.btn--solid {
  color: var(--void);
  background: var(--hot);
  box-shadow: 0 0 24px rgba(255, 45, 155, 0.5);
}
.btn--solid:hover { color: var(--void); background: var(--hot-soft); box-shadow: 0 0 34px rgba(255, 45, 155, 0.75); }

.btn--ghost {
  color: var(--text);
  border: 1px solid var(--edge);
}
.btn--ghost:hover { color: #fff; border-color: var(--hot); box-shadow: inset 0 0 24px rgba(255, 45, 155, 0.16); }

.btn__gh { flex: none; display: block; }

/* CRT frame around the hero media */
.crt { margin: 0; }

.crt__screen {
  position: relative;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--edge);
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 45, 155, 0.16), transparent 65%),
    linear-gradient(180deg, var(--deck-2), var(--void));
  box-shadow:
    0 0 0 1px rgba(255, 45, 155, 0.18),
    0 30px 90px rgba(255, 45, 155, 0.14),
    inset 0 0 70px rgba(255, 45, 155, 0.08);
  overflow: hidden;
}

.crt__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0 2px, transparent 2px 4px);
  pointer-events: none;
}

.crt__screen img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(1.05) contrast(1.04);
}

.crt__label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--hot);
  box-shadow: 0 0 10px var(--hot);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* Narrow: the wordmark leads, then the animation, then the pitch. Letting the
   copy block dissolve into the grid is what allows the media to sit between
   the tagline and the lede. */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    row-gap: 0;
  }
  .hero__copy { display: contents; }

  .hero .eyebrow       { order: 1; }
  .hero .wordmark      { order: 2; }
  .hero .tagline       { order: 3; }
  .hero .crt           { order: 4; max-width: 440px; margin-top: 2rem; }
  .hero .hero__lede    { order: 5; }
  .hero .hero__actions { order: 6; }
}

/* ═══════════════════════════════════════════════════════════════════
   Ticker
   ═══════════════════════════════════════════════════════════════════ */
.ticker {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-block: var(--rail);
  background: rgba(255, 45, 155, 0.06);
  padding-block: 0.6rem;
}

.ticker__track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: slide 38s linear infinite;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--hot-soft);
  white-space: nowrap;
}
.ticker__track span::before { content: "◆ "; color: var(--edge); }

@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ═══════════════════════════════════════════════════════════════════
   Section chrome
   ═══════════════════════════════════════════════════════════════════ */
.section {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(4rem, 10vw, 7rem) var(--gut) 0;
}

.section__head { max-width: 62ch; margin-bottom: clamp(2rem, 5vw, 3.2rem); }

.h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0.005em;
  color: #fff;
  text-shadow: 0 0 34px rgba(255, 45, 155, 0.35);
}

.section__lede { margin: 1.2rem 0 0; color: var(--text-dim); }
.section__lede code, .file__desc code {
  color: var(--ice);
  font-size: 0.92em;
}

/* ═══════════════════════════════════════════════════════════════════
   Hardware plates
   ═══════════════════════════════════════════════════════════════════ */
.plates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
}

.plate {
  margin: 0;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--deck), var(--void));
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.plate:hover {
  border-color: var(--hot);
  box-shadow: 0 20px 60px rgba(255, 45, 155, 0.2);
  transform: translateY(-4px);
}

.plate__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  position: relative;
}

.plate__btn::after {
  content: "⤢";
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  background: rgba(7, 3, 13, 0.72);
  color: var(--hot);
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.plate:hover .plate__btn::after,
.plate__btn:focus-visible::after { opacity: 1; }

.plate img {
  display: block;
  width: 100%;
  height: 270px;
  object-fit: contain;
  background: rgba(7, 3, 13, 0.55);
  padding: 0.9rem;
}

.plate figcaption {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--edge);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.plate__idx { color: var(--hot); margin-inline-end: 0.5rem; }

/* ═══════════════════════════════════════════════════════════════════
   Files
   ═══════════════════════════════════════════════════════════════════ */
.section--files { padding-bottom: clamp(4rem, 9vw, 6rem); }

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

.file {
  display: block;
  padding: 1.2rem 1.3rem 1.4rem;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: linear-gradient(180deg, var(--deck), rgba(7, 3, 13, 0.85));
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, box-shadow 0.22s ease, transform 0.18s ease;
}
.file:hover {
  color: inherit;
  border-color: var(--hot);
  box-shadow: 0 16px 44px rgba(255, 45, 155, 0.18);
  transform: translateY(-3px);
}

.file__kind {
  margin: 0 0 0.55rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--hot);
}

.file__name {
  margin: 0 0 0.6rem;
  font-family: var(--mono);
  font-size: 1.02rem;
  color: #fff;
  word-break: break-word;
}

.file__desc { margin: 0; font-size: 0.9rem; color: var(--text-dim); }

.file--accent { border-color: rgba(255, 45, 155, 0.55); background: rgba(255, 45, 155, 0.09); }

/* ═══════════════════════════════════════════════════════════════════
   Lightbox
   ═══════════════════════════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 5vw, 3rem);
  background: rgba(5, 2, 10, 0.9);
  backdrop-filter: blur(10px);
  animation: lb-in 0.18s ease-out;
}
.lightbox[hidden] { display: none; }

@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

.lightbox__figure {
  margin: 0;
  max-width: min(1000px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--deck-2), var(--void));
  box-shadow: 0 0 0 1px rgba(255, 45, 155, 0.2), 0 40px 120px rgba(255, 45, 155, 0.25);
  padding: clamp(0.9rem, 2vw, 1.4rem);
  overflow: hidden;
}

.lightbox__figure img {
  display: block;
  max-width: 100%;
  max-height: min(74vh, 780px);
  margin-inline: auto;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__figure figcaption {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
}

.lightbox__close {
  position: absolute;
  top: clamp(0.8rem, 3vw, 1.6rem);
  right: clamp(0.8rem, 3vw, 1.6rem);
  width: 42px;
  height: 42px;
  border: 1px solid var(--edge);
  border-radius: 3px;
  background: rgba(7, 3, 13, 0.8);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.lightbox__close:hover { color: var(--hot); border-color: var(--hot); }

/* ═══════════════════════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════════════════════ */
.footer {
  position: relative;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--edge);
  overflow: hidden;
}

/* the one moment of vaporwave horizon, kept to the very bottom */
.footer__horizon {
  position: absolute;
  inset: auto 0 0;
  height: 420px;
  background:
    linear-gradient(to top, rgba(255, 45, 155, 0.22), transparent 78%),
    repeating-linear-gradient(to right, rgba(255, 45, 155, 0.5) 0 1px, transparent 1px 58px),
    repeating-linear-gradient(to top,   rgba(255, 45, 155, 0.5) 0 1px, transparent 1px 30px);
  transform: perspective(240px) rotateX(70deg);
  transform-origin: bottom center;
  pointer-events: none;
  opacity: 0.85;
}

.footer__inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gut) clamp(6rem, 13vw, 9rem);
}

/* open source hardware block */
.oshw {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: clamp(1.2rem, 4vw, 2.4rem);
  align-items: start;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid var(--edge);
}

.oshw__gear {
  width: 104px;
  height: 104px;
  color: var(--hot);
  filter: drop-shadow(0 0 14px rgba(255, 45, 155, 0.65));
}

.oshw__title {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
}

.oshw__text { margin: 0; max-width: 60ch; color: var(--text-dim); font-size: 0.96rem; }

.oshw__clone { margin: 1rem 0 0; }
.oshw__clone code {
  display: inline-block;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: rgba(7, 3, 13, 0.7);
  font-size: 0.85rem;
  color: var(--ice);
  word-break: break-all;
}

@media (max-width: 620px) {
  .oshw { grid-template-columns: 1fr; }
  .oshw__gear { width: 76px; height: 76px; }
}

.footer__end {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem 2rem;
  margin-top: 2.2rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--edge);
}

.footer__mark {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  color: #fff;
  text-shadow: 0 0 22px rgba(255, 45, 155, 0.8);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer__links a { color: var(--text-dim); text-decoration: none; }
.footer__links a:hover { color: var(--hot); }

.footer__line {
  margin: 0;
  margin-inline-start: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════════════
   Motion preferences
   ═══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
  .dot { animation: none; }
  .plate:hover, .file:hover { transform: none; }
  .lightbox { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
