/* ===================================================
   TRAVELLER RYO-CHAN — main.css
   Global styles, header, hero, footer
   =================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --green:       #8BE89C;
  --cyan:        #A7E8EA;
  --ink:         #1C1C1C;
  --bg:          #FAFAF7;
  --accent:      #FF6B35;
  --accent-dark: #E55A24;
  --white:       #FFFFFF;
  --gray-light:  #F0F0EC;
  --gray-mid:    #BBBBBB;
  --shadow-sm:   0 2px 8px rgba(28,28,28,.12);
  --shadow-md:   0 6px 24px rgba(28,28,28,.18);
  --shadow-lg:   0 16px 48px rgba(28,28,28,.24);
  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --header-h:    64px;
  --font-display: "Raleway", "Noto Sans", "Noto Sans JP", sans-serif;
  --font-body:    "Noto Sans", "Noto Sans JP", "Noto Sans SC", "Noto Sans TC", "Noto Sans KR", sans-serif;
  --transition:   0.25s ease;
}

/* ---------- Dark Mode Variables ---------- */
[data-theme="dark"] {
  --bg:         #121210;
  --ink:        #E8E4DA;
  --white:      #1E1E1A;
  --gray-light: #2A2A26;
  --gray-mid:   #78746F;
  --shadow-sm:  0 2px 8px rgba(0,0,0,.48);
  --shadow-md:  0 6px 24px rgba(0,0,0,.58);
  --shadow-lg:  0 16px 48px rgba(0,0,0,.68);
}

/* Header: hardcoded rgba → override for dark */
[data-theme="dark"] #site-header {
  background: rgba(18, 18, 16, 0.88);
  border-bottom-color: rgba(232,228,218,.07);
}
[data-theme="dark"] .lang-current {
  border-color: rgba(232,228,218,.18);
  color: var(--ink);
}
[data-theme="dark"] #lang-dropdown {
  border-color: rgba(232,228,218,.10);
}
/* About section — uses hardcoded hex */
[data-theme="dark"] .about { background: #16161A; }
[data-theme="dark"] .about-title { color: var(--ink); }
[data-theme="dark"] .about-lede  { color: #B8B4AA; }
[data-theme="dark"] .about-num   { color: #8BE89C; }
[data-theme="dark"] .about-lbl   { color: var(--gray-mid); }
[data-theme="dark"] .about-photo img { border-color: #2A2A26; }
/* Timeline */
[data-theme="dark"] .timeline { background: #1A1A16; }
[data-theme="dark"] .timeline-label { color: #A0A09A; }
[data-theme="dark"] .timeline-current { color: var(--ink); }
[data-theme="dark"] .timeline-track {
  background: #2A2A26;
  border-color: #3A3A34;
}
/* YouTube gallery */
[data-theme="dark"] .yt-gallery  { background: var(--bg); }
[data-theme="dark"] .yt-title    { color: var(--ink); }
[data-theme="dark"] .yt-card     { background: #1E1E1A; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
[data-theme="dark"] .yt-card-title { color: var(--ink); }

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* RTL support */
[dir="rtl"] .header-right { flex-direction: row-reverse; }
[dir="rtl"] .lang-current { flex-direction: row-reverse; }

/* ---------- Header ---------- */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(28,28,28,.08);
  box-shadow: var(--shadow-sm);
}

.logo-toc-wrap { position: relative; }

.logo-wrap {
  display: flex;
  align-items: center;
  height: 48px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}
.logo-wrap:hover { opacity: 0.85; }
.logo-wrap[aria-expanded="true"] { opacity: 1; }
.logo-wrap[aria-expanded="true"] img { transform: rotate(20deg); }
.logo-wrap img { height: 48px; width: auto; object-fit: contain;
                 transition: transform .25s ease; }

/* Site TOC — slides down from under the logo. Glass card. */
.site-toc {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 800;
  min-width: 280px;
  max-width: 340px;
  /* Cap height so the panel always fits inside the viewport. Subtract
     header (~64px) + 12px gap + bottom buffer for browser URL preview /
     mobile address bar (~84px). dvh keeps the calc dynamic when mobile
     browser chrome shows/hides; vh is the fallback. */
  max-height: calc(100vh - 160px);
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  /* Trailing pad so the last item is never hidden under URL preview */
  padding-bottom: 16px;
  background: rgba(250, 250, 247, 0.96);
  border: 1px solid rgba(28, 28, 28, 0.08);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0,0,0,.18), 0 4px 10px rgba(0,0,0,.08);
  backdrop-filter: blur(10px);
  padding: 8px;
  animation: tocIn 0.22s cubic-bezier(.2,.8,.2,1);
}
[data-theme="dark"] .site-toc {
  background: rgba(28, 28, 30, 0.96);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 14px 36px rgba(0,0,0,.5);
}
@keyframes tocIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.site-toc ul { list-style: none; margin: 0; padding: 0; }
.site-toc li { margin: 0; }
.site-toc .toc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink);
  text-align: start;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s ease;
}
[data-theme="dark"] .site-toc .toc-item { color: #E8E4DA; }
.site-toc .toc-item:hover {
  background: rgba(139, 232, 156, 0.18);
}
[data-theme="dark"] .site-toc .toc-item:hover {
  background: rgba(139, 232, 156, 0.12);
}
.site-toc .toc-icon { font-size: 18px; flex-shrink: 0; width: 22px;
                      text-align: center; }
.site-toc .toc-label { flex: 1; }
.site-toc .toc-ext::after { content: " ↗"; opacity: .55; font-size: 11px; }
.site-toc hr.toc-sep {
  border: none; border-top: 1px solid rgba(28,28,28,.08);
  margin: 6px 8px;
}
[data-theme="dark"] .site-toc hr.toc-sep { border-top-color: rgba(255,255,255,.08); }
/* Section header (e.g. "🤪 おバカシリーズ") — small uppercase-ish label,
   non-clickable, sits above its grouped items as a visual heading. */
.site-toc .toc-header {
  padding: 6px 14px 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #6B7470;
  text-transform: none;
}
[data-theme="dark"] .site-toc .toc-header { color: #B8B0A2; }

/* RTL: flip the dropdown to the right side */
html[dir="rtl"] .site-toc { left: auto; right: 0; }
html[dir="rtl"] .site-toc .toc-item { text-align: end; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- Language Switcher ---------- */
.lang-switcher {
  position: relative;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(28,28,28,.15);
  background: var(--white);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.lang-current:hover,
.lang-current[aria-expanded="true"] {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(139,232,156,.25);
}

.lang-current .caret {
  font-size: 12px;
  transition: transform var(--transition);
}
.lang-current[aria-expanded="true"] .caret { transform: rotate(180deg); }

#lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--white);
  border: 1.5px solid rgba(28,28,28,.12);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 200;
  padding: 6px;
  animation: dropDown 0.18s ease;
}
[dir="rtl"] #lang-dropdown { right: auto; left: 0; }

/* Mobile: lang switcher button sits on the left side of the header, so
   the default `right: 0` anchoring pushes the dropdown off-screen to the
   left. Flip to left-anchor and clamp width to viewport. */
@media (max-width: 768px) {
  #lang-dropdown {
    right: auto;
    left: 0;
    max-width: calc(100vw - 24px);
  }
}

@keyframes dropDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

#lang-dropdown li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition);
}
#lang-dropdown li:hover,
#lang-dropdown li[aria-selected="true"] { background: var(--gray-light); }
#lang-dropdown li[aria-selected="true"] { font-weight: 700; color: var(--accent); }
#lang-dropdown li .lang-item-flag { font-size: 18px; }
#lang-dropdown li .lang-item-name { flex: 1; }

/* ---------- World/Japan Toggle Button ---------- */
.btn-world {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn-world:hover {
  background: #333;
  transform: translateY(-1px);
}

/* ---------- Dark Mode Toggle Button ---------- */
.btn-dark {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(28,28,28,.18);
  background: var(--white);
  color: var(--ink);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
  line-height: 1;
}
.btn-dark:hover {
  border-color: var(--green);
  transform: scale(1.12) rotate(20deg);
  box-shadow: 0 0 0 3px rgba(139,232,156,.2);
}

/* ---------- Hero ---------- */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-h) + 40px) 24px 60px;
  background: linear-gradient(160deg, #EAF9EC 0%, #D8F5F7 40%, #FAFAF7 80%);
  overflow: hidden;
  text-align: center;
}

/* Decorative blobs */
#hero::before {
  content: "";
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(139,232,156,.35) 0%, transparent 70%);
  top: -100px; right: -150px;
  pointer-events: none;
}
#hero::after {
  content: "";
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(167,232,234,.4) 0%, transparent 70%);
  bottom: 0; left: -100px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 700px;
}

.hero-logo-large img {
  height: 180px;
  width: auto;
  filter: drop-shadow(0 8px 24px rgba(28,28,28,.18));
  animation: floatLogo 4s ease-in-out infinite;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* ===== Hero emblem — logo + circular portrait side-by-side =====
   They sit on a single horizontal row, centered, with a small gap.
   Each floats independently (different phase) so they feel alive
   without competing. The avatar matches the logo's drawn style with
   a soft white ring + shadow. */
.hero-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4vw, 48px);
  flex-wrap: nowrap;
  margin: 0 auto 18px;
}
.hero-avatar {
  flex: 0 0 auto;
  /* Match the logo's height (180px) so the two circles read as a balanced
     pair instead of one being noticeably smaller. The logo image itself
     uses height:180px (no fixed width), so we mirror that height here. */
  width: 180px; height: 180px;
  border-radius: 50%;
  background: #fff;
  padding: 5px;
  box-shadow:
    0 12px 28px rgba(28,28,28,.25),
    0 0 0 3px rgba(255,255,255,.95);
  animation: floatLogo 4s ease-in-out infinite;
  animation-delay: -1.6s;       /* out-of-phase bob vs logo */
}
.hero-avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
@media (max-width: 720px) {
  .hero-emblem { gap: 14px; }
  /* Mobile logo shrinks to 130px (see line ~1074) — match it on the avatar
     so the pair stays balanced. */
  .hero-avatar { width: 130px; height: 130px; }
}
@media (max-width: 480px) {
  /* Keep both circles the same on the smallest phones too. */
  .hero-avatar { width: 130px; height: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-avatar { animation: none; }
}

/* ===== Hero emblem Easter eggs — hover for hidden interactions =====
   Logo: cursor → bicycle dust trail + slight tilt, click → 360° spin.
   Avatar: cursor → speech bubble with random Ryo-chan fact (rotates).
   Both hovered together → "HI-FIVE" sparkle banner. */
.hero-emblem { position: relative; cursor: pointer; }

.hero-logo-large {
  transition: transform .35s cubic-bezier(.2,.9,.3,1.4), filter .3s ease;
  transform-origin: center;
  position: relative;
  cursor: pointer;
}
.hero-logo-large:hover {
  filter: drop-shadow(0 8px 20px rgba(139,232,156,0.5));
}

/* Vinyl-record spin: while hovering, the logo rotates continuously like
   a 33⅓ rpm record. Pairs with logo-theme-audio playback in main.js. */
.hero-logo-large:hover img {
  animation: vinyl-spin 4s linear infinite;
  transform-origin: center;
}
@keyframes vinyl-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Spindle hole at centre — only appears while hovered, sells the
   "this is a record" feel. Tiny dark dot with a soft inner highlight. */
.vinyl-spindle {
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #1c1c1c 60%, #444 100%);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.85), inset 0 1px 2px rgba(0,0,0,0.6);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .25s ease;
  pointer-events: none;
  z-index: 5;
}
.hero-logo-large:hover .vinyl-spindle {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.hero-logo-large.spinning {
  animation: emblemSpin .9s cubic-bezier(.4,0,.2,1);
}
@keyframes emblemSpin {
  0%   { transform: rotate(0) scale(1); }
  60%  { transform: rotate(380deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}
.emblem-dust {
  position: absolute;
  bottom: 12px;
  left: -10px;
  width: 50px;
  height: 14px;
  pointer-events: none;
  opacity: 0;
  display: flex;
  gap: 4px;
}
.emblem-dust span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(180,180,180,0.7);
  animation: emblemDust 1s linear infinite;
}
.emblem-dust span:nth-child(2) { animation-delay: .2s; }
.emblem-dust span:nth-child(3) { animation-delay: .4s; }
.hero-logo-large:hover .emblem-dust { opacity: 1; }
@keyframes emblemDust {
  0%   { transform: translateX(0)  scale(1);   opacity: .85; }
  100% { transform: translateX(-30px) scale(.4); opacity: 0; }
}

.hero-avatar {
  transition: transform .3s cubic-bezier(.2,.9,.3,1.4),
              box-shadow .3s ease;
  cursor: pointer;
}
.hero-avatar:hover {
  transform: scale(1.08) rotate(3deg);
  box-shadow:
    0 16px 40px rgba(28,28,28,.4),
    0 0 0 3px rgba(255,212,121,.95),
    0 0 30px rgba(255,212,121,0.5);
}
.emblem-bubble {
  position: absolute;
  /* Side bubble — appears to the right of the avatar at vertical center */
  top: 50%;
  left: calc(100% + 18px);
  transform: translateY(-50%) translateX(8px) scale(.85);
  transform-origin: left center;
  width: max-content;
  min-width: 200px;
  max-width: min(320px, 60vw);
  padding: 12px 16px;
  background: #fff;
  color: #1C1C1C;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  white-space: normal;
  overflow: visible;
  word-break: normal;
  text-align: left;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 100;
}
.emblem-bubble::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right-color: #fff;
}
/* Mobile / narrow screens: anchor the bubble to the VIEWPORT edges via
   position:fixed instead of relative to the avatar. The avatar sits in
   the right half of the hero-emblem flex row, so a left:50% trick still
   pushed the bubble off the right edge on narrow phones. Fixed-position
   guarantees both edges stay clear regardless of nesting. */
@media (max-width: 768px) {
  .emblem-bubble {
    position: fixed !important;
    top: 78px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    width: 100vw !important;
    min-width: 0 !important;
    max-width: none !important;
    transform: translateY(-8px) scale(.95) !important;
    transform-origin: top center !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 14px 18px !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }
  .emblem-bubble::after { display: none !important; }
}
.emblem-bubble.show {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
}
@media (max-width: 768px) {
  .emblem-bubble.show {
    transform: translateY(0) scale(1) !important;
  }
}

/* HI-FIVE banner — appears when both circles are hovered together */
.emblem-hifive {
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%) scale(.6);
  font-family: "Raleway", sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  color: #FFD479;
  text-shadow: 0 2px 14px rgba(255,212,121,0.7), 0 0 6px rgba(255,255,255,0.8);
  opacity: 0;
  transition: opacity .25s ease, transform .35s cubic-bezier(.3,1.4,.5,1);
  pointer-events: none;
  letter-spacing: 0.1em;
  white-space: nowrap;
  z-index: 6;
}
.emblem-hifive.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  animation: hifivePulse 1.2s ease-in-out infinite alternate;
}
@keyframes hifivePulse {
  0%   { filter: hue-rotate(0deg); transform: translateX(-50%) scale(1); }
  100% { filter: hue-rotate(40deg); transform: translateX(-50%) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo-large, .hero-avatar, .emblem-bubble, .emblem-hifive { transition: none; animation: none; }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--ink);
  line-height: 1.02;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.hero-title .hero-title-line1,
.hero-title .hero-title-line2 {
  display: block;
}
.hero-title .hero-title-line2 {
  color: var(--accent);
}

/* Visitor counter */
.visitor-counter {
  display: inline-block;
  margin-top: 4px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(139, 232, 156, 0.5);
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(28,28,28,.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-height: 1.5em;
}
.visitor-counter .visitor-num {
  color: var(--accent);
  font-size: 16px;
  font-weight: 900;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #555;
  font-weight: 600;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.btn-youtube {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--accent);
  color: var(--white);
  border-radius: 50px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 16px rgba(255,107,53,.35);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.btn-youtube:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255,107,53,.45);
}

.hero-hint {
  font-size: 13px;
  color: var(--gray-mid);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 8px;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}
.scroll-arrow {
  display: block;
  font-size: 28px;
  color: var(--gray-mid);
  animation: bounceArrow 1.5s ease-in-out infinite;
  line-height: 1;
}
@keyframes bounceArrow {
  0%, 100% { transform: translateY(0); opacity: .6; }
  50%       { transform: translateY(8px); opacity: 1; }
}

/* ---------- Fan Messages Section ---------- */
.fan-section {
  background: linear-gradient(180deg, #FAFAF7 0%, #F0EBE0 100%);
  padding: 64px 24px 48px;
  border-top: 1px solid #E8E4DA;
}
.fan-messages-wrap { max-width: 760px; margin: 0 auto; }
.fan-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--ink);
  margin: 0 0 6px;
  text-align: center;
}
.fan-sub {
  text-align: center;
  color: #6b6b6b;
  margin: 0 0 28px;
  font-size: 0.95rem;
}
.fan-form {
  background: #fff;
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 4px 18px rgba(0,0,0,.06);
  margin-bottom: 36px;
}
.fan-form-row { display: flex; gap: 10px; margin-bottom: 10px; }
.fan-form-row .fan-input { flex: 1 1 0; }
.fan-input, .fan-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #D6D2C7;
  border-radius: 10px; font: inherit; font-size: 0.95rem;
  background: #FAFAF7; box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fan-textarea { resize: vertical; min-height: 80px; margin-bottom: 10px; }
.fan-input:focus, .fan-textarea:focus {
  outline: none; border-color: #8BE89C;
  box-shadow: 0 0 0 3px rgba(139,232,156,.3);
}
.fan-submit {
  background: linear-gradient(135deg, #FF6B35, #E25A28);
  color: #fff; border: none; border-radius: 999px;
  padding: 11px 28px; font-weight: 800; font-size: 0.95rem;
  cursor: pointer; letter-spacing: .04em;
  box-shadow: 0 4px 14px rgba(255,107,53,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.fan-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255,107,53,.5); }
.fan-submit:disabled { opacity: .5; cursor: not-allowed; }
.fan-status {
  margin-top: 10px; font-size: 0.85rem; min-height: 1.2em;
}
.fan-status-ok    { color: #1F6E4F; }
.fan-status-warn  { color: #E25A28; }
.fan-status-info  { color: #6b6b6b; }

.fan-list { display: flex; flex-direction: column; gap: 14px; }
.fan-card {
  background: #fff; border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  animation: fanCardIn .25s ease;
}
@keyframes fanCardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fan-card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.fan-card-name { font-weight: 700; color: var(--ink); }
.fan-card-region { color: #888; font-size: 0.85rem; }
.fan-card-time { color: #aaa; font-size: 0.8rem; margin-left: auto; }
.fan-card-body { margin: 0; line-height: 1.55; color: #1C1C1C; white-space: pre-wrap; }
.fan-reply {
  margin-top: 12px; padding: 12px 14px;
  background: linear-gradient(135deg, rgba(139,232,156,0.18), rgba(167,232,234,0.18));
  border-left: 3px solid #1F6E4F; border-radius: 8px;
}
.fan-reply-from {
  font-weight: 800; font-size: 0.85rem; color: #1F6E4F;
  margin-bottom: 4px; letter-spacing: .03em;
}
.fan-reply-body { margin: 0; line-height: 1.55; color: #1C1C1C; white-space: pre-wrap; }
.fan-reply-time { font-size: 0.75rem; color: #888; display: block; margin-top: 4px; }
.fan-empty, .fan-loading {
  text-align: center; color: #888; padding: 28px 12px;
  background: #fff; border-radius: 12px;
}

/* Modal action row — YouTube link + ❤️ like side by side */
.modal-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.modal-actions-row .btn-yt-link { margin: 0; }
.modal-like-slot { display: inline-flex; }

/* ---------- ❤️ Like Button ---------- */
.rc-like {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.85); border: 1.5px solid #E8E4DA;
  font: inherit; font-weight: 700; font-size: 0.95rem;
  color: #1C1C1C; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
  user-select: none;
  backdrop-filter: blur(6px);
}
.rc-like:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.rc-like.liked {
  background: linear-gradient(135deg,#FF8FA3,#FF4D6D);
  color: #fff; border-color: #FF4D6D;
  box-shadow: 0 4px 14px rgba(255,77,109,.4);
}
.rc-like-heart { font-size: 1.05rem; line-height: 1; transition: transform .2s ease; }
.rc-like.rc-like-pop .rc-like-heart {
  animation: heartPop .55s cubic-bezier(.2,1.4,.4,1);
}
@keyframes heartPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.6); }
  70%  { transform: scale(.85); }
  100% { transform: scale(1); }
}
.rc-like.rc-like-shake { animation: heartShake .35s ease; }
@keyframes heartShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
.rc-like-count { font-variant-numeric: tabular-nums; }
.rc-float-heart {
  position: fixed;
  font-size: 1.4rem;
  pointer-events: none;
  z-index: 9999;
  animation: floatUp 1.2s cubic-bezier(.2,.6,.4,1) forwards;
  will-change: transform, opacity;
}
@keyframes floatUp {
  0%   { transform: translate(0,0) scale(.6); opacity: 0; }
  20%  { transform: translate(0,-10px) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx,0), -90px) scale(1.2); opacity: 0; }
}

/* ---------- Footer (refined: aurora divider + cinematic gradient) ---------- */
#site-footer {
  position: relative;
  /* Deep ocean → forest green — matches logo palette */
  background:
    radial-gradient(ellipse at 18% -10%, rgba(139,232,156,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 82% 110%, rgba(167,232,234,0.15) 0%, transparent 55%),
    linear-gradient(160deg, #0A2540 0%, #133E5C 40%, #134E3A 100%);
  color: #fff;
  padding: 64px 24px 38px;
  margin-top: 0;
  overflow: hidden;
  isolation: isolate;
}
/* Smooth top blend so footer melts into page bg (no harsh edge) */
#site-footer::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(139,232,156,0.55) 30%, rgba(167,232,234,0.7) 50%, rgba(139,232,156,0.55) 70%, transparent 100%);
  filter: blur(0.3px);
  z-index: 2;
}
/* Aurora divider — soft glowing horizontal beam pulsing along the top */
.footer-aurora {
  position: absolute;
  top: -40px;
  left: -10%;
  width: 120%;
  height: 90px;
  background:
    radial-gradient(ellipse 60% 100% at 30% 50%, rgba(139,232,156,0.35) 0%, transparent 60%),
    radial-gradient(ellipse 50% 100% at 65% 60%, rgba(167,232,234,0.30) 0%, transparent 60%),
    radial-gradient(ellipse 40% 100% at 85% 40%, rgba(255,212,121,0.18) 0%, transparent 65%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 1;
  animation: footerAurora 12s ease-in-out infinite alternate;
}
@keyframes footerAurora {
  0%   { transform: translateX(-3%); opacity: 0.85; }
  100% { transform: translateX(3%);  opacity: 1; }
}
/* Twinkling-stars background layer */
#site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 30%, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(1.5px 1.5px at 27% 65%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(2px 2px at 48% 22%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1.5px 1.5px at 64% 75%, rgba(255,255,255,.65), transparent 60%),
    radial-gradient(2px 2px at 82% 35%, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(1.5px 1.5px at 92% 60%, rgba(255,255,255,.7), transparent 60%);
  pointer-events: none;
  animation: footerTwinkle 4.5s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes footerTwinkle {
  0%   { opacity: 0.45; }
  100% { opacity: 1; }
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}
.footer-logo {
  height: 58px;
  width: auto;
  filter: drop-shadow(0 4px 10px rgba(139,232,156,0.45));
  transition: transform .35s cubic-bezier(.2,.8,.3,1.3);
}
.footer-logo:hover { transform: rotate(-4deg) scale(1.06); }

.footer-tag {
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.1;
}
.footer-tag-line1 {
  font-family: "Raleway", "Noto Sans", sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, #8BE89C 0%, #A7E8EA 60%, #FFD479 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* Slow aurora shimmer through the gradient */
  background-size: 200% 100%;
  animation: tagShimmer 6s ease-in-out infinite alternate;
}
@keyframes tagShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
.footer-tag-rule {
  display: block;
  width: 36px;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(139,232,156,0.9), rgba(167,232,234,0.4));
  border-radius: 2px;
  margin: 2px 0;
}
.footer-tag-line2 {
  font-family: "Raleway", "Noto Sans", sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.65);
  font-style: italic;
}

/* CTA-style social buttons */
.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: "Raleway", "Noto Sans", sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: #fff;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .25s ease, filter .2s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.footer-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.35) 50%, transparent 100%);
  transform: translateX(-110%);
  transition: transform .55s ease;
  z-index: -1;
}
.footer-cta:hover::before { transform: translateX(110%); }
.footer-cta:hover {
  transform: translateY(-3px) scale(1.04);
  filter: brightness(1.08);
}
.footer-cta-yt {
  background: linear-gradient(135deg, #FF3B30 0%, #FF6B35 100%);
  box-shadow: 0 6px 18px rgba(255,59,48,0.45);
}
.footer-cta-yt:hover { box-shadow: 0 10px 24px rgba(255,59,48,0.6); }
.footer-cta-ya {
  background: linear-gradient(135deg, #1F6E4F 0%, #8BE89C 100%);
  box-shadow: 0 6px 18px rgba(31,110,79,0.45);
  color: #0D3B1F;
}
.footer-cta-ya:hover { box-shadow: 0 10px 24px rgba(139,232,156,0.6); }
.footer-cta-icon { font-size: 1.05rem; }
.footer-cta-svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ---------- Utility ---------- */
[hidden] { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  #site-header { padding: 0 14px; }
  .logo-wrap img { height: 38px; }
  .btn-world { padding: 7px 12px; font-size: 13px; }
  .hero-logo-large img { height: 130px; }
  .footer-inner { flex-direction: column; align-items: center; text-align: center; gap: 22px; }
  .footer-brand { flex-direction: column; gap: 12px; }
  .footer-tag-line1 { font-size: 1.1rem; }
}

@media (max-width: 480px) {
  .lang-current span:nth-child(2) { display: none; }
}

/* ====================================================
   Timeline scrubber — a horizontal "journey timeline"
   between hero and the map. Dragging filters pins to
   only-those-visited-by-this-month.
   ==================================================== */
.timeline {
  background: linear-gradient(180deg, var(--bg) 0%, #F5F1E8 100%);
  border-top: 1px solid rgba(0,0,0,.05);
  border-bottom: 1px solid rgba(0,0,0,.05);
  padding: 18px 24px;
}
.timeline-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.timeline-label {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.timeline-current {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255,107,53,.1);
  padding: 3px 12px;
  border-radius: 50px;
  letter-spacing: 0.03em;
}
.timeline-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.timeline-btn {
  width: 30px; height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
}
.timeline-btn:hover { background: var(--accent); transform: scale(1.08); }
.timeline-btn.is-playing { background: var(--accent); }

.timeline-track {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
}
.timeline-track::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  background: rgba(0,0,0,.12);
  border-radius: 3px;
}
.timeline-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--accent));
  border-radius: 3px;
  width: 100%;
  transition: width .15s linear;
}
.timeline-range {
  position: relative;
  z-index: 2;
  width: 100%;
  appearance: none;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
.timeline-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 3px 8px rgba(255,107,53,.35);
  cursor: grab;
  transition: transform .15s ease;
}
.timeline-range::-webkit-slider-thumb:active { transform: scale(1.15); cursor: grabbing; }
.timeline-range::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 3px 8px rgba(255,107,53,.35);
  cursor: grab;
}
.timeline-ticks {
  position: absolute;
  left: 0; right: 0;
  bottom: -14px;
  height: 14px;
  pointer-events: none;
  font-size: 10px;
  color: var(--gray-mid);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.timeline-ticks span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}
.timeline-ticks span::before {
  content: "";
  display: block;
  width: 1px; height: 5px;
  background: rgba(0,0,0,.2);
  margin: 0 auto 2px;
}

@media (max-width: 600px) {
  .timeline { padding: 14px 16px 24px; }
  .timeline-label { font-size: 11px; }
  .timeline-current { font-size: 11px; }
}

/* ========== HERO BG VIDEO ========== */
.hero-bg-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0;
  transition: opacity .8s ease;
}
.hero-bg-video[data-ready="1"] { opacity: .45; }
.hero-bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(255,255,255,.25) 0%,
    rgba(250,250,247,.65) 55%,
    rgba(250,250,247,.95) 100%);
  z-index: 1;
}
#hero > .hero-content { position: relative; z-index: 2; }
@media (prefers-reduced-motion: reduce) {
  .hero-bg-video { display: none; }
}

/* ========== ABOUT ========== */
.about {
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 48px);
  background: linear-gradient(180deg, #FAFAF7, #EEF6F0);
  border-top: 1px solid rgba(28,28,28,.06);
  border-bottom: 1px solid rgba(28,28,28,.06);
  transition: box-shadow .35s ease;
}
/* Brief glow when navigated-to from the site-TOC "Profile" entry, so the
   user's eye lands on the section after the scroll instead of just on a
   wall of text. */
.about.about-pulse {
  box-shadow: inset 0 0 0 3px var(--color-green, #8BE89C),
              0 0 24px rgba(139,232,156,.55);
}
.about-inner {
  max-width: 960px; margin: 0 auto;
  display: grid; grid-template-columns: 160px 1fr; gap: 32px;
  align-items: center;
}
.about-photo img {
  width: 160px; height: 160px; border-radius: 50%;
  object-fit: cover; background: #FFF;
  box-shadow: 0 10px 28px rgba(28,28,28,.12);
  border: 4px solid #FFF;
}
.about-title {
  font-family: "Raleway", "Noto Sans JP", sans-serif;
  font-weight: 900; font-size: clamp(24px, 3.4vw, 34px);
  margin: 0 0 10px; color: #1C1C1C;
}
.about-lede {
  font-size: 16px; line-height: 1.65; color: #2c2c2c;
  margin: 0 0 18px; max-width: 62ch;
}
.about-stats {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 24px;
}
.about-stats li {
  display: flex; flex-direction: column; gap: 2px;
}
.about-num {
  font-family: "Raleway", sans-serif;
  font-weight: 900; font-size: 32px;
  color: #1C5A3A; line-height: 1;
}
.about-lbl { font-size: 13px; color: #555; letter-spacing: .02em; }
@media (max-width: 640px) {
  .about-inner { grid-template-columns: 1fr; text-align: center; }
  .about-photo img { width: 120px; height: 120px; }
  .about-stats { justify-content: center; }
}

/* ====================================================
   JOURNEY PHOTO STRIP — polaroid-style memento wall
   Sits between About and YouTube gallery. Each photo
   is a slightly-rotated polaroid so the whole row feels
   like a scrapbook page, not a gallery grid.
   ==================================================== */
.journey-strip {
  padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 48px) clamp(40px, 6vw, 72px);
  background: linear-gradient(180deg, #FAFAF7 0%, #F2EFE6 100%);
  text-align: center;
  overflow: hidden;
}
.journey-strip-title {
  font-family: "Raleway", "Noto Sans JP", sans-serif;
  font-weight: 900;
  font-size: clamp(22px, 3vw, 32px);
  margin: 0 0 36px;
  color: #1C1C1C;
  letter-spacing: .04em;
}
.journey-strip-title::after {
  content: "";
  display: block;
  width: 48px; height: 3px;
  margin: 10px auto 0;
  background: var(--accent, #FF6B35);
  border-radius: 2px;
}

.polaroid-track {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 20px 36px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 8px;
}
.polaroid {
  position: relative;
  margin: 0;
  padding: 12px 12px 40px;
  background: #FFFDF8;
  box-shadow:
    0 12px 28px rgba(28,28,28,.18),
    0 2px 6px rgba(28,28,28,.08);
  transition: transform .35s cubic-bezier(.17,.89,.32,1.2), box-shadow .35s ease;
  will-change: transform;
}
.polaroid img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  background: #eee;
}
.polaroid figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  font-family: "Caveat", "Noto Sans JP", cursive;
  font-size: 17px;
  color: #2c2c2c;
  text-align: center;
  padding: 0 10px;
}

/* Multilingual text helper — render every language as a <span data-lang="xx">,
   then use html[lang] to show only the active one. Decoupling like this
   means the journey.js render order doesn't matter — switching language
   ONLY needs the <html lang> attribute to change, which i18n always does
   via setLanguage(). No JS race conditions possible. */
.i18n-multi { display: inline; }
.i18n-multi .i18n-lang { display: none; }
/* Default: show English when no html[lang] match found */
.i18n-multi .i18n-en { display: inline; }
/* Active language overrides: hide en, show matching lang */
html[lang="ja"]      .i18n-multi .i18n-ja      { display: inline; }
html[lang="zh-Hans"] .i18n-multi .i18n-zh-Hans { display: inline; }
html[lang="zh-Hant"] .i18n-multi .i18n-zh-Hant { display: inline; }
html[lang="ko"]      .i18n-multi .i18n-ko      { display: inline; }
html[lang="hi"]      .i18n-multi .i18n-hi      { display: inline; }
html[lang="id"]      .i18n-multi .i18n-id      { display: inline; }
html[lang="pt"]      .i18n-multi .i18n-pt      { display: inline; }
html[lang="es"]      .i18n-multi .i18n-es      { display: inline; }
html[lang="ru"]      .i18n-multi .i18n-ru      { display: inline; }
html[lang="ar"]      .i18n-multi .i18n-ar      { display: inline; }
html[lang="bn"]      .i18n-multi .i18n-bn      { display: inline; }
/* Hide en when any non-en language is active */
html[lang="ja"]      .i18n-multi .i18n-en,
html[lang="zh-Hans"] .i18n-multi .i18n-en,
html[lang="zh-Hant"] .i18n-multi .i18n-en,
html[lang="ko"]      .i18n-multi .i18n-en,
html[lang="hi"]      .i18n-multi .i18n-en,
html[lang="id"]      .i18n-multi .i18n-en,
html[lang="pt"]      .i18n-multi .i18n-en,
html[lang="es"]      .i18n-multi .i18n-en,
html[lang="ru"]      .i18n-multi .i18n-en,
html[lang="ar"]      .i18n-multi .i18n-en,
html[lang="bn"]      .i18n-multi .i18n-en { display: none; }

/* Memory sticky-note — overlays ON its OWN photo (hovered one) so the
   user always sees note↔photo paired together. Yellow Post-it look with
   a tape strip across the top. Faded image behind makes the text easy
   to read. Each polaroid's note stays inside its own polaroid frame, so
   hovering #1 only lights up #1's note (no more confusion of the middle
   note belonging to which photo). */
.polaroid-memory {
  position: absolute;
  /* Anchor to the photo area (the polaroid has white padding around the
     image; ~6% inset matches the white frame). Bottom space leaves room
     above the handwritten caption. */
  top: 8%; left: 8%; right: 8%;
  /* Avoid covering the figcaption strip at the bottom */
  bottom: 18%;
  display: flex; align-items: center; justify-content: center;
  padding: 22px 20px;
  background: linear-gradient(180deg, rgba(255, 247, 194, 0.97) 0%, rgba(255, 232, 137, 0.97) 100%);
  color: #3a2f0e;
  font-family: "Caveat", "Noto Sans JP", cursive;
  font-size: 19px;
  line-height: 1.5;
  text-align: center;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.20),
    0 2px 6px rgba(0, 0, 0, 0.12);
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  /* Slight initial offset + rotate for the fade-in feel */
  transform: rotate(-1deg) translateY(8px) scale(.96);
  transition: opacity .3s ease, transform .35s cubic-bezier(.34,1.56,.64,1);
}
.polaroid-memory::before {
  content: "";
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 64px; height: 18px;
  background: rgba(255, 245, 200, 0.85);
  border: 1px solid rgba(150, 130, 60, 0.18);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
/* On hover, the note rests cleanly on its own photo */
.polaroid:hover .polaroid-memory,
.polaroid:focus-within .polaroid-memory {
  opacity: 1;
  transform: rotate(-1deg) translateY(0) scale(1);
}
/* Tilt direction alternates so neighbouring photos look natural,
   purely cosmetic (purely visual side-tilt, doesn't affect placement). */
.polaroid-memory-left  { /* used by even-index photos */ }
.polaroid-memory-right { /* used by odd-index photos  */ }
.polaroid:hover .polaroid-memory-right,
.polaroid:focus-within .polaroid-memory-right {
  transform: rotate(1.5deg) translateY(0) scale(1);
}
/* Keep the polaroid above its memory's tape strip */
.polaroid { z-index: 1; }
.polaroid:hover { z-index: 10; }

/* Portrait polaroids — taller, narrower frame. The default 8% inset clips
   the leading character of long lines (e.g. "1週間" → "週間"). Reduce the
   inset, shrink font, and let lines breathe so text fits cleanly. */
.polaroid-portrait .polaroid-memory {
  top: 6%; left: 5%; right: 5%; bottom: 10%;
  padding: 16px 14px;
  font-size: 16px;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .polaroid-memory { font-size: 16px; padding: 14px; }
}
/* fall-back handwriting font via Google if Caveat isn't loaded:
   browsers gracefully ignore unknown families → Noto Sans JP kicks in. */

.polaroid-1 { width: 300px; }
.polaroid-2 { width: 220px; }
.polaroid-3 { width: 320px; }

/* Portrait-oriented photo → taller image */
.polaroid.polaroid-portrait img { height: 320px; }

.polaroid:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.03) !important;
  box-shadow:
    0 18px 38px rgba(28,28,28,.26),
    0 4px 10px rgba(28,28,28,.10);
  z-index: 2;
}

@media (max-width: 720px) {
  .polaroid-1, .polaroid-2, .polaroid-3 { width: min(85vw, 320px); }
  .polaroid img { height: 220px; }
  .polaroid-2 img { height: 280px; }
}
@media (prefers-reduced-motion: reduce) {
  .polaroid, .polaroid:hover { transition: none; transform: none; }
}

/* ========== YOUTUBE GALLERY ========== */
.yt-gallery {
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 48px);
  background: #FAFAF7;
}
.yt-title {
  font-family: "Raleway", "Noto Sans JP", sans-serif;
  font-weight: 900; font-size: clamp(22px, 3vw, 30px);
  text-align: center; margin: 0 0 28px; color: #1C1C1C;
}
.yt-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.yt-card {
  all: unset; cursor: pointer;
  border-radius: 14px; overflow: hidden;
  background: #fff; box-shadow: 0 4px 14px rgba(28,28,28,.08);
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex; flex-direction: column;
}
.yt-card:hover, .yt-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(28,28,28,.18);
  outline: 2px solid #8BE89C;
}
.yt-thumb-wrap {
  position: relative; aspect-ratio: 16/9; background: #0d0d0d;
  overflow: hidden;
}
.yt-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-play {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  color: #fff; font-size: 44px; text-shadow: 0 2px 8px rgba(0,0,0,.6);
  opacity: .92;
  transition: transform .25s ease;
}
.yt-card:hover .yt-play { transform: scale(1.15); }
.yt-card-title {
  padding: 10px 14px 14px;
  font-size: 14px; font-weight: 600; line-height: 1.35;
  color: #1C1C1C;
}

/* ===== Admin-gated UI =====================================================
 * Edit/delete controls are visible only when body.is-admin is present
 * (set by main.js when URL has ?admin=1). Fans see a read-only site.
 * ========================================================================== */
body:not(.is-admin) #modal-edit,
body:not(.is-admin) #modal-delete,
body:not(.is-admin) #modal-edit-controls,
body:not(.is-admin) .cc-act-edit,
body:not(.is-admin) .cc-act-delete,
body:not(.is-admin) .cc-act-drag,
body:not(.is-admin) .cluster-card-actions,
body:not(.is-admin) .sd-btn-delete,
body:not(.is-admin) .sd-btn-pin,
body:not(.is-admin) #sd-apply,
body:not(.is-admin) .ph-pin-btn,
body:not(.is-admin) .modal-photo-pin {
  display: none !important;
}

/* ===== Admin "Publish" floating button ====================================
 * Injected by scripts/publish.js when body.is-admin. POSTs the merged
 * places overlay to /api/publish, which commits to GitHub.
 * ========================================================================== */
#admin-publish {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  padding: 10px 16px;
  font: 600 13px/1 "Raleway", "Noto Sans JP", sans-serif;
  letter-spacing: 0.04em;
  color: #fff;
  background: #1C1C1C;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
#admin-publish:hover { transform: translateY(-1px); background: #2A2A2A; }
#admin-publish[data-kind="busy"] { background: #4A4A4A; cursor: progress; }
#admin-publish[data-kind="ok"]   { background: #1F7A3A; }
#admin-publish[data-kind="err"]  { background: #B23A3A; }
body:not(.is-admin) #admin-publish { display: none !important; }
