/* ═══════════════════════════════════════════════════════════
   Nako Moon — VTuber & Japanese Teacher portal
   Warm study atmosphere · moon motif · gentle teacher
   Brand-flexible: cozy / academy / cafe
   ═══════════════════════════════════════════════════════════ */

:root {
  --cream: #fdf8f2;
  --paper: #f6efe6;
  --paper-deep: #ebe2d6;
  --ink: #3d342c;
  --ink-soft: #6b5f54;
  --ink-faint: #9a8f84;
  --night: #3d4f6f;
  --night-deep: #2c3a52;
  --moon: #c9a87c;
  --moon-light: #e8d4b8;
  --moon-glow: rgba(201, 168, 124, 0.35);
  --lavender: #b8a9c9;
  --lavender-soft: #e8e0f0;
  --lavender-deep: #8b7aa8;
  --rose: #d4a5a5;
  --rose-soft: #f5e4e4;
  --rose-deep: #b08080;
  --cocoa: #6b5344;
  --cocoa-soft: #8b7260;
  --teal: #7eb8b8;
  --twitch: #9146ff;
  --youtube: #e03e3e;
  --line: rgba(61, 52, 44, 0.1);
  --line-strong: rgba(61, 52, 44, 0.18);
  --shadow-sm: 0 2px 12px rgba(61, 52, 44, 0.06);
  --shadow: 0 8px 32px rgba(61, 52, 44, 0.1);
  --shadow-lg: 0 20px 56px rgba(61, 52, 44, 0.14);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --nav-h: 76px;
  --font-display: "Cormorant Garamond", "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
  --font-body: "Nunito", "Noto Sans JP", "Yu Gothic", "Hiragino Sans", system-ui, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.3s var(--ease);
  --link-hover: var(--cocoa);
  --nav-hover-bg: rgba(184, 169, 201, 0.15);
  --nav-hover-text: var(--ink);
  --tab-hover-bg: var(--night);
  --tab-hover-text: var(--cream);
  --card-hover-bg: #fff;
  --featured-hover-bg: linear-gradient(145deg, var(--night-deep) 0%, var(--night) 100%);
  --featured-hover-border: var(--moon);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body[data-lang="jp"] { font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Sans", var(--font-body); }

[data-i18n][hidden] { display: none !important; }

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

a {
  color: var(--night);
  text-decoration: none;
  transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

a:not(.btn):not(.portal__card):not(.media-item):hover {
  color: var(--link-hover);
}

/* ── Atmospheric background ── */
.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--hero-gradient,
    linear-gradient(180deg, var(--cream) 0%, var(--paper) 46%, var(--cream) 100%));
}

.sky-stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.24;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 12%, rgba(61, 79, 111, 0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 22% 38%, rgba(61, 79, 111, 0.25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 8%, rgba(201, 168, 124, 0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 68% 22%, rgba(61, 79, 111, 0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 45%, rgba(61, 79, 111, 0.25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 55% 65%, rgba(184, 169, 201, 0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 12% 78%, rgba(61, 79, 111, 0.2) 0%, transparent 100%);
  pointer-events: none;
}

.sky-petals {
  display: none;
}

.sky-petals::before,
.sky-petals::after {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background-image:
    radial-gradient(ellipse 6px 4px at 10% 20%, rgba(212, 165, 165, 0.5) 0%, transparent 100%),
    radial-gradient(ellipse 5px 3px at 35% 65%, rgba(184, 169, 201, 0.4) 0%, transparent 100%),
    radial-gradient(ellipse 4px 3px at 72% 30%, rgba(201, 168, 124, 0.35) 0%, transparent 100%),
    radial-gradient(ellipse 5px 4px at 88% 78%, rgba(212, 165, 165, 0.35) 0%, transparent 100%);
  animation: petal-drift 90s linear infinite;
}

.sky-petals::after {
  animation-duration: 120s;
  animation-direction: reverse;
  opacity: 0.6;
}

@keyframes petal-drift {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(8%) rotate(12deg); }
}

/* Scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 250;
  background: transparent;
  pointer-events: none;
}

.scroll-progress__bar {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--lavender), var(--moon), var(--rose));
  box-shadow: 0 0 12px var(--moon-glow);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

/* ── Layout ── */
.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

.section {
  padding: clamp(72px, 11vw, 128px) 0;
  position: relative;
}

.section--alt {
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 240, 223, 0.78) 18%, rgba(255, 247, 238, 0.86) 82%, transparent 100%);
}

.section-divider {
  height: 64px;
  margin: -20px 0;
  background:
    linear-gradient(90deg, transparent, rgba(213, 154, 78, 0.34), rgba(233, 143, 162, 0.22), rgba(159, 138, 198, 0.28), transparent);
  opacity: 0.9;
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

.section--night {
  background: var(--section-night-bg, linear-gradient(165deg, var(--night-deep) 0%, var(--night) 100%));
  color: var(--cream);
}

.section--night a { color: var(--moon-light); }
.section--night a:hover { color: #fff; }

/* Section headers */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lavender-deep);
  margin-bottom: 14px;
}

.eyebrow::before,
.eyebrow::after {
  content: "✦";
  font-size: 9px;
  opacity: 0.55;
}

.section--night .eyebrow { color: var(--moon-light); }

.headline {
  font-family: var(--font-display);
  font-size: clamp(32px, 5.5vw, 52px);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
  color: var(--headline-color, var(--ink));
}

.section--night .headline { color: var(--cream); }

.lead {
  font-size: clamp(16px, 2vw, 18px);
  color: var(--ink-soft);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.75;
}

.section--night .lead { color: rgba(253, 248, 242, 0.88); }

.section-head {
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 64px);
}

.section-head .lead { margin: 0 auto; }

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 clamp(16px, 4vw, 40px);
  transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(255, 250, 244, 0.96);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav__brand {
  display: flex;
  flex-direction: column;
  gap: 0;
  color: var(--nav-brand-color, var(--ink));
  flex-shrink: 0;
}

.nav__brand:hover { color: var(--nav-brand-color, var(--ink)); }

.nav__name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
}

.nav__space {
  font-size: 11px;
  font-weight: 600;
  color: var(--nav-space-color, var(--lavender-deep));
  letter-spacing: 0.06em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav__links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--nav-link-color, var(--ink-soft));
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  transition: color var(--transition), background var(--transition);
}

.nav__links a:hover,
.nav__links a.is-active {
  color: var(--nav-hover-text);
  background: var(--nav-hover-bg);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: flex;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 3px;
}

.lang-switch button {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.lang-switch button.is-on {
  background: var(--night);
  color: var(--cream);
}

.nav__menu-btn {
  display: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: linear-gradient(135deg, var(--night) 0%, var(--night-deep) 100%);
  color: var(--cream) !important;
  box-shadow: 0 4px 16px rgba(44, 58, 82, 0.25);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(44, 58, 82, 0.3);
  color: var(--cream) !important;
}

.btn--moon {
  background: linear-gradient(135deg, var(--moon) 0%, #b89568 100%);
  color: var(--ink) !important;
  box-shadow: 0 4px 16px var(--moon-glow);
}

.btn--moon:hover {
  transform: translateY(-2px);
  color: var(--ink) !important;
}

.btn--ghost {
  background: #fff;
  color: var(--ink) !important;
  border: 1px solid var(--line-strong);
}

.btn--ghost:hover {
  background: #fff;
  border-color: var(--lavender);
}

.btn--soft {
  background: var(--lavender-soft);
  color: var(--night) !important;
  border: 1px solid rgba(139, 122, 168, 0.2);
}

.btn--soft:hover { background: #ddd4eb; }

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: min(820px, calc(100vh - 64px));
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
  padding: calc(var(--nav-h) + 34px) clamp(20px, 5vw, 48px) 36px;
  max-width: 1180px;
  margin: 0 auto;
}

.hero::before {
  display: none;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(61, 52, 44, 0.07);
}

.hero__badge.is-live {
  border-color: rgba(145, 70, 255, 0.35);
  background: rgba(145, 70, 255, 0.08);
  color: #7c3aed;
}

.hero__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.hero__badge.is-live .hero__dot {
  background: #ef4444;
  animation: breathe 2s ease infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 84px);
  font-weight: 600;
  line-height: 1.02;
  margin: 0 0 4px;
  color: var(--hero-title-color, var(--ink));
}

.hero__jp {
  display: block;
  font-size: clamp(28px, 4.5vw, 42px);
  color: var(--hero-jp-color, var(--lavender-deep));
  margin-top: 4px;
  font-weight: 500;
}

.hero__space {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 28px);
  font-style: italic;
  color: var(--hero-space-color, var(--cocoa-soft));
  margin: 8px 0 20px;
}

.hero__welcome {
  font-size: 17px;
  color: var(--hero-welcome-color, var(--ink-soft));
  line-height: 1.75;
  max-width: 480px;
  margin-bottom: 28px;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.chip strong {
  color: var(--ink);
  font-weight: 800;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.hero__visual {
  position: relative;
  display: flex;
  justify-content: stretch;
  align-items: center;
}

.hero-card {
  width: min(100%, 468px);
  margin-left: auto;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 250, 244, 0.98) 100%);
  border: 1px solid rgba(213, 154, 78, 0.24);
  border-radius: 18px;
  padding: clamp(20px, 3vw, 28px);
  box-shadow: 0 26px 68px rgba(47, 77, 119, 0.18);
  color: var(--ink);
}

.hero-card__identity {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
}

.hero-card__identity img {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 14px 28px rgba(47, 77, 119, 0.18);
}

.hero-card__kicker {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lavender-deep);
}

.hero-card__identity strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 38px);
  font-weight: 700;
  line-height: 1;
  color: var(--night);
}

.hero-card__identity small {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.35;
}

.hero-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.hero-metric {
  display: block;
  min-width: 0;
  border-radius: 14px;
  padding: 13px 12px;
  background: #fff7ef;
  border: 1px solid rgba(213, 154, 78, 0.2);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(61, 52, 44, 0.06);
}

.hero-metric:hover {
  transform: translateY(-3px);
  background: #fff;
  color: var(--ink);
  border-color: var(--metric-accent, var(--moon));
  box-shadow: 0 12px 28px rgba(47, 77, 119, 0.14);
}

.hero-metric > span {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 700;
  line-height: 1;
  color: var(--metric-accent, var(--night));
}

.hero-metric small {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero-metric--youtube { --metric-accent: var(--youtube); }
.hero-metric--twitter { --metric-accent: #0f1419; }
.hero-metric--discord { --metric-accent: #5865f2; }

.hero-card__schedule {
  display: block;
  margin-top: 12px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--night) 0%, var(--night-deep) 100%);
  color: var(--cream) !important;
  box-shadow: 0 14px 32px rgba(47, 77, 119, 0.2);
}

.hero-card__schedule:hover {
  transform: translateY(-3px);
  color: #fff !important;
  box-shadow: 0 18px 40px rgba(47, 77, 119, 0.28);
}

.hero-card__schedule > span,
.hero-card__schedule > strong,
.hero-card__schedule > small {
  display: block;
}

.hero-card__schedule > span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--moon-light);
}

.hero-card__schedule > strong {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.05;
}

.hero-card__schedule > small {
  margin-top: 8px;
  color: rgba(253, 248, 242, 0.78);
  line-height: 1.4;
}

.hero__frame {
  position: relative;
  width: min(100%, 440px);
  filter: drop-shadow(0 22px 38px rgba(44, 58, 82, 0.16));
}

.hero__arch {
  position: relative;
  border-radius: 200px 200px 24px 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), inset 0 -36px 48px rgba(61, 52, 44, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 38%),
    var(--paper-deep);
}

.hero__arch::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 3px;
  background: linear-gradient(160deg, var(--moon-light), var(--lavender), var(--rose-soft));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.hero__arch img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: center top;
}

.hero__arch img.is-ref {
  object-fit: contain;
  object-position: center top;
  background: var(--paper-deep);
  transform: scale(1.04);
  transform-origin: top center;
}

.hero__moon {
  position: absolute;
  top: -24px;
  right: -16px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8ee, var(--moon-light) 45%, #c4a06a);
  box-shadow: 0 0 40px var(--moon-glow), inset -8px -4px 16px rgba(0, 0, 0, 0.08);
  animation: moon-float 8s ease-in-out infinite;
}

@keyframes moon-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

.hero__cat {
  position: absolute;
  bottom: 16px;
  left: -12px;
  font-size: 36px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
  animation: moon-float 6s ease-in-out infinite reverse;
}

.hero-scroll {
  display: flex;
  justify-content: center;
  padding: 0 20px 18px;
  margin-top: -6px;
  position: relative;
  z-index: 3;
}

.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 10px 20px 8px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.scroll-cue:hover {
  color: var(--lavender-deep);
  border-color: var(--lavender);
  background: #fff;
}

.scroll-cue__chevron {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: cue-bounce 1.9s ease-in-out infinite;
}

@keyframes cue-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(4px); opacity: 1; }
}

/* Stats strip */
.stats-strip {
  padding: 0 clamp(20px, 5vw, 48px);
  margin: 8px auto 0;
  max-width: 1180px;
  position: relative;
  z-index: 2;
}

.stats-strip__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.stat {
  text-align: center;
  padding: 4px 8px;
  border-right: 1px solid var(--line);
}

.stat:last-child { border-right: none; }

.stat__num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 600;
  color: var(--night);
  line-height: 1.1;
}

.stat__lbl {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--night);
  margin-top: 4px;
}

.stat__sub {
  display: block;
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* Portal strip */
.portal {
  padding: 48px 0 80px;
  margin-top: 24px;
}

.portal__head {
  text-align: center;
  max-width: 1180px;
  margin: 0 auto 28px;
  padding: 0 clamp(20px, 5vw, 48px);
}

.portal__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 600;
  margin: 0;
  color: var(--portal-title-color, var(--ink));
}

.portal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

.portal__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  position: relative;
  min-height: 112px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 14px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition), color var(--transition);
  overflow: hidden;
  --portal-accent: var(--lavender);
}

.portal__card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 12px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--portal-accent);
  opacity: 0.42;
  transform: scaleX(0.42);
  transition: transform var(--transition), opacity var(--transition);
}

.portal__card:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.portal__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--lavender);
  background: var(--card-hover-bg);
  color: var(--ink);
}

.portal__card:hover .portal__label { color: var(--ink); }
.portal__card:hover .portal__icon { color: var(--night); }

.portal__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--lavender-soft);
  color: var(--portal-accent);
}

.portal__icon svg { width: 20px; height: 20px; }

.portal__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.portal__card--featured {
  background: linear-gradient(145deg, var(--night) 0%, var(--night-deep) 100%);
  border-color: transparent;
  color: var(--cream);
}

.portal__card[data-platform="twitch"] { --portal-accent: var(--twitch); }
.portal__card[data-platform="youtube"] { --portal-accent: var(--youtube); }
.portal__card[data-platform="twitter"] { --portal-accent: #0f1419; }
.portal__card[data-platform="discord"] { --portal-accent: #5865f2; }
.portal__card[data-platform="patreon"] { --portal-accent: #ff424d; }
.portal__card[data-platform="booth"] { --portal-accent: #fc4c02; }
.portal__card[data-platform="calendly"] { --portal-accent: var(--teal); }
.portal__card[data-platform="tip"] { --portal-accent: var(--rose-deep); }

.portal__card--featured .portal__icon {
  background: rgba(255, 255, 255, 0.15);
  color: var(--moon-light);
}

.portal__card--featured .portal__label { color: var(--cream); }

.portal__card--featured:hover {
  background: var(--featured-hover-bg);
  border-color: var(--featured-hover-border);
  color: var(--cream);
  box-shadow: 0 12px 36px rgba(44, 58, 82, 0.28);
}

.portal__card--featured:hover .portal__label,
.portal__card--featured:hover .portal__icon {
  color: var(--cream);
}

.portal__card--featured:hover .portal__icon {
  background: rgba(255, 255, 255, 0.18);
}

/* ── About / Character sheet ── */
.about-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: start;
}

.about-portrait {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.about-portrait img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.spec-sheet {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 28px;
}

.spec-cell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.spec-cell__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lavender-deep);
  margin-bottom: 4px;
}

.spec-cell__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.prose {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
}

.prose p { margin: 0 0 18px; }

.pull-quote {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.8vw, 26px);
  font-style: italic;
  line-height: 1.55;
  color: var(--night);
  margin: 0 0 28px;
  padding: 20px 24px 20px 28px;
  border-left: 4px solid var(--moon);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, var(--lavender-soft) 100%);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: var(--shadow-sm);
}

.trait-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.trait {
  background: var(--rose-soft);
  border: 1px solid rgba(212, 165, 165, 0.35);
  color: var(--rose-deep);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}

.fav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fav {
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
}

/* ── Lessons ── */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

.lesson-grid .lesson-card:nth-child(2) {
  transform: scale(1.03);
  box-shadow: var(--shadow);
  z-index: 1;
}

.lesson-grid .lesson-card:nth-child(2):hover {
  transform: scale(1.03) translateY(-6px);
}

.lesson-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.lesson-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-bar, var(--lavender));
}

.lesson-card--rose { --accent-bar: var(--rose); }
.lesson-card--lavender { --accent-bar: var(--lavender); }
.lesson-card--moon { --accent-bar: var(--moon); }

.lesson-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.lesson-card h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 10px;
}

.lesson-card p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 16px;
  flex: 1;
}

.lesson-card ul {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.lesson-card li {
  font-size: 13px;
  color: var(--ink-soft);
  padding: 4px 0 4px 18px;
  position: relative;
}

.lesson-card li::before {
  content: "✦";
  position: absolute;
  left: 0;
  font-size: 8px;
  color: var(--lavender-deep);
  top: 8px;
}

/* ── Social groups ── */
.social-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.social-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
}

.social-group:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--lavender);
  background: #fff;
}

.social-group h4 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--night);
  margin: 0 0 14px;
}

.social-group a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  margin: 0 -8px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.social-group a:last-child { border-bottom: none; }

.social-group a:hover {
  color: var(--night);
  background: var(--lavender-soft);
}

.social-group a svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--night); }

.social-group a:hover svg { color: var(--lavender-deep); }

.social-group a span.desc {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint);
}

/* ── Content hub tabs ── */
.hub-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.hub-tab {
  background: #fff;
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.hub-tab:hover:not(.is-on) {
  background: var(--tab-hover-bg);
  color: var(--tab-hover-text);
  border-color: var(--tab-hover-bg);
}

.hub-tab.is-on {
  background: var(--night);
  color: var(--cream);
  border-color: var(--night);
  box-shadow: 0 4px 14px rgba(44, 58, 82, 0.25);
}

.hub-panel[hidden] { display: none; }

.hub-sync {
  text-align: center;
  font-size: 12px;
  color: rgba(253, 248, 242, 0.55);
  margin: 24px 0 0;
}

/* Dark updates section — light cards need explicit ink colors */
.section--night .hub-tab {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(253, 248, 242, 0.88);
}

.section--night .hub-tab:hover:not(.is-on) {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.section--night .hub-tab.is-on {
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.section--night .hub-tab[data-hub="youtube"].is-on {
  background: var(--youtube);
  border-color: var(--youtube);
}

.section--night .hub-tab[data-hub="x"].is-on {
  background: #0f1419;
  border-color: rgba(255, 255, 255, 0.35);
}

.section--night .hub-tab[data-hub="twitch"].is-on {
  background: var(--twitch);
  border-color: var(--twitch);
}

.section--night .hub-tab[data-hub="shop"].is-on {
  background: #fc4c02;
  border-color: #fc4c02;
}

.section--night .media-item,
.section--night .tweet,
.section--night .widget--light {
  color: var(--ink);
}

.section--night .tweet__text {
  color: var(--ink-soft);
}

.section--night .tweet__foot {
  color: var(--ink-faint);
}

.section--night .tweet__foot a,
.section--night .widget--light a:not(.btn) {
  color: var(--night);
  font-weight: 700;
}

.section--night .tweet__foot a:hover,
.section--night .widget--light a:not(.btn):hover {
  color: var(--lavender-deep);
}

.section--night .media-item__title {
  color: var(--ink);
}

.section--night .media-item__date {
  color: var(--ink-faint);
}

.section--night a.media-item:hover {
  color: var(--ink);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.media-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  color: var(--ink);
}

a.media-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.media-item__thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--paper-deep);
  overflow: hidden;
}

.media-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

a.media-item:hover .media-item__thumb img { transform: scale(1.04); }

/* Shop cards: BOOTH product photos are square — show them whole, no 16:9 crop */
.media-item--shop .media-item__thumb {
  aspect-ratio: 1 / 1;
  background: var(--paper-deep);
}
.media-item--shop .media-item__thumb img { object-fit: contain; }
a.media-item--shop:hover .media-item__thumb img { transform: scale(1.03); }
.media-item--shop .media-item__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.media-item__shoplink {
  font-size: 12px;
  font-weight: 700;
  color: #fc4c02;
  letter-spacing: 0.01em;
}

.media-item__tag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  color: #fff;
}

.media-item__tag--yt { background: var(--youtube); }
.media-item__tag--tw { background: var(--twitch); }
.media-item__tag--x { background: #1a8cd8; }
.media-item__tag--shop { background: #fc4c02; }

.media-item__body { padding: 14px 16px 16px; }

.media-item__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-item__date {
  font-size: 12px;
  color: var(--ink-faint);
}

/* ══ Today's Japanese — learning band (日本語の先生 / phrase of the day) ══ */
.section--learn {
  background:
    radial-gradient(120% 90% at 50% -10%, var(--lavender-soft) 0%, transparent 55%),
    linear-gradient(180deg, var(--cream) 0%, var(--paper) 100%);
}

.learn-deck-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 18px;
}
.learn-deck-title__emoji { font-size: 22px; }
.learn-deck-title__name {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 600;
  color: var(--lavender-deep);
}

.learn-stage {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.learn-card {
  width: 100%;
  max-width: 620px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 48px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.learn-card::before {
  content: "🌙";
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 22px;
  opacity: 0.5;
}

.learn-card__word {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.learn-card__jp {
  font-size: clamp(56px, 12vw, 88px);
  line-height: 1.1;
  color: var(--ink);
  font-weight: 500;
}

/* Furigana (ふりがな) — the teaching detail: small reading above each kanji */
.learn-card__jp ruby { ruby-position: over; }
.learn-card__jp rt {
  font-size: 0.26em;
  color: var(--lavender-deep);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.15em;
}

.learn-card__romaji {
  font-size: 18px;
  font-style: italic;
  color: var(--ink-faint);
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.learn-card__meaning {
  font-size: clamp(20px, 3.4vw, 26px);
  font-weight: 700;
  color: var(--cocoa);
  margin: 18px 0 0;
}

.learn-card__example {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--line-strong);
}

.learn-card__ex-jp {
  font-size: clamp(18px, 3vw, 22px);
  color: var(--ink);
  margin: 0 0 4px;
  font-weight: 600;
}

.learn-card__ex-romaji {
  font-size: 14px;
  font-style: italic;
  color: var(--ink-faint);
  margin: 0 0 6px;
}

.learn-card__ex-en {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
}

.learn-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.learn-shuffle {
  font-size: 15px;
}

.learn-count {
  font-size: 13px;
  color: var(--ink-faint);
}
.learn-count strong { color: var(--lavender-deep); font-size: 15px; }

@keyframes learn-swap {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.learn-card.is-swapping { animation: learn-swap 0.34s var(--ease); }

.learn-tip {
  text-align: center;
  font-size: 13px;
  color: var(--ink-faint);
  margin: 18px 0 0;
}

.learn-more {
  margin-top: 34px;
  text-align: center;
}

.learn-more__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lavender-deep);
  margin: 0 0 16px;
}

.learn-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.learn-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 96px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.learn-chip:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: var(--lavender);
}

.learn-chip.is-on {
  border-color: var(--lavender-deep);
  background: var(--lavender-soft);
}

.learn-chip__jp {
  font-size: 24px;
  color: var(--ink);
  line-height: 1.1;
}

.learn-chip__reading {
  font-size: 12px;
  font-style: italic;
  color: var(--ink-faint);
}

.learn-chip__en {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.learn-cta {
  text-align: center;
  margin: 30px 0 0;
}

/* Tweet cards */
.tweet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.tweet:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--line-strong);
}

.tweet__text {
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
}

.tweet__foot {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-faint);
}

/* Twitch block */
.twitch-block {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: start;
}

.twitch-player {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--night-deep);
  box-shadow: var(--shadow);
}

.twitch-player__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: rgba(253, 248, 242, 0.78);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.twitch-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.twitch-player.is-loaded iframe {
  opacity: 1;
}

.twitch-player.is-loaded .twitch-player__placeholder {
  display: none;
}

/* Fallback shown when Twitch can't be embedded (e.g. opened from file://) */
.twitch-player__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  background: linear-gradient(165deg, var(--night-deep) 0%, #4b3a6b 100%);
  color: var(--cream);
}
.twitch-player__fallback img {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.twitch-player__fallback-text {
  font-weight: 800;
  font-size: 18px;
  color: #fff;
}
.twitch-player__fallback-note {
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.32);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
}
.twitch-player.is-fallback .twitch-player__placeholder { display: none; }
/* A flex display would otherwise override the `hidden` attribute — keep it hidden. */
.twitch-player__fallback[hidden] { display: none; }

/* Community card */
.community-card {
  text-align: center;
  background: linear-gradient(145deg, #fff 0%, #fff7ef 100%);
  border: 1px solid rgba(213, 154, 78, 0.26);
  border-radius: var(--radius);
  padding: clamp(40px, 6vw, 56px);
  max-width: 720px;
  margin: 0 auto;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.community-card .headline {
  color: var(--ink);
}

.community-card .lead {
  color: var(--ink-soft);
}

.community-card .oshi {
  font-size: 48px;
  margin-bottom: 12px;
}

/* ── Timeline ── */
.timeline-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.timeline-filter button {
  background: #fff;
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.timeline-filter button:hover:not(.is-on) {
  background: var(--moon-light);
  border-color: var(--moon);
  color: var(--ink);
}

.timeline-filter button.is-on {
  background: var(--night);
  border-color: var(--night);
  color: var(--cream);
}

.timeline {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--moon), var(--lavender), transparent);
}

.tl-year {
  margin-bottom: 28px;
}

.tl-year[hidden] { display: none; }

.tl-year__label {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--moon);
  margin-bottom: 12px;
  position: relative;
}

.tl-year__label::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--moon);
  box-shadow: 0 0 0 4px var(--moon-glow);
}

.tl-event {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
  font-size: 14px;
}

.tl-event__date {
  font-weight: 700;
  color: var(--lavender-deep);
  font-size: 12px;
}

.tl-event__text { color: var(--ink-soft); }

/* ── Guidelines ── */
.guide-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.guide-nav {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-nav button {
  text-align: left;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 10px 14px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.guide-nav button.is-on,
.guide-nav button:hover {
  color: var(--ink);
  border-left-color: var(--lavender-deep);
  background: rgba(184, 169, 201, 0.1);
}

.guide-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow-sm);
}

.guide-panel[hidden] { display: none; }

.guide-panel h3 {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 16px;
  color: var(--ink);
}

.guide-panel p,
.guide-panel li {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.75;
}

.guide-panel ul,
.guide-panel ol {
  margin: 12px 0;
  padding-left: 22px;
}

.guide-panel li { margin-bottom: 8px; }

.guide-note {
  background: var(--paper);
  border-left: 3px solid var(--moon);
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 13px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.guide-highlight {
  background: var(--rose-soft);
  border: 1px solid rgba(212, 165, 165, 0.3);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 16px 0;
}

.guide-highlight strong {
  display: block;
  margin-bottom: 8px;
  color: var(--rose-deep);
}

.guide-example {
  background: var(--lavender-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  margin: 12px 0;
}

.guide-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 10px;
}

.guide-status--ok { background: #e8f5e9; color: #2e7d32; }
.guide-status--no { background: var(--rose-soft); color: var(--rose-deep); }
.guide-status--ask { background: #fff8e1; color: #f57f17; }

.guide-group { margin-bottom: 24px; }

/* Reference */
.ref-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.ref-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}

.ref-card:hover { transform: scale(1.015); }

/* Contact */
.contact-box {
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(40px, 6vw, 56px);
  max-width: 600px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

/* Footer */
.footer {
  background: var(--night-deep);
  color: rgba(253, 248, 242, 0.75);
  padding: 56px 0 32px;
}

.footer a { color: var(--moon-light); }
.footer a:hover { color: #fff; }

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--cream);
  margin-bottom: 6px;
}

.footer__space {
  font-size: 13px;
  color: var(--moon-light);
  font-style: italic;
  margin-bottom: 12px;
}

.footer h4 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--moon);
  margin: 0 0 14px;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer__links a { font-size: 14px; }

.footer__credits {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: rgba(253, 248, 242, 0.5);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(44, 58, 82, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox.is-open { display: flex; }

.lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

/* Scroll reveal */
.reveal,
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible,
.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: none;
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.15s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.2s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.25s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.3s; }
.reveal-stagger.is-visible > *:nth-child(7) { transition-delay: 0.35s; }
.reveal-stagger.is-visible > *:nth-child(8) { transition-delay: 0.4s; }
.reveal-stagger.is-visible > *:nth-child(9) { transition-delay: 0.45s; }
.reveal-stagger.is-visible > *:nth-child(10) { transition-delay: 0.5s; }

.lesson-grid.reveal-stagger.is-visible > .lesson-card:nth-child(2) {
  transform: scale(1.03);
}

.lesson-grid.reveal-stagger.is-visible > .lesson-card:nth-child(2):hover {
  transform: scale(1.03) translateY(-6px);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .stats-strip__inner { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat { border-right: none; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .stat:nth-last-child(-n+2) { border-bottom: none; }
  .lesson-grid .lesson-card:nth-child(2),
  .lesson-grid.reveal-stagger.is-visible > .lesson-card:nth-child(2) { transform: none; }
  .lesson-grid .lesson-card:nth-child(2):hover { transform: translateY(-6px); }
  .hero { grid-template-columns: 1fr; text-align: center; min-height: auto; padding-bottom: 28px; }
  .hero__visual { order: 0; justify-content: center; }
  .hero-card { margin: 0 auto; text-align: left; }
  .hero__frame { width: min(86vw, 360px); margin: 0 auto; }
  .hero__welcome, .hero__chips, .hero__actions { margin-left: auto; margin-right: auto; justify-content: center; }
  .about-layout, .twitch-block, .guide-layout { grid-template-columns: 1fr; }
  .about-portrait { position: static; }
  .lesson-grid, .social-board { grid-template-columns: repeat(2, 1fr); }
  .stream-schedule__intro { grid-template-columns: 1fr; text-align: center; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .guide-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .guide-nav button { border-left: none; border-bottom: 3px solid transparent; }
  .guide-nav button.is-on { border-bottom-color: var(--lavender-deep); }
}

/* Nav has its own breakpoint (≤1100px → dropdown) so the 10 sections never
   wrap the bar in the band where the desktop row no longer fits. */
@media (max-width: 1100px) {
  .nav__links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(253, 248, 242, 0.98);
    padding: 16px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav__links.is-open { display: flex; }
  .nav__link--secondary { display: block; }
  .nav__menu-btn { display: grid; place-items: center; }
}

/* On the desktop bar (single row), keep secondary sections out to save space.
   They stay reachable via the dropdown (≤1100px) and the footer. */
@media (min-width: 1101px) {
  .nav__link--secondary { display: none; }
}

@media (max-width: 640px) {
  .nav__links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(253, 248, 242, 0.98);
    padding: 16px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav__links.is-open { display: flex; }
  .nav__menu-btn { display: grid; place-items: center; }
  .nav__actions .btn--primary { display: none; }
  .hero { gap: 24px; padding: calc(var(--nav-h) + 18px) 16px 22px; }
  .hero__visual { order: 0; }
  .hero-card { width: 100%; padding: 18px; border-radius: 16px; }
  .hero-card__identity { grid-template-columns: 72px 1fr; gap: 14px; }
  .hero-card__identity img { width: 72px; height: 72px; border-radius: 18px; }
  .hero-card__kicker { font-size: 10px; letter-spacing: 0.08em; }
  .hero-card__identity strong { font-size: 30px; }
  .hero-card__metrics { grid-template-columns: 1fr; gap: 8px; }
  .hero-metric {
    display: grid;
    grid-template-columns: 84px 1fr;
    align-items: center;
  }
  .hero-metric small { margin-top: 0; }
  .hero-card__schedule strong { font-size: 24px; }
  .hero__frame { width: min(74vw, 250px); }
  .hero__arch img.is-ref { transform: none; }
  .hero__moon { width: 54px; height: 54px; top: -12px; right: -10px; }
  .hero__cat { font-size: 28px; bottom: 10px; left: -8px; }
  .hero__title { font-size: clamp(42px, 14vw, 58px); }
  .hero__jp { font-size: clamp(24px, 8vw, 34px); }
  .hero__actions .btn { flex: 1 1 220px; max-width: 300px; white-space: normal; }
  .lesson-grid, .social-board, .spec-sheet, .ref-grid { grid-template-columns: 1fr; }
  .portal__grid { grid-template-columns: repeat(2, 1fr); }
  .portal__card { min-height: 104px; padding: 18px 10px; }
  .stats-strip__inner { grid-template-columns: 1fr 1fr; }
  .hero-scroll { padding-bottom: 12px; }
  .schedule-grid { grid-template-columns: 1fr; }
  .schedule-card { grid-template-columns: 1fr; min-height: auto; }
  .schedule-card__days { justify-self: start; }
  .tl-event { grid-template-columns: 1fr; gap: 4px; }
  .footer__grid { grid-template-columns: 1fr; }
}

/* ── Theme picker ── */
.theme-picker {
  position: relative;
}

.theme-picker__btn {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 6px 12px;
  cursor: pointer;
}

.theme-picker__menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 300;
}

.theme-picker.is-open .theme-picker__menu { display: block; }

.theme-picker__option {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  padding: 10px 12px;
  cursor: pointer;
  transition: background var(--transition);
}

.theme-picker__option:hover,
.theme-picker__option.is-active {
  background: var(--lavender-soft);
}

.theme-picker__option strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
}

.theme-picker__option small {
  font-size: 11px;
  color: var(--ink-faint);
}

/* ── Stream schedule ── */
.stream-schedule {
  margin: -8px 0 28px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
}

.stream-schedule__intro {
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.stream-schedule__intro p,
.stream-schedule__hint {
  margin: 0;
  color: rgba(253, 248, 242, 0.78);
  font-size: 14px;
  line-height: 1.65;
}

.stream-schedule__hint {
  margin-top: 14px;
  color: rgba(253, 248, 242, 0.82);
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.schedule-card {
  --schedule-accent: var(--moon);
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  align-items: center;
  min-height: 120px;
  padding: 18px 18px 18px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.schedule-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--schedule-accent);
}

.schedule-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
  color: var(--ink);
}

.schedule-card--youtube { --schedule-accent: var(--youtube); }
.schedule-card--twitch { --schedule-accent: var(--twitch); }

.schedule-card__platform {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--schedule-accent);
}

.schedule-card__days {
  justify-self: end;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
}

.schedule-card__time {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.schedule-card__local,
.schedule-card__zones {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--ink-soft);
}

.schedule-card__zones {
  color: var(--ink-soft);
}

@media (max-width: 1024px) {
  .stream-schedule__intro {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .stream-schedule {
    padding: 18px;
  }

  .stream-schedule__intro {
    text-align: left;
  }

  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .schedule-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .schedule-card__days {
    justify-self: start;
  }
}

/* ── Platform widgets ── */
.widget-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.widget {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.widget--light {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.widget__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 8px;
}

.widget__label [data-countdown-platform],
.widget__label [data-countdown-state] {
  text-transform: none;
}

.widget__value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}

.countdown-local {
  margin: 8px 0 0;
  font-size: 12px;
  color: rgba(253, 248, 242, 0.86);
}

.countdown {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.countdown__unit {
  text-align: center;
  min-width: 52px;
}

.countdown__num {
  display: block;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.countdown__lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.65;
}

.quiz-spotlight {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}

.quiz-spotlight__text {
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  margin: 0 0 12px;
}

.hq-note {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; }
  .sky-petals { display: none; }
}
