.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

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

.theme-toggle {
  padding: 0.4rem;
}

.theme-icon {
  width: 1rem;
  height: 1rem;
}

[data-theme='light'] .theme-icon--sun {
  display: none;
}

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

.nav-mobile-toggle {
  position: relative;
}

.nav-mobile-icon {
  position: relative;
  display: block;
  width: 1rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: background var(--transition);
}

.nav-mobile-icon::before,
.nav-mobile-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--transition), top var(--transition);
}

.nav-mobile-icon::before {
  top: -5px;
}

.nav-mobile-icon::after {
  top: 5px;
}

.nav-mobile-toggle[aria-expanded='true'] .nav-mobile-icon {
  background: transparent;
}

.nav-mobile-toggle[aria-expanded='true'] .nav-mobile-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-mobile-toggle[aria-expanded='true'] .nav-mobile-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (min-width: 769px) {
  .nav-mobile-toggle {
    display: none;
  }
}

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

[data-theme='dark'] .btn.is-active {
  color: #0f0f0f;
}

.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
  transform-origin: top;
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 0.45rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg);
  transition: background var(--transition), transform var(--transition);
}

.timeline-item.is-current .timeline-dot {
  background: var(--accent);
  transform: scale(1.2);
}

.timeline-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.timeline-role {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}

.timeline-org {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-item {
  display: flex;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition),
    transform var(--transition);
}

.news-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.news-date {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  min-width: 5.5rem;
}

.news-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.project {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.project--reverse {
  flex-direction: row-reverse;
}

.project-content {
  flex: 1;
  min-width: 0;
}

.project-video-wrap {
  flex: 1;
  min-width: 0;
}

.project-title {
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 700;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.project-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.project-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.project-about {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all var(--transition);
}

.project-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.video-card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  aspect-ratio: 16 / 9;
}

.video-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: rgba(13, 148, 136, 0.3);
}

.video-card video,
.video-card iframe {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.youtube-placeholder,
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--bg-elevated);
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: inherit;
  color: var(--text);
  z-index: 1;
}

.youtube-placeholder img,
.video-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: 0.85;
}

.youtube-play,
.video-play {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}

.youtube-placeholder:hover .youtube-play,
.video-placeholder:hover .video-play {
  transform: scale(1.1);
}

.youtube-play svg,
.video-play svg {
  width: 24px;
  height: 24px;
  fill: #fff;
  margin-left: 4px;
}

.youtube-label,
.video-label {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
}

.video-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.55);
}

.video-loading[hidden] {
  display: none;
}

.video-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: video-spin 0.8s linear infinite;
}

.video-loading-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

@keyframes video-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .project,
  .project--reverse {
    flex-direction: column;
  }

  .project-video-wrap {
    order: -1;
    width: 100%;
  }

  .project-list {
    gap: 3.5rem;
  }

  .news-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .news-date {
    min-width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-link:hover,
  .footer-link:hover,
  .video-card:hover,
  .news-item:hover,
  .hero-portrait img:hover {
    transform: none;
  }

  .video-loading-spinner {
    animation: none;
    border-top-color: var(--accent);
  }
}
