:root {
  --ink: #12101c;
  --ink-soft: #1a1729;
  --text: #e8e3d8;
  --text-dim: #9691a8;
  --accent: #e8b84b;
  --line: #2b2740;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink); /* fallback if WebGL2 isn't available */
  color: var(--text);
  font-family: 'Google Sans Code', monospace;
  line-height: 1.7;
}
#ink-bg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none; display: block;
}
h1, h2, h3 { font-family: 'Google Sans Code', monospace; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* nav — image banner with brand + link overlaid on top */
nav {
  position: relative; max-width: 900px; margin: 0 auto;
  overflow: hidden; border-radius: 4px;
}
.nav-bg { display: block; width: 100%; height: auto; }
.nav-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem 1.5rem;
  background: linear-gradient(rgba(18,16,28,0.5), rgba(18,16,28,0.55));
}
nav .brand { font-weight: 600; font-size: 1rem; color: var(--text); text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
nav .links { display: flex; gap: 1.5rem; font-size: 0.85rem; }
nav .links a { color: var(--text-dim); text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
nav .links a:hover, nav .links a.active { color: var(--accent); }

main { max-width: 700px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

/* info box — circular photo + bio, side by side */
.info-box {
  display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap;
  background: rgba(26,23,41,0.75); border: 1px solid var(--line); border-radius: 4px;
  padding: 1.5rem;
}
.info-photo {
  width: 120px; height: 120px; border-radius: 50%; overflow: hidden;
  flex-shrink: 0; position: relative;
  background: linear-gradient(160deg, var(--ink-soft), var(--ink));
  border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; color: var(--text-dim); text-align: center; padding: 0.5rem;
}
.info-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.info-bio { flex: 1; min-width: 220px; font-size: 0.9rem; }
.info-bio h1 { margin: 0 0 0.5rem; font-size: 1.2rem; color: var(--accent); }
.info-bio p { margin: 0; }

/* links box — footer-style block for credits, stamps, outbound links */
.links-box {
  margin-top: 1.5rem;
  background: rgba(26,23,41,0.75); border: 1px solid var(--line); border-radius: 4px;
  padding: 1.5rem; text-align: center; font-size: 0.85rem;
}
.links-box .stamps {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 0.4rem;
  margin-bottom: 1rem;
}
.links-box .stamps img {
  height: auto; width: auto; max-height: 60px; max-width: 140px; display: block;
  border: 1px solid var(--line);
}
.links-box p { margin: 0; color: var(--text-dim); }
.links-box a { color: var(--text-dim); }
.links-box a:hover { color: var(--accent); }

/* control panel injected by ink-bg.js (speed slider, cycle colors, reset) */
.ink-controls {
  position: fixed; bottom: 1rem; right: 1rem; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
  max-width: calc(100vw - 2rem); justify-content: flex-end;
  background: rgba(18, 16, 28, 0.8); border: 1px solid var(--line);
  padding: 0.5rem 0.8rem; border-radius: 3px;
  font-family: 'Google Sans Code', monospace; font-size: 0.75rem; color: var(--text-dim);
}
.ink-controls label { display: flex; align-items: center; gap: 0.4rem; }
.ink-controls input[type="range"] { width: 90px; accent-color: var(--accent); }
.color-cycle-btn {
  background: none; color: var(--text-dim);
  border: 1px solid var(--line); padding: 0.35rem 0.6rem;
  font-family: 'Google Sans Code', monospace; font-size: 0.75rem;
  cursor: pointer; border-radius: 3px;
}
.color-cycle-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ===== "Disable BG" fallback — a calm layered wave background, evoking
   the classic Wii Menu ripple effect, shown in place of the ink shader
   when toggled off. Pure CSS/SVG animation, no WebGL, near-zero cost. ===== */
.wave-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  display: none;
  background: linear-gradient(180deg, #4a8fc7 0%, #1d3f66 100%);
}
body.bg-disabled .wave-bg { display: block; }
body.bg-disabled #ink-bg { display: none; }
.wave-bg svg { position: absolute; bottom: 0; left: 0; width: 200%; height: 40vh; min-height: 220px; }
.wave-bg .wave1 { opacity: 0.55; animation: wave-scroll 16s linear infinite; }
.wave-bg .wave2 { opacity: 0.35; bottom: 3vh; animation: wave-scroll 11s linear infinite reverse; }
.wave-bg .wave3 { opacity: 0.22; bottom: 6vh; animation: wave-scroll 22s linear infinite; }
@keyframes wave-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
