:root {
  --accent: #FFFFFF;
  --accent-soft: #E5E5E5;
  --ink: #17181A;
  --ink-soft: rgba(23,24,26,0.55);
  --off-white: #F2F2F2;
  --card-bg: #FFFFFF;
  --page-bg: #F4F4F1;
  --chip-bg: #F4F4F1;
  --line: #E6E6E2;
  --muted: #8A8A86;
  --radius: 24px;

  /* ---- folder-tab nav: tweak these to retune the whole component ---- */
  --tab-height: 44px;
  --tab-slant: 26px;          /* horizontal run of the outward-leaning right edge */
  --tab-corner-radius: 18px;  /* rounded top-left corner of each tab */
  --tab-curve-radius: 16px;   /* smooth curve where the slant meets the top edge */
  --tab-active-bg: #FFFFFF;
  --tab-active-color: #000000;
  --tab-inactive-bg: #D9D9D9;
  --tab-inactive-color: #999999;
  --tab-hover-bg: #CFCFCF;
  --tab-hover-color: #333333;
  --tab-transition: 300ms ease-in-out;
  --page-black: #F4F4F1;
  --panel-radius-tl: 0px;
  --panel-radius-other: 40px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--page-black);
  font-family: 'Montserrat Alternates', sans-serif;
  color: var(--ink);
}

html[lang="km"], html[lang="km"] body {
  font-family: 'Noto Sans Khmer', sans-serif;
}

a { color: #17181A; text-decoration: underline; }
a:hover { color: #555555; }

button { font-family: inherit; }

img { max-width: 100%; display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUpForm {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

#page-root {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--page-black);
  padding: 20px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- FOLDER COVER PANEL ---------- */
.folder-panel {
  flex: 1;
  min-height: 0;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- NAV (folder tabs) ---------- */
.nav-wrap {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-shrink: 0; flex-wrap: wrap; width: 100%; position: relative;
  padding: 0;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  padding: 5px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.lang-switch-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #17181A;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  transition: all .25s ease;
}
.lang-switch-opt.is-active {
  background: #0D0D0D;
  color: #FFFFFF;
  font-weight: 700;
}

#nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #FFFFFF;
  border: none;
  border-radius: 999px;
  padding: 5px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.nav-hamburger span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: #17181A;
}

.nav-wrap { justify-content: center; }
/* KH/EN switch (hidden while English-only) pins to the right without moving the centred menu */
.nav-end { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }

/* Menu: plain pill buttons inside the white #nav-pill; the active one is solid black */
.nav-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  height: 38px;
  padding: 0 18px;
  background: transparent;
  color: #6B6B67;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition: background 200ms ease, color 200ms ease;
  position: relative;
  min-width: 0;
  white-space: nowrap;
}
.nav-btn:not(.is-active):hover { background: var(--chip-bg); color: var(--ink); }
.nav-btn.is-active { background: var(--ink); color: #FFFFFF; font-weight: 600; }
.nav-btn:focus-visible { outline: 2px solid #4C9EFF; outline-offset: 2px; }
.nav-btn-label {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ---------- VIEW STAGE ---------- */
.view-stage { flex: 1; min-height: 0; height: 100%; }
.view { animation: fadeUp .4s ease both; height: 100%; }

/* ---------- BENTO GRID BASE ---------- */
/* Height is a percentage of the flex-computed .view-stage size (not a
   vh-based guess) so it always exactly fills whatever room is actually
   left below the nav on desktop, with no scrollbar. Overridden back to
   auto-height/scrollable at tablet and mobile widths further down. */
.bento-grid {
  display: grid;
  gap: 16px;
  height: 100%;
  min-height: 0;
}

.card {
  position: relative;
  border: none;
  background: var(--card-bg);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .3s ease;
  animation: fadeUp .5s ease both;
}
.card-white:hover { box-shadow: inset 0 0 0 1px #D2D2CD; }
/* photo cards: a slow zoom on hover instead of lifting the card */
.card-photo .photo-underlay, .card-photo .photo-img { transition: transform .8s cubic-bezier(.2,.7,.2,1), background-image .6s ease; }
.card-photo:hover .photo-underlay, .card-photo:not(.contact-card):hover .photo-img { transform: scale(1.03); }

.card-white {
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-photo {
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: none;
  isolation: isolate;
}

.photo-underlay { position: absolute; inset: 0; transition: background-image .6s ease; }
.photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 40%, rgba(13,13,13,0.85) 100%);
}
.photo-scrim--soft {
  background: linear-gradient(180deg, rgba(13,13,13,0.15) 0%, rgba(13,13,13,0.85) 100%);
}
.corner-dot { display: none; }

.photo-content {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 24px; gap: 4px; color: var(--off-white);
}
.photo-content--between { justify-content: space-between; }


.display-name {
  font-size: clamp(24px, 4.5vh, 40px); font-weight: 700; letter-spacing: -0.02em;
  line-height: 1; color: #FFFFFF;
}
.role-line { font-size: 13px; color: rgba(245,245,245,0.75); font-weight: 500; }
.loc-line { font-size: 11px; color: rgba(245,245,245,0.6); }

.tag-chip {
  display: inline-flex; width: fit-content; font-size: 11px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; color: #FFFFFF;
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.row-between { display: flex; justify-content: space-between; align-items: flex-end; }
.row-start { display: flex; justify-content: space-between; align-items: flex-start; }
.proj-title { font-size: 16px; font-weight: 600; color: var(--off-white); }
.proj-title--lg { font-size: clamp(18px, 3.2vh, 24px); font-weight: 700; }
.proj-title--sm { font-size: 13px; font-weight: 600; }
.proj-desc { font-size: 11px; color: rgba(245,245,245,0.7); margin-top: 2px; }
.proj-tag-sm { font-size: 10px; color: rgba(245,245,245,0.65); }

.dots { display: flex; gap: 5px; }
.dots--end { justify-content: flex-end; gap: 4px; }
.dot {
  width: 6px; height: 6px; border-radius: 50%; cursor: pointer; border: none; padding: 0;
  background: rgba(255,255,255,0.3);
}
.dot { transition: width .3s ease, background .3s ease; }
.dot.is-active { background: #FFFFFF; width: 16px; border-radius: 999px; }
.dots--end .dot { width: 5px; height: 5px; }
.dots--end .dot.is-active { width: 12px; }

.label-sm {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 10px;
}
html[lang="km"] .label-sm { text-transform: none; letter-spacing: 0; font-size: 12px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-size: 11px; font-weight: 500; padding: 5px 11px; border-radius: 999px;
  background: var(--chip-bg); border: none; color: var(--ink);
}
.bio-text { font-size: clamp(11px, 1.45vh, 13px); line-height: 1.6; color: rgba(23,24,26,0.72); padding: 8px; }

/* ---------- HOME GRID ---------- */
#home-grid {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: minmax(70px,1.15fr) minmax(70px,0.95fr) minmax(70px,0.95fr) minmax(60px,0.65fr);
}

/* ---------- WORK: FOLDER DRAWER ---------- */
/* Folders styled like the top menu tabs: the same silhouette (rounded
   top-left, slanted curved right edge, scaled to the tab height), no
   outlines - each tab runs straight into its own body in one solid
   colour - all white with black text. Hover turns a folder black with
   white text. Each .folder box is only its visible band; its body runs
   just far enough down to tuck under the next folder (or the shelf).
   On desktop the bands share the panel's height so everything fits
   without scrolling. Content comes from the js/work-projects-v*.js
   data file. */
.drawer-stage { height: 100%; }
.folder-stack {
  --band-max: 64px;    /* tallest a folder band gets when there's room */
  --stack-inset: 40px; /* folders sit this far inside the shelf's ends */
  --tab-w: 0.34;       /* tab width, as a fraction of folder width */
  height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 6px var(--stack-inset) 0;
}
.folder {
  --p: var(--p-d);
  --shade: #FFFFFF;
  --ink: #111111;
  /* cqw/cqh = this folder's band, used to size the tab and its text */
  container-type: size;
  --th: min(46px, 100cqh * 0.74);   /* tab height */
  --r: calc(var(--th) * 0.3);       /* edge inset unit */
  position: relative; display: block;
  flex: 1 1 0; min-height: 0; max-height: var(--band-max);
  color: var(--ink); text-decoration: none; outline: none; cursor: pointer;
  /* soft shadow along the folder's top edge: with every folder white,
     this is what separates each sheet from the one behind it */
  filter: drop-shadow(0 -2px 5px rgba(0,0,0,0.16));
}
/* color set here too: the global a:hover rule would otherwise grey the text */
.folder:hover, .folder:focus-visible { --shade: #111111; --ink: #FFFFFF; color: var(--ink); }
.folder.is-lifted { visibility: hidden; }
/* Only the top (backmost) folder gets rounded top corners; the rest stay
   square so the stack's sides read as one straight edge. Radius = --r,
   so even an edge tab (inset by at least --r) starts clear of the curve. */
.folder:first-child .folder-body { border-radius: var(--r) var(--r) 0 0; }
.folder-body, .folder-tab { background: var(--shade); transition: background-color 200ms ease, color 200ms ease; }
.folder-body {
  position: absolute; top: var(--th); left: 0; right: 0;

  /* reaches one tab-height past the band: down to where the next
     folder's own body begins */
  bottom: calc(-1 * var(--th));
}
.folder-tab {
  position: absolute; z-index: 1;
  /* +1px overlaps the body so no hairline shows between them */
  top: 0; height: calc(var(--th) + 1px);
  /* Same width for every tab; --p places it along the folder (0 = left,
     1 = right), kept two inset units inside the edges. */
  width: calc(var(--tab-w) * 100cqw);
  left: calc(2 * var(--r) + var(--p) * (100% - 4 * var(--r)));
  transform: translateX(calc(var(--p) * -100%));
  display: flex; align-items: center; justify-content: space-between;
  gap: calc(var(--th) * 0.3);
  /* right padding clears the slanted edge */
  padding: 0 calc(var(--th) * 0.75) 0 calc(var(--th) * 0.45);
  clip-path: polygon(
    0 calc(var(--th) * 0.4091),
    calc(var(--th) * 0.0030) calc(var(--th) * 0.3598),
    calc(var(--th) * 0.0118) calc(var(--th) * 0.3111),
    calc(var(--th) * 0.0266) calc(var(--th) * 0.2641),
    calc(var(--th) * 0.0468) calc(var(--th) * 0.2189),
    calc(var(--th) * 0.0725) calc(var(--th) * 0.1766),
    calc(var(--th) * 0.1030) calc(var(--th) * 0.1377),
    calc(var(--th) * 0.1377) calc(var(--th) * 0.1030),
    calc(var(--th) * 0.1766) calc(var(--th) * 0.0725),
    calc(var(--th) * 0.2189) calc(var(--th) * 0.0468),
    calc(var(--th) * 0.2641) calc(var(--th) * 0.0266),
    calc(var(--th) * 0.3111) calc(var(--th) * 0.0118),
    calc(var(--th) * 0.3598) calc(var(--th) * 0.0030),
    calc(var(--th) * 0.4091) 0,
    calc(100% - var(--th) * 0.9545) 0,
    calc(100% - var(--th) * 0.9123) calc(var(--th) * 0.0011),
    calc(100% - var(--th) * 0.8714) calc(var(--th) * 0.0043),
    calc(100% - var(--th) * 0.8318) calc(var(--th) * 0.0098),
    calc(100% - var(--th) * 0.7934) calc(var(--th) * 0.0173),
    calc(100% - var(--th) * 0.7561) calc(var(--th) * 0.0270),
    calc(100% - var(--th) * 0.7200) calc(var(--th) * 0.0391),
    calc(100% - var(--th) * 0.6855) calc(var(--th) * 0.0530),
    calc(100% - var(--th) * 0.6518) calc(var(--th) * 0.0693),
    calc(100% - var(--th) * 0.6195) calc(var(--th) * 0.0877),
    calc(100% - var(--th) * 0.5886) calc(var(--th) * 0.1082),
    calc(100% - var(--th) * 0.5586) calc(var(--th) * 0.1311),
    calc(100% - var(--th) * 0.5302) calc(var(--th) * 0.1559),
    calc(100% - var(--th) * 0.5030) calc(var(--th) * 0.1830),
    calc(100% - var(--th) * 0.4768) calc(var(--th) * 0.2123),
    calc(100% - var(--th) * 0.4518) calc(var(--th) * 0.2436),
    calc(100% - var(--th) * 0.4282) calc(var(--th) * 0.2773),
    calc(100% - var(--th) * 0.4059) calc(var(--th) * 0.3130),
    100% 100%,
    0 100%
  );
}
.folder-title {
  position: relative; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: clamp(11px, var(--th) * 0.38, 18px); font-weight: 600; line-height: 1.3;
}
.folder-tag {
  position: relative; flex: none;
  font-size: clamp(9px, var(--th) * 0.25, 12px); font-weight: 500; line-height: 1.3;
  opacity: 0.7; white-space: nowrap;
}
.folder:focus-visible .folder-title { text-decoration: underline; text-underline-offset: 3px; }
/* Drawer front: full panel width, flush with the panel's bottom edge
   (cancels the panel's 24px side / 18px bottom padding). */
.drawer-shelf {
  position: relative; flex: none; z-index: 1;
  height: clamp(56px, 9vh, 96px);
  margin: 0 calc(-1 * var(--stack-inset));
  background: #FFFFFF; box-shadow: 0 -6px 16px rgba(0,0,0,0.06), inset 0 0 0 1px var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
}
.drawer-handle {
  position: absolute; left: 50%; top: 50%; width: 20%; height: clamp(12px, 2vh, 20px);
  border-radius: 999px; background: #E6E6E2; transform: translate(-50%, -50%);
}

/* ---------- WORK: PROJECT DETAIL ---------- */
html.wd-lock, html.wd-lock body { overflow: hidden; }
.work-detail { position: fixed; inset: 0; z-index: 1000; }
.wd-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 500ms ease-in-out;
}
.wd-sheet {
  position: absolute; inset: 16px;
  background: #FFFFFF; color: var(--ink); border-radius: var(--radius);
  overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; transition: opacity 360ms ease-in-out;
}
.work-detail.is-open .wd-backdrop, .work-detail.is-open .wd-sheet { opacity: 1; }
.wd-sheet.is-swapping { animation: wdSwap 360ms ease both; }
@keyframes wdSwap { from { opacity: 0; } to { opacity: 1; } }
.wd-close {
  position: sticky; top: 16px; z-index: 5;
  /* block-level so the negative bottom margin pulls the hero up under it */
  margin: 16px 0 -56px 16px; width: max-content;
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px 0 12px; border-radius: 999px;
  background: rgba(255,255,255,0.92); color: #111;
  border: 1px solid rgba(0,0,0,0.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.wd-close:hover { background: #FFFFFF; }
.wd-close-x { font-size: 15px; line-height: 1; }
.wd-hero {
  position: relative; overflow: hidden;
  height: min(64vh, 560px); min-height: 300px;
  border-radius: 20px 20px 0 0;
  background-size: cover; background-position: center;
  color: #FFFFFF;
}
.wd-hero[data-tone="light"] { color: #111; }
.wd-hero.is-hidden { visibility: hidden; }
.wd-title {
  position: absolute; left: 48px; right: 48px; bottom: 40px; margin: 0;
  font-size: clamp(34px, 5.6vw, 76px); font-weight: 700; line-height: 1.05;
}
.wd-hero-tag { position: absolute; top: 28px; right: 32px; font-size: 13px; font-weight: 500; opacity: 0.8; }
.wd-ph-label {
  position: absolute; right: 32px; bottom: 32px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; opacity: 0.5;
  border: 1px dashed currentColor; border-radius: 6px; padding: 4px 8px;
}
.wd-body {
  max-width: 1040px; margin: 0 auto; padding: 48px 48px 64px;
  opacity: 0; transform: translateY(14px);
  transition: opacity 420ms ease 180ms, transform 420ms ease 180ms;
}
.work-detail.is-open .wd-body { opacity: 1; transform: none; }
.wd-meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 0;
  padding-bottom: 32px; border-bottom: 1px solid #E6E6E6;
}
.wd-meta dt { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-soft); }
.wd-meta dd { margin: 6px 0 0; font-size: 15px; font-weight: 600; }
.wd-lead { margin: 40px 0 0; font-size: clamp(18px, 2vw, 24px); line-height: 1.5; }
.wd-two { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.wd-section { margin-top: 44px; }
.wd-h2 { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-soft); }
.wd-text { margin: 0; font-size: 15px; line-height: 1.65; color: rgba(23,24,26,0.85); }
.wd-screens { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.wd-shot {
  aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #F2F2F2;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: rgba(0,0,0,0.35);
}
.wd-shot img { width: 100%; height: 100%; object-fit: cover; }
/* an odd last image spans the full row */
.wd-shot:nth-child(odd):last-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.wd-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.wd-tool {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px; border-radius: 999px; background: #F2F2F2;
  font-size: 13px; font-weight: 600;
}
.wd-tool svg { width: 30px; height: 30px; padding: 3px; border-radius: 8px; background: #FFFFFF; box-sizing: border-box; }
.wd-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; }
.wd-pager button {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 20px 24px; border-radius: 16px; border: 1.5px solid #111;
  background: #FFFFFF; color: #111; font: inherit; text-align: left; cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}
.wd-pager button.wd-next { align-items: flex-end; text-align: right; }
.wd-pager button:hover, .wd-pager button:focus-visible { background: #111; color: #FFFFFF; }
.wd-pager small { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; opacity: 0.6; }
.wd-pager strong { font-size: 18px; font-weight: 700; }
/* Shared-element ghost: the folder tab morphing into the detail hero. */
.wd-ghost { position: fixed; z-index: 1001; overflow: hidden; pointer-events: none; }
.wd-ghost-fill { position: absolute; inset: 0; background-size: cover; background-position: center; }
.wd-ghost-title { position: absolute; font-weight: 700; line-height: 1.05; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .wd-backdrop, .wd-sheet, .wd-body { transition: none; }
}

/* ---------- ABOUT GRID ---------- */
.about-grid {
  grid-template-columns: repeat(4, 1fr);
  /* Bottom row (Skills/Hobbies) only as tall as its content, so the
     Education/Experience cards above get the rest of the height. */
  grid-template-rows: 1fr 1fr auto;
}
.about-portrait { position: relative; }
.about-col { overflow: hidden; overflow-y: auto; }

.timeline { display: flex; flex-direction: column; gap: 2px; }
.timeline-item { display: flex; gap: 10px; }
.timeline-dot-col { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 10px; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: #FFFFFF; box-shadow: inset 0 0 0 2px var(--ink); flex-shrink: 0; }
.timeline-line { width: 1px; flex: 1; background: var(--line); margin-top: 4px; }
.timeline-body { padding-bottom: 16px; }
.timeline-title { font-size: 12px; font-weight: 700; color: var(--ink); }
.timeline-text { font-size: 10px; line-height: 1.6; color: rgba(23,24,26,0.6); margin-top: 4px; }

.timeline--sm .timeline-item { gap: 8px; }
.timeline--sm .timeline-dot-col { width: 8px; }
.timeline--sm .timeline-dot { width: 8px; height: 8px; }
.timeline--sm .timeline-body { padding-bottom: 10px; }
.timeline--sm .timeline-title { font-size: 12px; font-weight: 600; }
.timeline--sm .timeline-sub { font-size: 10px; color: var(--ink-soft); }
.timeline--sm .timeline-sub a { color: #17181A; font-weight: 600; }

.chip-row--sm .chip { font-size: 10px; padding: 4px 9px; }

.tools-card { position: relative; }
.select-frame, .select-dot { display: none; }
/* Tool grid artwork, scaled to fit the card. Negative margins let it use
   most of the card's padding too (stopping short of the dashed frame),
   so the icons read as large as possible at every card size. */
.tools-img {
  --bleed: 14px;
  position: relative; z-index: 1;
  flex: 1; min-height: 0;
  margin: calc(-1 * var(--bleed));
  width: calc(100% + 2 * var(--bleed)); max-width: none;
  object-fit: contain;
}
.soft-skills { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.soft-skill {
  display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 500;
  padding: 5px 10px; border-radius: 999px;
  background: var(--chip-bg); color: #17181A;
}
.soft-skill svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ---------- CONTACT ---------- */
.contact-grid { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.contact-card {
  border-radius: var(--radius); color: var(--off-white); padding: 24px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 16px;
  background: #FFFFFF;
  /* a real border (not an inset shadow) so the photo can't paint over it */
  border: 1px solid var(--line);
}
.contact-card .photo-img { object-fit: contain; object-position: center bottom; }
/* ---------- CONTACT HERO ---------- */
/* "Let's [envelope] Work / Together", top-left of the contact card; the
   illustration sits to its right (desktop) or below it (phones). */
.contact-card .photo-img { object-position: 92% bottom; }
.contact-hero {
  position: relative; z-index: 2; margin-bottom: auto;
  padding: clamp(8px, 2vw, 28px) clamp(8px, 2.4vw, 32px) 0;
  color: #111;
}
.ch-title {
  margin: 0; font-weight: 700; line-height: 0.98; letter-spacing: -0.035em;
  font-size: clamp(44px, 6.6vw, 112px);
}
html[lang="km"] .ch-title { letter-spacing: 0; line-height: 1.3; }
.ch-line { display: flex; align-items: center; flex-wrap: wrap; column-gap: 0.18em; }
.ch-icon-wrap { position: relative; display: inline-flex; }
/* envelope: amber tile with a white flap chevron; breathes gently */
.ch-envelope {
  /* buttons don't inherit font-size; the em sizes below need the headline's */
  font-size: inherit;
  width: 1.18em; height: 0.84em; padding: 0; border: 0; cursor: pointer;
  border-radius: 0.2em; background: #F5B942;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0.12em 0.3em rgba(245,185,66,0.35);
  animation: chBreathe 2s ease-in-out infinite;
  transition: transform 220ms ease, filter 220ms ease;
}
.ch-envelope svg { width: 62%; height: 62%; }
/* the breathing animation would override transform, so hover drops it */
.ch-envelope:hover, .ch-envelope:focus-visible { animation: none; transform: scale(1.1); filter: brightness(1.08); }
.ch-envelope:focus-visible { outline: 3px solid #111; outline-offset: 4px; }
.ch-envelope[aria-expanded="true"] { animation: none; }
@keyframes chBreathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0.12em 0.3em rgba(245,185,66,0.35); }
  50% { transform: scale(1.05); box-shadow: 0 0.14em 0.6em rgba(245,185,66,0.65); }
}
/* floating "You" / "Sreyka" pills with cursor pointers aimed at the icon */
.ch-cursor { position: absolute; display: flex; align-items: center; gap: 2px; pointer-events: none; z-index: 1; }
.ch-cursor--you { right: 82%; bottom: 96%; }
.ch-cursor--me { left: 88%; top: 82%; }
.ch-pointer { width: 14px; height: 14px; }
.ch-cursor--you .ch-pointer { align-self: flex-end; margin-bottom: -8px; fill: #2E9E6B; }
.ch-cursor--me .ch-pointer { align-self: flex-start; margin-top: -8px; fill: #F26B3A; }
.ch-pill {
  font-size: clamp(10px, 0.95vw, 13px); font-weight: 600; letter-spacing: 0;
  line-height: 1; white-space: nowrap; color: #FFFFFF;
  padding: 6px 12px; border-radius: 999px;
}
.ch-cursor--you .ch-pill { background: #2E9E6B; }
.ch-cursor--me .ch-pill { background: #F26B3A; }
/* supporting note + hand-drawn arrow */
.ch-note {
  position: relative; align-self: center; margin-left: 0.25em;
  font-size: clamp(13px, 1.25vw, 18px); font-weight: 700; letter-spacing: 0; line-height: 1.3;
}
.ch-arrow {
  position: absolute; left: -10%; top: 100%; width: clamp(70px, 7vw, 120px); height: auto;
  stroke: #F5B942; transform: rotate(-8deg);
}
@media (prefers-reduced-motion: reduce) {
  .ch-envelope { animation: none; }
}

.contact-scrim {
  position: absolute; inset: 0; pointer-events: none;
  /* Only darkens the bottom band behind the white social-link text - a
     full-height fade washed out the whole illustration, making it look
     blurry/foggy. */
  background: linear-gradient(180deg, rgba(13,13,13,0) 62%, rgba(13,13,13,0.85) 100%);
}
.contact-content {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.say-hello-btn {
  appearance: none; border: none; cursor: pointer;
  background: #FFFFFF; color: #0D0D0D; font-size: 15px; font-weight: 600;
  padding: 15px 26px; border-radius: 999px; width: fit-content;
  display: inline-flex; align-items: center; gap: 10px;
  transition: background .25s ease, color .25s ease;
}
.say-hello-btn:hover { background: var(--ink); color: #FFFFFF; }
.say-hello-btn span { font-size: 15px; line-height: 1; }

.social-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.social-pill, .location-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-radius: 999px; padding: 8px 14px 8px 8px;
  transition: background .3s ease;
  text-decoration: none;
}
.social-pill:hover { background: rgba(255,255,255,0.26); }
.social-icon-badge {
  width: 34px; height: 34px; border-radius: 50%; background: #FFFFFF;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  overflow: hidden;
}
.social-icon-badge img { width: 22px; height: 22px; object-fit: contain; filter: grayscale(100%); }
.location-pill .social-icon-badge img { width: 24px; height: 24px; }
.social-name { font-size: 11px; font-weight: 700; color: #F5F5F5; }
.social-handle { font-family: monospace; font-size: 9px; color: rgba(245,245,245,0.7); letter-spacing: -0.01em; }

.contact-form-overlay {
  position: absolute; inset: 0; background: rgba(13,13,13,0.5); z-index: 50;
  animation: fadeInOverlay .25s ease both;
}
.contact-form-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 51;
  animation: slideUpForm .35s cubic-bezier(.2,.8,.2,1) both;
}
.contact-form-inner {
  width: 100%; background: #111111; color: #F5F5F5;
  border-radius: var(--radius) var(--radius) 0 0; padding: 26px 26px 28px;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
  display: flex; flex-direction: column; gap: 12px;
}
.form-title { font-size: 24px; font-weight: 700; }
.close-btn {
  appearance: none; border: none; background: rgba(255,255,255,0.15); color: #F5F5F5;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1;
}
.form-email { font-size: 12px; opacity: 0.75; margin-top: -8px; }
#contact-form { display: flex; flex-direction: column; gap: 12px; }
.contact-form-field {
  appearance: none; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.06); color: #F5F5F5;
  border-radius: 14px; padding: 12px 14px; font-family: inherit; font-size: 13px; outline: none; resize: none;
}
.contact-form-field::placeholder { color: rgba(245,245,245,0.45); }
.contact-form-field:focus { border-color: rgba(255,255,255,0.5); }
.send-btn {
  appearance: none; border: none; cursor: pointer; background: #FFFFFF; color: #0D0D0D;
  font-size: 14px; font-weight: 600; padding: 13px 20px; border-radius: 999px; margin-top: 4px;
}

.form-sent-msg {
  font-size: 13px; font-weight: 600; color: #F5F5F5; background: rgba(255,255,255,0.12);
  border-radius: 12px; padding: 12px 14px;
}

/* ---------- RESPONSIVE ---------- */
/* Below desktop width the grid reflows into extra rows (tablet) or a
   single stacked column (mobile) and genuinely needs to scroll - only
   the full desktop layout above is required to fit in one screen. */
@media (max-width: 900px), (max-width: 1100px) and (orientation: portrait) {
  #page-root { height: auto; min-height: 100vh; overflow: visible; }
  /* page scrolls at these widths, so bands get a fixed height instead
     of sharing the panel's */
  .drawer-stage { height: auto; }
  .folder-stack { --tab-w: 0.45; --stack-inset: 24px; height: auto; padding-top: 10px; }
  /* same width as each other, but a long title may stretch its tab */
  .folder-tab { width: max-content; min-width: calc(var(--tab-w) * 100cqw); max-width: calc(100cqw - 4 * var(--r)); }
  .folder { flex: none; height: 64px; max-height: none; }
  .drawer-shelf { height: 96px; }
}

@media (max-width: 640px) {
  .folder-stack { --tab-w: 0.62; --stack-inset: 6px; }
  .folder { --p: var(--p-m); height: 62px; --th: 54px; --r: 12px; }
  /* tag sits above the title, and the tab may grow past --tab-w, so
     long titles fit on narrow screens */
  .folder-tab {
    width: max-content; min-width: calc(var(--tab-w) * 100cqw); max-width: calc(100cqw - 4 * var(--r));
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
    padding: 0 calc(var(--th) * 0.75) 0 14px;
  }
  .folder-title { align-self: stretch; font-size: 15px; }
  .folder-tag { order: -1; font-size: 10px; }
  .drawer-shelf { height: 80px; }
  .drawer-handle { height: 14px; width: 28%; }

  .wd-sheet { inset: 0; border-radius: 0; }
  .wd-hero { height: 52vh; min-height: 260px; border-radius: 0; }
  .wd-title { left: 20px; right: 20px; bottom: 24px; }
  .wd-hero-tag { top: 22px; right: 20px; font-size: 11px; }
  .wd-ph-label { right: 20px; bottom: auto; top: 50%; }
  .wd-body { padding: 28px 20px 48px; }
  .wd-meta { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .wd-two, .wd-screens, .wd-pager { grid-template-columns: 1fr; }
  .wd-two { gap: 0; }
}
@media (max-width: 400px) {
  .folder-stack { --stack-inset: 0px; }
  .folder { --r: 9px; }
  /* one radius from the edges instead of two, for a little more width */
  .folder-tab {
    padding: 0 calc(var(--th) * 0.7) 0 10px; max-width: calc(100cqw - 2 * var(--r));
    left: calc(var(--r) + var(--p) * (100% - 2 * var(--r)));
  }
  .folder-title { font-size: 14px; }
}
@media (max-width: 340px) {
  .folder-title { font-size: 11.5px; }
}

@media (max-width: 1100px) and (min-width: 901px) and (orientation: portrait) {
  #home-grid {
    grid-template-columns: repeat(2,1fr) !important;
    grid-template-rows: none !important;
    grid-auto-rows: minmax(150px,320px) !important;
    grid-auto-flow: row !important;
    height: auto !important;
  }
  #home-grid > div { grid-row: auto !important; }
  #home-grid [data-span="2"] { grid-column: 1/3 !important; }
  #home-grid [data-span="1"] { grid-column: span 1 !important; }
  /* Full width: it has no 1-col partner in this 2-col flow, so at half
     width it would leave a hole beside it. */
  #home-grid .tools-card { grid-column: 1/3 !important; }
  /* Last row (bio) hugs its text instead of a fixed 320px row. */
  #home-grid { grid-template-rows: repeat(5, minmax(150px,320px)) auto !important; }
  #home-grid > div:first-child { min-height: 320px !important; }
  .bio-card { min-height: 0 !important; height: auto !important; align-self: start !important; }

  /* text scale: tablet */
  .display-name { font-size: clamp(22px, 4vh, 32px) !important; }
  .proj-title--lg { font-size: clamp(16px, 2.6vh, 20px) !important; }
  .role-line { font-size: 12px !important; }
  .bio-text { font-size: 11px !important; }
  .form-title { font-size: 20px !important; }
}

@media (max-width: 900px) {
  /* one card per row, stacked vertically, no side-by-side pairs at any narrower-than-tablet width */
  #home-grid, .about-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: none !important;
    grid-auto-flow: row !important;
    grid-auto-rows: minmax(280px,auto) !important;
    height: auto !important;
    gap: 12px !important;
  }
  #home-grid > div, .about-grid > div {
    grid-column: 1/2 !important;
    grid-row: auto !important;
    min-height: 300px !important;
    border-radius: var(--radius) !important;
  }
  .tools-card { height: 300px; }
  .bio-card { min-height: 0 !important; height: auto !important; align-self: start !important; }
  .corner-dot { display: none !important; }
  .contact-grid { height: auto !important; min-height: calc(100vh - 100px) !important; }
  /* contain + bottom so the illustration sits under the hero headline */
  .contact-card .photo-img { object-fit: contain !important; object-position: center bottom !important; }
  .ch-cursor--you { right: 80%; bottom: 86%; }
  .ch-cursor--me { left: 80%; top: 86%; }
  .ch-pill { padding: 4px 9px; }
  .ch-pointer { width: 11px; height: 11px; }
}

/* Widened from 640px: at desktop tab sizing, the nav row (tabs + lang
   switch) stops fitting on one line as low as ~780px (Khmer labels are
   the worst case), and flex-wrap:wrap was pushing the switch onto its
   own second line - leaving a tall gap between the tabs and the panel
   below them. 800px keeps this compact/one-line nav active well above
   that wrap point, with margin to spare. */
@media (max-width: 800px) {
  /* 1: nav stays folder-tab style on mobile, left-aligned; language switch stays put.
     Active tab shows its full label; inactive tabs truncate so the row always fits
     without horizontal scroll. */
  .nav-hamburger { display: none !important; }
  /* A bit more breathing room than the 10px base gap - the tabs now grow
     to fill the row, so without this they sit right up against the
     language switch pill. */
  .nav-wrap { flex-wrap: nowrap !important; gap: 10px; }
  #nav-pill {
    display: inline-flex !important;
    position: static;
    flex-direction: row !important;
    align-items: flex-end;
    flex-wrap: nowrap !important;
    width: auto;
    flex: 0 1 auto;
    min-width: 0;
    gap: 2px;
    padding: 4px !important;
  }
  .nav-btn { flex: 0 1 auto; min-width: 0; }
  .nav-btn.is-active { flex-shrink: 0; }
  .nav-end { position: static; transform: none; }

  /* 3: cards hug at 16px on mobile */
  .card-white, .photo-content, .contact-card { padding: 16px !important; }
  .tools-img { --bleed: 8px; }

  /* 5: mobile text scale, smaller than tablet */
  .display-name { font-size: 24px !important; }
  .role-line { font-size: 11px !important; }
  .loc-line { font-size: 10px !important; }
  .proj-title--lg { font-size: 16px !important; }
  .proj-title { font-size: 14px !important; }
  .proj-desc { font-size: 10px !important; }
  .bio-text { font-size: 11px !important; padding: 14px !important; }
  .timeline-title { font-size: 11px !important; }
  .timeline-text { font-size: 9px !important; }

  /* gap stays 0 here (not a mobile-breathing-room value) - a nonzero gap
     between nav-wrap and folder-panel would separate the tabs from the
     panel too, breaking the flush/no-seam rule that's required at every
     width, not just desktop. The lang-switch pill gets its own lift via
     its own margin-bottom instead, independent of this. */
  #page-root { padding: 14px 14px 20px !important; gap: 14px !important; }

  /* contact: icon-only social pills on mobile, no glass background */
  .social-pill .social-name, .social-pill .social-handle,
  .location-pill .social-name, .location-pill .social-handle { display: none !important; }
  .social-pill, .location-pill {
    padding: 0 !important;
    background: none !important;
    border: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
  }
  .social-row { justify-content: center !important; }
}

/* Tab sizing is tiered separately from the rest of the ≤800px mobile-nav
   styles above: a "moderate" compact size for tablet-ish widths where
   there's still plenty of room (641-800px), and the much smaller icon-
   like size (below) only for genuinely narrow phone widths. Using the
   phone-sized tabs all the way up to 800px left them looking tiny and
   lost in a lot of unused space at widths like 768px. */
@media (max-width: 800px) and (min-width: 641px) {
  .nav-btn { padding: 0 14px; font-size: 13px; height: 34px; }
  /* Pill scales down alongside the tabs here - it was staying fixed at
     full desktop size while the tabs shrank around it, so it looked
     oversized/mismatched instead of belonging to the same nav row. */
  .lang-switch { gap: 6px; padding: 4px; }
  .lang-switch-opt { width: 23px; height: 23px; font-size: 11px; }
}

@media (max-width: 640px) {
  /* Wide enough to show a full short word (or the meaningful first word
     of a longer one) before the ellipsis - e.g. "ប្រវត្តិ..." - instead
     of clipping to 1-2 characters. */
  .nav-btn { max-width: 96px; padding: 0 11px; font-size: 12px; height: 32px; }
  /* Floor, not a target: the longest label (Khmer "About",
     ប្រវត្តិសង្ខេប) needs ~131px of content+padding box at this
     font-size/padding - below that it truncates even with
     flex-shrink:0 protecting it from flex competition, since max-width
     itself becomes the binding constraint. */
  .nav-btn.is-active { max-width: 140px; }
  .lang-switch { gap: 4px; padding: 3px; }
  .lang-switch-opt { width: 19px; height: 19px; font-size: 10px; }
}

@media (max-width: 480px) {
  /* max-width bumped up from 76px to match the added padding, same as
     the tier above, preserving the calibrated word-boundary truncation. */
  .nav-btn { padding: 0 9px; font-size: 11.5px; max-width: 88px; height: 32px; }
  /* Same floor as the tier above, scaled to this smaller font/padding -
     the Khmer "About" label needs ~119px here; below that it truncates. */
  .nav-btn.is-active { max-width: 130px; }
  .lang-switch { gap: 3px; padding: 3px; }
  .lang-switch-opt { width: 17px; height: 17px; font-size: 9px; }
  #home-grid > div, .about-grid > div { min-height: 260px !important; }
  .tools-card { height: 280px; }
  .display-name { font-size: 21px !important; }
}

/* bio card hugs its text on tablet/phone (beats the #home-grid > div min-height) */
@media (max-width: 900px), (max-width: 1100px) and (orientation: portrait) {
  #home-grid > .bio-card { min-height: 0 !important; }
}
@media (max-width: 900px) {
  /* rows size to their cards (each still has its own min-height), so the
     short bio row doesn't leave a blank band at the bottom */
  #home-grid { grid-auto-rows: auto !important; }
}

/* KH/EN switch is hidden while the site is English-only (KHMER_ENABLED in js/main-v*.js) */
.lang-switch[hidden] { display: none; }


/* =================================================================
   FOLDER TOUCHES
   The site's signature: every card is a folder with a named tab on
   top. Tabs sit
   above their card (bottom: 100%), so the cards don't clip
   (photos and scrollers round/clip themselves instead), and the
   grids leave a tab's height of room above each row.
   ================================================================= */
:root {
  --tab-h: 28px;      /* card tab height */
}

/* ---- card tabs ---- */
.card-tab {
  position: absolute; left: 0; bottom: 100%; z-index: 3;
  height: var(--tab-h); max-width: calc(100% - 40px);
  display: flex; align-items: center;
  padding: 2px 4px 0 16px;
  background: var(--tab-bg, #FFFFFF); color: var(--tab-ink, var(--ink));
  border-radius: 14px 0 0 0;
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  white-space: nowrap;
  /* overlaps the card by 1px so no seam shows */
  margin-bottom: -1px;
}
/* the leaning right edge */
.card-tab::after {
  content: ''; position: absolute; top: 0; bottom: 0;
  /* S-curve wing: flat on top, flat where it meets the card. Overlaps
     the tab by 1px so no seam shows. */
  left: calc(100% - 1px); width: calc(var(--tab-h) * 1.3);
  background: inherit;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 28' preserveAspectRatio='none'%3E%3Cpath d='M0 0H4C11 0 13 4.5 16.5 12.5C20 21 23.5 28 32 28H36V28H0Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 28' preserveAspectRatio='none'%3E%3Cpath d='M0 0H4C11 0 13 4.5 16.5 12.5C20 21 23.5 28 32 28H36V28H0Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}
html[lang="km"] .card-tab { letter-spacing: 0; text-transform: none; font-size: 12px; }
/* About cards: their existing section label becomes the tab */
.about-col > .label-sm {
  position: absolute; left: 0; bottom: 100%; z-index: 3;
  height: var(--tab-h); margin: 0 0 -1px;
  display: flex; align-items: center; padding: 2px 4px 0 16px;
  background: #FFFFFF; color: var(--ink); border-radius: 14px 0 0 0;
}
.about-col > .label-sm::after {
  content: ''; position: absolute; top: 0; bottom: 0;
  /* S-curve wing: flat on top, flat where it meets the card. Overlaps
     the tab by 1px so no seam shows. */
  left: calc(100% - 1px); width: calc(var(--tab-h) * 1.3);
  background: inherit;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 28' preserveAspectRatio='none'%3E%3Cpath d='M0 0H4C11 0 13 4.5 16.5 12.5C20 21 23.5 28 32 28H36V28H0Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 28' preserveAspectRatio='none'%3E%3Cpath d='M0 0H4C11 0 13 4.5 16.5 12.5C20 21 23.5 28 32 28H36V28H0Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}

/* the corner under the tab is square, like a real folder */
.card { border-top-left-radius: 0 !important; }

/* white cards: one soft shadow around card + tab together */
.card-white, .contact-card {
  box-shadow: none; border: none;
  filter: drop-shadow(0 1px 1.5px rgba(0,0,0,0.07)) drop-shadow(0 6px 18px rgba(0,0,0,0.04));
}
.card-white:hover { box-shadow: none; }

/* photo cards: dark tab; the card can't clip, so the photo layers round themselves */
.card-photo { --tab-bg: #111111; --tab-ink: #FFFFFF; overflow: visible; }
.card-photo > .photo-underlay, .card-photo > .photo-img, .card-photo > .photo-scrim,
.contact-scrim { border-radius: inherit; }
.card-photo:hover .photo-underlay, .card-photo:not(.contact-card):hover .photo-img { transform: none; }
.contact-card { --tab-bg: #FFFFFF; --tab-ink: var(--ink); }

/* About: content scrolls inside, under the tab */
.about-col { overflow: visible !important; }
.col-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }

/* contact form keeps sliding up inside the card's rounded shape */
.contact-form-clip {
  position: absolute; inset: 0; z-index: 50; overflow: hidden;
  border-radius: inherit; pointer-events: none;
}
.contact-form-clip > * { pointer-events: auto; }

/* room for the tabs: above the first row and between rows */
#page-root { gap: 10px; }
.bento-grid { padding-top: var(--tab-h); row-gap: calc(var(--tab-h) + 10px); }
.contact-grid { padding-top: var(--tab-h); }

@media (max-width: 900px), (max-width: 1100px) and (orientation: portrait) {
  #home-grid, .about-grid { row-gap: calc(var(--tab-h) + 10px) !important; }
}
@media (max-width: 900px) {
  #home-grid, .about-grid { row-gap: calc(var(--tab-h) + 8px) !important; }
  #home-grid > div, .about-grid > div { border-top-left-radius: 0 !important; }
  .about-col .col-scroll { overflow: visible; }
}
@media (max-width: 640px) {
  :root { --tab-h: 26px; }
  .card-tab, .about-col > .label-sm { font-size: 10px; padding-left: 14px; }
}


/* ---------- ONE-PAGE FIT ON SHORT SCREENS ----------
   Laptops (often with 125-150% display scaling) can leave 500-700px of
   height. Tighten the spacing so the whole bento still fits with no
   scrolling; only below 480px tall does the page scroll instead of
   squeezing the cards further. */
@media (min-width: 901px) and (max-height: 820px), (min-width: 901px) and (max-width: 1100px) and (orientation: landscape) {
  :root { --tab-h: 24px; }
  #page-root { padding: 12px 20px 16px; gap: 6px; }
  #nav-pill { padding: 4px; }
  .nav-btn { height: 34px; font-size: 13px; }
  .bento-grid { column-gap: 12px; row-gap: calc(var(--tab-h) + 6px); }
  .card-tab, .about-col > .label-sm { font-size: 10px; padding-left: 14px; }
  .card-white { padding: 16px 18px; }
  .photo-content { padding: 18px; }
  .bio-text { font-size: clamp(10px, 1.55vh, 12.5px); line-height: 1.5; padding: 2px; }
  .display-name { font-size: clamp(22px, 5vh, 36px); }
  #home-grid { grid-template-rows: minmax(60px,1.15fr) minmax(60px,0.95fr) minmax(60px,0.95fr) minmax(60px,0.75fr); }
}
@media (min-width: 901px) and (max-width: 1100px) and (orientation: landscape) {
  .proj-title--lg { font-size: 18px; }
  .proj-desc { display: none; }
  .bio-text { font-size: clamp(9.5px, 1.45vh, 11.5px); }
}
@media (min-width: 901px) and (max-height: 480px) {
  #page-root { height: 480px; min-height: 480px; overflow: visible; }
}
