/* color tokens */
:root {
  --bg: #ffffff;
  --surface: #fff5f5;
  --surface-alt: #ffe8e8;
  --border: #cc0000;
  --border-light: #e8a0a0;
  --accent: #cc0000;
  --accent-dim: #990000;
  --header-bg: #cc0000;
  --text: #111111;
  --text-muted: #555555;
  --text-on-accent: #ffffff;
  --font-sans: "MS Mincho", "ＭＳ 明朝", Georgia, serif;
  --font-mono: "Courier New", monospace;
  --max-w: 100%;
  --sidebar-w: clamp(160px, 15vw, 260px);
}

/* reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: clamp(14px, 1.2vw, 20px); scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M8 0L16 8L8 16L0 8Z' fill='none' stroke='%23ffcccc' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 16px 16px; /* keep tile fine at any size */
}

a { color: var(--accent); text-decoration: underline; }
a:hover { color: var(--accent-dim); text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── layout ──────────────────────────────────────────────── */
.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(12px, 2.5vw, 48px);
}

.site-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(10px, 1.2vw, 24px);
  display: flex;
  align-items: flex-start;
  gap: clamp(10px, 1.2vw, 24px);
}

/* ── site banner ─────────────────────────────────────────── */
.site-banner {
  background: var(--header-bg);
  padding: 0.7em 0;
}
.site-banner .page-wrap {
  display: flex;
  align-items: baseline;
  gap: 1em;
}
.banner-logo {
  font-size: 2rem;
  font-weight: bold;
  text-decoration: none;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, #fff 0%, #fff 30%, #ffaaaa 50%, #fff 70%, #fff 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: logo-shine 4s linear infinite;
}
.banner-logo:hover { text-decoration: none; }
@keyframes logo-shine {
  from { background-position: 200% center; }
  to   { background-position: -200% center; }
}
.banner-tagline {
  font-size: 0.92rem;
  color: #ffcccc;
  font-style: italic;
}

/* ── marquee ─────────────────────────────────────────────── */
.retro-marquee {
  background: #ffff00;
  color: var(--accent);
  overflow: hidden;
  padding: 0.25em 0;
  font-size: 0.92rem;
  font-weight: bold;
  border-bottom: 1px solid var(--border);
}
.retro-marquee-inner {
  display: flex;
  width: max-content;
  animation: marquee-scroll 30s linear infinite;
}
.retro-marquee-inner span { padding-right: 80px; white-space: nowrap; }

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── nav ─────────────────────────────────────────────────── */
nav {
  background: #f0f0f0;
  border-bottom: 2px solid var(--border);
  padding: 0.33em 0;
}
nav .page-wrap {
  display: flex;
  align-items: center;
  gap: 0.33em;
}
.nav-links {
  display: flex;
  gap: 0.25em;
  list-style: none;
}
.nav-links a {
  display: block;
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 0.92rem;
  font-weight: bold;
  padding: 0.25em 0.83em;
  border: 1px solid var(--accent-dim);
  text-decoration: none;
}
.nav-links a:hover { background: var(--accent-dim); color: var(--text-on-accent); }
.nav-links a.active { background: var(--accent-dim); border-color: #660000; }

/* ── sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-box {
  border: 1px solid var(--border);
  background: var(--surface);
}
.sidebar-box-header {
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 0.83rem;
  font-weight: bold;
  padding: 0.2em 0.5em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sidebar-box ul { list-style: none; padding: 4px 0; }
.sidebar-box ul li a {
  display: block;
  padding: 0.2em 0.5em;
  font-size: 0.92rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--border-light);
}
.sidebar-box ul li:last-child a { border-bottom: none; }
.sidebar-box ul li a:hover { background: var(--surface-alt); }
.sidebar-box p {
  padding: 0.33em 0.5em;
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.visitor-count-box {
  background: #111111;
  margin: 0.33em 0.5em 0;
  border: 1px solid #440000;
  padding: 0.25em 0.5em;
}
.visitor-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.visitor-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #884444;
  letter-spacing: 0.05em;
}
.visitor-num {
  font-family: var(--font-mono);
  color: #ff4444;
  font-size: 1.08rem;
  letter-spacing: 0.15em;
}
.visitor-since {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: #553333;
  text-align: center;
  background: #111111;
  padding: 0 0.5em 0.25em;
  margin: 0 0.5em 0.33em;
  border: 1px solid #440000;
  border-top: none;
}

/* ── main content ────────────────────────────────────────── */
.main-content { flex: 1; min-width: 0; }

/* ── retro section header bar ────────────────────────────── */
.retro-header {
  display: block;
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 0.92rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25em 0.67em;
  margin-bottom: 0.5em;
  border-left: 4px solid var(--accent-dim);
}

/* ── headings ────────────────────────────────────────────── */
h1 { font-size: 1.5rem; line-height: 1.2; }
h2 { font-size: 1.17rem; }
h3 { font-size: 1rem; }

/* ── hero (home page) ────────────────────────────────────── */
.hero {
  padding: 12px 0 10px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 10px;
}
.hero h1 { margin-bottom: 0.33em; font-size: 1.83rem; }
.hero p { color: var(--text-muted); font-size: 1rem; }
.hero .accent { color: var(--accent); }

/* ── track card (music page) ─────────────────────────────── */
.track-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.track-card {
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.player-box-header {
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 0.83rem;
  font-weight: bold;
  padding: 0.2em 0.67em;
  border-bottom: 1px solid var(--accent-dim);
}
.track-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px 4px;
}
.track-title { font-size: 1rem; font-weight: bold; }
.track-meta { font-size: 0.83rem; color: var(--text-muted); }

audio {
  width: 100%;
  padding: 0 8px 8px;
  accent-color: var(--accent);
}

/* ── blog post list ──────────────────────────────────────── */
.post-list { display: flex; flex-direction: column; }
.post-list-item { padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.post-list-item:last-child { border-bottom: none; }
.post-list-item h2 { font-size: 1.08rem; margin-bottom: 2px; }
.post-list-item .post-date { font-size: 0.83rem; color: var(--text-muted); }
.post-list-item p { font-size: 0.92rem; color: var(--text-muted); margin-top: 3px; }

/* ── blog post body ──────────────────────────────────────── */
.post-header { margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.post-header h1 { margin-bottom: 4px; }
.post-date { font-size: 0.83rem; color: var(--text-muted); }

.post-body { max-width: 64ch; }
.post-body p { margin-bottom: 8px; font-size: 1rem; }
.post-body h2 { margin: 14px 0 4px; }
.post-body h3 { margin: 10px 0 3px; }
.post-body ul, .post-body ol { padding-left: 16px; margin-bottom: 8px; }
.post-body li + li { margin-top: 2px; }
.post-body code { font-family: var(--font-mono); font-size: 0.92rem; background: var(--surface-alt); padding: 1px 3px; border: 1px solid var(--border-light); }
.post-body pre { background: var(--surface-alt); border: 1px solid var(--border); padding: 8px; overflow-x: auto; margin-bottom: 8px; }
.post-body pre code { background: none; padding: 0; border: none; }
.post-body blockquote { border-left: 3px solid var(--accent); padding-left: 8px; color: var(--text-muted); margin-bottom: 8px; background: var(--surface-alt); }

/* ── separator ───────────────────────────────────────────── */
hr {
  border: none;
  margin: 10px 0;
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.5em;
  color: var(--accent);
  text-shadow: 0 0 6px var(--border-light);
}
hr::before { content: '\2605 \25C6 \2605 \25C6 \2605'; }

/* ── page title (inner pages) ────────────────────────────── */
.page-title { margin-bottom: 10px; }
.page-title h1 { margin-bottom: 2px; }
.page-title p { color: var(--text-muted); font-size: 0.92rem; }

/* ── blink NEW badge ─────────────────────────────────────── */
.blink {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 0 0.25em;
  margin-left: 0.33em;
  animation: blink-anim 1s step-end infinite;
  vertical-align: middle;
}
@keyframes blink-anim {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── footer ──────────────────────────────────────────────── */
footer {
  border-top: 2px solid var(--border);
  padding: 0.67em 0;
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-muted);
  background: #f9f0f0;
}
footer a { color: var(--accent); font-size: 0.83rem; }

/* ── sparkle divider ─────────────────────────────────────── */
.sparkle-divider {
  text-align: center;
  color: var(--accent);
  letter-spacing: 0.67em;
  font-size: 1rem;
  margin: 8px 0;
  text-shadow: 0 0 6px var(--border-light), 0 0 12px var(--border-light);
}

/* ── starburst badge ─────────────────────────────────────── */
.starburst {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.33rem;
  height: 2.33rem;
  background: var(--accent-dim);
  color: white;
  font-size: 0.5rem;
  font-weight: bold;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  vertical-align: middle;
  margin-left: 0.33em;
  animation: starburst-pulse 2s ease-in-out infinite;
}
@keyframes starburst-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.1); }
}

/* ── sidebar: status box ─────────────────────────────────── */
.status-box { padding: 4px 6px; }
.status-row {
  font-size: 0.83rem;
  color: var(--text-muted);
  padding: 1px 0;
  border-bottom: 1px dotted var(--border-light);
  line-height: 1.5;
}
.status-row:last-child { border-bottom: none; }
.status-label { color: var(--accent); font-weight: bold; margin-right: 2px; }

/* ── sidebar: update log ─────────────────────────────────── */
.update-log { list-style: none; padding: 4px 6px; }
.update-log li {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-bottom: 1px dotted var(--border-light);
  padding: 2px 0;
  line-height: 1.5;
}
.update-log li:last-child { border-bottom: none; }
.update-date {
  display: block;
  color: var(--accent);
  font-weight: bold;
  font-size: 0.67rem;
  letter-spacing: 0.05em;
}

/* ── sidebar: 88x31 webring buttons ──────────────────────── */
.webring-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 6px;
}
.webring-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 31px;
  background: var(--surface-alt);
  border: 1px dashed var(--border-light);
  font-size: 0.67rem;
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.webring-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }

/* ── BGM button ──────────────────────────────────────────── */
.bgm-btn {
  display: block;
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: bold;
  padding: 0.33em 0.5em;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.1em;
}
.bgm-btn:hover { background: var(--surface); border-color: var(--accent); }

/* ── under construction ──────────────────────────────────── */
.under-construction {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: var(--surface-alt);
  border: 2px dashed var(--accent);
  padding: 0.5em 1em;
  font-size: 0.92rem;
  font-weight: bold;
  color: var(--accent);
  margin: 8px 0;
}
.uc-icon { font-size: 1.33rem; animation: blink-anim 1s step-end infinite; }

/* ── web clap ────────────────────────────────────────────── */
.clap-section {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}
.clap-btn {
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: bold;
  padding: 0.33em 1.17em;
  cursor: pointer;
  letter-spacing: 0.05em;
}
.clap-btn:hover { background: var(--surface-alt); }

/* ── custom scrollbar (webkit) ───────────────────────────── */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #fff5f5; }
::-webkit-scrollbar-thumb { background: var(--accent); border: 2px solid #fff5f5; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ── sparkle cursor (?tweak=1) ───────────────────────────── */
body.tweak-cursor,
body.tweak-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2 7 7 2-7 2-2 7-2-7-7-2 7-2z' fill='%23cc0000' stroke='%23990000' stroke-width='0.5'/%3E%3C/svg%3E") 12 12, auto;
}
