*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; overflow-y: scroll; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

::selection {
  background: var(--selection-bg);
  color: var(--selection-color);
}
:root {
  /* Colors — Light Theme */
  --bg: #ffffff;
  --bg-secondary: #FAFAFA;
  --bg-tertiary: #F6F4F4;
  --border: #EFEFEF;
  --text: #121212;
  --text-82: rgba(18, 18, 18, 0.82);
  --text-50: rgba(18, 18, 18, 0.50);
  --text-32: rgba(18, 18, 18, 0.32);
  --text-16: rgba(18, 18, 18, 0.16);
  --accent: rgb(22, 177, 247);
  --accent-hover: rgb(14, 165, 238);
  --accent-shadow: rgba(22, 177, 247, 0.35);
  --accent-border: rgba(176, 205, 246, 0.32);
  --card-hover-shadow: 0 16px 48px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.04);
  --selection-bg: rgba(22, 177, 247, 0.15);
  --selection-color: #121212;
  --placeholder-bg: #E5E5E5;
  --placeholder-text: #999;

  /* Lifestyle */
  --lifestyle-gradient-from: rgba(174, 210, 252, 0.32);
  --lifestyle-gradient-to: rgba(233, 242, 255, 0.32);
  --lifestyle-border: rgba(74, 149, 254, 0.16);
  --lifestyle-accent: #4A95FE;
  --lifestyle-music-bg: #ffffff;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);

  /* Chat */
  --chat-bg: rgba(255, 255, 255, 0.95);
  --chat-msg-user: var(--accent);
  --chat-msg-user-text: #fff;
  --chat-msg-bot: #F0F0F0;
  --chat-msg-bot-text: var(--text);
  --chat-input-bg: #F6F4F4;
  --chat-input-border: #EFEFEF;

  /* Spacing */
  --page-max: 1280px;
  --content-max: 1216px;
  --narrow-max: 680px;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --radius-pill: 64px;

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1a1a1a;
  --border: #222222;
  --text: #e8e8e8;
  --text-82: rgba(232, 232, 232, 0.82);
  --text-50: rgba(232, 232, 232, 0.50);
  --text-32: rgba(232, 232, 232, 0.32);
  --text-16: rgba(232, 232, 232, 0.16);
  --accent: rgb(22, 177, 247);
  --accent-hover: rgb(50, 190, 255);
  --accent-shadow: rgba(22, 177, 247, 0.25);
  --accent-border: rgba(22, 177, 247, 0.24);
  --card-hover-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
  --selection-bg: rgba(22, 177, 247, 0.25);
  --selection-color: #e8e8e8;
  --placeholder-bg: #2a2a2a;
  --placeholder-text: #666;

  --lifestyle-gradient-from: rgba(74, 149, 254, 0.12);
  --lifestyle-gradient-to: rgba(74, 149, 254, 0.06);
  --lifestyle-border: rgba(74, 149, 254, 0.12);
  --lifestyle-accent: #6aafff;
  --lifestyle-music-bg: #1a1a1a;

  --glass-bg: rgba(20, 20, 20, 0.72);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);

  --chat-bg: rgba(20, 20, 20, 0.95);
  --chat-msg-bot: #1e1e1e;
  --chat-msg-bot-text: var(--text);
  --chat-input-bg: #1a1a1a;
  --chat-input-border: #2a2a2a;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(40px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes heartPop {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.35); }
  50%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}
@keyframes storyFadeIn {
  from { opacity: 0; transform: scale(1.03); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.anim-fade-up    { opacity: 0; animation: fadeUp 0.7s var(--ease-out) forwards; }
.anim-fade-in    { opacity: 0; animation: fadeIn 0.6s ease forwards; }
.anim-scale-in   { opacity: 0; animation: scaleIn 0.6s var(--ease-out) forwards; }
.anim-slide-right{ opacity: 0; animation: slideRight 0.6s var(--ease-out) forwards; }
.anim-slide-left { opacity: 0; animation: slideLeft 0.6s var(--ease-out) forwards; }
.anim-card-reveal{ opacity: 0; animation: cardReveal 0.8s var(--ease-out) forwards; }

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.28s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.55s; }
.delay-6 { animation-delay: 0.7s; }
.delay-7 { animation-delay: 0.85s; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Page transition */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.page-transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* View Transitions — smooth crossfade for theme switch */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  mix-blend-mode: normal;
}
::view-transition-old(root) {
  z-index: 1;
  animation: themeFadeOut 0.35s ease both;
}
::view-transition-new(root) {
  z-index: 2;
  animation: themeFadeIn 0.35s ease both;
}
@keyframes themeFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes themeFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* Aave-style Glass Effect — SVG feDisplacementMap */

/* SVG filter definition (injected via JS) */
.glass-svg-filters {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Glass displacement effect */
.glass-displacement {
  position: relative;
}

.glass-displacement::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  z-index: -1;
  transition: background 0.4s ease, border-color 0.4s ease;
}

/* When SVG filter is supported and active */
.glass-displacement.svg-glass-active {
  filter: url(#glass-displacement-filter);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Fallback: standard backdrop-filter */
.glass-fallback {
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

/* Glass card overlay on hover */
.glass-hover-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  backdrop-filter: blur(8px) saturate(160%);
  background: rgba(255, 255, 255, 0.06);
}

.card:hover .glass-hover-overlay {
  opacity: 1;
}
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 12px 32px;
  transition: transform 0.3s var(--ease-out), padding 0.3s ease;
}

.site-header.scrolled {
  padding: 12px 32px;
}

.header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  height: 43px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.nav-pill a {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  color: var(--text-32);
  white-space: nowrap;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.nav-pill a:hover { color: var(--text-50); }
.nav-pill a.muted { color: var(--text-32); }
.nav-pill a.muted:hover { color: var(--text-50); }
.nav-pill a.active { color: var(--text); }
.nav-pill a.active:hover { color: var(--text); }

.nav-divider {
  width: 1px;
  height: 16px;
  background: rgb(156, 163, 175);
  flex-shrink: 0;
}
[data-theme="dark"] .nav-divider {
  background: rgba(156, 163, 175, 0.3);
}

.btn-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  padding: 0 16px;
  height: 44px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, background 0.3s ease;
}

.nav-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.nav-btn--secondary {
  background: var(--bg-tertiary);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text);
}

.nav-btn--secondary:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px var(--border), 0 2px 12px rgba(0, 0, 0, 0.08);
}

.nav-btn--primary {
  background: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-border);
  color: #ffffff;
}

.nav-btn--primary:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: inset 0 0 0 1px var(--accent-border), 0 4px 16px var(--accent-shadow);
  background: var(--accent-hover);
}

.nav-btn--primary:active { transform: translateY(0) scale(0.98); }
.nav-btn:hover svg { transform: rotate(-8deg) scale(1.1); }

/* Theme toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), background 0.4s ease, opacity 0.15s ease;
}
.theme-toggle:hover { transform: scale(1.1); }
.theme-toggle:active { transform: scale(0.9); }
.theme-toggle svg {
  width: 18px;
  height: 18px;
  color: var(--text);
  position: absolute;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-60deg) scale(0);
}
[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(60deg) scale(0);
}
[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), background 0.3s ease, opacity 0.15s ease;
}
.mobile-menu-btn:hover { transform: scale(1.05); }
.mobile-menu-btn:active { transform: scale(0.95); }
.mobile-menu-btn svg { width: 20px; height: 20px; color: var(--text); }

/* ─── Mobile menu (offmenu-style) ─── */
.mobile-menu {
  display: none;
  position: fixed;
  /* 8px from screen edges; dots at 14px inside = 22px from screen = matches header btn */
  top: 8px;
  left: 8px;
  z-index: 101;
  /* Figma: 196×172, r=12, bg=#121212 */
  width: 196px;
  height: 172px;
  background: #121212;
  overflow: hidden;
  border-radius: 12px;
  /* Start clipped to button area — menu dot grid exactly overlaps header button dots */
  clip-path: inset(4px 152px 128px 4px round 10px);
}
/* Dark theme glow on open */
[data-theme="dark"] .mobile-menu.open {
  box-shadow:
    0 0 0 1px inset rgba(255, 255, 255, 0.1),
    0 0 12px 0 inset rgba(255, 255, 255, 0.1),
    0 0 20px 4px rgba(255, 255, 255, 0.04);
  animation: mmOpen 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards, mmGlow 3s 0.6s ease-in-out infinite;
}
@keyframes mmGlow {
  0%, 100% { box-shadow: 0 0 0 1px inset rgba(255,255,255,0.1), 0 0 12px 0 inset rgba(255,255,255,0.1), 0 0 20px 4px rgba(255,255,255,0.04); }
  50%      { box-shadow: 0 0 0 1px inset rgba(255,255,255,0.14), 0 0 16px 0 inset rgba(255,255,255,0.12), 0 0 28px 6px rgba(255,255,255,0.07); }
}
/* Open — clip-path reveals from button area to full menu */
.mobile-menu.open {
  display: block;
  animation: mmOpen 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes mmOpen {
  0% {
    clip-path: inset(4px 152px 128px 4px round 10px);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    clip-path: inset(0 0 0 0 round 12px);
    opacity: 1;
  }
}
/* Closing — clip-path shrinks back to button area */
.mobile-menu.closing {
  display: block;
  animation: mmClose 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes mmClose {
  0% {
    clip-path: inset(0 0 0 0 round 12px);
    opacity: 1;
  }
  92% {
    clip-path: inset(4px 152px 128px 4px round 10px);
    opacity: 1;
  }
  100% {
    clip-path: inset(4px 152px 128px 4px round 10px);
    opacity: 0;
  }
}

/* ── Grid dots — at 14px inside = 22px from screen = same as header button dots ── */
.mm-dots {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 20px;
  height: 20px;
  display: grid;
  grid-template-columns: repeat(3, 4px);
  grid-template-rows: repeat(3, 4px);
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.mm-dot {
  width: 4px;
  height: 4px;
  border-radius: 5px;
  background: #fff;
  transition: opacity 0.3s ease;
}
/* Default: all dots same brightness (like header button) */
.mm-dot--bright { opacity: 1; }
.mm-dot--dim { opacity: 1; }
/* Open: all dots start uniform (1.0), then dim ones fade to 0.32 = checkerboard emerges */
.mobile-menu.open .mm-dot--dim {
  animation: mmDotDimIn 0.4s 0.2s ease-out forwards;
}
@keyframes mmDotDimIn {
  from { opacity: 1; }
  to   { opacity: 0.32; }
}
/* Closing: checkerboard merges back to uniform before clip shrinks */
.mobile-menu.closing .mm-dot--dim {
  animation: mmDotDimOut 0.15s ease-in forwards;
}
@keyframes mmDotDimOut {
  from { opacity: 0.32; }
  to   { opacity: 1; }
}

/* ── Theme toggle — same screen position as header's toggle ── */
/* Header: pad=12, dots-btn=40, gap=8 → theme btn at 60px screen-left
   Icon 18px centered in 40px = icon-left at 71px. Menu at 8px → 63px inside menu.
   Vertical: header pad=12 + 11(icon offset) = 23px screen → 15px inside menu */
.mm-theme {
  position: absolute;
  top: 15px;
  left: 63px;
  width: 18px;
  height: 18px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
.mobile-menu.open .mm-theme {
  animation: mmFadeIn 0.3s 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes mmFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* Theme icon animation — same rotate+scale+opacity as header toggle */
.mm-theme svg {
  position: absolute;
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.mm-theme .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.mm-theme .icon-moon {
  opacity: 0;
  transform: rotate(-60deg) scale(0);
}
[data-theme="dark"] .mm-theme .icon-sun {
  opacity: 0;
  transform: rotate(60deg) scale(0);
}
[data-theme="dark"] .mm-theme .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ── Links — 24px from left edge of menu ── */
.mm-links {
  position: absolute;
  top: 58px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mm-link {
  font-size: 18px;
  font-weight: 500;
  line-height: 22px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  opacity: 0;
  transition: color 0.2s ease;
}
.mm-link--current { color: rgba(255, 255, 255, 0.32); }
.mm-link svg { flex-shrink: 0; color: #fff; }
/* Staggered link reveal */
.mobile-menu.open .mm-link:nth-child(1) { animation: mmLinkIn 0.35s 0.1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.mobile-menu.open .mm-link:nth-child(2) { animation: mmLinkIn 0.35s 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.mobile-menu.open .mm-link:nth-child(3) { animation: mmLinkIn 0.35s 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes mmLinkIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
/* Closing: links vanish fast before container shrinks */
.mobile-menu.closing .mm-link { animation: mmLinkOut 0.15s ease-out forwards; }
.mobile-menu.closing .mm-link:nth-child(3) { animation-delay: 0.0s; }
.mobile-menu.closing .mm-link:nth-child(2) { animation-delay: 0.03s; }
.mobile-menu.closing .mm-link:nth-child(1) { animation-delay: 0.06s; }
@keyframes mmLinkOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(6px); }
}
/* Closing: theme fades fast */
.mobile-menu.closing .mm-theme { animation: mmFadeOut 0.12s ease-out forwards; }
@keyframes mmFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Mobile menu backdrop */
.mobile-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
}
.mobile-menu-backdrop.open { display: block; }
/* ─── Page Layout ─── */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 100px 32px 36px;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 128px;
  width: 100%;
}

/* ─── Hero ─── */
.hero {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: var(--content-max);
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  width: 100%;
}

/* ─── Hero Text ─── */
.hero-txt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 24px;
  width: 100%;
}

.avatar-wrap {
  width: 116px;
  height: 116px;
  cursor: pointer;
  border-radius: 50%;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #7AC4F0;
  transition: transform 0.5s var(--ease-out);
  animation: avatar-shimmer 4s ease-in-out infinite alternate;
}
@keyframes avatar-shimmer {
  0% { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #AED6F0; }
  50% { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #46BDFF; }
  100% { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px #AED6F0; }
}

.avatar-wrap:hover .avatar {
  transform: scale(1.08);
}

.avatar-wrap:active .avatar { transform: scale(1.02); }

.hero-name {
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-82);
  text-align: center;
  max-width: 964px;
  letter-spacing: -0.04em;
}

.hero-desc {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-32);
  text-align: center;
  max-width: 964px;
  letter-spacing: -0.02em;
}

/* ─── Projects ─── */
.projects {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.tab-content {
  display: none;
  width: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tab-content.active {
  display: block;
}
.tab-content.visible {
  opacity: 1;
}

/* ─── Lifestyle Photo Grid ─── */
.lifestyle {
  width: 100%;
  max-width: var(--content-max);
}

.lifestyle-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

.lifestyle-photo-grid .photo-card {
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out);
  background: #f7f4f4;
  border: 1px solid #efefef;
  padding: 8px;
}

.lifestyle-photo-grid .photo-card:hover {
  transform: scale(1.02);
}

.lifestyle-photo-grid .photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  box-shadow: 0 4px 8px rgba(18, 18, 18, 0.16);
}

[data-theme="dark"] .lifestyle-photo-grid .photo-card {
  background: #1e1e1e;
  border-color: #2a2a2a;
}

[data-theme="dark"] .lifestyle-photo-grid .photo-card img {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.32);
}

.show-more-btn {
  display: block;
  margin: 24px auto 0;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.show-more-btn:hover {
  background: var(--bg-tertiary, var(--border));
  color: var(--text);
}

/* Archive grid */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}
.archive-card {
  background: var(--bg-secondary);
  box-shadow: inset 0 0 0 1px var(--border);
  border-radius: 24px;
  padding: 8px 8px 14px;
  cursor: pointer;
  transition: transform 0.5s var(--ease-out);
  will-change: transform;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.archive-card:hover {
  transform: scale(1.02);
}
.archive-card:active {
  transform: scale(0.995);
}
.archive-card-img {
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 8px rgba(18, 18, 18, 0.16);
}
.archive-card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.12) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: none;
}
.archive-card:hover .archive-card-img::after {
  transform: translateX(100%);
  transition: transform 0.8s ease;
}
.archive-card-img img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.archive-card-img img.loaded {
  opacity: 1;
}
.archive-card-body {
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.archive-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.archive-card-title {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.04em;
}
.archive-card-year {
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--text-50);
  font-weight: 400;
  flex-shrink: 0;
}
.archive-card-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.archive-card-tags {
  display: flex;
  gap: 8px;
}
.archive-card-tag {
  font-size: 16px;
  font-weight: 400;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-tertiary);
  color: var(--text-50);
  border: 1px solid var(--border);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.archive-card-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.archive-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  color: var(--text-50);
  font-weight: 400;
  letter-spacing: -0.02em;
}
.archive-stat svg {
  width: 20px;
  height: 20px;
  opacity: 0.5;
}

.lifestyle-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 0;
  color: var(--text-32);
  font-size: 16px;
}

/* ─── Lightbox (stories-style) ─── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox.closing {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-viewer {
  position: relative;
  max-width: min(80vw, calc(100vw - 160px));
  max-height: min(88vh, calc(100vh - 96px));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.06);
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox.active .lightbox-viewer { opacity: 1; }
.lightbox.closing .lightbox-viewer { opacity: 0; transition: opacity 0.25s ease; }

.lightbox-img {
  max-width: min(80vw, calc(100vw - 160px));
  max-height: min(88vh, calc(100vh - 96px));
  object-fit: contain;
  display: block;
}

.lightbox-close {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10001;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
  opacity: 0;
  transform: scale(0.9);
}

.lightbox.active .lightbox-close {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.25s;
}

.lightbox.closing .lightbox-close {
  opacity: 0;
  transform: scale(0.9);
  transition-delay: 0s;
  transition-duration: 0.15s;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.28); transform: scale(1.08); }
.lightbox-close:active { transform: scale(0.9); }

/* Counter */
.lightbox-counter {
  position: fixed;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.lightbox.active .lightbox-counter { opacity: 1; transition-delay: 0.25s; }
.lightbox.closing .lightbox-counter { opacity: 0; transition-delay: 0s; }

/* Tap zones */
.lightbox-tap-left,
.lightbox-tap-right {
  position: absolute;
  top: 0; bottom: 0;
  z-index: 5;
  cursor: pointer;
}
.lightbox-tap-left { left: 0; width: 35%; }
.lightbox-tap-right { right: 0; width: 65%; }

/* Arrow buttons (beside viewer) */
.lightbox-arrow {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, background 0.2s ease, transform 0.2s ease;
  opacity: 0;
}

.lightbox.active .lightbox-arrow { opacity: 1; transition-delay: 0.25s; }
.lightbox.closing .lightbox-arrow { opacity: 0; transition-delay: 0s; transition-duration: 0.15s; }

.lightbox-arrow:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.08); }
.lightbox-arrow:active { transform: scale(0.9); }

.lightbox-prev { margin-right: 16px; }
.lightbox-next { margin-left: 16px; }

/* Responsive visibility utilities */
.show-mobile { display: none; }
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: inline !important; }
}

@media (max-width: 768px) {
  .lightbox-viewer {
    max-height: min(92vh, calc(100vh - 48px));
    max-width: min(85vw, calc(100vw - 120px));
  }
  .lightbox-img {
    max-width: min(85vw, calc(100vw - 120px));
    max-height: min(92vh, calc(100vh - 48px));
  }
  .lightbox-close { top: 16px; right: 16px; }
  .lightbox-arrow { width: 36px; height: 36px; }
  .lightbox-prev { margin-right: 8px; }
  .lightbox-next { margin-left: 8px; }
}

@media (max-width: 480px) {
  .lightbox-viewer {
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 32px);
    border-radius: 0;
  }
  .lightbox-img {
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 32px);
  }
  .lightbox-close {
    top: 12px;
    right: 12px;
    z-index: 10002;
  }
  .lightbox-arrow { display: none; }
  .lightbox-counter { top: 16px; font-size: 13px; }
}
/* ─── Filter Tabs ─── */
.filter-container {
  padding-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-pill);
  padding: 4px;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  height: 46px;
  font-size: 18px;
  font-weight: 500;
  line-height: 22px;
  color: var(--text-32);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease, color 0.3s ease;
}

.filter-tab.active {
  background: var(--bg);
  color: var(--text);
}
.filter-tab.active svg {
  color: var(--lifestyle-accent);
}

.filter-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.5);
}
[data-theme="dark"] .filter-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
}

.filter-tab:active { transform: scale(0.97); }

.filter-tab svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.filter-tab:hover svg { transform: scale(1.1); }

/* ─── Cards ─── */
.card {
  background: var(--bg-secondary);
  box-shadow: inset 0 0 0 1px var(--border);
  border-radius: var(--radius-xl);
  padding: 8px;
  width: 100%;
  max-width: var(--content-max);
  cursor: pointer;
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
  will-change: transform;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 0 0 1px var(--border), var(--card-hover-shadow);
}

.card:active {
  transform: translateY(-1px) scale(0.995);
}

.card-inner {
  display: flex;
  gap: 4px;
}

.card-left {
  width: 49%;
  height: 400px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  transition: transform 0.5s var(--ease-out);
}

.card-left img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.12) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: none;
}

.card:hover .card-left::after {
  transform: translateX(100%);
  transition: transform 0.8s ease;
}

.card:hover .card-left { transform: scale(1.01); }

.card-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px;
  border-radius: var(--radius-lg);
}

.card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.card-top { display: flex; flex-direction: column; gap: 16px; }

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-logo { display: flex; align-items: center; gap: 12px; }

.card-logo img,
.card-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  transition: transform 0.4s var(--ease-out), border-radius 0.3s ease;
}

.card-logo-icon {
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.card-logo-icon svg {
  width: 24px;
  height: 24px;
}

.card:hover .card-logo img,
.card:hover .card-logo-icon {
  transform: rotate(-3deg) scale(1.05);
  border-radius: 14px;
}

.card-logo-name {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  transition: letter-spacing 0.3s ease;
}


.card-num {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-32);
  transition: color 0.3s ease;
}

.card:hover .card-num { color: var(--text-50); }

/* Mobile-only badges (year/type next to logo) */
.card-badges-mobile {
  display: none;
  align-items: center;
  gap: 6px;
}
/* Figma: same height as logo, r=32, border, font=13/500 */
.card-badge {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-50);
  padding: 0 10px;
  border-radius: 32px;
  background: transparent;
  border: 1px solid var(--border);
  line-height: 1;
  letter-spacing: -0.26px;
  height: 32px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-desc {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
}

.card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-tag {
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-tertiary);
  color: var(--text-50);
  border: 1px solid var(--border);
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-meta { display: flex; flex-direction: column; gap: 4px; }

.card-meta-label {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-32);
  transition: color 0.3s ease;
}

.card:hover .card-meta-label { color: var(--text-50); }

.card-meta-value {
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
}

.card-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-border);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  width: 100%;
  height: 43px;
  border: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, background 0.3s ease;
}

.card-cta svg { width: 20px; height: 20px; flex-shrink: 0; }

.card-cta:hover {
  background: var(--accent-hover);
  box-shadow: inset 0 0 0 1px var(--accent-border), 0 4px 16px var(--accent-shadow);
}

/* Placeholder block for missing images */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--placeholder-bg);
  color: var(--placeholder-text);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  padding: 20px;
  border-radius: inherit;
  transition: background 0.4s ease;
}

/* Magnetic */
.magnetic { transition: transform 0.3s var(--ease-out); }

/* ─── Case Page (card layout) ─── */
.case-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 96px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
body:has(.case-page) {
  background: var(--bg-secondary);
}

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 200;
  width: 0%;
  transition: width 50ms linear;
}

/* Card wrapper */
.case-card {
  background: var(--bg);
  border-radius: 32px;
  padding: 8px;
}
.case-card-inner {
  padding: 32px 48px 40px;
}

/* Hero header — no card, sits on gray bg */
.case-hero {
  margin: 0;
  text-align: center;
  padding: 24px 48px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Hero image card */
.case-hero-card {
  padding: 8px;
}
.case-hero-card .case-hero-image {
  border-radius: 24px;
}

.case-hero-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(0,0,0,0.02);
  display: flex;
}
.case-hero-image .placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .case-hero-image {
  background: rgba(255,255,255,0.02);
}

.case-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-hero-hook {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.case-hero-hook .scope-pill {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 18px;
  padding: 6px 16px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-50);
  letter-spacing: -0.01em;
}
[data-theme="dark"] .case-hero-hook .scope-pill {
  border-color: rgba(255,255,255,0.06);
}

.case-hero h1 {
  font-size: 36px;
  font-weight: 600;
  line-height: 110%;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 720px;
}

.case-hero-subtitle {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-50);
  line-height: 22px;
  letter-spacing: -0.01em;
  max-width: 640px;
}

/* Scope pills (metadata) */
.case-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.case-scope-pill {
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 18px;
  padding: 6px 16px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}
.case-scope-pill .pill-label {
  color: var(--text-32);
  font-size: 13px;
  font-weight: 500;
}
[data-theme="dark"] .case-scope-pill {
  border-color: rgba(255,255,255,0.06);
}

/* Content wrapper */
.case-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Content sections */
.case-section {
  margin-bottom: 0;
}
.case-section .case-card-inner > *:last-child {
  margin-bottom: 0;
}

.case-section h2 {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 0;
  margin-bottom: 24px;
  line-height: 110%;
}
.case-section h2 .section-num {
  display: none;
}

.case-section h3 {
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 13px;
  margin-top: 40px;
  line-height: 110%;
  letter-spacing: -0.02em;
}

.case-section p {
  font-size: 16px;
  line-height: 22px;
  letter-spacing: -0.01em;
  color: var(--text-82);
  margin-bottom: 13px;
}

.case-section ul,
.case-section ol {
  padding-left: 24px;
  margin-bottom: 13px;
}

.case-section li {
  font-size: 16px;
  line-height: 22px;
  letter-spacing: -0.01em;
  color: var(--text-82);
  margin-bottom: 8px;
  list-style: disc;
}

.case-section ol li {
  list-style: decimal;
}

/* Callout — stat highlight */
.case-callout {
  background: var(--bg-tertiary);
  border-radius: 20px;
  padding: 24px 28px;
  margin: 24px 0;
}
.case-callout-label {
  font-size: 15px;
  color: var(--text-50);
  line-height: 1.5;
  margin-bottom: 8px;
}
.case-callout-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Blockquote — card style */
.case-quote {
  border-left: none;
  padding: 24px 28px;
  margin: 24px 0;
  background: var(--bg-secondary);
  border-radius: 20px;
}

.case-quote p {
  font-size: 16px;
  font-style: italic;
  color: var(--text-50);
  margin-bottom: 0;
  line-height: 22px;
  letter-spacing: -0.01em;
}

/* TL;DR block */
.case-tldr .case-card-inner {
  background: var(--bg-secondary);
  border-radius: 24px;
  padding: 32px;
}
.case-tldr h2 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.case-tldr ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}
.case-tldr li {
  list-style: none !important;
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.6;
  padding-left: 28px;
  position: relative;
  color: var(--text-50);
}
.case-tldr li .tldr-check {
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  color: var(--accent);
}
.case-tldr > .case-card-inner > p:last-child {
  margin-bottom: 0;
  font-size: 14px;
  color: var(--text-32);
}

/* Image in case — edge-to-edge within card 8px padding */
.case-card-inner .case-image {
  position: relative;
  margin-left: -48px;
  margin-right: -48px;
  width: calc(100% + 96px);
  border-radius: 24px;
  overflow: hidden;
  margin-top: 24px;
  margin-bottom: 24px;
  background: rgba(0,0,0,0.02);
  aspect-ratio: 16 / 9;
}
[data-theme="dark"] .case-card-inner .case-image {
  background: rgba(255,255,255,0.02);
}
.case-card-inner .case-image:last-child {
  margin-bottom: -40px;
}

.case-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.case-image iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Placeholder inside case images */
.case-card-inner .case-image .placeholder {
  font-size: 13px;
  color: var(--text-32);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* ─── Case Slider ─── */
.case-slider .case-slider-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  touch-action: pan-y;
}
.case-slider .case-slider-track img {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  display: block;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  cursor: zoom-in;
}
.case-slider .case-slider-track video {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  display: block;
  object-fit: cover;
  user-select: none;
}
.case-slider-prev,
.case-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text, #1a1a2e);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
  z-index: 2;
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
}
.case-slider:hover .case-slider-prev,
.case-slider:hover .case-slider-next {
  opacity: 1;
}
.case-slider-prev { left: 12px; }
.case-slider-next { right: 12px; }
.case-slider-prev:hover,
.case-slider-next:hover {
  background: var(--glass-bg);
  border-color: var(--glass-border);
}
.case-slider-prev:active,
.case-slider-next:active {
  transform: translateY(-50%) scale(0.95);
}
.case-slider-prev svg,
.case-slider-next svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.case-slider-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 9999px;
  background: rgba(8, 14, 40, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}
.case-slider-dots button {
  height: 6px;
  border-radius: 9999px;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}
.case-slider-dots button.active {
  width: 16px;
  background: #fff;
}
.case-slider-dots button:not(.active) {
  width: 6px;
  background: rgba(255, 255, 255, 0.5);
}
.case-slider-dots button:hover:not(.active) {
  background: rgba(255, 255, 255, 0.8);
}

/* ─── Lightbox ─── */
.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  cursor: zoom-out;
}
.lb-overlay.lb-active {
  background: rgba(0, 0, 0, 0.92);
}
.lb-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.3s ease, transform 0.3s ease;
  cursor: default;
  user-select: none;
}
.lb-active .lb-image {
  opacity: 1;
  transform: scale(1);
}
.lb-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lb-close:hover { background: rgba(255, 255, 255, 0.22); }
.lb-close:active { transform: scale(0.92); }
.lb-close svg { width: 20px; height: 20px; }
.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-prev:hover,
.lb-next:hover { background: rgba(255, 255, 255, 0.22); }
.lb-prev:active,
.lb-next:active { transform: translateY(-50%) scale(0.92); }
.lb-prev svg,
.lb-next svg { width: 22px; height: 22px; fill: currentColor; }
.lb-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.04em;
}

/* Highlight / results cards — rabiya style 1:1 */
.case-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 32px -48px;
  width: calc(100% + 96px);
}
.case-results-grid--top {
  margin: 0;
  width: 100%;
}

.case-result-card {
  background: var(--bg-tertiary);
  border-radius: 20px;
  padding: 22px 22px 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 200px;
}

.case-result-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.case-result-desc {
  font-size: 15px;
  color: var(--text-50);
  font-weight: 400;
  line-height: 1.55;
  flex: 1;
}

.case-result-metric {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-82);
  letter-spacing: -0.01em;
}
.case-result-metric strong {
  color: var(--text);
  font-weight: 600;
  margin-left: 4px;
}

/* Case accordion */
.case-accordion {
  margin: 24px 0;
  background: var(--bg-tertiary);
  border-radius: 20px;
  overflow: hidden;
  transition: background 0.25s ease;
}
.case-accordion-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 24px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}
.case-accordion-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.case-accordion-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-50);
}
.case-accordion-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  gap: 5px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-50);
  margin-top: 8px;
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 14px 10px 16px;
  min-width: 108px;
  transition: background 0.2s ease, color 0.2s ease;
}
.case-accordion:hover {
  background: var(--border);
}
.case-accordion-header:hover .case-accordion-toggle {
  background: var(--bg);
  color: var(--text);
}
.case-accordion-toggle svg {
  width: 14px; height: 14px;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.case-accordion.open .case-accordion-toggle svg {
  transform: rotate(180deg);
}
.case-accordion-toggle .toggle-read,
.case-accordion.open .toggle-hide { display: inline; }
.case-accordion-toggle .toggle-hide,
.case-accordion.open .toggle-read { display: none; }
.case-accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.case-accordion.open .case-accordion-panel {
  grid-template-rows: 1fr;
}
.case-accordion-panel-inner {
  overflow: hidden;
}
.case-accordion-content {
  padding: 0 24px 24px;
}
.case-accordion-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 10px;
  letter-spacing: -0.02em;
}
.case-accordion-content h3:first-child { margin-top: 20px; }
.case-accordion-content p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-50);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.case-accordion-content p:last-child { margin-bottom: 0; }
.case-accordion-content ul {
  list-style: disc;
  padding-left: 20px;
  margin: 12px 0;
}
.case-accordion-content li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-50);
  margin-bottom: 6px;
}

/* Timeline table */
.case-timeline {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.case-timeline th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-32);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
}

.case-timeline td {
  font-size: 15px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-82);
}

.case-timeline td:first-child {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  width: 100px;
}

/* Old case-nav — hidden, replaced by floating nav */
.case-nav {
  display: none;
}

/* Left TOC sidebar */
.case-toc {
  position: fixed;
  left: calc((100vw - 1080px) / 2 - 210px);
  top: 96px;
  width: 170px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.case-toc.visible {
  opacity: 1;
  pointer-events: auto;
}
.case-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.case-toc li {
  list-style: none;
}
.case-toc a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-32);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.case-toc .toc-num {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-16);
  min-width: 16px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}
.case-toc a:hover {
  color: var(--text-50);
  background: rgba(0,0,0,0.03);
}
.case-toc a:hover .toc-num {
  color: var(--text-32);
}
[data-theme="dark"] .case-toc a:hover {
  background: rgba(255,255,255,0.03);
}
.case-toc a.active {
  color: var(--text);
  font-weight: 500;
}
.case-toc a.active .toc-num {
  color: var(--text-32);
}

/* Hide TOC on viewports where it doesn't fit */
@media (max-width: 1440px) {
  .case-toc { display: none; }
}

/* Floating bottom navigation */
.case-bottom-nav {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(219, 219, 219, 0.5);
  border-radius: 16px;
  padding: 6px;
  display: flex;
  gap: 4px;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
[data-theme="dark"] .case-bottom-nav {
  background: rgba(40, 40, 40, 0.5);
}
.case-bottom-nav.visible {
  opacity: 1;
  pointer-events: auto;
}
.case-bottom-nav.visible.scroll-hidden {
  opacity: 0;
  pointer-events: none;
}

.case-bottom-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s ease;
  white-space: nowrap;
}
[data-theme="dark"] .case-bottom-nav a {
  background: rgba(60, 60, 60, 0.74);
}
.case-bottom-nav a:hover {
  background: rgba(255, 255, 255, 0.9);
}
[data-theme="dark"] .case-bottom-nav a:hover {
  background: rgba(80, 80, 80, 0.74);
}
.case-bottom-nav a.nav-icon-btn {
  padding: 10px 14px;
}
.case-bottom-nav a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.case-bottom-nav .nav-mobile-only {
  display: none;
}

/* Lessons section */
.case-lesson {
  padding: 20px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

.case-lesson strong {
  display: block;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
}

.case-lesson p {
  font-size: 15px;
  color: var(--text-50);
  margin-bottom: 0;
}
/* ─── About Page (Figma spec: 1280px frame) ─── */

/* Page wrapper — matches main page .page structure */
.ab {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 96px 32px 48px;
  min-height: 100vh;
}

/* Content wrap — 960px inner (1216px - 128px*2 padding) */
.ab-wrap {
  max-width: 960px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 48px;
}

/* Progressive blur — top and bottom */
.ab-blur {
  position: fixed;
  left: 0;
  right: 0;
  height: 8rem;
  z-index: 10;
  pointer-events: none;
}
.ab-blur--top { top: 0; }
.ab-blur--bottom { bottom: 0; }

/* Stagger animation */
@keyframes abFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.ab-wrap > * {
  animation: abFadeUp 0.6s var(--ease-out) both;
}
.ab-wrap > :nth-child(1) { animation-delay: 0.05s; }
.ab-wrap > :nth-child(2) { animation-delay: 0.1s; }
.ab-wrap > :nth-child(3) { animation-delay: 0.15s; }
.ab-wrap > :nth-child(4) { animation-delay: 0.2s; }
.ab-wrap > :nth-child(5) { animation-delay: 0.25s; }
.ab-wrap > :nth-child(6) { animation-delay: 0.3s; }
.ab-wrap > :nth-child(7) { animation-delay: 0.35s; }
.ab-wrap > :nth-child(8) { animation-delay: 0.4s; }
.ab-wrap > :nth-child(9) { animation-delay: 0.45s; }
.ab-wrap > :nth-child(n+10) { animation-delay: 0.5s; }

/* Section row — horizontal: left label + right content, space-between */
.ab-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

.ab-section-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.ab-section-right {
  width: 620px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Headings — Figma: Inter 500, 24px, lineH 28.8, letterSp -0.96 */
.ab-heading {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.04em;
  color: var(--text);
  margin: 0;
}

/* Sub-heading — Figma: Inter 400, 18px, lineH 18, letterSp -0.72, opacity 0.8 */
.ab-subheading {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-82);
  margin: 0;
}

/* Section label — Figma: Inter 400, 18px, lineH 18, letterSp -0.72 */
.ab-label {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
  margin: 0;
}

/* Body text — Figma: Inter 400, 16px, lineH 20.8, letterSp -0.32, opacity 0.8 */
.ab-text {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-82);
  margin: 0;
}

/* Tag links — clickable highlights */
.ab-tag {
  display: inline;
  position: relative;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding: 2px 5px;
  background: rgba(22, 177, 247, 0.1);
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.ab-tag:hover {
  background: rgba(22, 177, 247, 0.18);
}

[data-theme="dark"] .ab-tag {
  background: rgba(22, 177, 247, 0.12);
  color: var(--text);
}

[data-theme="dark"] .ab-tag:hover {
  background: rgba(22, 177, 247, 0.22);
}

/* Divider — Figma: 960px, 1px, rgb(18,18,18) */
.ab-divider {
  width: 100%;
  height: 1px;
  background: rgba(18, 18, 18, 0.12);
}

[data-theme="dark"] .ab-divider {
  background: rgba(255, 255, 255, 0.12);
}

/* Bullet list — Figma: 16px, lineH 20.8, letterSp -0.32, opacity 0.8 */
.ab-bullets {
  list-style: disc;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ab-bullets li {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-82);
}

.ab-bullets li::marker {
  color: var(--text-32);
}

/* Entries container — Figma: vertical, gap 36px */
.ab-entries {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* Entry row — Figma: horizontal, gap 12px, center-aligned */
.ab-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  padding: 8px 10px;
  margin: -8px -10px;
  border-radius: 10px;
  transition: background-color 0.25s ease, transform 0.3s var(--ease-out);
}

a.ab-entry:hover {
  background: rgba(245, 245, 245, 1);
  transform: translateX(2px);
}

[data-theme="dark"] a.ab-entry:hover {
  background: var(--bg-secondary);
}

/* Logo — Figma: 24x24 */
.ab-entry-logo {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ab-entry-logo img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
}

.ab-entry-ph {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-50);
}

.ab-entry-icon {
  width: 24px;
  height: 24px;
  color: var(--text);
}

/* Entry info — Figma: vertical, company + role stacked */
.ab-entry-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-width: 0;
}

/* Entry name — Figma: Inter 400, 16px, lineH 20.8, letterSp -0.32, color rgb(18,18,18) */
.ab-entry-name {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Entry role — Figma: Inter 400, 16px, lineH 20.8, letterSp -0.32, opacity 0.8 */
.ab-entry-role {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-82);
}

/* Entry date — Figma: Inter 400, 16px, lineH 20.8, letterSp -0.32, opacity 0.8 */
.ab-entry-date {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-82);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

/* Mobile — Figma: pad=[12,12,80,12], gap=36, all text 14px */
@media (max-width: 768px) {
  .ab { padding: 80px 12px 24px; }
  .ab-wrap {
    padding-top: 12px;
    gap: 36px;
  }
  .ab-section {
    flex-direction: column;
    gap: 24px;
  }
  .ab-section-left {
    gap: 2px;
  }
  .ab-section-right {
    width: 100%;
  }
  .ab-heading { font-size: 20px; }
  /* Figma: section labels same as headings on mobile — 20px/500 */
  .ab-label {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
  }
  /* Figma: subheading 16px, body/bullets 14px */
  .ab-subheading { font-size: 16px; }
  .ab-text { font-size: 14px; line-height: 1.3; letter-spacing: -0.02em; }
  .ab-bullets li { font-size: 14px; line-height: 1.3; letter-spacing: -0.02em; }
  /* Figma: dividers opacity 0.06 */
  .ab-divider { background: rgba(18, 18, 18, 0.06); }
  [data-theme="dark"] .ab-divider { background: rgba(255, 255, 255, 0.06); }
  /* Figma: entries gap=12 with 1px dividers between */
  .ab-entries { gap: 0; }
  .ab-entry {
    gap: 12px;
    padding: 12px 0;
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid rgba(18, 18, 18, 0.06);
  }
  [data-theme="dark"] .ab-entry {
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }
  .ab-entry:first-child { padding-top: 0; }
  .ab-entry:last-child { border-bottom: none; padding-bottom: 0; }
  .ab-entry-role { display: none; }
  .ab-entry-name { font-size: 14px; }
  .ab-entry-date { font-size: 14px; }
  .ab-entry-logo { width: 24px; height: 24px; }
  .ab-entry-logo img { width: 24px; height: 24px; }
}

/* ─── Chat Widget (offmenu-style) ─── */

.chat-position {
  --chat-bg: #12110d;
  --chat-fg: #edecec;
  --chat-border: rgba(255, 255, 255, 0.1);
  --chat-halo: rgba(255, 255, 255, 0.1);
  --chat-fg-50: rgba(237, 236, 236, 0.5);
  --chat-fg-30: rgba(237, 236, 236, 0.3);
  --chat-fg-15: rgba(237, 236, 236, 0.15);
  --chat-ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --chat-spring-duration: 0.9s;
}

/* --- Position --- */
.chat-position {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.chat-position.chat-hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

/* --- Expandable wrapper --- */
.chat-wrapper {
  position: relative;
  z-index: 1;
  display: grid;
  overflow: hidden;
  place-items: center;
  grid-template-columns: 0fr;
  grid-template-rows: 0fr;
  visibility: hidden;
  filter: blur(4px);
  /* Opening: width first (smooth), then height (delayed, smooth) */
  transition:
    grid-template-columns 400ms cubic-bezier(0.16, 1, 0.3, 1),
    grid-template-rows 450ms cubic-bezier(0.16, 1, 0.3, 1) 120ms,
    filter 400ms cubic-bezier(0.16, 1, 0.3, 1) 80ms,
    visibility 0ms linear 0ms;
}
.chat-position.open .chat-wrapper {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  visibility: visible;
  filter: blur(0);
}
/* Closing: height folds first, then width, all gentle */
.chat-position:not(.open) .chat-wrapper {
  transition:
    grid-template-rows 350ms cubic-bezier(0.4, 0, 0.2, 1),
    grid-template-columns 350ms cubic-bezier(0.4, 0, 0.2, 1) 100ms,
    filter 300ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0ms linear 500ms;
}

/* --- Content --- */
.chat-content { overflow: hidden; }
.chat-content-inner {
  width: 384px;
  height: 520px;
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 24px;
  overflow: hidden;
}

/* --- Top bar --- */
.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 0;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.chat-topbar-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--chat-fg);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
  opacity: 0;
  transition: opacity 300ms ease;
}
.chat-position.has-messages .chat-topbar-title { opacity: 1; }

.chat-back-btn,
.chat-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--chat-border);
  cursor: pointer;
  color: var(--chat-fg-50);
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.chat-back-btn:hover,
.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--chat-fg);
}
.chat-close-btn:active,
.chat-back-btn:active { transform: scale(0.9); }
.chat-back-btn {
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease, background 0.2s ease, color 0.2s ease;
}
.chat-position.has-messages .chat-back-btn {
  opacity: 1;
  pointer-events: auto;
}

/* --- Intro --- */
.chat-intro {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 400ms ease-in-out;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.chat-position.has-messages .chat-intro { grid-template-rows: 0fr; flex: 0; }
.chat-intro-inner {
  overflow: hidden;
  position: relative;
}
.chat-intro-inner::before,
.chat-intro-inner::after {
  display: none;
}
.chat-content-inner::before {
  content: '';
  position: absolute;
  top: 80px;
  bottom: 80px;
  left: 1px;
  right: 1px;
  background:
    linear-gradient(to bottom, #121212 0%, rgba(102,102,102,0) 85%),
    linear-gradient(to top, #121212 0%, rgba(102,102,102,0) 85%),
    url('img/chat-photo.jpg') center center / cover no-repeat;
  filter: saturate(1.5);
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}
.chat-content-inner::after {
  display: none;
}
.chat-position.has-messages .chat-content-inner::before,
.chat-position.has-messages .chat-content-inner::after {
  display: none;
}
.chat-intro-text {
  padding: 24px 24px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  position: relative;
  z-index: 1;
}
.chat-intro-label {
  display: none;
}
.chat-intro-msg {
  font-size: 20px;
  font-weight: 400;
  line-height: 25px;
  letter-spacing: -0.8px;
  color: #fff;
  margin: 0;
}

/* --- Suggestions --- */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 24px 24px;
  position: relative;
  z-index: 1;
}
.chat-suggestion {
  padding: 12px 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 36px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.28px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  font-family: var(--font);
}
.chat-suggestion:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--chat-fg);
  border-color: rgba(255, 255, 255, 0.25);
}

/* --- Thread --- */
.chat-thread {
  flex: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-position.has-messages .chat-thread { flex: 1; }
.chat-thread-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--chat-fg-15);
  border-radius: 2px;
}
/* Empty state */
.chat-messages:empty { display: none; }

/* --- Messages (screenshot style: label + text) --- */
.chat-msg-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
}
.chat-msg-group + .chat-msg-group {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.chat-msg-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-msg-label-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--chat-fg);
}
.chat-msg-label-time {
  font-size: 12px;
  color: var(--chat-fg-30);
}
.chat-msg-body {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--chat-fg);
  word-break: break-word;
}
.chat-msg-body strong { font-weight: 700; }
.chat-msg-body em { font-style: italic; }
.chat-msg-body p { margin: 0 0 8px; }
.chat-msg-body p:last-child { margin-bottom: 0; }
.chat-msg-body ul, .chat-msg-body ol {
  margin: 4px 0 8px;
  padding-left: 20px;
}
.chat-msg-body li { margin-bottom: 2px; }
.chat-msg-body a {
  color: #6aafff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chat-msg-body code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}
/* Inline suggestions in bot reply */
.chat-msg-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* --- Typing dots (in messages) --- */
.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
}
.chat-typing-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--chat-fg-30);
  animation: typingDot 1.4s infinite;
}
.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ─── Trigger pill ─── */
.chat-trigger {
  position: relative;
  z-index: 1;
  border-radius: 64px;
  transition: width 300ms ease, border-radius 300ms ease;
  overflow: hidden;
}

/* --- Greeting pill (expanded state on closed widget) --- */
.chat-greeting-pill {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 16px;
  transition: max-height 500ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 400ms ease,
              padding 500ms cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-greeting-pill-text {
  font-size: 14px;
  font-weight: 400;
  color: #fff;
  letter-spacing: -0.56px;
  white-space: nowrap;
  line-height: 18px;
  height: 18px;
}
.chat-greeting-divider {
  height: 0;
  margin: 0 12px;
  background: rgba(255, 255, 255, 0.06);
  opacity: 0;
  transition: height 400ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 400ms ease,
              margin 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Greeting active state */
.chat-trigger.greeting {
  border-radius: 16px;
}
.chat-trigger.greeting .chat-greeting-pill {
  max-height: 40px;
  opacity: 1;
  padding: 14px 16px 0;
}
.chat-trigger.greeting .chat-greeting-divider {
  height: 1px;
  opacity: 1;
  margin: 12px 12px 0;
}
.chat-trigger.greeting .chat-input-row {
  border-radius: 0 0 16px 16px;
}
/* Hide greeting when chat is open */
.chat-position.open .chat-greeting-pill,
.chat-position.open .chat-greeting-divider {
  max-height: 0;
  opacity: 0;
  padding: 0 16px;
  height: 0;
  margin: 0 12px;
}
.chat-trigger-btn {
  position: absolute;
  inset: 0;
  z-index: 10;
  cursor: pointer;
  display: block;
  background: none;
  border: none;
  border-radius: inherit;
}

/* In open state, only trigger-btn for closing, not the whole pill */
.chat-position.open .chat-trigger-btn { z-index: -1; }

.chat-input-row {
  display: flex;
  flex-direction: row;
  gap: 0;
  border-radius: 64px;
  padding: 8px;
  align-items: center;
  transition: border-radius 300ms ease;
}
/* When open: stretch to full panel width */
.chat-position.open .chat-trigger {
  width: 384px;
}
.chat-position.open .chat-input-row {
  padding: 8px 12px 8px 8px;
}

/* --- Dots icon --- */
.chat-trigger-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--chat-fg);
  flex-shrink: 0;
}
.chat-dots-svg {
  transition: transform 0.6s var(--chat-ease-spring);
}
.chat-dots-outer {
  animation: dotsOrbit 12s linear infinite;
  transform-origin: 20px 20px;
}
.chat-dots-inner {
  animation: dotsPulse 3s ease-in-out infinite;
  transform-origin: 20px 20px;
}
.chat-position:hover:not(.open) .chat-dots-svg {
  transform: rotate(30deg);
}
.chat-position.thinking .chat-dots-outer {
  animation: dotsOrbitFast 1.5s linear infinite;
}
.chat-position.thinking .chat-dots-inner {
  animation: dotsPulseFast 0.6s ease-in-out infinite;
}

/* Pulse glow on idle pill */
.chat-trigger::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  box-shadow: 0 0 12px 2px rgba(255, 255, 255, 0.04);
  animation: pillPulse 3s ease-in-out infinite;
  pointer-events: none;
}
.chat-position.open .chat-trigger::after { animation: none; box-shadow: none; }

@keyframes dotsOrbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes dotsOrbitFast {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes dotsPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(0.85); opacity: 0.6; }
}
@keyframes dotsPulseFast {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(0.7); opacity: 0.4; }
}
@keyframes pillPulse {
  0%, 100% { box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.03); }
  50%      { box-shadow: 0 0 18px 4px rgba(255, 255, 255, 0.07); }
}

/* ─── Input text / textarea ─── */
.chat-input-text {
  display: grid;
  overflow: visible;
  transition: grid-template-columns 300ms ease-in-out;
  grid-template-columns: 1fr;
  flex: 1;
  min-width: 0;
}
.chat-input-text-inner {
  overflow: visible;
  display: flex;
  align-items: center;
  min-width: 0;
  position: relative;
}
.chat-input-labels {
  margin: 0 12px 0 8px;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  height: 20px;
}
.chat-label-default {
  font-size: 14px;
  color: var(--chat-fg);
  white-space: nowrap;
  transition: all 500ms ease-out;
  opacity: 1;
  filter: blur(0);
}
.chat-label-thinking {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--chat-fg-50);
  white-space: nowrap;
  transition: all 500ms ease-out;
  opacity: 0;
  filter: blur(4px);
}
.chat-position.thinking .chat-label-default { opacity: 0; filter: blur(4px); }
.chat-position.thinking .chat-label-thinking { opacity: 1; filter: blur(0); }

/* Textarea */
.chat-textarea {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  outline: none;
  background: transparent;
  color: var(--chat-fg);
  font-size: 16px;
  font-family: var(--font);
  letter-spacing: -0.64px;
  resize: none;
  overflow: hidden;
  line-height: 20px;
  height: 20px;
  border: none;
  opacity: 0;
  filter: blur(4px);
  pointer-events: none;
  position: absolute;
  inset: 0;
  transition: opacity 400ms ease-in-out, filter 400ms ease-in-out;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  scrollbar-width: none;
}
.chat-textarea::-webkit-scrollbar { width: 3px; }
.chat-textarea::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 3px; }
.chat-textarea::-webkit-scrollbar-track { background: transparent; }
.chat-textarea::-webkit-inner-spin-button,
.chat-textarea::-webkit-outer-spin-button,
.chat-textarea::-webkit-search-decoration,
.chat-textarea::-webkit-search-cancel-button,
.chat-textarea::-webkit-resizer { display: none; }
.chat-textarea::placeholder { color: rgba(255, 255, 255, 0.6); }
.chat-content-inner ::selection,
.chat-position ::selection {
  background: rgba(22, 177, 247, 0.35);
  color: #e8e8e8;
}

.chat-position.open .chat-textarea {
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
  position: absolute;
  inset: auto 0 0 0;
  height: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
}
/* When thinking: hide textarea, show "Думаю..." instead */
.chat-position.open.thinking .chat-textarea {
  opacity: 0;
  filter: blur(4px);
  pointer-events: none;
  position: absolute;
}
.chat-position.open.thinking .chat-label-thinking {
  position: relative;
}
.chat-position.open .chat-label-default {
  opacity: 0;
  filter: blur(4px);
  position: absolute;
  pointer-events: none;
}

/* ─── Background morph ─── */
.chat-bg {
  z-index: 0;
  pointer-events: none;
  position: absolute;
  border-radius: 40px;
  background: var(--chat-bg);
  box-shadow:
    0 0 0 1px inset var(--chat-border),
    0 0 12px 0 inset var(--chat-halo);
  inset: 0;
  transition:
    inset 0.5s var(--chat-ease-spring),
    margin 0.5s var(--chat-ease-spring),
    border-radius 250ms cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 0.5s var(--chat-ease-spring);
}
.chat-trigger.greeting ~ .chat-bg { border-radius: 16px; }
.chat-position:hover:not(.open) .chat-bg { margin: -1px; }
.chat-position.open .chat-bg { border-radius: 24px; margin: 0; }

/* Limit */
.chat-limit-msg {
  text-align: center;
  font-size: 12px;
  color: var(--chat-fg-30);
  padding: 8px;
}

/* Mobile chat — merged into 768px below */
/* ─── 1280px ─── */
@media (max-width: 1280px) {
  .page { padding: 100px 24px 36px; }
  .lifestyle-photo-grid { grid-template-columns: repeat(3, 1fr); }
  .archive-grid { grid-template-columns: repeat(3, 1fr); } /* same as default, keep for clarity */
}

/* ─── 768px (Tablet) ─── */
@media (max-width: 768px) {
  /* Header — Figma: page pad=12, header h=40, gap=space-between */
  .site-header { padding: 12px; }
  .site-header.scrolled { padding: 12px; }
  .header-inner { padding: 0; }

  /* Hide desktop nav, show mobile grid-dots + Написать */
  .nav-pill { display: none; }
  .btn-container .nav-btn--secondary { display: none; }
  .mobile-menu-btn { display: flex; order: -1; }
  .btn-container { width: 100%; gap: 8px; }
  .btn-container .nav-btn--primary { margin-left: auto; padding: 0 12px; height: 40px; }
  /* Remove border from theme toggle on mobile — Figma shows no border */
  .theme-toggle { border: none; background: #EEEEEE; }
  [data-theme="dark"] .theme-toggle { background: var(--bg-tertiary); }

  /* Page — more top padding so avatar doesn't touch header */
  .page { padding: 80px 12px 24px; }
  .content { gap: 48px; }

  /* Hero — Figma: avatar 100px, Txt gap=8, margin accounts for 6px box-shadow ring */
  .avatar-wrap { width: 100px; height: 100px; margin: 6px; }
  .hero-txt { gap: 8px; padding-top: 0; }
  /* Name — Figma: 24px/500, lh=28.8, ls=-0.96px, color=text-82 */
  .hero-name { font-size: 24px; line-height: 1.2; letter-spacing: -0.96px; color: var(--text-82); }
  /* Desc — Figma: 18px/400, lh=23.4, ls=-0.36, color=text-32 */
  .hero-desc { font-size: 18px; line-height: 23.4px; letter-spacing: -0.36px; color: var(--text-32); }

  /* Filter tabs — Figma: 32px from text above, 24px to cards below, no separator */
  .hero { gap: 0; }
  .filter-container { padding-top: 24px; padding-bottom: 24px; }
  .filter-container::before { display: none; }
  .filter-pill { gap: 4px; padding: 4px; border: 1px solid var(--border); }
  .filter-tab { font-size: 16px; padding: 8px; height: 36px; gap: 6px; letter-spacing: -0.32px; }

  /* Card — Figma: r=28, pad=8, gap=4, bg=#FAFAFA, border=#EFEFEF */
  .card { padding: 8px; border-radius: 28px; }
  .card-inner { flex-direction: column; gap: 4px; }
  /* Image — Figma: h=240, r=24 */
  .card-left { width: 100%; height: 240px; border-radius: 24px; }
  /* Content — Figma: pad=8, gap=16 */
  .card-right { padding: 8px; gap: 16px; }
  .card-top { gap: 12px; }
  .card-tags { display: none; }
  .card-meta-row { display: none; }
  .card-num { display: none; }
  .card-badges-mobile { display: flex; flex-shrink: 0; }
  /* Logo — icon 36x36, name tight to icon, gap 8px */
  .card-logo { min-width: 0; flex-shrink: 1; gap: 8px; }
  .card-logo img, .card-logo-icon { width: 36px; height: 36px; border-radius: 12px; }
  .card-logo-icon svg { width: 18px; height: 18px; }
  .card-logo-name { font-size: 16px; letter-spacing: -0.32px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card-header-row { flex-wrap: nowrap; }
  /* Description — Figma: 14px/400, ls=-0.56, color=text */
  .card-desc { font-size: 14px; line-height: 1.21; letter-spacing: -0.56px; color: var(--text); }
  /* CTA — Figma: h=43, r=64, pad=12, gap=8, font=16/500 */
  .card-cta {
    height: 43px;
    border-radius: var(--radius-pill);
    padding: 0 12px;
    font-size: 16px;
  }
  .card-cta svg { color: #fff; }

  /* Archive — Figma: single col, card r=24, pad=[8,8,8,12], gap=12, bg=#F6F4F4, border=#EFEFEF */
  .archive-grid { grid-template-columns: 1fr; gap: 16px; }
  .archive-card { border-radius: 24px; padding: 8px 8px 12px; gap: 12px; background: var(--bg-tertiary); }
  /* Image — Figma: r=20, h=240 */
  .archive-card-img { border-radius: 20px; }
  .archive-card-img img { aspect-ratio: 4/3; }
  /* Body — Figma: pad=[6,0,6,0] horizontal */
  .archive-card-body { padding: 0 6px; gap: 8px; }
  /* Title — Figma: 16px/500 */
  .archive-card-title { font-size: 16px; }
  /* Year — Figma: 14px/400 */
  .archive-card-year { font-size: 14px; }
  /* Tags — Figma: 14px/400, r=32, pad=[8,6] */
  .archive-card-tag { font-size: 14px; padding: 6px 8px; border-radius: 32px; }
  /* Stats — Figma: 14px/400, icons 18px */
  .archive-card-stats { display: flex; }
  .archive-stat { font-size: 14px; }
  .archive-stat svg { width: 18px; height: 18px; }

  /* Lifestyle — Figma: 2 cols, gap=8, card r=20 pad=4 bg=#F6F4F4, image r=16 */
  .lifestyle-photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .lifestyle-photo-grid .photo-card {
    border-radius: 20px;
    padding: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
  }
  .lifestyle-photo-grid .photo-card img { border-radius: 16px; box-shadow: none; }

  /* Case page */
  .case-page { padding: 80px 12px 40px; gap: 12px; }
  .case-card { border-radius: 24px; padding: 6px; }
  .case-card-inner { padding: 28px 24px; }
  .case-card-inner .case-image { margin-left: -24px; margin-right: -24px; width: calc(100% + 48px); border-radius: 18px; }

  .case-hero { padding: 16px 24px 4px; }
  .case-hero h1 { font-size: 28px; }
  .case-hero-hook { display: none; }
  .case-hero { padding-top: 0; }
  .case-hero-image { border-radius: 18px; }
  .case-meta-pills { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .case-meta-pills::-webkit-scrollbar { display: none; }
  .case-scope-pill { height: 36px; padding: 0 14px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
  .case-scope-pill .pill-label { display: none; }
  .case-results-grid--top { margin: 0 !important; width: 100% !important; }
  .case-section h2 { font-size: 26px; }
  .case-results-grid { grid-template-columns: repeat(2, 1fr); margin-left: -24px; margin-right: -24px; width: calc(100% + 48px); }
  .case-results-grid--top { margin: 0 !important; width: 100% !important; }
  .case-result-card { min-height: 140px; padding: 20px; }
  .case-card-inner .case-image:last-child { margin-bottom: -28px; }
  .case-accordion-header { padding: 20px 22px; }
  .case-accordion-content { padding: 4px 22px 22px; }
  .case-bottom-nav {
    left: auto;
    right: 12px;
    bottom: 12px;
    transform: none;
    flex-direction: column;
    border-radius: 14px;
    padding: 5px;
    gap: 3px;
  }
  .case-bottom-nav a { padding: 8px 10px; font-size: 13px; justify-content: center; }
  .case-bottom-nav a .nav-text { display: none; }
  .case-bottom-nav a.nav-icon-btn { padding: 8px 10px; }
  .case-bottom-nav .nav-desktop-only { display: none; }
  .case-bottom-nav .nav-mobile-only { display: inline-flex; }

  /* About */
  .about-page { padding: 64px 12px 40px; }
  .about-name { font-size: 26px; }
  .timeline-item { flex-direction: column; gap: 4px; }
  .timeline-period { width: auto; }

  /* Chat — 12px from left+bottom always; open expands rightward to 8px from right edge */
  .chat-position { left: 12px; right: auto; bottom: 12px; }
  .chat-position.open .chat-trigger { width: calc(100vw - 20px); }
  .chat-content-inner { width: calc(100vw - 20px); height: 62dvh; }
  .chat-intro-msg { font-size: 18px; line-height: 23px; }
  .chat-intro-text { padding: 16px 16px 0; }
  .chat-suggestions { padding: 16px 16px 16px; }
  .chat-suggestion { height: 36px; padding: 0 12px; display: flex; align-items: center; }

  /* Stories — see css/stories.css */
}

/* ─── 480px (Phone) ─── */
@media (max-width: 480px) {
  /* Same as 768px base from Figma — already set, just minor overrides */

  /* Case page */
  .case-page { padding: 80px 8px 32px; }
  .case-card { border-radius: 20px; padding: 4px; }
  .case-card-inner { padding: 24px 16px; }
  .case-card-inner .case-image { margin-left: -16px; margin-right: -16px; width: calc(100% + 32px); border-radius: 16px; }
  .case-hero { padding: 12px 16px 4px; }
  .case-hero h1 { font-size: 24px; }
  .case-hero-subtitle { font-size: 15px; }
  .case-hero-image { border-radius: 16px; }
  .case-section h2 { font-size: 22px; }
  .case-section h3 { font-size: 18px; }
  .case-section p { font-size: 15px; line-height: 20px; }
  .case-result-card { min-height: 120px; padding: 16px; }
  .case-result-title { font-size: 15px; }
  .case-result-desc { font-size: 13px; }
  .case-results-grid { grid-template-columns: 1fr; margin-left: -16px; margin-right: -16px; width: calc(100% + 32px); }
  .case-results-grid--top { margin: 0 !important; width: 100% !important; }
  .case-card-inner .case-image:last-child { margin-bottom: -24px; }
  .case-quote { padding: 20px; border-radius: 16px; }
  .case-accordion { border-radius: 16px; }
  .case-accordion-header { padding: 16px; }
  .case-accordion-title { font-size: 15px; }
  .case-accordion-desc { font-size: 14px; }
  .case-accordion-content { padding: 4px 16px 16px; }
  .case-accordion-content p { font-size: 14px; }
  .case-accordion-content h3 { font-size: 16px; }
  .case-tldr .case-card-inner { padding: 24px 16px; }

  /* Slider mobile */
  .case-slider-prev, .case-slider-next { width: 32px; height: 32px; opacity: 1; }
  .case-slider-prev { left: 8px; }
  .case-slider-next { right: 8px; }
  .case-slider-prev svg, .case-slider-next svg { width: 14px; height: 14px; }

  /* About */
  .about-name { font-size: 22px; }
  .about-role { font-size: 16px; }
  .about-narrative p { font-size: 15px; }
}

/* ─── Landscape on phone ─── */
@media (max-height: 500px) and (orientation: landscape) {
  .chat-popup { max-height: 100vh; }
  .chat-content-inner { height: 50vh; }
  .chat-fab { bottom: 8px; right: 8px; width: 44px; height: 44px; }
  .lightbox-viewer {
    max-height: calc(100vh - 16px);
  }
  .lightbox-img {
    max-height: calc(100vh - 16px);
  }
  .lightbox-counter { top: 8px; }
  .lightbox-close { top: 8px; right: 8px; }
}
