/* Base */
:root {
  --bg: #0f1221;
  --bg-soft: #151938;
  --card: #171c3b;
  --text: #e8ebff;
  --muted: #a9b0d3;
  --brand: #7aa2ff;
  --accent: #42d392;
  --border: #252a51;
  --shadow: rgba(0, 0, 0, 0.35);
  --header-h: 96px;
  --desc-color: #cfd6ff;
  --bullets-color: #d7dcff;
  --badge-bg: #121632;
  --badge-color: #e8ebff;
}

.theme-light {
  --bg: #f7f8ff;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --text: #111225;
  --muted: #5a617b;
  --brand: #3a63ff;
  --accent: #1fa471;
  --border: #e5e8ff;
  --shadow: rgba(0, 0, 0, 0.08);
  --desc-color: #3b4364;
  --bullets-color: #3b4364;
  --badge-bg: rgba(58, 99, 255, 0.12);
  --badge-color: #2a3370;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, Segoe UI, Roboto, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.hero,
.section,
.tabs-section,
.contact-bar {
  scroll-margin-top: calc(var(--header-h) + 0px);
}

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: linear-gradient(180deg, rgba(15, 18, 33, 0.85), rgba(15, 18, 33, 0.6));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  isolation: isolate;
}

.site-header.is-shrunk .nav-wrap {
  padding: 12px 0;
}

.theme-light .site-header {
  background: linear-gradient(180deg, rgba(247, 248, 255, 0.85), rgba(247, 248, 255, 0.6));
}

.nav-wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
}

.nav-wrap > * {
  min-width: 0;
}

.legacy-nav .primary-nav {
  justify-self: flex-start;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-self: flex-end;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.legacy-brand {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  min-width: 170px;
  padding: 0px 18px;
}

.legacy-brand .brand-img,
.legacy-brand .brand-txt {
  position: absolute;
  left: 50%;
  top: 50%;
}

.legacy-brand .brand-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.5s ease;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.theme-light .legacy-brand .brand-img {
  border-color: rgba(16, 20, 43, 0.2);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.legacy-brand .brand-txt {
  width: 100%;
  max-width: 240px;
  text-align: center;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0;
  transform: translate(-50%, -50%) translateY(12px);
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1) 0.1s, 
              transform 0.45s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.legacy-brand .brand-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

.legacy-brand .brand-subtitle {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.78;
}

.site-header.is-shrunk .legacy-brand {
  padding-block: 18px;
}

.site-header.is-shrunk .legacy-brand .brand-img {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(-12px) scale(0.9);
  visibility: hidden;
}

.site-header.is-shrunk .legacy-brand .brand-txt {
  opacity: 1;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

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

.primary-nav a {
  color: var(--muted);
  text-decoration: none;
  position: relative;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding-bottom: 4px;
  transition: color 0.2s ease;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  color: var(--text);
}

.primary-nav a:hover::after,
.primary-nav a:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.nav-toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--brand);
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transform-origin: center;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

body.menu-open .nav-toggle .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.menu-open .nav-toggle .nav-toggle-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

body.menu-open .nav-toggle .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 7, 15, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9997;
}

body.menu-open {
  overflow: hidden;
}

body.menu-open .menu-overlay {
  opacity: 1;
  pointer-events: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
}

.icon-toggle:hover {
  color: var(--text);
  border-color: #2a3169;
}

.icon-toggle[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--brand);
}

.icon-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .primary-nav {
    gap: 20px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 72px;
  }

  header {
    min-height: 50px;
  }

  .nav-wrap {
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 7px 0;
  }

  .legacy-brand {
    order: 0;
    min-width: auto;
    padding: 0;
  }

  .nav-actions {
    position: absolute;
    gap: 8px;
    justify-self: end;
    top: 50%;
    right: 16px;
    transform: translate(0%, -50%);
  }

  .header-actions {
    gap: 6px;
  }

  .primary-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    width: min(280px, 85vw);
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    background: var(--bg);
    border-left: 1px solid var(--border);
    box-shadow: -16px 0 40px var(--shadow);
    padding: 24px 20px 32px;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    z-index: 9998;
    overflow-y: auto;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  }

  body.menu-open .primary-nav {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    min-height: fit-content;
  }

  .nav-toggle {
    display: inline-flex;
    width: 36px;
    height: 36px;
  }

  .nav-toggle-bar {
    width: 20px;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  body.menu-open .nav-toggle .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    transform-origin: center;
  }

  body.menu-open .nav-toggle .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    transform-origin: center;
  }

  .primary-nav a {
    display: flex;
    width: 100%;
    font-size: 15px;
    letter-spacing: 0.4px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
  }

  .theme-light .primary-nav a {
    border-color: var(--border);
    background: var(--card);
  }

  .primary-nav a::after {
    display: none;
  }

  .primary-nav a:hover,
  .primary-nav a:focus-visible {
    background: rgba(122, 162, 255, 0.14);
    color: var(--text);
  }
}

/* Profile Avatar Styles */
.header-avatar {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.avatar-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--brand);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Note: .brand-img styles for image-to-text transition are defined above in .legacy-brand section */

@media (max-width: 992px) {
  .header-avatar {
    position: static;
    transform: none;
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
  }

  .avatar-img {
    width: 160px;
    height: 160px;
  }
}

@media (max-width: 768px) {
  .avatar-img {
    width: 140px;
    height: 140px;
  }

  .legacy-brand .brand-img {
    width: 98px;
    height: 98px;
    border-width: 2px;
  }
}

/* Legacy hero header */
.legacy-header {
  position: relative;
  padding: 3rem 0;
  min-height: 420px;
  height: min(60vh, 540px);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  background-color: #0a0c19;
  background-image:
    linear-gradient(105deg, rgba(10, 12, 25, 0.9) 0%, rgba(10, 12, 25, 0.72) 42%, rgba(10, 12, 25, 0.48) 100%),
    url("hero-background.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.legacy-header__container {
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.legacy-header .header-content {
  max-width: min(620px, 60%);
}

@media (max-width: 992px) {
  .legacy-header__container {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .legacy-header {
    padding: 2rem 0 4.5rem;
    min-height: auto;
    height: auto;
    background-attachment: scroll;
  }

  .legacy-header__container {
    flex-direction: column;
  }

  .legacy-header .header-content {
    text-align: center;
    max-width: 100%;
  }

  .legacy-header .header-title {
    font-size: clamp(2.2rem, 10vw, 3.5rem);
  }

  .legacy-header .header-subtitle {
    font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    letter-spacing: 0.25rem;
  }

  .legacy-header .header-mono {
    font-size: clamp(0.9rem, 3vw, 1.3rem);
    letter-spacing: 0.15rem;
  }

  .legacy-header .header-desc {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  }

  .legacy-header .header-meta {
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
    font-size: 0.8rem;
  }

  .legacy-header .header-cta {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
  }

  .header-cta__btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }
}

.theme-light .legacy-header {
  color: #0f1326;
  border-bottom-color: rgba(15, 19, 38, 0.08);
  background-color: #f7f8ff;
  background-image:
    linear-gradient(105deg, rgba(247, 248, 255, 0.92) 0%, rgba(247, 248, 255, 0.78) 46%, rgba(247, 248, 255, 0.62) 100%),
    url("hero-background.jpg");
  background-attachment: scroll;
}

.legacy-header .header-subtitle {
  margin: 0 0 0.75rem;
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.4rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

.theme-light .legacy-header .header-subtitle {
  color: rgba(15, 19, 38, 0.7);
}

.legacy-header .header-title {
  margin: 0 0 0.25rem;
  font-size: clamp(2.75rem, 8vw, 6rem);
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 12px 45px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.legacy-header .header-mono {
  margin: 0 0 1.5rem;
  font-size: clamp(1rem, 3.5vw, 1.9rem);
  letter-spacing: 0.3rem;
  text-transform: uppercase;
  white-space: pre-line;
  color: rgba(255, 255, 255, 0.85);
}

.theme-light .legacy-header .header-mono {
  color: rgba(15, 19, 38, 0.8);
}

.legacy-header .header-desc {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: rgba(255, 255, 255, 0.92);
}

.theme-light .legacy-header .header-desc {
  color: rgba(15, 19, 38, 0.85);
}

.legacy-header .header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

.legacy-header .header-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.legacy-header .header-meta svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.theme-light .legacy-header .header-meta {
  color: rgba(15, 19, 38, 0.7);
}

.legacy-header .header-cta {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.95rem 2rem;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  background: var(--card);
}

.header-cta__btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
  text-decoration: none;
}

.header-cta__btn--primary {
  color: var(--brand);
  border-color: var(--brand);
}

.header-cta__btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.75);
}

.theme-light .header-cta__btn {
  color: #10142b;
  border-color: rgba(16, 20, 43, 0.2);
  box-shadow: 0 10px 24px rgba(16, 20, 43, 0.12);
}

.theme-light .header-cta__btn--primary {
  color: var(--brand);
  border-color: var(--brand);
}

.theme-light .header-cta__btn--ghost {
  background: transparent;
}

/* Sections */
.section {
  padding: 30px 0;
}

.section h3 {
  margin: 0 0 16px;
  font-size: 22px;
}

/* Highlights section - Skills */
.highlights {
  padding: 24px 0;
}

.highlights .skills-col {
  min-width: 0;
}

@media (max-width: 900px) {
  .highlights {
    padding: 16px 0;
  }
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.card {
  background: radial-gradient(120% 120% at -10% -10%, rgba(122, 162, 255, 0.08), transparent), var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px var(--shadow);
  border-color: #2a3169;
}

.card .body {
  padding: 14px;
  display: block;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card.expanded .body {
  align-self: stretch;
  height: 100%;
}

.card .title {
  font-weight: 600;
}

.card .subtitle {
  color: var(--muted);
  font-size: 14px;
}

.card .desc {
  color: var(--desc-color);
  font-size: 14px;
}

.card .card-summary {
  margin: 12px 0 0;
  color: var(--desc-color);
  font-size: 14px;
}

.card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.card.expanded .card-tags {
  display: none;
}

.card .card-details {
  display: none;
  margin-top: 12px;
}

.card .card-details > * + * {
  margin-top: 12px;
}

.card .card-details .links {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card.expanded .card-details {
  display: block;
}

/* Card header with thumbnail */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.card-thumb, .card-thumb-expanded {
  display: block;
  float: right;
  width: auto;
  max-width: min(20%, 150px);
  max-height: 100px;
  border-radius: 8px;
  object-fit: contain; 
  object-fit: cover;
  flex-shrink: 0;
  border: none; 
  margin: 10px 20px; 
}

.card-header-text {
  flex: 1;
  min-width: 0;
}

/* Hide thumbnail when card is expanded */
.card.expanded .card-thumb {
  display: none;
}
.card.expanded .card-image {
  display: block;
}

/* Thumbnail fallback in expanded view (when no full image) */
.card-thumb-expanded {
  display: none;
}

.card.expanded .card-thumb-expanded {
  display: block;
}

/* Full image in expanded view */
.card-image {
  display: none;
  float: right;
  width: auto;
  max-width: min(45%, 320px);
  max-height: 480px;
  object-fit: contain;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  margin: 20px 20px 10px 20px;
}

.card-image.is-lightbox-ready {
  cursor: zoom-in;
}

.card-image.is-lightbox-ready:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 65%, white);
  outline-offset: 4px;
}

.image-lightbox-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
  padding: max(1rem, calc(var(--header-h) * 0.45)) 1rem 1.25rem;
  overflow-y: auto;
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.image-lightbox__dialog {
  position: relative;
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  width: min(92vw, 1100px);
  max-height: calc(100vh - max(2.5rem, calc(var(--header-h) * 0.45)) - 1.5rem);
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.image-lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.image-lightbox__close span {
  display: block;
  line-height: 1;
}

.image-lightbox__close:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 10%, transparent);
}

.image-lightbox__close:active {
  background: color-mix(in srgb, var(--text) 16%, transparent);
}

.image-lightbox__close:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.image-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - max(8rem, calc(var(--header-h) * 0.45 + 5rem)));
  border-radius: 10px;
  object-fit: contain;
}

.image-lightbox__caption {
  margin: 0;
  max-width: min(72ch, 100%);
  padding: 0.25rem 0.5rem 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.5;
}

.image-lightbox__caption:empty {
  display: none;
}

@media (max-width: 640px) {
  .image-lightbox {
    padding: 0.6rem;
  }

  .image-lightbox__dialog {
    width: min(96vw, 1100px);
    max-height: calc(100vh - 1.2rem);
    padding: 1rem;
    border-radius: 12px;
  }

  .image-lightbox__close {
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
  }

  .image-lightbox__image {
    max-height: calc(100vh - 6rem);
  }

  .image-lightbox__caption {
    font-size: 0.85rem;
    padding-top: 0.25rem;
  }
}

/* Responsive thumbnail adjustments */
@media (max-width: 480px) {
  .card-thumb {
    width: 50px;
    height: 50px;
  }
  .card-thumb-expanded {
    max-width: 50px;
    max-height: 50px;
  }
}

.badge {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 28px;
  border: 1px solid var(--border);
  color: var(--badge-color);
  font-size: 12px;
  margin-right: 6px;
  margin-bottom: 6px;
  background: var(--badge-bg);
}

.links a {
  color: var(--brand);
  text-decoration: none;
  margin-right: 10px;
  font-size: 14px;
}

.links a:hover {
  text-decoration: underline;
}

/* Skills Section */
.highlights {
  margin-bottom: 32px;
}

.highlights .skills-col h3 {
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text) 0%, var(--brand) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.skills-group {
  background: linear-gradient(145deg, var(--card) 0%, rgba(23, 28, 59, 0.8) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.skills-group::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.skills-group:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(122, 162, 255, 0.1);
  border-color: rgba(122, 162, 255, 0.3);
}

.skills-group:hover::before {
  opacity: 1;
}

.theme-light .skills-group {
  background: linear-gradient(145deg, var(--card) 0%, rgba(247, 248, 255, 0.9) 100%);
}

.theme-light .skills-group:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(58, 99, 255, 0.15);
  border-color: rgba(58, 99, 255, 0.25);
}

.skills-group h4 {
  margin: 0 0 16px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--brand);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.skills-group h4 .ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(122, 162, 255, 0.2), rgba(66, 211, 146, 0.1));
  box-shadow: inset 0 0 0 1px rgba(122, 162, 255, 0.32);
  color: var(--brand);
}

.skills-group h4 .ico svg {
  width: 18px;
  height: 18px;
  display: block;
}

.skills-group h4 .ico-concepts {
  color: #c4b5fd;
  background: linear-gradient(145deg, rgba(167, 139, 250, 0.28), rgba(167, 139, 250, 0.08));
  box-shadow: inset 0 0 0 1px rgba(196, 181, 253, 0.42);
}

.skills-group h4 .ico-soft-skills {
  color: #8ee8c3;
  background: linear-gradient(145deg, rgba(66, 211, 146, 0.26), rgba(66, 211, 146, 0.08));
  box-shadow: inset 0 0 0 1px rgba(142, 232, 195, 0.4);
}

.skills-group h4 .ico-languages {
  color: #a9c2ff;
  background: linear-gradient(145deg, rgba(122, 162, 255, 0.3), rgba(122, 162, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(169, 194, 255, 0.42);
}

.skills-group h4 .ico-tools {
  color: #f3c98a;
  background: linear-gradient(145deg, rgba(232, 177, 90, 0.26), rgba(232, 177, 90, 0.08));
  box-shadow: inset 0 0 0 1px rgba(243, 201, 138, 0.42);
}

.theme-light .skills-group h4 .ico {
  background: linear-gradient(145deg, rgba(58, 99, 255, 0.14), rgba(31, 164, 113, 0.08));
  box-shadow: inset 0 0 0 1px rgba(58, 99, 255, 0.22);
}

.theme-light .skills-group h4 .ico-concepts {
  color: #5b3cc4;
  background: linear-gradient(145deg, rgba(91, 60, 196, 0.16), rgba(91, 60, 196, 0.05));
  box-shadow: inset 0 0 0 1px rgba(91, 60, 196, 0.28);
}

.theme-light .skills-group h4 .ico-soft-skills {
  color: #0d7a4c;
  background: linear-gradient(145deg, rgba(13, 122, 76, 0.16), rgba(13, 122, 76, 0.05));
  box-shadow: inset 0 0 0 1px rgba(13, 122, 76, 0.28);
}

.theme-light .skills-group h4 .ico-languages {
  color: #2a4fd0;
  background: linear-gradient(145deg, rgba(42, 79, 208, 0.14), rgba(42, 79, 208, 0.05));
  box-shadow: inset 0 0 0 1px rgba(42, 79, 208, 0.26);
}

.theme-light .skills-group h4 .ico-tools {
  color: #8a5a10;
  background: linear-gradient(145deg, rgba(138, 90, 16, 0.16), rgba(138, 90, 16, 0.05));
  box-shadow: inset 0 0 0 1px rgba(138, 90, 16, 0.28);
}

.skills-group .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skills-group .tags .badge {
  margin: 0;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  background: var(--badge-bg);
  border: 1px solid transparent;
  color: var(--badge-color);
  transition: all 0.2s ease;
}

.skills-group .tags .badge:hover {
  background: rgba(122, 162, 255, 0.15);
  border-color: rgba(122, 162, 255, 0.3);
  color: var(--brand);
  transform: translateY(-1px);
}

.theme-light .skills-group .tags .badge:hover {
  background: rgba(58, 99, 255, 0.1);
  border-color: rgba(58, 99, 255, 0.2);
  color: var(--brand);
}

/* Bullets */
.bullets {
  margin: 0;
  padding-left: 18px;
  color: var(--bullets-color);
}

.bullets li {
  margin: 8px 0;
}

/* Pretty qualifications */
.bullets.pretty {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}

.bullets.pretty li {
  list-style: none;
  margin: 0;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* Contact bar */
.contact-bar {
  padding: 14px 0 0;
}

.contact-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.contact-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  text-decoration: none;
  background: var(--bg-soft);
}

.contact-link:hover {
  color: var(--text);
  border-color: #2a3169;
  text-decoration: none;
}

.contact-loc {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  padding: 6px 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  color: var(--muted);
}

.site-footer .container {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.site-footer a {
  color: var(--brand);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Detail toggle */
.toggle-more {
  display: inline-flex;
  margin-top: 12px;
  padding: 6px 12px;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
}

.toggle-more:hover {
  color: var(--text);
  border-color: #2a3169;
}

.card .toggle-more {
  margin-top: 16px;
  align-self: flex-start;
}

/* Tabs */
.tabs-section {
  padding: 26px 0 34px;
}

.tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  background: linear-gradient(180deg, rgba(15, 18, 33, 0.9), rgba(15, 18, 33, 0.7));
  backdrop-filter: blur(8px);
  z-index: 10;
  margin-top: 0;
}

.theme-light .tabs {
  background: linear-gradient(180deg, rgba(247, 248, 255, 0.95), rgba(247, 248, 255, 0.8));
}

.tabs [role="tab"] {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 600;
}

.tabs [role="tab"][aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--brand);
}

.panel {
  padding: 16px 0;
}

.panel-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.panel-toolbar input[type="search"] {
  flex: 1;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
}

.panel-toolbar .btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.panel-toolbar .btn:hover {
  color: var(--text);
  border-color: #2a3169;
}

/* Timeline */
.timeline {
  position: relative;
  display: grid;
  gap: 16px;
  margin-left: 6px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(122, 162, 255, 0.35), rgba(66, 211, 146, 0.25));
}

.timeline::after {
  content: "";
  position: absolute;
  left: 20px;
  width: 14px;
  bottom: -2px;
  height: 2px;
  background: rgba(66, 211, 146, 0.25);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
}

.timeline-item .dot {
  position: relative;
  top: 6px;
  left: 21px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--card);
  box-shadow: 0 0 0 4px rgba(122, 162, 255, 0.18);
  transition: transform .15s ease, box-shadow .2s ease;
}

.timeline-item:hover .dot {
  transform: scale(1.2);
  box-shadow: 0 0 0 6px rgba(122, 162, 255, 0.22);
}

.timeline-item .dot::after {
  content: attr(data-date);
  position: absolute;
  left: 20px;
  top: -6px;
  transform: translateY(-100%);
  white-space: nowrap;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  box-shadow: 0 6px 18px var(--shadow);
  z-index: 2;
}

.timeline-item:hover .dot::after,
.timeline-item .dot:focus-visible::after {
  opacity: 1;
  transform: translateY(-110%);
}

.timeline-item .dot::before {
  content: "";
  position: absolute;
  left: 10px;
  top: -10px;
  width: 10px;
  height: 10px;
  transform: translateY(-100%) rotate(45deg);
  background: var(--bg-soft);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  opacity: 0;
  transition: opacity .15s ease;
  z-index: 2;
}

.timeline-item:hover .dot::before,
.timeline-item .dot:focus-visible::before {
  opacity: 1;
}

.timeline-item .card {
  margin: 0;
}

@media (max-width: 768px) {
  .timeline {
    margin-left: 0;
  }

  .timeline::before,
  .timeline::after {
    display: none;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-item .dot {
    display: none;
  }
}

/* Additional mobile fixes */
@media (max-width: 768px) {
  .tabs {
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tabs [role="tab"] {
    padding: 10px 12px;
    font-size: 14px;
    white-space: nowrap;
  }

  .panel-toolbar {
    flex-wrap: wrap;
  }

  .panel-toolbar input[type="search"] {
    min-width: 0;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .card .body {
    padding: 12px;
  }

  .section {
    padding: 20px 0;
  }

  .section h3 {
    font-size: 20px;
  }

  .highlights {
    gap: 24px;
  }

  .skills {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .skills-group {
    padding: 16px 18px;
  }

  .skills-group h4 {
    font-size: 13px;
  }

  .skills-group .tags .badge {
    padding: 6px 12px;
    font-size: 12px;
  }

  .contact-items {
    justify-content: center;
  }

  .menu-overlay {
    top: var(--header-h);
  }
}

@media (max-width: 480px) {
  .legacy-header .header-cta {
    flex-direction: row;
    gap: 0.5rem;
  }

  .header-cta__btn {
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
  }

  .contact-link {
    padding: 5px 8px;
    font-size: 13px;
  }

  .contact-link svg {
    width: 16px;
    height: 16px;
  }

  .legacy-brand {
    justify-content: left;
  }

  .legacy-brand .brand-img {
    width: 98px;
    height: 98px;
    border-width: 2px; 
  }
}

@media (max-width: 340px) {
  .legacy-brand .brand-img {
    width: 48px;
    height: 48px; 
    position: static;
    transform: none;
  }
}

/* Print */
@media print {
  .site-header,
  .tabs,
  .panel-toolbar,
  .site-footer {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    box-shadow: none;
    border-color: #ddd;
  }
}

/* Skill Usage Tooltip */
.skill-badge {
  cursor: pointer;
  position: relative;
}

.skill-badge:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.skill-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: 320px;
  min-width: 200px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(122, 162, 255, 0.1);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.skill-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.theme-light .skill-tooltip {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(58, 99, 255, 0.1);
}

.skill-tooltip-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-tooltip-title svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.skill-tooltip-section {
  margin-bottom: 12px;
}

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

.skill-tooltip-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 6px;
}

.skill-tooltip-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skill-tooltip-list li {
  padding: 4px 0;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.skill-tooltip-list li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.skill-tooltip-empty {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}
