/* ============================================================================
   Swaccho Khan — page compositions
   Hero, focus, skills, the 3D book, timeline, repositories, hobbies, contact.
   ========================================================================== */

/* ============================================================== HERO ===== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}

#hero-canvas,
#trail-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#trail-canvas {
  z-index: 1;
  mix-blend-mode: screen;
  pointer-events: none;
}

.hero__glow {
  position: absolute;
  z-index: 1;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(124, 92, 255, 0.24) 0%,
    rgba(34, 211, 238, 0.1) 38%,
    transparent 68%
  );
  transform: translate3d(-50%, -50%, 0);
  filter: blur(28px);
  opacity: 0;
  transition: opacity 620ms var(--ease-out);
  left: 0;
  top: 0;
  will-change: transform;
}

.hero__glow.is-active {
  opacity: 1;
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: var(--shell);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  padding-block: clamp(3rem, 8vh, 6rem);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.44rem 0.95rem 0.44rem 0.6rem;
  border-radius: 99px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.075em;
  color: var(--text-2);
  margin-bottom: 1.75rem;
}

.hero h1 {
  margin-bottom: 0.4rem;
  perspective: 800px;
}

.hero h1 .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.hero__role {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-height: 2.2em;
  font-size: clamp(1.05rem, 0.9rem + 0.75vw, 1.45rem);
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 1.6rem;
  letter-spacing: -0.02em;
}

.hero__role-prefix {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.8em;
  letter-spacing: 0.03em;
  flex: none;
}

.hero__role-word {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}

.hero__caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: var(--cyan);
  translate: 0 0.12em;
  animation: blink 1.05s steps(1) infinite;
  flex: none;
}

.hero__lede {
  max-width: 54ch;
  margin-bottom: 2.25rem;
  color: var(--text-2);
}

.hero__actions {
  margin-bottom: 2.5rem;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem 2.5rem;
  align-items: center;
  padding-top: 1.85rem;
  border-top: 1px solid var(--glass-border);
}

.hero__meta-item {
  display: grid;
  gap: 0.3rem;
}

.hero__meta-item dt {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--text-4);
}

.hero__meta-item dd {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-1);
  font-weight: 500;
}

/* Portrait / identity card */
.hero__aside {
  position: relative;
}

.hero__card {
  padding: 1.15rem;
  border-radius: var(--radius-xl);
  animation: float-y 7s var(--ease-in-out) infinite;
}

.hero__portrait {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: calc(var(--radius-xl) - 8px);
  overflow: hidden;
  background: linear-gradient(150deg, var(--ink-700), var(--ink-850));
}

.hero__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: saturate(1.02) contrast(1.04);
  transition: transform 900ms var(--ease-out), filter 620ms ease;
}

.hero__card:hover .hero__portrait img {
  transform: scale(1.045);
}

.hero__portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(6, 7, 14, 0.82) 100%);
  pointer-events: none;
}

/* Shown until a real photo decodes — and designed to stand on its own, so a
   missing /img/swaccho.jpg never looks like a broken image. */
.hero__portrait-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 620ms var(--ease-out);
  background:
    radial-gradient(70% 55% at 30% 25%, rgba(124, 92, 255, 0.32), transparent 70%),
    radial-gradient(60% 50% at 78% 80%, rgba(34, 211, 238, 0.22), transparent 70%),
    linear-gradient(160deg, var(--ink-700), var(--ink-950));
}

.hero__portrait-fallback::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(ellipse 75% 75% at 50% 45%, #000, transparent);
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 45%, #000, transparent);
}

.hero__portrait-fallback::after {
  content: attr(data-initials);
  position: relative;
  font-family: var(--font-sans);
  font-size: clamp(3.25rem, 9vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  color: transparent;
  background: var(--grad-text);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 9s linear infinite;
}

/* Scan line sweeping the portrait — reads as "being processed". */
.hero__scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 90px;
  z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.16), transparent);
  animation: scan-down 5.5s var(--ease-in-out) infinite;
  pointer-events: none;
}

.hero__card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 0.55rem 0.35rem;
}

.hero__card-name {
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.hero__card-name small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-top: 4px;
}

/* Orbiting satellite tags around the card */
.hero__orbit {
  position: absolute;
  z-index: 3;
  padding: 0.4rem 0.8rem;
  border-radius: 99px;
  background: rgba(9, 11, 20, 0.82);
  border: 1px solid var(--glass-border-lit);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--text-1);
  white-space: nowrap;
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.9);
}

/* Offsets stay inside the shell — .hero clips its overflow, so a chip that
   hangs too far past the column edge gets its tail cut off. */
.hero__orbit--1 {
  top: 8%;
  left: -13%;
  animation: float-y 5.5s var(--ease-in-out) infinite;
}

.hero__orbit--2 {
  top: 44%;
  right: -4%;
  animation: float-y 6.8s var(--ease-in-out) 0.6s infinite;
}

.hero__orbit--3 {
  bottom: 14%;
  left: -9%;
  animation: float-y 6.1s var(--ease-in-out) 1.1s infinite;
}

.hero__scroll {
  position: absolute;
  z-index: 2;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-4);
}

.hero__scroll-line {
  width: 1px;
  height: 42px;
  background: linear-gradient(180deg, var(--cyan), transparent);
  position: relative;
  overflow: hidden;
}

.hero__scroll-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cyan);
  animation: scan-down 2.1s var(--ease-in-out) infinite;
}

@media (max-width: 980px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero__aside {
    order: -1;
    max-width: 330px;
  }

  /* Once the hero stacks, the card is narrow enough that the floating tags
     would sit on top of it. They're decoration — drop them. */
  .hero__orbit {
    display: none;
  }
}

@media (max-width: 560px) {
  .hero__meta {
    gap: 1.2rem 1.75rem;
  }
}

/* ============================================================ NOW STRIP == */
.now-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--glass-border);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.now-strip__cell {
  padding: 1.65rem 1.5rem;
  background: rgba(9, 11, 20, 0.66);
  transition: background-color 420ms var(--ease-out);
}

.now-strip__cell:hover {
  background: rgba(20, 24, 40, 0.78);
}

.now-strip__cell dt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 0.75rem;
}

.now-strip__cell dd {
  margin: 0;
  color: var(--text-1);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.45;
}

.now-strip__cell dd span {
  display: block;
  font-size: 0.83rem;
  font-weight: 400;
  color: var(--text-3);
  margin-top: 0.4rem;
  letter-spacing: 0;
}

@media (max-width: 780px) {
  .now-strip {
    grid-template-columns: 1fr;
  }
}

/* =============================================================== FOCUS === */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.focus-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: clamp(1.75rem, 3vw, 2.6rem);
}

.focus-card--primary {
  grid-column: span 1;
  background: linear-gradient(155deg, rgba(124, 92, 255, 0.085), rgba(255, 255, 255, 0.03));
}

.focus-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--glass-border);
  color: var(--cyan);
  flex: none;
  transition: transform 520ms var(--ease-spring), color 380ms ease, border-color 380ms ease;
}

.focus-card:hover .focus-card__icon {
  transform: translateY(-3px) rotate(-6deg);
  color: var(--violet-soft);
  border-color: var(--glass-border-lit);
}

.focus-card__icon svg {
  width: 24px;
  height: 24px;
}

.focus-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.focus-card h3 {
  margin-top: 0.65rem;
}

.focus-card__state {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.7rem;
  border-radius: 99px;
  background: rgba(34, 211, 238, 0.09);
  border: 1px solid rgba(34, 211, 238, 0.22);
  white-space: nowrap;
}

.focus-card__points {
  display: grid;
  gap: 0.7rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.focus-card__points li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.885rem;
  line-height: 1.65;
  color: var(--text-2);
}

.focus-card__points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--grad-primary);
  transform: rotate(45deg);
}

.focus-card--minor {
  padding: 1.6rem;
}

.focus-card--minor h3 {
  font-size: 1.16rem;
}

.focus-card--minor .focus-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.focus-card--minor .focus-card__icon svg {
  width: 19px;
  height: 19px;
}

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

/* =============================================================== STATS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat {
  padding: 1.7rem 1.5rem;
  text-align: left;
}

.stat__value {
  display: block;
  font-size: clamp(1.85rem, 1.4rem + 1.6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  background: var(--grad-text);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.7rem;
  animation: shimmer 11s linear infinite;
}

.stat__label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-1);
  font-weight: 500;
  letter-spacing: -0.015em;
}

.stat__detail {
  display: block;
  font-size: 0.775rem;
  color: var(--text-4);
  margin-top: 0.4rem;
  line-height: 1.55;
}

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

.skill-group {
  padding: 1.75rem 1.6rem;
}

.skill-group__title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.025em;
}

.skill-group__note {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--text-4);
  margin: 0.45rem 0 1.35rem;
}

.skill-list {
  display: grid;
  gap: 0.55rem;
}

.skill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  font-size: 0.875rem;
  color: var(--text-2);
  transition: color 260ms ease, padding-left 320ms var(--ease-out);
}

.skill:last-child {
  border-bottom: none;
}

.skill:hover {
  color: var(--text-1);
  padding-left: 0.35rem;
}

.skill__level {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border-radius: 5px;
  flex: none;
  border: 1px solid transparent;
}

.skill__level[data-level='core'] {
  color: #7ff0c0;
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.24);
}

.skill__level[data-level='building'] {
  color: var(--cyan-soft);
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.26);
}

.skill__level[data-level='exploring'] {
  color: var(--amber);
  background: rgba(255, 181, 71, 0.09);
  border-color: rgba(255, 181, 71, 0.24);
}

.skill__level[data-level='past'] {
  color: var(--text-4);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.09);
}

/* =============================================================== BOOK ==== */
.book-section {
  position: relative;
}

.book-stage {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(124, 92, 255, 0.12), transparent 65%),
    rgba(255, 255, 255, 0.022);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
}

#book-canvas {
  display: block;
  width: 100%;
  height: clamp(430px, 62vh, 660px);
  touch-action: pan-y;
}

.book-stage__hint {
  position: absolute;
  top: 1.15rem;
  left: 1.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-4);
  pointer-events: none;
  transition: opacity 620ms ease;
}

.book-stage__hint.is-hidden {
  opacity: 0;
}

.book-stage__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 1rem;
  background: rgba(6, 7, 14, 0.7);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  transition: opacity 520ms ease, visibility 520ms;
}

.book-stage__loading.is-done {
  opacity: 0;
  visibility: hidden;
}

/* Controls */
.book-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.book-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.book-btn {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--text-2);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: color 260ms ease, transform 320ms var(--ease-spring), border-color 260ms ease,
    background-color 260ms ease, opacity 260ms ease;
}

.book-btn:hover:not(:disabled) {
  color: var(--text-1);
  border-color: var(--glass-border-lit);
  background: var(--glass-bg-strong);
  transform: translateY(-2px);
}

.book-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.book-btn svg {
  width: 18px;
  height: 18px;
}

.book-counter {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--text-3);
  min-width: 5.5ch;
  text-align: center;
}

.book-counter b {
  color: var(--text-1);
  font-weight: 500;
}

/* Chapter index dots */
.book-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.book-index__dot {
  position: relative;
  height: 26px;
  padding: 0 0.6rem;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--text-4);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: color 280ms ease, background-color 280ms ease, border-color 280ms ease,
    transform 320ms var(--ease-spring);
}

.book-index__dot:hover {
  color: var(--text-1);
  transform: translateY(-2px);
  border-color: var(--glass-border-lit);
}

.book-index__dot.is-current {
  color: #05060c;
  background: var(--grad-primary);
  border-color: transparent;
  font-weight: 600;
}

/* Accessible / no-WebGL chapter reader — also what search engines index. */
.book-fallback {
  display: grid;
  gap: 1rem;
}

.book-stage[data-webgl='on'] + .book-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* On a phone a two-page spread is far too small to read, so the book stays as
   the visual and the written chapters come back as the way you actually read
   them. Same content, sized for the screen it's on. */
@media (max-width: 720px) {
  .book-stage[data-webgl='on'] + .book-fallback {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  #book-canvas {
    height: clamp(320px, 46vh, 420px);
  }
}

.chapter-card {
  padding: clamp(1.5rem, 3vw, 2.25rem);
}

.chapter-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.9rem;
}

.chapter-card__numeral {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.chapter-card__era {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--text-4);
}

.chapter-card h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.15rem);
  letter-spacing: -0.02em;
  color: var(--text-1);
}

.chapter-card__sub {
  font-size: 0.85rem;
  color: var(--text-3);
  margin: 0.4rem 0 1.1rem;
}

.chapter-card p + p {
  margin-top: 0.9rem;
}

/* ── the connective tissue between chapters ──────────────────────────────── */
.chapter-bridge {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.35rem;
  padding-block: 0.35rem;
}

.chapter-bridge__line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 92, 255, 0.42));
}

.chapter-bridge__line:last-child {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.42), transparent);
}

.chapter-bridge__text {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 0.94rem + 0.4vw, 1.22rem);
  font-style: italic;
  letter-spacing: -0.012em;
  color: var(--text-3);
  text-align: center;
  max-width: 46ch;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .chapter-bridge {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    justify-items: center;
  }

  .chapter-bridge__line {
    width: 46px;
    background: linear-gradient(90deg, transparent, rgba(124, 92, 255, 0.45), transparent);
  }

  .chapter-bridge__line:last-child {
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.45), transparent);
  }
}

/* ============================================================ TIMELINE === */
.timeline {
  position: relative;
  display: grid;
  gap: 0.75rem;
  padding-left: clamp(1.5rem, 4vw, 2.75rem);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(124, 92, 255, 0.55) 8%,
    rgba(34, 211, 238, 0.4) 55%,
    transparent
  );
}

.tl-item {
  position: relative;
  padding: 1.4rem 1.5rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid transparent;
  transition: background-color 420ms var(--ease-out), border-color 420ms var(--ease-out),
    transform 420ms var(--ease-out);
}

.tl-item:hover {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  transform: translateX(5px);
}

.tl-item::before {
  content: '';
  position: absolute;
  left: calc(clamp(1.5rem, 4vw, 2.75rem) * -1 + 2px);
  top: 1.85rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-950);
  border: 2px solid var(--text-4);
  transition: border-color 380ms ease, box-shadow 380ms ease, transform 380ms var(--ease-spring);
}

.tl-item:hover::before {
  transform: scale(1.25);
}

.tl-item[data-kind='education']::before {
  border-color: var(--cyan);
}

.tl-item[data-kind='work']::before {
  border-color: var(--violet);
}

.tl-item[data-kind='volunteer']::before {
  border-color: var(--pink);
}

/* A turning point rather than a role — filled, not outlined, so it reads as a
   hinge in the story when you scan the rail. */
.tl-item[data-kind='milestone']::before {
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 181, 71, 0.14);
}

.tl-item[data-kind='milestone'] {
  background: rgba(255, 181, 71, 0.035);
  border-color: rgba(255, 181, 71, 0.14);
}

.tl-item[data-kind='milestone'] .tl-org {
  color: var(--amber);
}

.tl-item.is-current::before {
  border-color: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16);
}

.tl-item.is-quiet {
  opacity: 0.66;
}

.tl-item.is-quiet:hover {
  opacity: 1;
}

.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.25rem;
}

.tl-period {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-4);
  white-space: nowrap;
}

.tl-item h3 {
  font-size: 1.08rem;
  letter-spacing: -0.026em;
}

.tl-org {
  display: block;
  font-size: 0.85rem;
  color: var(--cyan-soft);
  margin-top: 0.28rem;
  font-weight: 500;
}

.tl-item[data-kind='work'] .tl-org {
  color: var(--violet-soft);
}

.tl-item[data-kind='volunteer'] .tl-org {
  color: #ff9ec7;
}

.tl-detail {
  font-size: 0.885rem;
  line-height: 1.7;
  color: var(--text-2);
  margin-top: 0.8rem;
  max-width: 74ch;
}

.tl-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.95rem;
}

.tl-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.75rem;
}

.filter-btn {
  padding: 0.45rem 0.95rem;
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--glass-border);
  transition: color 260ms ease, background-color 260ms ease, border-color 260ms ease,
    transform 300ms var(--ease-spring);
}

.filter-btn:hover {
  color: var(--text-1);
  transform: translateY(-2px);
  border-color: var(--glass-border-lit);
}

.filter-btn.is-active {
  color: #05060c;
  background: var(--grad-primary);
  border-color: transparent;
  font-weight: 600;
}

.filter-btn__count {
  opacity: 0.6;
  margin-left: 0.35rem;
}

/* ============================================================== REPOS ==== */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1rem;
}

.repo {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.5rem;
  min-height: 200px;
  transition: transform 420ms var(--ease-out), border-color 380ms ease, box-shadow 420ms var(--ease-out),
    opacity 320ms ease;
}

.repo.is-hidden {
  display: none;
}

.repo__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.repo__name {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-1);
  word-break: break-word;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.repo__name svg {
  width: 15px;
  height: 15px;
  color: var(--text-4);
  flex: none;
  transition: color 260ms ease, transform 320ms var(--ease-out);
}

.repo:hover .repo__name svg {
  color: var(--cyan);
  transform: translate(2px, -2px);
}

.repo__desc {
  font-size: 0.865rem;
  line-height: 1.65;
  color: var(--text-2);
  flex: 1;
}

.repo__desc.is-empty {
  color: var(--text-4);
  font-style: italic;
}

.repo__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 1.15rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-4);
  letter-spacing: 0.04em;
}

.repo__lang {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-3);
}

.repo__lang i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--lang, #8b95a5);
}

.repo__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.repo__stat svg {
  width: 12px;
  height: 12px;
}

.repo__badge {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.24rem 0.5rem;
  border-radius: 5px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.repo__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.repo__topic {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  padding: 0.18rem 0.5rem;
  border-radius: 5px;
  color: var(--text-3);
  background: rgba(124, 92, 255, 0.09);
  border: 1px solid rgba(124, 92, 255, 0.18);
}

.repo-empty {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-3);
}

/* GitHub profile summary card */
.gh-profile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  padding: clamp(1.5rem, 3vw, 2rem);
}

.gh-profile__avatar {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  flex: none;
  object-fit: cover;
  background: var(--ink-700);
}

.gh-profile__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-left: auto;
}

.gh-stat {
  display: grid;
  gap: 0.25rem;
}

.gh-stat b {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-1);
  line-height: 1;
}

.gh-stat span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-4);
}

/* ============================================================ FEATURED === */
.feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(1.85rem, 4vw, 3.25rem);
  background: linear-gradient(140deg, rgba(124, 92, 255, 0.1), rgba(34, 211, 238, 0.045));
}

.feature__visual {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(120% 100% at 20% 10%, var(--ink-700), var(--ink-950));
  border: 1px solid var(--glass-border);
  display: grid;
  place-items: center;
}

.feature__visual-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000, transparent);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000, transparent);
}

.feature__logo {
  position: relative;
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  background: var(--grad-text);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 8s linear infinite;
}

.feature__logo small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-4);
  -webkit-text-fill-color: var(--text-4);
  margin-top: 0.7rem;
  text-align: center;
}

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

  .feature__visual {
    order: -1;
  }
}

/* ============================================================= HOBBIES === */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1rem;
}

.hobby {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.6rem 1.5rem;
}

.hobby__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Things he used to do, held at arm's length rather than sold as current. */
.hobby--past {
  opacity: 0.72;
  transition: opacity 420ms var(--ease-out), transform 520ms var(--ease-out),
    border-color 420ms var(--ease-out), box-shadow 520ms var(--ease-out);
}

.hobby--past:hover {
  opacity: 1;
}

.hobby--past .hobby__icon {
  color: var(--text-3);
}

.hobby__tense {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 0.26rem 0.6rem;
  border-radius: 99px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  white-space: nowrap;
}

.hobby__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--violet-soft);
  transition: transform 480ms var(--ease-spring), color 320ms ease;
}

.hobby:hover .hobby__icon {
  transform: translateY(-3px) rotate(8deg);
  color: var(--cyan);
}

.hobby__icon svg {
  width: 19px;
  height: 19px;
}

.hobby h3 {
  font-size: 1.08rem;
}

.hobby p {
  font-size: 0.865rem;
  line-height: 1.68;
  color: var(--text-2);
  flex: 1;
}

.hobby__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.35rem;
}

/* ============================================================= CONTACT === */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(1.5rem, 3.5vw, 2.5rem);
  align-items: start;
}

.contact-form {
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
}

.contact-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
}

.contact-form__grid .field + .field {
  margin-top: 0;
}

.contact-form__grid--full {
  grid-template-columns: 1fr;
  margin-top: 1.15rem;
}

.contact-aside {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}

.contact-card {
  padding: 1.6rem 1.5rem;
}

.contact-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.contact-mail {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-1);
  word-break: break-all;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.032);
  border: 1px solid var(--glass-border);
  transition: border-color 280ms ease, background-color 280ms ease;
  width: 100%;
}

.contact-mail:hover {
  border-color: var(--glass-border-lit);
  background: var(--glass-bg-strong);
}

.contact-mail svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--cyan);
}

.copy-btn {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
  border: 1px solid var(--glass-border);
  transition: color 240ms ease, border-color 240ms ease;
  flex: none;
}

.copy-btn:hover {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.4);
}

.security-note {
  display: flex;
  gap: 0.8rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius);
  background: rgba(52, 211, 153, 0.045);
  border: 1px solid rgba(52, 211, 153, 0.16);
  font-size: 0.795rem;
  line-height: 1.65;
  color: var(--text-3);
}

.security-note svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: #34d399;
  margin-top: 2px;
}

@media (max-width: 900px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-aside {
    position: static;
  }
}

@media (max-width: 560px) {
  .contact-form__grid {
    grid-template-columns: 1fr;
  }

  .contact-form__grid .field + .field {
    margin-top: 1.15rem;
  }
}

/* ================================================================ CTA ==== */
.cta {
  position: relative;
  text-align: center;
  padding: clamp(2.75rem, 6vw, 4.75rem) clamp(1.5rem, 4vw, 3rem);
  background: linear-gradient(150deg, rgba(124, 92, 255, 0.12), rgba(34, 211, 238, 0.06));
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  inset: -60% 20%;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(124, 92, 255, 0.14) 25%,
    transparent 50%,
    rgba(34, 211, 238, 0.12) 75%,
    transparent 100%
  );
  animation: spin-slow 22s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.cta > * {
  position: relative;
  z-index: 1;
}

.cta h2 {
  max-width: 20ch;
  margin-inline: auto;
}

.cta .lede {
  margin: 1.25rem auto 2rem;
  text-align: center;
}

.cta .btn-row {
  justify-content: center;
}

/* ============================================================== ERROR ==== */
.error-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--nav-h) 1.5rem 3rem;
}

.error-code {
  font-size: clamp(5rem, 18vw, 12rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.85;
  background: var(--grad-text);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 9s linear infinite;
}
