/* ============================================================================
   Portfolio — site styles. Built on Lucha (shadcn neutral) tokens.
   Pairs with styles/tokens.css + styles/components.css.
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; }
:focus-visible { outline: none; }
::selection { background: var(--selection); color: var(--selection-foreground); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---- Layout primitives ---------------------------------------------------- */
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 28px; }
.wrap-tight { max-width: 760px; }
.section { padding-block: clamp(64px, 11vw, 140px); }
.section-sm { padding-block: clamp(48px, 8vw, 96px); }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* eyebrow / section label */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted-foreground);
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: currentColor; opacity: .5;
}
.eyebrow.no-rule::before { display: none; }

.section-head { display: flex; flex-direction: column; gap: 18px; max-width: 720px; }
.section-head h2 { margin: 0; }
.section-head .lead { margin: 0; }

/* ---- Header / nav --------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--background) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s;
}
.site-header[data-stuck="true"] { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: var(--weight-semibold); letter-spacing: -.01em; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; }
.brand .mark img { width: 100%; height: 100%; }
.dark .brand .mark img { filter: invert(1); }
.brand .who { display: flex; flex-direction: column; line-height: 1.05; }
.brand .who small { font-family: var(--font-mono); font-size: 11px; color: var(--muted-foreground); font-weight: 400; letter-spacing: .02em; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative; padding: 8px 12px; border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--muted-foreground); transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--foreground); background: var(--accent); }
.nav-link[aria-current="page"] { color: var(--foreground); }
.nav-actions { display: flex; align-items: center; gap: 8px; }

/* theme toggle — animated sun↔moon morph */
.theme-toggle {
  width: 36px; height: 36px; display: inline-grid; place-content: center;
  border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--background); color: var(--foreground); cursor: pointer;
  box-shadow: var(--shadow-xs); transition: background .15s, color .15s, transform .2s cubic-bezier(.34,1.56,.64,1);
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { background: var(--accent); transform: scale(1.08); }
.theme-toggle:active { transform: scale(.88); }
.theme-toggle .att-svg { width: 18px; height: 18px; overflow: visible; transition: transform .5s cubic-bezier(.34,1.56,.64,1); }
.dark .theme-toggle .att-svg { transform: rotate(270deg); }
/* center body: small sun → large moon */
.theme-toggle .att-body { transition: r .5s cubic-bezier(.34,1.56,.64,1); }
.dark .theme-toggle .att-body { r: 9px; }
/* mask cutter: parked off-canvas → carves crescent */
.theme-toggle .att-cut { transition: cx .5s cubic-bezier(.34,1.56,.64,1), cy .5s cubic-bezier(.34,1.56,.64,1); }
.dark .theme-toggle .att-cut { cx: 17px; cy: 8px; }
/* rays: visible sun → shrink + rotate away */
.theme-toggle .att-rays { transform-origin: 12px 12px; transition: opacity .35s ease, transform .5s cubic-bezier(.34,1.56,.64,1); }
.dark .theme-toggle .att-rays { opacity: 0; transform: scale(0) rotate(-30deg); }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle, .theme-toggle .att-svg, .theme-toggle .att-body,
  .theme-toggle .att-cut, .theme-toggle .att-rays { transition-duration: .01ms; }
}

/* language switcher (segmented) */
.lang-switch {
  display: inline-flex; align-items: center; height: 36px; padding: 3px;
  gap: 2px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--background); box-shadow: var(--shadow-xs);
}
.lang-switch button {
  appearance: none; border: 0; cursor: pointer; padding: 0 8px; height: 28px;
  min-width: 30px; border-radius: calc(var(--radius-md) - 3px);
  font-family: var(--font-mono); font-size: 11px; font-weight: var(--weight-medium);
  letter-spacing: .04em; text-transform: uppercase; line-height: 1;
  color: var(--muted-foreground); background: transparent;
  transition: background .15s, color .15s;
}
.lang-switch button:hover { color: var(--foreground); }
.lang-switch button[aria-pressed="true"] {
  color: var(--primary-foreground); background: var(--primary);
}

/* mobile nav */
.nav-burger { display: none; }
.mobile-menu { display: none; }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-burger {
    display: inline-grid; place-content: center; width: 36px; height: 36px;
    border-radius: var(--radius-md); border: 1px solid var(--border);
    background: var(--background); color: var(--foreground); cursor: pointer;
  }
  .nav-burger svg { width: 18px; height: 18px; }
  .mobile-menu {
    display: none; flex-direction: column; gap: 2px; padding: 8px 0 14px;
    border-top: 1px solid var(--border);
  }
  .mobile-menu.open { display: flex; }
  .mobile-menu .nav-link { padding: 12px; font-size: var(--text-base); }
  .nav-actions > .btn-sm { display: none; }
  .lang-switch button { min-width: 26px; padding: 0 6px; }
}

/* ---- Buttons (extend DS) -------------------------------------------------- */
.btn-arrow svg { transition: transform .2s ease; }
.btn-arrow:hover svg { transform: translateX(3px); }

/* ---- Hero w/ grid motion -------------------------------------------------- */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--surface); }
.hero-grid {
  position: absolute; inset: -10% -6% -10% -6%; z-index: -2;
  display: flex; flex-direction: column; gap: 18px;
  transform: rotate(-8deg) scale(1.18); transform-origin: center;
  opacity: .9; pointer-events: none;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 42%, #000 18%, transparent 72%);
  mask-image: radial-gradient(120% 90% at 50% 42%, #000 18%, transparent 72%);
}
.hero-row { display: flex; gap: 18px; flex: none; will-change: transform; }
.hero-row > * { flex: none; }
.mini {
  width: 230px; height: 150px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--card);
  box-shadow: var(--shadow-sm); overflow: hidden; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.mini .bar { height: 8px; border-radius: 999px; background: var(--muted); }
.mini .bar.w1 { width: 62%; } .mini .bar.w2 { width: 90%; } .mini .bar.w3 { width: 40%; }
.mini .chip { height: 22px; width: 56px; border-radius: 999px; background: var(--secondary); }
.mini .blk { flex: 1; border-radius: var(--radius-md); background: linear-gradient(135deg, var(--muted), var(--secondary)); }
.mini .row { display: flex; gap: 8px; align-items: center; }
.mini .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--muted); flex: none; }
.mini.dark-tile { background: var(--surface); border-color: var(--border); }
.mini.dark-tile .bar, .mini.dark-tile .dot { background: var(--muted); }
.mini.ink { background: var(--card); }
.mini.ink .bar { background: var(--muted); }
.mini.ink .blk { background: linear-gradient(135deg, var(--muted), var(--secondary)); }

.hero-inner { position: relative; z-index: 1; padding-block: clamp(120px, 20vw, 220px) clamp(80px, 12vw, 140px); }
.hero h1 {
  font-size: clamp(2.6rem, 7.2vw, 5.2rem); line-height: 1.02; letter-spacing: -.035em;
  margin: 22px 0 0; max-width: 16ch; text-wrap: balance;
}
.hero h1 .ghost { color: var(--muted-foreground); }
.hero .lead { margin: 26px 0 0; max-width: 52ch; font-size: clamp(1rem, 1.6vw, 1.25rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 26px 40px; margin-top: 56px; align-items: flex-end; }
.hero-stat .n { font-family: var(--font-mono); font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: var(--weight-medium); letter-spacing: -.02em; line-height: 1; }
.hero-stat .k { display: block; margin-top: 8px; font-size: var(--text-xs); color: var(--muted-foreground); max-width: 16ch; }
.hero-avail { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--muted-foreground); }
.hero-avail .pulse { width: 8px; height: 8px; border-radius: 50%; background: oklch(0.62 0.17 150); box-shadow: 0 0 0 0 oklch(0.62 0.17 150 / .5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 oklch(0.62 0.17 150 / .5)} 70%{box-shadow:0 0 0 9px oklch(0.62 0.17 150 / 0)} 100%{box-shadow:0 0 0 0 oklch(0.62 0.17 150 / 0)} }

/* marquee of tools */
.marquee { border-block: 1px solid var(--border); overflow: hidden; padding-block: 20px; background: var(--surface); }
.marquee-track { display: flex; gap: 56px; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted-foreground); white-space: nowrap; letter-spacing: .01em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---- Project cards (Mobbin-ish grid) -------------------------------------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
@media (max-width: 820px) { .work-grid { grid-template-columns: 1fr; } }
.work-card {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--card); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.work-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: color-mix(in oklab, var(--foreground) 18%, var(--border)); }
.work-shot { position: relative; aspect-ratio: 16/10; background: var(--surface); border-bottom: 1px solid var(--border); overflow: hidden; }
.work-shot image-slot { width: 100%; height: 100%; }
.work-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-img-contain { object-fit: contain; background: var(--surface); padding: 8px; }
.video-toggle {
  position: absolute; left: 32px; bottom: 32px; z-index: 2;
  width: 44px; height: 44px; display: grid; place-items: center;
  padding: 0; border-radius: 999px; cursor: pointer;
  color: var(--foreground);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 78%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.08));
  transition: background .15s ease, opacity .15s ease;
}
.video-toggle:hover { background: var(--background); }
.video-toggle svg { width: 18px; height: 18px; }
.video-toggle .ic-play { display: none; }
.video-toggle.is-paused .ic-pause { display: none; }
.video-toggle.is-paused .ic-play { display: block; }
.work-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; }
.work-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.work-title { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: -.015em; }
.work-year { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted-foreground); }
.work-desc { color: var(--muted-foreground); font-size: var(--text-sm); margin: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* window mockup (daisyUI style) */
.mock-window { border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; background: var(--card); box-shadow: var(--shadow-md); }
.mock-bar { height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.mock-bar .tl { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.mock-bar .url { margin-left: 12px; flex: 1; height: 20px; border-radius: 999px; background: var(--muted); max-width: 320px; display: flex; align-items: center; padding: 0 12px; font-family: var(--font-mono); font-size: 11px; color: var(--muted-foreground); }
.mock-view { aspect-ratio: 16/9; background: var(--surface); }
.mock-view image-slot { width: 100%; height: 100%; }
.video-cover { aspect-ratio: 16/8; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); background: #000; }
.shot-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: end; }
.shot-row img { width: 100%; display: block; border-radius: var(--radius-lg); }
.proto-screens { display: flex; justify-content: center; align-items: center; gap: clamp(18px, 4vw, 52px); height: 100%; padding: clamp(20px, 4vw, 44px); background: var(--surface); }
.proto-screens img { height: 100%; width: auto; max-width: 30%; object-fit: contain; border-radius: 14px; box-shadow: var(--shadow-sm); }
@media (max-width: 720px) { .shot-row { grid-template-columns: repeat(2, 1fr); } }

/* ---- Skills / stack ------------------------------------------------------- */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .skills-grid { grid-template-columns: 1fr; } }
.skill-card { padding: 26px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); display: flex; flex-direction: column; gap: 14px; transition: border-color .2s; }
.skill-card:hover { border-color: color-mix(in oklab, var(--foreground) 20%, var(--border)); }
.skill-ic { width: 38px; height: 38px; border-radius: var(--radius-md); border: 1px solid var(--border); display: grid; place-content: center; background: var(--surface); }
.skill-ic svg, .skill-ic i { width: 18px; height: 18px; color: var(--foreground); }
.skill-card h4 { margin: 0; }
.skill-card p { margin: 0; color: var(--muted-foreground); }
.skill-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- CTA band ------------------------------------------------------------- */
.cta-band { background: var(--surface); color: var(--foreground); border: 1px solid var(--border); border-radius: var(--radius-2xl); padding: clamp(40px, 7vw, 80px); position: relative; overflow: hidden; }
.cta-band h2 { margin: 0; color: var(--foreground); font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.03em; max-width: 18ch; }
.cta-band .lead { color: var(--muted-foreground); }

/* ---- Footer --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding-block: 60px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }
.footer-col h5 { margin: 0 0 14px; font-size: var(--text-xs); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground); font-weight: var(--weight-medium); }
.footer-col a { display: block; padding: 5px 0; color: var(--muted-foreground); font-size: var(--text-sm); transition: color .15s; width: fit-content; }
.footer-col a:hover { color: var(--foreground); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.footer-bottom small { color: var(--muted-foreground); }

/* ---- About page ----------------------------------------------------------- */
.about-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
@media (max-width: 820px) { .about-hero { grid-template-columns: 1fr; } }
.about-portrait { aspect-ratio: 4/5; border-radius: var(--radius-2xl); overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-md); }
.about-portrait image-slot { width: 100%; height: 100%; }
.prose { max-width: 64ch; }
.prose p { font-size: var(--text-base); line-height: 1.7; color: color-mix(in oklab, var(--foreground) 84%, transparent); }
.prose p + p { margin-top: 1.1em; }

/* timeline */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 140px 1fr; gap: 28px; padding: 26px 0; border-top: 1px solid var(--border); }
.tl-item:last-child { border-bottom: 1px solid var(--border); }
@media (max-width: 640px) { .tl-item { grid-template-columns: 1fr; gap: 8px; } }
.tl-when { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted-foreground); }
.tl-role { font-weight: var(--weight-semibold); font-size: var(--text-lg); letter-spacing: -.01em; }
.tl-org { color: var(--muted-foreground); }
.tl-body { display: flex; flex-direction: column; gap: 6px; }
.tl-body p { margin: 6px 0 0; color: var(--muted-foreground); }

/* ---- Contact -------------------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 18px; }
.field textarea.input { height: auto; min-height: 130px; padding: 10px 12px; resize: vertical; line-height: 1.5; font-family: var(--font-sans); }
.contact-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.contact-list a { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--border); transition: color .15s; }
.contact-list li:last-child a { border-bottom: 1px solid var(--border); }
.contact-list a:hover { color: var(--foreground); }
.contact-list .ic { width: 38px; height: 38px; border-radius: var(--radius-md); border: 1px solid var(--border); display: grid; place-content: center; background: var(--card); flex: none; }
.contact-list .ic svg, .contact-list .ic i { width: 17px; height: 17px; }
.contact-list .ct { display: flex; flex-direction: column; gap: 2px; }
.contact-list .ct b { font-weight: var(--weight-medium); }
.contact-list .ct span { font-size: var(--text-xs); color: var(--muted-foreground); font-family: var(--font-mono); }

/* ---- Page hero (interior pages) ------------------------------------------ */
.page-hero { padding-block: clamp(72px, 12vw, 130px) clamp(40px, 6vw, 64px); }
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -.035em; line-height: 1.03; margin: 18px 0 0; max-width: 18ch; text-wrap: balance; }
.page-hero .lead { margin: 22px 0 0; max-width: 56ch; }

/* ---- Filter pills --------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  height: 34px; padding: 0 14px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--background);
  font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--muted-foreground);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.filter:hover { color: var(--foreground); }
.filter[aria-pressed="true"] { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }

/* ---- Scroll reveal -------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .07s; }
.reveal[data-d="2"] { transition-delay: .14s; }
.reveal[data-d="3"] { transition-delay: .21s; }
.reveal[data-d="4"] { transition-delay: .28s; }
.reveal-img { transform: translateY(32px) scale(1.04); transition-duration: 1s, 1s; }
.reveal-img.in { transform: none; }
.case-body.reveal .case-list li { opacity: 0; transform: translateY(14px); transition: opacity .5s cubic-bezier(.16,1,.3,1), transform .5s cubic-bezier(.16,1,.3,1); }
.case-body.reveal.in .case-list li { opacity: 1; transform: none; }
.case-body.reveal.in .case-list li:nth-child(1) { transition-delay: .05s; }
.case-body.reveal.in .case-list li:nth-child(2) { transition-delay: .12s; }
.case-body.reveal.in .case-list li:nth-child(3) { transition-delay: .19s; }
.case-body.reveal.in .case-list li:nth-child(4) { transition-delay: .26s; }
.case-body.reveal.in .case-list li:nth-child(5) { transition-delay: .33s; }

/* ---- Case hero entrance (page-load reveal, inspired by ivancarlos.work) --- */
.case-hero .case-back, .case-hero h1, .case-hero .case-tags, .case-hero .case-facts {
  opacity: 0; animation: case-in .8s cubic-bezier(.16,1,.3,1) forwards;
}
.case-hero .case-back { animation-delay: .05s; }
.case-hero h1 { animation-delay: .14s; }
.case-hero .case-tags { animation-delay: .26s; }
.case-hero .case-facts { animation-delay: .38s; }
@keyframes case-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .case-hero .case-back, .case-hero h1, .case-hero .case-tags, .case-hero .case-facts { animation: none; opacity: 1; }
}

/* big editorial number */
.big-num { font-family: var(--font-mono); font-weight: var(--weight-medium); font-size: clamp(3rem, 9vw, 7rem); letter-spacing: -.04em; line-height: .9; }

/* ---- Approach / numbered steps ------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 30px 26px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; min-height: 200px; }
.step:last-child { border-right: 0; }
.step .sn { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted-foreground); }
.step h4 { margin: 0; }
.step p { margin: 0; color: var(--muted-foreground); font-size: var(--text-sm); }
@media (max-width: 860px) {
  .step:nth-child(2) { border-right: 0; }
  .step:nth-child(1), .step:nth-child(2) { border-bottom: 1px solid var(--border); }
}

/* ============================================================================
   Case study page
   ============================================================================ */
.case-hero { padding-block: clamp(64px, 11vw, 120px) clamp(32px, 5vw, 56px); }
.case-back { display: flex; width: fit-content; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--muted-foreground); margin-bottom: 28px; transition: color .15s; }
.case-back:hover { color: var(--foreground); }
.case-back svg { width: 15px; height: 15px; }
.case-hero h1 { font-size: clamp(2.2rem, 5.6vw, 4rem); letter-spacing: -.035em; line-height: 1.04; margin: 18px 0 0; max-width: 18ch; text-wrap: balance; }
.case-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.case-facts { display: flex; flex-wrap: wrap; gap: 28px 56px; margin-top: 44px; padding-top: 36px; border-top: 1px solid var(--border); }
.case-fact { display: flex; flex-direction: column; gap: 6px; }
.case-fact .k { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground); }
.case-fact .v { font-size: var(--text-base); font-weight: var(--weight-medium); }

/* numbered section block */
.case-block { padding-block: clamp(48px, 8vw, 96px); }
.case-grid { display: grid; grid-template-columns: 200px 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 760px) { .case-grid { grid-template-columns: 1fr; gap: 20px; } }
.case-num { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 96px; }
.case-num .nn { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted-foreground); }
.case-num h2 { margin: 0; font-size: var(--text-2xl); }
@media (max-width: 760px) { .case-num { position: static; } }
.case-body > p { font-size: var(--text-lg); line-height: 1.7; color: color-mix(in oklab, var(--foreground) 86%, transparent); max-width: 60ch; margin: 0; }
.case-body > p + p { margin-top: 1em; }

/* strategy / impact list */
.case-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 0; border-top: 1px solid var(--border); }
.case-list li { display: flex; gap: 16px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--border); font-size: var(--text-base); }
.case-list li .ck { color: var(--foreground); flex: none; margin-top: 1px; }
.case-list li .ck svg { width: 18px; height: 18px; }

/* solution steps (vertical, numbered) */
.flow { display: grid; gap: 16px; margin-top: 12px; }
.flow-step { display: grid; grid-template-columns: 44px 1fr; gap: 18px; align-items: start; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); transition: border-color .2s, box-shadow .2s; }
.flow-step:hover { border-color: color-mix(in oklab, var(--foreground) 20%, var(--border)); box-shadow: var(--shadow-sm); }
.flow-step .fn { width: 44px; height: 44px; border-radius: var(--radius-lg); background: var(--primary); color: var(--primary-foreground); display: grid; place-content: center; font-family: var(--font-mono); font-size: var(--text-lg); font-weight: var(--weight-medium); }
.flow-step h4 { margin: 0 0 4px; }
.flow-step p { margin: 0; color: var(--muted-foreground); font-size: var(--text-sm); }

/* phone / chat mockup */
.phone { width: 300px; max-width: 100%; margin-inline: auto; border-radius: 38px; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow-xl); padding: 12px; }
.phone-screen { border-radius: 28px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.phone-top { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--card); }
.phone-top .av { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); display: grid; place-content: center; color: var(--primary-foreground); }
.phone-top .av svg { width: 16px; height: 16px; }
.phone-top .nm { font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: 1.1; }
.phone-top .nm small { display: block; font-size: 11px; color: oklch(0.62 0.17 150); font-family: var(--font-mono); }
.phone-chat { padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; min-height: 340px; }
.bubble { max-width: 84%; padding: 12px 14px; font-size: var(--text-sm); line-height: 1.5; border-radius: 18px; }
.bubble.bot { background: var(--secondary); color: var(--secondary-foreground); border-bottom-left-radius: 6px; align-self: flex-start; }
.bubble.me { background: var(--primary); color: var(--primary-foreground); border-bottom-right-radius: 6px; align-self: flex-end; }
.bubble .amt { font-weight: var(--weight-semibold); }
.chip-cta { align-self: flex-start; display: inline-flex; gap: 8px; margin-top: 2px; }
.chip-cta .b { padding: 8px 14px; border-radius: var(--radius-full); border: 1px solid var(--border); font-size: var(--text-xs); font-weight: var(--weight-medium); background: var(--background); }

/* role grid */
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 8px; }
@media (max-width: 760px) { .role-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .role-grid { grid-template-columns: 1fr; } }
.role-card { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); display: flex; flex-direction: column; gap: 8px; }
.role-card .rt { font-weight: var(--weight-semibold); font-size: var(--text-lg); letter-spacing: -.01em; }
.role-card p { margin: 0; color: var(--muted-foreground); font-size: var(--text-sm); }

/* metrics band */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; }
@media (max-width: 640px) { .metrics { grid-template-columns: 1fr; } }
.metric { padding: 34px 28px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.metric:last-child { border-right: 0; }
@media (max-width: 640px) { .metric { border-right: 0; border-bottom: 1px solid var(--border); } .metric:last-child { border-bottom: 0; } }
.metric .mn { font-family: var(--font-mono); font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: var(--weight-medium); letter-spacing: -.03em; line-height: 1; }
.metric .mk { font-size: var(--text-sm); color: var(--muted-foreground); }

/* pull quote */
.pull { border-left: 3px solid var(--foreground); padding: 4px 0 4px 28px; margin: 0; }
.pull p { font-family: var(--font-heading); font-size: clamp(1.4rem, 3.2vw, 2.1rem); font-weight: var(--weight-medium); letter-spacing: -.02em; line-height: 1.3; margin: 0; text-wrap: pretty; }
.pull p em { font-style: normal; background: linear-gradient(transparent 62%, color-mix(in oklab, var(--foreground) 16%, transparent) 0); }
.pull footer { margin-top: 18px; color: var(--muted-foreground); font-size: var(--text-sm); }
