/* ----------------------------------------------------------
   Samantha Tan — portfolio
   Edge-to-edge layout · alternating project rows.
   ---------------------------------------------------------- */
:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --ink-soft: #1a1a1a;
  --muted: #4a4a4a;
  --muted-2: #545454;
  --line: rgba(10, 10, 10, 0.10);
  --line-strong: rgba(10, 10, 10, 0.22);
  --accent: #475569;
  --masthead-accent: #3f4756;
  --cta: #3f4756;
  --signature: linear-gradient(120deg, #be185d 0%, #f43f5e 30%, #fb7185 55%, #fdba74 80%, #fcd34d 100%);
  --serif: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --nav-h: 72px;
  --gutter: clamp(24px, 4vw, 64px);
  --pad: 1;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }

/* Smooth in-page scrolling for nav anchors, offset for the sticky nav */
html { scroll-behavior: smooth; }
#top, #work, #personal { scroll-margin-top: calc(var(--nav-h) + 14px); }

/* Page transitions — content rises in on load, fades out on leave */
@media (prefers-reduced-motion: no-preference) {
  main, .case-wrap {
    animation: pt-rise 0.55s cubic-bezier(0.22, 0.7, 0.2, 1) both;
  }
  html.pt-leaving #root {
    animation: pt-leave 0.18s ease forwards;
  }
}
@keyframes pt-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes pt-leave {
  to { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
html, body { cursor: none; }
a, button, input, textarea { cursor: none; }
body {
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  background-color: var(--bg);
}

#root { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img, image-slot { display: block; }

body[data-density="compact"] { --pad: 0.85; }
body[data-density="regular"] { --pad: 1; }
body[data-density="comfy"]   { --pad: 1.2; }

main { display: block; }

/* ----------------------------------------------------------
   Top nav — brand left, links right, always visible.
   Sticky glass treatment.
   ---------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              background 0.4s ease,
              backdrop-filter 0.4s ease,
              box-shadow 0.4s ease;
}
/* Condensed on scroll — white translucent glass + shrink chrome so focus shifts to the work. */
.nav.is-condensed {
  height: calc(var(--nav-h) - 18px);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  box-shadow: 0 1px 0 var(--line);
}
body[data-theme="dark"] .nav.is-condensed {
  background: rgba(14, 14, 16, 0.72);
}
.nav.is-condensed .nav-avatar {
  width: 26px;
  height: 26px;
}
.nav.is-condensed .nav-brand { font-size: 15.5px; }
.nav.is-condensed .nav-links { font-size: 14.5px; }
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg);
  transition: font-size 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  flex: none;
  box-shadow: 0 0 0 1px var(--line-strong);
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav-brand-dot { color: var(--accent); }
.nav-links {
  display: flex;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  font-size: 16px;
  font-weight: 500;
  transition: gap 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), font-size 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav-links a {
  position: relative;
  padding: 4px 0;
  color: var(--fg);
  transition: color 0.15s ease;
}
/* Icon links (email · linkedin) — no underline, gentle dim until hover */
.nav-links a.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--muted);
}
.nav-links a.nav-icon::after { display: none; }
.nav-links a.nav-icon:hover { color: var(--accent); }
.nav-links a.nav-icon svg {
  display: block;
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav.is-condensed .nav-icon svg { width: 18px; height: 18px; }

/* Dark-mode toggle — icon button that crossfades sun/moon */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  position: relative;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, width 0.4s cubic-bezier(0.2,0.8,0.2,1), height 0.4s cubic-bezier(0.2,0.8,0.2,1);
}
.nav-toggle:hover { color: var(--accent); border-color: var(--accent); }
.nav.is-condensed .nav-toggle { width: 30px; height: 30px; }
.nav-toggle svg {
  position: absolute;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.2,0.8,0.2,1);
}
.nav-toggle .toggle-moon { opacity: 0; transform: rotate(-40deg) scale(0.6); }
.nav-toggle .toggle-sun  { opacity: 1; transform: rotate(0deg) scale(1); }
.nav-toggle.is-dark .toggle-moon { opacity: 1; transform: rotate(0deg) scale(1); }
.nav-toggle.is-dark .toggle-sun  { opacity: 0; transform: rotate(40deg) scale(0.6); }

/* Email link — expands to "Contact me" with an underline on hover,
   matching the Work / Personal text links. */
.nav-links a.nav-contact {
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
  color: var(--fg);
}
/* The full-width anchor underline is suppressed; underline sits on the label only */
.nav-links a.nav-contact::after { display: none; }
.nav-links a.nav-contact svg {
  display: block;
  flex: none;
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav.is-condensed .nav-contact svg { width: 18px; height: 18px; }
.nav-contact-label {
  position: relative;
  display: inline-block;
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: max-width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              margin-left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.3s ease;
}
.nav-contact-label::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav-links a.nav-contact:hover .nav-contact-label,
.nav-links a.nav-contact:focus-visible .nav-contact-label {
  max-width: 140px;
  margin-left: 8px;
  opacity: 1;
}
.nav-links a.nav-contact:hover .nav-contact-label::after,
.nav-links a.nav-contact:focus-visible .nav-contact-label::after {
  transform: scaleX(1);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav-links a:hover::after { transform: scaleX(1); }

/* ==========================================================
   NAV VARIANTS — switchable via the Navigation tweak
   ========================================================== */

/* ---- Variant 1 · Capsule — floating glass pill ---- */
.nav--capsule {
  justify-content: center;
  padding-top: 14px;
  background: transparent;
  pointer-events: none;
}
.nav--capsule .navpill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.2vw, 30px);
  padding: 9px 12px 9px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04), 0 14px 36px -18px rgba(15, 23, 42, 0.32);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  transition: box-shadow 0.4s ease, background 0.4s ease, transform 0.4s cubic-bezier(0.2,0.8,0.2,1);
}
body[data-theme="dark"] .nav--capsule .navpill {
  background: rgba(20, 20, 23, 0.62);
}
.nav--capsule.is-condensed .navpill {
  transform: scale(0.965);
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.05), 0 10px 26px -16px rgba(15, 23, 42, 0.4);
}
.nav--capsule .nav-brand { font-size: 15.5px; white-space: nowrap; }
.nav--capsule .nav-avatar { width: 28px; height: 28px; }
.nav--capsule .navpill-div {
  width: 1px;
  align-self: stretch;
  margin: -2px 0;
  background: var(--line-strong);
}
.nav--capsule .nav-links { gap: clamp(16px, 2vw, 26px); font-size: 15px; }
.nav--capsule .nav-links a.nav-icon { color: var(--muted); }
.nav--capsule .nav-links a.nav-icon svg { width: 18px; height: 18px; }

/* ---- Variant 2 · Editorial — serif wordmark, status, numbered links ---- */
.nav--editorial {
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.nav--editorial.is-condensed {
  height: calc(var(--nav-h) - 18px);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}
body[data-theme="dark"] .nav--editorial.is-condensed { background: rgba(14, 14, 16, 0.78); }
.nav-edi-left {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-brand--serif {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.nav-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono, "Geist Mono", monospace);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.nav-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f9e6b;
  box-shadow: 0 0 0 0 rgba(47, 158, 107, 0.5);
  animation: navStatusPulse 2.4s ease-out infinite;
}
@keyframes navStatusPulse {
  0%   { box-shadow: 0 0 0 0 rgba(47, 158, 107, 0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(47, 158, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 158, 107, 0); }
}
.nav--editorial .nav-links a:not(.nav-icon) {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}
.nav-idx {
  font-family: var(--mono, "Geist Mono", monospace);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
}
.nav--editorial .nav-links a.nav-icon { color: var(--muted); }
@media (max-width: 920px) { .nav-status { display: none; } }

/* ---- Variant 3 · Mono — monospace command-line wordmark ---- */
.nav--mono {
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono, "Geist Mono", monospace);
}
.nav--mono.is-condensed {
  height: calc(var(--nav-h) - 18px);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}
body[data-theme="dark"] .nav--mono.is-condensed { background: rgba(14, 14, 16, 0.78); }
.nav--mono .nav-brand {
  gap: 11px;
  font-family: var(--mono, "Geist Mono", monospace);
  font-weight: 500;
  letter-spacing: 0;
}
.nav-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--fg);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  flex: none;
}
.nav-mono-name {
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--fg);
}
.nav--mono .nav-links { gap: clamp(20px, 2.6vw, 38px); }
.nav--mono .nav-links a:not(.nav-icon) {
  font-family: var(--mono, "Geist Mono", monospace);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: color 0.16s ease;
}
.nav--mono .nav-links a:not(.nav-icon):hover { color: var(--fg); }
.nav--mono .nav-links a:not(.nav-icon)::after { display: none; }
.nav-slash { color: var(--accent); margin-right: 1px; }
.nav--mono .nav-links a.nav-icon { color: var(--muted); }
.nav--mono .nav-links a.nav-icon svg { width: 18px; height: 18px; }
@media (max-width: 560px) { .nav-mono-name { display: none; } }

/* ==========================================================
   PAGE-WIDE MONO TREATMENT — applied when the Mono nav is active.
   Switches the type system to Geist Mono and adds terminal accents
   (// section markers, monospace meta) for a cohesive technical feel.
   Geist Mono ships 400/500 only, so headings cap at weight 500.
   ========================================================== */
body[data-pagestyle="mono"] .hero-sub,
body[data-pagestyle="mono"] .section-label,
body[data-pagestyle="mono"] .meta-label,
body[data-pagestyle="mono"] .meta-cat,
body[data-pagestyle="mono"] .project-pull,
body[data-pagestyle="mono"] .project-title,
body[data-pagestyle="mono"] .project-desc,
body[data-pagestyle="mono"] .project-flags,
body[data-pagestyle="mono"] .pcard-label,
body[data-pagestyle="mono"] .pcard-title,
body[data-pagestyle="mono"] .pcard-desc,
body[data-pagestyle="mono"] .pcard-flags,
body[data-pagestyle="mono"] .personal-title,
body[data-pagestyle="mono"] .personal-desc,
body[data-pagestyle="mono"] .cta,
body[data-pagestyle="mono"] .foot-link-label {
  font-family: var(--mono);
}

/* Headings — drop to weight 500 (mono's heaviest) and tighten tracking
   so the wider glyphs don't overflow. (Masthead keeps its Fraunces serif.) */
body[data-pagestyle="mono"] .project-title,
body[data-pagestyle="mono"] .pcard-title,
body[data-pagestyle="mono"] .personal-title,
body[data-pagestyle="mono"] .project-pull {
  font-weight: 500;
  letter-spacing: -0.015em;
}
body[data-pagestyle="mono"] .personal-title { font-size: clamp(22px, 2vw, 30px); }

/* Body copy — mono reads a touch denser, so trim size and open up leading. */
body[data-pagestyle="mono"] .hero-sub,
body[data-pagestyle="mono"] .project-desc,
body[data-pagestyle="mono"] .pcard-desc,
body[data-pagestyle="mono"] .personal-desc {
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.65;
}
body[data-pagestyle="mono"] .hero-sub { font-size: clamp(13.5px, 1vw, 15px); }
body[data-pagestyle="mono"] .project-desc,
body[data-pagestyle="mono"] .pcard-desc { font-size: 13.5px; }
body[data-pagestyle="mono"] .personal-desc { font-size: 14px; }

/* Uppercase eyebrow labels — wider mono glyphs need less tracking. */
body[data-pagestyle="mono"] .section-label,
body[data-pagestyle="mono"] .meta-label,
body[data-pagestyle="mono"] .pcard-label {
  font-weight: 500;
  letter-spacing: 0.1em;
}

/* Terminal motif — prefix section labels with the nav's // slash mark. */
body[data-pagestyle="mono"] .section-label::before {
  content: "// ";
  color: var(--accent);
}

/* CTA pill — mono, slightly tighter. */
body[data-pagestyle="mono"] .cta {
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ----------------------------------------------------------
   Hero decorations — scattered envelopes & stars (cursor-trail palette).
   ---------------------------------------------------------- */
.hero {
  position: relative;
  padding: clamp(48px, 8vh, 96px) var(--gutter) clamp(56px, 9vh, 120px);
  max-width: 1080px;
  overflow: visible;
}
.hero-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hd {
  position: absolute;
  display: block;
  filter: drop-shadow(0 3px 8px rgba(71, 85, 105, 0.10));
  animation: heroFloat 7s ease-in-out infinite;
  will-change: transform;
}
.hd svg { display: block; width: 100%; height: 100%; }
.hd-cloud--a { top: 12%;  right: 20%; width: 52px; animation-delay: -1s;  transform: rotate(-4deg); }
.hd-cloud--b { top: 68%;  right: 7%;  width: 42px; animation-delay: -4s;  transform: rotate(3deg); }
.hd-star--a { top: 30%; right: 6%;   width: 18px; animation-delay: -2s; opacity: 0.85; }
.hd-star--b { top: 80%; right: 28%;  width: 14px; animation-delay: -5s; opacity: 0.7; }
.hd-star--c { top: 50%; right: 14%;  width: 20px; animation-delay: -3s; opacity: 0.75; }
@keyframes heroFloat {
  0%, 100% { transform: translate(0, 0) rotate(var(--r, 0deg)); }
  50%      { transform: translate(-6px, -8px) rotate(var(--r, 0deg)); }
}
.hero-h, .hero-sub, .hero-kicker { position: relative; z-index: 1; }
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 22px;
  font-family: var(--mono);
  font-size: clamp(12px, 1vw, 13px);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-kicker::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--fg);
  opacity: 0.5;
  flex: none;
}
.hero-h {
  margin: 0 0 24px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 400;
  font-size: clamp(38px, 5vw, 60px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
  max-width: 21ch;
  color: var(--fg);
}
.hero-h em {
  font-style: italic;
  color: var(--masthead-accent);
}
.hero-heart {
  display: inline-block;
  width: clamp(28px, 3.4vw, 42px);
  height: auto;
  vertical-align: -0.12em;
  margin-left: 0.18em;
  color: #f43f5e;
  transform: rotate(6deg);
}
.hero-heart--pastel { color: #f9a8c4; }
.hero-heart--filled { color: #fb6f92; }
@media (prefers-reduced-motion: no-preference) {
  .hero-heart path {
    stroke-dasharray: 240;
    stroke-dashoffset: 240;
    animation: heart-draw 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.5s forwards;
  }
  .hero-heart path:nth-child(2) { animation-delay: 1.45s; animation-duration: 0.4s; }
  .hero-heart--filled > path:first-child {
    fill-opacity: 0;
    animation: heart-draw 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.5s forwards, heart-fill 0.5s ease 1.5s forwards;
  }
  .hero-heart-scribble path {
    animation-delay: 1.55s;
    animation-duration: 0.55s;
  }
}
@keyframes heart-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes heart-fill {
  to { fill-opacity: 0.16; }
}
.hero-sub {
  margin: 0;
  max-width: 720px;
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.55;
  color: var(--muted);
}

/* Intro = "beside": title and description sit side by side, kicker spans on top */
body[data-intro="beside"] .hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-areas:
    "kicker kicker"
    "title  sub";
  column-gap: clamp(40px, 6vw, 100px);
  align-items: end;
}
body[data-intro="beside"] .hero-kicker { grid-area: kicker; }
body[data-intro="beside"] .hero-h {
  grid-area: title;
  margin-bottom: 0;
  max-width: 18ch;
}
body[data-intro="beside"] .hero-sub {
  grid-area: sub;
  max-width: 46ch;
  padding-bottom: 6px;
}
@media (max-width: 820px) {
  body[data-intro="beside"] .hero { display: block; }
  body[data-intro="beside"] .hero-h { margin-bottom: 22px; max-width: 16ch; }
  body[data-intro="beside"] .hero-sub { padding-bottom: 0; }
}

/* ----------------------------------------------------------
   Section label
   ---------------------------------------------------------- */
.section-label {
  padding: 0 var(--gutter);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin: 0 var(--gutter) 0;
  padding-left: 0;
  padding-right: 0;
}
/* Override: section-label spans the full gutter line */
.section-label {
  margin: 0 var(--gutter);
  padding: 0 0 16px;
}

/* ----------------------------------------------------------
   Projects — one per row, each its own moment.
   Alternates left-meta / right-image with right-image / left-meta.
   ---------------------------------------------------------- */
.projects { padding-top: 0; }
.project-list { display: block; }

.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1.35fr);
  gap: clamp(40px, 5vw, 96px);
  padding: clamp(18px, 2.4vh, 34px) var(--gutter);
  align-items: center;
  min-height: clamp(320px, 44vh, 480px);
  position: relative;
}
.project .project-meta { order: 1; }
.project .project-preview { order: 2; }

.project-meta {
  display: flex;
  flex-direction: column;
  align-self: center;
  gap: 0;
}
.meta-label {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.meta-num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.meta-cat { color: var(--muted); }

.project-pull {
  margin: 0 0 28px;
  font-family: var(--sans);
  font-style: normal;
  font-weight: 600;
  font-size: clamp(24px, 2.4vw, 36px);
  line-height: 1.18;
  letter-spacing: -0.022em;
  color: var(--ink-soft);
  text-wrap: balance;
  max-width: 22ch;
}
.project-namerow {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 14px;
}
.project-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.15;
  letter-spacing: -0.018em;
  margin: 0;
  color: color-mix(in oklab, var(--fg) 76%, var(--bg));
  text-wrap: balance;
}
.project-flags {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  letter-spacing: 4px;
  line-height: 1;
  flex: none;
}
.project-desc {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 48ch;
}

.audience-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 22px;
}
.audience-tags span {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--fg);
  color: var(--bg);
  padding: 5px 9px;
  border-radius: 2px;
}

/* CTA — outlined pill with arrow, color coordinated to the background theme */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid var(--cta);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  background: transparent;
  color: var(--cta);
  position: relative;
  align-self: flex-start;
  margin-top: 8px;
  transition: transform 0.25s ease, background 0.25s ease;
}
.cta:hover {
  background: var(--cta);
  color: #ffffff;
}
.cta .arrow {
  display: inline-block;
  transition: transform 0.25s;
}
.cta:hover .arrow { transform: translateX(4px); }

/* Image side — consistent size across all case-study rows */
.project-preview {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(10, 10, 10, 0.03);
  border: 1px solid rgba(10, 10, 10, 0.08);
  box-shadow: 0 18px 40px -22px rgba(10, 10, 10, 0.30);
  align-self: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 0;
  display: flex;
}
.project-preview image-slot {
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.project.is-link:hover .project-preview image-slot { transform: scale(1.06); }
.project.is-link { cursor: none; }

/* ----------------------------------------------------------
   Compact "More work" grid — 3 columns, smaller tiles.
   ---------------------------------------------------------- */
.section-label--more {
  margin: clamp(40px, 6vh, 80px) var(--gutter) 0;
  padding: 0 0 16px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 56px) clamp(20px, 2.4vw, 36px);
  padding: clamp(28px, 4vh, 48px) var(--gutter) clamp(40px, 6vh, 72px);
}
.pcard {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.pcard-preview {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(10, 10, 10, 0.03);
  border: 1px solid rgba(10, 10, 10, 0.08);
  box-shadow: 0 12px 26px -18px rgba(10, 10, 10, 0.26);
  aspect-ratio: 16 / 9;
  display: flex;
}
.pcard-preview image-slot {
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.pcard:hover .pcard-preview image-slot { transform: scale(1.02); }
.pcard-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pcard-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.pcard-namerow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.pcard-title {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(17px, 1.2vw, 19px);
  line-height: 1.18;
  letter-spacing: -0.018em;
  color: var(--fg);
  text-wrap: balance;
}
.pcard-flags {
  font-size: 14px;
  letter-spacing: 4px;
  line-height: 1;
  flex: none;
  white-space: nowrap;
}
.pcard-desc {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 52ch;
}

/* ----------------------------------------------------------
   Personal project — a single feature spotlight.
   Tinted full-bleed band, off-center landscape media + side note.
   ---------------------------------------------------------- */
.personal {
  position: relative;
  overflow: hidden;
  background: var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, var(--bg));
  padding: clamp(48px, 7vh, 96px) 0 clamp(56px, 8vh, 104px);
}
/* Soft warm glows + fine grain so the band isn't a flat fill. */
.personal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 48% at 16% 10%, rgba(196,148,92,0.16), transparent 72%),
    radial-gradient(46% 46% at 94% 96%, rgba(120,82,48,0.13), transparent 70%),
    radial-gradient(40% 40% at 78% 18%, rgba(214,170,116,0.10), transparent 72%);
}
.personal::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
}
.personal-inner {
  position: relative;
  z-index: 1;
  padding: 0 var(--gutter);
}
.section-label--personal {
  margin: 0 0 clamp(28px, 4vh, 48px);
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}
.personal-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: clamp(32px, 4.5vw, 72px);
  align-items: center;
}
.personal-feature.is-link { text-decoration: none; color: inherit; cursor: none; }
.personal-feature.is-link:hover .personal-media image-slot,
.personal-feature.is-link:hover .personal-media .personal-cover { transform: scale(1.06); }
.personal-media {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(10, 10, 10, 0.04);
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  box-shadow: 0 24px 60px -28px rgba(10, 10, 10, 0.28);
}
.personal-media image-slot,
.personal-media .personal-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.personal:hover .personal-media image-slot,
.personal:hover .personal-media .personal-cover { transform: scale(1.02); }
.personal-body {
  display: flex;
  flex-direction: column;
}
.personal-title {
  margin: 4px 0 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.14;
  letter-spacing: -0.022em;
  color: var(--fg);
  text-wrap: balance;
}
.personal-role {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.personal-desc {
  margin: 18px 0 4px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 42ch;
}

/* ----------------------------------------------------------
   Footer — a simple divider + meta row
   ---------------------------------------------------------- */
.foot {
  margin-top: 0;
  padding: clamp(40px, 6vh, 72px) var(--gutter) clamp(32px, 4vh, 48px);
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 4vh, 48px);
}
.foot-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}
.foot-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: end;
}
@keyframes signatureShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.foot-links { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.foot-links a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  color: inherit;
}
.foot-links a .foot-ic {
  flex: none;
  color: var(--muted-2);
  transition: color 0.15s ease;
}
.foot-links a .foot-link-label {
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
  transition: border-color 0.15s ease;
}
.foot-links a:hover .foot-ic { color: var(--accent); }
.foot-links a:hover .foot-link-label { border-color: var(--fg); }
.foot-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ----------------------------------------------------------
   image-slot tuning
   ---------------------------------------------------------- */
image-slot {
  --slot-bg: transparent;
  --slot-border: rgba(10, 10, 10, 0.06);
  --slot-text: var(--muted);
  --slot-radius: 0;
}

/* ----------------------------------------------------------
   Swift cursor + trail (consumed by cursor.js)
   ---------------------------------------------------------- */
.swift-cursor {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-200px, -200px);
  transition: transform 0.07s ease-out, opacity 0.2s ease;
  will-change: transform;
  color: #3a3a3a;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}
@keyframes swiftBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
.swift-cursor > svg { animation: swiftBob 2.7s ease-in-out infinite; }
@keyframes swiftWingFlap {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-16deg); }
}
.swift-wing-l {
  transform-origin: 44px 32px;
  animation: swiftWingFlap 0.85s ease-in-out infinite;
}
.swift-trail {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  will-change: transform, opacity;
  animation: swiftTrailFloat var(--dur) cubic-bezier(0.3, 0.1, 0.4, 1) forwards;
}
@keyframes swiftTrailFloat {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(var(--r0)); }
  18%  { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(var(--r1)); }
  100% { opacity: 0;
         transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
                    scale(0.55) rotate(var(--r2)); }
}

/* Tweaks panel reset — restore native cursor inside the panel so the user
   can actually wield form controls (color swatches, dropdowns, etc.) */
.om-tp-panel, .om-tp-panel * { cursor: auto !important; }
.om-tp-panel button, .om-tp-panel input, .om-tp-panel select { cursor: pointer !important; }

/* ---- floating back-to-top button ---- */
.case-totop {
  position: fixed;
  right: clamp(18px, 3vw, 36px);
  bottom: clamp(18px, 3vw, 36px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 6px 22px rgba(10, 10, 10, 0.12);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.15s ease, border-color 0.15s ease;
}
.case-totop.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.case-totop:hover { border-color: var(--accent); color: var(--accent); }
.case-totop svg { display: block; }
/* docked: drop into normal flow, centered below the footer, so it never covers footer info */
.case-totop.is-docked {
  position: static;
  display: flex;
  width: fit-content;
  padding: 11px 16px 11px 13px;
  height: auto;
  margin: 6px auto 40px;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(10, 10, 10, 0.08);
}
.case-totop.is-docked span { display: inline; }
@media (prefers-reduced-motion: reduce) {
  .case-totop { transition: opacity 0.2s ease; transform: none; }
  .case-totop.is-visible { transform: none; }
}

/* ----------------------------------------------------------
   Responsive
   ---------------------------------------------------------- */
@media (max-width: 1100px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  :root { --nav-h: 60px; --gutter: 20px; }
  .nav-links { gap: 18px; font-size: 14px; }
  .case-totop {
    padding: 0;
    width: 46px;
    height: 46px;
    justify-content: center;
    gap: 0;
  }
  .case-totop span { display: none; }
  .hero { padding: 32px var(--gutter) 48px; }
  .project,
  .project.is-flipped {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 48px var(--gutter);
    min-height: 0;
  }
  .project.is-flipped .project-meta { order: 2; }
  .project.is-flipped .project-preview { order: 1; }
  .project-preview { min-height: 320px; aspect-ratio: 4 / 3; }
  .project-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px var(--gutter) 40px;
  }
  .personal-feature { grid-template-columns: 1fr; gap: 24px; }
  .personal-media { aspect-ratio: 16 / 10; }
  .section-label--more { margin-top: 24px; padding-top: 20px; }
  .foot { padding: 40px var(--gutter); gap: 24px; }
  .foot-row { grid-template-columns: 1fr; gap: 24px; }
  .foot-meta { text-align: left; }
  /* Hide bird on touch */
  .swift-cursor { display: none; }
  html, body { cursor: auto; }
}
