/* ================================================================
   EVELYN SU — PORTFOLIO
   ================================================================ */

/* ---- DESIGN TOKENS ---- */
:root {
  --bg:        #F6F4F0;
  --bg-2:      #EEEAE3;
  --bg-3:      #E6E2DA;
  --black:     #0C0C0B;
  --text:      #1C1A17;
  --muted:     #7A7570;
  --stone:     #8E8880;
  --stone-lt:  #CAC5BE;
  --blue:      #6FA3C4;
  --red:       #CC0000;
  --red-soft:  rgba(204,0,0,.45);   /* cursor ring at rest — tracks --red */
  --gold:      #D4A537;
  --white:     #FFFFFF;

  --ff-cursive: 'Great Vibes', cursive;
  --ff-serif:   'Cormorant Garamond', serif;
  --ff-sans:    'Work Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;

  --nav-h: 68px;
  --px:    clamp(24px, 5vw, 72px);   /* global horizontal page padding */
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- SELECTION COLOUR ---- */
::selection         { background: var(--red); color: #fff; }
::-moz-selection    { background: var(--red); color: #fff; }

/* ---- RESET & BASE ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; max-width: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-sans);
  overflow-x: hidden;
  max-width: 100%;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: none; }
ul { list-style: none; }

/* ---- CUSTOM CURSOR ---- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  will-change: transform;
  /* no transform transition — JS drives movement directly via rAF */
}
.cursor-dot {
  width: 8px; height: 8px;
  background: var(--red);
  transition: width .2s var(--ease), height .2s var(--ease), background .2s;
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1.5px solid var(--red-soft);
  transition: width .25s var(--ease), height .25s var(--ease),
              border-color .25s, opacity .25s;
}
.cursor-ring.ring-hover  { width: 50px; height: 50px; border-color: var(--red); }
.cursor-dot.dot-hover    { width: 4px;  height: 4px; }
.cursor-ring.ring-click  { width: 24px; height: 24px; }

/* ---- NAV ---- */
.nav {
  position: fixed; inset: 0 0 auto 0;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 64px);
  z-index: 1000;
  transition: background .45s, backdrop-filter .45s, box-shadow .45s;
}
.nav-scrolled {
  background: rgba(246,244,240,.88);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(12,12,11,.07);
}
.nav-logo   { display: flex; align-items: center; flex-shrink: 0; }
.su-stamp   { width: auto; height: 72px; transition: opacity .3s; display: block;
               mix-blend-mode: multiply; }   /* makes white bg transparent on nav */
.su-stamp:hover { opacity: .75; }
.su-stamp-fallback {
  display: none;        /* shown only when image 404s */
  align-items: center;
  justify-content: center;
  width: 56px; height: 36px;
  border: 2px solid var(--black);
  font-family: 'Arial Black', sans-serif;
  font-size: 18px; font-weight: 900;
  letter-spacing: 2px;
  color: var(--black);
}

.nav-links  { display: flex; align-items: center; gap: 38px; }
.nav-links li { display: flex; align-items: center; }
.nav-link {
  font-size: 11.5px; font-weight: 400; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text);
  position: relative; padding: 0;
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; margin: 0;
  line-height: 1;
  transition: color .3s;
}
.nav-link::after {
  content: ''; position: absolute; bottom: -3px; left: 0;
  width: 0; height: 1px; background: var(--black);
  transition: width .35s var(--ease);
}
.nav-link:hover::after, .nav-link:focus::after { width: 100%; }

/* Connect button — always red on every page */
.ex-connect-trigger {
  color: var(--red) !important;
}
.ex-connect-trigger::after { display: none; }
.ex-connect-trigger:hover { opacity: .75; }
.nav-link svg { transition: transform .3s var(--ease); }
.nav-dropdown:hover .nav-link svg { transform: rotate(180deg); }

/* Dropdown */
.nav-dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 18px); left: 50%;
  transform: translate(-50%, 6px);
  background: var(--bg);
  border: 1px solid rgba(12,12,11,.09);
  border-radius: 10px;
  padding: 8px 0; min-width: 210px;
  opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease);
  box-shadow: 0 12px 36px rgba(12,12,11,.09);
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1; pointer-events: all;
  transform: translate(-50%, 0);
}
.dropdown-menu li a {
  display: block; padding: 10px 22px;
  font-size: 12.5px; letter-spacing: .04em;
  transition: background .2s, padding-left .25s var(--ease);
}
.dropdown-menu li a:hover { background: var(--bg-2); padding-left: 28px; }

/* Mobile nav — Connect (matches desktop red style) */
.nav-connect-mobile {
  display: none;
  font-family: var(--ff-sans);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
  background: none;
  border: none;
  padding: 0;
  margin-left: auto;
  margin-right: 12px;
  cursor: pointer;
  transition: opacity .2s;
}
.nav-connect-mobile:hover { opacity: .75; }
.nav-menu-btn {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 6px;
}
.nav-menu-btn span {
  display: block; width: 22px; height: 1.5px;
  background: var(--black);
  transition: transform .35s var(--ease), opacity .35s;
}
.nav-menu-btn.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-menu-btn.active span:nth-child(2) { opacity: 0; }
.nav-menu-btn.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0;
  background: var(--bg); z-index: 3500;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 32px;
  opacity: 0; pointer-events: none;
  transform: translateY(-12px);
  transition: opacity .4s, transform .4s var(--ease);
}
.mobile-menu.active { opacity: 1; pointer-events: all; transform: translateY(0); }
.mobile-menu a {
  font-family: var(--ff-sans); font-size: 32px; font-weight: 300;
  transition: color .3s;
}
.mobile-menu a:hover { color: var(--stone); }

/* ---- SIDE PANELS (Work + Skills) — shared base ---- */
.work-side,
.skills-side {
  position: fixed;
  z-index: 900;
  display: flex;
  align-items: center;
  cursor: none;
}

/* Work: left edge, upper-center */
.work-side   { left: 0;  top: 50%; transform: translateY(-50%); }
/* Skills: right edge, center */
.skills-side { right: 0; top: 50%; transform: translateY(-50%); }

/* Tab — clean vertical label with red-dot accent */
.work-side-tab,
.skills-side-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 13px 10px;
  position: relative;
}

.work-side-tab::after,
.skills-side-tab::after {
  content: '';
  display: block;
  width: 3px; height: 3px;
  background: var(--red);
  border-radius: 50%;
  margin-top: 10px;
  opacity: 0.28;
  transition: opacity .35s;
}
.work-side:hover  .work-side-tab::after,
.skills-side:hover .skills-side-tab::after { opacity: 1; }

.work-side-letter,
.skills-side-letter {
  display: block;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--stone);
  line-height: 2;
  transition: color .32s var(--ease);
}
.work-side:hover  .work-side-letter,
.skills-side:hover .skills-side-letter { color: var(--black); }

/* Transparent frosted-glass popup — shared base */
.work-side-menu,
.skills-side-menu {
  position: absolute;
  top: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  background: rgba(246,244,240,.72);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid rgba(12,12,11,.07);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(12,12,11,.08);
}

/* Work popup opens to the RIGHT */
.work-side-menu {
  left: 100%;
  transform: translateY(-50%) translateX(-10px);
}
.work-side:hover .work-side-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateY(-50%) translateX(0);
}

/* Skills popup opens to the LEFT */
.skills-side-menu {
  right: 100%;
  transform: translateY(-50%) translateX(10px);
}
.skills-side:hover .skills-side-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateY(-50%) translateX(0);
}

/* Work popup — link list */
.work-side-menu {
  padding: 8px 0;
  min-width: 228px;
  white-space: nowrap;
}

.work-side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 22px;
  font-family: var(--ff-sans);
  font-size: 12.5px;
  letter-spacing: .03em;
  color: var(--text);
  transition: background .2s, padding-left .28s var(--ease);
}
.work-side-item:hover { background: rgba(12,12,11,.05); padding-left: 28px; }

.work-side-soon { color: var(--stone); }
.work-side-soon:hover {
  color: var(--stone);
  padding-left: 22px;
  background: transparent;
  cursor: not-allowed;
}
.work-soon-tag {
  font-size: 8px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--stone-lt);
  border: 1px solid var(--stone-lt);
  border-radius: 4px; padding: 1px 5px;
}

/* Skills popup — categorised layout */
.skills-side-menu { padding: 14px 16px; }

.skills-popup-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 380px;
  max-height: 72vh;
  overflow-y: auto;
}

/* Category section */
.skill-cat-section { display: flex; flex-direction: column; gap: 6px; }
.skill-cat-label {
  font-family: var(--ff-sans);
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--black);
  opacity: .4;
}
.skill-cat-row { display: flex; flex-wrap: wrap; gap: 5px; }

/* Every card is exactly 56×64px — fully uniform */
.skills-popup-grid .skill-card {
  width: 56px;
  height: 64px;
  padding: 0;
  border-radius: 8px;
  gap: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(246,244,240,.6);
  border-color: rgba(12,12,11,.05);
  overflow: hidden;
}
.skills-popup-grid .skill-card:hover {
  background: rgba(255,255,255,.88);
  border-color: rgba(12,12,11,.1);
}
.skills-popup-grid .skill-icon-wrap {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.skills-popup-grid .skill-icon  { width: 22px; height: 22px; }
.skills-popup-grid .skill-emoji { font-size: 18px; line-height: 1; }
.skills-popup-grid .skill-name  {
  font-size: 7.5px; letter-spacing: .04em;
  text-align: center; line-height: 1.2;
  padding: 0 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  width: 100%;
}

@media (max-width: 768px) {
  .work-side   { display: none; }
  .skills-side { display: none; }
}

/* ================================================================
   LANDING PAGE — portal entry
   ================================================================ */
.page-landing {
  background: var(--bg);
  overflow: hidden;
  height: 100dvh;
}

.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px var(--px) 40px;
  gap: 0;
  position: relative;
}

/* evlynsu name logo */
.landing-logo {
  display: block;
  width: clamp(96px, 15vw, 190px);
  height: auto;
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
  margin-bottom: -8px;
  animation: landing-fadein .9s ease both;
}

/* EV character container */
.landing-ev-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  cursor: none;
  animation: landing-fadein 1.1s .15s ease both, ev-float 3.2s ease-in-out infinite;
}

.landing-ev-img {
  display: block;
  width: clamp(220px, 52vw, 460px);
  height: auto;
  max-width: 90vw;
  filter: drop-shadow(0 16px 40px rgba(12,12,11,.14));
  animation: ev-flip 6s ease-in-out infinite;
  user-select: none;
  -webkit-user-drag: none;
  transition: filter .2s;
}
.landing-ev-wrap:hover .landing-ev-img {
  filter: drop-shadow(0 20px 48px rgba(12,12,11,.22));
}

/* Bounce animation on click */
@keyframes ev-bounce {
  0%   { transform: scale(1)    translateY(0); }
  28%  { transform: scale(0.91) translateY(6px); }
  58%  { transform: scale(1.1)  translateY(-14px); }
  78%  { transform: scale(0.97) translateY(3px); }
  100% { transform: scale(1)    translateY(0); }
}
.ev-bouncing { animation: ev-bounce .62s ease-out !important; }

/* Tap hint */
.landing-hint {
  font-family: var(--ff-sans);
  font-size: 9px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 12px 0 0;
  animation: landing-fadein 1.3s .4s ease both, hint-breathe 3s 1.8s ease-in-out infinite;
  transition: opacity .35s, transform .35s;
}
.landing-hint.hint-gone {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}
@keyframes hint-breathe {
  0%, 100% { opacity: .5; }
  50%       { opacity: 1;  }
}

/* Choice cards */
.choice-wrap {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-bottom: 48px;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.choice-wrap.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
}

.choice-img {
  width: clamp(180px, 32vw, 280px);
  height: auto;
  display: block;
  object-fit: contain;
  transition: transform .28s var(--ease), filter .25s;
}
.choice-btn:hover .choice-img {
  transform: translateY(-4px) scale(1.04);
  filter: brightness(1.06);
}

.choice-sub {
  font-family: var(--ff-sans);
  font-size: 10px;
  letter-spacing: .05em;
  color: var(--black);
  opacity: .45;
  margin-top: -42px;
}

/* Fade-in for landing elements */
@keyframes landing-fadein {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   EXPLORE PAGE — "Get to Know Me"
   ================================================================ */
.explore-hero {
  padding: calc(var(--nav-h) + 72px) var(--px) 48px;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}
.explore-eyebrow {
  font-family: var(--ff-sans);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 20px;
}
.explore-title {
  font-family: var(--ff-sans);
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: 18px;
}
.explore-title em { font-style: italic; }
.explore-intro-img {
  display: block;
  width: clamp(280px, 60vw, 560px);
  height: auto;
  margin: 0 auto 18px;
}
.explore-desc {
  font-family: var(--ff-sans);
  font-size: 14px;
  color: var(--stone);
  line-height: 1.8;
  max-width: 500px;
  margin: 0 auto;
}

/* Chatbox on explore page — wider, centred */
.explore-chat-section {
  display: flex;
  justify-content: center;
  padding: 0 var(--px) 72px;
}
.explore-chat {
  width: 100%;
  max-width: 660px !important;
}

/* Work grid */
.explore-work {
  padding: 0 var(--px) 96px;
  max-width: 1080px;
  margin: 0 auto;
}
.explore-section-title {
  font-family: var(--ff-sans);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 300;
  margin-bottom: 32px;
}
.explore-work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}
.explore-work-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 26px 22px;
  border: 1px solid rgba(12,12,11,.1);
  border-radius: 16px;
  background: var(--bg);
  text-decoration: none;
  color: var(--black);
  transition: background .25s var(--ease), border-color .25s, transform .25s var(--ease);
}
a.explore-work-card:hover {
  background: var(--black);
  border-color: var(--black);
  color: var(--bg);
  transform: translateY(-3px);
}
.explore-work-card--soon {
  opacity: .55;
  cursor: default;
}
.ewc-icon  { font-size: 26px; }
.ewc-title {
  font-family: var(--ff-sans);
  font-size: 18px;
  font-weight: 300;
  flex: 1;
}
.ewc-arrow {
  font-size: 16px;
  opacity: .4;
  align-self: flex-end;
  transition: opacity .2s, transform .2s;
}
a.explore-work-card:hover .ewc-arrow {
  opacity: 1;
  transform: translateX(4px);
}
.ewc-tag {
  font-family: var(--ff-sans);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .5;
}

/* Mobile landing */
@media (max-width: 540px) {
  .choice-wrap   { gap: 10px; }
  .choice-card   { min-width: 160px; padding: 16px 18px 14px; }
  .choice-title  { font-size: 17px; }
  .landing-ev-img { width: clamp(180px, 72vw, 340px); height: auto; }
}

/* ---- HERO ---- */
.hero {
  min-height: 100vh;
  padding-top: var(--nav-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Subtle paper grain */
.hero::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.03; mix-blend-mode: multiply;
}

/* Name logo — sits inside ev-hero above popo */
.hero-name-img {
  display: block;
  width: clamp(180px, 30vw, 420px);
  height: auto;
  mix-blend-mode: multiply;
  margin: 0 auto;
  flex-shrink: 0;
  pointer-events: none;
  user-select: none;
}

/* Stage: flex column, bottom-aligned, no clipping */
.hero-stage {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
  z-index: 2;
  min-height: 260px;
  padding-top: clamp(16px, 3vh, 36px);
}

/* ---- EV HERO (centered column: logo → EV) ---- */
.ev-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: all;
  cursor: none;
  gap: 0;
}

/* Wrapper that speech bubble is relative to */
.ev-img-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-top: -18px; /* pull popo up closer to the name logo */
}
.ev-speech {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--black);
  color: var(--bg);
  font-family: var(--ff-sans);
  font-size: 11px; font-weight: 400;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  margin-bottom: 6px;
  opacity: 0;
  transition: opacity .25s, transform .25s var(--ease);
  pointer-events: none;
  box-shadow: 0 3px 14px rgba(12,12,11,.14);
  z-index: 10;
}
.ev-speech::after {
  content: ''; position: absolute;
  top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--black);
}
.ev-speech.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ev-hero-img {
  display: block;
  height: clamp(260px, 48vh, 460px);
  width: auto;
  max-width: none;
  filter: drop-shadow(0 14px 32px rgba(12,12,11,.18));
  user-select: none;
  -webkit-user-drag: none;
  animation: ev-float 3.2s ease-in-out infinite;
}

/* ---- EV CONTACT BUTTON + POPUP ---- */
.ev-contact {
  position: absolute;
  right: 0;
  top: 44%;
  transform: translate(calc(100% + 14px), -50%);
  z-index: 10;
}
.ev-contact-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--black);
  border: none;
  color: rgba(246,244,240,.9);
  display: flex; align-items: center; justify-content: center;
  cursor: none;
  box-shadow: 0 4px 16px rgba(12,12,11,.22);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.ev-contact-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 22px rgba(12,12,11,.3);
}
.ev-contact-popup {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  background: var(--black);
  color: rgba(246,244,240,.92);
  font-family: var(--ff-sans);
  font-size: 12px;
  letter-spacing: .03em;
  padding: 9px 18px;
  border-radius: 22px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  box-shadow: 0 6px 24px rgba(12,12,11,.18);
}
.ev-contact-popup a { color: inherit; text-decoration: none; }
.ev-contact-popup a:hover { text-decoration: underline; text-underline-offset: 2px; }
.ev-contact-popup.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(-50%) translateX(0);
}

/* EV reactions */
.ev-hero-img.ev-wiggle { animation: ev-wiggle .5s ease-in-out forwards; }
.ev-hero-img.ev-jump   { animation: ev-jump  .6s cubic-bezier(.36,.07,.19,.97) forwards; }
.ev-hero-img.ev-shy    { animation: ev-shy   .55s ease-in-out forwards; }

@keyframes ev-wiggle {
  0%,100% { transform: rotate(0deg)  scale(1); }
  20%     { transform: rotate(-8deg) scale(1.06); }
  40%     { transform: rotate( 8deg) scale(1.06); }
  60%     { transform: rotate(-5deg) scale(1.03); }
  80%     { transform: rotate( 5deg) scale(1.03); }
}
@keyframes ev-jump {
  0%   { transform: translateY(0)     scale(1, 1); }
  28%  { transform: translateY(-36px) scale(1.1, 0.9); }
  56%  { transform: translateY(-14px) scale(0.95, 1.05); }
  78%  { transform: translateY(-3px)  scale(1.02, 0.98); }
  100% { transform: translateY(0)     scale(1, 1); }
}
@keyframes ev-shy {
  0%,100% { transform: scale(1)    rotate(0deg); }
  30%     { transform: scale(0.92) rotate(-4deg); }
  65%     { transform: scale(0.96) rotate(3deg); }
}
@keyframes ev-float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-12px); }
}
@keyframes ev-flip {
  0%,  36%  { transform: scaleX(1); }
  42%       { transform: scaleX(-1); }
  58%       { transform: scaleX(-1); }
  64%, 100% { transform: scaleX(1); }
}

/* ---- CHATBOX ---- */
.chat-wrap {
  width: 100%;
  max-width: 560px;
  padding: 0 clamp(16px, 4vw, 32px) clamp(20px, 4vh, 40px);
  flex-shrink: 0;
  position: relative; z-index: 2;
}
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
}
.chat-chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(246,244,240,.2);
  background: rgba(12,12,11,.5);
  font-family: var(--ff-sans);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: rgba(246,244,240,.78);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.chat-chip:hover {
  background: rgba(246,244,240,.1);
  border-color: rgba(246,244,240,.42);
  color: rgba(246,244,240,1);
}
.chat-body {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  background: rgba(12,12,11,.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(12,12,11,.28);
}
.chat-messages {
  /* Answers run several paragraphs, and a fixed 200px cut them off after
     two or three lines. Scale with the viewport, with a floor that still
     shows a full answer and a ceiling so the box never eats the page. */
  height: clamp(300px, 48vh, 480px);
  overflow-y: auto;
  padding: 12px 14px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
/* Messages stack up from the bottom, the way every chat app does, so the
   greeting sits on the input rather than floating at the top of an empty
   box. margin-top:auto eats the free space and collapses to 0 once the
   thread overflows, which justify-content:flex-end would not do without
   clipping the oldest message in a scroll container. */
.chat-messages > *:first-child { margin-top: auto; }
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }
.chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  animation: msg-in .22s var(--ease) both;
}
.chat-msg--user { flex-direction: row-reverse; }
.chat-avatar {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  max-width: 24px;
  max-height: 24px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 65%;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 2px;
  opacity: .9;
}
.chat-msg--user .chat-avatar { display: none; }
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.chat-bubble {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 14px;
  font-family: var(--ff-sans);
  font-size: 12px;
  line-height: 1.55;
}
.chat-msg--ai   .chat-bubble { background: rgba(255,255,255,.09); color: rgba(246,244,240,.9); border-bottom-left-radius: 3px; }
.chat-msg--user .chat-bubble { background: rgba(255,255,255,.18); color: rgba(246,244,240,.95); border-bottom-right-radius: 3px; }
.typing-dot {
  display: inline-block; width: 5px; height: 5px;
  background: rgba(246,244,240,.35); border-radius: 50%; margin: 0 2px;
  animation: typing-bounce .9s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .30s; }
@keyframes typing-bounce {
  0%,80%,100% { transform: translateY(0); }
  40%          { transform: translateY(-4px); }
}
.chat-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.chat-input {
  flex: 1; border: none; background: transparent;
  font-family: var(--ff-sans); font-size: 12.5px; color: rgba(246,244,240,.9); outline: none;
}
.chat-input::placeholder { color: rgba(246,244,240,.28); }
.chat-send {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: rgba(246,244,240,.9); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: none; flex-shrink: 0; transition: background .2s;
}
.chat-send:hover { background: rgba(255,255,255,.28); }
.hero-tags {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}
.hero-dot { color: var(--stone-lt); }

.scroll-hint {
  position: absolute; bottom: 38px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 9px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--stone);
  pointer-events: none;
  will-change: opacity;
}
.scroll-line {
  width: 1px; height: 44px;
  background: linear-gradient(to bottom, var(--stone) 0%, transparent 100%);
  animation: line-pulse 2.2s ease-in-out infinite;
}
@keyframes line-pulse {
  0%,100% { opacity:.35; transform: scaleY(1) translateY(0); }
  50%      { opacity:1;   transform: scaleY(1.15) translateY(2px); }
}

/* ---- DESIGN STUDIO CTA ---- */
.design-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  margin-bottom: 20px;
  border: 1px solid rgba(12,12,11,.15);
  border-radius: 32px;
  background: rgba(12,12,11,.04);
  text-decoration: none;
  color: var(--black);
  font-family: var(--ff-sans);
  transition: background .25s var(--ease), border-color .25s, transform .2s var(--ease);
  z-index: 3;
}
.design-cta:hover {
  background: var(--black);
  border-color: var(--black);
  color: var(--bg);
  transform: translateY(-2px);
}
.design-cta-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
}
.design-cta-sub {
  font-size: 10px;
  opacity: .55;
  letter-spacing: .06em;
}
.design-cta:hover .design-cta-sub { opacity: .72; }
.design-cta-arrow {
  flex-shrink: 0;
  opacity: .6;
  transition: transform .25s var(--ease), opacity .25s;
}
.design-cta:hover .design-cta-arrow {
  transform: translateX(3px);
  opacity: 1;
}

/* ---- ABOUT ---- */
.about {
  padding: clamp(80px, 12vw, 160px) clamp(24px, 8vw, 120px);
  background: var(--bg);
}
.about-inner {
  max-width: 720px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr;
  gap: clamp(48px, 7vw, 110px);
  align-items: start;
}

/* Section label */
.section-label {
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--stone); margin-bottom: 36px;
  display: flex; align-items: center; gap: 14px;
}
.section-label::before {
  content: ''; width: 26px; height: 1px;
  background: var(--stone-lt); flex-shrink: 0;
}
.section-label::after {
  content: ''; width: 4px; height: 4px;
  background: var(--red); border-radius: 50%; flex-shrink: 0;
  opacity: 0.6;
}

/* Bio Layers */
.bio-layers { margin-bottom: 30px; }
.bio-l1, .bio-l2, .bio-l3 {
  font-family: var(--ff-sans);
  font-size: clamp(26px, 3.8vw, 46px);
  font-weight: 300; line-height: 1.25;
  letter-spacing: -.01em;
  opacity: 0; /* animated in by GSAP */
}
.bio-l1 { color: var(--text); }
.bio-l2 { color: var(--stone); padding-left: clamp(14px, 2.5vw, 44px); }
.bio-l3 { font-style: italic; padding-left: clamp(28px, 5vw, 88px); }

.bio-body {
  margin-bottom: 44px;
  display: flex; flex-direction: column; gap: 16px;
}
.bio-body p {
  font-size: 15px; line-height: 1.85;
  color: var(--muted); font-weight: 300;
}

.about-ctas { display: flex; flex-direction: column; gap: 14px; }
.cta-arrow {
  display: flex; align-items: center; gap: 14px;
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text); width: fit-content;
  transition: gap .35s var(--ease), color .3s;
}
.cta-arrow svg { transition: transform .35s var(--ease); flex-shrink: 0; opacity: .7; }
.cta-arrow:hover { color: var(--black); gap: 20px; }
.cta-arrow:hover svg { transform: translateX(5px); opacity: 1; }

/* Photo */
.about-photo  { display: flex; justify-content: center; align-items: flex-start; padding-top: 8px; }
.photo-frame  { position: relative; width: clamp(240px, 28vw, 400px); aspect-ratio: 3/4; }
.headshot {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  border-radius: 3px;
  filter: grayscale(20%);
  transition: filter .7s;
}
.headshot:hover { filter: grayscale(0%); }
.headshot-placeholder {
  display: none;
  width: 100%; height: 100%;
  background: var(--bg-2);
  border-radius: 3px;
  align-items: center; justify-content: center;
  font-family: var(--ff-sans); font-size: 80px; color: var(--stone-lt);
}
.photo-deco {
  position: absolute; bottom: -18px; right: -18px;
  width: 68%; height: 68%;
  border: 1px solid var(--stone-lt); border-radius: 3px;
  z-index: -1;
  transition: transform .5s var(--ease);
}
.photo-frame:hover .photo-deco { transform: translate(5px, 5px); }

/* ---- SKILLS ---- */
.skills {
  padding: clamp(70px, 10vw, 130px) clamp(24px, 8vw, 120px);
  background: var(--bg-2);
}
.skills-inner { max-width: 1200px; margin: 0 auto; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.skill-card {
  background: var(--bg);
  border: 1px solid rgba(12,12,11,.065);
  border-radius: 10px;
  padding: 22px 12px 16px;
  display: flex; flex-direction: column;
  align-items: center; gap: 11px;
  cursor: none;
  transition: border-color .3s, box-shadow .35s;
  transform-style: preserve-3d;
  will-change: transform;
}
.skill-card:hover {
  border-color: rgba(12,12,11,.14);
  box-shadow: 0 10px 32px rgba(12,12,11,.08);
}
.skill-icon-wrap {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
}
.skill-icon    { width: 38px; height: 38px; object-fit: contain; }
.skill-emoji   { font-size: 32px; line-height: 1; }
.skill-name    {
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); text-align: center; line-height: 1.3;
}

/* ---- FOOTER ---- */
.footer {
  padding: clamp(40px, 5vw, 58px) clamp(24px, 8vw, 120px);
  background: var(--black);
  color: rgba(246,244,240,.88);
}
.footer-inner  { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.footer-top    { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 28px; }
.footer-logo-img {
  height: 54px; width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.88;
  display: block;
}
/* The stacked layout was built for icon + label rows. All the labels are
   gone now, so it runs as one row of equal round targets, ordered by how
   people actually reach out: mail, Instagram, LinkedIn, partnership. */
.footer-links  { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-link   {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; color: rgba(246,244,240,.5);
  letter-spacing: .04em;
  transition: color .3s, border-color .3s, background .3s;
}
.footer-link svg { width: 13px; height: 13px; flex-shrink: 0; }
.footer-link:hover { color: var(--bg); }

/* Bare glyphs read as debris; the ring gives each a real hit target (the
   raw 15px svg was well under a comfortable tap) and makes the row look
   deliberate rather than leftover. */
.footer-link--icon {
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(246,244,240,.16);
  gap: 0;
}
.footer-link--icon:hover {
  border-color: rgba(246,244,240,.4);
  background: rgba(246,244,240,.06);
}

.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
                 padding-top: 20px; border-top: 1px solid rgba(246,244,240,.08); }
.footer-copy   { font-size: 10.5px; color: rgba(246,244,240,.25); letter-spacing: .08em; text-transform: uppercase; }
.footer-nav    { display: flex; gap: 20px; }
.footer-nav a  { font-size: 11px; color: rgba(246,244,240,.3); letter-spacing: .08em;
                 text-transform: uppercase; transition: color .3s; }
.footer-nav a:hover { color: rgba(246,244,240,.7); }

/* ---- CONNECT BUTTONS (footer 3-button layout) ---- */
.connect-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 50px;
  font-family: var(--ff-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(246,244,240,.75);
  border: 1px solid rgba(246,244,240,.15);
  background: rgba(246,244,240,.06);
  transition: background .25s, color .25s, border-color .25s;
  text-decoration: none;
  white-space: nowrap;
}
.connect-btn:hover {
  background: rgba(246,244,240,.12);
  color: var(--bg);
  border-color: rgba(246,244,240,.3);
}
.connect-btn svg { flex-shrink: 0; }
@media (max-width: 600px) {
  .connect-btns { flex-direction: row; flex-wrap: wrap; }
}


/* ---- REVEAL (initial invisible for GSAP) ---- */
[data-reveal] { opacity: 0; transform: translateY(36px); }

/* ================================================================
   SUB-PAGE SHARED STYLES
   ================================================================ */
.page-header {
  /* one scale for every page top; skills, partnership and runclub set the
     same value on their own hero wrappers */
  padding: calc(var(--nav-h) + clamp(44px, 5vw, 72px)) clamp(24px, 8vw, 120px) clamp(32px, 4.5vw, 52px);
  background: var(--bg);
  max-width: 1200px; margin: 0 auto;
}
.page-header h1 {
  font-family: var(--ff-sans);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 300; letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: 16px;
  text-align: center;
}
.page-header p {
  font-size: 15px; color: var(--muted); font-weight: 300; line-height: 1.75;
  max-width: 560px;
  text-align: center;
  margin-left: auto; margin-right: auto;
}
/* the kicker is a flex row with a rule and a dot, so it centres on the axis */
.page-header .section-label { justify-content: center; }

.page-section {
  padding: clamp(28px, 4vw, 48px) clamp(24px, 8vw, 120px) clamp(48px, 7vw, 88px);
  max-width: 1200px; margin: 0 auto;
}

/* Project grid */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: clamp(20px, 3vw, 32px);
}
.project-card {
  background: var(--bg-2);
  border: 1px solid rgba(12,12,11,.06);
  border-radius: 12px; overflow: hidden;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
  cursor: none;
}
/* No lift. These cards are wide — the METCO one runs the full grid — and a
   6px jump on something that size reads as the whole section moving. The
   hover now just firms up the edge and settles a close shadow underneath,
   so the card looks picked out rather than detached. */
.project-card:hover {
  border-color: rgba(12,12,11,.17);
  box-shadow: 0 4px 20px rgba(12,12,11,.06);
}
.project-card-img {
  width: 100%; aspect-ratio: 16/9;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.project-card-img-placeholder {
  font-family: var(--ff-sans); font-size: 48px; color: var(--stone-lt);
  transition: transform .5s var(--ease);
}
.project-card:hover .project-card-img-placeholder { transform: scale(1.08); }
.project-card-body { padding: 24px 26px 28px; }
.project-card-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.tag {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px;
  background: rgba(12,12,11,.06); color: var(--muted);
}
.project-card h2 {
  font-family: var(--ff-sans); font-size: 26px; font-weight: 400;
  margin-bottom: 10px; line-height: 1.2;
}
.project-card p {
  font-size: 14px; color: var(--muted); line-height: 1.75;
  font-weight: 300; margin-bottom: 20px;
}
.project-link {
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 10px;
  transition: gap .3s var(--ease), color .3s;
}
.project-link svg { transition: transform .3s var(--ease); }
.project-link:hover { gap: 16px; color: var(--stone); }
.project-link:hover svg { transform: translateX(4px); }

/* Gallery grid (photography) */
.gallery-grid {
  columns: 3; column-gap: 16px;
}
.gallery-item {
  break-inside: avoid; margin-bottom: 16px;
  border-radius: 6px; overflow: hidden;
  background: var(--bg-3);
  aspect-ratio: var(--ar, 1);
  position: relative;
  transition: transform .4s var(--ease);
  cursor: none;
}
.gallery-item:hover { transform: scale(1.01); }
.gallery-placeholder {
  width: 100%; height: 100%; min-height: 200px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-sans); font-size: 20px; font-weight: 300;
  color: var(--stone-lt);
}

/* Back link */
.back-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--stone); margin-bottom: 32px;
  transition: color .3s, gap .3s var(--ease);
}
.back-link svg { transition: transform .3s var(--ease); }
.back-link:hover { color: var(--black); gap: 14px; }
.back-link:hover svg { transform: translateX(-4px); }

/* ================================================================
   RESPONSIVE SYSTEM
   ─── Desktop      › 1024px  (base styles above)
   ─── Tablet       640 – 1024px
   ─── Mobile       480 – 640px
   ─── Small mobile  0 – 480px
   ================================================================ */

/* ── Tablet (≤ 768px) ────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Prevent iOS zoom on any input focus */
  input, textarea, select { font-size: 16px !important; touch-action: manipulation; }

  /* Smaller placeholder text without breaking zoom prevention */
  .chat-input::placeholder { font-size: 11px; }
  .ds-modal-form input::placeholder,
  .ds-modal-form textarea::placeholder,
  .ds-modal-form select { font-size: 11px; }

  /* Partnership inquiry popup — smaller text on mobile */
  .ex-popup-heading { font-size: 16px; }
  .ex-popup-sub     { font-size: 11px; margin-bottom: 18px; }
  .ex-popup-btn     { font-size: 11px; padding: 11px 14px; gap: 10px; }
  .ex-popup-btn-icon { width: 26px; height: 26px; }

  /* Chat chips — single horizontal row */
  .chat-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
  }
  .chat-chips::-webkit-scrollbar { display: none; }
  .chat-chip {
    flex-shrink: 0;
    padding: 5px 10px;
    font-size: 10px;
  }

  /* Nav */
  .nav-links         { display: none; }
  .nav-menu-btn      { display: flex; }
  .nav-connect-mobile { display: flex; align-items: center; }

  /* Hero — shorter scroll travel on tablet */
  .hero-outer { height: 260vh; }

  /* About — single column, photo on top */
  .about { padding: clamp(64px, 9vw, 100px) clamp(24px, 6vw, 72px); }
  .about-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .about-photo { order: -1; justify-content: flex-start; }
  .photo-frame { width: min(300px, 60vw); }
  .photo-deco  { display: none; }  /* cleaner without deco on tablet */

  /* Bio layers — slightly tighter indent */
  .bio-l2 { padding-left: clamp(12px, 3vw, 36px); }
  .bio-l3 { padding-left: clamp(24px, 6vw, 72px); }

  /* Skills — 4 columns */
  .skills-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }

  /* Footer */
  .footer-top   { flex-direction: column; align-items: flex-start; gap: 20px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* Sub-pages */
  .project-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .gallery-grid { columns: 2; column-gap: 12px; }
  .page-section { padding-left: clamp(24px, 5vw, 72px); padding-right: clamp(24px, 5vw, 72px); }
  .page-header  { padding-left: clamp(24px, 5vw, 72px); padding-right: clamp(24px, 5vw, 72px); }
}

/* ── Mobile (≤ 640px) ─────────────────────────────────────────── */
@media (max-width: 640px) {

  /* Nav */
  .nav { padding: 0 18px; height: 60px; }
  .su-stamp { height: 42px; }

  /* Hero — compact scroll travel */
  .hero-outer { height: 230vh; }
  .ev-hero-img  { height: clamp(220px, 52vh, 420px); }
  .ev-speech    { font-size: 11px; padding: 7px 14px; }
  .scroll-hint  { bottom: 24px; }
  .scroll-line  { height: 32px; }

  /* About */
  .about { padding: 56px 20px 60px; }
  .about-inner { gap: 32px; }
  .about-photo { justify-content: center; }
  .photo-frame { width: min(240px, 72vw); }
  .section-label { margin-bottom: 24px; }

  .bio-l1, .bio-l2, .bio-l3 { font-size: clamp(22px, 6.5vw, 32px); }
  .bio-l2 { padding-left: 14px; }
  .bio-l3 { padding-left: 28px; }
  .bio-body { margin-bottom: 32px; }
  .bio-body p { font-size: 14px; line-height: 1.8; }
  .about-ctas { gap: 10px; }
  .cta-arrow  { font-size: 10.5px; }

  /* Skills */
  .skills { padding: 48px 20px 56px; }
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .skill-card { padding: 16px 8px 13px; gap: 8px; border-radius: 8px; }
  .skill-icon-wrap { width: 34px; height: 34px; }
  .skill-icon  { width: 30px; height: 30px; }
  .skill-emoji { font-size: 26px; }
  .skill-name  { font-size: 9.5px; }

  /* Footer */
  .footer { padding: 40px 20px 36px; }
  .footer-inner { gap: 24px; }
  .footer-logo  { font-size: 40px; }
  .footer-links { flex-direction: row; gap: 10px; }
  .footer-link  { font-size: 12px; }
  .footer-copy  { font-size: 9.5px; }
  .footer-nav   { gap: 14px; }
  .footer-nav a { font-size: 9.5px; }


  /* Sub-pages */
  .project-grid { grid-template-columns: 1fr; gap: 16px; }
  .project-card h2 { font-size: 22px; }
  .project-card p  { font-size: 13px; }
  .gallery-grid { columns: 2; column-gap: 10px; }
  .gallery-item { margin-bottom: 10px; }
  .page-header { padding-left: 20px; padding-right: 20px; }
  .page-header h1 { font-size: clamp(28px, 8vw, 40px); margin-bottom: 12px; }
  .page-header p  { font-size: 14px; }
  .page-section   { padding: 22px 20px 52px; }
  .back-link { margin-bottom: 20px; }
}

/* ── Small Mobile (≤ 420px) ──────────────────────────────────── */
@media (max-width: 420px) {

  /* Hero */
  .ev-hero-img { height: clamp(180px, 48vh, 320px); }

  /* Skills — 2 columns on very small screens */
  .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }

  /* About */
  .bio-l1, .bio-l2, .bio-l3 { font-size: 22px; }

  /* Gallery */
  .gallery-grid { columns: 1; }

  /* Footer */
  .footer-logo { font-size: 36px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .footer-nav { flex-wrap: wrap; gap: 10px; }

}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--stone-lt); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--stone); }

/* ---- SELECTION (defined at top of file in red) ---- */

/* ================================================================
   THEME TOGGLE + DARK MODE
   `js/theme.js` sets data-theme on <html> (saved choice, else OS
   preference) and injects the .theme-toggle button into the nav —
   or floating top-right on the landing page, which has no nav.
   (The always-dark product-design page that used to opt out of this
   was removed 2026-09-28; every remaining page loads theme.js.)
   ================================================================ */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(12,12,11,.14);
  background: transparent;
  color: var(--text);
  cursor: none;
  transition: background .25s, border-color .25s, color .25s, transform .25s;
}
.theme-toggle:hover { background: var(--bg-2); transform: rotate(12deg); }
.theme-toggle svg { position: absolute; transition: opacity .25s, transform .35s var(--ease); }
.theme-toggle .tt-moon           { opacity: 1; transform: scale(1); }
.theme-toggle .tt-sun            { opacity: 0; transform: scale(.5) rotate(-40deg); }
.theme-toggle.is-dark .tt-moon   { opacity: 0; transform: scale(.5) rotate(40deg); }
.theme-toggle.is-dark .tt-sun    { opacity: 1; transform: scale(1) rotate(0deg); }
.theme-toggle--floating {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 5000;
}

/* ---- DARK TOKENS ---- */
/* Dark tokens are contrast-measured against --bg, not eyeballed. Ratios in
   the comments are WCAG; AA wants 4.5:1 for normal text, and most of the
   labels using these are 10px or smaller, so they need the full 4.5.

   The old palette sat on #0e0d0c (near-black) with the LIGHT-mode red
   (#CC0000) bleeding through un-overridden — that red was 3.3:1 on this
   background, i.e. failing, on the small eyebrow labels it's used for. */
[data-theme="dark"] {
  --bg:       #171614;   /* lifted from #0e0d0c; --text still 14.9:1 */
  --bg-2:     #201e1b;   /* perceptible elevation step, was #191816 */
  --bg-3:     #2a2724;
  --black:    #ede9e2;   /* "strong text" token across components */
  --text:     #ede9e2;   /* 14.94:1 */
  --muted:    #bdb7ae;   /*  9.08:1 — was #9a948c at 6.46 */
  --stone:    #a8a29a;   /*  7.15:1 — was #8a8680 at 5.36 */
  --stone-lt: #56514a;   /* borders/dividers only, not text */

  /* Brand accents relit for a dark ground. The light-mode values are tuned
     against #F6F4F0 and are far too dark here. */
  --red:      #ea5a48;   /*  5.21:1 — was #CC0000 at 3.30, FAILING */
  --red-soft: rgba(234,90,72,.45);  /* keeps the cursor ring in step */
  --gold:     #dcb455;   /*  9.22:1 */
  --blue:     #84b4d2;   /*  8.13:1 */
}

/* ---- DARK COMPONENT FIXES (hard-coded light values) ---- */
[data-theme="dark"] .nav-scrolled {
  background: rgba(23,22,20,.90);
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
/* Nav logo image is dark-on-transparent with multiply blend — flip it */
[data-theme="dark"] .su-stamp {
  filter: brightness(0) invert(1);
  mix-blend-mode: normal;
  opacity: .9;
}
[data-theme="dark"] .theme-toggle { border-color: rgba(255,255,255,.16); }

/* Footer: --black flips to cream in dark mode, so give the footer an
   explicit dark surface instead of `background: var(--black)`. */
[data-theme="dark"] .footer {
  background: var(--bg-2);
  border-top: 1px solid rgba(255,255,255,.06);
}
[data-theme="dark"] .footer-link:hover { color: var(--text); }
[data-theme="dark"] .connect-btn:hover { color: var(--text); }

/* Borders/shadows hard-coded as near-black ink — flip to white ink */
/* Card edges were so faint the content read as floating on a flat void —
   half the "too dark to see" problem was missing structure, not contrast.
   Light mode gets its definition from a real border; dark needs the same. */
[data-theme="dark"] .exp-card,
[data-theme="dark"] .project-card {
  border-color: rgba(255,255,255,.14);
  background: var(--bg-2);
  box-shadow: none;
}
[data-theme="dark"] .exp-card:hover,
[data-theme="dark"] .project-card:hover {
  border-color: rgba(255,255,255,.3);
  box-shadow: none;
}
[data-theme="dark"] .exp-tag,
[data-theme="dark"] .tag { border-color: rgba(255,255,255,.18); }

/* Highlighter marks. The base rule used to live inline on the app-dev page
   inside a block that has since been removed; it sits here now, next to its
   dark-mode counterpart, because the hero still uses it. */
.hl {
  background: linear-gradient(180deg, transparent 55%, #FFE680 55%, #FFE680 95%, transparent 95%);
  padding: 0 2px;
  font-weight: 500;
  color: inherit;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Solid pale yellow behind cream text is unreadable in dark mode. Gold was
   the first attempt but it composites to rgb(83,68,31) over this ground — a
   muddy khaki that reads as dirt rather than emphasis. The brand coral
   (--red, #ea5a48) at .30 lands on a warm rust that looks deliberate and
   ties the highlight to the accent used everywhere else on the site. */
[data-theme="dark"] .hl {
  background: linear-gradient(180deg, transparent 55%, rgba(234,90,72,.30) 55%, rgba(234,90,72,.30) 95%, transparent 95%);
}

/* Landing page art: dark ink pieces blended with multiply — re-blend for dark */
[data-theme="dark"] .landing-logo {
  mix-blend-mode: screen;
  filter: invert(1);
}
/* Fingerprint: black print on white; invert to white print, keep bg black
   so it melts into the dark page */
[data-theme="dark"] .fp-base {
  filter: invert(1) grayscale(1) brightness(.75) opacity(.65);
}
[data-theme="dark"] .fp-ring.is-holding  .fp-base,
[data-theme="dark"] .fp-ring.is-complete .fp-base {
  filter: invert(1) grayscale(1) brightness(.75) opacity(0);
}
[data-theme="dark"] .fp-colored {
  filter: invert(1) sepia(1) saturate(8) hue-rotate(328deg);
}

/* Language toggle — shares the .theme-toggle chrome; shows 中 / EN */
.lang-toggle {
  font-family: var(--ff-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
}
.lang-toggle--floating { top: 64px; }

/* Theme + language toggles read as one control group, so they sit
   tighter than the 38px nav gap between the text links. */
.nav-links li:has(.theme-toggle) + li:has(.theme-toggle) { margin-left: -28px; }
