/* ============================================
   HARRIET WANG — v3
   Almost white · One accent · Images · Readable
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Ibarra+Real+Nova:ital,wght@0,400..700;1,400..700&family=Inter:ital,opsz,wght@0,14..32,300..700;1,14..32,400..500&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg:       #FAFAF8;
  --surface:  #F3F2EF;
  --ink:      #14140F;
  --mid:      #4A4845;
  --faint:    #E0DED9;
  --accent:   #0D29BB;   /* blue heart */
  --orange:   #DF5B01;   /* orange heart — decorative/large-text/border use (3:1 AA-large is enough) */
  --orange-text: #B84600; /* darker variant for small running text — passes 4.5:1 AA on --bg */

  /* display: serif close to Ibarra Real Nova · retro mono: SF Mono w/ DM Mono fallback · body: Inter */
  --serif:  'Ibarra Real Nova', 'DM Serif Display', Georgia, serif;
  --sans:   'Inter', 'DM Sans', system-ui, sans-serif;
  --mono:   ui-monospace, 'SF Mono', 'SFMono-Regular', Menlo, Consolas, 'DM Mono', monospace;

  --nav-h:  60px;
  --max-w:  1100px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 0px;   /* brutalist: square corners everywhere except the pill nav + CTA pill */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.6; overflow-x: hidden;
}
/* cursor:none only applies once main.js confirms the custom cursor actually initialized —
   see initCursor() in main.js. This means if JS fails to load, people keep a normal
   pointer instead of losing the cursor entirely. */
.has-custom-cursor,
.has-custom-cursor a, .has-custom-cursor button, .has-custom-cursor .project-card, .has-custom-cursor .project-card *,
.has-custom-cursor [data-cursor],
.has-custom-cursor #clippy, .has-custom-cursor #clippy *, .has-custom-cursor #clippy-paper,
.has-custom-cursor input, .has-custom-cursor select, .has-custom-cursor textarea,
.has-custom-cursor [role="button"], .has-custom-cursor .glow-word, .has-custom-cursor .nav__link {
  cursor: none;
}

/* ── KEYBOARD FOCUS ──
   Custom, on-brand focus ring — shows only for keyboard navigation (:focus-visible),
   never on mouse clicks, so it doesn't clash with the custom cursor. */
a:focus-visible, button:focus-visible, input:focus-visible,
[role="button"]:focus-visible, .project-card:focus-visible,
.carousel-btn:focus-visible, .nav__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.btn-pill:focus-visible { outline-offset: 4px; }

/* ── CUSTOM CURSOR ── */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 99999;
  pointer-events: none; display: flex; align-items: flex-start; gap: 8px;
  opacity: 0; transition: opacity 0.15s;
  will-change: transform;
}
.cursor__arrow {
  width: 22px; height: 22px; flex-shrink: 0;
  transition: width .18s ease, height .18s ease;
  display: block;
}
.cursor__label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em;
  background: var(--ink); color: var(--bg);
  padding: 3px 8px; border-radius: 4px;
  white-space: nowrap;
  opacity: 0; transform: translateY(3px) translateX(-4px);
  transition: opacity .18s ease, transform .18s ease;
  margin-top: 4px;
}
.cursor.is-hover .cursor__label { opacity: 1; transform: none; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ============================================  BRAND MARK (static, scrolls away — NOT part of the floating nav)  */
.brand-strip { padding: 26px var(--gutter) 0; position: relative; z-index: 90; }
.brand {
  display: inline-flex; align-items: center; gap: 0;
}
.brand__clover { height: 24px; width: auto; display: block; }
.brand__clover + .brand__clover { margin-left: -8px; }
.brand__dash { width: 24px; height: 1.5px; background: var(--ink); margin-left: 10px; }

/* ============================================  NAV (sticky → floating pill on scroll)  */
.nav {
  position: sticky; top: 0; z-index: 100;
  padding: 14px var(--gutter);
  transition: padding 0.35s ease;
}
.nav__pill {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 4px;
  border-radius: 0;
  transition: background 0.35s ease, box-shadow 0.35s ease, padding 0.35s ease, border-radius 0.35s ease, border-color 0.35s ease;
}

/* lifted pill once scrolled */
.nav.scrolled { padding-top: 10px; }
.nav.scrolled .nav__pill {
  background: linear-gradient(155deg, rgba(255,255,255,0.55), rgba(250,250,248,0.42) 40%, rgba(250,250,248,0.55));
  border: 1px solid rgba(255,255,255,0.55);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-radius: 16px;
  padding: 12px 22px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.75),
    inset 0 0 0 1px rgba(255,255,255,0.12),
    0 1px 0 rgba(20,20,15,0.06),
    0 14px 34px -16px rgba(20,20,15,0.32);
}

.nav__brandtext { display: flex; flex-direction: column; line-height: 1.2; gap: 1px; }
.nav__name {
  font-family: var(--serif); font-weight: 700; font-size: 1.125rem; color: var(--ink);
  letter-spacing: 0.01em;
}
.nav__tagline {
  font-family: var(--mono); font-size: 0.6875rem; color: var(--orange-text);
  letter-spacing: 0.02em;
}

.nav__links { display: flex; align-items: center; gap: 2.25rem; list-style: none; }
.nav__link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.875rem; font-weight: 500; color: var(--ink); letter-spacing: 0.01em;
  transition: color 0.18s, font-style 0.18s;
  position: relative; padding-bottom: 2px;
}
.nav__heart { position: relative; width: 15px; height: 15px; flex-shrink: 0; }
.nav__heart img { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.2s ease; }
.nav__heart .h-blue { opacity: 0; }

/* ( and ) revealed on hover / active */
.nav__link::before { content: '('; opacity: 0; transform: translateX(-3px); transition: opacity 0.2s, transform 0.2s; display: inline-block; }
.nav__link::after  { content: ')'; opacity: 0; transform: translateX( 3px); transition: opacity 0.2s, transform 0.2s; display: inline-block; }

.nav__link:hover        { color: var(--accent); font-style: italic; }
.nav__link.active       { color: var(--accent); font-style: italic; }

.nav__link:hover::before,  .nav__link:hover::after  { opacity: 1; transform: translateX(0); }
.nav__link.active::before, .nav__link.active::after { opacity: 1; transform: translateX(0); }

.nav__link:hover .h-blue, .nav__link.active .h-blue   { opacity: 1; }
.nav__link:hover .h-orange, .nav__link.active .h-orange { opacity: 0; }

@media (max-width: 720px) {
  .brand-strip { padding: 16px 20px 0; }
  .nav { padding: 10px 20px; }
  .nav__links { gap: 20px; }
  .nav__link { font-size: 0.78rem; gap: 5px; }
  .nav__heart { width: 12px; height: 12px; }
}

/* ============================================  LAYOUT  */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gutter); }
hr.rule { border: none; border-top: 1px solid var(--faint); }

/* ============================================  HERO  */
.hero { padding-top: clamp(2.5rem, 6vh, 4rem); padding-bottom: clamp(3.5rem, 8vh, 5.5rem); }

/* Two-column hero layout */
.hero__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 6vw, 6rem);
  align-items: start;
}
.hero__left { min-width: 0; }
.hero__right { display: flex; justify-content: flex-end; align-items: flex-start; }
.hero__photo-outer { position: relative; width: 100%; max-width: 380px; padding: 22px 0 56px; }
.hero__photo-wrap {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 0;
  overflow: hidden;
  background: #DCDBD7;
  border: none;
  position: relative;
  z-index: 3;
}
.hero__photo {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center; display: block;
}
.hero__deco { position: absolute; pointer-events: none; user-select: none; }
.hero__deco--blossom { width: 46%; left: -18%; bottom: 6%; z-index: 1; transform: rotate(-6deg); }
.hero__deco--butterfly { width: 42%; right: -18%; top: 2%; z-index: 2; transform: rotate(4deg); }

.hero__status {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.75rem; color: var(--mid);
  letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 1.75rem;
}
.hero__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; animation: blink 2.5s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.35} }

.hero__headline {
  position: relative;
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2rem, 4vw, 2.95rem);
  line-height: 1.16; letter-spacing: -0.01em;
  color: var(--ink); margin-bottom: 1.75rem; max-width: 700px;
}
.hero__headline em { font-style: italic; }

/* cursor radial glow — tracks across the whole headline, all words */
.hero__headline-glow { position: relative; display: block; }
.hero__headline-glow .glow-base { color: var(--ink); display: block; }
.hero__headline-glow .glow-layer {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  color: transparent; display: block;
  background: radial-gradient(circle 0px at 50% 50%, var(--accent) 0%, transparent 100%);
  -webkit-background-clip: text; background-clip: text;
  pointer-events: none;
}

.hero__body {
  font-family: var(--sans);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--ink); max-width: 500px; line-height: 1.65;
  font-weight: 400; margin-bottom: 2.25rem;
}
.hero__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.hero__actions { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }

.btn-pill {
  display: inline-block;
  background: var(--ink); color: var(--bg);
  font-family: var(--mono); font-size: 0.9rem;
  padding: 13px 26px; border-radius: 999px; border: 1.5px solid var(--ink);
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-pill:hover { background: var(--bg); color: var(--ink); }

.link-primary {
  font-size: 0.875rem; font-weight: 500; color: var(--ink);
  border-bottom: 1.5px solid var(--ink); padding-bottom: 1px;
  letter-spacing: 0.01em; transition: color 0.18s, border-color 0.18s;
}
.link-primary:hover { color: var(--accent); border-color: var(--accent); }

.link-muted { font-size: 0.875rem; color: var(--mid); transition: color 0.18s; }
.link-muted:hover { color: var(--ink); }
.link-inline {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 2px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
.link-inline:hover { color: var(--accent); text-decoration-color: currentColor; }

/* ============================================  SECTION LABELS  */
.section-label {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 400; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink); margin-bottom: 2rem;
}

/* ============================================  WIP BANNER  */
.wip-banner {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border: 1.5px solid var(--ink); border-radius: 0;
  background: var(--bg); margin-bottom: 2.5rem;
}
.wip-banner__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; animation: blink 2s ease-in-out infinite; }
.wip-banner p { font-size: 0.875rem; color: var(--mid); }
.wip-banner strong { color: var(--ink); font-weight: 500; }

/* ============================================  PROJECT GRID  */
.projects { padding: clamp(3rem, 7vw, 5.5rem) 0; }

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ── HORIZONTAL PROJECT CAROUSEL (homepage) ── */
.project-carousel { position: relative; }
.project-carousel__track {
  display: flex; gap: 1.25rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 14px 4px 22px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.project-carousel__track::-webkit-scrollbar { display: none; }
.project-carousel__track .project-card {
  flex: 0 0 340px; scroll-snap-align: start; flex-direction: column;
}
.project-carousel__track .project-card--star {
  flex: 0 0 420px; flex-direction: column;
}
.project-carousel__track .project-card--star .project-card__thumb {
  width: 100%; aspect-ratio: 16/10; min-height: unset;
}
.project-carousel__track .project-card--star .project-card__body {
  padding: 1.5rem; justify-content: flex-start;
}
.project-carousel__track .project-card--star .project-card__title { font-size: 1.375rem; }

.project-carousel__controls {
  display: flex; align-items: center; gap: 14px;
  margin-top: 1.5rem;
}
.carousel-btn {
  width: 34px; height: 34px; flex-shrink: 0;
  border: 1.5px solid var(--ink); background: var(--bg); color: var(--ink);
  font-family: var(--mono); font-size: 0.9rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s ease, color 0.18s ease;
}
.carousel-btn:hover { background: var(--ink); color: var(--bg); }
.project-carousel__bar {
  flex: 1; height: 3px; background: var(--faint); position: relative; cursor: pointer;
}
.project-carousel__thumb {
  position: absolute; top: 0; left: 0; height: 100%;
  background: var(--ink); width: 20%;
  transition: background 0.18s ease;
}
.project-carousel__bar:hover .project-carousel__thumb { background: var(--accent); }

@media (max-width: 640px) {
  .project-carousel__track .project-card,
  .project-carousel__track .project-card--star { flex-basis: 82vw; }
}

/* Mini cards — "More work" carousel on project detail pages */
.more-work { padding: clamp(3rem,7vw,5.5rem) 0; border-top: 1.5px solid var(--ink); }
.project-carousel__track .project-card--mini {
  flex: 0 0 260px; flex-direction: column;
}
.project-carousel__track .project-card--mini .project-card__thumb {
  aspect-ratio: 4/3; min-height: unset;
}
.project-carousel__track .project-card--mini .project-card__body {
  padding: 1rem 1.125rem; gap: 0.4rem;
}
.project-carousel__track .project-card--mini .project-card__title { font-size: 1.0625rem; }

.project-card {
  display: flex; flex-direction: column;
  border: 1.5px solid var(--ink); border-radius: 0;
  background: var(--bg); overflow: hidden;
  transition: box-shadow 0.22s ease, transform 0.22s ease;
  cursor: pointer; text-decoration: none; color: inherit;
}
.project-card:hover { transform: translateY(-3px); box-shadow: 6px 6px 0 var(--ink); }

.project-card__thumb {
  width: 100%; aspect-ratio: 16/9; overflow: hidden;
  background: var(--surface); flex-shrink: 0;
}
.project-card__thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}


/* placeholder color-blocks for cards without images */
.thumb--blue   { background: #E8EFFA; }
.thumb--slate  { background: #EAEBEE; }
.thumb--warm   { background: #F2EDE6; }
.thumb--green  { background: #E6F0EA; }
.thumb--dashed { background: var(--surface); border: 2px dashed var(--faint); }

.project-card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.625rem; flex: 1; }

.project-card__tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.125rem; }
.tag {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--mid);
  padding: 0.2rem 0.55rem; border: 1px solid var(--mid); border-radius: 0;
}
.tag--accent   { color: var(--accent); border-color: var(--accent); }
.tag--green    { color: var(--accent); border-color: var(--accent); }
.tag--featured { color: var(--orange-text); background: transparent; border-color: var(--orange); }

.project-card__title { font-family: var(--serif); font-size: 1.375rem; font-weight: 400; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink); }

.project-card__desc { font-size: 0.9375rem; color: var(--ink); line-height: 1.65; font-weight: 400; }

.project-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 0.875rem;
  border-top: 1px solid var(--faint);
}
.project-card__stats { display: flex; gap: 1.25rem; }
.stat__num  { font-family: var(--serif); font-size: 1.25rem; color: var(--ink); line-height: 1; display: block; letter-spacing: -0.02em; }
.stat__label { font-family: var(--mono); font-size: 0.6875rem; color: var(--mid); letter-spacing: 0.05em; text-transform: uppercase; }
.project-card__arrow { font-size: 0.9375rem; color: var(--faint); transition: color 0.18s, transform 0.18s; }
.project-card:hover .project-card__arrow { color: var(--accent); transform: translate(2px,-2px); }

/* ── CARD CTA BUTTONS ── */
.card-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 8px 14px; border-radius: 0; border: 1.5px solid var(--ink);
  white-space: nowrap; flex-shrink: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.card-btn--primary {
  background: var(--ink); color: var(--bg);
}
.project-card:hover .card-btn--primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.card-btn--wip {
  background: transparent; color: var(--mid);
  border-color: var(--faint);
}
.project-card:hover .card-btn--wip {
  border-color: var(--mid);
}

/* ── CARD CLICK EXIT ANIMATION ── */
@keyframes card-leave {
  0%   { opacity: 1; transform: translateY(-2px) scale(1); box-shadow: 0 0 0 2px var(--accent); }
  35%  { opacity: 1; transform: translateY(-2px) scale(1); box-shadow: 0 0 0 2px var(--accent); }
  100% { opacity: 0; transform: translateY(-10px) scale(1.01); box-shadow: none; }
}
.project-card.is-leaving {
  animation: card-leave 0.32s ease forwards !important;
  pointer-events: none; z-index: 5;
  border-color: var(--accent);
}

/* ── PAGE ENTER ANIMATION ── */
/* Body fades in — NO transform here; transform on body breaks position:fixed (cursor, nav) */
@keyframes page-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* Content slides up independently */
@keyframes page-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
body { animation: page-fade-in 0.25s ease both; }
.hero, .projects, .experience, .project-page, main, article {
  animation: page-slide-up 0.45s ease both;
}

/* NOTE: .project-card--star intentionally has NO grid-column/layout override
   here — homepage cards are a plain, uniform 2-col grid regardless of the
   `star` flag in projects-data.js. The "★ Featured" tag still renders via the
   tags array, it just no longer changes the card's size/layout on the
   homepage. (Still used for a wider card treatment in the "More work"
   carousel only — see .project-carousel__track .project-card--star above.) */

/* legacy alias kept for safety */
.project-card--full { grid-column: 1 / -1; flex-direction: row; }
.project-card--full .project-card__thumb { width: 42%; aspect-ratio: unset; min-height: 220px; }
.project-card--full .project-card__body  { padding: 2rem; }
.project-card--full .project-card__title { font-size: 1.625rem; }

/* fun/hackathon */
.project-card--fun { border-style: dashed; }

/* ============================================  EXPERIENCE  */
.experience { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1.5px solid var(--ink); }

.exp-item {
  display: grid; grid-template-columns: 160px 1fr;
  gap: 2rem; padding: 1.5rem 0; border-bottom: 1px solid var(--faint);
}
.exp-item:first-of-type { border-top: none; }
.exp-item__date { font-family: var(--mono); font-size: 0.75rem; color: var(--mid); padding-top: 0.2rem; }
.exp-item__role { font-family: var(--serif); font-size: 1.1875rem; font-weight: 400; letter-spacing: -0.01em; margin-bottom: 0.2rem; }
.exp-item__co   { font-family: var(--sans); font-weight: 600; font-size: 0.8125rem; color: var(--ink); margin-bottom: 0.5rem; }
.exp-item__desc { font-size: 0.875rem; color: var(--mid); line-height: 1.65; max-width: 460px; }

/* ============================================  FOOTER  */
.footer {
  position: relative; overflow: hidden;
  background: var(--bg); color: var(--ink);
  padding: clamp(4rem,9vw,6.5rem) 0 2.5rem;
  border-top: 1.5px solid var(--ink);
}
.footer__content { position: relative; z-index: 1; }
.footer__label {
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--mid); margin-bottom: 0.875rem;
}
.footer__headline {
  font-family: var(--serif); font-size: clamp(2.6rem, 6.5vw, 4.5rem);
  font-weight: 400; letter-spacing: -0.02em; line-height: 1;
  color: var(--ink); margin-bottom: 2.75rem;
}
.footer__headline em { font-style: italic; color: var(--accent); }
.footer-next-link { display: inline-block; transition: color 0.2s ease, transform 0.2s ease; }
.footer-next-link:hover { color: var(--accent); transform: translateX(4px); }
.footer-next-link:hover em { color: var(--orange); }
.footer__links { display: flex; gap: 2rem; flex-wrap: wrap; margin-bottom: 3.5rem; font-family: var(--mono); }
.footer__link {
  font-size: 0.9375rem; color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}
.footer__link:hover { color: var(--accent); border-color: var(--accent); }

.footer__bottom {
  display: flex; align-items: center; gap: 0.625rem;
  padding-top: 1.5rem; border-top: 1px solid var(--ink);
  flex-wrap: wrap;
  position: relative; z-index: 1;
}
.footer__bottom-clover { width: 18px; height: 18px; display: block; }
.footer__bamboo,
.footer-deco {
  position: absolute;
  right: 2%;
  bottom: 10%;
  width: clamp(220px, 24vw, 400px);
  height: auto;
  opacity: 0.96;
  pointer-events: none;
  z-index: 0;
}
.footer__sig {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--mid); letter-spacing: 0.06em;
}
.footer__closing {
  font-family: var(--mono); font-style: normal;
  font-size: 0.75rem; color: var(--mid); letter-spacing: 0.02em;
  margin-left: auto;
}

/* ============================================  FADE-IN  */
.fade-in { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: none; }


/* ============================================  ABOUT PAGE  */
.about-hero { padding-top: clamp(1.5rem,4vh,2.5rem); padding-bottom: clamp(3.5rem,8vh,5.5rem); position: relative; overflow: hidden; }
.about-canvas-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
#about-canvas { width: 100%; height: 100%; }
.about-hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }

.about-hero__eyebrow { font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mid); margin-bottom: 1.25rem; }
.about-hero__name { font-family: var(--serif); font-size: clamp(3rem, 6vw, 5.25rem); font-weight: 400; letter-spacing: -0.04em; line-height: 0.95; margin-bottom: 1.75rem; }
.about-hero__name .zh { display: block; font-size: 0.45em; letter-spacing: 0.12em; color: var(--accent); opacity: 0.75; font-style: italic; margin-top: 0.3em; }
.about-hero__bio { font-size: clamp(0.9375rem, 1.4vw, 1.0625rem); color: var(--mid); line-height: 1.75; font-weight: 400; margin-bottom: 1.75rem; max-width: 480px; }

.about-hero__photo-outer { position: relative; width: 100%; padding: 18px 8px 48px; }
.about-hero__photo { border-radius: 0; overflow: hidden; border: none; aspect-ratio: 4/5; background: #DCDBD7; display: flex; align-items: center; justify-content: center; position: relative; z-index: 3; }
.about-hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.about-hero__deco { position: absolute; pointer-events: none; user-select: none; filter: drop-shadow(3px 5px 0 rgba(0,0,0,0.12)); }
.about-hero__deco--kirby { width: 30%; left: -13%; bottom: 4%; z-index: 4; transform: rotate(-8deg); }
.about-hero__deco--plumbob { width: 16%; right: -7%; top: -6%; z-index: 2; transform: rotate(10deg); }
.about-bio-section { padding: clamp(3rem,7vw,5rem) 0; border-top: 1.5px solid var(--ink); }
.about-bio-section p { font-size: clamp(0.9375rem,1.4vw,1.0625rem); color: var(--mid); line-height: 1.8; max-width: 600px; margin-bottom: 1.25rem; }
.about-bio-section p:last-of-type { margin-bottom: 2rem; }

.skills-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--ink); border: 1.5px solid var(--ink); border-radius: 0; overflow: hidden; margin-top: 2rem; }
.skill-item { background: var(--bg); padding: 1.625rem; }
.skill-item__icon { font-size: 1.25rem; margin-bottom: 0.75rem; }
.skill-item__title { font-family: var(--serif); font-size: 1rem; font-weight: 400; margin-bottom: 0.5rem; }
.skill-item__list { font-family: var(--mono); font-size: 0.6875rem; color: var(--mid); line-height: 2.1; letter-spacing: 0.02em; }

.outside-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 2rem; }
.outside-card { padding: 1.625rem; border: 1.5px solid var(--ink); border-radius: 0; background: var(--bg); }
.outside-card__emoji { font-size: 1.375rem; margin-bottom: 0.875rem; }
.outside-card__title { font-family: var(--serif); font-size: 1.0625rem; font-weight: 400; margin-bottom: 0.5rem; }
.outside-card__body { font-size: 0.875rem; color: var(--mid); line-height: 1.7; }
.outside-card__quote { margin-top: 1rem; font-family: var(--serif); font-style: italic; font-size: 0.875rem; color: var(--accent); line-height: 1.6; border-left: 2px solid var(--orange); padding-left: 0.75rem; }

/* ============================================  ABOUT PAGE — LIFE OUTSIDE WORK (2 exploratory options) */

/* ABOUT PAGE — LIFE OUTSIDE WORK: Instagram-style square grid */
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.ig-cell { aspect-ratio: 1; overflow: hidden; }
.ig-cell__ph, .ig-cell img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ig-cell__ph {
  background: #DCDBD7; display: flex; align-items: center; justify-content: center;
  transition: filter 0.2s ease;
}
.ig-cell:hover .ig-cell__ph { filter: brightness(0.94); }
.ig-cell__ph span {
  font-family: var(--mono); font-size: 0.6875rem; color: var(--mid); opacity: 0.4;
  text-align: center; padding: 0 8px; letter-spacing: 0.02em;
}
@media (max-width: 560px) {
  .ig-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================  PROJECT DETAIL  */
.project-hero { padding-top: clamp(1.5rem,4vh,3rem); padding-bottom: clamp(2.5rem,5vh,4rem); border-bottom: 1.5px solid var(--ink); }
.back-link { display: inline-flex; align-items: center; gap: 0.375rem; font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mid); margin-bottom: 2.25rem; transition: color 0.18s; }
.back-link:hover { color: var(--accent); }
.tag-row { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.project-title { font-family: var(--serif); font-size: clamp(2.25rem,5.5vw,4.5rem); font-weight: 400; letter-spacing: -0.04em; line-height: 1.0; color: var(--ink); margin-bottom: 1.125rem; max-width: 820px; }
.project-sub { font-size: clamp(0.9375rem,1.4vw,1.0625rem); color: var(--mid); max-width: 540px; line-height: 1.75; margin-bottom: 2.25rem; }

.stats-row { display: flex; border: 1.5px solid var(--ink); border-radius: 0; overflow: hidden; margin-bottom: 2.25rem; }
.stat-block { flex: 1; padding: 1.375rem 1.5rem; border-right: 1px solid var(--faint); }
.stat-block:last-child { border-right: none; }
.stat-block__num { font-family: var(--serif); font-size: 1.875rem; color: var(--accent); line-height: 1; display: block; margin-bottom: 0.375rem; letter-spacing: -0.03em; }
.stat-block__label { font-family: var(--mono); font-size: 0.6875rem; color: var(--mid); line-height: 1.5; letter-spacing: 0.02em; }

.project-meta { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.5rem; padding-top: 2rem; border-top: 1.5px solid var(--ink); }
.project-meta__label { font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mid); display: block; margin-bottom: 0.3rem; }
.project-meta__value { font-size: 0.875rem; color: var(--ink); line-height: 1.5; }

/* Project body */
.project-body { padding: clamp(3rem,7vw,5.5rem) 0; }
.project-body__layout { display: grid; grid-template-columns: 200px 1fr; gap: 4rem; align-items: start; }
.project-body__sidebar { position: sticky; top: calc(var(--nav-h) + 2rem); }
.toc-link { display: block; font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mid); padding: 0.375rem 0 0.375rem 1rem; border-left: 1px solid var(--faint); transition: color 0.18s, border-color 0.18s; }
.toc-link:hover, .toc-link.active { color: var(--accent); border-left-color: var(--accent); }

.project-section { margin-bottom: 3.25rem; padding-bottom: 3.25rem; border-bottom: 1px solid var(--faint); }
.project-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.project-section__label { font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mid); margin-bottom: 0.875rem; }
.project-section__heading { font-family: var(--serif); font-size: clamp(1.25rem,2.2vw,1.75rem); font-weight: 400; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink); margin-bottom: 1.125rem; max-width: 560px; }
.project-section__body { font-size: 0.9375rem; color: var(--mid); line-height: 1.8; max-width: 600px; margin-bottom: 1rem; }
.project-section__body:last-child { margin-bottom: 0; }

/* Project images */
.project-img { width: 100%; border-radius: 0; overflow: hidden; border: none; margin: 1.5rem 0; background: var(--surface); }
.project-img img { width: 100%; display: block; }
.project-img-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; }
.project-img-grid .project-img { margin: 0; }
.img-caption { font-family: var(--mono); font-size: 0.6875rem; color: var(--mid); letter-spacing: 0.04em; margin-top: 0.5rem; line-height: 1.5; opacity: 0.85; }

/* Static image (back layer) + autoplay/looped video framed on top of it.
   Tune position/size here — all 3 knobs are relative to the image, so they
   hold up across breakpoints without extra media queries. */
.project-img--framed { position: relative; }
.project-img__bg { width: 100%; display: block; }
.project-img__video-frame {
  --frame-w: 17.7%;    /* frame width, relative to the static image — matched to the phone screen's actual pixel bounds */
  --frame-h: 67.5%;    /* frame height — matched to the phone screen's actual pixel bounds */
  --frame-left: 14%;   /* left edge, matched to the phone screen's actual pixel bounds */
  --frame-top: 17.5%;  /* top edge, matched to the phone screen's actual pixel bounds */
  position: absolute;
  top: var(--frame-top);
  left: var(--frame-left);
  width: var(--frame-w);
  height: var(--frame-h);
  overflow: hidden;
  background: #000; /* shows as a clean dark frame if the video is still loading */
  box-shadow: 0 10px 34px rgba(0,0,0,0.28);
}
.project-img__video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============================================  BAMBOO DECORATIONS  */
.bamboo-deco { display: none; } /* legacy, superseded by illustration decos below */

.deco { position: absolute; pointer-events: none; user-select: none; }

/* Hero decorations — index page (blossom + butterfly, defined near .hero__photo-outer) */
.hero { position: relative; overflow: hidden; }

/* About hero decoration */
.about-hero { position: relative; }
.about-hero__deco {
  width: clamp(140px, 14vw, 210px);
  right: 4%; top: -8%; z-index: 2;
}

.about-photo { position: relative; margin: 10px 0 0; }
.about-photo__frame { overflow: hidden; }
.about-photo__frame img { width: 100%; display: block; filter: saturate(0.85) sepia(0.12) hue-rotate(200deg); }
.about-photo__deco { width: clamp(130px, 13vw, 190px); top: -14%; right: 6%; z-index: 2; }

.exp-photo-deco { width: clamp(110px, 11vw, 170px); right: -4%; bottom: -12%; z-index: 2; }

/* Keep hero text above decorations */
.hero .container,
.about-hero__inner {
  position: relative;
  z-index: 1;
}

/* ============================================  RESPONSIVE  */
@media (max-width: 860px) {
  .hero__cols { grid-template-columns: 1fr; }
  .hero__right { justify-content: flex-start; }
  .hero__photo-outer { max-width: 280px; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card--star { flex-direction: column; }
  .project-card--star .project-card__thumb { width: 100%; aspect-ratio: 16/9; min-height: unset; }
  .project-card--full { flex-direction: column; }
  .project-card--full .project-card__thumb { width: 100%; aspect-ratio: 16/9; }
  .about-hero__inner { grid-template-columns: 1fr; }
  .about-hero__photo-outer { max-width: 320px; }
  .exp-item { grid-template-columns: 1fr; gap: 0.2rem; }
  .project-meta { grid-template-columns: 1fr 1fr; }
  .project-body__layout { grid-template-columns: 1fr; }
  .project-body__sidebar { display: none; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .outside-grid { grid-template-columns: 1fr; }
  .stats-row { flex-wrap: wrap; }
  .stat-block { flex: 1 1 calc(50% - 1px); }
}
@media (max-width: 560px) {
  .hero__headline { font-size: 2.125rem; }
  .project-img-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .footer__headline { font-size: 2.5rem; }
  .deco { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .fade-in { opacity: 1; transform: none; }
}

/* ============================================  PASSWORD GATE  ============ */
/* Lightweight client-side gate for pages not ready to be fully public yet.
   Not real security (visible in page source) — this is a friction-reducer
   for a shared preview link, not an access-control system. */
.gate-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.gate-card {
  width: 100%; max-width: 380px; margin: 0 1.5rem;
  border: 1.5px solid var(--ink); background: var(--surface);
  padding: clamp(2rem, 5vw, 2.75rem) clamp(1.75rem, 5vw, 2.25rem);
  text-align: center;
}
.gate-card__mark { display: flex; justify-content: center; gap: 2px; margin-bottom: 1.25rem; }
.gate-card__mark img { width: 22px; height: 22px; }
.gate-card__title {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 400;
  letter-spacing: -0.01em; color: var(--ink); margin-bottom: 0.5rem;
}
.gate-card__body { font-size: 0.875rem; color: var(--mid); line-height: 1.6; margin-bottom: 1.75rem; }
.gate-card__form { display: flex; flex-direction: column; gap: 0.75rem; }
.gate-card__input {
  font-family: var(--mono); font-size: 0.95rem; letter-spacing: 0.02em;
  text-align: center; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--ink); padding: 12px 16px; width: 100%;
}
.gate-card__input::placeholder { color: var(--mid); opacity: 0.7; }
.gate-card__submit {
  font-family: var(--mono); font-size: 0.9rem; letter-spacing: 0.01em;
  background: var(--ink); color: var(--bg); border: 1.5px solid var(--ink);
  padding: 12px 16px; width: 100%; cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.gate-card__submit:hover { background: var(--bg); color: var(--ink); }
.gate-card__error {
  font-family: var(--mono); font-size: 0.75rem; color: var(--orange-text);
  min-height: 1.2em; margin-top: 0.15rem;
}
.gate-card.is-shaking { animation: gate-shake 0.32s ease; }
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}
