/* ══════════════════════════════════════════════════
   ARABINDA SAHA — bchiang7-inspired portfolio
   Palette: Navy #0a192f · Teal #64ffda · Slate #8892b0
   Font: Inter (body/display) · Fira Code (mono)
══════════════════════════════════════════════════ */

:root {
  color-scheme: dark;
  --navy:        #0a192f;
  --navy-deep:   #020c1b;
  --navy-light:  #112240;
  --navy-lighter:#1d3461;
  --navy-shadow: #0d1b36;
  --teal:        #64ffda;
  --teal-muted:  #57cbab;
  --teal-tint:   rgba(100, 255, 218, 0.1);
  --white:       #e6f1ff;
  --slate-light: #ccd6f6;
  --slate:       #8892b0;
  --slate-dark:  #495670;
  --font-sans:   'Inter', system-ui, sans-serif;
  --font-display: 'Inter', system-ui, sans-serif;
  --font-mono:   'Fira Code', 'Courier New', monospace;
  --panel-w:     300px;
  --content-max: 1100px;
  --section-pad-y: 5.75rem;
  --prose-width: 62ch;
  --ease:        cubic-bezier(0.645, 0.045, 0.355, 1);
  --transition:  all 0.18s var(--ease);
}

/* ── F: Scroll progress bar ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(to right, var(--teal), rgba(100,255,218,0.4));
  z-index: 9997;
  pointer-events: none;
  transform-origin: left;
  /* No transition — must track scroll in real time */
}

/* ── Page loader (Brittany v4–style) ── */
body.is-loading {
  overflow: hidden;
}
body.is-loading .layout,
body.is-loading .mobile-header,
body.is-loading .side-rail,
body.is-loading .scroll-progress {
  visibility: hidden;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-deep);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.page-loader.loader--done {
  opacity: 0;
  visibility: hidden;
}

.loader-hex {
  opacity: 0;
  animation: loaderFadeIn 0.4s ease 0.1s forwards;
}
.loader-hex__shape {
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: hexDraw 1.2s var(--ease) 0.3s forwards;
}
.loader-hex__text {
  opacity: 0;
  animation: loaderFadeIn 0.5s ease 1s forwards;
}

@keyframes hexDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes loaderFadeIn {
  to { opacity: 1; }
}

/* ── Cursor spotlight (desktop only) ── */
.spotlight {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    600px circle at var(--spot-x, 50%) var(--spot-y, 50%),
    rgba(100, 255, 218, 0.04),
    transparent 60%
  );
}
@media (hover: hover) and (min-width: 901px) {
  .spotlight { opacity: 1; }
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 3rem;
}
section[id] {
  scroll-margin-top: 3rem;
}
@media (max-width: 900px) {
  section[id] {
    scroll-margin-top: var(--mobile-header-h, 4.75rem);
  }
}
body {
  background: var(--navy);
  color: var(--slate);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* P1.6 — Subtle film-grain texture (CSS-only via tiny SVG) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  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)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* P1.9 — Custom selection colour */
::selection {
  background: rgba(100, 255, 218, 0.22);
  color: var(--white);
}
::-moz-selection {
  background: rgba(100, 255, 218, 0.22);
  color: var(--white);
}
a { color: var(--teal); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--teal); }
a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}
button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
ul, ol { list-style: none; padding: 0; }
strong { color: var(--slate-light); font-weight: 500; }
.text-highlight { color: var(--white); font-weight: 500; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 10002;
  padding: 0.65rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--navy);
  background: var(--teal);
  border-radius: 4px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

/* ─────────────────────────────────────────
   LAYOUT: fixed left + scrolling right
───────────────────────────────────────── */
.mobile-header { display: none; }

.layout {
  display: flex;
  min-height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
}

/* ── Fixed side rails (Brittany v4–style; desktop / wide tablet only) ── */
.side-rail {
  display: none;
}
@media (min-width: 1081px) {
  .side-rail {
    display: flex;
    position: fixed;
    top: 0;
    bottom: 0;
    flex-direction: column;
    align-items: center;
    z-index: 12;
    pointer-events: none;
    animation: sideRailIn 0.65s var(--ease) 0.15s both;
  }
  @keyframes sideRailIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .side-rail--right {
    right: max(1.25rem, env(safe-area-inset-right, 0px));
    width: 48px;
  }
  .side-rail__spacer {
    flex: 1;
    min-height: 5rem;
    pointer-events: none;
  }
  .side-rail__line {
    width: 1px;
    height: clamp(4.5rem, 14vh, 9rem);
    background: linear-gradient(to bottom, transparent, var(--slate-dark) 20%, var(--slate-dark));
    margin-bottom: 1.25rem;
    opacity: 0.85;
    pointer-events: none;
  }
  .side-rail__list {
    list-style: none;
    margin: 0;
    padding: 0 0 max(1.25rem, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    pointer-events: auto;
  }
  .side-rail__link {
    display: flex;
    color: var(--slate-dark);
    transition: color 0.2s ease, transform 0.22s var(--ease);
  }
  .side-rail__link:hover,
  .side-rail__link:focus-visible {
    color: var(--teal);
    transform: translateY(-3px);
  }
  .side-rail__email {
    pointer-events: auto;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    color: var(--slate-dark);
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    transition: color 0.2s ease, transform 0.22s var(--ease);
    white-space: nowrap;
  }
  .side-rail__email:hover,
  .side-rail__email:focus-visible {
    color: var(--teal);
    transform: translateY(-3px);
  }
}

/* ── LEFT PANEL ── */
.left-panel {
  position: fixed;
  top: 0;
  width: var(--panel-w);
  height: 100vh;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  z-index: 10;
  overflow: hidden;          /* prevent children ever painting into right-panel space */
  left: calc((100vw - 1600px) / 2);
}
@media (max-width: 1600px) {
  .left-panel { left: 0; }
}

.left-panel__inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  padding: 4.5rem 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.left-panel__inner::-webkit-scrollbar {
  display: none;
}

/* Push socials to bottom without space-between overlap risk */
.lp-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

/* socials pinned to bottom with guaranteed gap */
.lp-socials {
  flex-shrink: 0;
  margin-top: 2rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

/* greeting */
.lp-greeting {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--teal);
  margin-bottom: 1.2rem;
}

/* name */
.lp-name {
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 3.4vw, 3.35rem);
  font-weight: 600;
  color: var(--slate-light);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 0.65rem;
}

/* title */
.lp-title {
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 600;
  color: var(--slate);
  line-height: 1.35;
  margin-bottom: 1.25rem;
  max-width: 18rem;
}

/* bio */
.lp-bio {
    font-size: 0.9rem;
    color: var(--slate);
    line-height: 1.7;
    max-width: 260px;
    margin-bottom: 1.4rem;
  }
.link-inline {
  color: var(--teal);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.25s var(--ease);
}
.link-inline:hover,
.link-inline:focus-visible {
  background-size: 100% 1px;
}

/* nav */
.lp-nav ol { display: flex; flex-direction: column; gap: 0.25rem; }
.nav-item a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  color: var(--slate);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: var(--transition);
  text-decoration: none;
}
.nav-line {
  display: block;
  width: 2rem;
  height: 1px;
  background: var(--slate-dark);
  transition: width 0.4s var(--ease), background 0.4s ease;
  flex-shrink: 0;
}
.nav-num { color: var(--teal); font-size: 0.7rem; }
.nav-label { transition: var(--transition); }

.nav-item a:hover .nav-line,
.nav-item.active a .nav-line {
  width: 4rem;
  background: var(--teal);
}
.nav-item a:hover,
.nav-item.active a {
  color: var(--slate-light);
}
.nav-item a:hover .nav-num,
.nav-item.active a .nav-num { color: var(--teal); }

.social-icon {
  color: var(--slate);
  transition: var(--transition);
  display: inline-flex;
}
.social-icon:hover {
  color: var(--teal);
  transform: translateY(-3px);
}
.lp-resume-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  letter-spacing: 0.08em;
  margin-left: 0.5rem;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.lp-resume-btn:hover {
  background: var(--teal-tint);
}

/* ── Animated download chevron — used on all resume buttons ── */
.btn-chevron {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 14px;
  position: relative;
  flex-shrink: 0;
  vertical-align: middle;
}
.btn-chevron::before,
.btn-chevron::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 1px 0;
}
.btn-chevron::before { top: 0; }
.btn-chevron::after  { top: 5px; opacity: 0.45; }

/* Bounce animation — triggers when parent is hovered */
@keyframes chevronBounce {
  0%   { transform: translateX(-50%) translateY(0)   rotate(45deg); }
  45%  { transform: translateX(-50%) translateY(3px)  rotate(45deg); }
  100% { transform: translateX(-50%) translateY(0)   rotate(45deg); }
}
.btn-resume:hover .btn-chevron::before,
.btn-resume:hover .btn-chevron::after,
.lp-resume-btn:hover .btn-chevron::before,
.lp-resume-btn:hover .btn-chevron::after,
.btn-primary:hover .btn-chevron::before,
.btn-primary:hover .btn-chevron::after {
  animation: chevronBounce 0.7s var(--ease) infinite;
}
.btn-resume:hover .btn-chevron::after,
.lp-resume-btn:hover .btn-chevron::after,
.btn-primary:hover .btn-chevron::after {
  animation-delay: 0.12s;
}

/* ── RIGHT PANEL ── */
.right-panel {
  margin-left: var(--panel-w);
  padding: 0 3rem;
  max-width: var(--content-max);
  width: 100%;
}

/* ── SECTIONS ── */
.section {
  padding: var(--section-pad-y) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 600;
  color: var(--slate-light);
  white-space: nowrap;
  margin-bottom: 1.5rem;
  cursor: default;
  transition: color 0.25s var(--ease);
  letter-spacing: -0.02em;
}
.section-heading:hover {
  color: var(--white);
}
.section-heading::after {
  content: '';
  display: block;
  height: 1px;
  width: 200px;
  background: var(--navy-light);
  flex-shrink: 0;
  transition: background 0.35s var(--ease), width 0.35s var(--ease);
}
.section-heading:hover::after {
  background: var(--teal);
  width: 240px;
}
.section-num {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--teal);
  font-weight: 400;
}
.section-intro {
  color: var(--slate-light);
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: var(--prose-width);
  margin-bottom: 2rem;
}
.section-heading + .section-intro,
.about-header + .section-intro {
  margin-top: -0.75rem;
}

/* ── HERO (desktop: hidden — content shown in left panel) ── */
.hero-section {
  display: none;
}

/* ── ABOUT ── */
.about-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.about-header .section-heading {
  margin-bottom: 0;
  flex: 1;
}

/* Mobile photo: shown in heading row on mobile, hidden on desktop */
.about-photo-mobile {
  display: none;
  flex-shrink: 0;
}

/* Mobile header photo — fully reset inherited .photo-wrapper styles */
.photo-wrapper.photo-wrapper--circle {
  width: min(280px, 72vw);
  height: min(280px, 72vw);
  max-width: 280px;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--slate-dark);
}
.photo-wrapper.photo-wrapper--circle::after {
  display: none;
  content: none;
}
.photo-wrapper.photo-wrapper--circle::before {
  display: none;
  content: none;
}
.photo-wrapper.photo-wrapper--circle .photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
  filter: none;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 4rem;
  align-items: flex-start;
  margin-top: 0;
}
.about-text {
  order: 1;
}
.about-text p {
  color: var(--slate);
  line-height: 1.75;
  font-size: 1.02rem;
  margin-bottom: 1.1rem;
  max-width: var(--prose-width);
}

/* Desktop photo: right column of grid, hidden on mobile */
.about-photo {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 0.25rem;
  order: 2;
}
.photo-wrapper {
  position: relative;
  isolation: isolate;        /* scoped stacking context — keeps z:-1 from escaping */
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: visible;
  flex-shrink: 0;
}
.photo-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--teal);
  border-radius: 4px;
  transform: translate(14px, 14px);
  z-index: -1;               /* behind img within isolated context */
  transition: transform 0.3s var(--ease);
  pointer-events: none;
}
.photo-wrapper:hover::after { transform: translate(8px, 8px); }

/* Teal colour overlay — disappears on hover */
.photo-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--teal);
  mix-blend-mode: multiply;
  opacity: 0.25;
  border-radius: 4px;
  z-index: 1;                /* in front of img */
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.photo-wrapper:hover::before { opacity: 0; }

.photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 4px;
  display: block;
  position: relative;        /* participates in stacking — sits above z:-1 ::after */
  z-index: 0;
  filter: grayscale(60%) contrast(1.1);
  transition: filter 0.3s ease;
}
.photo-wrapper:hover .photo-img { filter: none; }

/* ── EXPERIENCE TABS ── */
.exp-tabs { display: flex; gap: 2.5rem; }
.tab-list {
  display: flex;
  flex-direction: column;
  min-width: 130px;
  border-left: 2px solid var(--slate-dark);
  position: relative; /* needed for absolute indicator */
}

/* I: Sliding indicator — the real active marker */
.tab-indicator {
  position: absolute;
  left: -2px;
  top: 0;
  width: 2px;
  height: 42px; /* default, overridden by JS */
  background: var(--teal);
  border-radius: 1px;
  transition: top 0.25s var(--ease), height 0.25s var(--ease);
  z-index: 1;
}

.tab-btn {
  background: none;
  border: none;
  border-left: 2px solid transparent; /* keeps spacing — visual border from indicator */
  padding: 0.85rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
  margin-left: -2px;
  position: relative;
  z-index: 2;
}
.tab-btn:hover { color: var(--teal); background: var(--teal-tint); }
/* Active: teal text + tint bg — border handled by .tab-indicator */
.tab-btn.active { color: var(--teal); background: var(--teal-tint); }
.tab-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  z-index: 3;
}

/* ── Tab panel fade transition ── */
.tab-panels {
  position: relative;
  flex: 1;
  min-height: 280px; /* prevent layout jump when switching */
}

.tab-panel {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.tab-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Fade-out state */
.tab-panel--leaving {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Fade-in starting state (before rAF removes it) */
.tab-panel--entering {
  opacity: 0;
  transform: translateY(8px);
}

/* ── Project folder icons (v4-style) ── */
.project-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.project-folder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  cursor: default;
  transition: color 0.2s ease, transform 0.25s var(--ease);
}
.project-card:hover .project-folder-icon {
  transform: translateY(-2px);
}

.exp-role {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--slate-light);
  margin-bottom: 0.35rem;
  transition: color 0.2s ease;
}
.exp-company { color: var(--teal); font-weight: 400; }
.exp-company a {
  color: var(--teal);
  background: linear-gradient(var(--teal), var(--teal)) 0 100% / 0 1px no-repeat;
  transition: background-size 0.25s var(--ease);
}
.exp-company a:hover {
  background-size: 100% 1px;
}
.exp-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
  margin-bottom: 1rem;
}
.exp-bullets { display: flex; flex-direction: column; gap: 0.6rem; }
.exp-bullets li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--slate);
  font-size: 0.95rem;
  line-height: 1.7;
}
.exp-bullets li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--teal);
  font-size: 0.85rem;
  top: 1px;
}

.resume-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--teal);
  border-bottom: 1px solid transparent;
  margin-top: 2.5rem;
  transition: gap 0.25s var(--ease), border-color 0.2s ease, color 0.2s ease;
}
.resume-link:hover {
  border-color: var(--teal);
  gap: 0.7rem;
}
.resume-link span {
  display: inline-block;
  transition: transform 0.25s var(--ease);
}
.resume-link:hover span {
  transform: translate(3px, -3px);
}

/* ── FEATURED PROJECTS — alternating layout + visual panel (P0) ── */
.featured-projects {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  margin-bottom: 4rem;
}

.featured-project {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 0;
  position: relative;
  max-width: 100%;
  align-items: center;
}

.fp-image {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  min-height: 300px;
}
.fp-image-placeholder {
  width: 100%;
  height: 100%;
  min-height: 300px;
  background-color: var(--navy-light);
  background-image: radial-gradient(circle, var(--slate-dark) 1px, transparent 1px);
  background-size: 22px 22px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 4px;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.featured-project:hover .fp-image-placeholder {
  border-color: rgba(100, 255, 218, 0.15);
  background-color: var(--navy-lighter);
}
.fp-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.fp-content {
  position: relative;
  z-index: 2;
}

.featured-project:not(.fp-reverse) .fp-content {
  margin-left: -3rem;
  text-align: right;
}
.featured-project:not(.fp-reverse) .fp-tech {
  justify-content: flex-end;
}
.featured-project.fp-reverse {
  grid-template-columns: 2fr 3fr;
}
.featured-project.fp-reverse .fp-content {
  order: -1;
  margin-right: -3rem;
  text-align: left;
}
.featured-project.fp-reverse .fp-image {
  order: 1;
}

.fp-overline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--teal);
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
}

.fp-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 600;
  color: var(--slate-light);
  margin-bottom: 1rem;
  transition: color 0.18s ease;
  letter-spacing: -0.02em;
}
.featured-project:hover .fp-title { color: var(--teal); }

.fp-desc-box {
  background: var(--navy-light);
  border-radius: 4px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255,255,255,0.05);
  position: relative;
  z-index: 2;
  box-shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.featured-project:hover .fp-desc-box {
  border-color: rgba(100, 255, 218, 0.15);
}
.fp-desc-box p {
  font-size: 0.92rem;
  color: var(--slate);
  line-height: 1.8;
}
.fp-desc-box p + p { margin-top: 0.6rem; }

.fp-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.fp-tech li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--teal);
  background: var(--teal-tint);
  border: 1px solid rgba(100, 255, 218, 0.2);
  border-radius: 3px;
  padding: 0.25rem 0.65rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.featured-project:hover .fp-tech li {
  border-color: rgba(100, 255, 218, 0.35);
}

.other-projects-heading {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--slate);
  letter-spacing: 0.1em;
  text-align: center;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.other-projects-heading::before,
.other-projects-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--navy-light);
}

/* ── PROJECTS GRID (small cards) ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.project-card {
  background: var(--navy-light);
  border-radius: 4px;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s ease;
  cursor: default;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(100, 255, 218, 0.15);
}
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.project-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate-light);
  transition: var(--transition);
}
.project-card:hover .project-title { color: var(--teal); }
.project-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--teal);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.project-desc {
  font-size: 0.85rem;
  color: var(--slate);
  line-height: 1.7;
  flex: 1;
}
.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.project-tech li {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--slate);
}
.project-tech li:not(:last-child)::after { content: ' ·'; color: var(--slate-dark); margin-left: 0.5rem; }

/* ── SKILLS SECTION ── */
.skills-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}
.skill-group-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--teal);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.skill-tags li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
  background: var(--navy-light);
  border: 1px solid var(--slate-dark);
  border-radius: 3px;
  padding: 0.3rem 0.8rem;
  transition: transform 0.2s var(--ease), border-color 0.2s ease, color 0.2s ease;
}
.skill-tags li:hover {
  transform: translateY(-2px);
  border-color: rgba(100, 255, 218, 0.35);
  color: var(--slate-light);
}

/* Certs */
.certs-section, .seminars-section {
  margin-bottom: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--navy-light);
}
.cert-list { display: flex; flex-direction: column; gap: 0.5rem; }

/* Base cert row: dot · body (org+name stacked) · arrow */
.cert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.cert-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}
.cert-dot { color: var(--teal); font-size: 0.8rem; flex-shrink: 0; padding-top: 0.1rem; }
.cert-org {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--teal);
  letter-spacing: 0.04em;
  line-height: 1.3;
}
.cert-name {
  color: var(--slate);
  font-size: 0.88rem;
  line-height: 1.4;
  transition: color 0.2s ease;
}

/* Linked cert items */
.cert-item--link {
  text-decoration: none;
  border-radius: 4px;
  padding: 0.45rem 0.5rem;
  margin: -0.45rem -0.5rem;
  transition: background 0.2s ease, transform 0.2s var(--ease);
}
.cert-item--link:hover {
  background: var(--teal-tint);
  transform: translateX(4px);
}
.cert-item--link:hover .cert-name {
  color: var(--slate-light);
}
.cert-arrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--teal);
  opacity: 0;
  flex-shrink: 0;
  align-self: center;
  transition: opacity 0.2s ease, transform 0.2s var(--ease);
}
.cert-item--link:hover .cert-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

.seminar-item { align-items: flex-start; }
.seminar-title { color: var(--slate-light); font-size: 0.9rem; line-height: 1.5; margin-bottom: 0.25rem; }
.seminar-org {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
  line-height: 1.5;
}
.seminar-year {
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

/* ── CONTACT ── */
.contact-section {
  text-align: left;
  max-width: 760px;
  justify-content: flex-start;
  align-items: flex-start;
}
.contact-body {
  color: var(--slate-light);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 620px;
}

/* ── Contact form ── */
.contact-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
}
.form-input {
  background: var(--navy-light);
  border: 1px solid var(--slate-dark);
  border-radius: 4px;
  padding: 0.8rem 1rem;
  color: var(--slate-light);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  resize: none;
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--slate-dark); }
.form-input:hover {
  border-color: var(--slate);
}
.form-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(100, 255, 218, 0.08);
}
.form-textarea { min-height: 130px; line-height: 1.6; }

.form-footer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.form-submit {
  flex-shrink: 0;
}
.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.form-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
}
.form-status--success { color: var(--teal); }
.form-status--error   { color: #ff6b6b; }

.contact-details {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.contact-detail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate);
  transition: var(--transition);
}
.contact-detail-item:hover { color: var(--teal); transform: translateY(-2px); }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--teal);
  background: transparent;
  border: 1px solid var(--teal);
  border-radius: 4px;
  padding: 1rem 2rem;
  letter-spacing: 0.08em;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--teal-tint);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(100, 255, 218, 0.08);
}
.btn-primary:active {
  transform: translateY(-1px) scale(0.99);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

/* ════════════════════════════════
   RESPONSIVE — Tablet
════════════════════════════════ */
@media (max-width: 1080px) {
  :root { --panel-w: 260px; }
  .right-panel { padding: 0 2.5rem; }
  .left-panel { padding: 0 2rem; }
  .lp-name { font-size: 2rem; }
  .lp-title { font-size: 1.2rem; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-project { grid-template-columns: 1fr; gap: 1rem; }
  .featured-project .fp-image { display: none; }
  .featured-project:not(.fp-reverse) .fp-content {
    margin-left: 0;
    text-align: left;
  }
  .featured-project:not(.fp-reverse) .fp-tech {
    justify-content: flex-start;
  }
  .featured-project.fp-reverse { grid-template-columns: 1fr; }
  .featured-project.fp-reverse .fp-content {
    margin-right: 0;
    order: unset;
  }
  .featured-project.fp-reverse .fp-image { order: unset; }
}

/* ════════════════════════════════
   RESPONSIVE — Mobile (≤ 900px)
   Covers: all portrait phones, AND
   landscape phones (iPhone 14 = 844px,
   Samsung S23 = 915px landscape).
   Layout collapses: left panel hides,
   mobile header appears, hero shown.
════════════════════════════════ */
@media (max-width: 900px) {
  /* One value for bar height: drawer starts below header (fixes top clip under z-stacked header) */
  :root {
    /* Drawer + scroll-padding: clears fixed header (bar ≈ safe area + ~70px content) */
    --mobile-header-h: calc(4.75rem + env(safe-area-inset-top, 0px));
  }

  html {
    scroll-padding-top: var(--mobile-header-h);
  }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    min-height: 70px;
    box-sizing: border-box;
    padding: max(0.75rem, env(safe-area-inset-top)) 1.5rem 0.75rem;
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    background: rgba(10, 25, 47, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: box-shadow 0.3s ease;
  }
  .mobile-header.scrolled { box-shadow: 0 10px 30px rgba(2, 12, 27, 0.7); }

  .mobile-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--teal);
    letter-spacing: -0.02em;
    text-decoration: none;
  }

  /* Hamburger */
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 201;
    border-radius: 4px;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
  }
  .hamburger:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
  }
  .hamburger span {
    display: block;
    height: 2px;
    background: var(--teal);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
  }
  .hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.is-open span:nth-child(2) { opacity: 0; }
  .hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Drawer below header so it isn’t covered; scroll if content is tall */
  .mobile-nav {
    position: fixed;
    top: var(--mobile-header-h);
    right: 0;
    width: min(78vw, 320px);
    height: calc(100dvh - var(--mobile-header-h));
    max-height: calc(100svh - var(--mobile-header-h));
    background: var(--navy-light);
    z-index: 199;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    box-shadow: -12px 0 40px rgba(2, 12, 27, 0.5);
    border-left: 1px solid rgba(100, 255, 218, 0.06);
    overflow: hidden;
    overscroll-behavior: contain;
  }
  .mobile-nav.is-open { transform: translateX(0); }

  .mobile-nav__inner {
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.25rem;
    padding: 1.75rem 1.5rem max(1.75rem, env(safe-area-inset-bottom));
  }

  .mobile-nav ol {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    text-align: center;
    width: 100%;
  }
  .mobile-nav li {
    opacity: 0;
    transform: translateX(14px);
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  }
  .mobile-nav.is-open li {
    opacity: 1;
    transform: translateX(0);
  }
  .mobile-nav.is-open li:nth-child(1) { transition-delay: 0.04s; }
  .mobile-nav.is-open li:nth-child(2) { transition-delay: 0.08s; }
  .mobile-nav.is-open li:nth-child(3) { transition-delay: 0.12s; }
  .mobile-nav.is-open li:nth-child(4) { transition-delay: 0.16s; }
  .mobile-nav.is-open li:nth-child(5) { transition-delay: 0.2s; }
  .mobile-nav.is-open .btn-resume {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.26s;
  }
  .mobile-nav .btn-resume {
    opacity: 0;
    transform: translateX(14px);
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), background 0.2s ease, border-color 0.2s ease;
  }

  .mobile-nav a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--slate-light);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: center;
    transition: color 0.2s ease, transform 0.2s var(--ease);
  }
  .mobile-nav a span { color: var(--teal); font-size: 0.75rem; }
  .mobile-nav a:hover,
  .mobile-nav a:focus-visible {
    color: var(--teal);
  }
  .btn-resume {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--teal);
    border: 1px solid var(--teal);
    border-radius: 4px;
    padding: 0.85rem 2rem;
    transition: var(--transition);
    text-decoration: none;
  }
  .btn-resume:hover { background: var(--teal-tint); }

  /* Overlay: full screen; drawer sits above at z-199 */
  .mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 25, 47, 0.65);
    z-index: 198;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .mobile-nav-overlay.is-open { opacity: 1; pointer-events: auto; }

  /* Hide desktop left panel */
  .left-panel { display: none; }

  /* Right panel full width */
  .right-panel {
    margin-left: 0;
    padding: 0 max(1.25rem, env(safe-area-inset-right)) 0 max(1.25rem, env(safe-area-inset-left));
    max-width: 100%;
    padding-top: var(--mobile-header-h);
  }

  /* Show hero on mobile */
  .hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 3rem;
    gap: 0;
  }
  .hero-greeting {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--teal);
    margin-bottom: 1.2rem;
  }
  .hero-name {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 10vw, 4.5rem);
    font-weight: 600;
    color: var(--slate-light);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
  }
  .hero-sub {
    font-size: clamp(1.4rem, 5vw, 2.5rem);
    font-weight: 600;
    color: var(--slate);
    margin-bottom: 1.5rem;
    line-height: 1.2;
  }
  .hero-bio {
      font-size: 0.95rem;
      color: var(--slate);
      line-height: 1.7;
      max-width: 480px;
      margin-bottom: 1.35rem;
    }

  /* ── Consistent section spacing — every section identical ── */
  .section { padding: 4rem 0; min-height: auto; }
  .hero-section { padding-top: 2.5rem; padding-bottom: 3rem; min-height: 85svh; }
  .section-heading { font-size: 1.4rem; margin-bottom: 1.5rem; white-space: normal; }
  .section-heading::after { width: 80px; }

  /* Resume button — compact, not full-width */
  .hero-section .btn-primary {
    align-self: flex-start;
    max-width: 260px;
    width: auto;
  }

  /* ── About: mobile layout ── */
  /* Mobile photo sits above heading — centred */
  .about-photo-mobile {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1.75rem;
  }
  /* Hide desktop photo column entirely */
  .about-photo { display: none; }
  /* Heading row is now standalone — restore its full width */
  .about-header {
    align-items: center;
    margin-bottom: 1.5rem;
  }
  .about-header .section-heading {
    margin-bottom: 0;
    white-space: normal;
  }
  .about-header .section-heading::after { display: none; }
  /* Grid: single column for text */
  .about-grid {
    display: block;
    margin-top: 0;
  }
  .about-text { order: unset; }

  /* ── Experience: breathing room between tabs and content ── */
  .exp-tabs { flex-direction: column; gap: 0; }
  .tab-panels { padding-top: 1.25rem; min-height: unset; }
  .tab-list {
    flex-direction: row;
    border-left: none;
    border-bottom: 2px solid var(--slate-dark);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tab-btn {
    border-left: none;
    border-bottom: 2px solid transparent;
    margin-left: 0;
    margin-bottom: -2px;
    padding: 0.75rem 1rem;
    white-space: nowrap;
  }
  .tab-btn.active { border-bottom-color: var(--teal); border-left: none; }
  .tab-indicator { display: none; }

  .projects-grid { grid-template-columns: 1fr; }
  .featured-projects { gap: 2.5rem; }
  .featured-project { grid-template-columns: 1fr; gap: 0; }
  .featured-project .fp-image { display: none; }
  /* Reset all content alignment — everything left-aligned on mobile */
  .featured-project:not(.fp-reverse) .fp-content,
  .featured-project.fp-reverse .fp-content {
    margin-left: 0;
    margin-right: 0;
    text-align: left;
    order: unset;
  }
  .featured-project:not(.fp-reverse) .fp-tech,
  .featured-project.fp-reverse .fp-tech {
    justify-content: flex-start;
  }
  .featured-project.fp-reverse { margin-left: 0; }
  .skills-section { grid-template-columns: 1fr; gap: 2rem; }
  .cert-item { gap: 0.6rem; }
  .contact-section { text-align: left; align-items: flex-start; }
  .form-row { grid-template-columns: 1fr; }
  .form-footer { flex-direction: column; align-items: flex-start; }
}

/* ── Entrance animations ── */
.fade-up {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease),
              transform 0.5s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Respect user motion preferences ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .page-loader { display: none; }
  body.is-loading .layout,
  body.is-loading .mobile-header,
  body.is-loading .side-rail,
  body.is-loading .scroll-progress {
    visibility: visible;
  }
  .side-rail {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  .mobile-nav li,
  .mobile-nav .btn-resume {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .tab-indicator { transition: none; }
  .section-heading, .section-heading::after { transition: none; }
  .scroll-progress { display: none; }
  body::after { display: none; }
}

/* ════════════════════════════════════════
   FOOTER — clean, minimal
════════════════════════════════════════ */

.footer {
  padding: 3rem 0 4rem;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.04);
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.footer__socials {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--slate-dark);
  border-radius: 50%;
  transition: color 0.2s ease, transform 0.2s ease;
}
.footer__social:hover {
  color: var(--teal);
  transform: translateY(-3px);
}

.footer__credit {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--slate-dark);
  letter-spacing: 0.04em;
  transition: color 0.25s ease;
}
.footer__name {
  color: var(--teal);
  transition: color 0.2s ease;
}
.footer__credit:hover {
  color: var(--slate);
}
.footer__credit:hover .footer__name {
  color: var(--teal-muted);
}

/* ════════════════════════════════════════
   CONTENT UPDATE ADDITIONS
════════════════════════════════════════ */.exp-note {
  font-size: 0.875rem;
  color: var(--teal);
  font-style: italic;
  margin-top: 1.25rem;
  padding: 0.65rem 0.85rem;
  border-left: 2px solid var(--teal);
  background: var(--teal-tint);
  border-radius: 0 3px 3px 0;
}
.fp-desc-box p.fp-note {
  font-size: 0.875rem;
  color: var(--teal);
  font-style: italic;
  margin-top: 1.25rem;
  padding: 0.65rem 0.85rem;
  border-left: 2px solid var(--teal);
  background: var(--teal-tint);
  border-radius: 0 3px 3px 0;
  line-height: 1.7;
}

/* ════════════════════════════════════════
   CONTENT UPDATE ADDITIONS
════════════════════════════════════════ */


