/* ==========================================================================
   Alper Karagöl — Base Layout & Editorial Components
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--ink);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.975rem;
  line-height: 1.65;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font-family: inherit; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Container & Subtle Grid Background */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.container-prose {
  width: 100%;
  max-width: var(--max-w-prose);
  margin: 0 auto;
  padding: 0 24px;
}

.bg-lab-grid {
  background-image:
    radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0);
  background-size: 28px 28px;
}

/* Typography Helpers */
.font-display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; }
.font-mono { font-family: var(--font-mono); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.section { padding: 76px 0; }
.section-sm { padding: 48px 0; }
.section-divider { border-top: 1px solid var(--border); }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}

.section-title {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.5rem);
  line-height: 1.12;
  font-weight: 400;
  color: var(--ink);
}

.section-title em { font-style: italic; color: var(--accent); }

.section-sub {
  margin: 10px 0 0;
  color: var(--ink-3);
  max-width: 60ch;
  font-size: 0.98rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

[data-theme="dark"] .btn-primary {
  background: var(--accent);
  color: #061317;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  padding: 8px 12px;
}
.btn-ghost:hover { background: var(--bg-subtle); color: var(--ink); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: var(--r-xs); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap var(--dur-fast) var(--ease);
}
.link-arrow:hover { gap: 10px; }

/* Pills & Tags */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--ink-2);
  border: 1px solid var(--border);
}
.pill-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.pill-film { background: var(--film-soft); color: var(--film); border-color: var(--film-border); }

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}
[data-theme="dark"] .brand-mark { background: var(--accent); color: #061317; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 6px 11px;
  border-radius: var(--r-xs);
  font-size: 0.855rem;
  font-weight: 500;
  color: var(--ink-3);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.nav-link:hover { color: var(--ink); background: var(--bg-subtle); }
.nav-link.active { color: var(--ink); background: var(--bg-subtle); font-weight: 600; }

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

.cmdk-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.cmdk-trigger:hover { border-color: var(--accent); color: var(--ink); }

.kbd {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--ink-3);
}

.icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.mobile-menu-btn { display: none; }

.mobile-drawer {
  display: none;
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: var(--bg);
  z-index: 55;
  padding: 24px;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.mobile-drawer.open { display: flex; }
.mobile-drawer .nav-link { font-size: 1.05rem; padding: 12px 14px; }

@media (max-width: 920px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: grid; }
  .cmdk-trigger span.cmdk-label { display: none; }
}

/* ==========================================================================
   Hero & Interactive 3D Molecular Canvas
   ========================================================================== */
.hero {
  padding: 64px 0 56px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 44px;
  align-items: center;
}

@media (max-width: 960px) {
  .hero { padding: 44px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
}

.hero-title {
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.2vw, 4.1rem);
  line-height: 1.04;
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-lead {
  margin: 22px 0 0;
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 56ch;
}

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

.hero-meta-strip {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.stat-item { display: flex; flex-direction: column; gap: 2px; }
.stat-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}
.stat-label { font-size: 0.78rem; color: var(--ink-3); }

/* Interactive Protein Structure Card */
.mol-card {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--canvas-bg);
  border: 1px solid var(--canvas-border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  aspect-ratio: 4 / 4.25;
  display: flex;
  flex-direction: column;
  color: #e2e8f0;
}

.mol-hud-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.mol-badge {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #cbd5e1;
}

.mol-toggle {
  pointer-events: auto;
  display: inline-flex;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--r-pill);
  padding: 2px;
  backdrop-filter: blur(8px);
}

.mol-toggle button {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 180ms, color 180ms;
}

.mol-toggle button.active {
  background: #2dd4bf;
  color: #042f2e;
}

#protein-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#protein-canvas:active { cursor: grabbing; }

.mol-hud-bottom {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.mol-caption {
  background: rgba(10, 15, 24, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(8px);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 0.74rem;
  line-height: 1.45;
  color: #cbd5e1;
}
.mol-caption strong { color: #f8fafc; font-family: var(--font-mono); font-size: 0.72rem; }
.mol-hint {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: #64748b;
  padding: 4px 8px;
}

/* Hero Portrait Dossier Frame (Sci-Fi Lab Editorial) */
.hero-portrait-card {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--canvas-bg);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(45, 212, 191, 0.08);
  overflow: hidden;
  aspect-ratio: 1 / 1.02;
  max-width: 460px;
  width: 100%;
  justify-self: end;
}

@media (max-width: 960px) {
  .hero-portrait-card {
    justify-self: start;
    max-width: 420px;
  }
}

.hero-portrait-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
  transition: transform 600ms var(--ease), filter 400ms var(--ease);
}

.hero-portrait-card:hover img {
  transform: scale(1.025);
}

.portrait-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 10, 18, 0.42) 0%, transparent 26%, transparent 62%, rgba(6, 10, 18, 0.88) 100%);
}

/* Subtle Sci-Fi Corner Reticles */
.reticle {
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
  z-index: 3;
  border-color: rgba(45, 212, 191, 0.65);
  border-style: solid;
  border-width: 0;
}
.reticle-tl { top: 12px; left: 12px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 4px; }
.reticle-tr { top: 12px; right: 12px; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 4px; }
.reticle-bl { bottom: 12px; left: 12px; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 4px; }
.reticle-br { bottom: 12px; right: 12px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 4px; }

.portrait-hud-top {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.portrait-hud-bottom {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: rgba(8, 13, 22, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #e2e8f0;
}

.portrait-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.portrait-role {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #5eead4;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.portrait-coords {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #94a3b8;
  text-align: right;
  white-space: nowrap;
}

.signal-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 10px #2dd4bf;
  animation: pulse-signal 2.4s ease-in-out infinite;
}

@keyframes pulse-signal {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* Sci-Fi Frontier Dispatches & Interactive Molecular Lab Bay */
.frontier-shell {
  border-radius: var(--r-lg);
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(45, 212, 191, 0.12), transparent 60%),
    radial-gradient(ellipse 70% 60% at 90% 90%, rgba(59, 130, 246, 0.12), transparent 60%),
    #0a1019;
  border: 1px solid rgba(45, 212, 191, 0.22);
  box-shadow: var(--shadow-lg);
  padding: 36px;
  color: #e2e8f0;
  position: relative;
  overflow: hidden;
}

.frontier-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 50% 45%, black 35%, transparent 95%);
}

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

@media (max-width: 960px) {
  .frontier-shell { padding: 24px; }
  .frontier-grid { grid-template-columns: 1fr; gap: 28px; }
}

.frontier-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5eead4;
}

.frontier-heading {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  line-height: 1.1;
  font-weight: 400;
  color: #f8fafc;
}

.frontier-heading em {
  font-style: italic;
  color: #2dd4bf;
}

.signal-tabs {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.signal-tab {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
}

.signal-tab:hover {
  border-color: rgba(45, 212, 191, 0.5);
  color: #e2e8f0;
}

.signal-tab.active {
  background: rgba(45, 212, 191, 0.16);
  border-color: #2dd4bf;
  color: #5eead4;
}

.signal-display {
  margin-top: 18px;
  padding: 22px 24px;
  border-radius: var(--r-md);
  background: rgba(7, 11, 18, 0.78);
  border: 1px solid rgba(45, 212, 191, 0.2);
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.signal-code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  color: #2dd4bf;
  text-transform: uppercase;
}

.signal-quote {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.8vw, 1.38rem);
  line-height: 1.48;
  color: #f1f5f9;
}

.signal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.signal-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #94a3b8;
}

.signal-next-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-xs);
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.08);
  color: #5eead4;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast), transform var(--dur-fast);
}

.signal-next-btn:hover {
  background: rgba(45, 212, 191, 0.18);
  transform: translateY(-1px);
}

.frontier-shell .mol-card {
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.75);
  border-color: rgba(45, 212, 191, 0.24);
}

/* Institutional Credibility Ribbon */
.affiliations-bar {
  padding: 26px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.affiliations-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.affiliations-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.affiliations-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px;
}

.affil-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-2);
}

.affil-chip img {
  height: 22px;
  width: auto;
  border-radius: 3px;
  opacity: 0.9;
}

/* ==========================================================================
   Cards & Bento Grids
   ========================================================================== */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }

@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
}

.card-interactive:hover {
  transform: translateY(-3px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
}

.card-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: var(--ink);
}

.card-desc {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--ink-3);
  line-height: 1.6;
}

.card-footer {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Research Pillar Cards */
.pillar-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  margin-bottom: 10px;
}

/* Publication List Rows */
.pub-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}

.pub-row {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 18px;
  align-items: start;
  transition: background var(--dur-fast);
}
.pub-row:last-child { border-bottom: 0; }
.pub-row:hover { background: var(--bg-subtle); }

@media (max-width: 720px) {
  .pub-row { grid-template-columns: 1fr; gap: 8px; }
}

.pub-year {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-3);
  padding-top: 2px;
}

.pub-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 650;
  line-height: 1.42;
  color: var(--ink);
}

.pub-meta {
  margin-top: 5px;
  font-size: 0.82rem;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pub-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Filter Bar & Search */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.search-input {
  flex: 1;
  min-width: 240px;
  max-width: 380px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.88rem;
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast);
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
[data-theme="dark"] .chip.active { background: var(--accent); color: #061317; border-color: var(--accent); }

/* ==========================================================================
   35mm Analog Film Contact Sheet & Lightbox
   ========================================================================== */
.contact-sheet-wrap {
  background: #101114;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-lg);
  padding: 28px;
  color: #e5e7eb;
  position: relative;
  overflow: hidden;
}

.film-sprockets {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 16px;
  opacity: 0.45;
  overflow: hidden;
}
.sprocket {
  width: 18px;
  height: 11px;
  border-radius: 3px;
  background: #050608;
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.film-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #f59e0b;
}

.film-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 960px) { .film-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .film-grid { grid-template-columns: 1fr; } }

.film-frame {
  background: #17191f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-sm);
  padding: 10px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.film-frame:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.55);
}

.film-frame-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: #f59e0b;
  margin-bottom: 8px;
}

.film-frame-img {
  aspect-ratio: 3 / 2;
  border-radius: 4px;
  overflow: hidden;
  background: #090a0d;
}
.film-frame-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms var(--ease);
}
.film-frame:hover .film-frame-img img { transform: scale(1.04); }

.film-frame-meta {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.film-frame-title { font-size: 0.86rem; font-weight: 600; color: #f8fafc; }
.film-frame-sub { font-family: var(--font-mono); font-size: 0.68rem; color: #94a3b8; }

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 7, 11, 0.92);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.open { display: flex; }

.lightbox-inner {
  max-width: 980px;
  width: 100%;
  background: #11141a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-lg);
  overflow: hidden;
  color: #f1f5f9;
}

.lightbox-stage {
  background: #06080c;
  max-height: 70vh;
  display: grid;
  place-items: center;
  position: relative;
}
.lightbox-stage img {
  max-height: 70vh;
  width: auto;
  object-fit: contain;
}

.lightbox-bar {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Blog / Writing Cards & Article Prose
   ========================================================================== */
.post-card-img {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg-subtle);
  margin-bottom: 16px;
}
.post-card-img img { width: 100%; height: 100%; object-fit: cover; }

.prose {
  font-size: 1.04rem;
  line-height: 1.82;
  color: var(--ink-2);
}
.prose h2, .prose h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 2em 0 0.6em;
  line-height: 1.2;
}
.prose p { margin: 0 0 1.25em; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink);
}
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.3em; }

/* ==========================================================================
   Timeline (About / Web CV)
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: 26px;
  border-left: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.timeline-item { position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 4px;
}

/* ==========================================================================
   Command Palette (Cmd+K)
   ========================================================================== */
.cmdk-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(8, 12, 20, 0.56);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 24px;
}
.cmdk-backdrop.open { display: flex; }

.cmdk-dialog {
  width: 100%;
  max-width: 560px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.cmdk-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.cmdk-input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.96rem;
  outline: none;
}

.cmdk-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.cmdk-group-label {
  padding: 8px 10px 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
}

.cmdk-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-xs);
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
}
.cmdk-item:hover, .cmdk-item.selected {
  background: var(--accent-soft);
  color: var(--ink);
}
.cmdk-item small { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-4); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 200ms, transform 200ms;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Skeletons & States */
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty-state {
  padding: 40px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  color: var(--ink-3);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 36px;
  background: var(--bg-subtle);
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-col h4 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--ink-3);
}