/* ============================================================
   JIANI LIU PORTFOLIO — Calm Editorial Sage Theme
   ============================================================ */

/* ── VARIABLES ───────────────────────────────────────────────── */
:root {
  --font-serif: 'Cormorant Garamond', 'DM Serif Display', Georgia, serif;
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* ── Color palette ── */
  --bg:              #F7F6F3;
  --bg-2:            #F1F3EE;
  --bg-3:            #DCE8DA;
  --sage-accent:     #DCE8DA;
  --sage-mid:        #BFD3C2;
  --sage-dark:       #46774C;   /* darkened: 4.80:1 on bg-2; white text 5.36:1 as bg */
  --hero-start:      #8FD3CC;
  --hero-end:        #BFE6D8;
  --border:          #D9DDD6;
  --border-soft:     rgba(217,221,214,0.5);
  --tx-light:        #5C6D60;   /* darkened: 4.95:1 on bg-2, 5.53:1 on white */
  --tx:              #4B4F4B;
  --tx-dark:         #232826;
  --btn-dark:        #2F3431;
  --btn-dark-h:      #1F2421;
  --btn-sec:         #EEF2EC;
  --btn-sec-h:       #E3E8E0;
  --white:           #FFFFFF;
  --glass-tint:      rgba(220, 232, 218, 0.65);
  --charcoal:        #475651;

  /* ── Layout ── */
  --max:    1160px;
  --pad:    0 24px;
  --sec-py: 96px;
  --nav-h:  64px;

  /* ── Radii ── */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --r-2xl: 28px;
  --r-3xl: 36px;
  --r-f:   9999px;

  /* ── Shadows (charcoal-tinted, not pure black) ── */
  --sh-xs: 0 1px 4px rgba(35,40,38,0.04);
  --sh-sm: 0 4px 18px rgba(35,40,38,0.07);
  --sh-md: 0 12px 36px rgba(35,40,38,0.09);
  --sh-lg: 0 24px 60px rgba(35,40,38,0.13);

  /* ── Easing ── */
  --ease:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-b: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--tx);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
h1, h2, h3 { font-family: var(--font-serif); color: var(--tx-dark); }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; border: none; background: none; cursor: pointer; }

/* ── LAYOUT ──────────────────────────────────────────────────── */
.container { max-width: var(--max); margin-inline: auto; padding: var(--pad); }
.section   { padding: var(--sec-py) 0; contain: layout style; }

/* ── SECTION LABELS ──────────────────────────────────────────── */
.section-label {
  display: inline-block; font-family: var(--font-sans);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase; margin-bottom: 10px;
}
.label--sage  { color: var(--sage-dark); }
.label--dim   { color: var(--tx-light); }
.label--inv   { color: var(--sage-dark); }
.label--light   { color: var(--white); }

/* ── SECTION HEADINGS ─────────────────────────────────────────── */
.section-heading {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--tx-dark);
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 22px; border-radius: var(--r-f);
  font-family: var(--font-sans);
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  min-height: 44px; /* WCAG 2.5.8 touch target */
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease, background 0.2s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }

/* Primary — dark charcoal pill */
.btn--primary {
  background: var(--btn-dark); color: var(--white);
  box-shadow: 0 2px 14px rgba(47,52,49,0.20);
}
.btn--primary:hover {
  background: var(--btn-dark-h);
  box-shadow: 0 6px 22px rgba(47,52,49,0.28);
}

/* Outline-inv — ghost for hero (light gradient bg) */
.btn--outline-inv {
  background: rgba(35,40,38,0.06); color: var(--tx-dark);
  border: 1px solid rgba(35,40,38,0.14);
}
.btn--outline-inv:hover {
  background: rgba(35,40,38,0.11);
  border-color: rgba(35,40,38,0.24);
}

/* Secondary */
.btn--secondary {
  background: var(--btn-sec); color: var(--btn-dark);
}
.btn--secondary:hover { background: var(--btn-sec-h); }

/* ── NAV ─────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 24px;
  transform: translateZ(0);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.nav__inner {
  max-width: var(--max); margin-inline: auto;
  height: var(--nav-h); display: flex; align-items: center;
}
.nav__logo-mark {
  display: inline-flex; align-items: center;
  margin-right: 36px; flex-shrink: 0;
  border-radius: var(--r-sm);
  transition: opacity 0.2s ease;
}
.nav__logo-mark:hover { opacity: 0.80; }
.nav__logo-img {
  width: 36px; height: 36px;
  object-fit: contain; display: block;
  border-radius: var(--r-sm);
}
.nav__links { display: flex; gap: 2px; flex: 1; }
.nav__link {
  padding: 7px 13px; font-size: 13.5px; font-weight: 400;
  color: var(--tx); border-radius: var(--r-md);
  transition: color 0.15s ease, background 0.15s ease;
}
.nav__link:hover { color: var(--tx-dark); background: rgba(35,40,38,0.05); }
.nav__actions { margin-left: 20px; }
.nav__cta {
  display: inline-flex; align-items: center;
  background: var(--btn-dark); color: var(--white);
  padding: 4px 14px; font-size: 12.5px; font-weight: 500; border-radius: var(--r-f);
  min-height: 28px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.nav__cta:hover { background: var(--btn-dark-h); }

/* Frosted glass on scroll */
.nav.is-scrolled {
  background: rgba(247, 246, 243, 0.6);
  backdrop-filter: blur(15px) saturate(150%);
  -webkit-backdrop-filter: blur(15px) saturate(150%);
}
.nav.is-scrolled .nav__link      { color: var(--tx); }
.nav.is-scrolled .nav__link:hover { color: var(--tx-dark); background: var(--bg-2); }

/* Mobile burger */
.nav__hamburger {
  display: none; flex-direction: column; gap: 5px;
  padding: 8px; margin-left: auto; cursor: pointer; border-radius: var(--r-sm);
}
.nav__hamburger span {
  display: block; width: 22px; height: 1.5px;
  background: var(--tx-dark); border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav__mobile-menu {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 99;
  background: rgba(247, 246, 243, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px 20px; flex-direction: column; gap: 4px;
}
.nav__mobile-menu.is-open { display: flex; }
.nav__mobile-link {
  padding: 12px 14px; font-size: 15px; font-weight: 400;
  color: var(--tx); border-radius: var(--r-lg);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav__mobile-link:hover { background: var(--bg-2); color: var(--tx-dark); }
.nav__mobile-cta { margin-top: 8px; margin-right: 8px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ── HERO ─────────────────────────────────────────────────────── */
.section--hero {
  position: relative; overflow: hidden;
  min-height: 95vh; display: flex; align-items: center;
  padding: 0;
  /* Shell edge — lower-right only, prominently wave-like */
  border-radius: 0 0 clamp(80px, 11vw, 140px) 0;
}

/* View window — fixed background, slides open left→right on load, scrolls with section */
.hero__bg {
  position: absolute; inset: 0;
  /* Image declared via inline style in JS; fixed keeps it viewport-anchored while the section scrolls */
  background-size: cover;
  background-position: center 40%;
  background-attachment: fixed;
  filter: saturate(0.82) brightness(1.02);
  will-change: clip-path;
  /* Shell curve on lower-right — the view-window edge — visible throughout the slide */
  clip-path: inset(0 100% 0 0 round 0 0 88px 0);
  animation: heroBgWipe 2.6s var(--ease) forwards;
}
.hero__bg--gradient {
  background: linear-gradient(148deg, var(--hero-start) 0%, var(--hero-end) 100%);
  background-attachment: fixed;
}
/* Soft left-to-right tint — keeps text readable, waves visible on right */
.hero__bg-tint {
  position: absolute; inset: 0;
  
  background: linear-gradient(
    95deg,
    rgba(224, 236, 228, 0.50) 0%,
    rgba(224, 236, 228, 0.18) 50%,
    rgba(224, 236, 228, 0.04) 72%,
    transparent 100%
  );
}

/* Spanning glass panel — left edge anchored, height driven by content */
.hero__panel {
  position: absolute;
  top: 50%; left: 0;
  transform: translateY(-50%);
  width: 60vw;
  min-width: 1200px;
  background: rgba(247, 246, 243, 0.1);
  backdrop-filter: blur(26px) saturate(138%);
  -webkit-backdrop-filter: blur(26px) saturate(138%);
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.70),
    0 0 80px rgba(35, 40, 38, 0.10),
    0 4px 24px rgba(35, 40, 38, 0.07);
  z-index: 2;
  /* Shell curve on upper-right and lower-right via clip-path — animates the right edge expanding */
  clip-path: inset(0 100% 0 0 round 0 88px 88px 0);
  animation: heroPanelExpand 2.4s var(--ease) 0.18s forwards;
}

/* Content drives the panel height */
.hero__panel-content {
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 24px 60px max(calc((100vw - var(--max)) / 2 + 24px), 24px);
}

.hero__greeting {
  font-family: var(--font-sans);
  font-size: clamp(16px, 2vw, 22px); font-weight: 400;
  color: rgba(35,40,38,0.70); margin-bottom: 15px;
}

.hero__name {
  font-family: var(--font-serif);
  font-size: clamp(60px, 10vw, 70px); font-weight: 600;
  letter-spacing: -0.025em; line-height: 0.90; color: var(--tx-dark);
  margin-bottom: 15px;
}

.hero__title {
  font-family: var(--font-sans);
  font-size: clamp(15px, 1.8vw, 19px); font-weight: 500;
  color: rgba(35,40,38,0.82); letter-spacing: -0.01em;
  margin-bottom: 15px;
}

.hero__tagline {
  font-family: var(--font-sans);
  font-size: clamp(14.5px, 1.45vw, 16.5px); line-height: 1.78;
  color: rgba(35,40,38,0.72); max-width: 500px; margin-bottom: 25px;
}
.hero__ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }

/* Icon-only social pills */
.hero__social { display: flex; gap: 8px; flex-wrap: wrap; }
.hero__social-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; /* WCAG 2.5.8 touch target */
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.hero__social-link:hover { opacity: 0.75; transform: translateY(-1px); }
.hero__social-icon {
  font-size: 12px; font-style: normal;
  background: rgba(255,255,255,0.50);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.60);
  border-radius: 8px; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--tx-dark);
  box-shadow: 0 1px 4px rgba(35,40,38,0.06);
}

/* Hero entrance keyframes */
/* View window sweeps left → right; shell curve rides along the whole way */
@keyframes heroBgWipe {
  from { clip-path: inset(0 100% 0 0 round 0 0 88px 0); }
  to   { clip-path: inset(0 0%   0 0 round 0 0 88px 0); }
}
/* Panel right edge sweeps left → right, shell curve visible throughout */
@keyframes heroPanelExpand {
  from { clip-path: inset(0 100% 0 0 round 0 88px 88px 0); }
  to   { clip-path: inset(0 0%   0 0 round 0 88px 88px 0); }
}
@keyframes heroFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Scroll indicator */
.hero__scroll {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: rgba(35,40,38,0.30); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  animation: heroBounce 2.8s ease-in-out infinite;
}
.hero__scroll-arrow {
  width: 11px; height: 11px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
@keyframes heroBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: .4; }
  50%       { transform: translateX(-50%) translateY(7px); opacity: .72; }
}

/* ── PROJECTS ─────────────────────────────────────────────────── */
.section--projects { background: var(--bg-2); }

.projects__header { margin-bottom: 52px; }

.projects__grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}

/* Project card — shadow-only surface, no border framing */
.project-card {
  background: var(--white);
  border-radius: var(--r-xl); overflow: hidden;
  box-shadow: var(--sh-sm);
}

.project-card__thumb {
  aspect-ratio: 16/10; position: relative; overflow: hidden;
}
.project-card__thumb-img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.45s var(--ease);
}
.project-card:hover .project-card__thumb-img { transform: scale(1.03); }

.project-card__thumb-bg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.40);
}

/* Frosted glass badge */
.project-card__badge {
  position: absolute; top: 12px; right: 12px;
  background: rgba(247,246,243,0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--tx-dark);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: var(--r-f);
  padding: 3px 9px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
}

.project-card__body { padding: 22px 24px 24px; }

.project-card__name {
  font-family: var(--font-serif);
  font-size: 21px; font-weight: 600; color: var(--tx-dark);
  letter-spacing: -0.01em; margin-bottom: 8px; line-height: 1.22;
}
.project-card__detail {
  font-size: 13px; line-height: 1.66; color: var(--tx-light);
  margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.project-card__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 16px; }
.project-card__tag {
  font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: var(--r-f);
  background: var(--sage-accent); color: var(--tx);
  letter-spacing: 0.02em;
}
.project-card__links { display: flex; gap: 8px; }

.project-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; padding: 11px 16px; border-radius: var(--r-f);
  min-height: 44px; /* WCAG 2.5.8 touch target */
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.project-link--demo {
  background: var(--sage-accent); color: var(--tx-dark);
}
.project-link--demo:hover { background: #C8D9CB; }
.project-link--code {
  background: transparent; color: var(--tx-light);
  border: 1px solid var(--border);
}
.project-link--code:hover { background: var(--bg-2); color: var(--tx); }

/* ── PROJECT CARD ENTRANCE ANIMATION ─────────────────────────── */
.project-card {
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transition:
    opacity   0.45s var(--ease) calc(var(--i, 0) * 90ms),
    transform 0.45s var(--ease) calc(var(--i, 0) * 90ms);
}
.project-card.card-visible { opacity: 1; transform: none; }
.project-card.card-settled {
  transition:
    transform    0.25s ease,
    box-shadow   0.25s ease,
    border-color 0.25s ease;
}
.project-card.card-settled:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-md);
}

/* ── EXPERIENCE ───────────────────────────────────────────────── */
.section--experience { background: var(--bg-2); }

.experience__header { margin-bottom: 52px; }

/* Timeline layout */
.experience__list {
  position: relative;
  padding-left: 36px;
  display: flex; flex-direction: column; gap: 16px;
}

/* Vertical line */
.experience__list::before {
  content: '';
  position: absolute; left: 8px; top: 20px; bottom: 20px; width: 1px;
  background: linear-gradient(to bottom, var(--sage-mid), rgba(191,211,194,0.12));
  transform-origin: top center;
  transform: scaleY(0);
  transition: transform 1.2s var(--ease);
}
.experience__list.line-visible::before { transform: scaleY(1); }

/* Experience card — shadow surface, no persistent border */
.exp-card {
  background: var(--white); border-radius: var(--r-xl);
  padding: 28px 30px 24px; position: relative;
  opacity: 0; transform: translateX(-20px);
  box-shadow: var(--sh-sm);
  transition:
    opacity   0.5s var(--ease) calc(var(--i, 0) * 140ms),
    transform 0.5s var(--ease) calc(var(--i, 0) * 140ms);
}
.exp-card.card-visible { opacity: 1; transform: none; }
.exp-card.card-settled {
  transition: box-shadow 0.2s ease;
}
.exp-card.card-settled:hover {
  box-shadow: var(--sh-sm);
}

/* Timeline dot */
.exp-card::before {
  content: '';
  position: absolute; left: -32px; top: 22px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--sage-mid);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px rgba(191,211,194,0.30);
  transform: scale(0);
  transition: transform 0.4s var(--ease-b) calc(var(--i, 0) * 140ms + 180ms);
}
.exp-card.card-visible::before { transform: scale(1); }

.exp-card__top {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 10px; margin-bottom: 4px;
}
.exp-card__company {
  font-family: var(--font-serif);
  font-size: 23px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--tx-dark); line-height: 1.15;
}
.exp-card__role {
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 400; color: var(--tx-light); margin-top: 3px;
}

.exp-card__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.exp-card__period {
  font-size: 12px; font-weight: 400; color: var(--tx-light);
  font-variant-numeric: tabular-nums;
}
.exp-card__type {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 8px; border-radius: var(--r-f);
  color: var(--tx); background: var(--sage-accent);
}
.exp-card__type--full-time { background: rgba(245,158,11,0.10); color: #92400E; } /* was #d97706: 3.26:1 FAIL */
.exp-card__type--volunteer  { background: rgba(16,185,129,0.10); color: #047857; } /* was #10b981: 2.66:1 FAIL */

.exp-card__location {
  font-size: 12px; color: var(--tx-light); margin-bottom: 18px;
  display: flex; align-items: center; gap: 4px;
}

.exp-card__bullets { display: flex; flex-direction: column; gap: 9px; padding-left: 0; }
.exp-card__bullet {
  font-size: 13.5px; line-height: 1.70; color: var(--tx);
  padding-left: 16px; position: relative;
}
.exp-card__bullet::before {
  content: '–'; position: absolute; left: 0;
  color: var(--sage-dark); font-size: 12px; top: 1px;
}

/* ── SKILLS ───────────────────────────────────────────────────── */
.section--skills { background: var(--bg); }
.skills__header  { margin-bottom: 48px; }
.skills__grid    { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* Skill category — glass-soft class applied in JS, override radius/padding */
.skill-category {
  border-radius: var(--r-xl) !important;
  padding: 28px;
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}
.skill-category:hover { box-shadow: 0 12px 32px rgba(35,40,38,0.09) !important; transform: translateY(-2px); }

.skill-category__header { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.skill-category__dot    { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.skill-category__name   {
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--tx-light);
}

.skill-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-chip {
  font-size: 12.5px; font-weight: 400; padding: 5px 12px; border-radius: var(--r-f);
  background: var(--bg-2); color: var(--tx);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  cursor: default;
}
.skill-chip:hover {
  background: var(--sage-accent); color: var(--tx-dark);
  transform: translateY(-1px);
}

/* ── ABOUT ────────────────────────────────────────────────────── */
.section--about { background: var(--bg); }

.about__grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 72px; align-items: start;
}
.about__bio-heading { margin-bottom: 24px; }
.about__bio p {
  font-family: var(--font-sans);
  font-size: clamp(14.5px, 1.4vw, 16.5px); line-height: 1.82;
  color: var(--tx); margin-bottom: 18px;
}
.about__bio p:last-child { margin-bottom: 0; }

.about__edu-heading {
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--tx-light); margin-bottom: 18px;
}

/* ── ABOUT TIMELINE ────────────────────────────────────────────── */
.about-timeline {
  position: relative;
  padding-left: 28px;
  display: flex; flex-direction: column; gap: 0;
}
.about-timeline::before {
  content: '';
  position: absolute; left: 6px; top: 14px; bottom: 14px; width: 1px;
  background: linear-gradient(to bottom, var(--sage-mid), rgba(191,211,194,0.15));
}

.about-tl-item {
  position: relative;
  padding-bottom: 14px;
}
.about-tl-item:last-child { padding-bottom: 0; }

.about-tl-dot {
  position: absolute; left: -25px; top: 15px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--sage-mid);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 3px rgba(191,211,194,0.30);
}

.about-tl-card {
  padding: 14px 16px; border-radius: var(--r-lg);
  background: rgba(255,255,255,0.55);
  box-shadow: 0 1px 8px rgba(35,40,38,0.05);
  transition: box-shadow 0.2s ease;
}
.about-tl-card:hover { box-shadow: var(--sh-sm); }

.about-tl-card__top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  margin-bottom: 3px;
}
.about-tl-card__org {
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 600; color: var(--tx-dark); line-height: 1.2;
}
.about-tl-card__detail {
  font-family: var(--font-sans);
  font-size: 13px; color: var(--tx-light); font-weight: 400; margin-top: 2px;
}
.about-tl-card__period {
  font-family: var(--font-sans);
  font-size: 11.5px; color: var(--tx-light); margin-top: 5px;
}

.about-tl-badge {
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 2px 7px; border-radius: 20px;
  white-space: nowrap; flex-shrink: 0; margin-top: 2px;
}
.about-tl-badge--education { background: rgba(99,102,241,0.10); color: #4338CA; } /* was #6366f1: 4.38:1 FAIL */
.about-tl-badge--volunteer  { background: rgba(16,185,129,0.10); color: #047857; } /* was #10b981: 2.66:1 FAIL */
.about-tl-badge--full-time { background: rgba(245,158,11,0.10);  color: #92400E; } /* was #d97706: 3.26:1 FAIL */

/* ── CONTACT ──────────────────────────────────────────────────── */
.section--contact {
  background: var(--sage-dark);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  text-align: center;
  padding: 112px 0 96px;
  position: relative; overflow: hidden;
}
/* Atmospheric orbs — echoes the hero palette quietly */
.section--contact::before {
  content: '';
  position: absolute; top: -20%; left: -8%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(143,211,204,0.08) 0%, transparent 62%);
  filter: blur(40px);
  pointer-events: none;
}
.section--contact::after {
  content: '';
  position: absolute; bottom: -18%; right: -5%;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(191,230,216,0.07) 0%, transparent 62%);
  filter: blur(40px);
  pointer-events: none;
}

.contact__inner {
  max-width: 580px; margin-inline: auto; padding: var(--pad);
  position: relative; z-index: 1;
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.glass-soft {
  background: rgba(255,255,255,0.52);
  backdrop-filter: blur(16px) saturate(115%);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.60),
    0 8px 28px rgba(35,40,38,0.07);
  border-radius: 22px;
}

.contact__glass {
  width: min(720px, 100%);
  padding: 2rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.contact__heading {
  font-family: var(--font-serif);
  font-size: clamp(34px, 5.5vw, 60px); font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.04; color: var(--white);
  margin-bottom: 16px;
}
.contact__body {
  font-family: var(--font-sans);
  font-size: 15.5px; line-height: 1.68; color: rgba(255,255,255,0.9);
  max-width: 400px; margin: 0 auto 38px;
}
.contact__links { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }

.contact__link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 20px; border-radius: var(--r-f);
  font-size: 13.5px; font-weight: 500;
  min-height: 44px; /* WCAG 2.5.8 touch target */
  transition: background 0.2s ease, border-color 0.2s ease, color 0.15s ease, transform 0.2s ease;
}
.contact__link:hover { transform: translateY(-1px); }
.contact__link--primary {
  background: var(--white); color: var(--charcoal);
  box-shadow: 0 2px 14px rgba(255,255,255,0.10);
}
.contact__link--primary:hover {
  background: rgba(255,255,255,0.93);
  box-shadow: 0 6px 24px rgba(255,255,255,0.16);
}
.contact__link--secondary {
  background: transparent; color: rgba(255,255,255,0.80);
  border: 1px solid rgba(255,255,255,0.18);
}
.contact__link--secondary:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.30);
  color: rgba(255,255,255,0.95);
}

.contact__link-icon {
  font-size: 11px; font-style: normal;
  background: rgba(255,255,255,0.08); border-radius: 4px;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── FOOTER ──────────────────────────────────────────────────── */
.footer {
  background: var(--charcoal); border-top: 1px solid rgba(255,255,255,0.05);
  padding: 28px 24px;
}
.footer__inner {
  max-width: var(--max); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.footer__left  { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer__name  {
  font-family: var(--font-serif);
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.55);
}
.footer__links { display: flex; gap: 14px; }
.footer__link  { font-size: 12px; color: rgba(255,255,255,0.72); transition: color 0.15s ease; }
.footer__link:hover { color: rgba(255,255,255,0.95); }
.footer__right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.footer__social { display: flex; gap: 12px; }
.footer__social-link { font-size: 12px; color: rgba(255,255,255,0.72); transition: color 0.15s ease; }
.footer__social-link:hover { color: rgba(255,255,255,0.95); }
.footer__copyright { font-size: 12px; color: rgba(255,255,255,0.40); }

/* ── GENERIC SCROLL ANIMATIONS ─────────────────────────────────── */
.anim {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.6s var(--ease) var(--delay, 0s), transform 0.6s var(--ease) var(--delay, 0s);
}
.anim.is-visible { opacity: 1; transform: translateY(0); }

.anim-left {
  opacity: 0; transform: translateX(-26px);
  transition: opacity 0.6s var(--ease) var(--delay, 0s), transform 0.6s var(--ease) var(--delay, 0s);
}
.anim-left.is-visible { opacity: 1; transform: translateX(0); }

.anim-right {
  opacity: 0; transform: translateX(26px);
  transition: opacity 0.6s var(--ease) var(--delay, 0s), transform 0.6s var(--ease) var(--delay, 0s);
}
.anim-right.is-visible { opacity: 1; transform: translateX(0); }

/* Hero content items — no additional animation; content rides with the panel */
.hero-in { opacity: 1; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hero__bg { opacity: 1 !important; transform: none !important; }
  .hero__panel { opacity: 1 !important; transform: none !important; }
  .project-card, .exp-card { opacity: 1 !important; transform: none !important; }
  .project-card.card-settled, .exp-card.card-settled { transition: none !important; }
  .experience__list::before { transform: scaleY(1) !important; }
  .exp-card::before { transform: scale(1) !important; }
}

/* ── SKIP LINK (WCAG 2.4.1 — Bypass Blocks, Level A) ──────────── */
.skip-link {
  position: absolute; top: -9999px; left: 8px;
  padding: 10px 20px; border-radius: var(--r-md);
  background: var(--btn-dark); color: var(--white);
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 500;
  z-index: 9999; white-space: nowrap;
}
.skip-link:focus { top: 8px; }

/* ── FOCUS INDICATORS (WCAG 2.4.7 / 2.4.11) ─────────────────── */
/* Applies to all interactive elements via keyboard navigation only */
:focus-visible {
  outline: 2px solid var(--sage-dark);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
/* On dark section backgrounds, use a light outline */
.section--contact :focus-visible,
.footer :focus-visible,
.nav__mobile-menu :focus-visible {
  outline-color: rgba(255, 255, 255, 0.85);
}
/* Buttons/links already have enough visual affordance; keep outline tight */
.btn:focus-visible,
.nav__cta:focus-visible,
.contact__link:focus-visible,
.project-link:focus-visible {
  outline-offset: 2px;
}

/* ── DARK MODE — Galaxy / Deep Navy ──────────────────────────── */
[data-theme="dark"] {
  --bg:          #070B18;
  --bg-2:        #0B1020;
  --bg-3:        #0F1630;
  --sage-accent: #131B38;
  --sage-mid:    #253068;
  --sage-dark:   #7B92E8;   /* periwinkle / indigo accent */
  --hero-start:  #0E1B52;
  --hero-end:    #1A0E52;
  --border:      #192040;
  --border-soft: rgba(25,32,64,0.5);
  --tx-light:    #7080C0;   /* was #5C72B0: failed 4.5:1 → now 5.18:1 on bg, 4.70:1 on bg-3 */
  --tx:          #9AACD8;
  --tx-dark:     #CDD8F4;
  --btn-dark:    #BCCEF2;
  --btn-dark-h:  #D2E0F8;
  --btn-sec:     #131B38;
  --btn-sec-h:   #1C2548;
  --white:       #0B1020;
  --glass-tint:  rgba(8,14,38,0.68);
  --charcoal:    #131B38;
  --sh-xs: 0 1px 4px rgba(0,0,20,0.35);
  --sh-sm: 0 4px 18px rgba(0,0,30,0.45);
  --sh-md: 0 12px 36px rgba(0,0,30,0.55);
  --sh-lg: 0 24px 60px rgba(0,0,30,0.65);
}

/* Dark overrides for hardcoded rgba values */
/* Images — lower brightness only, keep saturation & contrast */
[data-theme="dark"] .project-card__thumb-img {
  filter: brightness(0.80);
  transition: filter 0.3s ease, transform 0.45s var(--ease);
}
[data-theme="dark"] .project-card:hover .project-card__thumb-img {
  filter: brightness(0.90);
}
[data-theme="dark"] .section--contact {
  filter: brightness(0.80);
}
[data-theme="dark"] .contact__inner {
  filter: brightness(1.25); /* 0.80 × 1.25 = 1 — restores content to original brightness */
}

[data-theme="dark"] .nav__logo-img {
  filter: brightness(0.85) saturate(0.6) hue-rotate(195deg);
}

[data-theme="dark"] .nav.is-scrolled {
  background: rgba(7, 11, 24, 0.45);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
[data-theme="dark"] .nav__mobile-menu {
  background: rgba(7, 11, 24, 0.98);
}
[data-theme="dark"] .hero__panel {
  background: rgba(8, 14, 38, 0.22);
  box-shadow:
    inset -1px 0 0 rgba(100,140,255,0.12),
    0 0 80px rgba(0,0,40,0.40),
    0 4px 24px rgba(0,0,30,0.28);
}
/* Galaxy tunnel tint — deep indigo left fading to transparent right */
[data-theme="dark"] .hero__bg-tint {
  background: linear-gradient(
    95deg,
    rgba(10, 18, 65, 0.75) 0%,
    rgba(20, 10, 60, 0.45) 45%,
    rgba(8, 18, 55, 0.18) 70%,
    transparent 100%
  );
}
[data-theme="dark"] .hero__greeting { color: rgba(190,210,255,0.65); }
[data-theme="dark"] .hero__title    { color: rgba(205,222,255,0.85); }
[data-theme="dark"] .hero__tagline  { color: rgba(190,210,255,0.68); }
[data-theme="dark"] .hero__scroll   { color: rgba(190,210,255,0.28); }
[data-theme="dark"] .hero__social-icon {
  background: rgba(100,140,255,0.10);
  border-color: rgba(100,140,255,0.20);
}
[data-theme="dark"] .project-card__badge {
  background: rgba(7,11,24,0.78);
  border-color: rgba(100,140,255,0.15);
}
[data-theme="dark"] .about-tl-card {
  background: rgba(100,140,255,0.04);
}
[data-theme="dark"] .glass-soft {
  background: rgba(100,140,255,0.05);
  box-shadow:
    inset 0 1px 0 rgba(100,140,255,0.10),
    0 8px 28px rgba(0,0,30,0.38);
}
[data-theme="dark"] .contact__glass {
  background: rgba(100,140,255,0.05);
  border-color: rgba(100,140,255,0.15);
}
[data-theme="dark"] .contact__heading { color: #CDD8F4; }
[data-theme="dark"] .nav__link:hover { background: rgba(100,140,255,0.08); }
[data-theme="dark"] .btn--outline-inv {
  background: rgba(190,210,255,0.07);
  border-color: rgba(190,210,255,0.20);
  color: var(--tx-dark);
}
[data-theme="dark"] .btn--outline-inv:hover {
  background: rgba(190,210,255,0.13);
  border-color: rgba(190,210,255,0.30);
}
[data-theme="dark"] .btn--primary {
  background: var(--btn-dark);
  color: #070B18;
}
[data-theme="dark"] .btn--primary:hover { background: var(--btn-dark-h); color: #070B18; }
[data-theme="dark"] .nav__cta { background: var(--btn-dark); color: #070B18; }
[data-theme="dark"] .nav__cta:hover { background: var(--btn-dark-h); }
[data-theme="dark"] .skill-chip:hover { background: var(--sage-accent); }
[data-theme="dark"] .project-link--demo:hover { background: #182055; }
[data-theme="dark"] .project-card__tag { color: var(--tx-light); }
[data-theme="dark"] .contact__link--primary {
  background: rgba(255,255,255,0.92);
  color: #070B18;
}
[data-theme="dark"] .contact__link--primary:hover {
  background: rgba(255,255,255,1);
  color: #0B1020;
}

/* Hero background — dark image swapped via JS (applyThemeBgImages) */

/* Contact bg — dark image swapped via JS (applyThemeBgImages); hide orb overlay */
[data-theme="dark"] .section--contact::before {
  display: none;
}

/* Smooth theme transition */
body, .nav, .hero__panel, .project-card, .exp-card,
.about-tl-card, .skill-category, .glass-soft, .contact__glass,
.footer, .nav__mobile-menu {
  transition:
    background 0.3s ease,
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
}

/* ── THEME TOGGLE BUTTON ──────────────────────────────────────── */
/* Light mode: dark button (moon) */
#theme-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #2C322C;
  background: #232826;
  color: #E4EDE5;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(35,40,38,0.22);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
#theme-toggle:hover {
  background: #1A1E1A;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(35,40,38,0.30);
}
/* Dark mode: white button (sun) */
[data-theme="dark"] #theme-toggle {
  border: 1px solid rgba(255,255,255,0.25);
  background: #F5F5F0;
  color: #232826;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
}
[data-theme="dark"] #theme-toggle:hover {
  background: #FFFFFF;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

/* ── RESPONSIVE ───────────────────────────────────────────────── */

/* ── Tablet & below (≤ 1024px) ───────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sec-py: 76px; }
  .projects__grid { grid-template-columns: 1fr; max-width: 640px; margin-inline: auto; }
  .skills__grid   { grid-template-columns: 1fr; max-width: 640px; margin-inline: auto; }
  .about__grid    { grid-template-columns: 1fr; gap: 44px; }

  /* Nav: switch to hamburger on tablet — fix outer layout so burger sits beside logo */
  .nav__links, .nav__actions { display: none; }
  .nav__hamburger { display: flex; }
  .nav__outer { display: flex; align-items: center; }
  .nav__inner { flex: 1; max-width: none; margin-inline: 0; }

  /* background-attachment:fixed causes GPU repaints on mobile — switch to scroll */
  .hero__bg { background-attachment: scroll; }
  .section--contact { background-attachment: scroll; }

  /* Hero panel flows in-document (no absolute/clip-path) on tablet & mobile */
  .section--hero { align-items: flex-start; border-radius: 0 0 clamp(44px, 10vw, 72px) 0; }
  .hero__panel {
    position: relative; width: 100%;
    transform: none;
    clip-path: none;
    border-radius: 0 clamp(44px, 10vw, 72px) clamp(44px, 10vw, 72px) 0;
    animation: heroFadeIn 0.9s var(--ease) 0.1s forwards;
  }
  .hero__panel-content {
    padding: calc(var(--nav-h) + 40px) 48px 56px;
  }
}

/* ── Small tablet / large phone (≤ 768px) ────────────────────── */
@media (max-width: 768px) {
  :root { --sec-py: 60px; }
  .hero__panel-content { padding: calc(var(--nav-h) + 60px) 24px 80px; }
  .exp-card   { padding: 20px 18px 18px; }
  .exp-card__top { flex-direction: column; gap: 6px; }
  .exp-card__meta { align-items: flex-start; }
  .contact__glass { padding: 40px 24px; }
  .footer__inner  { flex-direction: column; align-items: flex-start; }
  .footer__right  { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── Small phone (≤ 480px) ───────────────────────────────────── */
@media (max-width: 480px) {
  :root { --sec-py: 48px; }
  .hero__name { font-size: 46px; }
  .hero__panel-content { padding: calc(var(--nav-h) + 60px) 18px 80px; }
  .hero__tagline { font-size: 14px; }
  .projects__grid, .skills__grid { max-width: 100%; }
  .exp-card__company { font-size: 19px; }
  .contact__links { flex-direction: column; }
  .contact__link  { justify-content: center; }
  .contact__glass { padding: 28px 16px; }
}
