/* ============================================================
   FONT
   ============================================================ */
@font-face {
  font-family: 'Google Sans';
  src: url('fonts/GoogleSans-VariableFont_GRAD,opsz,wght.woff2') format('woff2-variations'),
       url('fonts/GoogleSans-VariableFont_GRAD,opsz,wght.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --teal: #7ECBC3;

  --hero-bg:      #0A0A0A;
  --hero-ink:     #EDEDED;
  --hero-mute:    #8A8A8A;
  --hero-line:    #232323;
  --hero-accent:  var(--teal);

  --bg:      #0A0A0A;
  --panel:   #141414;
  --panel-2: #1B1B1B;
  --ink:     #EDEDED;
  --mute:    #8A8A8A;
  --line:    #232323;
  --line-2:  #2E2E2E;
  --accent:  var(--teal);
  --foot:    #050505;

  --soft:      #C8C8C8;
  --soft-2:    #D1D5DB;
  --soft-3:    #A5A5A5;
  --foot-txt:  #666666;
  --foot-link: #888888;
  --mock-bg:   #1E1E1E;
  --prev-grad: radial-gradient(circle at 50% 20%, rgba(126,203,195,.12), transparent 50%), #0c1011;
  --plan-box:  #1A1A1A;
  --plan-bd:   #333333;

  --r-xl: 18px;
  --r-lg: 16px;
  --r-md: 10px;
  --r-sm: 6px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  --wrap: 1080px;
  --pad:  24px;
  --nav-h: 72px;

  --dialog-dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Ccircle cx='4' cy='4' r='3.5' fill='%237ECBC3'/%3E%3C/svg%3E") 4 4, auto;
}

html[data-theme="light"] {
  --hero-bg:      #FFFFFF;
  --hero-ink:     #1E2633;
  --hero-mute:    #6A7280;
  --hero-line:    #E2E4E8;

  --bg:      #F4F4F2;
  --panel:   #FFFFFF;
  --panel-2: #F0F0EE;
  --ink:     #141414;
  --mute:    #6A6A6A;
  --line:    #E2E2DE;
  --line-2:  #D4D4CE;
  --foot:    #ECECEA;

  --soft:      #3A3A3A;
  --soft-2:    #333333;
  --soft-3:    #555555;
  --foot-txt:  #777777;
  --foot-link: #666666;
  --mock-bg:   #FFFFFF;
  --prev-grad: radial-gradient(circle at 50% 20%, rgba(126,203,195,.18), transparent 50%), #EDEDEA;
  --plan-box:  #F5F5F2;
  --plan-bd:   #CCCCCC;

  --teal:       #71bdb5; 
  
  --accent:     var(--teal);
  --hero-accent:var(--teal);

  --dialog-dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Ccircle cx='4' cy='4' r='3.5' fill='%2371bdb5'/%3E%3C/svg%3E") 4 4, auto;
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { 
  box-sizing: border-box; 
  -webkit-tap-highlight-color: transparent; 
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--hero-bg);
  color: var(--ink);
  font: 400 16px/1.7 Manrope, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s var(--ease);
}

h1, h2, h3 {
  font-family: Outfit, system-ui, sans-serif;
  margin: 0;
  line-height: 1.1;
}

img { max-width: 100%; }

::selection { background: var(--teal); color: #06201E; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 3px;
}

.vh {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section {
  padding-top: clamp(64px, 9vw, 112px);
  padding-bottom: clamp(64px, 9vw, 112px);
}

/* ============================================================
   NAV
   ============================================================ */
nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--nav-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  height: 38px;
  width: auto;
  display: block;
}

nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  margin-left: auto;
  margin-right: 4px;
  padding: 0;
  font-size: 15px;
}

nav ul a {
  position: relative;
  text-decoration: none;
  color: var(--hero-mute);
  transition: color .3s var(--ease);
}

nav ul a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: -5px;
  height: 1px;
  background: currentColor;
  transition: right .35s var(--ease);
}

nav ul a:hover { color: var(--teal); }
nav ul a:hover::after { right: 0; }

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--hero-ink);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  transition: color .3s var(--ease), transform .3s var(--ease);
}

.theme-toggle:hover { transform: scale(1.08); color: var(--teal); }
.theme-toggle:active { transform: scale(.94); }

.theme-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .3s var(--ease);
}

.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* GitHub / LinkedIn icon in nav */
.nav-github {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--hero-ink);
  text-decoration: none;
  border-radius: 50%;
  flex-shrink: 0;
  transition: color .3s var(--ease), transform .3s var(--ease);
}

.nav-github:hover {
  color: var(--teal);
  transform: scale(1.08);
}

.nav-github:active {
  transform: scale(.94);
}

/* ============================================================
   CUSTOM CURSOR
   ============================================================ */
.cursor-dot, .cursor-outline { display: none; }

@media (hover: hover) and (pointer: fine) {
  * { cursor: none !important; }

  .cursor-dot, .cursor-outline {
    display: block;
    position: fixed;
    top: 0; left: 0;
    border-radius: 50%;
    z-index: 2147483647;
    pointer-events: none;
    transform: translate(-50%, -50%);
    will-change: transform;
  }

  .cursor-dot {
    width: 7px; height: 7px;
    background: var(--teal);
    transition: background-color .25s var(--ease);
    z-index: 2147483647;
  }

  .cursor-outline {
    width: 48px; height: 48px;
    border: 2px solid var(--teal);
    backdrop-filter: invert(100%);
    -webkit-backdrop-filter: invert(100%);
    transition: width .25s var(--ease), height .25s var(--ease),
                background-color .25s var(--ease), border-color .25s var(--ease),
                backdrop-filter .25s var(--ease);
  }
  
  body.no-invert .cursor-outline {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.hover-teal-text .cursor-outline {
    border-color: var(--teal);
    background-color: rgba(126, 203, 195, .18);
  }
  body.hover-white-text .cursor-dot { background: #FFFFFF; }
  body.hover-white-text .cursor-outline {
    border-color: #FFFFFF;
    background-color: rgba(255, 255, 255, .18);
  }
}

/* ============================================================
   DIALOG CURSOR FIX
   ============================================================ */
body.dialog-open,
body.dialog-open *,
dialog::backdrop {
  cursor: var(--dialog-dot) !important;
}

body.dialog-open .cursor-dot,
body.dialog-open .cursor-outline {
  display: none !important;
}

/* ============================================================
   HERO
   ============================================================ */
.hero-container {
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: 1;
  background: var(--hero-bg);
  transition: background-color .4s var(--ease);
}

.hero {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--hero-bg);
  color: var(--hero-ink);
  overflow: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

#dot-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px) minmax(0, 1fr);
  align-items: center;
  height: 100%;
  gap: 32px;
}

.side {
  position: relative;
  z-index: 2;
  will-change: opacity, transform;
}

.side.left  { text-align: left; }
.side.right { text-align: right; }

.hero-eyebrow {
  color: var(--teal);
  font: 700 11px Manrope, sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.side h2 {
  font-size: clamp(26px, 3.6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  line-height: 1.08;
  white-space: nowrap;
}

.portrait {
  position: relative;
  width: 100%;
  max-width: 360px;
  justify-self: center;
  align-self: end;
  line-height: 0;
  will-change: opacity, transform;
  transform-origin: center center;
}

.portrait img { display: block; width: 100%; height: auto; }

/* ============================================================
   SHEET
   ============================================================ */
.content-overlap {
  position: relative;
  z-index: 2;
  background: var(--bg);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--line);
  box-shadow: 0 -28px 60px rgba(0, 0, 0, .55);
  overflow: clip;
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease),
              border-color .4s var(--ease);
}

html[data-theme="light"] .content-overlap {
  box-shadow: 0 -28px 60px rgba(0, 0, 0, .12);
}

/* ============================================================
   EYEBROW LABEL
   ============================================================ */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--teal);
  font: 700 12px Manrope, sans-serif;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 50px;
  height: 4px;
  background: linear-gradient(90deg, var(--teal) 0%, transparent 100%);
}

/* ============================================================
   HEADINGS
   ============================================================ */
.who-heading {
  font-family: 'Google Sans', 'Product Sans', Outfit, system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0;
}

.who-heading .accent { color: var(--teal); }

.lab {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0 0 36px;
  font: 500 12px Manrope, sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mute);
}

.lab::before, .lab::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-section {
  padding-top: clamp(72px, 8vw, 104px);
  padding-bottom: 40px;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.4fr);
  gap: clamp(36px, 8vw, 110px);
  align-items: start;
}

.about-heading {
  position: sticky;
  top: 34px;
}

.manifesto {
  display: grid;
  gap: 12px;
}

.manifesto p {
  margin: 0;
  color: var(--soft);
  font-family: 'Google Sans', var(--heading-font, Outfit), system-ui, sans-serif;
  font-size: clamp(23px, 3.1vw, 36px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.32;

  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease),
              transform .7s var(--ease),
              color .4s var(--ease);
}

.manifesto p.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.manifesto .highlight {
  color: var(--teal);
}

.about-detail {
  max-width: 650px;
  margin-top: 24px;
  color: var(--mute);
  font-size: 16px;
  line-height: 1.7;
  
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.about-detail.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.credential-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 50px;
}

.credential-card {
  min-height: 0;
  padding: clamp(10px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  transition: background .4s var(--ease), border-color .4s var(--ease);
}

.gpa {
  margin: 0 0 10px;
  color: var(--teal);
  font-family: 'Google Sans', Outfit, system-ui, sans-serif;
  font-size: clamp(90px, 12vw, 140px);
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 1;
}

.credential-card .gpa {
  font-size: clamp(40px, 12vw, 20px) !important;
  color: var(--teal) !important;
  line-height: 0.9;
}
.credential-card h3 {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.credential-card p {
  margin: 0;
  color: var(--mute);
  font-size: 14px;
  line-height: 1.7;
}

.credential-card .eyebrow {
  margin-bottom: 10px;
}

.credential-list {
  display: grid;
  gap: 16px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.credential-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--soft-2);
  font-size: 15px;
  line-height: 1.55;
  transition: color .4s var(--ease);
}

.credential-list li::before {
  content: "↗";
  color: var(--teal);
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================================
   CAROUSEL TICKER
   ============================================================ */
.separator-band {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 40px;
  margin-bottom: 10px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}

.ticker-track {
  display: flex;
  width: max-content;
  padding-block: 16px;
  animation: scrollMarquee 30s linear infinite;
}

.separator-band:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-group {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 32px;
  padding-right: 32px;
}

.ticker-group span {
  font-family: Outfit, system-ui, sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mute);
  transition: color .4s var(--ease);
}

.ticker-group i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}

.separator-band:hover .ticker-group span {
  color: var(--teal);
}

@keyframes scrollMarquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   WORK
   ============================================================ */
.work-pin {
  position: relative;
  height: 300vh;
  background: var(--bg);
}

.work-sticky {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding-top: var(--nav-h);
  display: flex;
  flex-direction: column;
}

.work-head {
  flex-shrink: 0;
  padding-top: 10px;
  padding-bottom: 4px;
}

.work-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.work-section-heading .who-heading { margin: 0; }

.work-section-intro {
  max-width: 430px;
  margin: 0 0 6px;
  color: var(--mute);
  font-size: 15px;
  line-height: 1.7;
}

.work-viewport {
  position: relative;
  width: 100%;
  overflow-x: clip;
  overflow-y: visible;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.work-track {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 22px;
  padding-inline: max(var(--pad), calc((100vw - var(--wrap)) / 2 + var(--pad)));
  will-change: transform;
}

.card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(300px, 42vw, 440px);
  height: min(520px, 70vh);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition:
    transform .25s var(--ease),
    border-color .25s var(--ease),
    background-color .25s var(--ease);
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(126, 203, 195, .65);
  background: var(--panel-2);
}

.card:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
}

.prev {
  position: relative;
  display: block;
  flex: 1 1 0;
  min-height: 200px;
  overflow: hidden;
  border-radius: 11px;
  border: 0;
  margin: 0;
  background: var(--mock-bg);
}

.prev img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s var(--ease);
}

.card:hover .prev img {
  transform: scale(1.05);
}

.project-info {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  padding: 16px 12px 12px;
}

.project-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.project-topline h3 {
  margin: 0;
  font: 700 25px Outfit, system-ui, sans-serif;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.project-number {
  color: var(--mute);
  font: 700 12px Manrope, sans-serif;
}

.project-category {
  margin: 0 0 8px;
  color: var(--teal);
  font: 700 12px Manrope, sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  transition: border-color .4s var(--ease);
}

.tech-list {
  color: var(--mute);
  font-size: 11px;
  line-height: 1.6;
}

.view-project {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--teal);
  font-size: 18px;
  transition: background-color .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease);
}

.card:hover .view-project {
  background: var(--teal);
  color: #06201E;
  border-color: var(--teal);
}

.more-card {
  flex: 0 0 auto;
  width: clamp(300px, 42vw, 440px);
  height: min(520px, 70vh);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: rgba(126, 203, 195, .025);
  text-decoration: none;
  text-align: center;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}

.more-card:hover {
  border-color: var(--teal);
  background: rgba(126, 203, 195, .07);
}

.more-card strong {
  display: block;
  margin-bottom: 8px;
  font-family: Outfit, system-ui, sans-serif;
  font-size: 25px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.more-card span:not(.accent) {
  color: var(--mute);
  font-size: 14px;
  line-height: 1.7;
}

.work-sticky > .wrap:last-child {
  flex-shrink: 0;
  padding-top: 16px;
  padding-bottom: 24px;
}

.work-progress {
  position: relative;
  height: 1px;
  background: var(--line);
}

.work-progress::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  background: var(--teal);
  transition: width .08s linear;
}

/* ============================================================
   TECH STACK
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.4fr);
  gap: clamp(36px, 8vw, 110px);
  align-items: start;
}

.skills-heading {
  position: sticky;
  top: 34px;
}

.skills-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.stack-category {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.stack-category.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stack-category h3 {
  font-size: 16px;
  color: var(--ink);
  margin: 0 0 16px 0;
  font-family: 'Google Sans', Outfit, sans-serif;
  letter-spacing: .02em;
}

.stack-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--mute);
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.3s var(--ease),
              color 0.3s var(--ease),
              box-shadow 0.3s var(--ease),
              background-color 0.4s var(--ease);
  cursor: default;
  flex-shrink: 0;
  white-space: nowrap;
}

.tool-card img, .tool-card i, .tool-card svg {
  width: 26px;
  height: 26px;
  font-size: 26px;
  display: block;
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tool-card:hover {
  border-color: var(--teal);
  color: var(--ink);
  background: var(--panel-2);
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .tool-card:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.tool-card:hover img, .tool-card:hover i, .tool-card:hover svg {
  transform: scale(1.15) rotate(6deg);
}

.style-pill {
  padding: 7px 16px;
  border-radius: 99px;
  background: rgba(126, 203, 195, 0.08);
  color: var(--teal);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(126, 203, 195, 0.2);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
  cursor: default;
  flex-shrink: 0;
  white-space: nowrap;
}

.style-pill:hover {
  background: rgba(126, 203, 195, 0.15);
  transform: translateY(-3px);
}

/* ============================================================
   CONTACT + FOOTER
   ============================================================ */
.bottom-section {
  background: var(--foot);
  border-top: 1px solid var(--line);
  padding-top: clamp(64px, 9vw, 104px);
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}

.cta {
  padding-top: 20px;
  padding-bottom: 90px;
  display: flex;
  justify-content: center;
}

.cta-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta .eyebrow {
  justify-content: center;
  margin-bottom: 24px;
}

.cta .who-heading {
  font-size: clamp(48px, 8vw, 92px);
  line-height: 1;
  margin-bottom: 24px;
}

.cta .who-heading .accent {
  display: inline-block;
  transform: translateY(-120vh);
  opacity: 0;
  will-change: transform, opacity;
}

.cta .who-heading .accent.fall-in {
  animation: dotFall 1.5s cubic-bezier(0.28, 0.84, 0.42, 1) forwards;
}

@keyframes dotFall {
  0% {
    transform: translateY(-120vh) rotate(0deg);
    opacity: 0;
  }
  30% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  55% {
    transform: translateY(-24px) rotate(0deg);
  }
  75% {
    transform: translateY(0) rotate(0deg);
  }
  88% {
    transform: translateY(-8px) rotate(0deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
}

.cta p.lead {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.7;
  max-width: 500px;
  color: var(--mute);
  margin: 0 auto 36px;
}

.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 36px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .02em;
  border: 1px solid var(--ink);
  cursor: pointer;
  font-family: inherit;
  transition: transform .25s var(--ease), background-color .25s var(--ease),
              color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}

.btn svg {
  width: 18px;
  height: 18px;
  transition: transform .25s var(--ease);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

html[data-theme="light"] .btn:hover {
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.btn:hover svg.fly-icon {
  transform: translateX(3px) translateY(-3px);
}

.btn.o {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}

.btn.o:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.btn.o:hover svg {
  transform: scale(1.1);
}

footer { border-top: 1px solid var(--line); transition: border-color .4s var(--ease); }

footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 30px;
  padding-bottom: 30px;
  font-size: 14px;
  color: var(--foot-txt);
  transition: color .4s var(--ease);
}

footer a {
  text-decoration: none;
  color: var(--foot-link);
  transition: color .25s var(--ease);
}

footer a:hover { color: var(--teal); }

.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ============================================================
   DIALOG
   ============================================================ */
dialog {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 0;
  max-width: 1000px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow: hidden;
  overscroll-behavior: contain;   /* NEW: prevents outer page scroll bleed */
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .8);
  transition: background-color .4s var(--ease), color .4s var(--ease),
              border-color .4s var(--ease);
}

.dialog-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  min-height: 0;
}

.dialog-content {
  padding: 48px 40px 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  max-height: 85vh;
  min-width: 0;
  font-size: 16px;
}

.dialog-image {
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  background: var(--panel-2);
}

.dialog-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transition: opacity .25s var(--ease);
}

dialog[open] { animation: dialogIn .32s var(--ease); }

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

dialog::backdrop {
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

dialog h3 {
  font-size: 2em;
  color: var(--ink);
  letter-spacing: -0.02em;
}

dialog .k { color: var(--teal); margin: 8px 0 20px; font-size: 0.94em; }
dialog ul { padding-left: 20px; margin: 0 0 20px; }
dialog li {
  margin-bottom: 10px;
  font-size: 0.97em;
  line-height: 1.65;
  color: var(--soft-2);
  transition: color .4s var(--ease);
}

dialog .st {
  font-size: 0.85em;
  color: var(--mute);
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin: 0 0 22px;
  line-height: 1.6;
  transition: color .4s var(--ease), border-color .4s var(--ease);
}

dialog button {
  appearance: none;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 11px 24px;
  border-radius: var(--r-sm);
  font: 600 15px Manrope, sans-serif;
  cursor: pointer;
  align-self: flex-start;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}

dialog button:hover { background: var(--teal); color: #06201E; }

/* ============================================================
   CERTIFICATE DIALOG LAYOUT
   ============================================================ */
dialog.cert-layout {
  width: fit-content;
  max-width: calc(100% - 32px);
  max-height: 90vh;
  overflow-y: auto;
}

dialog.cert-layout .dialog-grid {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

dialog.cert-layout .dialog-image {
  order: -1;
  height: auto;
  min-height: 0;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

dialog.cert-layout .dialog-image img {
  position: relative;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 40vh;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

dialog.cert-layout .dialog-content {
  padding: 24px 32px 18px;
  align-items: center;
  text-align: center;
  font-size: 16px;
  overflow: visible;
  max-height: none;
}

dialog.cert-layout h3 {
  margin: 0;
  font-size: 1.4em;
}

dialog.cert-layout .k {
  margin: 4px 0 2px; 
}

dialog.cert-layout .st {
  width: 60%;
  margin: 0 auto 16px auto; 
  padding-top: 2px;
}

dialog.cert-layout #dx {
  align-self: center;
}

/* ============================================================
   CONTACT FORM DIALOG
   ============================================================ */
#contact-dlg {
  max-width: 560px;
  width: calc(100% - 32px);
  max-height: min(90dvh, 780px);
  overflow: hidden;
  padding: 0;
}

.contact-form {
  max-height: inherit;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 40px 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.contact-form::-webkit-scrollbar {
  width: 8px;
}
.contact-form::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 4px;
}
.contact-form::-webkit-scrollbar-track {
  background: transparent;
}

.contact-head { margin-bottom: 4px; }

.contact-head h3 {
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 8px;
}

.contact-sub {
  margin: 0;
  color: var(--mute);
  font-size: 15px;
  line-height: 1.6;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--mute);
}

.field .opt {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--soft-3);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  font: 400 15px/1.5 Manrope, system-ui, sans-serif;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--panel);
}

.field textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

.field input:user-invalid,
.field textarea:user-invalid {
  border-color: #e57373;
}

.form-status {
  min-height: 20px;
  margin: 0;
  font-size: 14px;
  color: var(--mute);
}

.form-status.error  { color: #e57373; }
.form-status.success { color: var(--teal); }

.contact-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.contact-actions .btn { padding: 13px 26px; }

.contact-fallback {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--soft-3);
  text-align: center;
}

.copy-email {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--teal);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s var(--ease);
}

.copy-email:hover {
  color: var(--ink);
}

.copy-hint {
  display: inline-block;
  margin-left: 6px;
  color: var(--teal);
  font-size: 12px;
  opacity: 0;
  transition: opacity .25s var(--ease);
}

.copy-hint.show {
  opacity: 1;
}

/* ============================================================
   CERTIFICATE DECK
   ============================================================ */
.cert-deck {
  position: relative;
  height: 210px;
  margin-top: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cert-img-wrap {
  position: absolute;
  width: 250px; 
  aspect-ratio: 1.414 / 1;
  border-radius: var(--r-md);
  background: var(--line);
  border: 3px solid var(--panel);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  cursor: pointer;
  
  --tx: 0px;
  --ty: 0px;
  --rot: 0deg;
  --scl: 1;
  transform: translateX(var(--tx)) translateY(var(--ty)) rotate(var(--rot)) scale(var(--scl));
  
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.3s var(--ease),
              z-index 0s;
}

html[data-theme="light"] .cert-img-wrap {
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.cert-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--r-md) - 3px);
  display: block;
  pointer-events: none;
}

.cert-img-wrap:nth-child(1) { --tx: -35px; --rot: -8deg; z-index: 1; }
.cert-img-wrap:nth-child(2) { --tx: 0px;   --rot: 0deg;  z-index: 2; }
.cert-img-wrap:nth-child(3) { --tx: 35px;  --rot: 8deg;  z-index: 1; }

.cert-deck:hover .cert-img-wrap:nth-child(1) { --tx: -140px; --rot: -14deg; }
.cert-deck:hover .cert-img-wrap:nth-child(2) { --tx: 0px;    --rot: 0deg; }
.cert-deck:hover .cert-img-wrap:nth-child(3) { --tx: 140px;  --rot: 14deg; }

.cert-deck .cert-img-wrap:hover {
  z-index: 10 !important;
  --scl: 1.15;
  --ty: -18px;
  border-color: var(--teal);
}

.cert-tooltip {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: var(--bg);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 20;
}

.cert-tooltip::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent var(--ink) transparent;
}

.cert-img-wrap:hover .cert-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cert-instruction {
  text-align: center;
  font-size: 13px !important;
  color: var(--mute) !important;
  font-weight: 500;
  margin-top: 30px !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    height: auto;
    padding-top: calc(var(--nav-h) + 40px);
    padding-bottom: 48px;
    gap: 28px;
  }

  .portrait {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 250px;
    align-self: center;
  }

  .side.left, .side.right {
    text-align: center;
    align-self: center;
    padding: 0;
  }

  .side h2 { font-size: clamp(30px, 8vw, 44px); white-space: normal; }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .about-heading { position: static; }

  .credential-grid { grid-template-columns: 1fr; gap: 20px; }
  .credential-card { min-height: 0; }

  .work-section-heading {
    display: block;
  }

  .work-section-intro {
    margin-top: 14px;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .skills-heading { 
    position: static; 
  }

  /* ============================================================
     MOBILE DIALOG — image full width, popup scrolls
     ============================================================ */
  #dlg {
    max-height: 90vh;
    overflow-y: auto;
  }

  .dialog-grid {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .dialog-image {
    order: -1;
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    background: var(--panel-2);
    flex: 0 0 auto;
  }
  .dialog-image img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
    object-position: center;
  }

  .dialog-content {
    padding: 24px 24px 32px;
    max-height: none;
    overflow: visible;
    font-size: 16px;
  }

  .cert-img-wrap { width: 210px; }
  .cert-deck { height: 180px; }
  .cert-img-wrap:nth-child(1) { --tx: -95px; --rot: -12deg; }
  .cert-img-wrap:nth-child(3) { --tx: 95px;  --rot: 12deg; }
  .cert-deck:hover .cert-img-wrap:nth-child(1) { --tx: -95px; --rot: -12deg; }
  .cert-deck:hover .cert-img-wrap:nth-child(3) { --tx: 95px;  --rot: 12deg; }

  .work-pin {
    height: auto !important;
  }

  .work-sticky {
    position: static;
    height: auto;
    display: block;
    padding-top: 0;
  }

  .work-sticky > .wrap {
    display: block !important;
    height: auto !important;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .work-sticky > .wrap:first-child > div:first-child {
    margin-bottom: 24px;
  }

  .work-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-top: 0 !important;
  }

  .work-viewport::-webkit-scrollbar {
    display: none;
  }

  .work-track {
    display: flex;
    transform: none !important;
    padding-inline: var(--pad);
    height: auto;
    gap: 16px;
  }

  .card, .more-card {
    scroll-snap-align: start;
    height: auto;
    width: 82vw;
  }

  .prev {
    flex: 0 0 auto;
    aspect-ratio: 3 / 2;
    min-height: 0;
  }

  .work-sticky > .wrap:last-child {
    display: none !important;
  }
}

@media (max-width: 640px) {
  :root { --r-xl: 14px; --pad: 20px; }

  nav ul { gap: 14px; font-size: 13px; margin-right: 4px; }
  nav ul a { white-space: nowrap; }

  .theme-toggle { width: 30px; height: 30px; }
  .theme-toggle svg { width: 20px; height: 20px; }

  .nav-github { display: none; }

  .card, .more-card { width: 82vw; }

  .project-topline h3 { font-size: 22px; }

  .stack-grid { flex-wrap: wrap; }
  
  dialog.cert-layout .dialog-image {
    padding: 20px;
  }
  dialog.cert-layout .dialog-content {
    padding: 24px 20px 32px;
  }
}

@media (max-width: 480px) {
  nav ul { gap: 10px; font-size: 12px; }
  .brand img { height: 32px; }

  #contact-dlg {
    max-height: 92dvh;
  }
  .contact-form {
    padding: 28px 20px 24px;
    gap: 14px;
  }

  .cert-img-wrap { width: 160px; border-width: 2px; }
  .cert-deck { height: 140px; margin-top: 20px;}
  .cert-img-wrap:nth-child(1) { --tx: -75px; --rot: -12deg; }
  .cert-img-wrap:nth-child(3) { --tx: 75px;  --rot: 12deg; }
  .cert-deck:hover .cert-img-wrap:nth-child(1) { --tx: -75px; --rot: -12deg; }
  .cert-deck:hover .cert-img-wrap:nth-child(3) { --tx: 75px;  --rot: 12deg; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .ticker-track { animation: none; }

  .work-pin {
    height: auto !important;
  }

  .work-sticky {
    position: static;
    height: auto;
    display: block;
  }

  .work-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .work-track {
    display: flex;
    padding-inline: var(--pad);
    transform: none !important;
    height: auto;
  }

  .card, .more-card {
    width: 82vw;
    height: auto;
    scroll-snap-align: start;
  }

  .prev {
    flex: 0 0 auto;
    aspect-ratio: 3 / 2;
    min-height: 0;
  }

  .work-progress { display: none; }

  .manifesto p, .about-detail {
    opacity: 1;
    transform: none;
  }

  .stack-category {
    opacity: 1;
    transform: none;
  }

  .cta .who-heading .accent {
    transform: none;
    opacity: 1;
  }
  .cta .who-heading .accent.fall-in {
    animation: none;
  }
}