@font-face {
  font-family: "Tiny5";
  src: url("assets/fonts/Tiny5.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #080a16;
  --bg-2: #0d1124;
  --panel: #131834;
  --panel-2: #1a2043;
  --line: #2b3260;
  --ink: #eef1ff;
  --muted: #9aa3cf;
  --lime: #a8f06a;
  --cyan: #6fe6ff;
  --pink: #ff7ac6;
  --gold: #ffd45e;
  --shadow: #04050d;
  --s: 0.6;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Tiny5", "Press Start 2P", "Courier New", monospace;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, #1b2450 0%, transparent 60%),
    linear-gradient(180deg, #0b1026 0%, var(--bg) 55%, #06070f 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  padding-bottom: 120px;
}

::selection { background: var(--pink); color: #0b0d1c; }

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  image-rendering: pixelated;
}

.crt {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px),
    radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  opacity: 0.55;
  mix-blend-mode: multiply;
}

/* ---------- topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(14px, 4vw, 40px);
  background: rgba(8, 10, 22, 0.82);
  backdrop-filter: blur(6px);
  border-bottom: 3px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--lime);
  color: #0b0d1c;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 4px 4px 0 var(--shadow);
}

.logo-text {
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 1px;
}

.nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
  align-items: center;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 18px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav a:hover { color: var(--ink); border-color: var(--pink); }

.ig-link {
  color: var(--ink) !important;
  background: var(--panel-2);
  padding: 4px 12px;
  border: 2px solid var(--line);
}

.ig-link:hover { border-color: var(--pink); }

.sound-btn {
  font-family: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--panel);
  border: 3px solid var(--line);
  padding: 6px 12px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--shadow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sound-btn:hover { border-color: var(--cyan); }
.sound-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.sound-btn[aria-pressed="true"] { background: var(--lime); color: #0b0d1c; border-color: #0b0d1c; }
.sound-btn .note { font-size: 20px; line-height: 1; }
.sound-btn[aria-pressed="true"] .note { animation: note-bounce 0.6s steps(2) infinite; }

@keyframes note-bounce {
  50% { transform: translateY(-3px); }
}

/* ---------- hero ---------- */

main { position: relative; z-index: 2; }

.hero {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(40px, 9vh, 96px) 20px 60px;
  text-align: center;
}

.kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  letter-spacing: 6px;
  font-size: 17px;
  text-transform: uppercase;
}

.title {
  margin: 0;
  font-size: clamp(60px, 15vw, 150px);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: clamp(4px, 1.4vw, 16px);
  color: #fff;
  text-shadow:
    4px 4px 0 #000,
    8px 8px 0 var(--pink),
    12px 12px 0 rgba(0, 0, 0, 0.55);
  animation: title-float 4.4s ease-in-out infinite;
}

@keyframes title-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.lead {
  max-width: 600px;
  margin: 26px auto 0;
  color: var(--muted);
  font-size: 21px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 19px;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  border: 3px solid var(--line);
  padding: 10px 20px;
  box-shadow: 6px 6px 0 var(--shadow);
  transition: transform 0.08s, box-shadow 0.08s, border-color 0.15s;
}

.btn:hover { border-color: var(--ink); transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--shadow); }
.btn:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--shadow); }

.btn-primary {
  background: var(--pink);
  color: #120818;
  border-color: #120818;
  font-weight: 600;
}

.chips {
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.chips li {
  font-size: 16px;
  color: var(--lime);
  border: 2px dashed rgba(168, 240, 106, 0.45);
  padding: 2px 10px;
}

/* ---------- marquee ---------- */

.marquee {
  overflow: hidden;
  border-top: 3px solid var(--line);
  border-bottom: 3px solid var(--line);
  background: rgba(19, 24, 52, 0.7);
  padding: 8px 0;
  margin: 20px 0 0;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 26s linear infinite;
  color: var(--lime);
  font-size: 17px;
  letter-spacing: 1px;
  white-space: nowrap;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- sections ---------- */

.section {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(40px, 7vh, 72px) 20px 0;
}

.section-head { text-align: center; margin-bottom: 30px; }

.section-head h2,
.about-text h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  letter-spacing: 2px;
  text-shadow: 3px 3px 0 #000, 6px 6px 0 rgba(255, 122, 198, 0.35);
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 19px;
}

/* ---------- subs grid ---------- */

.subs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.sub-card {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 24px 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  opacity: 0;
  transform: translateY(14px);
}

.sub-card.is-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s steps(4), transform 0.35s steps(4), box-shadow 0.12s, border-color 0.12s;
}

.sub-card:hover {
  border-color: var(--cyan);
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--shadow);
}

.sub-card:active { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--shadow); }

.sub-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  image-rendering: pixelated;
  border: 3px solid #0b0d1c;
  background: #0b0d1c;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.sub-body { min-width: 0; width: 100%; }

.sub-name {
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sub-handle {
  font-size: 16px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.sub-cta {
  border-style: dashed;
  text-decoration: none;
  color: var(--ink);
  background: rgba(19, 24, 52, 0.6);
}

.sub-cta:hover { border-color: var(--lime) !important; }

.cta-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  background: #0b0d1c;
  border: 3px dashed var(--lime);
  color: var(--lime);
  font-size: 34px;
  line-height: 1;
}

.subs-note {
  margin-top: 20px;
  text-align: center;
  font-size: 16px;
  color: var(--muted);
}

.subs-note code {
  color: var(--cyan);
  background: rgba(111, 230, 255, 0.08);
  padding: 1px 6px;
}

/* ---------- about ---------- */

.about-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: center;
  background: var(--panel);
  border: 3px solid var(--line);
  box-shadow: 8px 8px 0 var(--shadow);
  padding: 28px;
}

.portrait-frame {
  background: var(--bg-2);
  border: 3px solid var(--line);
  padding: 10px;
  box-shadow: inset 0 0 0 3px #0a0d1e;
}

.portrait-frame img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  animation: portrait-bob 3.2s steps(2) infinite;
}

@keyframes portrait-bob {
  50% { transform: translateY(-4px); }
}

.about-text p { color: var(--muted); margin: 12px 0 18px; }
.about-text h2 { margin-bottom: 6px; }

/* ---------- footer ---------- */

.footer {
  position: relative;
  z-index: 2;
  margin-top: 80px;
  padding: 26px 20px 60px;
  border-top: 3px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: center;
  color: var(--muted);
  font-size: 17px;
  background: rgba(8, 10, 22, 0.7);
}

.footer a { color: var(--cyan); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ---------- pet ---------- */

.ground {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46px;
  z-index: 25;
  background:
    repeating-linear-gradient(90deg, #1d2a1a 0 8px, #223020 8px 16px) 0 10px / 16px 16px,
    linear-gradient(180deg, #a8f06a 0 7px, #5f8f36 7px 10px, #24301f 10px 100%);
  border-top: 3px solid #0a0d1c;
  box-shadow: 0 -10px 0 rgba(0, 0, 0, 0.35);
}

.pet {
  position: fixed;
  left: 0;
  bottom: 40px;
  width: 168px;
  height: 245px;
  z-index: 40;
  pointer-events: none;
  will-change: transform;
}

.pet-flip,
.pet-scale {
  width: 100%;
  height: 100%;
  transform-origin: bottom center;
}

.pet-scale { transform: scale(var(--s)); }

.pet-bob { width: 100%; height: 100%; }

.sprite {
  width: 168px;
  height: 245px;
  background-image: url("assets/jonbek-sheet.png");
  background-size: 672px 980px;
  background-repeat: no-repeat;
  background-position: 0 0;
  image-rendering: pixelated;
  pointer-events: auto;
  cursor: pointer;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35));
}

.sprite.walking { animation: anim-walk 0.4s steps(4) infinite; }
.sprite.idle    { animation: anim-idle 2.6s steps(4) infinite; }
.sprite.wave    { animation: anim-wave 0.55s steps(4) infinite; }

@keyframes anim-walk {
  from { background-position: 0 -245px; }
  to   { background-position: -672px -245px; }
}

@keyframes anim-idle {
  from { background-position: 0 -490px; }
  to   { background-position: -672px -490px; }
}

@keyframes anim-wave {
  from { background-position: 0 -735px; }
  to   { background-position: -672px -735px; }
}

.pet-bob.walking { animation: bob 0.2s steps(2) infinite; }
@keyframes bob {
  50% { transform: translateY(-3px); }
}

.nameplate {
  position: absolute;
  left: 50%;
  bottom: calc(232px * var(--s));
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 21px;
  line-height: 1;
  letter-spacing: 1px;
  padding: 6px 12px 7px;
  white-space: nowrap;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.bubble {
  position: absolute;
  left: 50%;
  bottom: calc(232px * var(--s) + 34px);
  transform: translate(-50%, 6px) scale(0.9);
  background: #fff;
  color: #131126;
  font-size: 17px;
  padding: 6px 12px;
  border: 3px solid #0b0d1c;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.12s steps(2), transform 0.12s steps(2);
  white-space: nowrap;
}

.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: #fff;
  border-right: 3px solid #0b0d1c;
  border-bottom: 3px solid #0b0d1c;
  transform: rotate(45deg);
}

.bubble.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- responsive ---------- */

@media (max-width: 780px) {
  body { font-size: 17px; }
  .nav { gap: 12px; }
  .nav a { font-size: 15px; }
  .ig-link { display: none; }
  .logo-text { display: none; }
  .sound-btn { font-size: 14px; padding: 5px 9px; }
  .about-card { grid-template-columns: 1fr; text-align: center; }
  .portrait-frame { max-width: 220px; margin: 0 auto; }
  .hero { padding-bottom: 150px; }
  .chips { margin-top: 24px; }
  .sub-card { flex-direction: row; align-items: center; text-align: left; padding: 14px; gap: 12px; }
  .sub-avatar { width: 64px; height: 64px; flex: 0 0 64px; }
  .cta-avatar { width: 64px; height: 64px; flex: 0 0 64px; font-size: 28px; }
  .ground { height: 36px; }
  .pet { bottom: 30px; }
  .nameplate { font-size: 15px; padding: 5px 9px 6px; }
  .bubble { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .title, .marquee-track, .portrait-frame img { animation: none; }
  .crt { display: none; }
}
