:root {
  --primary-accent: #ffb347;
  --primary-accent-strong: #ff8f3f;
  --bg-gradient: linear-gradient(135deg, #07111f 0%, #111c34 45%, #1d2947 100%);
  --bg-surface: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.14);
  --text-main: #f8fafc;
  --text-muted: #9fb0c9;
  --text-soft: #cad5e6;
  --shadow-soft: 0 24px 80px rgba(2, 8, 23, 0.28);
  --shadow-card: 0 20px 50px rgba(15, 23, 42, 0.28);
  --reading-width: 74ch;
  --nav-height: 76px;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --transition-smooth: all 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

body.light-mode {
  --bg-gradient: linear-gradient(135deg, #f4f1eb 0%, #f8f4ea 35%, #e8eef7 100%);
  --bg-surface: rgba(255, 255, 255, 0.7);
  --glass-bg: rgba(255, 255, 255, 0.66);
  --glass-border: rgba(15, 23, 42, 0.08);
  --text-main: #162033;
  --text-muted: #5f6f85;
  --text-soft: #344259;
  --shadow-soft: 0 24px 80px rgba(148, 163, 184, 0.25);
  --shadow-card: 0 16px 48px rgba(100, 116, 139, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text-main);
  background: var(--bg-gradient);
  background-attachment: fixed;
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 179, 71, 0.18), transparent 35%),
    radial-gradient(circle at 80% 20%, rgba(78, 106, 255, 0.18), transparent 34%),
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.1), transparent 30%);
  pointer-events: none;
  z-index: -2;
  animation: meshShift 18s ease-in-out infinite alternate;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  position: relative;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

.page-shell,
.story-shell {
  padding-top: 18px;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.48;
  pointer-events: none;
  z-index: -1;
  animation: orbFloat 14s ease-in-out infinite alternate;
}

.ambient-a {
  top: 10%;
  left: -8%;
  width: 240px;
  height: 240px;
  background: rgba(255, 179, 71, 0.18);
}

.ambient-b {
  top: 55%;
  right: -10%;
  width: 280px;
  height: 280px;
  background: rgba(123, 146, 255, 0.2);
  animation-delay: 2s;
}

.ambient-c {
  bottom: 6%;
  left: 18%;
  width: 180px;
  height: 180px;
  background: rgba(255, 233, 196, 0.14);
  animation-delay: 4s;
}

.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.floating-nav {
  position: sticky;
  top: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  min-height: var(--nav-height);
  border-radius: 999px;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.floating-nav.nav-hidden {
  transform: translateY(-140%);
  opacity: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 179, 71, 0.92), rgba(255, 143, 63, 0.72));
  color: #0f172a;
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong {
  font-family: "Poppins", sans-serif;
  font-size: 0.98rem;
}

.brand-copy small {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.94rem;
  transition: var(--transition-smooth);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.text-link:hover {
  color: var(--primary-accent);
}

.theme-toggle {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  background: rgba(255, 179, 71, 0.18);
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 28px;
  align-items: stretch;
  padding: 64px 0 32px;
}

.hero-copy {
  padding: 24px 4px;
}

.eyebrow,
.story-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--primary-accent);
  font-weight: 700;
}

.hero-title,
.page-hero h1,
.story-hero h1,
.section-header h2 {
  font-family: "Poppins", sans-serif;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-title {
  margin: 18px 0;
  font-size: clamp(3rem, 8vw, 6.5rem);
}

.hero-title .hero-letter {
  display: inline-block;
}

.hero-lead,
.page-hero p,
.story-summary,
.story-card p,
.empty-card p,
.ad-copy,
.policy-card p {
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  transition: var(--transition-smooth);
}

.primary-button {
  background: linear-gradient(135deg, var(--primary-accent), var(--primary-accent-strong));
  color: #0f172a;
  box-shadow: 0 20px 40px rgba(255, 143, 63, 0.26);
}

.primary-button:hover {
  transform: translateY(-3px);
}

.secondary-button {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
}

.hero-aside {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-xl);
}

.hero-stat {
  padding: 18px 18px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-stat span,
.story-card-date,
.ad-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-stat strong {
  display: block;
  margin-top: 10px;
  font-size: 1.05rem;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 0 18px;
}

.section-header h2 {
  margin: 10px 0 0;
  font-size: clamp(2rem, 3vw, 3rem);
}

.text-link {
  color: var(--text-soft);
  font-weight: 700;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.story-card,
.empty-card {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  transform-style: preserve-3d;
  transition: var(--transition-smooth);
}

.story-card:hover {
  border-color: rgba(255, 179, 71, 0.38);
}

.story-card-header,
.story-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.story-card-score {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 179, 71, 0.14);
  color: var(--primary-accent);
  font-weight: 700;
  font-size: 0.82rem;
}

.story-card h3,
.empty-card h3,
.policy-card h2,
.process-strip h3,
.ai-banner h2 {
  margin: 0;
  font-family: "Poppins", sans-serif;
}

.story-card h3,
.empty-card h3 {
  font-size: 1.42rem;
  line-height: 1.12;
}

.card-meta,
.story-meta,
.footer-links,
.ai-icons,
.tag-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.card-meta,
.story-meta {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.tag-pill,
.tag-cloud button,
.ai-icons span {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.88rem;
}

.story-link {
  color: var(--primary-accent);
  font-weight: 700;
}

.empty-card {
  grid-column: 1 / -1;
  align-items: flex-start;
}

.process-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 24px;
  margin-bottom: 28px;
  border-radius: var(--radius-xl);
}

.process-strip article {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.05);
}

.process-strip span {
  color: var(--primary-accent);
  font-weight: 800;
  letter-spacing: 0.14em;
}

.ad-frame,
.page-hero,
.story-hero,
.policy-card,
.story-content,
.ai-banner,
.tag-cloud {
  border-radius: var(--radius-xl);
}

.ad-frame,
.page-hero,
.story-hero,
.policy-card,
.tag-cloud {
  padding: 24px;
  margin-bottom: 24px;
}

.page-main,
.story-main {
  padding-top: 34px;
}

.story-hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  margin: 12px 0 14px;
}

.story-content {
  max-width: min(100%, calc(var(--reading-width) + 92px));
  margin: 0 auto 24px;
  padding: 36px 46px;
  font-family: "Noto Serif JP", serif;
  font-size: 1.05rem;
}

.story-content p {
  margin: 0 0 1.3em;
}

.story-ad,
.ai-banner,
.story-related-header {
  max-width: min(100%, calc(var(--reading-width) + 92px));
  margin-left: auto;
  margin-right: auto;
}

.ai-banner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 26px 28px;
  margin-bottom: 32px;
}

.ai-banner:hover .ai-icons span {
  transform: translateY(-4px);
  color: var(--primary-accent);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  padding: 28px 0 12px;
  color: var(--text-muted);
}

.progress-shell {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.reading-progress {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-accent), #ffe4a4);
  box-shadow: 0 0 18px rgba(255, 179, 71, 0.58);
}

@keyframes orbFloat {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(26px, -24px, 0) scale(1.12);
  }
}

@keyframes meshShift {
  from {
    transform: scale(1) translateY(0);
  }
  to {
    transform: scale(1.08) translateY(-2%);
  }
}

@media (max-width: 1024px) {
  .hero-section,
  .process-strip,
  .ai-banner {
    grid-template-columns: 1fr;
  }

  .story-card {
    grid-column: span 6;
  }

  .floating-nav {
    border-radius: 28px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav-links {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 20px, 100%);
  }

  .hero-section {
    padding-top: 40px;
  }

  .hero-title {
    font-size: clamp(2.6rem, 16vw, 4rem);
  }

  .story-card,
  .empty-card {
    grid-column: 1 / -1;
  }

  .story-content {
    padding: 26px 22px;
    font-size: 1rem;
  }

  .site-footer,
  .ai-banner,
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
