/* ═══════════════════════════════════════════════════════════════════
   joeyv23.neocities.org — the porch view
   obsidian night · earned gold · bone text · one cyan thread
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Theme Variables ─────────────────────────────────────────── */
:root {
  --bg:             #060810;
  --bg-subtle:      #05070d;
  --bg-card:        rgba(12, 14, 24, 0.72);
  --bg-card-hover:  rgba(14, 17, 30, 0.95);
  --bg-nav:         #10141f;
  --bg-overlay:     rgba(5, 6, 12, 0.5);
  --bg-overlay-deep:rgba(5, 6, 12, 0.88);

  --text:           #c9c5b4;
  --text-muted:     #79776a;
  --text-card:      #98948a;

  --heading:        #e8c56a;
  --heading-glow:   rgba(232, 197, 106, 0.32);
  --h3:             #d9b45a;

  --link:           #4fc3f7;
  --link-hover:     #81d4fa;
  --link-glow:      rgba(79, 195, 247, 0.5);
  --link-visited:   #4db6ac;

  --accent:         #8a7440;
  --accent-hover:   #b3924f;
  --violet:         #a78bfa;

  --marquee:        #e8c56a;
  --deco:           #8a7440;

  --rainbow: linear-gradient(90deg, #e8c56a, #f2dda0, #c9c5b4, #4fc3f7, #a78bfa, #e8c56a);

  --field-opacity:  1;

  --aurora-opacity: 1;
  --aurora-1:       rgba(45, 212, 191, 0.20);
  --aurora-2:       rgba(232, 197, 106, 0.13);
  --aurora-3:       rgba(167, 139, 250, 0.16);
  --aurora-4:       rgba(79, 195, 247, 0.11);
}

/* ─── Font ─────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Press Start 2P';
  src: url('../fonts/PressStart2P.woff2') format('woff2');
  font-display: swap;
}

/* ─── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(14px, 1.8vw, 16px);
  line-height: 1.7;
  color: var(--text);
  background: linear-gradient(180deg, #04050b 0%, #070a13 45%, #101627 100%) fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── The Night (layered fixed backdrop) ──────────────────────── */
#sky-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  opacity: var(--aurora-opacity);
  transition: opacity 0.5s;
}

.aurora-bg::before,
.aurora-bg::after {
  content: '';
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
}

.aurora-bg::before {
  background:
    radial-gradient(ellipse 40% 12% at 25% 30%, var(--aurora-1), transparent 70%),
    radial-gradient(ellipse 35% 16% at 75% 40%, var(--aurora-2), transparent 65%);
  filter: blur(50px);
  animation: aurora-drift-1 30s ease-in-out infinite alternate;
}

.aurora-bg::after {
  background:
    radial-gradient(ellipse 50% 10% at 55% 26%, var(--aurora-3), transparent 65%),
    radial-gradient(ellipse 30% 14% at 15% 44%, var(--aurora-4), transparent 60%);
  filter: blur(60px);
  animation: aurora-drift-2 38s ease-in-out infinite alternate;
}

@keyframes aurora-drift-1 {
  0%   { transform: translate(0%, 0%) rotate(0deg); }
  33%  { transform: translate(4%, -2%) rotate(1.5deg); }
  66%  { transform: translate(-2%, 3%) rotate(-1deg); }
  100% { transform: translate(3%, -4%) rotate(2deg); }
}

@keyframes aurora-drift-2 {
  0%   { transform: translate(0%, 0%) rotate(0deg); }
  33%  { transform: translate(-3%, 2%) rotate(-1.5deg); }
  66%  { transform: translate(5%, -1%) rotate(1deg); }
  100% { transform: translate(-4%, 3%) rotate(-2deg); }
}

.field-bg {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: min(44vh, 520px);
  background: url('../img/field.svg') bottom center / cover no-repeat;
  opacity: var(--field-opacity);
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.5s;
}

#firefly-canvas {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* Content rides above the night */
header, nav, main, footer {
  position: relative;
  z-index: 4;
}

/* ─── Layout ───────────────────────────────────────────────────── */
header, nav, section, footer {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 2rem);
}

/* ─── Links ────────────────────────────────────────────────────── */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}

a:hover {
  color: var(--link-hover);
  text-shadow: 0 0 8px var(--link-glow);
}

a:visited {
  color: var(--link-visited);
}

/* ─── Headings ─────────────────────────────────────────────────── */
h1, h2, h3, nav, .nav-btn, .bmc-link, code, .badge-url {
  font-family: 'Press Start 2P', monospace;
}

h2 {
  font-size: clamp(12px, 2vw, 16px);
  color: var(--heading);
  margin-bottom: 1rem;
  text-shadow: 0 0 10px var(--heading-glow);
}

h3 {
  font-size: clamp(10px, 1.5vw, 12px);
  color: var(--h3);
  margin-bottom: 0.5rem;
}

/* ─── Header ───────────────────────────────────────────────────── */
header {
  text-align: center;
  padding-top: 2rem;
}

.header-deco {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 4px;
  margin-bottom: 0.5rem;
}

.rainbow-title {
  font-size: clamp(24px, 5vw, 48px);
  background: var(--rainbow);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbow-scroll 6s linear infinite;
  margin-bottom: 0.75rem;
  text-shadow: none;
}

@keyframes rainbow-scroll {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.marquee-container {
  overflow: hidden;
  border-top: 1px dashed var(--accent);
  border-bottom: 1px dashed var(--accent);
  padding: 0.5rem 0;
  margin: 0.75rem 0;
  white-space: nowrap;
}

.marquee-text {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(8px, 1.2vw, 10px);
  color: var(--marquee);
  animation: scroll-marquee 26s linear infinite;
}

@keyframes scroll-marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.construction-gif {
  display: block;
  margin: 0.5rem auto;
  image-rendering: pixelated;
}

.music-row {
  margin-top: 0.5rem;
}

#music-toggle {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 0.4rem 0.8rem;
  color: var(--text);
  background: var(--bg-nav);
  border: 2px solid var(--accent);
  cursor: pointer;
}

#music-toggle:hover {
  border-color: var(--accent-hover);
  color: var(--heading);
}

/* ─── Nav ──────────────────────────────────────────────────────── */
#main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 0;
  padding-bottom: 0;
}

.nav-btn {
  display: inline-block;
  font-size: 10px;
  padding: 0.5rem 1rem;
  color: var(--text) !important;
  background: var(--bg-nav);
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none !important;
  -webkit-text-fill-color: var(--text);
}

.nav-btn:hover {
  background: var(--accent);
  color: var(--bg) !important;
  -webkit-text-fill-color: var(--bg);
  box-shadow: 0 0 12px var(--accent);
  transform: translateY(-2px);
}

/* ─── Kintsugi seams (dividers) ───────────────────────────────── */
.kintsugi {
  max-width: 800px;
  height: 18px;
  margin: 0.4rem auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='800' height='16' viewBox='0 0 800 16'%3E%3Cpath d='M0,9 L64,7.5 L118,10 L169,6 L243,9.5 L305,7 L342,10.5 L418,6.5 L472,9 L534,7.5 L581,10 L642,6.5 L706,9.5 L757,8 L800,9' fill='none' stroke='%23e8c56a' stroke-width='1.1' opacity='0.8'/%3E%3Cpath d='M169,6 L162,2 M418,6.5 L424,13 M642,6.5 L636,12 M243,9.5 L247,14' stroke='%23e8c56a' stroke-width='0.8' opacity='0.45' fill='none'/%3E%3Ccircle cx='305' cy='7' r='1.6' fill='%23f2dda0'/%3E%3Ccircle cx='534' cy='7.5' r='1.2' fill='%23f2dda0'/%3E%3Ccircle cx='118' cy='10' r='1' fill='%23f2dda0'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 4px rgba(232, 197, 106, 0.35));
  opacity: 0.85;
}

/* ─── Vortex Player Section ───────────────────────────────────── */
#player {
  text-align: center;
}

.player-tagline {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1rem;
}

#vortex-container {
  position: relative;
  width: 100%;
  max-width: 720px;
  height: 420px;
  margin: 0 auto 1rem;
  border: 2px solid var(--accent);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(232, 197, 106, 0.18);
}

#vortex-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

#vortex-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay);
  cursor: pointer;
  transition: opacity 0.3s;
}

#vortex-overlay span {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--heading);
  text-shadow: 0 0 10px var(--heading-glow);
  padding: 0.6rem 1.2rem;
  border: 2px solid var(--heading);
  background: var(--bg-overlay-deep);
}

#vortex-overlay:hover span {
  background: var(--heading);
  color: var(--bg);
  box-shadow: 0 0 12px var(--heading);
}

.player-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── About ────────────────────────────────────────────────────── */
.about-content p {
  margin-bottom: 1rem;
}

.about-content strong {
  color: var(--heading);
}

.about-content em {
  color: var(--violet);
  font-style: italic;
}

/* ─── Hall of Ages flagship ───────────────────────────────────── */
.flagship-card {
  display: block;
  padding: 1.4rem 1.5rem;
  background:
    linear-gradient(160deg, rgba(232, 197, 106, 0.07), rgba(12, 14, 24, 0.85) 45%),
    var(--bg-card);
  border: 2px solid var(--heading);
  box-shadow: 0 0 24px rgba(232, 197, 106, 0.15), inset 0 0 40px rgba(0, 0, 0, 0.4);
  text-decoration: none !important;
  transition: all 0.25s;
}

.flagship-card:hover {
  box-shadow: 0 0 34px rgba(232, 197, 106, 0.35), inset 0 0 40px rgba(0, 0, 0, 0.35);
  transform: translateY(-3px);
}

.flagship-card h3 {
  color: var(--heading);
  font-size: clamp(12px, 1.8vw, 15px);
  margin-bottom: 0.6rem;
  text-shadow: 0 0 10px var(--heading-glow);
}

.flagship-card .flagship-stats {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--violet);
  letter-spacing: 1px;
  margin-bottom: 0.7rem;
}

.flagship-card p {
  font-size: 14px;
  color: var(--text-card);
  line-height: 1.6;
}

.flagship-card .enter {
  display: inline-block;
  margin-top: 0.8rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--heading);
  border-bottom: 1px dashed var(--heading);
  padding-bottom: 2px;
}

/* ─── Writing ──────────────────────────────────────────────────── */
.post {
  margin-bottom: 2rem;
  padding: 1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
}

.post h3 {
  margin-bottom: 0.25rem;
}

.post time {
  display: block;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.post p {
  margin-bottom: 0.75rem;
}

.post p:last-child {
  margin-bottom: 0;
}

.post.elsewhere {
  border-left-color: var(--violet);
}

.post.elsewhere ul {
  list-style: none;
  margin: 0.5rem 0 0.75rem;
}

.post.elsewhere li {
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.3rem;
}

.post.elsewhere li::before {
  content: '\2726';
  position: absolute;
  left: 0;
  color: var(--heading);
  font-size: 11px;
}

/* ─── Projects Grid ────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.project-card {
  display: block;
  padding: 1rem;
  background: var(--bg-card);
  border: 2px solid var(--card-color, var(--accent));
  transition: all 0.2s;
  text-decoration: none !important;
}

.project-card:hover {
  background: var(--bg-card-hover);
  box-shadow: 0 0 16px var(--card-color, var(--accent)), inset 0 0 30px rgba(0, 0, 0, 0.3);
  transform: translateY(-3px);
}

.project-card h3 {
  color: var(--card-color, var(--h3));
  margin-bottom: 0.4rem;
}

.project-card p {
  font-size: 13px;
  color: var(--text-card);
  line-height: 1.5;
}

/* ─── Tamagotchi ───────────────────────────────────────────────── */
#pet {
  text-align: center;
}

#tamagotchi-container {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: 440px;
  margin: 0 auto 0.8rem;
  border: 2px solid var(--accent);
  border-radius: 4px;
  overflow: hidden;
  background: #000033;
}

#tama-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#tama-power {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(155, 188, 15, 0.06), transparent 60%),
    var(--bg-overlay-deep);
  z-index: 5;
}

#tama-power.off {
  display: none;
}

.tama-note {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.tama-btns {
  display: none;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.tama-btns.on {
  display: flex;
}

/* ─── Sidebar ──────────────────────────────────────────────────── */
.sidebar-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.sidebar-box {
  flex: 1 1 200px;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--accent);
}

.badge-wall {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.75rem;
}

.badge-wall img {
  image-rendering: pixelated;
  display: block;
}

.badge-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 31px;
  font-size: 9px;
  color: var(--text-muted);
  border: 1px dashed var(--accent);
  text-align: center;
  line-height: 1.2;
}

.badge-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.badge-url {
  display: block;
  font-size: 8px;
  color: var(--heading);
  word-break: break-all;
  background: var(--bg-subtle);
  padding: 0.5rem;
  border: 1px dashed var(--accent);
}

.bmc-link {
  display: inline-block;
  font-size: 10px;
  padding: 0.6rem 1rem;
  color: var(--heading) !important;
  -webkit-text-fill-color: var(--heading);
  border: 2px solid var(--heading);
  background: var(--bg-subtle);
  text-decoration: none !important;
  transition: all 0.15s;
}

.bmc-link:hover {
  background: var(--heading);
  color: var(--bg) !important;
  -webkit-text-fill-color: var(--bg);
  box-shadow: 0 0 12px var(--heading-glow);
}

.aurora-ascii {
  font-family: monospace;
  font-size: 11px;
  line-height: 1.15;
  overflow: hidden;
  user-select: none;
}

.webring-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 12px;
}

.webring-name {
  color: var(--text-muted);
  font-size: 11px;
}

.webring-link[aria-disabled="true"] {
  color: var(--text-muted);
  opacity: 0.5;
  cursor: default;
}

/* ─── Footer ───────────────────────────────────────────────────── */
footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 3rem;
}

footer p {
  margin-bottom: 0.4rem;
}

.blink {
  animation: blink-anim 1.2s steps(2, start) infinite;
}

@keyframes blink-anim {
  to { visibility: hidden; }
}

.awooo {
  margin-top: 1.2rem;
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(232, 197, 106, 0.28);
  cursor: default;
}

.awooo:hover {
  color: rgba(232, 197, 106, 0.6);
  text-shadow: 0 0 8px rgba(232, 197, 106, 0.3);
}

/* ─── Reduced Motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .rainbow-title,
  .marquee-text,
  .aurora-bg::before,
  .aurora-bg::after,
  .blink {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  #vortex-container {
    height: 320px;
  }
  #tamagotchi-container {
    height: 360px;
  }
  .field-bg {
    height: 34vh;
    background-position: 12% bottom;
  }
  .sidebar-columns {
    flex-direction: column;
  }
}
