/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS — LIGHT THEME
   ═══════════════════════════════════════════════════════════ */
:root,
[data-theme="light"] {
  --bg:         #F7F6F3;
  --bg-alt:     #EFEEE9;
  --surface:    #FFFFFF;
  --ink:        #161614;
  --ink-2:      #3B3B38;
  --ink-3:      #6E6E6A;
  --ink-4:      #A3A39E;
  --rule:       #DEDCD7;
  --accent:     #B85C38;
  --accent-h:   #9C4D2F;
  --accent-t:   rgba(184,92,56,.07);
  --card-shadow:0 1px 3px rgba(0,0,0,.05);
  --card-hover: 0 14px 36px rgba(0,0,0,.08);
  --modal-bg:   rgba(0,0,0,.55);
  --nav-bg:     rgba(247,246,243,.82);
  --toast-bg:   var(--ink);
  --toast-fg:   var(--bg);
}

/* ═══════════════════════════════════════════════════════════
   DARK THEME
   ═══════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --bg:         #141413;
  --bg-alt:     #1C1C1A;
  --surface:    #1E1E1C;
  --ink:        #EDEDEA;
  --ink-2:      #C4C4BF;
  --ink-3:      #8E8E89;
  --ink-4:      #5E5E5A;
  --rule:       #2E2E2B;
  --accent:     #D4845A;
  --accent-h:   #E09970;
  --accent-t:   rgba(212,132,90,.1);
  --card-shadow:0 1px 3px rgba(0,0,0,.2);
  --card-hover: 0 14px 36px rgba(0,0,0,.3);
  --modal-bg:   rgba(0,0,0,.72);
  --nav-bg:     rgba(20,20,19,.82);
  --toast-bg:   var(--surface);
  --toast-fg:   var(--ink);
}

/* ═══════════════════════════════════════════════════════════
   SHARED TOKENS
   ═══════════════════════════════════════════════════════════ */
:root {
  --serif:   'Newsreader', Georgia, serif;
  --sans:    'Outfit', -apple-system, 'Helvetica Neue', sans-serif;

  --sp-xs:   .25rem;
  --sp-sm:   .5rem;
  --sp-md:   1rem;
  --sp-lg:   1.5rem;
  --sp-xl:   2.5rem;
  --sp-2xl:  4rem;
  --sp-3xl:  6.5rem;

  --mw:      1120px;
  --gutter:  clamp(20px, 5vw, 64px);
  --navH:    60px;
  --rad:     6px;
  --ease:    cubic-bezier(.25,.46,.45,.94);
}

/* ═══════════ RESET ═══════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--navH) + 24px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.72;
  color: var(--ink-2);
  background: var(--bg);
  transition: background .35s, color .35s;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
strong { font-weight: 600; color: var(--ink); }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--mw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ═══════════ FOCUS STATES ═══════════ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ═══════════ NAV ═══════════ */
.nav {
  position: sticky; top: 0; z-index: 500;
  height: var(--navH);
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--rule);
  transition: background .35s, border-color .35s;
}

.nav__inner {
  max-width: var(--mw); margin: 0 auto;
  padding: 0 var(--gutter);
  height: 100%;
  display: flex; align-items: center; gap: var(--sp-lg);
}

.nav__logo {
  font-family: var(--serif);
  font-weight: 600; font-size: 1.15rem;
  color: var(--ink);
  margin-right: auto;
}

.nav__links {
  list-style: none;
  display: flex; align-items: center; gap: var(--sp-lg);
}

.nav__link {
  font-size: .82rem; font-weight: 500;
  color: var(--ink-3);
  letter-spacing: .02em;
  position: relative;
  transition: color .25s;
}
.nav__link::after {
  content: ''; position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width .3s var(--ease);
}
.nav__link:hover,
.nav__link.active { color: var(--ink); }
.nav__link.active::after,
.nav__link:hover::after { width: 100%; }

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  transition: color .25s, border-color .25s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: none; }

/* ═══════════ BUTTONS ═══════════ */
.btn {
  display: inline-block;
  font-size: .84rem; font-weight: 600;
  letter-spacing: .015em;
  padding: .72rem 1.55rem;
  border-radius: var(--rad);
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .25s, color .25s, border-color .25s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.1);
}
.btn--ghost {
  background: transparent; color: var(--ink);
}
.btn--ghost:hover {
  background: var(--ink); color: var(--bg);
}

/* ═══════════ HERO ═══════════ */
.hero {
  min-height: max(88vh, 540px);
  display: flex; align-items: center;
  padding: calc(var(--navH) + var(--sp-2xl)) 0 var(--sp-3xl);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: stretch;
}

.hero__kicker {
  font-size: .72rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-md);
}

.hero__name {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(48px, 8.5vw, 96px);
  line-height: .95; letter-spacing: -.025em;
  color: var(--ink);
  margin-bottom: var(--sp-lg);
}

.hero__pitch {
  font-size: clamp(.92rem, 1.6vw, 1.06rem);
  line-height: 1.72; color: var(--ink-2);
  max-width: 520px;
  margin-bottom: var(--sp-lg);
}

.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero__photo {
  position: relative;
  border-radius: calc(var(--rad) + 4px);
  overflow: hidden;
  align-self: stretch;
  justify-self: end;
  width: 100%;
  box-shadow: 0 12px 30px rgba(0,0,0,.08);
}
.hero__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--rad);
}
.hero__photo::after {
  content: ''; position: absolute; inset: 0;
  border-radius: var(--rad);
  border: 1px solid var(--rule);
  pointer-events: none;
}

/* ═══════════ HERO CREDIBILITY STRIP ═══════════ */
.hero__creds {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-bottom: var(--sp-xl);
}

.hero__creds li {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-4);
  white-space: nowrap;
  line-height: 1.4;
}

/* Divider dot between items */
.hero__creds li + li::before {
  content: '·';
  display: inline-block;
  margin: 0 10px;
  color: var(--rule);
  font-size: .82rem;
  font-weight: 400;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .hero__creds {
    gap: 2px 0;
  }
  .hero__creds li {
    font-size: .62rem;
    letter-spacing: .08em;
  }
  .hero__creds li + li::before {
    margin: 0 7px;
  }
}

/* ═══════════ SECTIONS ═══════════ */
.section { padding: var(--sp-3xl) 0; }
.section--alt { background: var(--bg-alt); transition: background .35s; }

.section__head { margin-bottom: var(--sp-2xl); }

.label {
  display: block;
  font-size: .7rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.section__head h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 400; line-height: 1.15;
  letter-spacing: -.015em;
  color: var(--ink);
}

/* ═══════════ FILTER CHIPS ═══════════ */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: var(--sp-xl);
}

.chip {
  font-size: .78rem; font-weight: 600;
  letter-spacing: .02em;
  padding: 7px 16px;
  border-radius: 100px;
  border: 1.5px solid var(--rule);
  background: transparent;
  color: var(--ink-3);
  transition: all .25s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* ═══════════ PROJECT CARDS ═══════════ */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-lg);
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--rad);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: box-shadow .35s var(--ease), transform .35s var(--ease), border-color .3s, opacity .4s, background .35s;
}
.card:hover {
  box-shadow: var(--card-hover);
  transform: translateY(-5px);
  border-color: var(--accent);
}
.card.hidden {
  display: none;
}

.card__img {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--rule);
}
.card__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .45s var(--ease), filter .3s var(--ease);
}
.card:hover .card__img img { transform: scale(1.04); filter: saturate(1.02); }

.card__body { padding: var(--sp-lg); }


.card__title {
  font-family: var(--serif);
  font-size: 1.1rem; font-weight: 500;
  color: var(--ink); line-height: 1.3;
  margin-bottom: 6px;
}

.card__impact {
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-2);
  margin-bottom: 8px;
}

.card__desc {
  font-size: .86rem; line-height: 1.6;
  color: var(--ink-3);
  margin-bottom: 12px;
}

.card__tags {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 5px;
}
.card__tags li {
  font-size: .68rem; font-weight: 600;
  letter-spacing: .04em;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--rule);
  color: var(--ink-4);
  transition: border-color .25s;
}



#experience,
#experience .container {
  overflow: visible;
}

/* ═══════════ HORIZONTAL TIMELINE ═══════════ */
.htl-wrap {
  position: relative;
  padding: 0 0 var(--sp-2xl);
  overflow: visible;
}

/* Controls row (indicator + arrows) */
.htl-controls {
  max-width: var(--mw); margin: 0 auto;
  padding: 0 var(--gutter) var(--sp-lg);
  display: flex; align-items: center; justify-content: space-between;
}

.htl-indicator {
  font-size: .78rem; font-weight: 600;
  letter-spacing: .06em; color: var(--ink-4);
}

.htl-arrows { display: flex; gap: 8px; }

.htl-arrow {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--rule);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-3);
  transition: all .25s var(--ease);
}
.htl-arrow:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.htl-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.htl-arrow:disabled { opacity: .25; pointer-events: none; cursor: default; }

/* Progress bar */
.htl-progress {
  max-width: var(--mw); margin: 0 auto;
  padding: 0 var(--gutter);
  margin-bottom: var(--sp-lg);
}
.htl-progress__fill {
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  width: 25%;
  transition: width .35s var(--ease);
}

/* Rail line with dots */
.htl-rail {
  position: absolute;
  top: 0; left: 0; right: 0;
  pointer-events: none;
  /* The rail is positioned inside the track area — we offset it */
  display: none; /* shown via JS positioning; using the track-relative approach below instead */
}

/* We draw the rail INSIDE the track using a pseudo-element */
.htl-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 70px var(--gutter) 32px;
  max-width: var(--mw);
  margin: 0 auto;
  position: relative;
  isolation: isolate;

  /* Visible styled scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--ink-4) transparent;
}
.htl-track::-webkit-scrollbar { height: 6px; }
.htl-track::-webkit-scrollbar-track { background: transparent; }
.htl-track::-webkit-scrollbar-thumb {
  background: var(--ink-4);
  border-radius: 4px;
}
.htl-track::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Rail line drawn behind cards — uses a tall inline element to span full scroll width */
.htl-track::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 0;
  width: 100%;
  /* Stretch to full scrollable width */
  min-width: calc(100% + 1px);
  height: 2px;
  background: var(--rule);
  z-index: 0;
  pointer-events: none;
}

/* Card */
.htl-card {
  flex: 0 0 clamp(260px, 30vw, 320px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--rad);
  padding: var(--sp-lg);
  position: relative;
  z-index: 1;
  cursor: default;
  transition: box-shadow .3s var(--ease), transform .3s var(--ease), border-color .3s;
}
.htl-card:hover,
.htl-card:focus-visible {
  box-shadow: var(--card-hover);
  transform: translateY(-4px);
  border-color: var(--accent);
}

/* Dot above each card — sits ON the rail line */
.htl-card::before {
  content: '';
  position: absolute;
  top: -34px; left: 28px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  background: var(--bg-alt);
  z-index: 2;
  transition: background .25s, border-color .25s;
}
.htl-card:hover::before,
.htl-card:focus-visible::before,
.htl-card.tip-open::before {
  background: var(--accent);
}

/* Connector line from dot to card */
.htl-card::after {
  content: '';
  position: absolute;
  top: -20px; left: 34px;
  width: 2px; height: 20px;
  background: var(--rule);
  z-index: 1;
  transition: background .25s;
}
.htl-card:hover::after,
.htl-card:focus-visible::after,
.htl-card.tip-open::after {
  background: var(--accent);
}

.htl-card__co {
  font-family: var(--serif);
  font-size: 1.18rem; font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 2px;
}

.htl-card__role {
  font-size: .88rem; font-weight: 500;
  color: var(--ink-2); line-height: 1.3;
  margin-bottom: 6px;
}

.htl-card__date {
  display: block;
  font-size: .66rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 10px;
}

.htl-card__desc {
  font-size: .86rem; line-height: 1.6;
  color: var(--ink-3);
}

/* ═══════ TOOLTIP — floating on desktop / bottom-sheet on mobile ═══════ */
.htl-tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 14px);
  width: min(360px, calc(100vw - (var(--gutter) * 2)));
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--rad);
  box-shadow: var(--card-hover);
  padding: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  pointer-events: none;
  z-index: 30;
}

.htl-tip::after {
  content: '';
  position: absolute;
  left: 24px;
  top: 100%;
  width: 10px;
  height: 10px;
  background: var(--surface);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transform: rotate(45deg) translateY(-3px);
}

/* Show on hover/focus (desktop) */
.htl-card:hover .htl-tip,
.htl-card:focus-within .htl-tip,
.htl-card:focus-visible .htl-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Show when tapped (mobile — toggled via JS) */
.htl-card.tip-open .htl-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.htl-tip__heading {
  font-size: .7rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.htl-tip__tools {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-bottom: 10px;
}
.htl-tip__tools li {
  font-size: .68rem; font-weight: 600;
  padding: 3px 9px;
  border: 1px solid var(--rule);
  border-radius: 100px;
  color: var(--ink-3);
}

.htl-tip__highlight {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink-2);
  background: var(--accent-t);
  border-left: 2.5px solid var(--accent);
  padding: 8px 10px;
  border-radius: 0 var(--rad) var(--rad) 0;
  margin-bottom: 10px;
}

.htl-tip__highlight-label {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 2px;
}

.htl-tip__bullets {
  list-style: none;
}
.htl-tip__bullets li {
  font-size: .82rem; line-height: 1.55;
  color: var(--ink-2);
  padding-left: 14px;
  position: relative;
  margin-bottom: 4px;
}
.htl-tip__bullets li::before {
  content: ''; position: absolute;
  left: 0; top: 8px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent); opacity: .45;
}

/* Mobile: bottom-sheet tooltip */
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
  .htl-track {
    overflow-y: hidden;
  }

  .htl-card .htl-tip {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(62vh, 420px);
    overflow-y: auto;
    border-radius: 14px 14px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 16px 20px 22px;
    transform: translateY(100%);
    z-index: 950;
  }

  .htl-card .htl-tip::after {
    display: none;
  }

  .htl-card:hover .htl-tip,
  .htl-card:focus-within .htl-tip,
  .htl-card:focus-visible .htl-tip {
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    pointer-events: none;
  }

  .htl-card.tip-open .htl-tip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* Rail dots are decorative HTML elements — hidden since we use card::before for dot rendering */
.htl-rail { display: none; }


/* Backdrop for mobile bottom-sheet */
.htl-backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .25s var(--ease), visibility .25s;
  z-index: 900;
}
.htl-backdrop.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ═══════════ SKILLS ═══════════ */
.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2xl);
  padding-bottom: var(--sp-2xl);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--sp-2xl);
}

.skills__col h3 {
  font-family: var(--serif);
  font-size: 1rem; font-weight: 500;
  color: var(--ink);
  margin-bottom: var(--sp-md);
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--rule);
}

.skills__col ul {
  list-style: none;
  display: flex; flex-direction: column; gap: 6px;
}
.skills__col li {
  font-size: .88rem; color: var(--ink-2);
  padding-left: 16px; position: relative;
}
.skills__col li::before {
  content: ''; position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); opacity: .35;
}

/* Education */
.edu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-xl);
}
.edu__item h4 {
  font-family: var(--serif);
  font-size: 1rem; font-weight: 500;
  color: var(--ink); margin-bottom: 2px;
}
.edu__item p {
  font-size: .86rem; color: var(--ink-3);
}
.edu__item time {
  font-weight: 600; color: var(--accent);
  font-size: .82rem;
}

/* ═══════════ CONTACT ═══════════ */
.contact { max-width: 560px; }
.contact__sub {
  font-size: 1rem; color: var(--ink-3);
  margin-bottom: var(--sp-xl);
}

.contact__row {
  display: flex; flex-wrap: wrap;
  align-items: center; gap: var(--sp-lg);
}

.contact__email-group {
  display: flex; align-items: center; gap: 8px;
}

.contact__link {
  font-size: .9rem; font-weight: 600; color: var(--ink);
  transition: color .25s;
}
.contact__link:hover { color: var(--accent); }

.copy-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--rad);
  background: transparent;
  color: var(--ink-3);
  transition: all .25s;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ═══════════ MODAL ═══════════ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--modal-bg);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-lg);
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s;
}
.modal-backdrop.open {
  opacity: 1; visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: 10px;
  max-width: 680px; width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(16px) scale(.97);
  transition: transform .35s var(--ease);
  box-shadow: 0 24px 80px rgba(0,0,0,.18);
}
.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal__close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: var(--bg); color: var(--ink-3);
  transition: color .2s, background .2s;
}
.modal__close:hover { color: var(--ink); background: var(--rule); }

.modal__img {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-alt);
  border-radius: 10px 10px 0 0;
}
.modal__img img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.modal__body { padding: var(--sp-xl); }

.modal__title {
  font-family: var(--serif);
  font-size: 1.4rem; font-weight: 500;
  color: var(--ink); margin-bottom: 12px;
}

.modal__desc {
  font-size: .92rem; line-height: 1.72;
  color: var(--ink-2);
  margin-bottom: 20px;
}

.modal__stack {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 24px;
}
.modal__stack li {
  font-size: .72rem; font-weight: 600;
  letter-spacing: .04em;
  padding: 4px 12px;
  border: 1px solid var(--rule);
  border-radius: 100px;
  color: var(--ink-3);
}

.modal__actions {
  display: flex; flex-wrap: wrap; gap: 10px;
}

/* ═══════════ TOAST ═══════════ */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 22px;
  border-radius: 100px;
  background: var(--toast-bg);
  color: var(--toast-fg);
  font-size: .82rem; font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease);
  z-index: 1100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════ FOOTER ═══════════ */
.ft { border-top: 1px solid var(--rule); padding: var(--sp-lg) 0; transition: border-color .35s; }
.ft__inner { font-size: .76rem; color: var(--ink-4); }

/* ═══════════ SCROLL REVEAL ═══════════ */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
  animation: reveal-fallback .6s var(--ease) 1.2s both;
}
.reveal.in { opacity: 1; transform: translateY(0); animation: none; }
@keyframes reveal-fallback { to { opacity: 1; transform: translateY(0); } }

/* ═══════════ REDUCED MOTION ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .anim { opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; }
  .htl-track { scroll-behavior: auto; }
  .htl-tip { transition: none; }
  .htl-tip::after { transition: none; }
  .htl-card { transition: none; }
  .htl-card::before, .htl-card::after { transition: none; }
  .htl-progress__fill { transition: none; }
  .htl-backdrop { transition: none; }
}

/* ═══════════ RESPONSIVE — ≤ 900px ═══════════ */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--sp-xl);
  }
  .hero__photo {
    justify-self: start;
    order: -1;
    max-height: 280px;
  }
  .hero { min-height: auto; padding-top: calc(var(--navH) + var(--sp-xl)); padding-bottom: var(--sp-2xl); }

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

  .skills { grid-template-columns: 1fr 1fr; gap: var(--sp-lg); }
  .edu { grid-template-columns: 1fr; gap: var(--sp-lg); }
}

/* ═══════════ RESPONSIVE — ≤ 600px ═══════════ */
@media (max-width: 600px) {
  :root { --gutter: 20px; }

  .nav__links { gap: var(--sp-md); }
  .nav__link { font-size: .74rem; }

  .hero__name { font-size: clamp(40px, 12vw, 60px); }

  .hero__photo { max-height: 200px; }

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

  .contact__row { flex-direction: column; align-items: flex-start; gap: var(--sp-md); }

  .modal { max-height: 95vh; border-radius: 8px; }
  .modal__body { padding: var(--sp-lg); }
}

/* ═══════════ PRINT ═══════════ */
@media print {
  .nav, .hero__cta, .ft, .filters, .toast, .modal-backdrop, .theme-toggle, .htl-controls, .htl-progress, .htl-backdrop { display: none; }
  .htl-track { overflow: visible; flex-wrap: wrap; gap: 12px; }
  .htl-card { flex: 1 1 45%; }
  .htl-card::before, .htl-card::after { display: none; }
  .htl-track::before { display: none; }
  .hero { min-height: auto; padding: 24px 0; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .section { padding: 16px 0; }
  .reveal { opacity: 1; transform: none; }
  .card { break-inside: avoid; }
}
