/* ==========================================================================
   JjangJi Science – Modern Design System & Blog Stylesheet
   ========================================================================== */

:root {
  --font-sans: "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  
  /* Light Theme */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-inverse: #ffffff;
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-subtle: #e0e7ff;
  --primary-contrast: #ffffff;
  
  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.15);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --header-height: 72px;
  --max-w-content: 1200px;
  --max-w-narrow: 840px;
}

html.dark {
  /* Dark Theme */
  --bg-page: #0b0f19;
  --bg-surface: #121827;
  --bg-surface-elevated: #1a2236;
  --bg-subtle: #192133;
  --bg-hover: #222d45;
  
  --border: #1e293b;
  --border-strong: #334155;
  
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;
  --text-inverse: #0f172a;
  
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-subtle: rgba(99, 102, 241, 0.18);
  --primary-contrast: #ffffff;
  
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.15);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 24px 32px -6px rgba(0, 0, 0, 0.6);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-page);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  overflow-wrap: break-word;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: balance;
}

p, span, a, label {
  word-break: keep-all;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

button, input {
  font: inherit;
  color: inherit;
}

/* Accessibility skip link */
.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-weight: 600;
  transition: top 0.2s;
}
.skip:focus {
  top: 16px;
}

/* Reading Progress Bar */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #10b981);
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* Layout Wrappers */
.wrap {
  width: 100%;
  max-width: var(--max-w-content);
  margin: 0 auto;
  padding: 0 24px;
}

.wrap.narrow {
  max-width: var(--max-w-narrow);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  transition: background 0.3s, border-color 0.3s;
}

html.dark .site-header {
  background: rgba(11, 15, 25, 0.85);
}

.hdr {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
}

.logo span b {
  font-weight: 800;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.dark .logo span b {
  background: linear-gradient(135deg, #818cf8 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.main-nav a:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.main-nav a.active {
  color: var(--primary);
  background: var(--primary-subtle);
  font-weight: 700;
}

.hdr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.icon-btn:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.18s ease;
}

.lang-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.menu-btn {
  display: none;
}

/* Theme Icons Toggle */
#themeBtn .i-sun { display: none; }
#themeBtn .i-moon { display: block; }
html.dark #themeBtn .i-sun { display: block; }
html.dark #themeBtn .i-moon { display: none; }

/* ==========================================================================
   Hero Section (Home)
   ========================================================================== */
.hero {
  position: relative;
  padding: 80px 0 72px;
  overflow: hidden;
  background: 
    radial-gradient(circle at 15% 25%, rgba(99, 102, 241, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.08) 0%, transparent 45%),
    var(--bg-page);
}

html.dark .hero {
  background: 
    radial-gradient(circle at 15% 25%, rgba(99, 102, 241, 0.16) 0%, transparent 50%),
    radial-gradient(circle at 85% 75%, rgba(6, 182, 212, 0.14) 0%, transparent 50%),
    var(--bg-page);
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-bg .grid-pat {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, #000 70%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, #000 70%, transparent 100%);
}

.hero-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: float 14s ease-in-out infinite alternate;
}

.hero-bg .o1 {
  width: 440px;
  height: 440px;
  background: #6366f1;
  top: -100px;
  left: 10%;
}

.hero-bg .o2 {
  width: 380px;
  height: 380px;
  background: #06b6d4;
  top: 40px;
  right: 15%;
  animation-delay: -5s;
}

.hero-bg .o3 {
  width: 320px;
  height: 320px;
  background: #ec4899;
  bottom: -60px;
  left: 45%;
  animation-delay: -9s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 20px) scale(1.08); }
}

.hero-in {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
}

.hero-copy h1 {
  font-size: 3.4rem;
  font-weight: 850;
  line-height: 1.14;
  letter-spacing: -0.035em;
  color: var(--text-main);
}

.hero-copy h1 .grad {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 50%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.dark .hero-copy h1 .grad {
  background: linear-gradient(135deg, #818cf8 0%, #38bdf8 50%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 560px;
}

.hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
  transform: translateY(-2px);
}

html.dark .btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

html.dark .btn-primary:hover {
  background: linear-gradient(135deg, #818cf8, #6366f1);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.55);
}

.btn-ghost {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--text-subtle);
  transform: translateY(-2px);
}

.btn-light {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-light:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
}

.stats {
  display: flex;
  gap: 36px;
  margin-top: 18px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.stats dt {
  font-size: 2rem;
  font-weight: 850;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1;
}

.stats dt sup {
  color: var(--primary);
  font-size: 1.1rem;
}

.stats dd {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-subtle);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Featured Hero Card */
.hero-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 24px 38px -8px var(--accent-glow);
}

.hc-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-subtle);
}

.hc-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hero-card:hover .hc-img img {
  transform: scale(1.04);
}

.hc-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hc-body h2 {
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 1.35;
  color: var(--text-main);
}

.hc-body time {
  font-size: 0.85rem;
  color: var(--text-subtle);
}

/* ==========================================================================
   Centered Hero & Minimalist Layout
   ========================================================================== */
.hero-center {
  padding: 88px 0 68px;
  text-align: center;
}

.hero-in-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 860px;
  margin: 0 auto;
}

.hero-title-center {
  font-size: 3.3rem;
  font-weight: 850;
  line-height: 1.18;
  letter-spacing: -0.035em;
  color: var(--text-main);
  text-align: center;
}

.hero-title-center .grad {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 50%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.dark .hero-title-center .grad {
  background: linear-gradient(135deg, #818cf8 0%, #38bdf8 50%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub-center {
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 auto;
  text-align: center;
}

.hero-btns.center {
  justify-content: center;
  margin-top: 10px;
}

.hero-badges-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.hero-badge:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.hero-badge b {
  color: var(--primary);
  font-weight: 750;
}

/* ==========================================================================
   Teacher Showcase Section (Centered & High-Contrast)
   ========================================================================== */
.teacher-showcase {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 52px 36px;
  text-align: center;
  box-shadow: var(--shadow-md);
  max-width: 960px;
  margin: 0 auto;
}

.teacher-avatar-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 20px;
}

.teacher-avatar-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 4px solid var(--primary);
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.25);
  background: var(--bg-subtle);
  image-rendering: -webkit-optimize-contrast;
}

.teacher-avatar-img.lg {
  width: 160px;
  height: 160px;
}

.teacher-avatar-img.sm {
  width: 72px;
  height: 72px;
  border-width: 2px;
}

.teacher-avatar-badge {
  position: absolute;
  bottom: -4px;
  right: 0;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

.teacher-title {
  font-size: 2.15rem;
  font-weight: 850;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin-top: 8px;
  margin-bottom: 12px;
}

.teacher-lead {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 36px;
}

/* Teacher Proof Visual Gallery (Real Photos replacing boring text boxes) */
.teacher-proof-wrap {
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.proof-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  text-align: center;
}

.proof-sub {
  font-size: 0.98rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.proof-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s ease;
}

.proof-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.proof-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-subtle);
}

.proof-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  transition: transform 0.3s ease;
}

.proof-card:hover .proof-img img {
  transform: scale(1.05);
}

.proof-caption {
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .proof-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.hc-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  z-index: 2;
}

/* Image-Dominant Visual Cards (Pictures First, Minimal Text) */
.visual-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.visual-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.visual-card .card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-subtle);
}

.visual-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  transition: transform 0.35s ease;
}

.visual-card:hover .card-img img {
  transform: scale(1.05);
}

.visual-card .card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 750;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.visual-card .card-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.visual-card .card-body time {
  font-size: 0.82rem;
  color: var(--text-subtle);
  font-weight: 600;
}

.visual-card .card-body h3 {
  font-size: 1.15rem;
  font-weight: 750;
  line-height: 1.45;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.visual-card:hover .card-body h3 {
  color: var(--primary);
}

/* Common Centered Helpers */
.text-center {
  text-align: center;
}

.sec-head.center {
  text-align: center;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.sec-head.center p {
  margin: 0 auto;
}

.chips.center {
  justify-content: center;
}

.dest-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  list-style: none;
  max-width: 800px;
  margin: 0 auto;
}

.dest-list li {
  padding: 8px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.post-title-center {
  font-size: 2.6rem;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text-main);
  margin: 12px 0 16px;
  text-align: center;
}

.lede.center {
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 20px;
  text-align: center;
}

.post-meta.center {
  justify-content: center;
}

.author-box.center {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 32px 0;
  text-align: left;
}

.share-row.center {
  justify-content: center;
}

/* ==========================================================================
   Marquee of Destinations
   ========================================================================== */
.marquee {
  width: 100%;
  overflow: hidden;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: relative;
}

.mq-track {
  display: flex;
  white-space: nowrap;
  animation: scroll 32s linear infinite;
  gap: 40px;
}

.mq-track:hover {
  animation-play-state: paused;
}

.mq-track span {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.mq-track span::before {
  content: "•";
  color: var(--primary);
  font-size: 1.2rem;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ==========================================================================
   Section Layouts
   ========================================================================== */
.section {
  padding: 72px 24px;
}

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.sec-head h2 {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.sec-head p {
  color: var(--text-subtle);
  font-size: 1rem;
  margin-top: 6px;
}

.sec-head a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.sec-head a:hover {
  background: var(--primary-subtle);
  transform: translateX(3px);
}

/* Grids */
.grid {
  display: grid;
  gap: 28px;
}

.grid.g3 {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

/* ==========================================================================
   Post Card Component
   ========================================================================== */
.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-subtle);
  overflow: hidden;
  position: relative;
}

.card.tall .card-img {
  aspect-ratio: 16 / 11;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  transition: transform 0.35s ease;
}

.card:hover .card-img img {
  transform: scale(1.05);
}

.card-img .ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  opacity: 0.4;
}

.card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-meta time {
  font-size: 0.82rem;
  color: var(--text-subtle);
  font-weight: 500;
}

.card-body h3 {
  font-size: 1.18rem;
  font-weight: 750;
  line-height: 1.4;
  color: var(--text-main);
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body .more {
  margin-top: auto;
  padding-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  transition: gap 0.15s;
}

.card:hover .card-body .more {
  gap: 10px;
}

/* Wide Featured Card on List */
.featured {
  margin-bottom: 36px;
}

.featured .card.wide .card-link {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: stretch;
}

.featured .card.wide .card-img {
  aspect-ratio: auto;
  min-height: 320px;
}

.featured .card.wide .card-body {
  padding: 36px;
}

.featured .card.wide h3 {
  font-size: 1.6rem;
  -webkit-line-clamp: 3;
}

/* ==========================================================================
   Badges & Category Colors
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1;
}

.badge.lg {
  padding: 7px 16px;
  font-size: 0.88rem;
}

/* Results (Gold / Amber) */
.b-results { background: rgba(245, 158, 11, 0.14); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.3); }
html.dark .b-results { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

/* AP (Cyan / Sky) */
.b-ap { background: rgba(14, 165, 233, 0.14); color: #0284c7; border: 1px solid rgba(14, 165, 233, 0.3); }
html.dark .b-ap { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }

/* IB (Indigo / Violet) */
.b-ib { background: rgba(99, 102, 241, 0.14); color: #4f46e5; border: 1px solid rgba(99, 102, 241, 0.3); }
html.dark .b-ib { background: rgba(99, 102, 241, 0.2); color: #818cf8; }

/* Concepts (Emerald) */
.b-concepts { background: rgba(16, 185, 129, 0.14); color: #059669; border: 1px solid rgba(16, 185, 129, 0.3); }
html.dark .b-concepts { background: rgba(16, 185, 129, 0.2); color: #34d399; }

/* Study (Blue) */
.b-study { background: rgba(59, 130, 246, 0.14); color: #2563eb; border: 1px solid rgba(59, 130, 246, 0.3); }
html.dark .b-study { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }

/* Notes (Slate) */
.b-notes { background: rgba(100, 116, 139, 0.14); color: #475569; border: 1px solid rgba(100, 116, 139, 0.3); }
html.dark .b-notes { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; }

/* Category Grid on Home */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.cat-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.cat-card .emoji {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.cat-card b {
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--text-main);
}

.cat-card small {
  color: var(--text-subtle);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Category Filter Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.chip small {
  background: var(--bg-subtle);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  color: var(--text-subtle);
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chip.on {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.chip.on small {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ==========================================================================
   Page Hero (Listing, Search, Archive)
   ========================================================================== */
.page-hero {
  padding: 48px 0 32px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  font-size: 2.6rem;
  font-weight: 850;
  letter-spacing: -0.03em;
  margin: 12px 0 8px;
  color: var(--text-main);
}

.page-hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
}

/* Breadcrumb */
.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-subtle);
  margin-bottom: 12px;
}

.crumbs i {
  font-style: normal;
  color: var(--border-strong);
}

.crumbs a:hover {
  color: var(--primary);
}

/* Inline Search Form */
.search-inline {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 520px;
  margin-top: 20px;
}

.search-inline svg {
  position: absolute;
  left: 16px;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-inline input {
  width: 100%;
  height: 48px;
  padding: 0 18px 0 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-size: 0.98rem;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.search-inline.big input {
  height: 56px;
  font-size: 1.1rem;
  padding-left: 54px;
}

.search-inline.big svg {
  left: 20px;
  width: 24px;
  height: 24px;
}

.search-inline input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-subtle);
}

.search-count {
  margin-top: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-subtle);
}

/* ==========================================================================
   Article Detail Page
   ========================================================================== */
.post {
  padding-bottom: 60px;
}

.post-hero {
  padding: 56px 0 40px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.post-hero h1 {
  font-size: 2.5rem;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin: 18px 0 12px;
}

.post-hero .lede {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--text-subtle);
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.post-meta .author {
  color: var(--text-main);
  font-weight: 700;
}

.post-meta .avatar {
  width: 24px;
  height: 24px;
  display: inline-block;
}

.post-meta .avatar svg {
  width: 100%;
  height: 100%;
}

.post-meta .alt-lang {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-weight: 700;
  color: var(--primary);
  font-size: 0.84rem;
}

.post-meta .alt-lang:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
}

/* Post Layout with Share Rail */
.post-layout {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 40px;
  padding-top: 48px;
  max-width: var(--max-w-narrow);
}

.share-rail {
  position: sticky;
  top: calc(var(--header-height) + 32px);
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-rail a, .share-rail button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.share-rail a:hover, .share-rail button:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  background: var(--primary-subtle);
}

/* Prose (Article Body) Typography */
.prose {
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--text-main);
  overflow-wrap: break-word;
}

.prose p {
  margin-bottom: 1.6em;
  color: var(--text-main);
}

.prose h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 2.2em 0 0.8em;
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--text-main);
  padding-top: 16px;
}

.prose h3 {
  font-size: 1.4rem;
  font-weight: 750;
  margin: 1.8em 0 0.6em;
  line-height: 1.35;
  color: var(--text-main);
}

.prose h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.4em 0 0.5em;
}

.prose strong, .prose b {
  font-weight: 750;
  color: var(--text-main);
}

.prose em, .prose i {
  font-style: italic;
}

.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 600;
}

.prose a:hover {
  color: var(--primary-hover);
}

.prose ul, .prose ol {
  margin: 1.2em 0 1.6em 1.4em;
}

.prose li {
  margin-bottom: 0.5em;
}

.prose blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  background: var(--bg-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.8em 0;
  font-style: italic;
  color: var(--text-muted);
}

.prose figure {
  margin: 2.4em 0;
}

.prose figure img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  width: 100%;
  height: auto;
  cursor: zoom-in;
  image-rendering: -webkit-optimize-contrast;
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--bg-subtle);
}

.prose figure img:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.prose figcaption {
  font-size: 0.88rem;
  color: var(--text-subtle);
  text-align: center;
  margin-top: 8px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 0.95rem;
}

.prose th, .prose td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
}

.prose th {
  background: var(--bg-subtle);
  font-weight: 750;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3em 0;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.prose pre {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
  margin: 1.6em 0;
}

.prose pre code {
  background: transparent;
  padding: 0;
  border: none;
}

/* Table of Contents (TOC) */
.toc {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 2.4em;
  box-shadow: var(--shadow-sm);
}

.toc summary {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  outline: none;
}

.toc ol {
  margin: 12px 0 0 16px;
  list-style: decimal;
}

.toc li {
  font-size: 0.94rem;
  margin-bottom: 6px;
}

.toc li.h3 {
  margin-left: 18px;
  list-style: circle;
}

.toc a {
  color: var(--text-muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Post Footer Elements */
.post-foot {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.share-row b {
  font-size: 0.95rem;
  color: var(--text-main);
}

.share-row a, .share-row button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.share-row a:hover, .share-row button:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.author-box {
  display: flex;
  gap: 20px;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.author-box img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border-strong);
}

.author-box b {
  display: block;
  font-size: 1.1rem;
  color: var(--text-main);
}

.author-box p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 4px 0 10px;
}

.author-box a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
}

/* Prev / Next Post Navigation */
.prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.prevnext .pn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.prevnext .pn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  background: var(--primary-subtle);
}

.prevnext .pn.next {
  text-align: right;
  align-items: flex-end;
}

.prevnext .pn small {
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
}

.prevnext .pn b {
  font-size: 1rem;
  line-height: 1.35;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Pagination Component
   ========================================================================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 54px;
  flex-wrap: wrap;
}

.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.15s;
}

.pg:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

.pg.num {
  min-width: 42px;
  padding: 0;
}

.pg.on {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pg.dots {
  border: none;
  background: transparent;
  color: var(--text-subtle);
}

/* ==========================================================================
   Archive Page (Timeline by Year)
   ========================================================================== */
.archive {
  padding-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.archive .year h2 {
  font-size: 1.8rem;
  font-weight: 850;
  color: var(--text-main);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.archive .year h2 small {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-subtle);
}

.archive .year ul {
  list-style: none;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.archive .year li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.archive .year li:hover {
  background: var(--bg-subtle);
}

.archive .year time {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-subtle);
  font-family: ui-monospace, monospace;
  flex-shrink: 0;
}

.archive .year li a {
  font-weight: 650;
  color: var(--text-main);
  flex: 1;
}

.archive .year li a:hover {
  color: var(--primary);
}

/* ==========================================================================
   About Page
   ========================================================================== */
.about-hero {
  padding: 64px 0 48px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  align-items: center;
  gap: 48px;
}

.about-photo img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 4px solid var(--bg-surface);
}

.about-feats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-feats div b {
  display: block;
  font-size: 1.4rem;
  font-weight: 850;
  color: var(--primary);
}

.about-feats div span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-subtle);
}

.dest-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  list-style: none;
}

.dest-list li {
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dest-list li::before {
  content: "🏛️";
  font-size: 1.1rem;
}

/* About Band on Home */
.about-band {
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-subtle));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  display: flex;
  align-items: center;
  gap: 40px;
  box-shadow: var(--shadow-md);
}

.about-band img {
  border-radius: var(--radius-lg);
  border: 3px solid var(--border-strong);
  flex-shrink: 0;
}

.about-band h2 {
  font-size: 2rem;
  font-weight: 850;
  margin: 6px 0 12px;
}

.about-band p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 24px;
}

/* ==========================================================================
   Consultation CTA Banner
   ========================================================================== */
.cta {
  padding: 24px;
  margin: 40px 0 20px;
}

.cta-in {
  max-width: var(--max-w-content);
  margin: 0 auto;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  border-radius: var(--radius-lg);
  padding: 44px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  color: #fff;
  box-shadow: 0 16px 36px -10px rgba(79, 70, 229, 0.45);
  box-sizing: border-box;
}

.cta-in h2 {
  font-size: 1.95rem;
  font-weight: 850;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: balance;
  line-height: 1.3;
}

.cta-in p {
  font-size: 1.05rem;
  opacity: 0.94;
  max-width: 580px;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-wrap: balance;
  line-height: 1.6;
}

/* ==========================================================================
   Simplified Minimal Footer
   ========================================================================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 44px 0 36px;
  margin-top: 60px;
}

.foot-simple {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.foot-brand-simple {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.foot-brand-simple .logo {
  justify-content: center;
}

.foot-tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
}

.foot-links a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.foot-links a:hover {
  color: var(--primary);
}

.foot-links .sep {
  color: var(--border-strong);
  user-select: none;
}

.foot-copy {
  font-size: 0.85rem;
  color: var(--text-subtle);
  margin-top: 4px;
}

/* Floating Back To Top Button */
.to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 850;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-3px);
}

/* Image Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  animation: zoomIn 0.22s ease-out;
}

@keyframes zoomIn {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 404 Page */
.nf {
  padding: 120px 0;
  text-align: center;
}

.nf-code {
  font-size: 7rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.nf h1 {
  font-size: 2.2rem;
  font-weight: 850;
  margin-bottom: 12px;
}

.nf p {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
  .hero-in {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .hero-copy h1 {
    font-size: 2.7rem;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .about-photo {
    max-width: 280px;
    margin: 0 auto;
  }
  
  .about-feats {
    grid-template-columns: 1fr;
  }
  
  .featured .card.wide .card-link {
    grid-template-columns: 1fr;
  }
  
  .post-layout {
    grid-template-columns: 1fr;
  }
  
  .share-rail {
    display: none; /* Mobile uses footer share-row */
  }
  
  .foot-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .about-band {
    flex-direction: column;
    text-align: center;
    padding: 32px;
  }
}

@media (max-width: 720px) {
  .menu-btn {
    display: inline-flex;
  }
  
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    box-shadow: var(--shadow-lg);
  }
  
  .main-nav.open {
    display: flex;
  }
  
  .hero-copy h1 {
    font-size: 2.2rem;
  }
  
  .stats {
    flex-direction: column;
    gap: 16px;
  }
  
  .cta-in {
    flex-direction: column;
    text-align: center;
    padding: 32px 20px;
    gap: 20px;
  }
  
  .cta-in h2 {
    font-size: 1.35rem;
    line-height: 1.35;
    word-break: keep-all;
    overflow-wrap: break-word;
    text-wrap: balance;
  }
  
  .cta-in p {
    font-size: 0.92rem;
    line-height: 1.55;
    word-break: keep-all;
    overflow-wrap: break-word;
    text-wrap: balance;
  }

  .to-top {
    bottom: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
  }
  
  .prevnext {
    grid-template-columns: 1fr;
  }
  
  .prevnext .pn.next {
    text-align: left;
    align-items: flex-start;
  }
  
  .foot-grid {
    grid-template-columns: 1fr;
  }
}
