:root {
  color-scheme: light;
  --ink: #151718;
  --ink-soft: #3a3f42;
  --muted: #687078;
  --line: #dfe4e7;
  --paper: #f4f6f7;
  --surface: #ffffff;
  --surface-strong: #f8fafb;
  --night: #111313;
  --night-soft: #1d2224;
  --green: #15a46d;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #d14d3f;
  --cyan: #0891b2;
  --violet: #7c3aed;
  --shadow: 0 18px 50px rgba(21, 23, 24, 0.12);
  --container: 1180px;
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eaed;
  --ink-soft: #bcc0c5;
  --muted: #8e949a;
  --line: #3a3f44;
  --paper: #111313;
  --surface: #1a1e20;
  --surface-strong: #23272a;
  --night: #0a0c0c;
  --night-soft: #141618;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .site-header {
  background: rgba(17, 19, 19, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .brand-mark {
  background: #fff;
  color: #111313;
}

[data-theme="dark"] .site-nav a:hover,
[data-theme="dark"] .site-nav a.active {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .section.white {
  background: var(--surface);
}

[data-theme="dark"] .project-card {
  border-color: rgba(255, 255, 255, 0.04);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .project-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .project-body .tag {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .note-card {
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .detail-block {
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .side-block.light {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .side-block.light p,
[data-theme="dark"] .side-block.light li {
  color: var(--muted);
}

[data-theme="dark"] .stack-list li {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .stat-pill {
  background: var(--surface-strong);
  border-color: var(--line);
}

[data-theme="dark"] .filter-pill {
  background: var(--surface);
  border-color: var(--line);
}

[data-theme="dark"] .filter-pill:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(110deg, #23272a 30%, #2d3236 50%, #23272a 70%);
  background-size: 200% 100%;
}

[data-theme="dark"] .button {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--surface);
  color: var(--ink);
}

[data-theme="dark"] .button.dark {
  color: #111313;
}

[data-theme="dark"] .button.subtle {
  background: var(--surface-strong);
}

[data-theme="dark"] .back-to-top {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--surface);
  color: var(--ink);
}

[data-theme="dark"] .back-to-top:hover {
  background: #fff;
  color: #111313;
  border-color: #fff;
}

[data-theme="dark"] .project-media {
  background: var(--surface-strong);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .project-preview {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .project-hero {
  background: var(--paper);
}

[data-theme="dark"] .notes-hero {
  background: var(--paper);
}

[data-theme="dark"] .back-link {
  color: var(--muted);
}

[data-theme="dark"] .section {
  color: var(--ink);
}

[data-theme="dark"] .text-link {
  color: var(--ink);
}

[data-theme="dark"] .focus-list li {
  border-bottom-color: var(--line);
}

[data-theme="dark"] .hero-main-shot {
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .project-preview img {
  background: var(--surface);
}

[data-theme="dark"] .mobile-overlay {
  background: rgba(17, 19, 19, 0.96);
}

[data-theme="dark"] .mobile-overlay a {
  color: var(--ink-soft);
}

[data-theme="dark"] .mobile-overlay a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

body.menu-open {
  overflow: hidden;
}

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

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 36px;
  color: var(--ink);
  background: rgba(244, 246, 247, 0.84);
  border-bottom: 1px solid rgba(21, 23, 24, 0.06);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 800;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 0.91rem;
  font-weight: 680;
}

.site-nav a {
  padding: 9px 12px;
  border-radius: 7px;
}

.site-nav a:hover {
  background: rgba(21, 23, 24, 0.07);
}

.site-nav a.active {
  color: var(--ink);
  background: rgba(21, 23, 24, 0.09);
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 60;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.hamburger span:nth-child(2) {
  width: 70%;
}

.menu-open .hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-open .hamburger span:nth-child(2) {
  opacity: 0;
}

.menu-open .hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: rgba(244, 246, 247, 0.96);
  backdrop-filter: blur(24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.menu-open .mobile-overlay {
  opacity: 1;
  pointer-events: auto;
}

.mobile-overlay a {
  display: block;
  padding: 14px 24px;
  color: var(--ink-soft);
  font-size: 1.3rem;
  font-weight: 720;
  border-radius: 10px;
  transition: color 0.15s ease, background 0.15s ease;
}

.mobile-overlay a:hover {
  color: var(--ink);
  background: rgba(21, 23, 24, 0.06);
}

/* ── Header tools ───────────────────────────── */

.header-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
}

.theme-toggle,
.lang-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(21, 23, 24, 0.12);
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover,
.lang-toggle:hover {
  background: rgba(21, 23, 24, 0.07);
  color: var(--ink);
}

[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .lang-toggle {
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] .lang-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.container {
  width: min(var(--container), calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  color: #fff;
  background: var(--night);
  padding: 88px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero-copy {
  min-width: 0;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.6rem, 5vw, 4.5rem);
  line-height: 1.02;
  font-weight: 830;
  letter-spacing: -0.02em;
}

.hero h1 span {
  display: block;
  color: #d8f6e8;
}

.hero-lead {
  max-width: 580px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.05rem;
  line-height: 1.75;
}

.hero-media {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: #1a1e20;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.hero-main-shot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  object-position: center top;
}

.hero-actions,
.project-actions,
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid rgba(21, 23, 24, 0.15);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 760;
  line-height: 1;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(21, 23, 24, 0.36);
}

.button.dark {
  border-color: transparent;
  background: #fff;
  color: var(--ink);
}

.button.ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.button.ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.button.subtle {
  background: var(--surface-strong);
}

.hero-proof {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 1px;
  margin-top: 62px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.16);
}

.hero-proof div {
  min-height: 96px;
  padding: 18px;
  background: rgba(17, 19, 19, 0.74);
}

.hero-proof strong {
  display: block;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1.1;
}

.hero-proof span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.84rem;
  line-height: 1.45;
}

.section {
  padding: 92px 0;
}

.section.tight {
  padding: 64px 0;
}

.section.dark {
  color: #fff;
  background: var(--night);
}

.section.white {
  background: #fff;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.62fr);
  gap: 60px;
  align-items: end;
  margin-bottom: 38px;
}

.section-kicker {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.dark .section-kicker {
  color: rgba(255, 255, 255, 0.52);
}

.section h2,
.project-title h1,
.notes-hero h1 {
  margin: 0;
  font-size: 3rem;
  line-height: 1.06;
  font-weight: 830;
  letter-spacing: 0;
}

.section-head p,
.about-copy p,
.contact-copy,
.project-title p,
.notes-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.85;
}

.dark .section-head p,
.dark .contact-copy {
  color: rgba(255, 255, 255, 0.66);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(320px, 0.5fr);
  gap: 40px;
  align-items: start;
}

.about-copy {
  display: grid;
  gap: 20px;
}

.focus-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.focus-list li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.focus-list li::before {
  width: 9px;
  height: 9px;
  margin-top: 9px;
  content: "";
  border-radius: 50%;
  background: var(--accent, var(--green));
}

.signal-panel {
  padding: 26px;
  color: #fff;
  background: linear-gradient(160deg, var(--night) 0%, var(--night-soft) 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.signal-panel h3 {
  margin: 0 0 18px;
  font-size: 1.1rem;
}

.signal-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.signal-row:first-of-type {
  border-top: 0;
}

.signal-row span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.86rem;
}

.signal-row strong {
  font-size: 0.95rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(21, 23, 24, 0.08);
  border-top: 3px solid var(--accent, var(--green));
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(21, 23, 24, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(21, 23, 24, 0.16);
  box-shadow: 0 8px 28px rgba(21, 23, 24, 0.08);
}

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

.project-media {
  position: relative;
  height: 190px;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid rgba(21, 23, 24, 0.08);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 420ms ease;
}

.project-media::after {
  position: absolute;
  inset: auto 0 0;
  height: 52px;
  content: "";
  background: rgba(17, 19, 19, 0.52);
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-strong);
  border: 1px solid rgba(21, 23, 24, 0.1);
  font-size: 0.76rem;
  font-weight: 720;
  line-height: 1;
}

.tag.accent {
  color: #fff;
  background: var(--accent, var(--green));
  border-color: transparent;
}

.project-card h3 {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.project-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.72;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 780;
}

.text-link::after {
  margin-left: 7px;
  content: "->";
}

.matrix-table {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
}

.matrix-row {
  display: grid;
  grid-template-columns: 1.15fr 1.1fr 1fr 1.3fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease;
}

.matrix-row.head {
  pointer-events: none;
}

.matrix-row:not(.head):hover {
  background: rgba(255, 255, 255, 0.22);
}

.matrix-row > div {
  min-width: 0;
  padding: 16px;
  background: var(--night-soft);
  transition: background 0.2s ease;
}

.matrix-row:not(.head):hover > div:first-child {
  box-shadow: inset 3px 0 0 var(--accent, var(--green));
}

.matrix-row.head > div {
  color: rgba(255, 255, 255, 0.55);
  background: #0b0c0c;
  font-size: 0.76rem;
  font-weight: 820;
  text-transform: uppercase;
}

.matrix-row strong {
  display: block;
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.matrix-row span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.84rem;
  line-height: 1.55;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.note-card {
  min-height: 240px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid rgba(21, 23, 24, 0.08);
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.note-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent, var(--ink-soft));
  box-shadow: var(--shadow);
}

.note-card time {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 760;
}

.note-card h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.26;
}

.note-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.contact-band {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.48fr);
  gap: 60px;
  align-items: center;
}

.contact-band h2 {
  margin: 0;
  font-size: 3rem;
  line-height: 1.05;
}

.contact-copy {
  margin-top: 18px;
}

.site-footer {
  padding: 28px 0 44px;
  color: var(--muted);
  background: var(--night);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.84rem;
}

.project-hero {
  padding: 72px 0 36px;
  background: #fff;
}

.back-link {
  display: inline-flex;
  margin-bottom: 36px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 760;
}

.back-link::before {
  margin-right: 8px;
  content: "<-";
}

.project-top {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 0.58fr);
  gap: 48px;
  align-items: center;
}

.project-title h1 {
  overflow-wrap: anywhere;
}

.project-title p {
  margin-top: 22px;
}

.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-strong);
  font-size: 0.84rem;
  font-weight: 740;
}

.project-preview {
  overflow: hidden;
  border: 1px solid rgba(21, 23, 24, 0.12);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.project-preview img {
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 18px;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.project-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.68fr) minmax(320px, 0.32fr);
  gap: 38px;
  align-items: start;
}

.detail-section {
  display: grid;
  gap: 24px;
}

.detail-block {
  padding: 28px;
  background: #fff;
  border: 1px solid rgba(21, 23, 24, 0.1);
  border-radius: var(--radius);
}

.detail-block h2,
.side-block h2 {
  margin: 0 0 16px;
  font-size: 1.32rem;
  line-height: 1.25;
}

.detail-block p {
  margin: 0;
  color: var(--muted);
}

.bullet-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bullet-list li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 11px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.bullet-list li::before {
  width: 8px;
  height: 8px;
  margin-top: 9px;
  content: "";
  border-radius: 50%;
  background: var(--accent, var(--green));
}

.side-rail {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 92px;
}

.side-block {
  padding: 22px;
  background: var(--night);
  border-radius: var(--radius);
  color: #fff;
}

.side-block.light {
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(21, 23, 24, 0.1);
}

.side-block p,
.side-block li {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.92rem;
}

.side-block.light p,
.side-block.light li {
  color: var(--muted);
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack-list li {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.side-block.light .stack-list li {
  background: var(--surface-strong);
  border-color: var(--line);
}

.quote-strip {
  padding: 34px;
  color: #fff;
  background: var(--accent, var(--green));
  border-radius: var(--radius);
}

.quote-strip p {
  margin: 0;
  font-size: 1.32rem;
  line-height: 1.55;
  font-weight: 740;
}

.notes-hero {
  padding: 82px 0 44px;
  background: #fff;
}

.notes-hero p {
  width: min(720px, 100%);
  margin-top: 20px;
}

.empty-state {
  padding: 70px 0;
  text-align: center;
}

/* ── Entrance animations ────────────────────── */

.animate-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger child cards */
.projects-grid .animate-in:nth-child(1) { transition-delay: 0s; }
.projects-grid .animate-in:nth-child(2) { transition-delay: 0.08s; }
.projects-grid .animate-in:nth-child(3) { transition-delay: 0.16s; }
.projects-grid .animate-in:nth-child(4) { transition-delay: 0.06s; }
.projects-grid .animate-in:nth-child(5) { transition-delay: 0.14s; }
.projects-grid .animate-in:nth-child(6) { transition-delay: 0.22s; }
.notes-grid .animate-in:nth-child(1) { transition-delay: 0s; }
.notes-grid .animate-in:nth-child(2) { transition-delay: 0.08s; }
.notes-grid .animate-in:nth-child(3) { transition-delay: 0.16s; }

/* ── Skeleton loading ───────────────────────── */

.skeleton {
  background: linear-gradient(110deg, #e8ebed 30%, #f4f6f7 50%, #e8ebed 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

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

.project-media.skeleton,
.project-preview.skeleton {
  min-height: 190px;
}

.project-media.skeleton img,
.project-preview.skeleton img {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.project-media img.loaded,
.project-preview img.loaded {
  opacity: 1;
}

/* ── Back to top ────────────────────────────── */

.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 30;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(21, 23, 24, 0.15);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  box-shadow: 0 6px 20px rgba(21, 23, 24, 0.1);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ── Filter pills ───────────────────────────── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-pill {
  padding: 7px 15px;
  border: 1px solid rgba(21, 23, 24, 0.12);
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 680;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.filter-pill:hover {
  border-color: rgba(21, 23, 24, 0.28);
  color: var(--ink);
}

.filter-pill.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

@media (max-width: 980px) {
  .site-header {
    padding: 0 22px;
  }

  .hero {
    padding: 64px 0 56px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-media {
    order: -1;
    max-width: 520px;
    margin: 0 auto;
  }

  .hero h1,
  .section h2,
  .project-title h1,
  .notes-hero h1,
  .contact-band h2 {
    font-size: 3rem;
  }

  .section-head,
  .about-grid,
  .contact-band,
  .project-top,
  .project-detail-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid,
  .notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .matrix-row {
    grid-template-columns: 1fr 1fr;
  }

  .side-rail {
    position: static;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }

  .site-header {
    align-items: center;
    min-height: auto;
    padding: 14px 18px;
  }

  .brand {
    flex: 0 0 auto;
  }

  .brand span:last-child {
    display: none;
  }

  .site-nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .container {
    width: min(100% - 28px, var(--container));
  }

  .hero {
    padding: 48px 0 44px;
  }

  .hero-media {
    max-width: 100%;
  }

  .hero h1,
  .section h2,
  .project-title h1,
  .notes-hero h1,
  .contact-band h2 {
    font-size: 2.4rem;
  }

  .hero-lead {
    font-size: 0.95rem;
  }

  .hero-proof {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 36px;
  }

  .section {
    padding: 64px 0;
  }

  .section-head {
    gap: 18px;
  }

  .projects-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .project-media {
    height: 210px;
  }

  .matrix-row {
    grid-template-columns: 1fr;
  }

  .matrix-row.head {
    display: none;
  }

  .project-hero {
    padding: 42px 0 28px;
  }

  .detail-block,
  .quote-strip {
    padding: 22px;
  }
}
