/* style.css — Component Styles for Naïm Naouar Academic Site */

/* ─── UTILITY CLASSES ─── */
.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.container--narrow {
  max-width: var(--content-default);
}

.section {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

.section--alt {
  background-color: var(--color-surface);
}

/* ─── HEADER ─── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg), transparent 8%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-divider);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.header--scrolled {
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: 3.75rem;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
  flex-shrink: 0;
}

.header__logo svg {
  width: 36px;
  height: 36px;
}

.header__logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  letter-spacing: -0.01em;
  display: none;
}

@media (min-width: 900px) {
  .header__logo-text { display: block; }
}

/* Desktop nav */
.header__nav {
  display: none;
  list-style: none;
  gap: var(--space-1);
}

@media (min-width: 900px) {
  .header__nav { display: flex; }
}

.header__nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.header__nav a:hover,
.header__nav a.active {
  color: var(--color-text);
  background: var(--color-surface-offset);
}

/* Header controls */
.header__controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.header__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.header__btn:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
}

.header__btn svg {
  width: 18px;
  height: 18px;
}

.lang-toggle {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  width: auto;
  padding: var(--space-1) var(--space-2);
}

/* Mobile menu button */
.header__menu-btn {
  display: flex;
}

@media (min-width: 900px) {
  .header__menu-btn { display: none; }
}

/* Mobile nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 3.75rem;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  z-index: 40;
  padding: var(--space-6) var(--space-4);
  overflow-y: auto;
}

.mobile-nav.open { display: block; }

.mobile-nav__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.mobile-nav__list a {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-md);
}

.mobile-nav__list a:hover {
  background: var(--color-surface-offset);
}

/* ─── HERO ─── */
.hero {
  padding-top: clamp(var(--space-16), 10vw, var(--space-32));
  padding-bottom: clamp(var(--space-12), 8vw, var(--space-24));
  overflow: clip;
}

.hero__content {
  max-width: 720px;
}

.hero__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.hero__name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: 1.1;
}

.hero__title {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  font-weight: 400;
  margin-bottom: var(--space-2);
}

.hero__affiliation {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.hero__bio {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
  margin-bottom: var(--space-8);
  line-height: 1.7;
}

/* Metrics */
.hero__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}

.metric {
  text-align: left;
}

.metric__value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  font-weight: 400;
  line-height: 1;
  margin-bottom: var(--space-1);
}

.metric__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Profile links */
.hero__links {
  display: flex;
  gap: var(--space-3);
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}

.profile-link:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-highlight);
}

.profile-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ─── SECTION HEADINGS ─── */
.section__header {
  margin-bottom: clamp(var(--space-6), 4vw, var(--space-12));
}

.section__label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.section__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-text);
}

/* ─── 3D CUBE CAROUSEL ─── */
.cube-carousel {
  max-width: 820px;
  margin-inline: auto;
}

.cube-viewport {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  perspective: 1200px;
  min-height: 360px;
}

.cube-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-origin: center center;
  will-change: transform, opacity;
}

/* Only the active face is shown; others are hidden */
.cube-face { display: none; }
.cube-face--active { display: block; }

/* Cube flip animation states */
.cube-face--exit-left {
  display: block;
  animation: cubeExitLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.cube-face--enter-right {
  display: block;
  animation: cubeEnterRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.cube-face--exit-right {
  display: block;
  animation: cubeExitRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.cube-face--enter-left {
  display: block;
  animation: cubeEnterLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cubeExitLeft {
  0%   { transform: rotateY(0deg); opacity: 1; }
  50%  { opacity: 0.6; }
  100% { transform: rotateY(-90deg); opacity: 0; }
}
@keyframes cubeEnterRight {
  0%   { transform: rotateY(90deg); opacity: 0; }
  50%  { opacity: 0.6; }
  100% { transform: rotateY(0deg); opacity: 1; }
}
@keyframes cubeExitRight {
  0%   { transform: rotateY(0deg); opacity: 1; }
  50%  { opacity: 0.6; }
  100% { transform: rotateY(90deg); opacity: 0; }
}
@keyframes cubeEnterLeft {
  0%   { transform: rotateY(-90deg); opacity: 0; }
  50%  { opacity: 0.6; }
  100% { transform: rotateY(0deg); opacity: 1; }
}

.cube-face__inner {
  padding: var(--space-8) var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  background: var(--color-surface-2);
  min-height: 340px;
}

.cube-face__label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.cube-face__number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-accent);
  line-height: 1;
}

.cube-face__tag {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  padding: 0.25em 0.75em;
  border-radius: var(--radius-full, 999px);
}

.cube-face__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}

.cube-face__desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 720px;
}

.cube-face__figure {
  margin-top: auto;
  padding-top: var(--space-4);
}

.cube-face__figure img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--color-divider);
  background: #fff;
  padding: var(--space-2);
}

/* Cube navigation */
.cube-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-4) 0 var(--space-2);
}

.cube-nav__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cube-nav__btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-highlight);
}

.cube-dots {
  display: flex;
  gap: var(--space-2);
}

.cube-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-divider);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.cube-dot--active {
  background: var(--color-accent);
  width: 28px;
  border-radius: 5px;
}

/* Progress bar for auto-advance */
.cube-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--color-accent);
  border-radius: 0 0 0 var(--radius-lg);
  width: 0;
  opacity: 0.5;
  transition: width linear;
}

.cube-progress--running {
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .cube-face--exit-left,
  .cube-face--enter-right,
  .cube-face--exit-right,
  .cube-face--enter-left {
    animation: none;
  }
}

/* ─── PUBLICATIONS ─── */
.pub-tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: var(--space-6);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pub-tab {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--transition-interactive),
              border-color var(--transition-interactive);
}

.pub-tab:hover {
  color: var(--color-text);
}

.pub-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.pub-panel {
  display: none;
}

.pub-panel.active {
  display: block;
}

.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.pub-item {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}

.pub-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pub-item__title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
  line-height: 1.4;
}

.pub-item__authors {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.pub-item__meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.pub-item__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.125rem var(--space-2);
  border-radius: var(--radius-full);
  background: var(--color-accent-highlight);
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: 600;
}

.pub-item__links {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
}

.pub-item__links a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.pub-item__links a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

.pub-hal-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-accent);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
}

.pub-hal-link:hover {
  background: var(--color-accent-highlight);
  border-color: var(--color-accent);
}

/* ─── PROJECTS ─── */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.project-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
  position: relative;
}

@media (min-width: 768px) {
  .project-card {
    grid-template-columns: 140px 1fr;
    gap: var(--space-6);
  }
}

.project-card--active {
  background: color-mix(in srgb, var(--color-accent-highlight), var(--color-surface-2) 50%);
}

.project-card--active .project-card__name::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  flex-shrink: 0;
}

.project-card__period {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.project-card__name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.project-card__type {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-highlight);
  padding: 0.1rem var(--space-2);
  border-radius: var(--radius-full);
}

.project-card__role {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

.project-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.project-card__partners {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.project-status-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
  margin-top: var(--space-6);
}

.project-status-label:first-child {
  margin-top: 0;
}

/* ─── CV / PARCOURS ─── */
.cv-section {
  margin-bottom: clamp(var(--space-8), 4vw, var(--space-16));
}

.cv-section:last-child {
  margin-bottom: 0;
}

.cv-section__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}

.cv-subsection {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  margin-top: var(--space-6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cv-subsection:first-of-type {
  margin-top: 0;
}

/* CV grid layout */
.cv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(var(--space-6), 4vw, var(--space-12));
}

@media (min-width: 768px) {
  .cv-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.cv-timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  padding-left: var(--space-5);
}

.cv-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--space-2);
  bottom: var(--space-2);
  width: 2px;
  background: var(--color-divider);
}

.cv-timeline__item {
  position: relative;
}

.cv-timeline__item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-5));
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  border: 2px solid var(--color-bg);
  transform: translateX(-3px);
}

.cv-timeline__year {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-faint);
  letter-spacing: 0.04em;
}

.cv-timeline__text {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.5;
}

.cv-timeline__detail {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* Simple list for responsibilities */
.cv-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cv-list li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-left: var(--space-4);
  position: relative;
  line-height: 1.5;
}

.cv-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 1px;
  background: var(--color-text-faint);
}

/* ─── TEACHING ─── */
.teaching-content {
  max-width: 65ch;
}

.teaching-content p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.teaching-topics {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.teaching-topics li {
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ─── CONTACT ─── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.contact-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.contact-item__icon {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-item__label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
}

.contact-item__value {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.5;
}

.contact-item__value a {
  color: var(--color-accent);
  text-decoration: none;
}

.contact-item__value a:hover {
  text-decoration: underline;
}

/* Contact profile links */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.contact-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
}

.contact-link:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-highlight);
  color: var(--color-accent);
}

.contact-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-accent);
}

/* ─── FOOTER ─── */
.footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-8);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer__text {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer__text a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

.footer__links {
  display: flex;
  gap: var(--space-4);
  list-style: none;
}

.footer__links a {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
}

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

/* ─── HERO LAYOUT (two-column with photo) ─── */
.hero__layout {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .hero__layout {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-12);
  }
  .hero__content {
    flex: 1;
    max-width: 720px;
  }
  .hero__photo-area {
    flex-shrink: 0;
  }
}

/* ─── ORBIT KEYWORD SYSTEM ─── */
.hero__photo-area {
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-container {
  position: relative;
  width: 380px;
  height: 380px;
  flex-shrink: 0;
}

.hero__photo {
  width: 148px;
  height: 148px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--color-divider);
  box-shadow: var(--shadow-md);
  position: absolute;
  top: 50%;
  left: 45%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* Faint orbit tracks */
.orbit-ring {
  position: absolute;
  top: 50%;
  left: 45%;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--color-primary) 7%, transparent);
  pointer-events: none;
}
.orbit-ring--1 {
  width: 230px; height: 230px;
  transform: translate(-50%, -50%);
}
.orbit-ring--2 {
  width: 300px; height: 300px;
  transform: translate(-50%, -50%);
}
.orbit-ring--3 {
  width: 365px; height: 365px;
  transform: translate(-50%, -50%);
}

/* Keywords positioned by JS */
.orb-kw {
  position: absolute;
  white-space: nowrap;
  font-family: var(--font-body);
  color: var(--color-primary);
  letter-spacing: 0.01em;
  line-height: 1;
  pointer-events: auto;
  cursor: default;
  will-change: transform;
  transition: opacity 0.3s ease;
}

/* Pause on hover */
.orbit-container.paused .orb-kw {
  opacity: 0.7 !important;
}

/* Size tiers */
.orb-kw--6 { font-size: 1.05rem; font-weight: 700; color: var(--color-accent); opacity: 0.88; }
.orb-kw--5 { font-size: 0.88rem; font-weight: 600; color: var(--color-accent); opacity: 0.72; }
.orb-kw--4 { font-size: 0.78rem; font-weight: 600; opacity: 0.55; }
.orb-kw--3 { font-size: 0.7rem; font-weight: 500; opacity: 0.42; }
.orb-kw--2 { font-size: 0.62rem; font-weight: 500; opacity: 0.33; }
.orb-kw--1 { font-size: 0.56rem; font-weight: 400; opacity: 0.25; }

/* Hovered keyword glows */
.orb-kw:hover {
  opacity: 1 !important;
  color: var(--color-accent);
  text-shadow: 0 0 8px color-mix(in srgb, var(--color-accent) 30%, transparent);
}

/* Responsive: smaller orbits on mobile */
@media (max-width: 767px) {
  .orbit-container {
    width: 300px;
    height: 300px;
  }
  .hero__photo {
    width: 110px;
    height: 110px;
  }
  .orbit-ring--1 {
    width: 185px; height: 185px;
  }
  .orbit-ring--2 {
    width: 240px; height: 240px;
  }
  .orbit-ring--3 {
    width: 290px; height: 290px;
  }
  .hero__photo {
    left: 50%;
  }
  .orbit-ring {
    left: 50%;
  }
  .orb-kw--6 { font-size: 0.82rem; }
  .orb-kw--5 { font-size: 0.72rem; }
  .orb-kw--4 { font-size: 0.66rem; }
  .orb-kw--3 { font-size: 0.58rem; }
  .orb-kw--2 { font-size: 0.52rem; }
  .orb-kw--1 { font-size: 0.48rem; }
}

/* ─── PUBLICATION INTRO ─── */
.pub-intro {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

.pub-intro a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.pub-intro a:hover {
  text-decoration: underline;
}

/* ─── PUBLICATION CITATION ─── */
.pub-item__citation-toggle {
  margin-top: var(--space-2);
}

.pub-item__citation-toggle summary {
  font-size: var(--text-xs);
  color: var(--color-accent);
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.pub-item__citation-toggle summary::-webkit-details-marker {
  display: none;
}

.pub-item__citation-toggle summary::before {
  content: '\25B6';
  font-size: 0.6em;
  transition: transform var(--transition-interactive);
}

.pub-item__citation-toggle[open] summary::before {
  transform: rotate(90deg);
}

.pub-item__citation {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-top: var(--space-2);
  padding-left: var(--space-3);
  border-left: 2px solid var(--color-accent);
  font-style: normal;
}

.pub-item__citation em {
  font-style: italic;
}

/* ─── CV NESTED LIST ─── */
.cv-nested-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cv-nested-list > li > strong {
  font-size: var(--text-sm);
  color: var(--color-text);
  display: block;
  margin-bottom: var(--space-2);
}

.cv-nested-list > li > ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-left: var(--space-4);
}

.cv-nested-list > li > ul > li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  position: relative;
  padding-left: var(--space-3);
  line-height: 1.5;
}

.cv-nested-list > li > ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 1px;
  background: var(--color-text-faint);
}

/* ─── TEACHING GRID / CARDS ─── */
.teaching-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

@media (min-width: 768px) {
  .teaching-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.teaching-card {
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.teaching-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.teaching-card__title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.teaching-card__badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-highlight);
  padding: 0.1rem var(--space-2);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.teaching-card__dept {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.teaching-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ─── SCROLL REVEAL ─── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}
