/* ==========================================================================
   Hanbai v2.8 — Warm Editorial Light (Default) & Soft Dusk Dark
   Zero backdrop-filter / Zero SVG noise / Zero canvas loop
   ========================================================================== */

:root {
  /* Light Theme (Default: Warm Parchment & Terracotta Coral) */
  --bg: #faf6ef;
  --bg-card: #ffffff;
  --bg-subtle: #f7f1e7;
  --bg-pill: #ffffff;

  --text: #232230;
  --text-secondary: #534f61;
  --muted: #787285;

  --accent: #c47a52;
  --accent-strong: #ad623a;
  --accent-soft: rgba(196, 122, 82, 0.11);
  --accent-glow: rgba(196, 122, 82, 0.15);

  --accent2: #7a6ea8;
  --accent2-soft: rgba(122, 110, 168, 0.11);

  --live: #2f855a;
  --live-soft: rgba(47, 133, 90, 0.11);

  --border: #e7dfd2;
  --border-accent: rgba(196, 122, 82, 0.42);

  --shadow-card: 0 2px 12px rgba(74, 54, 30, 0.045);
  --shadow-hover: 0 16px 36px rgba(196, 122, 82, 0.15), 0 0 0 1px rgba(196, 122, 82, 0.12);
  --shadow-pill: 0 2px 10px rgba(74, 54, 30, 0.06);

  --grad-btn: linear-gradient(135deg, #cf835a 0%, #b5663e 100%);
  --grad-btn-hover: linear-gradient(135deg, #c47449 0%, #9f542e 100%);

  --font-sans: "Inter", "Outfit", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-card: 16px;
  --radius-media: 10px;
  --radius-pill: 999px;
}

[data-theme="dark"] {
  /* Soft Warm Dusk Slate — gentle dark mode, never pitch black */
  --bg: #262530;
  --bg-card: #31303d;
  --bg-subtle: #2b2a36;
  --bg-pill: #31303d;

  --text: #f0ece4;
  --text-secondary: #cac5d4;
  --muted: #9e99ac;

  --accent: #e89c74;
  --accent-strong: #f2ae89;
  --accent-soft: rgba(232, 156, 116, 0.16);
  --accent-glow: rgba(232, 156, 116, 0.14);

  --accent2: #aca1d4;
  --accent2-soft: rgba(172, 161, 212, 0.16);

  --live: #5ee092;
  --live-soft: rgba(94, 224, 146, 0.14);

  --border: #434152;
  --border-accent: rgba(232, 156, 116, 0.46);

  --shadow-card: 0 4px 18px rgba(15, 14, 22, 0.22);
  --shadow-hover: 0 16px 36px rgba(15, 14, 22, 0.34), 0 0 0 1px rgba(232, 156, 116, 0.2);
  --shadow-pill: 0 3px 12px rgba(15, 14, 22, 0.22);

  --grad-btn: linear-gradient(135deg, #e5966c 0%, #cc784e 100%);
  --grad-btn-hover: linear-gradient(135deg, #eda37b 0%, #d88358 100%);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 18% 0%, rgba(196, 122, 82, 0.09) 0%, transparent 48%),
    radial-gradient(ellipse at 85% 92%, rgba(122, 110, 168, 0.07) 0%, transparent 48%);
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(ellipse at 18% 0%, rgba(232, 151, 107, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 92%, rgba(155, 142, 196, 0.09) 0%, transparent 50%);
}

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

button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ==========================================================================
   Floating Minimal Top Controls (Lightweight solid surface, zero blur)
   ========================================================================== */

.floating-brand {
  position: fixed;
  top: 18px;
  left: 20px;
  z-index: 40;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  background: var(--bg-pill);
  border: 1px solid var(--border-accent);
  box-shadow: var(--shadow-pill);
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.floating-brand:hover {
  transform: translateY(-2px);
  background: var(--accent);
  color: #fff;
}

.floating-controls {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-pill {
  height: 36px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-pill);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-pill);
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ctrl-pill:hover {
  transform: translateY(-1px);
  border-color: var(--border-accent);
  color: var(--accent);
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

/* ==========================================================================
   Main Container & Hero
   ========================================================================== */

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 80px 22px 54px;
}

.hero {
  text-align: center;
  padding: 24px 0 38px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.kicker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero-title {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--text);
}

.hero-word {
  display: inline-block;
  animation: heroRise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-accent {
  color: var(--accent);
  animation-delay: 0.05s;
}

@keyframes heroRise {
  from {
    opacity: 0.45;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-tagline {
  max-width: 600px;
  margin: 16px auto 0;
  font-size: 1.04rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.hero-actions {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.pill-btn-solid {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 6px 18px rgba(196, 122, 82, 0.24);
}

.pill-btn-solid:hover {
  background: var(--grad-btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(196, 122, 82, 0.32);
}

.pill-btn-outline {
  background: var(--bg-card);
  color: var(--accent);
  border: 1px solid var(--border-accent);
}

.pill-btn-outline:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
}

/* ==========================================================================
   Stats Strip
   ========================================================================== */

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 8px 0 50px;
  padding: 20px 18px;
  border-radius: var(--radius-card);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.stat-item {
  text-align: center;
  padding: 4px 8px;
  position: relative;
}

.stat-item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--border);
}

.stat-num {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  margin-top: 5px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

/* ==========================================================================
   Section Header & Filter
   ========================================================================== */

.section {
  margin-bottom: 54px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}

.count-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
}

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

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

.filter-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ==========================================================================
   Dynamic Project Cards (Pure GPU transform/opacity)
   ========================================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 18px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: cardReveal 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition:
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.26s ease,
    box-shadow 0.26s ease;
}

.project-card:nth-child(1) { animation-delay: 0.03s; }
.project-card:nth-child(2) { animation-delay: 0.08s; }
.project-card:nth-child(3) { animation-delay: 0.13s; }
.project-card:nth-child(4) { animation-delay: 0.18s; }

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.26s ease;
}

.project-card.is-featured-warm {
  border-color: rgba(196, 122, 82, 0.26);
}

.project-card.is-featured-warm::before {
  opacity: 0.72;
}

.project-card.is-featured-lavender {
  border-color: rgba(122, 110, 168, 0.26);
}

.project-card.is-featured-lavender::before {
  background: linear-gradient(90deg, transparent, var(--accent2), transparent);
  opacity: 0.72;
}

.project-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-hover);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card.is-hidden {
  display: none;
}

.project-card.is-filtering-in {
  animation: cardReveal 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Card Preview Media (Clickable Lightbox) */
.card-media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-media);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--bg-subtle);
  cursor: zoom-in;
}

.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-media img.img-align-left {
  object-position: left center;
}

.project-card:hover .card-media img {
  transform: scale(1.03);
}

.media-zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  background: rgba(24, 22, 36, 0.78);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.card-media:hover .media-zoom-hint,
.card-media:focus-visible .media-zoom-hint {
  opacity: 1;
  transform: translateY(0);
}

/* Card Content */
.card-content {
  display: flex;
  flex-direction: column;
  padding: 16px 4px 2px;
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}

.status-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-live {
  color: var(--live);
  background: var(--live-soft);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  animation: livePulse 2.4s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(47, 133, 90, 0.42);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(47, 133, 90, 0);
  }
}

.badge-invite {
  color: var(--accent2);
  background: var(--accent2-soft);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent2);
}

.card-tech {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.5;
}

.card-summary {
  margin: 10px 0 0;
  min-height: 6.8em;
  font-size: 0.89rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Smooth Expandable Details Drawer */
.card-details {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}

.card-details.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.card-details-inner {
  overflow: hidden;
}

.detail-list {
  margin: 14px 0 2px;
  padding: 14px;
  min-height: 210px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
}

.detail-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  font-size: 0.82rem;
  line-height: 1.6;
}

.detail-row dt {
  font-weight: 700;
  color: var(--accent);
}

.detail-row dd {
  margin: 0;
  color: var(--text-secondary);
}

/* English typography overrides (desktop 2-column alignment & wider dt column) */
html[lang="en"] .card-tech {
  min-height: 3em;
}

html[lang="en"] .card-summary {
  min-height: 8.6em;
}

html[lang="en"] .detail-list {
  min-height: 290px;
}

html[lang="en"] .detail-row {
  grid-template-columns: 92px 1fr;
  gap: 12px;
}

/* Card Actions Row */
.card-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.action-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--grad-btn);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(196, 122, 82, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-primary svg {
  transition: transform 0.2s ease;
}

.action-primary:hover {
  background: var(--grad-btn-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(196, 122, 82, 0.3);
}

.action-primary:hover svg {
  transform: translateX(3px);
}

.action-expand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.action-expand svg {
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.action-expand:hover {
  border-color: var(--border-accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.action-expand[aria-expanded="true"] {
  border-color: var(--border-accent);
  color: var(--accent);
}

.action-expand[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* ==========================================================================
   Research Focus & Tech Stack (Two-Tier Cloud)
   ========================================================================== */

.stack-groups {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.stack-group-label {
  margin: 0 0 11px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.stack-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stack-pill {
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.stack-pill.is-core {
  border-color: var(--border-accent);
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.stack-pill:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  color: var(--accent);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-copy {
  margin: 0;
}

/* ==========================================================================
   Lightbox Modal
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(12, 11, 20, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: scale(1.06);
}

.lightbox-figure {
  margin: 0;
  max-width: min(1080px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transform: scale(0.96);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox.is-open .lightbox-figure {
  transform: scale(1);
}

.lightbox-figure img {
  max-width: 100%;
  max-height: calc(88vh - 56px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  background: #faf6ef;
}

.lightbox-caption {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #f3efe8;
  font-size: 0.9rem;
  font-weight: 600;
}

.lightbox-caption a {
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: var(--grad-btn);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ==========================================================================
   Lightweight Scroll Reveal (Below-the-fold only)
   ========================================================================== */

.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-pending {
  opacity: 0;
  transform: translateY(14px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive & Reduced Motion
   ========================================================================== */

@media (max-width: 760px) {
  .container {
    padding: 72px 16px 42px;
  }

  .floating-brand {
    top: 12px;
    left: 14px;
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
  }

  .floating-controls {
    top: 12px;
    right: 14px;
    gap: 6px;
  }

  .ctrl-pill {
    height: 34px;
    padding: 0 11px;
    font-size: 0.76rem;
  }

  .hero {
    padding: 16px 0 26px;
  }

  .hero-kicker {
    font-size: 0.75rem;
    padding: 4px 12px;
  }

  .hero-tagline {
    font-size: 0.96rem;
    line-height: 1.7;
  }

  .pill-btn {
    padding: 10px 20px;
    font-size: 0.86rem;
  }

  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding: 8px;
    margin-bottom: 36px;
  }

  .stat-item {
    padding: 14px 8px;
  }

  .stat-item:not(:last-child)::after {
    display: none;
  }

  .stat-item:nth-child(odd) {
    border-right: 1px solid var(--border);
  }

  .stat-item:nth-child(1),
  .stat-item:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }

  .section {
    margin-bottom: 42px;
  }

  .section-header {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .project-card {
    padding: 14px;
  }

  .card-top-row {
    flex-wrap: wrap;
    gap: 6px 10px;
  }

  .card-tech,
  html[lang="en"] .card-tech {
    min-height: 0;
  }

  .card-summary,
  html[lang="en"] .card-summary {
    min-height: 0;
  }

  .detail-list,
  html[lang="en"] .detail-list {
    min-height: 0;
    justify-content: flex-start;
  }

  .media-zoom-hint {
    opacity: 0.88;
    transform: none;
  }

  .detail-row,
  html[lang="en"] .detail-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .card-actions {
    flex-wrap: wrap;
  }

  .action-primary,
  .action-expand {
    min-height: 38px;
  }

  .lightbox {
    padding: 16px;
  }

  .lightbox-close {
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
  }

  .lightbox-caption {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    font-size: 0.84rem;
  }
}

@media (max-width: 420px) {
  .container {
    padding: 68px 12px 36px;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .card-title {
    font-size: 1.04rem;
  }

  .card-tech {
    font-size: 0.72rem;
  }

  .stack-pill {
    padding: 6px 12px;
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-word,
  .reveal,
  .project-card,
  .card-media img,
  .card-details,
  .pulse-dot {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
