/* ─────────────────────────────────────────────────────────────────────────────
   MURAT KHIDOYATOV / PORTFOLIO
   Aesthetic: modern technical · dark mode · mono · terminal-inspired
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  /* dark theme (default) */
  --bg: #0a0b0d;
  --bg-elev: #111316;
  --bg-card: #14171b;
  --border: #1f242b;
  --border-strong: #2a3038;
  --text: #e6e7e9;
  --text-dim: #8b9099;
  --text-muted: #5a6068;
  --accent: #c8ff5e;       /* electric chartreuse */
  --accent-soft: #c8ff5e26;
  --warning: #ff9b3d;
  --success: #5dd97f;
  --danger: #ff5d5d;

  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --font-display: 'Fraunces', 'Times New Roman', serif;

  --max-w: 1200px;
  --pad: clamp(1rem, 4vw, 3rem);
  --radius: 6px;
}

[data-theme='light'] {
  --bg: #f7f6f2;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --border: #e2e0d8;
  --border-strong: #c8c5bb;
  --text: #14161a;
  --text-dim: #5a6068;
  --text-muted: #8b9099;
  --accent: #2a5a1a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  font-feature-settings: 'ss01', 'ss02', 'cv01';
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* ── Background layers ───────────────────────────────────────────────────── */

.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Navigation ──────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--pad);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__brand {
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  gap: 0.15em;
}

.brand__bracket { color: var(--accent); }

.nav__links {
  display: flex;
  gap: 1.75rem;
  font-size: 12px;
}

.nav__links a {
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.15s ease;
  display: flex;
  align-items: baseline;
  gap: 0.4em;
}

.nav__links a:hover { color: var(--accent); }

.nav__num {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.nav__theme {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

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

@media (max-width: 720px) {
  .nav__links { display: none; }
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) var(--pad) clamp(4rem, 10vw, 8rem);
}

.hero__terminal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 4rem;
  max-width: 640px;
  font-size: 12px;
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--accent) 30%, transparent);
  animation: fadeIn 0.8s ease 0.1s both;
}

.terminal__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: var(--radius) var(--radius) 0 0;
}

.dot {
  width: 11px; height: 11px;
  border-radius: 50%;
}
.dot--red { background: #ff5f56; }
.dot--yellow { background: #ffbd2e; }
.dot--green { background: #27c93f; }

.terminal__title {
  margin-left: auto;
  margin-right: auto;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.terminal__body {
  padding: 1.25rem 1.5rem;
}

.line {
  margin-bottom: 0.4em;
}

.prompt { color: var(--accent); margin-right: 0.6em; }
.cmd    { color: var(--text); }
.line--out { color: var(--text-dim); padding-left: 1.3em; }

.cursor {
  display: inline-block;
  background: var(--accent);
  width: 8px; height: 1em;
  vertical-align: middle;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
  max-width: 16ch;
}

.title__row {
  display: block;
  animation: rise 1s ease both;
}
.title__row:nth-child(1) { animation-delay: 0.3s; }
.title__row:nth-child(2) { animation-delay: 0.5s; }
.title__row:nth-child(3) { animation-delay: 0.7s; }

.title__row--accent {
  font-style: italic;
  color: var(--accent);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.hero__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.meta__col { display: flex; flex-direction: column; gap: 0.3em; }
.meta__label { color: var(--text-muted); }
.meta__value { color: var(--text); }
.meta__link {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.meta__link:hover { opacity: 0.7; }

.pulse {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  margin-right: 0.5em;
  box-shadow: 0 0 0 0 var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── Sections ────────────────────────────────────────────────────────────── */

.section {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 6rem) var(--pad);
  border-top: 1px solid var(--border);
}

.section__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.section__num {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  font-weight: 500;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.01em;
}

.section__rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── About ───────────────────────────────────────────────────────────────── */

.about__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 820px) {
  .about__grid { grid-template-columns: 1fr; }
}

.about__text p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.85;
  margin-bottom: 1.4em;
  max-width: 60ch;
}

.about__text p:last-child { margin-bottom: 0; }

.hl {
  color: var(--text);
  background: linear-gradient(transparent 80%, var(--accent-soft) 80%);
  padding: 0 0.1em;
}

.link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent);
  transition: opacity 0.15s ease;
}
.link:hover { opacity: 0.7; }

.about__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  font-size: 12px;
  position: sticky;
  top: 6rem;
}

.card__row {
  display: flex;
  justify-content: space-between;
  padding: 0.5em 0;
  border-bottom: 1px dashed var(--border);
}
.card__row:last-child { border-bottom: 0; }
.card__row span:first-child { color: var(--text-muted); }
.card__row span:last-child  { color: var(--text); text-align: right; }

/* ── Research ────────────────────────────────────────────────────────────── */

.research__list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
}

.research__item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.research__item:hover {
  transform: translateX(4px);
  border-left-color: var(--text);
}

.research__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.tag {
  display: inline-block;
  padding: 0.15em 0.6em;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.tag--active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.research__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  margin-bottom: 0.3em;
  letter-spacing: -0.01em;
}

.research__org {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 1em;
}

.research__body {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.75;
  margin-bottom: 1.2em;
}

.research__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}
.research__tech span {
  font-size: 10px;
  padding: 0.25em 0.7em;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.publication {
  background: var(--bg-elev);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
}

.publication__label {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 0.8em;
}

.publication__cite {
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
}

.publication__cite strong {
  color: var(--accent);
  font-weight: 500;
}

/* ── Projects ────────────────────────────────────────────────────────────── */

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.project {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.project::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.project:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.project:hover::before { transform: translateX(0); }

.project__index {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 1em;
}

.project__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  margin-bottom: 0.3em;
  letter-spacing: -0.01em;
}

.project__role {
  color: var(--text-dim);
  font-size: 11px;
  margin-bottom: 1em;
}

.project__body {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 1.2em;
}

.project__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.project__tech span {
  font-size: 10px;
  padding: 0.2em 0.6em;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
}

/* ── Gallery hint ────────────────────────────────────────────────────────── */

.section--gallery { padding-bottom: 1rem; }

.gallery__hint {
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 0;
}

/* ── Apple-style horizontal-scroll-on-vertical-scroll ────────────────────── */

.hscroll {
  position: relative;
  height: 500vh;       /* total scroll budget — tweak for pacing */
  background: var(--bg);
}

.hscroll__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hscroll__track {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-left: var(--pad);
  padding-right: var(--pad);
  will-change: transform;
}

.hscroll__slide {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-width: min(55vw, 720px);
}

.hscroll__slide img {
  height: min(60vh, 520px);
  width: auto;
  max-width: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  object-fit: contain;
}

.hscroll__slide figcaption {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  display: flex;
  align-items: baseline;
  gap: 0.8em;
}

.cap__num {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.hscroll__progress {
  position: absolute;
  bottom: 4vh;
  left: var(--pad);
  right: var(--pad);
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.hscroll__progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.05s linear;
}

@media (max-width: 720px) {
  .hscroll { height: auto; }
  .hscroll__sticky {
    position: static;
    height: auto;
    padding: 1rem 0 2rem;
  }
  .hscroll__track {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
  }
  .hscroll__track::-webkit-scrollbar { display: none; }
  .hscroll__slide {
    scroll-snap-align: start;
    max-width: 90vw;
  }
  .hscroll__slide img { height: 50vh; }
  .hscroll__progress { display: none; }
}

/* ── Resume ──────────────────────────────────────────────────────────────── */

.resume__intro {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 2rem;
  max-width: 60ch;
}

.resume__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.resume__card {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  color: var(--text);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.resume__card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -20px color-mix(in srgb, var(--accent) 25%, transparent);
}

.resume__icon {
  font-size: 2rem;
  color: var(--accent);
  align-self: flex-start;
  transition: transform 0.25s ease;
}

.resume__card:hover .resume__icon { transform: translateX(6px); }

.resume__body { flex: 1; }

.resume__tag {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 0.5em;
  display: block;
}

.resume__body h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  margin-bottom: 0.5em;
}

.resume__body p {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 1em;
}

.resume__cta {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.05em;
  border-bottom: 1px dashed var(--accent);
  padding-bottom: 1px;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.footer {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem var(--pad) 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 11px;
  color: var(--text-muted);
}

.footer__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

.footer__links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer__links a:hover { color: var(--accent); }

/* ── Selection ───────────────────────────────────────────────────────────── */
::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hscroll { height: auto; }
  .hscroll__sticky { position: static; height: auto; }
  .hscroll__track { flex-wrap: wrap; transform: none !important; }
}

/* ── Project card "View" link ────────────────────────────────────────────── */

.project__link {
  display: inline-block;
  margin-top: 1.2em;
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
  border-bottom: 1px dashed var(--accent);
  padding-bottom: 1px;
  transition: opacity 0.15s ease;
}
.project__link:hover { opacity: 0.7; }

/* ── Project detail pages ────────────────────────────────────────────────── */

.proj-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.15s ease;
  letter-spacing: 0.03em;
}
.proj-back:hover { color: var(--accent); }

.proj-hero {
  padding-bottom: 0;
}

.proj-hero__label {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 1em;
}

.proj-hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.6em;
  max-width: 22ch;
}

.proj-hero__role {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 1.5rem;
}

.proj-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.proj-hero__tags span {
  font-size: 10px;
  padding: 0.25em 0.7em;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.proj-images {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem var(--pad) 0;
}

.proj-images__grid {
  display: grid;
  gap: 1rem;
}

.proj-images__grid--two {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
  .proj-images__grid--two { grid-template-columns: 1fr; }
}

.proj-images__grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.proj-images__caption {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 0.8rem;
  letter-spacing: 0.04em;
}

.proj-body {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) var(--pad) clamp(3rem, 7vw, 6rem);
}

.proj-body__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 4rem;
  align-items: start;
}

@media (max-width: 860px) {
  .proj-body__grid { grid-template-columns: 1fr; gap: 2.5rem; }
}

.proj-subsection {
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
  margin-top: 2.5rem;
}

.proj-subsection:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.proj-subsection__label {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.6em;
}

.proj-subsection__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  letter-spacing: -0.01em;
  margin-bottom: 1em;
}

.proj-subsection p {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.85;
  margin-bottom: 1.1em;
  max-width: 62ch;
}

.proj-subsection p:last-of-type { margin-bottom: 0; }

.proj-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65em;
  margin-top: 1.4em;
}

.proj-bullets li {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.65;
  padding-left: 1.5em;
  position: relative;
}

.proj-bullets li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 11px;
}

.proj-bullets__label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
}

.proj-sidebar {
  position: sticky;
  top: 6rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.proj-sidebar__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  font-size: 12px;
}

.proj-sidebar__card h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  margin-bottom: 1em;
  color: var(--text);
}

.proj-sidebar__card .card__row {
  font-size: 11px;
}

.proj-other-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 11px;
  padding: 0.65em 0;
  border-bottom: 1px dashed var(--border);
  transition: color 0.15s ease;
}

.proj-other-link:last-child { border-bottom: none; }
.proj-other-link:hover { color: var(--accent); }

.proj-other-link__num {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ── Framework animation (research page) ─────────────────────────────────── */

.framework-viz {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem var(--pad) 0;
}

.framework-viz__label {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75em;
}

#frameworkCanvas {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

@media (max-width: 560px) {
  #frameworkCanvas { min-height: 260px; }
}

/* ── Arm demo ─────────────────────────────────────────────────────────────── */
.arm-demo {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem var(--pad) 0;
}

.arm-demo__label {
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75em;
}

#armCanvas {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: grab;
  touch-action: none;
}

#armCanvas:active { cursor: grabbing; }

.arm-demo__controls {
  margin-top: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.arm-demo__toprow {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.arm-demo__btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  padding: 0.45em 1em;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.arm-demo__btn:hover { opacity: 0.85; }

.arm-demo__hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.arm-demo__sliders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem 2rem;
}

.arm-demo__slider-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.arm-demo__slider-row label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}

.arm-demo__slider-row label span {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.arm-demo__slider-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: var(--border-strong);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.arm-demo__slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
}

.arm-demo__slider-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.arm-demo__slider-row input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

@media (max-width: 560px) {
  .arm-demo__sliders { grid-template-columns: 1fr; }
  .arm-demo__toprow { flex-direction: column; align-items: flex-start; }
}