/* ============ DESIGN TOKENS ============ */
:root {
  --bg: #0c0f0a;
  --panel: #0e120a;
  --border: #232a1c;
  --accent: #b6ff2e;
  --text: #f2f5ec;
  --body: #c8d1bd;
  --dim: #5c6b4a;

  --font-display: 'Archivo', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Space Grotesk', system-ui, sans-serif;

  --section-pad-y: clamp(40px, 6vw, 60px);
  --section-pad-x: clamp(16px, 4vw, 32px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-body);
}

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

.hi { color: var(--accent); }
.hi.bold { font-weight: 700; }
.dim { color: var(--dim); }

.cli-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 6vw, 44px);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: -1px;
  margin: 0 0 26px;
}

.section {
  padding: var(--section-pad-y) var(--section-pad-x);
  border-bottom: 1px solid var(--border);
}
.section--last { border-bottom: none; }

/* one-shot scroll reveal, activated by main.js */
[data-reveal] {
  transition: opacity .7s ease, transform .7s ease;
}
[data-reveal].is-hidden {
  opacity: 0;
  transform: translateY(26px);
}

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none !important; }
  .ticker-track { animation: none !important; }
}

/* ============ PLACEHOLDER PHOTO SLOTS ============ */
/* Empty slots for photos not added yet — swap the element for an <img> when a photo is ready. */
.photo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(45deg, #11150c 0 12px, #161b10 12px 24px);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  padding: 8px;
}
.photo-slot--rounded { border-radius: 8px; }

/* ============ TOPBAR ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px clamp(16px, 4vw, 32px);
  background: rgba(12, 15, 10, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
}
.topbar-brand {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}
.topbar-nav {
  display: flex;
  gap: clamp(10px, 2.5vw, 22px);
  flex-wrap: wrap;
}
.topbar-nav a {
  color: var(--dim);
  text-decoration: none;
  transition: color .3s ease;
}
.topbar-nav a:hover { color: var(--accent); }
.topbar-clock { color: var(--dim); }

/* ============ HERO ============ */
.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  border-bottom: 1px solid var(--border);
}
.hero-intro {
  padding: clamp(40px, 7vw, 72px) clamp(16px, 4vw, 32px) clamp(36px, 5vw, 56px);
}
.hero-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(52px, 11vw, 86px);
  line-height: 0.95;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: -2px;
  margin: 0;
}
.cursor {
  color: var(--accent);
  animation: blink 1.2s step-end infinite;
}
.hero-name-cn {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 4vw, 34px);
  color: var(--accent);
  margin-top: 8px;
}
.hero-stats-block {
  font-family: var(--font-mono);
  font-size: clamp(12px, 2.8vw, 14px);
  color: var(--accent);
  margin-top: 24px;
  line-height: 2;
}

.hero-right {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}
.hero-portrait-row {
  flex: 1;
  min-height: 360px;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 28px);
  padding: clamp(18px, 3vw, 28px);
  flex-wrap: wrap;
}
.polaroid {
  width: min(46%, 225px);
  border: 1px solid #3a4430;
  background: var(--panel);
  transform: rotate(-2deg);
  box-shadow: 6px 6px 0 rgba(182, 255, 46, 0.12);
}
.polaroid-photo { aspect-ratio: 3/4; overflow: hidden; }
.polaroid-photo img { width: 100%; height: 100%; object-fit: cover; }
.polaroid-caption {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
}
.personnel-file {
  flex: 1;
  min-width: 150px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 2.1;
  color: var(--dim);
}
.personnel-file-title { color: var(--accent); margin-bottom: 6px; }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
}
.stat-cell {
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-cell:nth-child(odd) { border-right: 1px solid var(--border); }
.stat-cell:nth-child(n+3) { border-top: 1px solid var(--border); }
.stat-number {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  color: var(--text);
}
.stat-number--accent { color: var(--accent); }
.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  margin-top: 2px;
}
.pixel-canvas {
  width: min(100%, 175px);
  image-rendering: pixelated;
  margin-top: auto;
}
#px-bosses { width: min(100%, 150px); }
#px-racket { width: min(100%, 110px); }
#px-tea { width: min(100%, 140px); }

/* ============ TICKER ============ */
.ticker {
  background: var(--accent);
  overflow: hidden;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: marquee 18s linear infinite;
}
.ticker-group {
  display: flex;
  gap: 34px;
  padding-right: 34px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--bg);
  letter-spacing: 2px;
  white-space: nowrap;
}

/* ============ TIMELINE ============ */
.timeline { display: flex; flex-direction: column; }
.timeline-row {
  display: grid;
  grid-template-columns: minmax(84px, 110px) 1fr;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
}
.timeline-row--last { border-bottom: 1px solid var(--border); }
.timeline-year { font-size: 13px; color: var(--dim); }
.timeline-desc { font-size: 13px; color: var(--body); line-height: 1.6; }

/* ============ PHOTO WALL ============ */
.photo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: 140px;
  grid-auto-flow: dense;
  gap: 10px;
}
.photo-tile {
  overflow: hidden;
  border: 1px solid var(--border);
}
.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9);
  transition: transform .5s ease, filter .5s ease;
}
.photo-tile:hover img {
  transform: scale(1.05);
  filter: saturate(1.1);
}
.photo-tile--big { grid-column: span 2; grid-row: span 2; }
.photo-tile--tall { grid-row: span 2; }
.photo-tile--wide { grid-column: span 2; }
.photo-wall-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
  margin-top: 12px;
}

/* ============ FAMILY ============ */
.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.family-card {
  border: 1px solid var(--border);
  background: var(--panel);
}
.family-card--root { border-color: var(--accent); }
.family-card-photo { height: 220px; overflow: hidden; }
.family-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.family-card:hover .family-card-photo img { transform: scale(1.04); }
.family-card-body {
  padding: 18px 18px 22px;
  font-family: var(--font-mono);
}
.family-card-name { font-size: 17px; color: var(--text); font-weight: 700; }
.family-card-name--accent { color: var(--accent); }
.family-card-meta { font-size: 11px; color: var(--dim); margin-top: 4px; }
.family-card-bio {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--body);
  margin-top: 10px;
  line-height: 1.6;
}

/* ============ HOBBIES ============ */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.hobby-card {
  border: 1px solid var(--border);
  padding: 22px 20px;
  background: var(--panel);
  transition: border-color .3s ease;
}
.hobby-card:hover { border-color: var(--accent); }
.hobby-proc { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.hobby-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  color: var(--text);
  margin-top: 6px;
}
.hobby-title--accent { color: var(--accent); }
.hobby-desc {
  font-size: 13px;
  color: var(--body);
  margin-top: 8px;
  line-height: 1.6;
}

/* ============ CONTACT ============ */
.contact-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.contact-qr {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.contact-qr-box {
  width: 150px;
  height: 150px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.contact-qr-label { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.contact-info {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--body);
  line-height: 2.2;
}

/* ============ FOOTER ============ */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px clamp(16px, 4vw, 32px);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-cell:nth-child(odd) { border-right: none; }
  .stat-cell:nth-child(n+2) { border-top: 1px solid var(--border); }
}
