/* ============================================
   Portfolio — variables, reset, base
   ============================================ */
:root {
  --bg: #f9fafb;
  --bg-pure: #ffffff;
  --text: #0c1929;
  --text-muted: #5c6d80;
  --accent-1: #0369a1;
  --accent-2: #0ea5e9;
  --accent-3: #38bdf8;
  --accent-4: #7dd3fc;
  --accent-deep: #0c4a6e;
  --surface: #f1f5f9;
  --surface-elevated: #ffffff;
  --border: rgba(12, 74, 110, 0.1);
  --border-strong: rgba(12, 74, 110, 0.16);
  --shadow: 0 4px 6px -1px rgba(12, 74, 110, 0.06), 0 20px 50px -12px rgba(3, 105, 161, 0.12);
  --shadow-hover: 0 25px 60px -15px rgba(3, 105, 161, 0.22);
  --radius: 20px;
  --radius-sm: 12px;
  --nav-h: 76px;
  --font-body: "Outfit", system-ui, sans-serif;
  --font-display: "Syne", system-ui, sans-serif;
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 100% -20%, rgba(56, 189, 248, 0.09), transparent 50%),
    radial-gradient(ellipse 90% 70% at 0% 100%, rgba(14, 165, 233, 0.07), transparent 45%);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
}

#main,
.site-header,
.site-footer {
  position: relative;
  z-index: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-1);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid var(--accent-3);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10000;
  padding: 12px 20px;
  background: var(--accent-1);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: top 0.2s;
}

.skip-link:focus {
  top: 16px;
}

/* ----- Layout utilities ----- */
.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

.section {
  padding: clamp(3rem, 8vw, 6rem) 0;
  position: relative;
}

.section--alt {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(249, 250, 251, 0.95) 100%);
  backdrop-filter: blur(8px);
}

.section--premium {
  position: relative;
}

.section--premium::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: min(72rem, 94vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  pointer-events: none;
}

.section__label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 0.65rem;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.2vw, 2.65rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1.35rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ----- Sticky nav ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition), background 0.4s ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 32px rgba(12, 74, 110, 0.07);
}

.header-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  position: relative;
}

.logo::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-4));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out-expo);
}

.logo:hover {
  color: var(--accent-1);
  text-decoration: none;
}

.logo:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-list a {
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  position: relative;
  transition: color 0.3s ease, background 0.3s ease;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--accent-deep);
  background: rgba(14, 165, 233, 0.08);
  text-decoration: none;
}

.nav-list a[aria-current="page"] {
  color: var(--accent-1);
  background: rgba(14, 165, 233, 0.12);
}

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .nav-list {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 1.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    gap: 0;
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
  }

  .nav-list.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-list li {
    border-bottom: 1px solid var(--border);
  }

  .nav-list a {
    display: block;
    padding: 0.85rem 0;
  }
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn:focus-visible {
  outline-offset: 4px;
}

.btn--primary {
  background: linear-gradient(145deg, var(--accent-deep) 0%, var(--accent-1) 40%, var(--accent-2) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(3, 105, 161, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(3, 105, 161, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-decoration: none;
  color: #fff;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.55);
  color: var(--accent-deep);
  border: 1.5px solid var(--border-strong);
  backdrop-filter: blur(8px);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--accent-3);
  text-decoration: none;
}

/* ----- Hero: full-bleed split + curtain reveal ----- */
.hero-split {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  overflow: hidden;
  background: var(--bg-pure);
}

.hero-split > .hero-split__rail {
  position: absolute;
  z-index: 4;
}

.hero-split__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100svh - var(--nav-h));
  position: relative;
  isolation: isolate;
}

.hero-split__pane {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-split__pane--media {
  background: #0c1929;
}

.hero-split__pane--content {
  background: linear-gradient(165deg, #ffffff 0%, #f0f9ff 55%, #e0f2fe 100%);
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.75rem, 5vw, 4rem);
}

.hero-split__media {
  position: absolute;
  inset: 0;
}

.hero-split__video,
.hero-split__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
}

.hero-split--revealed .hero-split__video,
.hero-split--revealed .hero-split__img {
  transform: scale(1);
  transition: transform 1.35s var(--ease-out-expo);
}

.hero-split:not(.hero-split--video) .hero-split__video {
  display: none;
}

.hero-split.hero-split--video .hero-split__img {
  display: none;
}

.hero-split__media-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--accent-deep), var(--accent-1), var(--accent-3));
  font-family: var(--font-display);
  font-size: clamp(3rem, 14vw, 5rem);
  font-weight: 800;
  color: #fff;
}

.hero-split__media-fallback.is-visible {
  display: flex;
}

.hero-split__media-fallback span {
  opacity: 0.92;
  letter-spacing: -0.04em;
}

.hero-split__curtain {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  pointer-events: none;
  will-change: clip-path;
}

.hero-split__curtain--right {
  background: linear-gradient(160deg, #ffffff 0%, #f0f9ff 40%, #e0f2fe 100%);
}

.hero-split--revealed .hero-split__curtain {
  pointer-events: none;
}

.hero-split__curtain--left {
  clip-path: inset(0 0 0 0);
}

.hero-split__curtain--right {
  clip-path: inset(0 0 0 0);
}

.hero-split--revealed .hero-split__curtain--left {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.15s var(--ease-out-expo);
}

.hero-split--revealed .hero-split__curtain--right {
  clip-path: inset(0 0 0 100%);
  transition: clip-path 1.15s var(--ease-out-expo);
}

.hero-split__rail {
  top: 12%;
  bottom: 12%;
  left: 50%;
  width: 1px;
  margin-left: -0.5px;
  background: linear-gradient(180deg, transparent, rgba(56, 189, 248, 0.5), var(--accent-2), rgba(56, 189, 248, 0.5), transparent);
  transform: scaleY(0);
  transform-origin: center top;
  opacity: 0.85;
  pointer-events: none;
}

.hero-split--revealed .hero-split__rail {
  transform: scaleY(1);
  transition: transform 1s 0.15s var(--ease-out-expo);
}

.hero-split__content-inner {
  position: relative;
  z-index: 2;
  max-width: 32rem;
}

.hero-split__pretitle {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-1);
}

.hero-split__name {
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 6.5vw, 3.85rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0 0 1.1rem;
  color: var(--text);
}

.hero-split__tagline {
  font-size: clamp(1.08rem, 2.4vw, 1.28rem);
  font-weight: 400;
  color: var(--text-muted);
  min-height: 2.6em;
  margin: 0 0 2rem;
  line-height: 1.55;
}

.hero-split__tagline .cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent-1));
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-split__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.1rem;
}

.hero-split__img.is-error,
.split__img.is-error {
  display: none;
}

@media (max-width: 768px) {
  .hero-split__layout {
    grid-template-columns: 1fr;
    grid-template-rows: min(42vh, 320px) 1fr;
    min-height: calc(100svh - var(--nav-h));
  }

  .hero-split__rail {
    display: none;
  }

  .hero-split__pane--content {
    text-align: center;
    align-items: flex-start;
    padding-bottom: clamp(2.5rem, 10vw, 4rem);
  }

  .hero-split__content-inner {
    margin-inline: auto;
  }

  .hero-split__actions {
    justify-content: center;
  }

  .hero-split__curtain--left {
    clip-path: inset(0 0 0 0);
  }

  .hero-split__curtain--right {
    clip-path: inset(0 0 0 0);
  }

  .hero-split--revealed .hero-split__curtain--left {
    clip-path: inset(0 0 100% 0);
  }

  .hero-split--revealed .hero-split__curtain--right {
    clip-path: inset(100% 0 0 0);
  }
}

/* ----- Split rows (About, Education, Languages) ----- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

.split__text p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.split__text p:last-child {
  margin-bottom: 0;
}

.split__media {
  position: relative;
}

.split__img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-height: 380px;
  object-fit: cover;
}

.split__img-fallback {
  display: none;
  border-radius: var(--radius);
  min-height: 280px;
  background: linear-gradient(145deg, var(--accent-4), var(--accent-2));
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.split__img-fallback.is-visible {
  display: flex;
}

.split__actions {
  margin-top: 1.25rem;
}

@media (max-width: 768px) {
  .split {
    grid-template-columns: 1fr;
  }
}

@supports not (background-clip: text) {
  .section__title {
    color: var(--text);
    background: none;
    -webkit-text-fill-color: currentColor;
  }
}

/* ----- Scroll split-reveal sections (About / Education) ----- */
.split-reveal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 3.75rem);
  align-items: center;
  padding: clamp(0.25rem, 1vw, 0.5rem) 0;
}

.split-reveal__col--text,
.split-reveal__frame {
  overflow: hidden;
}

.split-reveal__col--text p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.split-reveal__col--text p:last-of-type {
  margin-bottom: 0;
}

.split-reveal__frame {
  margin: 0;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  box-shadow: var(--shadow);
  position: relative;
}

.split-reveal__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.split-reveal__frame--logo .split-reveal__img {
  object-fit: contain;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: linear-gradient(145deg, #fff, #f8fafc);
}

.split-reveal__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(160deg, #e0f2fe, #f8fafc);
}

.split-reveal__frame--logo .split-reveal__media {
  aspect-ratio: 16 / 11;
}

.split-reveal__video,
.split-reveal__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out-expo);
}

.split-reveal__frame:hover .split-reveal__img,
.split-reveal__frame:hover .split-reveal__video {
  transform: scale(1.03);
}

.split-reveal:not(.split-reveal--video) .split-reveal__video {
  display: none;
}

.split-reveal.split-reveal--video .split-reveal__img {
  display: none;
}

.split-reveal__col--media .split__actions {
  margin-top: 1.35rem;
}

.split-reveal--media-left {
  direction: rtl;
}

.split-reveal--media-left > * {
  direction: ltr;
}

@media (max-width: 768px) {
  .split-reveal,
  .split-reveal--media-left {
    direction: ltr;
    grid-template-columns: 1fr;
  }

  .split-reveal__col--text {
    order: 2;
  }

  .split-reveal__col--media {
    order: 1;
  }

  .split-reveal--media-left .split-reveal__col--text {
    order: 2;
  }

  .split-reveal--media-left .split-reveal__col--media {
    order: 1;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lang-code-hint {
  font-size: 0.85em;
  font-family: ui-monospace, monospace;
  background: rgba(14, 165, 233, 0.1);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* ----- Skills bubble sea (full-bleed, taller) ----- */
.section--skills {
  overflow-x: clip;
}

.skills-sea-bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 1.75rem;
}

.skills-sea-wrap {
  position: relative;
  min-height: 504px;
  background:
    linear-gradient(90deg, rgba(224, 242, 254, 0.35) 0%, transparent 8%, transparent 92%, rgba(224, 242, 254, 0.35) 100%),
    linear-gradient(165deg, #dbeafe 0%, #f8fafc 42%, #e0f2fe 100%);
  overflow: hidden;
}

.skills-sea-wrap--full {
  min-height: 504px;
  border-radius: 0;
  border: none;
  border-top: 1px solid rgba(12, 74, 110, 0.08);
  border-bottom: 1px solid rgba(12, 74, 110, 0.08);
  box-shadow: none;
}

.skills-sea {
  position: relative;
  width: 100%;
  min-height: 504px;
  touch-action: manipulation;
}

.skill-bubble {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.72rem, 1.65vw, 0.95rem);
  line-height: 1.2;
  padding: 10px;
  color: #fff;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 24px rgba(0, 119, 182, 0.2);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow var(--transition);
  transform-origin: center center;
  -webkit-tap-highlight-color: transparent;
}

.skill-bubble:hover,
.skill-bubble:focus-visible {
  z-index: 5;
  box-shadow: var(--shadow-hover);
}

.skill-bubble:hover .skill-bubble__inner,
.skill-bubble:focus-visible .skill-bubble__inner {
  transform: scale(1.1);
}

.skill-bubble:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent-1);
}

.skill-bubble__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
  transition: transform 0.4s var(--ease-out-expo);
  /* Give text a stable usable width inside circle */
  width: calc(100% - 16px);
  max-width: calc(100% - 16px);
  min-width: 0;
  margin-inline: auto;
}

.skill-bubble__name {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  /* Avoid weird per-letter wrapping */
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
  line-height: 1.15;
}

.skill-bubble__level {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  font-size: 0.68em;
  font-weight: 500;
  opacity: 0.92;
  line-height: 1.1;
  /* Keep level on one line */
  white-space: nowrap;
}
.skills-hint {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ----- Experience ----- */
.experience-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 2rem);
}

.exp-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.35rem, 3vw, 1.9rem);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  align-items: start;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  box-shadow: 0 1px 2px rgba(12, 74, 110, 0.04);
}

.exp-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-6px);
}

.exp-card__logo-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.exp-card__logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border);
}

.exp-card__logo.is-error {
  display: none;
}

.exp-card__logo-fallback {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-3), var(--accent-1));
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 1.25rem;
}

.exp-card__logo-fallback.is-visible {
  display: flex;
}

.exp-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
}

.exp-card__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.exp-card ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  grid-column: 1 / -1;
}

.exp-card li {
  margin-bottom: 0.4rem;
}

@media (max-width: 768px) {
  .experience-grid {
    grid-template-columns: 1fr;
  }
}

/* ----- Languages ----- */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.lang-box {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.lang-box:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 12px 28px rgba(14, 165, 233, 0.1);
  transform: translateY(-2px);
}

.lang-box__flag-slot {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, #f1f5f9);
  border: 1px solid var(--border-strong);
  box-shadow: 0 4px 14px rgba(12, 74, 110, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 0;
  line-height: 0;
}

.lang-box__emoji {
  font-size: 1.85rem;
  line-height: 1;
  display: block;
  transform: scale(1.15);
  transform-origin: center center;
}

.lang-box__text {
  min-width: 0;
}

.lang-box__name {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  font-size: 1rem;
}

.lang-box__level {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .lang-grid {
    grid-template-columns: 1fr;
  }
}

/* ----- Engagements ----- */
.engagements-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.engagement-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform var(--transition), box-shadow var(--transition);
}

.engagement-card:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow);
  z-index: 2;
}

.engagement-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.engagement-card:hover img {
  transform: scale(1.08);
}

.engagement-card__fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(145deg, var(--accent-4), var(--accent-2));
}

.engagement-card__fallback.is-visible {
  display: flex;
}

.engagement-card img.is-error {
  display: none;
}

/* Title always visible at bottom */
.engagement-card__bar {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 0.65rem 0.85rem;
  background: linear-gradient(transparent, rgba(10, 37, 64, 0.92));
  color: #fff;
  pointer-events: none;
}

.engagement-card__bar strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
}

/* Full card — dark layer + text on hover (like hobbies) */
.engagement-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 18, 32, 0.85);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out-expo);
  pointer-events: none;
}

.engagement-card:hover .engagement-card__overlay,
.engagement-card:focus-within .engagement-card__overlay {
  opacity: 1;
}

.engagement-card:focus {
  outline: none;
}

.engagement-card:focus-visible {
  outline: 3px solid var(--accent-3);
  outline-offset: 3px;
}

.engagement-card__overlay-title {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.engagement-card__overlay-text {
  margin: 0;
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 500;
  line-height: 1.5;
  color: #e2e8f0;
  text-align: center;
  text-wrap: balance;
  max-width: 34ch;
}

@media (max-width: 1024px) {
  .engagements-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .engagements-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin-inline: auto;
  }

  .engagement-card {
    aspect-ratio: 16 / 10;
  }
}

/* ----- Projects ----- */
.project-group {
  margin-bottom: 3rem;
}

.project-group:last-child {
  margin-bottom: 0;
}

.project-group__title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 1.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-strong);
  color: var(--accent-deep);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.project-card {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.project-card:hover,
.project-card:focus-visible {
  box-shadow: var(--shadow-hover);
  border-color: rgba(56, 189, 248, 0.25);
  transform: translateY(-6px);
  text-decoration: none;
  color: inherit;
}

.project-card__img-wrap {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface);
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.project-card:hover img,
.project-card:focus-visible img {
  transform: scale(1.05);
}

.project-card__fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent-1);
  background: linear-gradient(135deg, #e8f6fc, #fff);
}

.project-card__fallback.is-visible {
  display: flex;
}

.project-card__img-wrap img.is-error {
  display: none;
}

.project-card__body {
  padding: 1rem 1.1rem;
}

.project-card__body h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--text);
}

.project-card__body p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* ----- Hobbies mosaic ----- */
.hobbies-mosaic {
  margin-top: 2rem;
  columns: 3 280px;
  column-gap: clamp(12px, 2.5vw, 20px);
}

.hobby-tile {
  position: relative;
  break-inside: avoid;
  margin-bottom: clamp(12px, 2.5vw, 20px);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: 0 4px 20px rgba(12, 74, 110, 0.07);
  cursor: default;
  transition: box-shadow var(--transition), transform var(--transition);
}

.hobby-tile:hover,
.hobby-tile:focus-within {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  z-index: 2;
}

.hobby-tile:focus {
  outline: none;
}

.hobby-tile:focus-visible {
  outline: 3px solid var(--accent-3);
  outline-offset: 4px;
}

.hobby-tile--sm {
  min-height: 168px;
}

.hobby-tile--md {
  min-height: 220px;
}

.hobby-tile--lg {
  min-height: 280px;
}

.hobby-tile--xl {
  min-height: 340px;
}

.hobby-tile__img {
  width: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s var(--ease-out-expo);
}

.hobby-tile--sm .hobby-tile__img {
  aspect-ratio: 5 / 4;
  min-height: 168px;
}

.hobby-tile--md .hobby-tile__img {
  aspect-ratio: 1;
  min-height: 220px;
}

.hobby-tile--lg .hobby-tile__img {
  aspect-ratio: 4 / 5;
  min-height: 280px;
}

.hobby-tile--xl .hobby-tile__img {
  aspect-ratio: 3 / 4;
  min-height: 340px;
}

.hobby-tile:hover .hobby-tile__img,
.hobby-tile:focus-within .hobby-tile__img {
  transform: scale(1.06);
}

.hobby-tile__fallback {
  display: none;
  min-height: inherit;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(145deg, var(--accent-4), var(--accent-2));
}

.hobby-tile__fallback.is-visible {
  display: flex;
}

.hobby-tile__img.is-error {
  display: none;
}

.hobby-tile__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 1.5rem);
  background: rgba(10, 18, 32, 0.82);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out-expo);
  pointer-events: none;
}

.hobby-tile:hover .hobby-tile__overlay,
.hobby-tile:focus-within .hobby-tile__overlay {
  opacity: 1;
}

.hobby-tile__caption {
  margin: 0;
  font-size: clamp(0.92rem, 2.2vw, 1.05rem);
  font-weight: 500;
  line-height: 1.5;
  color: #f1f5f9;
  text-align: center;
  text-wrap: balance;
  max-width: 28ch;
}

@media (max-width: 480px) {
  .hobbies-mosaic {
    columns: 1;
  }

  .hobby-tile--sm,
  .hobby-tile--md,
  .hobby-tile--lg,
  .hobby-tile--xl {
    min-height: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hobby-tile__overlay {
    transition-duration: 0.15s;
  }

  .hobby-tile__img {
    transition: none;
  }

  .hobby-tile:hover,
  .hobby-tile:focus-within {
    transform: none;
  }

  .hobby-tile:hover .hobby-tile__img,
  .hobby-tile:focus-within .hobby-tile__img {
    transform: none;
  }
}

/* ----- Footer ----- */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ----- Modals ----- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(12, 25, 41, 0.48);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: calc(var(--radius) + 2px);
  max-width: 480px;
  width: 100%;
  max-height: min(85vh, 560px);
  overflow: auto;
  padding: 1.65rem 1.65rem 1.35rem;
  box-shadow: var(--shadow-hover), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  border: 1px solid var(--border-strong);
  transform: scale(0.94) translateY(12px);
  transition: transform var(--transition);
}

.modal-overlay.is-open .modal {
  transform: scale(1) translateY(0);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
}

.modal__close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition);
}

.modal__close:hover {
  background: var(--border);
}

.modal__body {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.modal__body p {
  margin: 0 0 0.75rem;
}

/* ----- Scroll reveal (GSAP sets initial state) ----- */
.reveal {
  will-change: opacity, transform;
}

/* ----- Premium page loader ----- */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(145deg, #f8fafc 0%, #eff6ff 50%, #e0f2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.page-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader__content {
  text-align: center;
  width: min(280px, 78vw);
}

.page-loader__mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 1.5rem;
}

.page-loader__inner {
  width: 100%;
  height: 3px;
  background: rgba(12, 74, 110, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.page-loader__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-2), var(--accent-4));
  border-radius: 999px;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.45);
}
