/* ===== Design System ===== */
:root {
  --c-bg: #f5f5f0;
  --c-surface: #ffffff;
  --c-text: #1a1a2e;
  --c-text-secondary: #555566;
  --c-text-muted: #8888a0;
  --c-primary: #4a3aff;
  --c-primary-dark: #3628cc;
  --c-primary-light: #ededff;
  --c-accent: #ff6b4a;
  --c-accent-light: #fff0ed;
  --c-border: #e8e8ee;
  --c-border-light: #f0f0f5;
  --c-gradient-start: #1a1a2e;
  --c-gradient-mid: #302b63;
  --c-gradient-end: #4a3aff;
  --shadow-sm: 0 1px 3px rgba(26,26,46,.06);
  --shadow-md: 0 4px 16px rgba(26,26,46,.08);
  --shadow-lg: 0 12px 40px rgba(26,26,46,.12);
  --shadow-card: 0 2px 12px rgba(26,26,46,.06);
  --shadow-card-hover: 0 12px 32px rgba(74,58,255,.15);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-sans: "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", Consolas, monospace;
  --transition: .25s cubic-bezier(.4, 0, .2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-sans);
  color: var(--c-text); background: var(--c-bg); line-height: 1.85;
  letter-spacing: .01em;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

.container { max-width: 1000px; margin: 0 auto; padding: 0 24px; }

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, var(--c-gradient-start) 0%, var(--c-gradient-mid) 50%, var(--c-gradient-end) 100%);
  color: #fff; padding: 56px 0 48px; text-align: center;
  position: relative; overflow: hidden;
}
.site-header::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 600px 300px at 20% 80%, rgba(255,107,74,.2), transparent),
    radial-gradient(ellipse 400px 400px at 80% 20%, rgba(74,58,255,.3), transparent);
  pointer-events: none;
}
.site-header .container { position: relative; z-index: 1; }
.site-title { font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.site-title .subtitle {
  display: block; font-size: 1rem; font-weight: 400; margin-top: 6px;
  opacity: .75; letter-spacing: .06em;
}
.site-lead { margin-top: 16px; font-size: .95rem; opacity: .85; max-width: 540px; margin-left: auto; margin-right: auto; }

/* ===== Nav ===== */
.site-nav {
  background: var(--c-surface); border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px); background: rgba(255,255,255,.92);
}
.nav-list { display: flex; gap: 0; list-style: none; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nav-list li a {
  display: block; padding: 16px 22px; font-size: .86rem; font-weight: 600;
  white-space: nowrap; color: var(--c-text-secondary);
  border-bottom: 2.5px solid transparent; transition: var(--transition);
  letter-spacing: .02em;
}
.nav-list li a:hover { color: var(--c-primary); }
.nav-list li a.active {
  color: var(--c-primary); border-bottom-color: var(--c-primary);
}
/* BBS link: hidden in modern mode, shown only in retro mode */
.nav-bbs { display: none; }
body.retro .nav-bbs { display: list-item; }

/* ===== Hero ===== */
.hero { text-align: center; padding: 64px 0 48px; }
.hero h2 {
  font-size: 1.5rem; font-weight: 800; line-height: 1.8; color: var(--c-text);
  letter-spacing: -.01em;
}
.hero h2 br + br { display: none; }

/* ===== Cards ===== */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; padding-bottom: 56px; }
.card {
  background: var(--c-surface); border-radius: var(--radius-lg); padding: 36px 30px; display: flex;
  flex-direction: column; box-shadow: var(--shadow-card); transition: var(--transition);
  border: 1px solid var(--c-border-light); position: relative; overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  opacity: 0; transition: var(--transition);
}
.card:hover {
  transform: translateY(-6px); box-shadow: var(--shadow-card-hover);
  border-color: transparent;
}
.card:hover::before { opacity: 1; }
.card-icon {
  font-size: 2.2rem; margin-bottom: 16px;
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  background: var(--c-primary-light); border-radius: var(--radius-sm);
}
.card h3 {
  font-size: 1.08rem; font-weight: 700; margin-bottom: 10px;
  color: var(--c-text); letter-spacing: -.01em;
}
.card p { font-size: .88rem; color: var(--c-text-secondary); margin-bottom: 20px; line-height: 1.7; flex: 1; }
.card-link {
  font-size: .84rem; font-weight: 700; color: var(--c-primary);
  display: inline-flex; align-items: center; gap: 4px; transition: var(--transition);
}
.card:hover .card-link { gap: 8px; }

/* ===== Comparison Table ===== */
.comparison { padding: 40px 0 64px; }
.comparison h2 {
  font-size: 1.4rem; text-align: center; margin-bottom: 28px;
  font-weight: 800; letter-spacing: -.01em;
}
table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--c-surface); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow-md);
}
thead th {
  background: var(--c-gradient-start); color: #fff;
  padding: 16px 24px; text-align: left; font-size: .88rem; font-weight: 600;
  letter-spacing: .03em;
}
tbody td {
  padding: 16px 24px; border-bottom: 1px solid var(--c-border-light); font-size: .9rem;
  color: var(--c-text-secondary);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--c-primary-light); }

/* ===== Article Page ===== */
.article {
  background: var(--c-surface); border-radius: var(--radius-lg); padding: 56px 48px;
  margin: 36px 0; box-shadow: var(--shadow-md); border: 1px solid var(--c-border-light);
}
.article h1 {
  font-size: 1.7rem; margin-bottom: 12px; font-weight: 800;
  color: var(--c-text); letter-spacing: -.02em; line-height: 1.5;
}
.article .lead {
  color: var(--c-text-muted); font-size: .92rem; margin-bottom: 36px;
  padding-bottom: 28px; border-bottom: 1px solid var(--c-border);
  line-height: 1.8;
}
.article h2 {
  font-size: 1.25rem; margin: 48px 0 18px; padding-bottom: 10px;
  border-bottom: 2px solid var(--c-primary-light); color: var(--c-text);
  font-weight: 800; letter-spacing: -.01em;
  position: relative;
}
.article h2::after {
  content: "";
  position: absolute; bottom: -2px; left: 0; width: 48px; height: 2px;
  background: var(--c-primary);
}
.article h3 {
  font-size: 1.05rem; margin: 32px 0 14px; color: var(--c-text);
  font-weight: 700; letter-spacing: -.01em;
}
.article p { margin-bottom: 18px; color: var(--c-text-secondary); }
.article ul, .article ol { margin: 0 0 18px 24px; }
.article li { margin-bottom: 8px; color: var(--c-text-secondary); }
.article strong { color: var(--c-text); }
.article pre {
  background: #1e1e2e; color: #cdd6f4; padding: 24px 28px; border-radius: var(--radius-md);
  overflow-x: auto; font-size: .84rem; line-height: 1.7; margin: 18px 0 28px;
  border: 1px solid rgba(255,255,255,.06);
}
.article code { font-family: var(--font-mono); }
.article p code, .article li code {
  background: var(--c-primary-light); color: var(--c-primary); padding: 2px 8px;
  border-radius: 5px; font-size: .86em; font-weight: 500;
}
.article table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin: 18px 0 28px; border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--c-border);
}
.article table th {
  background: var(--c-bg); padding: 12px 18px; text-align: left;
  font-size: .86rem; font-weight: 700; color: var(--c-text);
  border-bottom: 1px solid var(--c-border);
}
.article table td {
  padding: 12px 18px; font-size: .86rem; color: var(--c-text-secondary);
  border-bottom: 1px solid var(--c-border-light);
}
.article table tr:last-child td { border-bottom: none; }
.article blockquote {
  border-left: 4px solid var(--c-primary); padding: 16px 24px; margin: 18px 0 28px;
  background: var(--c-primary-light); color: var(--c-text-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}
.article .summary-box {
  background: linear-gradient(135deg, var(--c-primary-light), var(--c-accent-light));
  border-radius: var(--radius-md); padding: 28px; margin: 36px 0;
}
.article .summary-box p:last-child { margin-bottom: 0; }
.article hr { border: none; border-top: 1px solid var(--c-border); margin: 40px 0; }

/* ===== Retro elements: hidden by default (shown via retro.css when body.retro) ===== */
.retro-marquee { display: none; }
.retro-construction { display: none; }
.retro-flash-theater { display: none; }
.retro-visitor-counter { display: none; }
.retro-guestbook { display: none; }

/* ===== Footer ===== */
.site-footer {
  background: var(--c-gradient-start); color: rgba(255,255,255,.5);
  text-align: center; padding: 28px 0; font-size: .82rem;
  margin-top: 32px; letter-spacing: .02em;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .site-header { padding: 40px 0 32px; }
  .site-title { font-size: 1.5rem; }
  .hero { padding: 48px 0 32px; }
  .hero h2 { font-size: 1.15rem; }
  .cards { grid-template-columns: 1fr; gap: 16px; }
  .article { padding: 32px 22px; margin: 24px 0; }
  .article h1 { font-size: 1.35rem; }
  .article h2 { font-size: 1.12rem; }
  .nav-list li a { padding: 14px 16px; font-size: .82rem; }
  .container { padding: 0 18px; }
  thead th, tbody td { padding: 12px 16px; font-size: .84rem; }
}

@media (max-width: 480px) {
  .site-title { font-size: 1.3rem; }
  .site-title .subtitle { font-size: .88rem; }
  .hero h2 { font-size: 1.05rem; }
  .card { padding: 28px 22px; }
  .article { padding: 24px 18px; }
  .article pre { padding: 18px 16px; font-size: .8rem; }
}
