/*
Theme Name: Leap Year Lab
Theme URI: https://leap-year-lab.jp
Author: Leap Year Lab
Description: うるう年専門サイト「うるう年ラボ」のWordPressテーマ。宇宙的エンタメビジュアル×SEO特化設計。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: leap-year-lab
Tags: blog, custom-colors, custom-logo, full-width-template, editor-style
*/

/* =====================================================
   DESIGN TOKENS
   ===================================================== */
:root {
  /* Colors */
  --c-void:        #04050a;
  --c-deep:        #080c18;
  --c-cosmos:      #0d1530;
  --c-nebula:      #111e45;
  --c-accent:      #4a9eff;
  --c-accent-glow: #7bbfff;
  --c-leap:        #ff6b35;
  --c-leap-glow:   #ff9a71;
  --c-gold:        #f5c842;
  --c-gold-dim:    #c9a030;
  --c-text:        #e8eaf6;
  --c-muted:       #8892b0;
  --c-faint:       #3d4a6e;
  --c-surface:     rgba(13,21,48,0.7);
  --c-surface-2:   rgba(26,38,80,0.5);
  --c-border:      rgba(74,158,255,0.2);

  /* Light section colors — 信頼感のある白・淡色 */
  --c-light-bg:    #f8f9ff;
  --c-light-bg2:   #eef1fb;
  --c-light-text:  #0d1530;
  --c-light-muted: #4a5280;
  --c-light-border:#c8d0f0;
  --c-light-accent:#1a6fd4;
  --c-light-leap:  #d94f1a;

  /* Typography */
  --f-display: 'Playfair Display', 'Georgia', serif;
  --f-heading: 'Space Grotesk', sans-serif;
  --f-body:    'Noto Sans JP', sans-serif;
  --f-mono:    'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* Layout */
  --max-w:       1200px;
  --max-w-text:  720px;
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur-fast:    150ms;
  --dur-mid:     300ms;
  --dur-slow:    600ms;
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--c-void);
  color: var(--c-text);
  font-family: var(--f-body);
  line-height: 1.8;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* =====================================================
   TYPOGRAPHY SCALE
   ===================================================== */
.t-hero    { font-family: var(--f-display); font-size: clamp(3.5rem, 9vw, 8rem); font-weight: 900; line-height: 1.0; letter-spacing: -0.02em; }
.t-display { font-family: var(--f-display); font-size: clamp(2.2rem, 5vw, 4rem);  font-weight: 700; line-height: 1.1; }
.t-h1      { font-family: var(--f-heading); font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 700; line-height: 1.2; }
.t-h2      { font-family: var(--f-heading); font-size: clamp(1.4rem, 2.5vw, 2rem);   font-weight: 600; line-height: 1.3; }
.t-h3      { font-family: var(--f-heading); font-size: clamp(1.1rem, 2vw, 1.4rem);   font-weight: 600; line-height: 1.4; }
.t-body    { font-family: var(--f-body);    font-size: 1rem;   line-height: 1.8; }
.t-small   { font-family: var(--f-body);    font-size: .875rem; color: var(--c-muted); }
.t-mono    { font-family: var(--f-mono);    font-size: .8125rem; }

/* =====================================================
   LAYOUT UTILITIES
   ===================================================== */
.container  { max-width: var(--max-w);      margin-inline: auto; padding-inline: var(--space-xl); }
.container--narrow { max-width: var(--max-w-text); margin-inline: auto; padding-inline: var(--space-xl); }
.section    { padding-block: var(--space-3xl); }
.section--lg { padding-block: 120px; }

/* =====================================================
   HEADER / NAVIGATION
   ===================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: var(--space-md) 0;
  transition: background var(--dur-mid) var(--ease-smooth),
              backdrop-filter var(--dur-mid) var(--ease-smooth);
}
.site-header.scrolled {
  background: rgba(4,5,10,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-border);
}
.header-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
}
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--f-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-text);
}
.site-logo .logo-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: block;
  flex-shrink: 0;
}
.site-logo .logo-text span { color: var(--c-accent); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.nav-menu a {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-family: var(--f-heading);
  font-size: .9rem;
  font-weight: 500;
  color: var(--c-muted);
  transition: color var(--dur-fast), background var(--dur-fast);
}
.nav-menu a:hover,
.nav-menu a.active {
  color: var(--c-text);
  background: var(--c-surface-2);
}
.nav-cta {
  padding: var(--space-sm) var(--space-lg) !important;
  background: linear-gradient(135deg, var(--c-leap), #ff4500) !important;
  color: #fff !important;
  border-radius: var(--radius-full) !important;
  font-weight: 600 !important;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255,107,53,.4) !important;
}

/* =====================================================
   HERO SECTION
   ===================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Canvas stars background */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

/* Orbit rings */
.orbit-rings {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}
.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  animation: orbit-spin linear infinite;
}
.orbit-ring:nth-child(1) {
  width: 600px; height: 600px;
  border-color: rgba(74,158,255,0.12);
  animation-duration: 60s;
}
.orbit-ring:nth-child(2) {
  width: 900px; height: 900px;
  border-color: rgba(74,158,255,0.07);
  animation-duration: 90s;
  animation-direction: reverse;
}
.orbit-ring:nth-child(3) {
  width: 1200px; height: 1200px;
  border-color: rgba(255,107,53,0.05);
  animation-duration: 120s;
}

/* Leap number — giant background text */
.hero-bg-number {
  position: absolute;
  right: -5vw;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--f-display);
  font-size: clamp(200px, 35vw, 480px);
  font-weight: 900;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(74,158,255,0.08);
  user-select: none;
  z-index: 1;
  animation: bg-number-float 8s ease-in-out infinite;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--space-xl);
  padding-top: 100px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: rgba(255,107,53,0.12);
  border: 1px solid rgba(255,107,53,0.3);
  border-radius: var(--radius-full);
  font-family: var(--f-heading);
  font-size: .8125rem;
  font-weight: 600;
  color: var(--c-leap);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: var(--space-lg);
  animation: fade-up .8s var(--ease-smooth) both;
}
.hero-eyebrow .dot {
  width: 6px; height: 6px;
  background: var(--c-leap);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero-title {
  font-family: var(--f-display);
  font-size: clamp(3.2rem, 8vw, 7.5rem);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
  animation: fade-up .8s .1s var(--ease-smooth) both;
}
.hero-title .line-1 { display: block; color: var(--c-text); }
.hero-title .line-2 {
  display: block;
  background: linear-gradient(90deg, var(--c-leap), var(--c-gold), var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-title .line-3 { display: block; color: var(--c-muted); font-size: 0.55em; font-weight: 400; letter-spacing: 0; line-height: 1.6; margin-top: .5rem; font-family: var(--f-body); }

.hero-desc {
  max-width: 560px;
  font-size: 1.125rem;
  color: var(--c-muted);
  line-height: 1.8;
  margin-bottom: var(--space-xl);
  animation: fade-up .8s .2s var(--ease-smooth) both;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-3xl);
  animation: fade-up .8s .3s var(--ease-smooth) both;
}

/* Countdown bar in hero */
.hero-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: var(--space-lg) var(--space-lg);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  animation: fade-up .8s .4s var(--ease-smooth) both;
}
.countdown-item {
  text-align: center;
  padding-inline: 14px;
}
.countdown-num {
  font-family: var(--f-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--c-accent);
  line-height: 1;
  display: block;
}
.countdown-label {
  font-size: .7rem;
  color: var(--c-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  display: block;
  margin-top: 4px;
}
.countdown-sep {
  font-family: var(--f-mono);
  font-size: 2rem;
  color: var(--c-faint);
  line-height: 1;
  align-self: flex-start;
  padding-top: 3px;
  flex-shrink: 0;
}
.countdown-info {
  border-left: 1px solid var(--c-border);
  padding-left: var(--space-lg);
  margin-left: var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.countdown-info-label {
  font-size: .8125rem;
  color: var(--c-muted);
}
.countdown-info-year {
  font-family: var(--f-heading);
  font-weight: 600;
  color: var(--c-text);
  font-size: .9375rem;
  white-space: nowrap;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-family: var(--f-heading);
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform var(--dur-fast) var(--ease-bounce),
              box-shadow var(--dur-mid) var(--ease-smooth);
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--c-leap), #ff4500);
  color: #fff;
}
.btn-primary:hover { box-shadow: 0 12px 32px rgba(255,107,53,.45); }

.btn-secondary {
  background: transparent;
  color: var(--c-text);
  border: 1px solid var(--c-border);
}
.btn-secondary:hover {
  background: var(--c-surface-2);
  border-color: rgba(74,158,255,.5);
}

.btn-ghost {
  background: transparent;
  color: var(--c-accent);
  padding-inline: 0;
}
.btn-ghost .arrow {
  transition: transform var(--dur-fast) var(--ease-bounce);
}
.btn-ghost:hover .arrow { transform: translateX(4px); }

/* =====================================================
   CARDS — CONTENT GRID
   ===================================================== */
.card-grid {
  display: grid;
  gap: var(--space-lg);
}
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--4 { grid-template-columns: repeat(4, 1fr); }
.card-grid--2-1 { grid-template-columns: 2fr 1fr; }

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--dur-mid) var(--ease-smooth),
              box-shadow var(--dur-mid) var(--ease-smooth),
              border-color var(--dur-mid);
  backdrop-filter: blur(8px);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(0,0,0,.4), 0 0 0 1px rgba(74,158,255,.2);
  border-color: rgba(74,158,255,.3);
}
.card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--c-cosmos);
  position: relative;
  overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow); }
.card:hover .card-thumb img { transform: scale(1.04); }
.card-body { padding: var(--space-lg); }
.card-cat {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}
.card-cat--tool     { background: rgba(74,158,255,.15);  color: var(--c-accent); }
.card-cat--article  { background: rgba(245,200,66,.12);  color: var(--c-gold);   }
.card-cat--trivia   { background: rgba(255,107,53,.12);  color: var(--c-leap);   }
.card-title {
  font-family: var(--f-heading);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--c-text);
  margin-bottom: var(--space-sm);
}
.card-meta {
  font-size: .8125rem;
  color: var(--c-muted);
}

/* Feature card (tall, interactive CTA) */
.card--feature {
  background: linear-gradient(160deg, var(--c-cosmos) 0%, rgba(74,158,255,.08) 100%);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-height: 300px;
}
.card--feature .feature-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 1.75rem;
}
.card--feature .feature-icon--leap { background: rgba(255,107,53,.15); }
.card--feature .feature-icon--tool { background: rgba(74,158,255,.15); }
.card--feature .feature-icon--quiz { background: rgba(245,200,66,.12); }

/* =====================================================
   SECTION: FEATURED TOOLS
   ===================================================== */
.tools-section { background: linear-gradient(180deg, var(--c-void) 0%, var(--c-deep) 50%, var(--c-void) 100%); }

.tool-strip {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: var(--space-md);
}
.tool-strip::-webkit-scrollbar { display: none; }

.tool-pill {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--dur-fast), transform var(--dur-fast) var(--ease-bounce);
  text-decoration: none;
  color: var(--c-text);
  min-width: 220px;
}
.tool-pill:hover {
  border-color: rgba(74,158,255,.5);
  transform: translateY(-2px);
}
.tool-pill .tool-pill-icon { font-size: 1.5rem; }
.tool-pill .tool-pill-name { font-family: var(--f-heading); font-size: .9375rem; font-weight: 600; }
.tool-pill .tool-pill-desc { font-size: .75rem; color: var(--c-muted); }

/* =====================================================
   SECTION: DATA VISUALIZATION TEASER
   ===================================================== */
.viz-section {
  position: relative;
  overflow: hidden;
}
.viz-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 80% 50%, rgba(74,158,255,.06) 0%, transparent 70%);
  pointer-events: none;
}
.viz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}
.viz-canvas-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--c-border);
  background: var(--c-cosmos);
}
.viz-canvas-wrap canvas { width: 100%; display: block; }

/* =====================================================
   SECTION: ARTICLES
   ===================================================== */
.articles-section { }

.article-list { display: flex; flex-direction: column; gap: var(--space-md); }
.article-row {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--c-text);
  transition: border-color var(--dur-fast), transform var(--dur-fast) var(--ease-bounce);
}
.article-row:hover {
  border-color: rgba(74,158,255,.4);
  transform: translateX(4px);
}
.article-row-num {
  font-family: var(--f-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-faint);
  min-width: 40px;
}
.article-row-title {
  font-family: var(--f-heading);
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}
.article-row-arrow { color: var(--c-muted); transition: transform var(--dur-fast); }
.article-row:hover .article-row-arrow { transform: translateX(4px); color: var(--c-accent); }

/* =====================================================
   SECTION: QUIZ TEASER
   ===================================================== */
.quiz-teaser {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  background: linear-gradient(135deg, var(--c-cosmos), var(--c-nebula));
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  position: relative;
  overflow: hidden;
}
.quiz-teaser::after {
  content: '?';
  position: absolute;
  right: -2rem;
  bottom: -3rem;
  font-family: var(--f-display);
  font-size: 16rem;
  font-weight: 900;
  color: rgba(74,158,255,.04);
  pointer-events: none;
  line-height: 1;
}

/* =====================================================
   SECTION HEADER
   ===================================================== */
.section-header {
  margin-bottom: var(--space-2xl);
}
.section-header--flex {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
}
.section-eyebrow {
  display: inline-block;
  font-family: var(--f-heading);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--space-sm);
}
.section-title {
  font-family: var(--f-heading);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.2;
}
.section-sub {
  margin-top: var(--space-sm);
  font-size: 1rem;
  color: var(--c-muted);
  max-width: 520px;
}

/* =====================================================
   LANGUAGE TOGGLE
   ===================================================== */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.lang-toggle-label {
  font-family: var(--f-heading);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--c-muted);
  transition: color .2s;
  user-select: none;
}
.lang-toggle-label.active { color: var(--c-text); }

.lang-toggle-track {
  position: relative;
  width: 48px;
  height: 24px;
  border-radius: 999px;
  background: rgba(74,158,255,.15);
  border: 1px solid rgba(74,158,255,.3);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.lang-toggle-track:hover {
  background: rgba(74,158,255,.22);
  border-color: rgba(74,158,255,.5);
}
.lang-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  transition: transform .22s var(--ease-bounce);
}
.lang-en .lang-toggle-thumb {
  transform: translateX(24px);
  background: var(--c-accent);
  box-shadow: 0 0 8px rgba(74,158,255,.5);
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  border-top: 1px solid var(--c-border);
  padding-block: var(--space-2xl);
  background: var(--c-void);
}
.footer-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--space-xl);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
}
.footer-brand p {
  font-size: .9rem;
  color: var(--c-muted);
  line-height: 1.7;
  margin-top: var(--space-md);
  max-width: 280px;
}
.footer-col-title {
  font-family: var(--f-heading);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: var(--space-md);
}
.footer-col ul { display: flex; flex-direction: column; gap: 6px; }
.footer-col ul li a {
  font-size: .8125rem;
  font-family: var(--f-heading);
  font-weight: 500;
  color: var(--c-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, transform .15s var(--ease-bounce);
  position: relative;
}
.footer-col ul li a::after {
  content: '→';
  font-size: .6875rem;
  margin-left: auto;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .15s, transform .15s var(--ease-bounce);
  flex-shrink: 0;
}
.footer-col ul li a:hover {
  color: var(--c-text);
  background: rgba(74,158,255,.06);
  border-color: rgba(74,158,255,.18);
  transform: translateX(2px);
}
.footer-col ul li a:hover::after {
  opacity: 1;
  transform: translateX(0);
}
.footer-bottom {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--space-xl);
  padding-top: var(--space-xl);
  margin-top: var(--space-xl);
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8125rem;
  color: var(--c-muted);
}

/* =====================================================
   PAGE TEMPLATES
   ===================================================== */

/* --- Article / Single --- */
.article-header {
  padding-top: 120px;
  padding-bottom: var(--space-3xl);
  background: linear-gradient(180deg, var(--c-deep) 0%, var(--c-void) 100%);
  text-align: center;
}
/* =====================================================
   ARTICLE BODY — リッチ装飾
   ===================================================== */
.article-body {
  padding-block: var(--space-3xl);
  /* 白背景で読みやすく */
  background: var(--c-light-bg);
  color: var(--c-light-text);
}
.article-body .container--narrow {
  max-width: var(--max-w-text);
  margin-inline: auto;
  padding-inline: var(--space-xl);
}

/* H2: 宇宙グラデ帯 */
.article-body h2 {
  font-family: var(--f-heading);
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-weight: 700;
  margin: 2.5em 0 .75em;
  position: relative;
  padding: 12px 44px 12px 16px;
  background: linear-gradient(135deg, #0d1530 0%, #1a2a5e 100%);
  color: #e8eaf6;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
}
/* 左の縦線 */
.article-body h2::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--c-accent), var(--c-leap));
  flex-shrink: 0;
}
/* 右の✦装飾 */
.article-body h2::after {
  content: '✦';
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: .8125rem;
  color: rgba(74,158,255,.35);
  pointer-events: none;
}
/* JS挿入の番号バッジ */
.article-body h2 .h2-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(74,158,255,.2);
  border: 1px solid rgba(74,158,255,.3);
  font-family: var(--f-mono);
  font-size: .75rem;
  font-weight: 700;
  color: #7bbfff;
  flex-shrink: 0;
  letter-spacing: 0;
  line-height: 1;
}

/* H3: アクセントライン */
.article-body h3 {
  font-family: var(--f-heading);
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  font-weight: 700;
  margin: 2em 0 .6em;
  color: var(--c-light-text);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--c-light-bg2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.article-body h3::before {
  content: '';
  display: inline-block;
  width: 4px; height: 1.1em;
  background: linear-gradient(180deg, var(--c-accent), #7bbfff);
  border-radius: 2px;
  flex-shrink: 0;
}

/* 本文 */
.article-body p {
  color: var(--c-light-muted);
  margin-bottom: 1.4em;
  line-height: 1.95;
  font-size: 1rem;
}

/* strong強調 */
.article-body strong {
  color: var(--c-light-text);
  font-weight: 700;
  background: linear-gradient(transparent 60%, rgba(74,158,255,.18) 60%);
}

/* リンク */
.article-body a {
  color: var(--c-light-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(26,111,212,.35);
  transition: color .15s, text-decoration-color .15s;
}
.article-body a:hover {
  text-decoration-color: var(--c-light-accent);
}

/* ULリスト — 宇宙ドット */
.article-body ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.5em;
}
.article-body ul li {
  color: var(--c-light-muted);
  padding: 8px 0 8px 28px;
  position: relative;
  border-bottom: 1px solid var(--c-light-bg2);
  line-height: 1.7;
}
.article-body ul li:last-child { border-bottom: none; }
.article-body ul li::before {
  content: '';
  position: absolute;
  left: 6px; top: 17px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), #7bbfff);
  box-shadow: 0 0 6px rgba(74,158,255,.5);
}

/* OLリスト */
.article-body ol {
  padding-left: 0;
  margin-bottom: 1.5em;
  counter-reset: article-ol;
}
.article-body ol li {
  color: var(--c-light-muted);
  padding: 10px 0 10px 44px;
  position: relative;
  border-bottom: 1px solid var(--c-light-bg2);
  line-height: 1.7;
  counter-increment: article-ol;
}
.article-body ol li:last-child { border-bottom: none; }
.article-body ol li::before {
  content: counter(article-ol);
  position: absolute;
  left: 0; top: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d1530, #1a2a5e);
  color: var(--c-accent);
  font-family: var(--f-mono);
  font-size: .8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(74,158,255,.3);
}

/* ポイントボックス（h3直後の p を装飾） */
.article-body .point-box {
  background: linear-gradient(135deg, #eef1fb, #f8f9ff);
  border: 1px solid var(--c-light-border);
  border-left: 4px solid var(--c-accent);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-xl);
}

/* 計算式ブロック */
.article-body .calc-box {
  background: var(--c-light-text);
  color: #e8eaf6;
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-xl);
  font-family: var(--f-mono);
  font-size: .9375rem;
  line-height: 2;
  border-left: 4px solid var(--c-accent);
}

/* TOC */
/* =====================================================
   TOC BOX — 宇宙ステーション風
   ===================================================== */
.toc-box {
  background: #fff;
  border: 2px solid #e0e8ff;
  border-radius: 20px;
  padding: 28px 28px 20px;
  margin-bottom: var(--space-2xl);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(13,21,48,.08);
}

/* 右上の惑星デコ */
.toc-box::after {
  content: '🚀';
  position: absolute;
  right: 20px; top: 16px;
  font-size: 2rem;
  opacity: .25;
  pointer-events: none;
  transform: rotate(30deg);
}

/* ヘッダー部分：グラデ帯 */
.toc-box h4 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-heading);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #1a6fd4;
  margin-bottom: 20px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #eef4ff, #e0e8ff);
  border-radius: 999px;
  border: 1px solid #c8d8f8;
}
.toc-box h4::before {
  content: '✦';
  font-size: .875rem;
  color: #4a9eff;
}

/* リスト本体 */
.toc-box ol {
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-box ol li {
  list-style: none;
  position: relative;
  border-bottom: none;
  color: #3a4a7a;
  padding: 0;
}
/* article-body ol li::before が TOC に入り込まないようにする */
#toc-list li::before { display: none !important; }

/* 各項目：カード風 */
.toc-box ol li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f8f9ff;
  border: 1px solid #e0e8ff;
  border-radius: 10px;
  color: #2a3a6a;
  text-decoration: none;
  font-size: .9rem;
  font-family: var(--f-heading);
  font-weight: 500;
  transition: background .15s, border-color .15s, transform .15s;
  line-height: 1.4;
}

/* 番号バッジ：惑星カラー */
/* 番号バッジ — JSで .toc-num spanを挿入するためCSSカウンターは使わない */
.toc-box ol li a .toc-num {
  font-family: var(--f-mono);
  font-size: .75rem;
  font-weight: 700;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #4a9eff, #1a6fd4);
  color: #fff;
  box-shadow: 0 2px 8px rgba(74,158,255,.35);
}

/* カラーバリエーション */
.toc-box ol li:nth-child(3n+2) a .toc-num {
  background: linear-gradient(135deg, #ff6b35, #d94f1a);
  box-shadow: 0 2px 8px rgba(255,107,53,.35);
}
.toc-box ol li:nth-child(3n) a .toc-num {
  background: linear-gradient(135deg, #f5c842, #c9a030);
  box-shadow: 0 2px 8px rgba(245,200,66,.35);
  color: #3a2a00;
}

/* 矢印アイコン */
.toc-box ol li a .toc-arrow {
  margin-left: auto;
  font-size: .8rem;
  color: #a0aace;
  flex-shrink: 0;
  transition: transform .15s, color .15s;
}

.toc-box ol li a:hover {
  background: #eef4ff;
  border-color: #4a9eff;
  transform: translateX(3px);
}
.toc-box ol li a:hover .toc-arrow {
  transform: translateX(3px);
  color: #4a9eff;
}

/* H3サブ項目 */
.toc-box ol li a.toc-h3 {
  font-size: .8375rem;
  margin-left: 16px;
  background: #f3f6ff;
  border-style: dashed;
  color: #4a5a8a;
}
.toc-box ol li a.toc-h3 .toc-num {
  display: none;
}
.toc-box ol li a.toc-h3::before {
  content: '–';
  color: #a0aace;
  font-size: .875rem;
  flex-shrink: 0;
}

/* FAQ ブロック */
.article-body .faq-item {
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--c-light-border);
}
.article-body .faq-q {
  background: linear-gradient(135deg, #0d1530, #1a2a5e);
  color: #e8eaf6;
  padding: 14px 20px;
  font-family: var(--f-heading);
  font-weight: 600;
  font-size: .9375rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.article-body .faq-q::before {
  content: 'Q';
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  font-family: var(--f-mono);
  font-size: .875rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.article-body .faq-a {
  background: #f8f9ff;
  padding: 14px 20px 14px 56px;
  font-size: .9375rem;
  color: var(--c-light-muted);
  line-height: 1.8;
  position: relative;
}
.article-body .faq-a::before {
  content: 'A';
  position: absolute;
  left: 20px; top: 14px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(217,79,26,.12);
  color: var(--c-light-leap);
  font-family: var(--f-mono);
  font-size: .875rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* まとめボックス */
.article-body .summary-box {
  background: linear-gradient(135deg, #0d1530 0%, #111e45 100%);
  border: 1px solid rgba(74,158,255,.25);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-2xl);
  margin-top: var(--space-2xl);
  position: relative;
  overflow: hidden;
  color: #e8eaf6;
}
.article-body .summary-box::before {
  content: '✦';
  position: absolute; right: var(--space-xl); top: var(--space-lg);
  font-size: 4rem; color: rgba(74,158,255,.07); pointer-events: none;
}
.article-body .summary-box h2 {
  background: none;
  padding: 0; margin: 0 0 var(--space-lg);
  font-size: 1.1875rem;
  color: #e8eaf6;
  border-radius: 0;
}
.article-body .summary-box h2::before,
.article-body .summary-box h2::after { display: none; }
.article-body .summary-box ul li { color: rgba(232,234,246,.75); border-bottom-color: rgba(74,158,255,.12); }
.article-body .summary-box ul li::before { box-shadow: 0 0 8px rgba(74,158,255,.6); }
.article-body .summary-box p { color: rgba(232,234,246,.75); }

/* =====================================================
   LIGHT SECTIONS — 白背景セクション（TOPページ等）
   ===================================================== */
.section-light {
  background: var(--c-light-bg);
  color: var(--c-light-text);
  padding-block: var(--space-3xl);
}
.section-light .section-eyebrow { color: var(--c-light-accent); }
.section-light .section-title   { color: var(--c-light-text); }
.section-light .section-sub     { color: var(--c-light-muted); }

/* light section 内のカード */
.section-light .card {
  background: #fff;
  border-color: var(--c-light-border);
  box-shadow: 0 2px 16px rgba(13,21,48,.08);
}
.section-light .card:hover {
  box-shadow: 0 8px 32px rgba(13,21,48,.14);
  border-color: rgba(26,111,212,.3);
}
.section-light .card-title { color: var(--c-light-text); }
.section-light .card-meta  { color: var(--c-light-muted); }

/* light section 内の記事行 */
.section-light .article-mosaic-item {
  background: #fff;
  border-color: var(--c-light-border);
  color: var(--c-light-text);
}
.section-light .article-mosaic-item:hover {
  background: var(--c-light-bg2);
  border-color: rgba(26,111,212,.35);
}
.section-light .article-num   { color: #c8d0f0; }
.section-light .article-title { color: var(--c-light-text); }
.section-light .article-cat   { background: rgba(26,111,212,.1); color: var(--c-light-accent); }
.section-light .article-go    { color: var(--c-light-muted); }
.section-light .article-mosaic-item:hover .article-go { color: var(--c-light-accent); }

/* light section 内のボタン */
.section-light .btn-secondary {
  color: var(--c-light-text);
  border-color: var(--c-light-border);
}
.section-light .btn-secondary:hover {
  background: var(--c-light-bg2);
  border-color: rgba(26,111,212,.4);
}
.section-light .btn-ghost { color: var(--c-light-accent); }

/* light section 内の stat block */
.section-light .stat-block {
  background: #fff;
  border-color: var(--c-light-border);
  box-shadow: 0 2px 12px rgba(13,21,48,.07);
}
.section-light .stat-label { color: var(--c-light-muted); }

/* --- Tool Pages --- */
.tool-page-header {
  padding-top: 120px;
  padding-bottom: var(--space-3xl);
  text-align: center;
  background: linear-gradient(160deg, var(--c-deep) 0%, var(--c-void) 100%);
}
.tool-interface {
  max-width: 680px;
  margin-inline: auto;
  padding: var(--space-2xl) var(--space-xl);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
}
.tool-input-group {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.tool-input-group input,
.tool-input-group select {
  flex: 1;
  padding: 13px var(--space-md);
  background: var(--c-cosmos);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: 1rem;
  transition: border-color var(--dur-fast);
}
.tool-input-group input:focus,
.tool-input-group select:focus {
  outline: none;
  border-color: var(--c-accent);
}
.tool-result-box {
  padding: var(--space-xl);
  background: var(--c-cosmos);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  text-align: center;
}
.tool-result-num {
  font-family: var(--f-mono);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--c-accent);
  line-height: 1;
  display: block;
}

/* --- Quiz page --- */
.quiz-page { max-width: 640px; margin-inline: auto; padding: var(--space-2xl) var(--space-xl); }
.quiz-progress {
  height: 4px;
  background: var(--c-cosmos);
  border-radius: 2px;
  margin-bottom: var(--space-xl);
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-leap), var(--c-accent));
  border-radius: 2px;
  transition: width var(--dur-mid) var(--ease-smooth);
}
.quiz-question {
  font-family: var(--f-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}
.quiz-choices { display: flex; flex-direction: column; gap: var(--space-sm); }
.quiz-choice {
  padding: var(--space-md) var(--space-lg);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  color: var(--c-text);
  font-size: .9375rem;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.quiz-choice:hover { border-color: rgba(74,158,255,.5); background: var(--c-cosmos); }
.quiz-choice.correct { border-color: #1D9E75; background: rgba(29,158,117,.12); color: #5DCAA5; }
.quiz-choice.wrong   { border-color: #E24B4A; background: rgba(226,75,74,.1);    color: #F09595; }

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes bg-number-float {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50%       { transform: translateY(-52%) translateX(-1%); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(0.7); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-fade-up { animation: fade-up .8s var(--ease-smooth) both; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .7s var(--ease-smooth), transform .7s var(--ease-smooth);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* =====================================================
   SECTION-LIGHT 内の checker section 調整
   ===================================================== */
.checker-section.section-light {
  background: var(--c-light-bg);
  border-top: 1px solid var(--c-light-border);
  border-bottom: 1px solid var(--c-light-border);
}
.checker-section.section-light::before {
  opacity: .04;
}
.checker-section .section-eyebrow { color: var(--c-light-accent); }
.checker-section h2               { color: var(--c-light-text); }
.checker-section input            {
  background: #fff;
  border-color: var(--c-light-border);
  color: var(--c-light-text);
}

/* =====================================================
   ARTICLE-BODY SIDEBAR カード（ライト背景）
   ===================================================== */
.article-body {
  /* サイドバーの card を白に */
}

/* =====================================================
   SECTION 交互パターン用ユーティリティ追加
   ===================================================== */
.section-light .stat-val { /* 色は各箇所のインラインで指定 */ }

/* photo-card-grid 内でも section-light に対応 */
.section-light .photo-card { border-color: var(--c-light-border); }
.section-light .photo-card-overlay {
  background: linear-gradient(to top, rgba(13,21,48,.9) 0%, rgba(13,21,48,.2) 60%, transparent 100%);
}

/* articles-grid が section-light 内 */
.section-light .articles-grid a[style*="aspect-ratio"] {
  border-color: var(--c-light-border);
}

@media (max-width: 1024px) {
  .card-grid--3  { grid-template-columns: repeat(2, 1fr); }
  .footer-inner  { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
  .viz-grid      { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --space-xl: 24px; --space-2xl: 48px; --space-3xl: 64px; }
  .card-grid--3, .card-grid--4, .card-grid--2-1 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero-countdown { flex-wrap: wrap; gap: var(--space-lg); }
  .nav-menu { display: none; }
  .header-inner { padding-inline: var(--space-md); }
  .container { padding-inline: var(--space-md); }
  .hero-content { padding-inline: var(--space-md); }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .hero-countdown { width: 100%; justify-content: space-around; }
}
