/* ============================================================
   KING GNU FAN PAGE
   Palette: ink black / bone / signal amber / deep teal / rust
   Theme system: [data-theme="dark" | "light" | "green"] on <html>
   ============================================================ */

:root {
  --ink:          #0f0e10;
  --ink-soft:     #17161a;
  --bone:         #ede7da;
  --bone-dim:     #b9b3a6;
  --accent-amber: #e8a33d;
  --accent-teal:  #2f7d74;
  --accent-rust:  #c1502e;
  --accent-bone:  #ede7da;

  --font-display: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
  --font-body:    "Space Grotesk", "Zen Kaku Gothic New", sans-serif;
  --font-jp:      "Shippori Mincho", serif;

  --radius: 2px;
}

/* ---------- THEME: DARK (default) ---------- */
html[data-theme="dark"] {
  --bg:         var(--ink);
  --bg-raised:  var(--ink-soft);
  --text:       var(--bone);
  --text-dim:   var(--bone-dim);
  --accent:     var(--accent-amber);
  --accent-2:   var(--accent-teal);
  --border:     rgba(237, 231, 218, 0.14);
}

/* ---------- THEME: LIGHT ---------- */
html[data-theme="light"] {
  --bg:         var(--bone);
  --bg-raised:  #ffffff;
  --text:       var(--ink);
  --text-dim:   #5a564e;
  --accent:     var(--accent-rust);
  --accent-2:   var(--accent-teal);
  --border:     rgba(15, 14, 16, 0.12);
}

/* ---------- THEME: GREEN (troll mode — deliberately hideous) ---------- */
html[data-theme="green"] {
  --bg:         #00ff00;
  --bg-raised:  #ccff00;
  --text:       #ff00ff;
  --text-dim:   #0000ff;
  --accent:     #ff0000;
  --accent-2:   #ffff00;
  --border:     #ff00ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  transition: background-color .25s ease, color .25s ease;
}

body {
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

/* ============ HEADER ============ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 6vw;
  border-bottom: 1px solid var(--border);
}

.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wordmark-en {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(20px, 2.6vw, 28px);
  letter-spacing: 0.04em;
}
.wordmark-jp {
  font-family: var(--font-jp);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  margin-top: 2px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s ease, transform .15s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:active { transform: scale(0.97); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.theme-toggle-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ============ HERO ============ */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 6vw;
  align-items: center;
  padding: 9vw 6vw 7vw;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 18px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(38px, 5.6vw, 74px);
  line-height: 1.03;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
}

.hero-sub {
  max-width: 46ch;
  font-size: 17px;
  color: var(--text-dim);
  margin: 0;
}

.hero-photo-frame {
  aspect-ratio: 4 / 5;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--bg-raised);
}

.hero-photo { width: 100%; height: 100%; object-fit: contain; }

.hero-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 20px;
  background:
    repeating-linear-gradient(
      45deg,
      transparent, transparent 10px,
      var(--border) 10px, var(--border) 11px
    );
}
.placeholder-hint {
  font-family: monospace;
  font-size: 11px;
  opacity: 0.7;
}

/* ============ SECTION SHELL ============ */
.section {
  padding: 5vw 6vw;
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 2.4em;
}

/* ============ BIO ============ */
.bio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3.5vw;
}

.bio-text { margin: 0; color: var(--text-dim); font-size: 16px; }
.hl { color: var(--accent); font-weight: 600; }

/* ============ MIXTURE METER ============ */
.mixture-intro {
  max-width: 60ch;
  color: var(--text-dim);
  margin: 0 0 2.6em;
}

.mixture-meter { display: flex; flex-direction: column; gap: 20px; max-width: 700px; }

.mixture-row {
  display: grid;
  grid-template-columns: 170px 1fr 46px;
  align-items: center;
  gap: 16px;
}

.mixture-tag {
  font-size: 14px;
  color: var(--text);
}

.mixture-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  overflow: hidden;
}

.mixture-fill {
  height: 100%;
  width: var(--pct);
  background: var(--hue);
  border-radius: 999px;
  transform-origin: left;
  animation: fillbar 1.1s ease-out;
}

@keyframes fillbar {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.mixture-pct {
  font-size: 13px;
  color: var(--text-dim);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============ FACTS ============ */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.fact-card {
  background: var(--bg);
  padding: 2.2em;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fact-index {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  color: var(--accent-2);
}

.fact-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}

.fact-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14.5px;
}

/* ============ FOOTER ============ */
.site-footer {
  padding: 3em 6vw 4em;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 14vw; }
  .hero-photo-frame { order: -1; aspect-ratio: 16/10; }
  .bio-grid { grid-template-columns: 1fr; gap: 1.4em; }
  .facts-grid { grid-template-columns: 1fr; }
  .mixture-row { grid-template-columns: 110px 1fr 40px; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ================================================================
   GREEN "TROLL" MODE OVERRIDES — deliberately, aggressively ugly.
   Comic Sans, clashing neon, marquee-style motion, rotated cards,
   rainbow dashed borders. This is the joke mode. Enjoy the pain.
   ================================================================ */
html[data-theme="green"] body {
  font-family: "Comic Sans MS", "Comic Sans", cursive !important;
  cursor: crosshair;
}

html[data-theme="green"] .wordmark-en,
html[data-theme="green"] .hero-title,
html[data-theme="green"] .section-label,
html[data-theme="green"] .fact-card h3 {
  font-family: "Comic Sans MS", "Comic Sans", cursive !important;
}

html[data-theme="green"] .site-header {
  border-bottom: 6px dashed magenta;
  background: repeating-linear-gradient(
    90deg, #00ff00, #00ff00 20px, #ccff00 20px, #ccff00 40px
  );
}

html[data-theme="green"] .wordmark-en {
  color: #ff00ff;
  text-shadow: 3px 3px 0 #ffff00, -2px -2px 0 #0000ff;
  animation: troll-shake 0.4s infinite;
}

html[data-theme="green"] .wordmark-jp { color: #0000ff; }

html[data-theme="green"] .theme-toggle {
  background: #ff0000;
  color: #ffff00;
  border: 4px dotted #0000ff;
  border-radius: 0;
  font-weight: bold;
  animation: troll-wiggle 0.8s infinite;
}

html[data-theme="green"] .hero-title {
  color: #ff0000;
  text-shadow: 4px 4px 0 #ffff00, -3px -3px 0 #0000ff, 0 0 20px #ff00ff;
  transform: rotate(-1.5deg);
}

html[data-theme="green"] .eyebrow {
  color: #0000ff;
  background: #ffff00;
  display: inline-block;
  padding: 4px 10px;
  transform: rotate(2deg);
}

html[data-theme="green"] .hero-sub { color: #000080; font-weight: bold; }

html[data-theme="green"] .hero-photo-frame {
  border: 8px ridge #ff00ff;
  transform: rotate(1deg);
  box-shadow: 0 0 0 4px #ffff00, 0 0 30px 6px #ff0000;
}

html[data-theme="green"] .hero-photo-placeholder {
  color: #ff0000;
  font-weight: bold;
  background: repeating-linear-gradient(
    45deg, #ccff00, #ccff00 10px, #ff00ff 10px, #ff00ff 20px
  );
}

html[data-theme="green"] .section {
  border-top: 6px dashed #ff00ff;
}

html[data-theme="green"] .section-label {
  color: #ff0000;
  background: #ffff00;
  display: inline-block;
  padding: 3px 12px;
  transform: rotate(-2deg);
  text-shadow: none;
}

html[data-theme="green"] .hl {
  color: #0000ff;
  background: #ffff00;
  font-weight: bold;
}

html[data-theme="green"] .bio-text,
html[data-theme="green"] .mixture-intro,
html[data-theme="green"] .mixture-tag,
html[data-theme="green"] .site-footer {
  color: #ff00ff;
  font-weight: bold;
}

html[data-theme="green"] .mixture-bar {
  border: 3px dotted #ff0000;
  border-radius: 0;
  background: #ffff00;
}

html[data-theme="green"] .mixture-pct { color: #0000ff; font-weight: bold; }

html[data-theme="green"] .facts-grid {
  background: #ff00ff;
  border: 6px double #ff0000;
}

html[data-theme="green"] .fact-card {
  background: #ccff00;
  transform: rotate(-1deg);
}
html[data-theme="green"] .fact-card:nth-child(even) { transform: rotate(1deg); }

html[data-theme="green"] .fact-card h3 {
  color: #ff0000;
  text-shadow: 2px 2px 0 #0000ff;
}

html[data-theme="green"] .fact-card p { color: #000080; font-weight: bold; }
html[data-theme="green"] .fact-index { color: #ff00ff; text-shadow: 1px 1px 0 #000; }

@keyframes troll-shake {
  0%, 100% { transform: rotate(-1deg); }
  50%      { transform: rotate(1deg); }
}

@keyframes troll-wiggle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.06) rotate(-3deg); }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="green"] .wordmark-en,
  html[data-theme="green"] .theme-toggle {
    animation: none !important;
  }
}