/* ── 1. Design tokens ──────────────────────────────────────────────────── */
:root {
  --bg-primary:     #0f0f0f;
  --bg-secondary:   #1a1a1a;
  --bg-tertiary:    #2a2a2a;
  --bg-card:        #161616;
  --text-primary:   #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-muted:     #808080;
  --accent:         #10b981;
  --accent-dim:     rgba(16, 185, 129, 0.1);
  --accent-border:  rgba(16, 185, 129, 0.3);
  --border:         rgba(255, 255, 255, 0.06);
  --border-strong:  rgba(255, 255, 255, 0.1);
  --font-sans:      'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', monospace;
  --r:              8px;
}

/* ── 2. Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent-dim); color: var(--accent); }

/* ── 3. Top navigation ─────────────────────────────────────────────────── */
#top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg-primary);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2rem;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}
.nav-links a:hover::after { width: 100%; }

.btn-theme {
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.btn-theme:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  align-items: center;
  justify-content: center;
}
.nav-toggle:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

/* ── 4. Sections ───────────────────────────────────────────────────────── */
section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.section-header { margin-bottom: 3rem; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-desc {
  color: var(--text-secondary);
  margin-top: 0.75rem;
  line-height: 1.7;
}

/* ── 5. Hero ───────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.hero-label::before {
  content: '';
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.hero h1 em {
  color: var(--text-secondary);
  font-style: normal;
}

.hero-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 2.5rem;
}

/* Hero visual — pulsing ring treatment */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-photo {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  position: relative;
  z-index: 2;
  filter: grayscale(20%) contrast(1.1);
  transition: filter 0.5s;
}
.hero-photo:hover {
  filter: grayscale(0%) contrast(1);
}

.photo-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 320px; height: 320px;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  animation: pulse-ring 4s ease-in-out infinite;
}
.photo-ring-2 {
  width: 370px; height: 370px;
  border-color: rgba(34, 211, 238, 0.08);
  animation-delay: 1s;
}

@keyframes pulse-ring {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50%       { transform: translate(-50%, -50%) scale(1.04); opacity: 1; }
}

/* ── 6. Philosophy ─────────────────────────────────────────────────────── */
.philosophy-text {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
  margin-bottom: 1.25rem;
}
.philosophy-text:last-child { margin-bottom: 0; }
.philosophy-text strong { color: var(--text-primary); }
.philosophy-text em { color: var(--accent); font-style: normal; }

/* ── Skill mentions — inline contextual skill highlighting ─────────────── */
.skill-mention {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  white-space: nowrap;
}

/* ── 7. Case Studies ───────────────────────────────────────────────────── */
.case-swiper {
  padding-bottom: 3rem;
}

.case-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  transition: all 0.3s;
  position: relative;
  overflow-y: auto;
  min-height: 500px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.case-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
}

.case-header {
  margin-bottom: 1.5rem;
}

.case-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.case-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.case-subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
}

.case-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.case-company {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
}

.case-impact-statements {
  list-style: none;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-left: 1rem;
}

.case-impact-statements li {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-secondary);
  padding-left: 1.5rem;
  position: relative;
}

.case-impact-statements li::before {
  content: '✔';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
  top: 0.2em;
}

.case-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.case-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.case-section {
  margin-bottom: 0;
}

.case-section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.case-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
}
.case-section p:last-child { margin-bottom: 0; }

/* ── D2 Diagrams ────────────────────────────────────────────────────────── */
.case-diagram {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  margin: 1.5rem 0;
  position: relative;
  transition: border-color 0.2s;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  overflow: hidden;
}

.case-diagram:hover {
  border-color: var(--accent-border);
}

.case-diagram-container {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.case-diagram-container:active {
  cursor: grabbing;
}

.case-diagram-container svg {
  max-width: 100%;
  max-height: 100%;
  user-select: none;
  -webkit-user-select: none;
}

/* ── 8. Blog / Writing ─────────────────────────────────────────────────── */
.blog-swiper {
  padding-bottom: 3rem;
}

.article-image {
  margin: -2rem -2rem 1.5rem;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.article-card:hover .article-image img {
  transform: scale(1.04);
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s;
  height: 56vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.article-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.article-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.article-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.article-excerpt {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex-grow: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.article-read {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── 9. Career Timeline ──────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: var(--border-strong);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -2.45rem;
  top: 0.25rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
  border: 2px solid var(--bg-primary);
  transition: background 0.2s;
}

.timeline-content { padding-left: 0.5rem; }

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.timeline-role {
  font-weight: 600;
  font-size: 1rem;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.timeline-company {
  font-size: 0.9375rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.timeline-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.timeline-desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: 780px;
}

/* ── Timeline sub-projects ─────────────────────────────────────────────── */
.timeline-sub-projects {
  margin-top: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
}

.timeline-sub-projects-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.timeline-sub-project {
  position: relative;
  padding-left: 1.1rem;
}
.timeline-sub-project + .timeline-sub-project {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border);
}
.timeline-sub-project::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-sub-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

.timeline-sub-role {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.timeline-sub-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timeline-sub-company {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.timeline-sub-desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: 780px;
}

/* ── Timeline chapter marker ───────────────────────────────────────────── */
.timeline-chapter-marker {
  position: relative;
  padding-bottom: 2rem;
  padding-left: 0.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.timeline-marker-dot {
  position: absolute;
  left: -2.45rem;
  top: 0.3rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.timeline-marker-content {
  padding-left: 0.5rem;
}

.timeline-marker-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.timeline-marker-date {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.timeline-marker-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── 10. Background ────────────────────────────────────────────────────── */
.story-narrative {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}
.story-narrative:last-child { margin-bottom: 0; }


/* ── 11. Contact ───────────────────────────────────────────────────────── */
.contact-section {
  text-align: center;
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 4rem 3rem;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.contact-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-border), transparent);
}

.contact-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.contact-desc {
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.contact-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
.social-link:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-dim);
}

.social-link-cta {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}
.social-link-cta:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ── 12. Footer ────────────────────────────────────────────────────────── */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  max-width: 1100px;
  margin: 0 auto;
}

.footer-name {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  color: var(--text-muted);
  font-size: 1rem;
  transition: all 0.2s;
}
.footer-top-link:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── 13. Scroll animations ─────────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── 14. Swiper overrides ──────────────────────────────── */
.slider-wrapper {
  position: relative;
  padding: 0 3rem;
}

.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 2;
  transition: opacity 0.3s ease;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
}

.slider-nav.case-prev,
.slider-nav.blog-prev { left: 0; }

.slider-nav.case-next,
.slider-nav.blog-next { right: 0; }

.slider-nav.swiper-button-disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Hide default Swiper arrows since we use custom external ones */
.swiper-button-prev, .swiper-button-next {
  display: none;
}

/* Swiper pagination dots */
.swiper-pagination-bullet {
  background: var(--text-muted);
  opacity: 0.5;
  width: 8px;
  height: 8px;
}

.swiper-pagination-bullet-active {
  background: var(--accent);
  opacity: 1;
}

.case-swiper .swiper-slide, .blog-swiper .swiper-slide {
  height: auto;
}

/* ── Diagram toolbar ─────────────────────────────────────────────────── */
.diagram-toolbar {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 0.35rem;
  border-radius: 6px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.case-diagram:hover .diagram-toolbar {
  opacity: 1;
  pointer-events: auto;
}

body.light .diagram-toolbar {
  background: rgba(255, 255, 255, 0.85);
}

.diagram-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}

.diagram-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.diagram-hint {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 0 0.4rem;
  white-space: nowrap;
  border-left: 1px solid var(--border-strong);
  margin-left: 0.15rem;
}

/* ── Skeleton loader ───────────────────────────────────────────────────── */
.diagram-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

.diagram-skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Error state ───────────────────────────────────────────────────────── */
.diagram-error {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 2rem;
}

.diagram-retry {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  padding: 0.375rem 0.875rem;
  border-radius: var(--r);
  font-size: 0.8125rem;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: all 0.2s;
}

.diagram-retry:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ── 15. Light theme overrides ─────────────────────────────────────────── */
body.light {
  --bg-primary:     #fafafa;
  --bg-secondary:   #f5f5f5;
  --bg-tertiary:    #efefef;
  --bg-card:        #ffffff;
  --text-primary:   #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted:     #808080;
  --accent:         #059669;
  --accent-dim:     rgba(5, 150, 105, 0.1);
  --accent-border:  rgba(5, 150, 105, 0.3);
  --border:         rgba(0, 0, 0, 0.08);
  --border-strong:  rgba(0, 0, 0, 0.15);
}
body.light #top-nav {
  background: var(--bg-primary);
}

/* ── 16. Responsive ────────────────────────────────────────────────────── */
/* ── Wide screens ──────────────────────────────────────────────────────── */
@media (min-width: 1400px) {
  .nav-container,
  section { max-width: 1280px; }
  .hero { max-width: 1280px; }
}

/* ── Tablet ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-grid { gap: 2.5rem; }
  .case-body { grid-template-columns: 1fr; }
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .diagram-toolbar {
    opacity: 1;
    pointer-events: auto;
  }
  .case-diagram {
    min-height: 240px;
    padding: 1rem;
  }
  .diagram-hint {
    display: none;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-visual {
    order: -1;
    justify-content: center;
  }
  .hero-photo { width: 180px; height: 180px; }
  .photo-ring { width: 220px; height: 220px; }
  .photo-ring-2 { width: 260px; height: 260px; }
  .hero-subtitle { max-width: 100%; }
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-strong);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
  }
  .nav-links.open {
    max-height: 24rem;
    opacity: 1;
    visibility: visible;
  }
  .nav-links li {
    width: 100%;
  }
  .nav-links a {
    display: block;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
  }
  .nav-links a::after { display: none; }
  section { padding: 4rem 1.25rem; }
  .philosophy-text { font-size: 1rem; }
  .contact-section { padding: 2.5rem 1.25rem; }
  .contact-links { flex-direction: column; align-items: stretch; }
  .social-link { justify-content: center; }
  .case-card { padding: 1.5rem; }
  .case-title { font-size: 1.125rem; }
  .case-subtitle { font-size: 0.875rem; }
  .case-body { grid-template-columns: 1fr; gap: 1rem; }
  .case-section p { font-size: 0.875rem; }
  .article-card { flex: 0 0 85vw; }
  .article-title { font-size: 1rem; }
  .article-date { font-size: 0.7rem; }
  .slider-wrapper { padding: 0 2rem; }
  .slider-nav { font-size: 1.1rem; }
}

/* ── Small mobile ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .section-title { font-size: 1.5rem; }
  .nav-container { padding: 0.875rem 1.25rem; }
  section { padding: 3rem 1.25rem; }
  .case-title { font-size: 1rem; }
  .case-subtitle { font-size: 0.8125rem; }
  .philosophy-text { font-size: 0.9375rem; }
  .story-narrative { font-size: 0.875rem; }
}

/* ── 17. Reduced motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .diagram-skeleton-line {
    background: var(--bg-tertiary);
  }
}