/* ---------------------------------------------------
   Francis Onah - portfolio
   No build step. Plain CSS, custom properties, no framework.
--------------------------------------------------- */

:root {
  --bg: #090d12;
  --bg-elev: #0f151d;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8eef3;
  --text-dim: #93a4b5;
  --text-faint: #5b6b7c;
  --accent: #5eead4;
  --accent-dim: rgba(94, 234, 212, 0.14);
  --accent-2: #fbbf24;
  --radius: 14px;
  --radius-sm: 9px;
  --max: 1120px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- cursor spotlight ---------- */
#spotlight {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(560px circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(94, 234, 212, 0.07), transparent 70%);
}

@media (hover: none) {
  #spotlight {
    display: none;
  }
}

h1, h2, h3 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
  color: var(--text-dim);
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

::selection {
  background: var(--accent);
  color: #06231d;
}

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

/* ---------- 3D scene canvas ---------- */
#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
}

/* ---------- layout helpers ---------- */
.section {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 120px 24px;
}

.section-tight {
  padding-top: 40px;
  padding-bottom: 40px;
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-top: 10px;
}

.section-sub {
  margin-top: 14px;
}

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

/* ---------- reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
  text-decoration: none !important;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #06231d;
}

.btn-primary:hover {
  background: #7ff4de;
}

.btn-outline {
  border-color: var(--border-strong);
  color: var(--text);
}

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

.btn-ghost {
  border-color: var(--border);
  color: var(--text-dim);
  padding: 9px 18px;
  font-size: 0.85rem;
}

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

.btn-text {
  color: var(--text-dim);
  padding: 12px 4px;
}

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

/* ---------- header / nav ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(9, 13, 18, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.logo {
  text-decoration: none !important;
}

.logo-mark {
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 10px;
}

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

.primary-nav {
  display: flex;
  gap: 28px;
}

.primary-nav .nav-link {
  color: var(--text-dim);
  font-size: 0.92rem;
  text-decoration: none !important;
  transition: color 0.2s var(--ease);
}

.primary-nav .nav-link:hover,
.primary-nav .nav-link.active {
  color: var(--text);
}

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

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-btn span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 8px 24px 20px;
  gap: 4px;
}

.mobile-nav .nav-link {
  color: var(--text-dim);
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none !important;
}

.nav-link-accent {
  color: var(--accent) !important;
}

@media (max-width: 860px) {
  .primary-nav {
    display: none;
  }
  .nav-actions .btn-ghost {
    display: none;
  }
  .menu-btn {
    display: flex;
  }
  .mobile-nav.show {
    display: flex;
  }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 140px 24px 80px;
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.6);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(94, 234, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0); }
}

.hero-title {
  font-size: clamp(3rem, 9vw, 6rem);
  margin-top: 18px;
  background: linear-gradient(90deg, var(--text) 0%, var(--accent) 22%, var(--accent-2) 48%, var(--accent) 74%, var(--text) 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: text-shine 7s linear infinite;
}

.hero-title .accent {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  text-shadow: 0 0 24px rgba(94, 234, 212, 0.55);
}

@keyframes text-shine {
  to {
    background-position: -250% center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title {
    animation: none;
  }
}

.hero-subtitle {
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 6px;
}

.hero-lede {
  max-width: 640px;
  font-size: 1.08rem;
  margin-top: 26px;
}

.hero-lede .mono {
  color: var(--text);
}

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

.hero-stats {
  display: flex;
  gap: 48px;
  margin: 72px 0 0;
  flex-wrap: wrap;
}

.hero-stats dt {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  color: var(--accent);
  text-shadow: 0 0 28px rgba(94, 234, 212, 0.35);
}

.hero-stats dd {
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: 0.85rem;
  max-width: 14ch;
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
}

.scroll-cue span {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 7px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scroll-cue 1.8s infinite;
}

@keyframes scroll-cue {
  0% { opacity: 1; top: 7px; }
  70% { opacity: 0; top: 18px; }
  100% { opacity: 0; top: 18px; }
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: start;
}

.about-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: float-idle 6s ease-in-out infinite;
}

.photo-frame {
  position: relative;
  width: min(300px, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  isolation: isolate;
  transform-style: preserve-3d;
}

.photo-frame::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 26px;
  background: conic-gradient(
    from 0deg,
    var(--accent),
    transparent 28%,
    var(--accent-2),
    transparent 72%,
    var(--accent)
  );
  animation: spin-ring 6s linear infinite;
  z-index: -1;
  filter: blur(0.5px);
}

.photo-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 14%;
  border-radius: 22px;
  border: 1px solid var(--border);
  display: block;
}

.photo-frame .corner {
  position: absolute;
  width: 20px;
  height: 20px;
  z-index: 2;
  opacity: 0.85;
  pointer-events: none;
  animation: corner-pulse 3.5s ease-in-out infinite;
}

.corner.tl { top: 9px; left: 9px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); border-radius: 4px 0 0 0; }
.corner.tr { top: 9px; right: 9px; border-top: 2px solid var(--accent-2); border-right: 2px solid var(--accent-2); border-radius: 0 4px 0 0; animation-delay: 0.6s; }
.corner.bl { bottom: 9px; left: 9px; border-bottom: 2px solid var(--accent-2); border-left: 2px solid var(--accent-2); border-radius: 0 0 0 4px; animation-delay: 1.2s; }
.corner.br { bottom: 9px; right: 9px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); border-radius: 0 0 4px 0; animation-delay: 1.8s; }

.photo-tag {
  margin-top: -20px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(9, 13, 18, 0.85);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

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

@keyframes corner-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes float-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
  .about-photo,
  .photo-frame::before,
  .corner {
    animation: none;
  }
}

.about-copy p {
  font-size: 1.02rem;
}

.about-facts {
  margin-top: 28px;
  display: grid;
  gap: 10px;
  font-size: 0.86rem;
}

.about-facts li {
  display: flex;
  gap: 10px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.about-facts li:first-child {
  border-top: none;
  padding-top: 0;
}

.about-facts span {
  color: var(--text-faint);
  min-width: 150px;
}

@media (max-width: 760px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-photo {
    margin: 0 auto 8px;
  }
}

/* ---------- ambient section blobs ---------- */
#skills,
#experience,
#projects {
  overflow: hidden;
}

#skills::before,
#experience::before,
#projects::before {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
}

#skills::before {
  top: -8%;
  right: -8%;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.14), transparent 70%);
  animation: blob-drift 16s ease-in-out infinite;
}

#experience::before {
  top: 30%;
  left: -14%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.1), transparent 70%);
  animation: blob-drift 20s ease-in-out infinite reverse;
}

#projects::before {
  bottom: -10%;
  left: -8%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.12), transparent 70%);
  animation: blob-drift 18s ease-in-out infinite;
}

@keyframes blob-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.18); }
}

@media (prefers-reduced-motion: reduce) {
  #skills::before,
  #experience::before,
  #projects::before {
    animation: none;
  }
}

/* ---------- skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.skill-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px 24px;
  transform-style: preserve-3d;
  will-change: transform;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.12s linear, box-shadow 0.3s var(--ease), opacity 0.3s var(--ease), filter 0.3s var(--ease);
}

.skill-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(94, 234, 212, 0.14), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.skill-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  pointer-events: none;
}

.skill-card:hover::before {
  opacity: 0.85;
  animation: scan-sweep 1.3s ease-in-out;
}

.skill-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 16px 40px -22px rgba(94, 234, 212, 0.35);
}

.skill-card:hover::after {
  opacity: 1;
}

.skills-grid:has(.skill-card:hover) .skill-card:not(:hover) {
  opacity: 0.6;
  filter: saturate(0.7);
}

@keyframes scan-sweep {
  from { top: 0%; }
  to { top: 100%; }
}

.cube-wrap {
  display: inline-block;
  width: 14px;
  height: 14px;
  perspective: 60px;
  vertical-align: -2px;
  margin-right: 9px;
}

.cube-tilt {
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(-20deg);
}

.cube-spin {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: cube-spin 7s linear infinite;
}

.cube-spin i {
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent);
  background: rgba(94, 234, 212, 0.05);
  opacity: 0.7;
}

.cube-spin i:nth-child(1) { transform: rotateY(0deg) translateZ(7px); }
.cube-spin i:nth-child(2) { transform: rotateY(90deg) translateZ(7px); }
.cube-spin i:nth-child(3) { transform: rotateY(180deg) translateZ(7px); }
.cube-spin i:nth-child(4) { transform: rotateY(270deg) translateZ(7px); }

@keyframes cube-spin {
  to { transform: rotateY(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .cube-spin {
    animation: none;
  }
  .skill-card:hover::before {
    animation: none;
    opacity: 0;
  }
}

.skill-card h3 {
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 14px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.76rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 9px;
  opacity: 0;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.tag:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
}

.skill-card.is-visible .tag {
  animation: tag-in 0.4s var(--ease) forwards;
}

.skill-card.is-visible .tag:nth-child(1) { animation-delay: 0.05s; }
.skill-card.is-visible .tag:nth-child(2) { animation-delay: 0.1s; }
.skill-card.is-visible .tag:nth-child(3) { animation-delay: 0.15s; }
.skill-card.is-visible .tag:nth-child(4) { animation-delay: 0.2s; }
.skill-card.is-visible .tag:nth-child(5) { animation-delay: 0.25s; }
.skill-card.is-visible .tag:nth-child(6) { animation-delay: 0.3s; }
.skill-card.is-visible .tag:nth-child(7) { animation-delay: 0.35s; }
.skill-card.is-visible .tag:nth-child(8) { animation-delay: 0.4s; }
.skill-card.is-visible .tag:nth-child(9) { animation-delay: 0.45s; }
.skill-card.is-visible .tag:nth-child(10) { animation-delay: 0.5s; }

@keyframes tag-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .tag {
    opacity: 1;
  }
  .skill-card.is-visible .tag {
    animation: none;
  }
}

/* ---------- timeline ---------- */
.timeline {
  position: relative;
  padding-left: 28px;
  perspective: 1000px;
}

.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
}

.timeline::before {
  bottom: 0;
  background: var(--border);
}

.timeline::after {
  height: calc(var(--timeline-progress, 0) * 100%);
  background: linear-gradient(var(--accent), var(--accent-2));
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .timeline::after {
    height: 100%;
    box-shadow: none;
  }
}

.timeline-item {
  position: relative;
  padding-bottom: 52px;
  border-radius: 10px;
  transition: opacity 0.3s var(--ease), filter 0.3s var(--ease);
}

.timeline-item::after {
  content: "";
  position: absolute;
  inset: -10px -16px;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(94, 234, 212, 0.08), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: 10px;
  z-index: -1;
}

.timeline-item:hover::after {
  opacity: 1;
}

.timeline:has(.timeline-item:hover) .timeline-item:not(:hover) {
  opacity: 0.65;
  filter: saturate(0.75);
}

.timeline-item.reveal {
  transform: translateY(24px) rotateX(12deg);
  transform-origin: left center;
}

.timeline-item.reveal.is-visible {
  transform: translateY(0) rotateX(0deg);
}

@media (prefers-reduced-motion: reduce) {
  .timeline-item.reveal,
  .timeline-item.reveal.is-visible {
    transform: none;
  }
}

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

.timeline-marker {
  position: absolute;
  left: -33px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transition: box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}

.timeline-item.is-visible .timeline-marker,
.timeline-item:hover .timeline-marker {
  background: var(--accent);
  box-shadow: 0 0 12px 2px rgba(94, 234, 212, 0.6);
}

.timeline-marker::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
}

.timeline-item.is-visible .timeline-marker::after {
  animation: marker-ping 1s ease-out forwards;
}

@keyframes marker-ping {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-item.is-visible .timeline-marker::after {
    animation: none;
  }
}

.timeline-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
}

.timeline-top h3 {
  font-size: 1.15rem;
  color: var(--text);
}

.loc {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.dates {
  font-size: 0.78rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.role {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  margin: 6px 0 2px;
}

.role-sub {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 0.8rem;
  margin-bottom: 14px;
}

.timeline-content ul {
  margin-top: 14px;
  display: grid;
  gap: 9px;
}

.timeline-content li {
  position: relative;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 0.94rem;
}

.timeline-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 1px;
  background: var(--text-faint);
}

.timeline-content .tag-row {
  margin-top: 14px;
}

.timeline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 4px 0;
}

.timeline-toggle:hover {
  color: var(--accent-2);
}

.timeline-toggle .chevron {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

.timeline-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.timeline-details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease);
}

.timeline-details.expanded {
  grid-template-rows: 1fr;
}

.timeline-details-inner {
  overflow: hidden;
  min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
  .timeline-details {
    transition: none;
  }
}

/* ---------- projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transform-style: preserve-3d;
  will-change: transform;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.12s linear, box-shadow 0.3s var(--ease), opacity 0.3s var(--ease), filter 0.3s var(--ease);
}

.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(94, 234, 212, 0.16), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.project-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  pointer-events: none;
}

.project-card:hover::before {
  opacity: 0.85;
  animation: scan-sweep 1.3s ease-in-out;
}

.project-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 24px 60px -24px rgba(94, 234, 212, 0.3);
}

.project-card:hover::after {
  opacity: 1;
}

.project-grid:has(.project-card:hover) .project-card:not(:hover) {
  opacity: 0.6;
  filter: saturate(0.7);
}

@media (prefers-reduced-motion: reduce) {
  .project-card:hover::before {
    animation: none;
    opacity: 0;
  }
}

.card-chrome {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.card-chrome span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  animation: chrome-pulse 2.6s ease-in-out infinite;
}

.card-chrome span:nth-child(1) { background: #ef6b6b; animation-delay: 0s; }
.card-chrome span:nth-child(2) { background: var(--accent-2); animation-delay: 0.3s; }
.card-chrome span:nth-child(3) { background: var(--accent); animation-delay: 0.6s; }

@keyframes chrome-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .card-chrome span {
    animation: none;
    opacity: 1;
  }
}

.project-card h3 {
  font-size: 1.08rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.badge-latest {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #06231d;
  background: var(--accent);
  border-radius: 999px;
  padding: 3px 8px;
  box-shadow: 0 0 14px rgba(94, 234, 212, 0.5);
}

.project-card p {
  font-size: 0.9rem;
  min-height: 72px;
}

.project-card .tag-row {
  margin-bottom: 18px;
}

.project-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-faint);
  margin-bottom: 14px;
  min-height: 1em;
}

.stat-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.stat-sep {
  opacity: 0.5;
}

.card-link {
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none !important;
}

.projects-more {
  margin-top: 32px;
}

/* ---------- live activity ---------- */
.activity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px 8px;
}

.activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.activity-head .dot-live {
  margin-right: 8px;
}

.activity-status {
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
}

.activity-feed {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: baseline;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.activity-item:first-child {
  border-top: none;
}

.activity-tag {
  color: var(--accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.activity-text {
  color: var(--text-dim);
}

.activity-text a {
  color: var(--text);
  font-weight: 500;
}

.activity-time {
  color: var(--text-faint);
  font-size: 0.76rem;
  white-space: nowrap;
}

.activity-placeholder {
  padding: 18px 0;
  color: var(--text-faint);
  font-size: 0.86rem;
}

@media (max-width: 600px) {
  .activity-item {
    grid-template-columns: 1fr auto;
  }
  .activity-tag {
    grid-column: 1 / -1;
  }
}

/* ---------- writing ---------- */
.writing-list {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.writing-item {
  position: relative;
  overflow: hidden;
  background: var(--bg-elev);
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 20px 22px;
  text-decoration: none !important;
  transition: background 0.2s var(--ease);
}

.writing-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(var(--accent), var(--accent-2));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s var(--ease);
}

.writing-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  pointer-events: none;
}

.writing-item:hover {
  background: var(--surface-hover);
}

.writing-item:hover::before {
  transform: scaleY(1);
}

.writing-item:hover::after {
  opacity: 0.8;
  animation: scan-sweep 1.1s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .writing-item:hover::after {
    animation: none;
    opacity: 0;
  }
}

.writing-date {
  color: var(--text-faint);
  font-size: 0.78rem;
}

.writing-title {
  color: var(--text);
  font-size: 0.98rem;
}

.writing-arrow {
  color: var(--accent);
  transition: transform 0.2s var(--ease);
}

.writing-item:hover .writing-arrow {
  transform: translateX(4px);
}

@media (max-width: 600px) {
  .writing-item {
    grid-template-columns: 1fr auto;
  }
  .writing-date {
    grid-column: 1 / -1;
  }
}

/* ---------- certifications ---------- */
.cert-list {
  display: grid;
  gap: 14px;
}

.cert-list li {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 20px;
  padding: 16px 18px;
  margin: 0 -18px;
  border-top: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.25s var(--ease), padding-left 0.25s var(--ease);
}

.cert-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(var(--accent), var(--accent-2));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s var(--ease);
}

.cert-list li:first-child {
  border-top: none;
}

.cert-list li:hover {
  background: var(--surface-hover);
  padding-left: 26px;
}

.cert-list li:hover::before {
  transform: scaleY(1);
}

.cert-list strong {
  color: var(--text);
  font-weight: 500;
  transition: color 0.25s var(--ease);
}

.cert-list li:hover strong {
  color: var(--accent);
}

.cert-list span {
  color: var(--text-faint);
  font-size: 0.84rem;
}

/* ---------- contact ---------- */
.contact-section {
  padding-top: 60px;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(32px, 6vw, 72px);
  text-align: center;
}

.contact-card h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  max-width: 20ch;
  margin: 12px auto 0;
}

.contact-card .section-sub {
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}

.contact-card .hero-actions {
  justify-content: center;
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.social-row a {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-decoration: none !important;
}

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

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 24px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.back-to-top {
  color: var(--text-faint);
  text-decoration: none !important;
}

.back-to-top:hover {
  color: var(--accent);
}
