/* ============================================================
   Bianca Oliveira — Portfolio  (topbar layout, new home hero)
   ============================================================ */

/* ---- Design tokens ---- */
:root {
  --page: #F0F3F4;
  --bg: #ffffff;
  --surface: #efeff0;
  --ink: #0C0119;
  --muted: rgba(12, 1, 25, 0.52);
  --faint: rgba(12, 1, 25, 0.34);
  --line: #CECECE;
  --accent: #0099ff;
  --pink: #FF7797;
  --pink-glow: rgba(255, 119, 151, 0.55);
  --topbar-h: 112px;
  --gap: 14px;
  --radius: 28px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

body.dark {
  --page: #050506;
  --bg: #111113;
  --surface: #1b1b1e;
  --ink: #ededee;
  --muted: rgba(237, 237, 238, 0.55);
  --faint: rgba(237, 237, 238, 0.36);
  --line: rgba(237, 237, 238, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::selection {
  background: #FF7797;
  color: #fff;
}

::-moz-selection {
  background: #FF7797;
  color: #fff;
}

html,
body {
  height: 100%;
}

body {
  font-family: 'Space Mono', monospace;
  background: var(--page);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--pink);
  color: #fff;
}

/* ============================== TOPBAR ============================== */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 36px;
  background: transparent;
  border-bottom: none;
  transition: background 0.5s var(--ease);
}

body.dark .topbar {
  background: transparent;
}

.topbar-left {
  position: absolute;
  left: 36px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--faint);
}

.tb-copy {
  font-family: 'Pixelify Sans', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--faint);
}

.tb-social {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  transition: color 0.3s var(--ease), transform 0.3s var(--ease);
}

.tb-social:hover {
  color: var(--pink);
  transform: translateY(-2px);
}

body.dark .tb-copy,
body.dark .tb-social {
  color: rgba(255, 255, 255, 0.4);
}
body.dark .tb-social:hover {
  color: #fff;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ---- Mobile kebab + glass drawer (hidden on desktop) ---- */
.tb-kebab {
  display: none;              /* shown only on phones */
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid #CECECE;
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), transform 0.2s var(--ease);
}
.tb-kebab:hover { transform: translateY(-1px); border-color: var(--muted); }
body.dark .tb-kebab { border-color: rgba(255, 255, 255, 0.15); }

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(8, 2, 16, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.drawer-scrim.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 401;
  width: min(82vw, 340px);
  padding: 22px 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  border-left: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: -30px 0 80px -34px rgba(12, 1, 25, 0.55);
  transform: translateX(101%);
  transition: transform 0.42s var(--ease);
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
body.dark .drawer {
  background: rgba(18, 18, 22, 0.72);
  border-left-color: rgba(255, 255, 255, 0.08);
}
.drawer-close {
  align-self: flex-end;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.drawer-close:hover { transform: translateY(-1px); border-color: var(--muted); }
.drawer-group { display: flex; flex-direction: column; gap: 10px; }
.drawer-label {
  font-family: 'Pixelify Sans', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 2px;
}
.drawer-item {
  font-family: 'Pixelify Sans', monospace;
  font-size: 16px;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 16px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.drawer-item:hover { border-color: var(--muted); }
.drawer-item.active { border-color: var(--pink); color: var(--pink); }
.drawer-foot {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drawer-socials { display: flex; gap: 18px; }
.drawer-socials a { color: var(--faint); transition: color 0.2s var(--ease), transform 0.2s var(--ease); }
.drawer-socials a:hover { color: var(--pink); transform: translateY(-2px); }
.drawer-copy { font-family: 'Pixelify Sans', monospace; font-size: 13px; color: var(--faint); }

/* ---- Mobile carousel arrows (glass) + hint variants — hidden on desktop ---- */
.carousel-arrows { display: none; }
.pg-hint-mobile { display: none; }

.topbar-link {
  font-family: 'Pixelify Sans', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  padding: 25px 25px;
  border-radius: 14px;
  cursor: pointer;
  background: transparent;
  border: 1px solid #CECECE;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.3s var(--ease), transform 0.2s var(--ease), border-color 0.25s var(--ease);
  position: relative;
  letter-spacing: 0.01em;
}

.topbar-link:not(.active):hover {
  border-color: var(--muted);
  transform: translateY(-1px);
}

.topbar-link.active {
  background: linear-gradient(180deg, #FFC0D7 2%, #FFB1CD 44%, #FFBCCB 100%);
  color: #3a1322;
  border-color: transparent;
  /* Default (home — leftmost): shadow spreads left */
  box-shadow:
    0 6.75px 0 0 #F392A9,
    inset -13.50px 7.6px 24.80px 0 #FF9EB5,
    -17.70px 26.15px 60px 0 #FE97B4;
}

/* Playground (middle): shadow centered below */
[data-nav="playground"].topbar-link.active {
  box-shadow:
    0 6.75px 0 0 #F392A9,
    inset 0px 7.6px 24.80px 0 #FF9EB5,
    0px 26.15px 60px 0 #FE97B4;
}

/* Contact (rightmost): shadow spreads right */
[data-nav="contact"].topbar-link.active {
  box-shadow:
    0 6.75px 0 0 #F392A9,
    inset 13.50px 7.6px 24.80px 0 #FF9EB5,
    17.70px 26.15px 60px 0 #FE97B4;
}

/* Dark mode: all shadows at reduced opacity */
body.dark [data-nav="home"].topbar-link.active,
body.dark .topbar-link.active {
  box-shadow:
    0 6.75px 0 0 #F392A9,
    inset -13.50px 7.6px 24.80px 0 #FF9EB5,
    -14px 20px 50px 0 rgba(254, 151, 180, 0.55);
}
body.dark [data-nav="playground"].topbar-link.active {
  box-shadow:
    0 6.75px 0 0 #F392A9,
    inset 0px 7.6px 24.80px 0 #FF9EB5,
    0px 20px 50px 0 rgba(254, 151, 180, 0.55);
}
body.dark [data-nav="contact"].topbar-link.active {
  box-shadow:
    0 6.75px 0 0 #F392A9,
    inset 13.50px 7.6px 24.80px 0 #FF9EB5,
    14px 20px 50px 0 rgba(254, 151, 180, 0.55);
}


/* Dark mode: subtler borders on unselected menu + control buttons */
body.dark .topbar-link:not(.active) {
  border-color: rgba(255, 255, 255, 0.15);
}
body.dark .topbar-link:not(.active):hover {
  border-color: rgba(255, 255, 255, 1);
}
body.dark .ctrl-btn {
  border-color: rgba(255, 255, 255, 0.15);
}
body.dark .ctrl-btn:hover {
  border-color: rgba(255, 255, 255, 1);
}

.floating-controls {
  position: fixed;
  top: 30px;
  right: 36px;
  z-index: 200;
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: auto;
}

@media (max-width: 1100px) {
  .floating-controls {
    top: auto;
    bottom: 24px;
    right: 24px;
    flex-direction: row;
  }
}

@media (max-width: 600px) {
  .floating-controls {
    flex-direction: column;
    align-items: flex-end;
  }
}

.floating-controls .ctrl-btn,
.floating-controls .lang-switch {
  width: auto;
}

.floating-controls .lang-switch .ctrl-btn {
  width: 100%;
}

/* Location info — bottom left corner */
.floating-location {
  position: fixed;
  bottom: 36px;
  left: 36px;
  z-index: 200;
  font-family: 'Pixelify Sans', monospace;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.6;
  transition: color 0.5s var(--ease);
}

.ctrl-btn {
  font-family: 'Pixelify Sans', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 1px solid #CECECE;
  border-radius: 14px;
  padding: 25px 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.3s var(--ease), transform 0.2s var(--ease), border-color 0.25s var(--ease);
}

.ctrl-btn:hover {
  border-color: var(--muted);
  transform: translateY(-1px);
}

.ctrl-btn .chev {
  font-size: 9px;
}

.lang-switch {
  position: relative;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  bottom: auto;
  right: 0;
  background: var(--bg);
  border: none;
  border-radius: 10px;
  padding: 5px;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.25s var(--ease);
  box-shadow: none;
  z-index: 210;
}

@media (max-width: 1100px) {
  .lang-menu {
    top: auto;
    bottom: calc(100% + 8px);
    transform: translateY(6px);
  }
}

.lang-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  font-family: 'Space Mono', monospace;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: none;
  padding: 9px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lang-option:hover {
  background: var(--surface);
  color: var(--ink);
}

/* ============================== STAGE ============================== */
.stage {
  flex: 1;
  min-height: 100vh;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* ============================== HOME ============================== */
.view-home {
  background: var(--page);
  min-height: 100vh;
  padding-top: var(--topbar-h);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
}

/* --- Hero section --- */
.home-hero {
  flex-grow: 1;
  flex-shrink: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: calc(var(--topbar-h) + 20px) 24px 10vh;
  overflow: hidden;
  text-align: center;
}

/* Big headline wrapper */
.hero-title {
  position: relative;
  z-index: 2;
  animation: enterUpBig 0.9s var(--ease) backwards;
  animation-delay: 0.1s;
  width: 100%;
}

.hero-title-svg {
  display: block;
  width: clamp(380px, 82vw, 1040px);
  height: auto;
  max-height: clamp(120px, 28vh, 260px);
  margin: 0 auto;
  transform: translateX(40px);
  transition: filter 0.5s var(--ease), transform 0.5s var(--ease);
}

body.dark .hero-title-svg {
  filter: brightness(0) invert(1);
}

html[lang="pt-BR"] .hero-title-svg {
  transform: translateX(0px);
}

/* 3D Avatar wrapper — sits between the two text lines */
.avatar-3d-wrapper {
  position: relative;
  z-index: 3;
  width: clamp(200px, 25vh, 320px);
  height: clamp(220px, 29vh, 380px);
  margin: -195px 0 -55px; /* Pulls the avatar 3D up further */
  animation: floatAvatar 6s ease-in-out infinite;
  /* Radial fade-out at the bottom — elliptical so the edge is rounded */
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 38%, black 55%, transparent 72%);
  mask-image: radial-gradient(ellipse 100% 80% at 50% 38%, black 55%, transparent 72%);
}

@keyframes floatAvatar {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

.avatar-3d {
  width: 100%;
  height: 100%;
  --progress-bar-color: transparent;
  --progress-mask: transparent;
}

/* Pixelated face overlay positioned over the 3D avatar face */
.pixel-face-overlay {
  position: absolute;
  top: 49%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(75px, 9.5vh, 105px);
  height: clamp(75px, 9.5vh, 105px);
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pixel-face-overlay img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Pinyon Script subtitle */
.hero-sub {
  font-family: 'Pinyon Script', cursive;
  font-size: clamp(80px, 14vh, 170px);
  font-weight: 400;
  color: #FF7797;
  line-height: 1.0;
  position: relative;
  z-index: 4;
  /* Higher than wrapper z-index of 3, so text overlays the avatar */
  animation: enterUpBig 0.9s var(--ease) backwards;
  animation-delay: 0.3s;
  text-align: center;
  width: 100%;
  margin: -35px auto clamp(0px, 0.5vh, 8px);
  /* Pulled up by negative top margin, tight spacing to carousel */
}

/* ============================== HOME CASES (stacked cards) ============================== */
.home-cases {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 40px;
  gap: 0;
  position: relative;
  height: clamp(220px, 34vh, 360px);
  overflow: visible;
  margin-top: clamp(-240px, -28vh, -140px);
  margin-bottom: 30px; /* Prevent cards from being cut off at the bottom */
}

.home-case-card {
  position: relative;
  width: clamp(200px, 22vw, 380px);
  aspect-ratio: 1280 / 920;
  border-radius: 18px;
  overflow: hidden;
  cursor: none; /* Inherit global none, handle via global custom cursor */
  pointer-events: auto; /* Allow the card to be hit-tested directly in 3D */
  flex-shrink: 0;
  margin-left: -28px;
  box-shadow:
    0 20px 60px -16px rgba(0, 0, 0, 0.35),
    0 4px 12px -4px rgba(0, 0, 0, 0.18);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), z-index 0s;
  will-change: transform;
}

.home-case-card:first-child {
  margin-left: 0;
}

/* Fan rotation — each card gets a CSS var set by JS */
.home-case-card {
  transform: rotate(var(--rot, 0deg)) translateY(var(--ty, 0px));
}

.home-case-card:hover {
  transform: rotate(0deg) translateY(-24px) scale(1.06) !important;
  z-index: 10;
  box-shadow:
    0 36px 80px -20px rgba(0, 0, 0, 0.5),
    0 8px 20px -6px rgba(0, 0, 0, 0.25);
}

.home-case-card:hover .home-case-label {
  opacity: 1;
  transform: translateY(0);
}

.home-case-thumb {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.home-case-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
}

.home-case-label {
  position: absolute;
  bottom: 16px;
  left: 14px;
  right: 14px;
  z-index: 1;
  color: #0C0119;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

/* ---- 3D ring carousel (K95-style): shared perspective lives on the
   container so all cards converge to one vanishing point; slots are
   JS-positioned (no transition) — the inner .home-case-card keeps the
   CSS hover pop untouched ---- */
.home-cases {
  perspective: 1700px;
  transform-style: preserve-3d;
}

.hcc-slot {
  position: absolute;
  left: 50%;
  bottom: -16px;
  will-change: transform, opacity;
  transform-style: preserve-3d;
}

.hcc-slot .home-case-card {
  margin-left: 0; /* static-fan overlap doesn't apply inside slots */
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Scale up on hover (all cards, including back ones) */
.hcc-slot .home-case-card.hovered {
  transform: scale(1.1) translateY(-12px) !important;
  box-shadow:
    0 40px 90px -20px rgba(0, 0, 0, 0.55),
    0 10px 24px -6px rgba(0, 0, 0, 0.28);
  z-index: 200;
}

.hcc-slot.featured .home-case-card.hovered {
  transform: scale(1.12) translateY(-18px) !important;
}

/* Show label only while hovering a card */
.hcc-slot .home-case-card.hovered .home-case-label {
  opacity: 1;
  transform: translateY(0);
}

/* ============================== CUSTOM CAROUSEL CURSOR ============================== */
* {
  cursor: none !important;
}

body {
  --cursor-color: #0a0a0c;
}
body.dark {
  --cursor-color: #ffffff;
}

.hc-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  display: block;
  /* Centered exactly on the mouse coordinates */
  transform: translate(-50%, -50%);
}

.hc-cursor-ring {
  width: 12px;
  height: 12px;
  background: var(--cursor-color);
  border: 2px solid transparent;
  border-radius: 50%;
  box-shadow: none;
  transition: all 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hc-cursor.is-hovering-card .hc-cursor-ring {
  width: 46px;
  height: 46px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.hc-cursor-pill {
  position: absolute;
  left: calc(100% + 12px); /* Offset to the right of the ring */
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 100px;
  padding: 8px 16px 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.hc-cursor.is-hovering-card .hc-cursor-pill {
  opacity: 1;
  visibility: visible;
}

.hc-pill-icon {
  color: #0C0119;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hc-pill-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.hc-pill-title {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: #0C0119;
  letter-spacing: 0.01em;
  line-height: 1;
}

.hc-pill-category {
  font-size: 11px;
  font-weight: 400;
  color: #0C0119;
  line-height: 1;
}

body.dark .hc-pill-icon,
body.dark .hc-pill-title,
body.dark .hc-pill-category {
  color: #ffffff;
}

/* ---- Light/dark content panels ---- */
.panel-light {
  min-height: 100vh;
  padding: calc(var(--topbar-h) + clamp(14px, 2vh, 34px)) clamp(34px, 5vw, 92px) 140px;
  background: var(--page);
  color: var(--ink);
  overflow-y: auto;
}

.panel-light::-webkit-scrollbar {
  width: 0;
}

.eyebrow {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 20px;
}

.view-head {
  margin-bottom: 52px;
  max-width: 880px;
}

.view-title {
  font-size: clamp(36px, 5vw, 76px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.view-title em {
  font-style: italic;
  font-weight: 400;
}

.view-lead {
  font-size: clamp(16px, 1.4vw, 20px);
  color: var(--muted);
  margin-top: 20px;
  max-width: 64ch;
  line-height: 1.5;
}

/* WORKS list */
.works-list {
  list-style: none;
}

.work-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr auto 28px;
  align-items: center;
  gap: 26px;
  padding: clamp(20px, 3vh, 32px) 12px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: padding-left 0.35s var(--ease);
}

.works-list .work-row:last-child {
  border-bottom: 1px solid var(--line);
}

.work-index {
  font-size: 13px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  align-self: start;
  padding-top: 8px;
}

.work-name {
  font-size: clamp(26px, 3.2vw, 44px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  transition: color 0.3s var(--ease);
}

.work-tagline {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  max-width: 56ch;
  line-height: 1.45;
}

.work-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
  max-width: 280px;
}

.work-cats span {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.work-arrow {
  font-size: 20px;
  color: var(--faint);
  transition: transform 0.35s var(--ease), color 0.3s;
}

.work-cover {
  position: absolute;
  right: 70px;
  top: 50%;
  width: 116px;
  aspect-ratio: 1280 / 920;
  border-radius: 8px;
  overflow: hidden;
  transform: translateY(-50%) scale(0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease);
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.4);
}

.work-cover img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.work-row:hover {
  padding-left: 24px;
}

.work-row:hover .work-name {
  color: var(--pink);
}

.work-row:hover .work-arrow {
  color: var(--pink);
  transform: translate(4px, -4px);
}

.work-row:hover .work-cover {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.work-row:hover .work-cats {
  opacity: 0;
  transition: opacity 0.25s;
}

/* ============================== WORKS GALLERY (bento masonry) ============================== */
.works-gallery {
  margin-top: clamp(48px, 7vh, 80px);
  columns: 4;
  column-gap: 16px;
  padding-bottom: 80px;
}

.wg-card {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  cursor: none;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.wg-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 48px -12px rgba(255, 119, 151, 0.25);
  z-index: 2;
}

.wg-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.wg-card:hover img {
  transform: scale(1.05);
}

/* Placeholder cards — gradient backgrounds with project name */
.wg-placeholder {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 20px;
  background: linear-gradient(135deg, var(--wg-g1, #ddd), var(--wg-g2, #bbb));
}

.wg-placeholder-label {
  font-family: 'Pixelify Sans', monospace;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 6px 14px;
  border-radius: 999px;
}

/* Gallery section title */
.wg-section-title {
  font-family: 'Pixelify Sans', monospace;
  font-size: clamp(14px, 1.2vw, 16px);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.wg-section-title span {
  color: var(--pink);
}

@media (max-width: 1200px) {
  .works-gallery { columns: 3; }
}
@media (max-width: 800px) {
  .works-gallery { columns: 2; column-gap: 12px; }
  .wg-card { margin-bottom: 12px; border-radius: 12px; }
}
@media (max-width: 480px) {
  .works-gallery { columns: 1; }
}

/* ABOUT */
.about-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.about-big {
  font-size: clamp(48px, 8vw, 120px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.about-eyebrow {
  font-size: 13px;
  color: var(--muted);
  padding-top: 12px;
  white-space: nowrap;
}

.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 2fr;
  gap: 40px;
  padding: 44px 0 64px;
}

.about-intro {
  display: flex;
  flex-direction: column;
}

.about-name {
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.about-name em {
  font-style: normal;
  color: var(--muted);
}

.about-drizzle {
  margin-top: auto;
  padding-top: 30px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 30ch;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.stat {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: clamp(120px, 16vh, 168px);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.stat-empty {
  background: rgba(255, 255, 255, 0.015);
}

.stat-hi {
  background: rgba(255, 255, 255, 0.045);
}

.stat-num {
  display: block;
  font-size: clamp(30px, 3.4vw, 50px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.about-body {
  max-width: 760px;
  margin-bottom: 72px;
}

.about-h {
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.about-body p {
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 28px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: #0a0a0c;
  background: #fff;
  padding: 13px 24px;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), opacity 0.25s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.services-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 6px;
}

.service-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  align-items: start;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.service-row:last-child {
  border-bottom: 1px solid var(--line);
}

.service-n {
  font-size: 15px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}

.service-list {
  display: flex;
  flex-direction: column;
}

.service-tag {
  display: inline-block;
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.service-list ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.service-list li {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* CONTACT */
.contact-title {
  font-weight: 700;
}

.contact-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.contact-email {
  display: inline-block;
  font-size: clamp(26px, 4vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 8px 0 40px;
  transition: color 0.25s;
}

.contact-email:hover {
  color: var(--accent);
}

.contact-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.contact-links a {
  font-size: 15px;
  color: var(--muted);
  transition: color 0.25s;
}

.contact-links a:hover {
  color: var(--ink);
}

/* CASE STUDY */
.case-back {
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  margin-bottom: 30px;
  display: inline-flex;
  gap: 8px;
  transition: color 0.25s;
}

.case-back:hover {
  color: var(--ink);
}

.case-hero {
  position: relative;
  min-height: clamp(300px, 42vh, 440px);
  border-radius: 22px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  margin-bottom: 38px;
}

.case-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.42) 100%);
}

.case-hero-chips,
.case-hero-foot {
  position: relative;
  z-index: 1;
}

.case-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-chip {
  font-size: 12px;
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.case-hero-foot h1 {
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: #fff;
}

.case-hero-foot p {
  font-size: clamp(15px, 1.4vw, 19px);
  color: rgba(255, 255, 255, 0.92);
  margin-top: 10px;
  max-width: 60ch;
}

#case-content {
  max-width: 860px;
  margin: 0 auto;
}

.case-meta {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  padding-bottom: 28px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.case-meta-services {
  max-width: 420px;
}

.case-meta-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin-bottom: 8px;
}

.case-meta-value {
  display: block;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
}

.case-summary {
  font-size: clamp(21px, 2.3vw, 30px);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.4;
  max-width: 640px;
  margin: 0 auto 12px;
  text-align: center;
}

.case-body {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.case-section {
  margin-top: 52px;
}

.case-section h3 {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 18px;
}

.case-section p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 16px;
}

.case-link {
  display: inline-block;
  margin-top: 40px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

.case-next {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.case-next-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  margin-bottom: 18px;
}

.case-next-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.case-next-card {
  position: relative;
  text-align: left;
  border-radius: 16px;
  overflow: hidden;
  min-height: 150px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.3s var(--ease);
}

.case-next-card:hover {
  transform: translateY(-3px);
}

.case-next-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5));
}

.case-next-card span {
  position: relative;
  z-index: 1;
  color: #fff;
}

.case-next-label {
  font-size: 11px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.case-next-name {
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ============================== RESPONSIVE ============================== */
@media (max-width: 860px) {
  .topbar {
    padding: 0 18px;
  }
  .topbar-left { display: none; }

  .topbar-link {
    font-size: 13px;
    padding: 8px 12px;
  }

  .hero-title {
    font-size: clamp(52px, 12vw, 90px);
  }

  .hero-sub {
    font-size: clamp(44px, 10vw, 80px);
    margin-left: 0;
  }

  .home-cases {
    padding: 0 20px 50px;
    margin-top: clamp(-60px, -6vh, -30px);
    margin-bottom: 0;
  }

  .home-case-card {
    width: clamp(160px, 28vw, 230px);
    aspect-ratio: 1280 / 920;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .work-row {
    grid-template-columns: 28px 1fr 24px;
  }

  .work-cats,
  .work-cover {
    display: none;
  }
}

@media (max-width: 560px) {
  .topbar-nav {
    gap: 0;
  }

  .topbar-link {
    font-size: 12px;
    padding: 7px 9px;
  }

  .topbar-controls .ctrl-btn:last-child {
    display: none;
  }
}

/* ============================== MOTION ============================== */
@keyframes enterUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes enterUpBig {
  from {
    opacity: 0;
    transform: translateY(48px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes viewFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.panel-light {
  scroll-behavior: smooth;
}

.btn-primary:active,
.ctrl-btn:active,
.topbar-link:active,
.case-next-card:active,
.lang-option:active {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: no-preference) {
  .topbar-link {
    animation: enterUp 0.6s var(--ease) backwards;
  }

  .topbar-link:nth-child(1) {
    animation-delay: 0.05s;
  }

  .topbar-link:nth-child(2) {
    animation-delay: 0.10s;
  }

  .topbar-link:nth-child(3) {
    animation-delay: 0.15s;
  }

  .topbar-link:nth-child(4) {
    animation-delay: 0.20s;
  }

  .topbar-link:nth-child(5) {
    animation-delay: 0.25s;
  }

  .view.active {
    animation: viewFade 0.4s var(--ease);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  @keyframes floatAvatar {

    0%,
    100% {
      transform: none;
    }
  }
}
/* ============================================================
   V4 PAGES — case (editorial) · playground (spiral) · contact
   (multi-step) · about (rising head). Light home language.
   ============================================================ */

/* ---------- shared ---------- */
.page-scroll { scroll-behavior: smooth; }
.page-scroll::-webkit-scrollbar { width: 0; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* ============================ CASE (yungbld editorial) ============================ */
.case-page {
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  padding: calc(var(--topbar-h) + 26px) clamp(22px, 5vw, 84px) 140px;
}

/* Scroll-to-top button — same frosted-glass look as the mobile carousel arrows */
.case-scroll-top {
  position: fixed;
  bottom: 36px;
  right: 36px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 8000;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
              background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  pointer-events: none;
  box-shadow: 0 10px 26px -12px rgba(12, 1, 25, 0.4);
}
body.dark .case-scroll-top {
  background: rgba(30, 30, 36, 0.5);
  border-color: rgba(255, 255, 255, 0.14);
}
.case-scroll-top svg { width: 20px; height: 20px; }
.case-scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.case-scroll-top:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -10px rgba(12, 1, 25, 0.45);
}
body.dark .case-scroll-top:hover {
  background: rgba(40, 40, 48, 0.78);
  border-color: rgba(255, 255, 255, 0.28);
}
.case-scroll-top:active { transform: scale(0.92); }


.case-page .case-back {
  font-family: 'Pixelify Sans', monospace;
  font-size: 14px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  transition: color 0.25s, border-color 0.25s, transform 0.2s var(--ease);
}
.case-page .case-back:hover { color: var(--ink); border-color: var(--muted); transform: translateY(-1px); }

.cp-head { max-width: 1200px; margin: clamp(28px, 6vh, 64px) auto 0; }
.cp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-chip {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 7px 14px;
}
.cp-title {
  font-size: clamp(56px, 9.5vw, 136px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.94;
  margin-top: 22px;
}
.cp-tagline {
  font-size: clamp(18px, 2vw, 26px);
  color: var(--muted);
  max-width: 46ch;
  line-height: 1.35;
  margin-top: 18px;
}

.cp-meta {
  max-width: 1200px;
  margin: clamp(28px, 5vh, 52px) auto 0;
  display: grid;
  grid-template-columns: 180px 200px 1fr;
  gap: 28px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.cp-meta-label {
  display: block;
  font-family: 'Pixelify Sans', monospace;
  font-size: 12px;
  color: var(--faint);
  text-transform: lowercase;
  margin-bottom: 7px;
}
.cp-meta-value { display: block; font-size: 15px; font-weight: 500; line-height: 1.5; }

.cp-hero {
  max-width: 1200px;
  margin: clamp(26px, 4vh, 44px) auto 0;
  aspect-ratio: 16 / 8;
  border-radius: 26px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--g1, #ddd), var(--g2, #bbb));
}
.cp-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cp-lede {
  max-width: 1200px;
  margin: clamp(48px, 9vh, 96px) auto;
  font-size: clamp(22px, 2.7vw, 36px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.35;
  width: min(100%, 24em);
}

.cp-body { max-width: 1200px; margin: 0 auto; }
.cp-section {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(36px, 6vh, 64px) 0;
  border-top: 1px solid var(--line);
}
.cp-section-side { position: sticky; top: 12px; align-self: start; }
.cp-section-n {
  font-family: 'Pixelify Sans', monospace;
  font-size: 13px;
  color: var(--pink);
  display: block;
  margin-bottom: 10px;
}
.cp-section-side h3 {
  font-size: clamp(22px, 2.3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.cp-section-copy p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 62ch;
  margin-bottom: 16px;
}
.cp-section-copy p:last-child { margin-bottom: 0; }

.cp-live {
  display: inline-flex;
  margin: 34px auto 0;
  font-family: 'Pixelify Sans', monospace;
  font-size: 15px;
  color: var(--page);
  background: var(--ink);
  border-radius: 999px;
  padding: 15px 26px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.cp-live:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(12, 1, 25, 0.4); }

.cp-next {
  position: relative;
  max-width: 1200px;
  margin: clamp(56px, 10vh, 110px) auto 0;
  border-top: 1px solid var(--line);
  padding: clamp(30px, 5vh, 52px) 0 clamp(64px, 10vh, 120px);
}
.cp-next-eyebrow {
  font-family: 'Pixelify Sans', monospace;
  font-size: 13px;
  color: var(--faint);
  display: block;
  margin-bottom: 8px;
}
.cp-next-link {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 22px;
  padding: 0;
}
.cp-next-name {
  font-size: clamp(46px, 8vw, 112px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  transition: color 0.3s var(--ease);
}
.cp-next-arrow { font-size: clamp(30px, 4vw, 56px); transition: transform 0.35s var(--ease); }
.cp-next-link:hover .cp-next-name { color: var(--pink); }
.cp-next-link:hover .cp-next-arrow { transform: translateX(12px); }
.cp-next-cover {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 156px;
  border-radius: 16px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: 9000;
  transform: rotate(-4deg) scale(0.85) translate(-50%, -60%);
  transform-origin: top left;
  box-shadow: 0 26px 60px -22px rgba(12, 1, 25, 0.45);
  transition: opacity 0.35s var(--ease), transform 0.4s var(--ease);
  will-change: transform, left, top;
}
.cp-next-cover img { width: 100%; height: 100%; object-fit: cover; }
.cp-next-cover.is-visible { opacity: 1; transform: rotate(-4deg) scale(1) translate(-50%, -60%); }

@media (max-width: 900px) {
  .cp-meta { grid-template-columns: 1fr 1fr; }
  .cp-section { grid-template-columns: 1fr; }
  .cp-section-side { position: static; }
  .cp-next-cover { display: none; }
}

/* Phone: there's no hover, so the "next project" cover — normally a
   mouse-follow reveal — is shown as a fixed, always-visible thumbnail
   under the link instead of being hidden entirely. `!important` guards
   against `.cp-next-cover.is-visible` (higher specificity) ever winning. */
@media (max-width: 600px) {
  .cp-next-link { display: flex; }
  .cp-next-cover,
  .cp-next-cover.is-visible {
    display: block !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1280 / 780;
    opacity: 1 !important;
    pointer-events: none !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    margin-top: clamp(20px, 4vh, 32px);
    box-shadow: 0 20px 48px -20px rgba(12, 1, 25, 0.4);
  }
}

/* ============================ PLAYGROUND (K95 spiral) ============================ */
.view-playground {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: var(--page);
}
.pg-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, black 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, black 30%, transparent 78%);
  pointer-events: none;
}
.pg-stage {
  position: absolute;
  inset: 0;
  perspective: 1700px;
  transform-style: preserve-3d;
}
.pg-slot {
  position: absolute;
  left: 50%;
  top: 50%;
  will-change: transform, opacity;
  transform-style: preserve-3d;
}
.pg-card {
  width: clamp(140px, 15vw, 220px);
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 24px 50px -20px rgba(12, 1, 25, 0.35);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.pg-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-card.hovered {
  transform: scale(1.05);
  box-shadow: 0 34px 70px -22px rgba(12, 1, 25, 0.5);
}
.pg-word {
  position: absolute;
  right: clamp(20px, 4vw, 56px);
  top: clamp(14px, 4vh, 44px);   /* top-right — bottom corners belong to the floating controls */
  font-family: 'Pixelify Sans', monospace;
  font-size: clamp(34px, 4.6vw, 72px);
  color: var(--ink);
  pointer-events: none;
  z-index: 5;
}
.pg-intro {
  position: absolute;
  bottom: clamp(40px, 7vh, 80px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Space Mono', monospace;
  font-size: clamp(16px, 2.5vw, 28px);
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--ink);
  pointer-events: none;
  z-index: 5;
  text-align: center;
  width: 100%;
}
.pg-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 3vh, 32px);
  transform: translateX(-50%);
  font-family: 'Pixelify Sans', monospace;
  font-size: 13px;
  color: var(--faint);
  z-index: 5;
  pointer-events: none;
}

.pg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background: rgba(12, 1, 25, 0.48);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.pg-lightbox.open { opacity: 1; visibility: visible; }
.pg-lightbox-card {
  background: var(--bg);
  border-radius: 24px;
  padding: 16px;
  width: fit-content;
  max-width: 95vw;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.35s var(--ease);
}
.pg-lightbox.open .pg-lightbox-card { transform: none; }
.pg-lightbox-card img {
  width: auto;
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 16px;
  display: block;
  margin: 0 auto;
}
.pg-lightbox-card figcaption { padding: 18px 10px 10px; }
.pg-lightbox-title { font-family: 'Pixelify Sans', monospace; font-size: 22px; color: var(--ink); margin-right: 12px; }
.pg-lightbox-year { font-family: 'Pixelify Sans', monospace; font-size: 14px; color: var(--faint); }
.pg-lightbox-desc { font-size: 15px; line-height: 1.6; color: var(--muted); margin-top: 8px; }
.pg-lightbox-close {
  position: absolute;
  top: calc(var(--topbar-h) * 0.4);
  right: 36px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.25s;
}
.pg-lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

/* ============================ CONTACT (multi-step) ============================ */
.view-contact {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: var(--page);
}
.cf-wrap {
  position: absolute;
  inset: 0 0 176px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--topbar-h) + 40px) 24px 0;
  z-index: 2;
}
.view-contact.active .cf-wrap { animation: fadeUp 0.7s var(--ease) both; }

.cf-title {
  font-family: 'Space Mono', monospace;
  font-size: clamp(40px, 6vw, 70px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.1;
  color: var(--ink);
}
.cf-sub {
  font-family: 'Pinyon Script', cursive;
  font-size: clamp(30px, 3.6vw, 52px);
  color: #FF7797;
  line-height: 1;
  margin-top: 6px;
}

.cf-stage { position: relative; width: 100%; height: clamp(130px, 24vh, 240px); margin-top: clamp(18px, 4vh, 42px); }
.cf-step {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s;
}
.cf-step.active { opacity: 1; visibility: visible; transform: none; }

.cf-field { display: inline-flex; align-items: center; gap: clamp(12px, 2vw, 26px); color: var(--ink); }
.cf-icon { width: clamp(34px, 4.4vw, 58px); height: auto; color: var(--faint); flex-shrink: 0; }
.cf-field:focus-within .cf-icon { color: var(--pink); }
.cf-input {
  font-family: 'Space Mono', monospace;
  font-size: clamp(24px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  caret-color: var(--pink);
  width: auto;
  field-sizing: content;
  min-width: 5ch;
  max-width: 68vw;
  text-align: center;
}
.cf-input::placeholder { color: var(--faint); opacity: 1; font-weight: 400; }

.cf-input:-webkit-autofill,
.cf-input:-webkit-autofill:hover,
.cf-input:-webkit-autofill:focus,
.cf-input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ink) !important;
  -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
  transition: background-color 5000s ease-in-out 0s !important;
}

.cf-input:-webkit-autofill::first-line {
  font-family: 'Space Mono', monospace !important;
  font-size: clamp(24px, 4vw, 48px) !important;
  font-weight: 600 !important;
  letter-spacing: -0.035em !important;
}

@keyframes cfShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.cf-field.shake { animation: cfShake 0.4s var(--ease); }

.cf-controls { display: flex; align-items: center; gap: 20px; margin-top: clamp(14px, 3vh, 30px); }
.cf-back {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
}
.cf-back:hover { color: var(--ink); border-color: var(--muted); }
.cf-dots { display: flex; gap: 7px; align-items: center; }
.cf-dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--line); transition: all 0.3s var(--ease); }
.cf-dots span.on { background: var(--pink); width: 22px; }
.cf-next {
  font-family: 'Pixelify Sans', monospace;
  font-size: 15px;
  color: var(--page);
  background: linear-gradient(180deg, #0C0119 2%, #261C31 44%, #2E2637 100%);
  border: none;
  border-radius: 14px;
  padding: 15px 28px;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  box-shadow:
    inset -13.50px 7.5px 25px 0px #434343,
    0px 6.80px 0px 0px #0C0119,
    -17.70px 26.20px 60px 0px rgba(12, 1, 25, 0.15);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.cf-next:hover {
  transform: translateY(-2px);
  box-shadow:
    inset -13.50px 7.5px 25px 0px #434343,
    0px 6.80px 0px 0px #0C0119,
    -17.70px 30px 65px 0px rgba(12, 1, 25, 0.25);
}

body.dark .cf-next {
  background: #ffffff;
  color: #0c0119;
  box-shadow:
    inset -13.50px 7.5px 25px 0px rgba(0, 0, 0, 0.1),
    0px 6.80px 0px 0px #cccccc,
    -17.70px 26.20px 60px 0px rgba(0, 0, 0, 0.3);
}
body.dark .cf-next:hover {
  box-shadow:
    inset -13.50px 7.5px 25px 0px rgba(0, 0, 0, 0.1),
    0px 6.80px 0px 0px #cccccc,
    -17.70px 30px 65px 0px rgba(0, 0, 0, 0.4);
}
.cf-error {
  min-height: 22px;
  margin-top: 12px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 13px;
  color: #e0245e;
}
.cf-privacy {
  margin-top: 18px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 12px;
}
.cf-privacy a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.cf-privacy a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}


/* success */
.cf-check { width: clamp(52px, 7vh, 68px); color: var(--ink); margin-bottom: 14px; }
.cf-done-title { font-size: clamp(30px, 4vw, 52px); font-weight: 700; letter-spacing: -0.03em; }
.cf-done-title em { font-family: 'Pinyon Script', cursive; font-weight: 400; font-style: normal; color: #FF7797; font-size: 1.2em; }
.cf-done-sub { font-size: 16px; color: var(--muted); margin-top: 8px; }
.cf-recap { display: flex; gap: 34px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.cf-recap div { display: flex; gap: 8px; align-items: baseline; }
.cf-recap dt { font-family: 'Pixelify Sans', monospace; font-size: 13px; color: var(--faint); }
.cf-recap dd { font-size: 15px; font-weight: 500; color: var(--ink); }
.cf-mailto { display: inline-block; margin-top: 18px; font-family: 'Pixelify Sans', monospace; font-size: 13px; color: var(--muted); text-decoration: underline; transition: color 0.25s; }
.cf-mailto:hover { color: var(--ink); }

/* marquee of cases at the bottom */
.cf-marquee {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 168px;
  overflow: hidden;
  z-index: 1;
  opacity: 0.6;
  transition: opacity 0.3s var(--ease);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.cf-marquee:hover {
  opacity: 1;
}
.cf-track {
  display: flex;
  gap: 18px;
  width: max-content;
  padding: 6px 0;
  animation: cfScroll 38s linear infinite;
}
.cf-marquee:hover .cf-track { animation-play-state: paused; }
@keyframes cfScroll { to { transform: translateX(-50%); } }
.cf-mcard {
  position: relative;
  width: 218px;
  height: 140px;
  border-radius: 14px;
  overflow: hidden;
  border: none;
  padding: 0;
  cursor: pointer;
  background: var(--bg);
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
}
.cf-mcard:hover { transform: translateY(-6px); }
.cf-mcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cf-mcard span {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

/* ============================ ABOUT (rising head) ============================ */
.view-about {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: var(--page);
}
.about-hero-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.about-ghost {
  position: absolute;
  left: 50%;
  bottom: -3%;
  transform: translateX(-50%);
  font-family: 'Pixelify Sans', monospace; /* monochrome pixel ghost (Coral Pixels is a color font → noisy at low opacity) */
  font-weight: 700;
  font-size: clamp(140px, 24vw, 380px);
  line-height: 0.8;
  color: var(--ink);
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
}
.about-copy {
  position: absolute;
  top: calc(var(--topbar-h) + clamp(10px, 3.5vh, 42px));
  left: 0;
  right: 0;
  margin: 0 auto;               /* centered without transform — fadeUp animates transform */
  width: min(720px, 88vw);
  text-align: center;
  z-index: 6;
  font-family: 'Pixelify Sans', monospace;
}
.view-about.active .about-copy { animation: fadeUp 0.8s var(--ease) 0.3s backwards; }
.about-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.about-tagline-l1 {
  font-family: 'Pixelify Sans', monospace;
  font-size: clamp(18px, 2.6vh, 24px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: 0.3px;
  text-align: center;
}
.about-tagline-title-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: rgba(135, 145, 230, 0.42);
  padding: 6px 26px;
  font-family: 'Pixelify Sans', monospace;
  font-size: clamp(30px, 5vh, 52px);
  color: var(--ink);
  letter-spacing: 3px;
  margin: 14px 0 26px;
  border-left: 4px solid #ff5e7e;
  border-right: 4px solid #ff5e7e;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 6px;
}
.about-tagline-title-box::before,
.about-tagline-title-box::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ff5e7e;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 94, 126, 0.55);
  animation: dotPulse 2.6s ease-in-out infinite;
}
.about-tagline-title-box::before { left: -8px; top: -6px; }
.about-tagline-title-box::after { right: -8px; bottom: -6px; animation-delay: 1.3s; }
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 94, 126, 0.55); }
  50%      { box-shadow: 0 0 0 7px rgba(255, 94, 126, 0); }
}

.about-line {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.about-line-2 { margin-top: 14px; }

/* ---------- Animated sky (day) → night in dark mode ---------- */
.sky-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg,
    #2f86d1 0%,
    #4f9fdf 28%,
    #79bdee 56%,
    #aad7f4 82%,
    #d6ecfb 100%);
  transition: background 1s var(--ease);
}
/* soft sun bloom bottom-right (like the reference) */
.sky-bg::before {
  content: '';
  position: absolute;
  inset: -12%;
  z-index: 1;
  background:
    radial-gradient(42% 34% at 84% 84%, rgba(255,255,255,0.95), rgba(255,255,255,0) 62%),
    radial-gradient(26% 22% at 18% 20%, rgba(255,255,255,0.45), rgba(255,255,255,0) 60%);
  transition: opacity 1s var(--ease), background 1s var(--ease);
}
/* starfield — invisible by day, revealed at night */
.sky-stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 1.1s var(--ease);
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 28% 42%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.6px 1.6px at 44% 12%, #fff, transparent),
    radial-gradient(1.1px 1.1px at 62% 30%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1.5px 1.5px at 76% 16%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 88% 38%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.3px 1.3px at 8% 60%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1.5px 1.5px at 34% 68%, #fff, transparent),
    radial-gradient(1.1px 1.1px at 54% 54%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1.4px 1.4px at 70% 62%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 92% 58%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.3px 1.3px at 20% 84%, rgba(255,255,255,0.8), transparent);
}
/* drifting cloud bands */
.sky-clouds {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background-repeat: repeat;
  transition: opacity 1s var(--ease), filter 1s var(--ease);
}
.sky-clouds--far {
  background-image:
    radial-gradient(120px 60px at 18% 30%, rgba(255,255,255,0.75), transparent 72%),
    radial-gradient(90px 48px at 26% 36%, rgba(255,255,255,0.7), transparent 72%),
    radial-gradient(140px 70px at 64% 22%, rgba(255,255,255,0.72), transparent 72%),
    radial-gradient(100px 52px at 72% 28%, rgba(255,255,255,0.65), transparent 72%);
  background-size: 760px 420px;
  opacity: 0.7;
  animation: cloudDrift 90s linear infinite;
}
.sky-clouds--near {
  background-image:
    radial-gradient(170px 92px at 40% 62%, rgba(255,255,255,0.92), transparent 70%),
    radial-gradient(130px 74px at 50% 68%, rgba(255,255,255,0.85), transparent 72%),
    radial-gradient(150px 82px at 86% 78%, rgba(255,255,255,0.95), transparent 70%),
    radial-gradient(110px 64px at 8% 82%, rgba(255,255,255,0.8), transparent 72%);
  background-size: 980px 560px;
  opacity: 0.9;
  animation: cloudDrift 58s linear infinite;
}
@keyframes cloudDrift {
  from { background-position-x: 0; }
  to   { background-position-x: -980px; }
}
@keyframes twinkle {
  from { opacity: 0.55; }
  to   { opacity: 1; }
}

/* ---------- Night ---------- */
body.dark .sky-bg {
  background: linear-gradient(180deg,
    #05070f 0%,
    #0a1230 34%,
    #16224e 66%,
    #22315f 100%);
}
body.dark .sky-bg::before {
  /* sun bloom → cool moon glow */
  background:
    radial-gradient(20% 20% at 82% 22%, rgba(226,236,255,0.9), rgba(226,236,255,0) 60%),
    radial-gradient(46% 40% at 82% 22%, rgba(150,180,255,0.28), rgba(150,180,255,0) 68%);
}
body.dark .sky-stars { opacity: 0.9; animation: twinkle 5s ease-in-out infinite alternate; }
body.dark .sky-clouds { filter: brightness(0.4) saturate(0.6); opacity: 0.5; }

.about-socials {
  position: absolute;
  bottom: 32px;
  left: 32px;
  display: flex;
  gap: 16px;
  z-index: 10;
}
.about-socials a {
  color: var(--ink);
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
}
.about-socials a:hover { opacity: 1; transform: translateY(-2px); }

/* Timeline/Journey Container */
.about-journey {
  width: min(720px, 88vw);
  margin: 80px auto 120px;
  font-family: 'Pixelify Sans', monospace;
  position: relative;
  z-index: 10;
}

.aj-timeline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin-bottom: 60px;
  padding: 0 20px;
}

.aj-timeline::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
  z-index: 1;
  transform: translateY(-50%);
}

.aj-node {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: none;
  background: none;
  border: none;
  padding: 10px;
  outline: none;
}

.aj-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c3c0c7;
  border: 2px solid var(--page);
  transition: all 0.3s var(--ease);
}

.aj-node.active .aj-dot {
  background: var(--pink);
  transform: scale(1.3);
  box-shadow: 0 0 0 4px var(--pink-glow);
}

.aj-year {
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
  font-weight: 500;
  transition: all 0.3s var(--ease);
}

.aj-node.active .aj-year {
  color: var(--ink);
  font-size: 38px;
  font-weight: 700;
  margin-top: 16px;
}

.aj-content {
  text-align: left;
  animation: fadeUp 0.6s var(--ease) both;
}

.aj-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.aj-subtitle {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 40px;
  line-height: 1.5;
}

.aj-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.aj-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  transition: transform 0.3s var(--ease);
}

.aj-row:hover {
  transform: translateX(6px);
}

.aj-role {
  font-weight: 600;
  color: var(--ink);
  flex: 2;
}

.aj-company {
  color: var(--ink);
  font-weight: 400;
  flex: 1;
  text-align: center;
}

.aj-period {
  color: var(--muted);
  flex: 1;
  text-align: right;
}

@media (max-width: 600px) {
  .aj-timeline {
    padding: 0;
  }
  .aj-year {
    font-size: 12px;
  }
  .aj-node.active .aj-year {
    font-size: 26px;
    margin-top: 10px;
  }
  .aj-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px 0;
  }
  .aj-company {
    text-align: left;
  }
  .aj-period {
    text-align: left;
  }
}

.about-avatar-stage {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: clamp(400px, 52vh, 640px);
  height: clamp(300px, 54vh, 560px);
  overflow: hidden;
  z-index: 2;
  transform: translateX(-50%);
}
@keyframes headRise { from { transform: translateX(-50%) translateY(68%); } to { transform: translateX(-50%) translateY(0); } }
.view-about.active .about-avatar-stage { animation: headRise 1.15s cubic-bezier(0.16, 0.8, 0.24, 1) 0.05s both; }
.about-avatar-inner {
  position: absolute;
  left: 0;
  bottom: -72%;                 /* raised from -84% */
  width: 100%;
  height: 200%;
}
.about-avatar-inner .avatar-3d { width: 100%; height: 100%; }
.about-avatar-inner .pixel-face-overlay {
  width: clamp(200px, 29vh, 320px);
  height: clamp(200px, 29vh, 320px);
}

@property --floaty {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}
.about-chips { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.about-chip, .about-cv {
  position: absolute;
  pointer-events: auto;
  transform: translate(
    calc(var(--par-x, 0) * var(--d, 20) * -1px),
    calc(var(--par-y, 0) * var(--d, 20) * -0.55px + var(--floaty, 0px))
  );
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.about-chip {
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  border-radius: 14px;
  padding: 16px 24px;
  text-align: center;
  font-family: 'Space Mono', monospace;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
body.dark .about-chip {
  background: rgba(20, 20, 25, 0.85);
  color: #eee;
}
.about-chip:hover {
  background: rgba(255, 255, 255, 1);
}
body.dark .about-chip:hover { background: rgba(28, 28, 36, 0.95); }
@keyframes chipFloat {
  0%, 100% { --floaty: 0px; }
  50%      { --floaty: -9px; }
}
.chip-num { display: block; font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.chip-cap { display: block; font-size: 12px; opacity: 0.7; }
.chip-tl { left: clamp(10%, 22vw, 28%); top: 44%; }
.chip-tr { right: clamp(10%, 22vw, 28%); top: 44%; }
.chip-bl { left: clamp(12%, 24vw, 30%); top: 74%; }
.chip-br { right: clamp(14%, 26vw, 32%); top: 74%; }

.about-cv {
  font-family: 'Space Mono', monospace;
  font-size: 15px;
  color: #fff;
  background: #111;
  border-radius: 12px;
  padding: 24px 32px;
  text-decoration: none;
  font-weight: 700;
}
body.dark .about-cv {
  background: #eee;
  color: #111;
}
.about-cv:hover { transform: translateY(-2px); }

/* backwards fill: once the entrance ends, the parallax transform takes over again.
   Second track = perpetual gentle float (starts after the entrance finishes). */
.view-about.active .about-chip { animation: fadeUp 0.7s var(--ease) backwards, chipFloat 7s ease-in-out infinite; }
.view-about.active .about-cv   { animation: fadeUp 0.7s var(--ease) backwards, chipFloat 8.5s ease-in-out infinite; }
.view-about.active .chip-tl { animation-delay: 0.55s, 1.3s; }
.view-about.active .chip-tr { animation-delay: 0.65s, 1.8s; }
.view-about.active .chip-bl { animation-delay: 0.75s, 2.3s; }
.view-about.active .chip-br { animation-delay: 0.85s, 1.1s; }
.view-about.active .about-cv { animation-delay: 0.95s, 2.6s; }

/* ============================================================
   RESPONSIVE SYSTEM — tablet (≤900) + phone (≤600)
   Keeps the desktop concept & visual language; reflows the
   layered (absolutely-positioned) compositions into readable
   vertical stacks and shrinks the floating furniture so nothing
   collides. Two clean breakpoints only.
   ============================================================ */

/* ---------- TABLET & PHONE shared ---------- */
@media (max-width: 900px) {
  :root { --topbar-h: 90px; }

  /* Topbar pills: a touch taller for tap comfort, tighter horizontally */
  .topbar { padding: 0 14px; }
  .topbar-nav { gap: 8px; }
  .topbar-link { font-size: 13px; padding: 11px 13px; border-radius: 12px; }

  /* Floating controls → compact frosted chips, always legible over any content */
  .floating-controls { top: auto; bottom: 16px; right: 14px; gap: 8px; }
  .ctrl-btn {
    padding: 11px 15px;
    font-size: 13px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(10px) saturate(1.4);
    backdrop-filter: blur(10px) saturate(1.4);
    border-color: rgba(12, 1, 25, 0.08);
  }
  body.dark .ctrl-btn {
    background: rgba(28, 28, 33, 0.72);
    border-color: rgba(237, 237, 238, 0.12);
  }
  .floating-location { bottom: 14px; left: 14px; font-size: 12px; }

  /* ---- HOME ---- */
  .home-hero { padding: 8px 18px 3vh; }
  .hero-title-svg { width: min(88vw, 640px); transform: none; max-height: 20vh; }
  html[lang="pt-BR"] .hero-title-svg { transform: none; }
  .avatar-3d-wrapper { margin: -140px 0 -46px; }
  .hero-sub { font-size: clamp(60px, 12vw, 120px); margin-top: -32px; }
  .home-cases {
    padding: 0 12px;
    height: clamp(200px, 34vh, 320px);
    margin-top: clamp(-70px, -8vh, -40px);
    margin-bottom: 0;
  }
  /* At tablet, use vw so cards don't exceed available space */
  .home-case-card { width: clamp(150px, 22vw, 240px); }
  /* lift the fanned ring clear of the bottom furniture (location + controls) */
  .hcc-slot { bottom: clamp(104px, 15vh, 150px); }

  /* ---- Intermediate zone (750-900px): prevent card overlap ---- */
  @media (max-width: 750px) {
    .home-case-card { width: clamp(140px, 28vw, 200px); }
    .home-cases { height: clamp(180px, 30vh, 260px); }
  }

  /* ---- ABOUT: layered composition → scrollable vertical stack ---- */
  .view-about { height: auto; min-height: calc(100dvh - var(--topbar-h)); overflow: visible; }
  .about-hero-screen {
    height: auto;
    min-height: calc(100dvh - var(--topbar-h));
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: calc(var(--topbar-h) + 16px) 20px 36px;
    gap: 20px;
  }
  .about-copy { position: static; order: 1; width: 100%; max-width: 580px; }
  .about-tagline-l1 { font-size: clamp(16px, 4.4vw, 22px); }
  .about-tagline-title-box { font-size: clamp(26px, 7.5vw, 46px); margin: 12px 0 18px; }
  .about-line { font-size: 13px; line-height: 1.6; }

  /* chips: static 2×2 grid, parallax/float disabled (no pointer on touch) */
  .about-chips {
    position: static;
    order: 2;
    inset: auto;
    width: 100%;
    max-width: 520px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .about-chip, .about-cv {
    position: static;
    inset: auto;
    left: auto; right: auto; top: auto; bottom: auto;
    transform: none;
    width: 100%;
    margin: 0;
  }
  .about-cv {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 24px;
    font-size: 14px;
  }
  /* entrance only (no translateX / float which fight the static grid) */
  .view-about.active .about-chip,
  .view-about.active .about-cv { animation: fadeUp 0.6s var(--ease) backwards; animation-delay: 0.15s; }

  /* avatar sits at the bottom of the column, still cropped from the nose up */
  .about-avatar-stage {
    position: relative;
    order: 3;
    left: auto;
    bottom: auto;
    transform: none;
    width: min(84vw, 440px);
    height: clamp(260px, 40vh, 400px);
    margin: 4px auto 0;
  }
  .view-about.active .about-avatar-stage { animation: fadeUp 0.9s var(--ease) 0.1s both; }
  .about-avatar-inner { bottom: -58%; }

  .about-socials { position: static; order: 4; margin-top: 4px; }

  /* ---- CONTACT ---- */
  .cf-recap { gap: 16px; flex-direction: column; }

  /* ---- PLAYGROUND: increase card size at tablet ---- */
  .pg-card { width: clamp(160px, 28vw, 220px); }
  .pg-hint { bottom: 12px; }
}

/* ---------- PHONE ---------- */
@media (max-width: 600px) {
  :root { --topbar-h: 92px; }

  /* Bigger menu; nav on the left, kebab drawer trigger on the right */
  .topbar { padding: 0 12px; justify-content: space-between; }
  .topbar-nav { gap: 6px; }
  .topbar-link { font-size: 15px; padding: 15px 14px; border-radius: 12px; }
  .tb-kebab { display: flex; }

  /* The glass drawer replaces the corner floating controls on phones.
     Scoped to the SPA (body has data-view); the standalone privacidade.html
     has no drawer, so it keeps its floating controls. */
  body[data-view] .floating-controls { display: none; }

  /* HOME — scale the hero so title fits and the ring clears the corners */
  .hero-title-svg { width: 92vw; max-height: 15vh; }
  /* Smaller avatar face on phone */
  .avatar-3d-wrapper {
    margin: -80px 0 -30px;
    width: clamp(120px, 32vw, 170px);
    height: clamp(140px, 36vw, 200px);
  }
  .hero-sub { font-size: clamp(50px, 17vw, 96px); margin-top: -24px; }
  /* Mobile home layout: hero (title + avatar + script) sits near the centre of
     the screen; the cases carousel comes right below it with breathing room;
     the "currently based in…" note stays pinned bottom-left, clear of the carousel. */
  .view-home {
    min-height: 100dvh;
    justify-content: center;                          /* centre the hero + carousel group */
    gap: clamp(20px, 4vh, 40px);                      /* spacing between hero and carousel */
    /* extra top bias pushes the group down so the hero lands near screen centre */
    padding: calc(var(--topbar-h) + 11vh) 0 84px;
  }
  .home-hero {
    padding: 0 18px;
    flex: 0 0 auto;
  }
  .home-cases {
    height: clamp(170px, 22vh, 215px);
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
  }
  .home-case-card { width: clamp(212px, 62vw, 300px); }
  /* Smaller pixel face on phone */
  .pixel-face-overlay {
    width: clamp(52px, 13vw, 75px);
    height: clamp(52px, 13vw, 75px);
  }
  /* cards sit inside their own box (not lifted into the corner furniture) */
  .hcc-slot { bottom: clamp(4px, 1.5vh, 16px); }
  /* Location note — bottom-left, with a gap above it */
  .floating-location { font-size: 13px; line-height: 1.6; bottom: 20px; left: 16px; }

  /* ABOUT — single-column stat stack reads best on a narrow screen */
  .about-chips { grid-template-columns: 1fr; max-width: 340px; }

  /* CONTACT — two-row grid for the marquee cards so they're bigger and fill width */
  .cf-marquee {
    height: auto;
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    overflow: hidden;
    padding: 16px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .cf-marquee .cf-track {
    animation: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    padding: 0;
  }
  /* Show only first 4 cards (one full set, no duplicates) */
  .cf-marquee .cf-track:last-child { display: none; }
  .cf-mcard {
    width: 100%;
    height: clamp(110px, 28vw, 160px);
  }
  .cf-wrap { inset: 0; bottom: 0; }

  /* PLAYGROUND — espiral 3D compacta no mobile */
  .pg-card { width: clamp(124px, 35vw, 164px); }
  .pg-word { font-size: clamp(28px, 9vw, 50px); }
  .pg-intro { bottom: clamp(52px, 9vh, 90px); font-size: clamp(13px, 3.5vw, 20px); }
  .pg-hint { bottom: clamp(20px, 3.5vh, 36px); }
  /* Hint text: mobile users drag, not scroll */
  .pg-hint-desktop { display: none; }
  .pg-hint-mobile { display: inline; }

  /* ---- Glass arrows to rotate the carousels (mobile only) ---- */
  #home-arrows, #pg-arrows {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 90;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    pointer-events: none;   /* only the buttons are interactive */
  }
  body[data-view="home"] #home-arrows { display: flex; bottom: 30%; }
  body[data-view="playground"] #pg-arrows { display: flex; top: 50%; transform: translateY(-50%); }
  .carousel-arrow {
    pointer-events: auto;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(14px) saturate(1.5);
    backdrop-filter: blur(14px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 26px -12px rgba(12, 1, 25, 0.4);
    cursor: pointer;
    transition: transform 0.15s var(--ease), background 0.2s var(--ease);
  }
  body.dark .carousel-arrow {
    background: rgba(30, 30, 36, 0.5);
    border-color: rgba(255, 255, 255, 0.14);
  }
  .carousel-arrow:active { transform: scale(0.92); }

  /* CONTACT — make view scrollable so the 2-row grid is reachable */
  .view-contact { height: auto; min-height: 100dvh; overflow-y: auto; }
  .cf-wrap {
    position: static;
    inset: auto;
    padding: calc(var(--topbar-h) + 24px) 20px 32px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cf-track,
  .sky-clouds,
  .sky-stars,
  .about-tagline-title-box::before,
  .about-tagline-title-box::after,
  body[data-view="about"] .topbar-link.active { animation: none; }
  .view-about.active .about-avatar-stage,
  .view-about.active .about-copy,
  .view-about.active .about-chip,
  .view-about.active .about-cv,
  .view-contact.active .cf-wrap { animation: none; }
}

/* spiral cards must re-enable hit-testing inside pointer-events:none slots */
.pg-card { pointer-events: auto; cursor: none; }

/* FIX: .view-home declares display:flex which outlived .view{display:none} — hide it when inactive and keep flex when active */
.view-home:not(.active) { display: none !important; }
.view-home.active { display: flex !important; }

/* Home furniture stays on home: only the topbar and the lang/dark floating controls repeat across views */
body:not([data-view="home"]) .floating-location { display: none; }
