/* ── Bê Santos Portfolio v2 — Coffee theme (redesign) ───
   Cream palette, SVG side-nav, one-page, collapsible Work.
   Shares /assets with v1.
   NOTE: the .case-* / .embed-* / .work accordion rules style the LOCKED
   case-study panels — keep them as-is. */

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

:root {
  --cream:  #FFF8F1;   /* background */
  --ink:    #27182E;   /* work project names */
  --blue:   #0157DA;   /* most text, links, nav */
  --hero:   #0160F0;   /* hero band */
  --coffee: #FF846A;   /* coffee-break + footer */

  --bg: var(--cream);
  --fg: var(--ink);

  --font-primary: 'Space Grotesk', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --sidebar: 232px;     /* left nav lane reserved in the content */
  --frame: 1560px;      /* max width of the nav + content group */
  --gutter: 4rem;
}

html { scroll-behavior: smooth; overflow-x: hidden; }   /* contain any edge bleed so the page never scrolls sideways (and the fixed burger stays put) */

body {
  font-family: var(--font-primary);
  background: var(--bg);
  color: var(--fg);
  cursor: none;
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; text-decoration: none; }

/* Screen-reader-only — lets the hero carry a keyword-rich <h1> for SEO/a11y
   without changing the visual design. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Paper-grain texture */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 9990;
  pointer-events: none; opacity: 0.05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Reactive cursor + coffee-ring trail ──────────────── */
#cursor {
  position: fixed; top: 0; left: 0; z-index: 9999;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--coffee);
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  transition: width .25s ease, height .25s ease, background .2s ease, border-color .2s ease;
}
/* over interactive elements the dot opens into a ring + label */
#cursor.is-active {
  width: 60px; height: 60px;
  background: transparent;
  border: 1.5px solid var(--coffee);
}
.cursor-label {
  font-family: var(--font-mono); font-size: 9px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--coffee); white-space: nowrap;
  opacity: 0; transition: opacity .2s ease;
}
#cursor.is-active .cursor-label { opacity: 1; }

/* over a coffee recipe the cursor becomes a photo of the drink */
#cursor.is-media {
  width: 170px; height: 170px;
  background-color: transparent;
  background-size: cover; background-position: center;
  border: 2px solid var(--coffee);
}
#cursor.is-media .cursor-label { display: none; }

/* faint coffee-stain ring left behind as the cursor moves */
.coffee-ring {
  position: fixed; z-index: 9998; pointer-events: none;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--coffee);
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0.4;
  animation: coffeeRing 1.1s ease-out forwards;
}
@keyframes coffeeRing {
  to { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* ── Fixed brand (top-left) ───────────────────────────── */
#brand {
  position: fixed; top: 2.6rem; left: 2.5rem; z-index: 60; display: block;
}
#brand img { height: 74px; width: auto; display: block; }

/* ── Persistent SVG side navigation ───────────────────── */
/* Pinned far-left with a constant margin; the centred content moves away
   from it as the viewport widens (gap is intentionally variable). */
#sidenav {
  position: fixed; top: 200px; left: 2.5rem; z-index: 40;
  width: 190px;
  display: flex; flex-direction: column; gap: 1.5rem;
}
.nav-group { display: flex; flex-direction: column; gap: 0.5rem; }
.nav-link {
  font-family: var(--font-primary);
  font-size: 14px; font-weight: 400; line-height: 1.2;
  color: var(--blue); opacity: 0.5; cursor: none;
  transition: opacity 0.2s ease, font-weight 0.2s ease;
}
.nav-link:hover { opacity: 1; }
/* one uniform indent for every sub-item (≈ 3rd letter of the section names) */
.nav-sub { display: flex; flex-direction: column; gap: 0.5rem; padding-left: 22px; }
.nav-link.active { opacity: 1; font-weight: 700; }

/* Burger toggle + drawer scrim — desktop keeps the fixed left nav, so both are
   hidden here and only activated in the ≤1080px media query. */
#nav-toggle { display: none; }
#nav-scrim { display: none; }

/* ── Main column — centred frame, content offset past the nav lane ── */
main {
  max-width: var(--frame);
  margin: 0 auto;
  padding: 0 var(--gutter) 6rem var(--sidebar);
}
.section { scroll-margin-top: 2rem; }

/* ── Hero band (flush to the top edge) ────────────────── */
#hero { padding-top: 0; }
.hero-band {
  position: relative;
  background: var(--hero);
  min-height: 480px;
  padding: 0;                  /* padding lives on the greeting so the photo can
                                  bleed to the band edges and be masked by it */
  display: flex; align-items: center;
  overflow: hidden;            /* masks the photo to the band's rounded shape */
  border-radius: 0 0 90px 0;
}
.hero-greeting {
  color: #fff;
  font-family: var(--font-mono);
  font-size: clamp(20px, 2.1vw, 24px);
  font-weight: 400;
  line-height: 2.7;
  max-width: 55%;
  padding: 3.5rem;
}
.hero-greeting .nb { white-space: nowrap; }   /* keep "but friends call me Bê" on one line */
/* Transparent cutout, flush to the band's bottom-right; the band clips it
   (rounded corner) and the blue shows through the transparent areas. */
.hero-portrait {
  position: absolute; right: 0; bottom: 0;
  height: 100%; width: auto; max-width: 60%;
  object-fit: contain; object-position: bottom right;
}

/* ── Traits band (5 columns) ──────────────────────────── */
#traits { margin-top: 4rem; }
.traits-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2rem;
}
.trait-title {
  font-family: var(--font-primary);
  font-weight: 700; font-size: 17px; line-height: 1.1;
  color: var(--blue); margin-bottom: 1.5rem;
}
.trait-title .phon { font-weight: 300; font-size: 12px; margin-left: 0.4rem; }
.trait-title.carioca span:first-child { text-decoration: underline; }
.trait-text {
  font-family: var(--font-mono);
  font-size: 12px; line-height: 2; color: var(--blue);
}

/* ── Section heading ──────────────────────────────────── */
.section-heading {
  font-family: var(--font-primary); font-weight: 700;
  font-size: 28px; color: var(--blue); margin-bottom: 0.5rem;
}
.section-sub {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--blue); opacity: 0.85; margin-bottom: 3rem;
}

/* ── Work (collapsible) ───────────────────────────────── */
#work { margin-top: 9rem; }
.work-list { border-top: 1px solid rgba(1, 87, 218, 0.55); }
.work-item { border-bottom: 1px solid rgba(1, 87, 218, 0.55); position: relative; }

.work-row {
  display: flex; align-items: flex-end; gap: 1.75rem;
  width: 100%; background: none; border: 0; text-align: left;
  padding: 1.4rem 0; cursor: none;
}
.work-num {
  font-family: var(--font-mono); font-size: 20px; font-weight: 300;
  color: var(--blue); opacity: 0.7; width: 2ch; flex-shrink: 0;
}
/* title + "what it is" caption, stacked */
.work-head { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.work-what {
  font-family: var(--font-mono); font-size: 12px; font-weight: 400;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--blue); opacity: 0.65;
}
/* Signature: outlined by default, fills solid on hover/open */
.work-name {
  font-family: var(--font-primary); font-weight: 700;
  font-size: clamp(40px, 7vw, 84px); line-height: 1; letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--blue);
  transition: color 0.25s ease, -webkit-text-stroke 0.25s ease;
}
.work-row:hover .work-name,
.work-item.open .work-name {
  color: var(--blue); -webkit-text-stroke: 0 transparent;
}
.work-toggle {
  margin-left: auto; align-self: center;
  font-family: var(--font-mono); font-size: 24px; color: var(--blue);
  opacity: 0.5; transition: transform 0.3s, opacity 0.2s; flex-shrink: 0;
}
.work-item.open .work-toggle { transform: rotate(45deg); opacity: 1; }
.work-row:hover .work-toggle { opacity: 1; }

.badge {
  display: inline-block; background: var(--coffee); color: #fff;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em;
  padding: 3px 7px; border-radius: 3px; vertical-align: middle; margin-left: 0.75rem;
}

/* collapsible panel (LOCKED layout)
   Animate the REAL content height with the grid 0fr→1fr technique instead of a
   huge max-height (which eased across 30000px and made the panel snap shut in a
   rush). The inner fades in alongside the height for a smoother reveal. */
.work-panel {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.work-item.open .work-panel { grid-template-rows: 1fr; }
.work-panel-inner {
  min-height: 0; overflow: hidden;
  padding: 0.5rem 0 2.5rem; --case-media: 100%;
  /* whitespace-only "information blocks": tight inside a block, wide between
     blocks (proximity). --block-gap sits before every subhead. */
  --block-gap: 7rem; --media-gap: 1.75rem;
  opacity: 0; transition: opacity 0.4s ease 0.05s;
}
.work-item.open .work-panel-inner { opacity: 1; }
/* Once fully open, stop clipping so shadows / hover-expand aren't cut at the
   panel edge. Active only at rest (class added by JS after the open transition);
   during collapse/expand the panel stays clipped for a clean animation. Purely
   visual — no size, proportion, or layout change. */
.work-item.is-expanded .work-panel-inner { overflow: visible; }
/* never lead a panel with the big between-block gap */
.work-panel-inner > :first-child { margin-top: 0; }

.case-meta {
  display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem;
  font-family: var(--font-mono); font-size: 11px; opacity: 0.6; margin-bottom: 2.75rem;
}
.case-meta b { font-weight: 500; opacity: 1; }
.case-text {
  font-family: var(--font-mono); font-size: 14px; line-height: 1.9;
  opacity: 0.82; max-width: 640px; margin-bottom: 1.5rem;
}
.case-list {
  font-family: var(--font-mono); font-size: 14px; line-height: 1.9;
  opacity: 0.82; max-width: 640px; margin-bottom: 1.5rem; padding-left: 1.1rem;
}
.case-list li { margin-bottom: 0.4rem; }
.case-list li::marker { color: var(--coffee); }
.case-list b { font-weight: 500; opacity: 1; }
.case-subhead {
  font-family: var(--font-primary); font-weight: 700;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink); opacity: 0.9; margin: var(--block-gap) 0 0.85rem;
}
.case-ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.6rem; min-height: 200px; padding: 1.5rem; text-align: center;
  border: 1.5px dashed rgba(39, 24, 46, 0.35); border-radius: 6px;
  background: rgba(39, 24, 46, 0.03);
  font-family: var(--font-mono); font-size: 13px; color: rgba(39, 24, 46, 0.55);
}
.case-ph-tag {
  font-family: var(--font-mono); font-size: 9px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--coffee); border: 1px solid var(--coffee);
  border-radius: 999px; padding: 2px 9px;
}
.case-text.todo-flag {
  opacity: 1; color: var(--coffee); max-width: none;
  border: 1px dashed var(--coffee); border-radius: 6px;
  background: rgba(255, 132, 106, 0.08); padding: 0.7rem 0.9rem;
}
/* Figure size tiers — standard is tight/text-aligned; wide for overviews;
   narrow reins in tall portrait/device shots. (.case-duo pairs two.) */
.case-figure { margin: var(--media-gap) 0; max-width: var(--case-media); }
.case-figure--wide { max-width: var(--case-media); }
.case-figure--narrow { max-width: 360px; }
.case-figure img, .case-figure video { display: block; width: 100%; height: auto; border-radius: 6px; }
.case-figure figcaption {
  font-family: var(--font-mono); font-size: 9px;
  text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.4; margin-top: 0.5rem;
}
.case-video { position: relative; width: 100%; max-width: var(--case-media); aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: #000; margin: var(--media-gap) 0; }
.case-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* horizontal scroll-snap carousel (e.g. heatmaps) */
.case-carousel {
  display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem; -webkit-overflow-scrolling: touch;
  max-width: var(--case-media); margin: var(--media-gap) 0;
}
.case-carousel img {
  height: 460px; width: auto; flex: 0 0 auto; scroll-snap-align: start;
  border-radius: 6px; display: block;
}

/* two small figures side by side (e.g. low-res animation gifs) */
.case-duo {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  max-width: var(--case-media); margin: var(--media-gap) 0;
}
.case-duo .case-figure { margin: 0; }

/* three equal photo tiles in a row (e.g. launch-day gallery) */
.case-trio {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: var(--media-gap) 0;
  max-width: var(--case-media);
}
.case-trio .case-figure { margin: 0; max-width: none; }
.case-trio img { width: 100%; height: 280px; object-fit: cover; border-radius: 6px; }

/* Personas — desktop "feature + thumbnails" gallery (DEFAULT):
   the focused persona is large on the LEFT; the other two sit SIDE BY SIDE to
   its right (BIG | small | small). Click a thumbnail to bring it into focus.
   On small screens this collapses to a coverflow carousel (media query below). */
.pc-wrap { max-width: var(--case-media); margin: var(--media-gap) 0; }
.persona-carousel { position: relative; }
.pc-stage {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1rem;
  align-items: end;            /* line the three images up by their bottoms */
  padding-bottom: 1.8rem;      /* room for the focus caption that floats below */
}
.pc-card {
  margin: 0; max-width: none; cursor: none; transform-origin: center center;
  transition: opacity .3s ease, transform .3s ease, filter .3s ease;
}
.pc-card img {
  width: 100%; height: auto; display: block; border-radius: 8px;
  box-shadow: 0 10px 26px rgba(1, 87, 218, 0.14);
  transition: transform .25s ease, box-shadow .25s ease;
}
.pc-card figcaption {
  font-family: var(--font-mono); font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.1em; opacity: 0.6; margin-top: 0.6rem; text-align: center;
}
/* placement by focus state: BIG focus left, two thumbnails side by side right */
.pc-card.is-center { grid-column: 1; grid-row: 1; z-index: 2; position: relative; }
.pc-card.is-left   { grid-column: 2; grid-row: 1; }
.pc-card.is-right  { grid-column: 3; grid-row: 1; }
/* focus caption floats just below its image (out of flow) so the three image
   bottoms align rather than the image+caption box */
.pc-card.is-center figcaption { position: absolute; top: 100%; left: 0; right: 0; margin-top: 0.6rem; }
/* the two thumbnails: no caption, slightly recessed */
.pc-card.is-left figcaption, .pc-card.is-right figcaption { display: none; }
.pc-card.is-left, .pc-card.is-right { opacity: 0.78; }
/* micro-interaction: thumbnails brighten + zoom a touch on hover, dip on press */
.pc-card.is-left:hover, .pc-card.is-right:hover { opacity: 1; }
.pc-card.is-left:hover img, .pc-card.is-right:hover img { transform: scale(1.05); box-shadow: 0 14px 34px rgba(1, 87, 218, 0.26); }
.pc-card.is-left:active img, .pc-card.is-right:active img { transform: scale(0.98); }
/* micro-interaction: the newly focused card pops in when clicked */
.pc-card.just-focused img { animation: pcPop .45s ease; }
@keyframes pcPop { 0% { transform: scale(0.95); } 55% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* arrows + dots: carousel-only, hidden by default (shown in the media query) */
.pc-arrow {
  display: none; position: absolute; top: 50%; transform: translate(var(--pc-tx), -50%); z-index: 5;
  width: 42px; height: 42px; border-radius: 50%;
  align-items: center; justify-content: center;
  background: var(--cream); border: 1.5px solid var(--blue); color: var(--blue);
  font-family: var(--font-primary); font-size: 22px; line-height: 1; padding-bottom: 3px;
  cursor: none; transition: background .2s ease, color .2s ease, transform .2s ease;
}
.pc-prev { left: 0; --pc-tx: -80%; }
.pc-next { right: 0; --pc-tx: 80%; }
.pc-arrow:hover { background: var(--blue); color: var(--cream); transform: translate(var(--pc-tx), -50%) scale(1.08); }
.pc-arrow:active { transform: translate(var(--pc-tx), -50%) scale(0.92); }
.pc-dots { display: none; justify-content: center; gap: 0.5rem; margin-top: 2rem; }
.pc-dot {
  width: 7px; height: 7px; border-radius: 50%; padding: 0;
  border: 1px solid var(--blue); background: transparent; opacity: 0.45;
  cursor: none; transition: background .2s ease, opacity .2s ease;
}
.pc-dot.active { background: var(--blue); opacity: 1; }

/* ≤600px — coverflow carousel fallback: one card in front + bigger, the other
   two behind on each side; arrows (always visible here, since touch has no
   hover) + dots navigate. */
@media (max-width: 600px) {
  .pc-wrap { max-width: 460px; margin-left: auto; margin-right: auto; }
  .pc-stage { display: block; padding-bottom: 0; }
  .pc-card { width: 100%; transition: transform .5s cubic-bezier(.4, 0, .2, 1), opacity .5s ease, filter .5s ease; }
  .pc-card.is-center { position: relative; z-index: 3; opacity: 1; transform: scale(1); }
  .pc-card.is-center figcaption { display: block; position: absolute; top: 100%; left: 0; right: 0; margin-top: 0.6rem; }
  .pc-card.is-left, .pc-card.is-right {
    position: absolute; top: 0; left: 0; z-index: 1; opacity: 0.4; filter: saturate(0.7);
  }
  .pc-card.is-left  { transform: translateX(-40%) scale(0.8); }
  .pc-card.is-right { transform: translateX(40%) scale(0.8); }
  .pc-arrow { display: flex; }
  .pc-dots { display: flex; }
}

.case-placeholder { font-family: var(--font-mono); font-size: 13px; opacity: 0.6; padding: 1.5rem 0; }

/* figures side by side, sized by aspect ratio so they share one height and
   fill the row width WITHOUT horizontal scroll. Each figure carries its
   aspect ratio in `--ar` (width/height); widths distribute proportionally. */
.case-row {
  display: flex; gap: 1rem; align-items: flex-start; margin: var(--media-gap) 0;
  max-width: var(--case-media);
}
.case-row .case-figure { flex: var(--ar, 1) 1 0; min-width: 0; margin: 0; max-width: none; }
.case-row .case-figure img, .case-row .case-figure video {
  width: 100%; height: auto; border-radius: 6px;
}

/* ── Screen viewports — tall full-page screenshots shown inside a fixed-height
   frame that scrolls internally. Mirrors the mini-tool mockups (browser frame
   for desktop, iPhone bezel for mobile) but static + scrollable. */
.case-shot {
  max-width: var(--case-media);
  border: 1px solid rgba(39, 24, 46, 0.2); border-radius: 10px; overflow: hidden;
  /* tight, downward-biased lift so the blur doesn't reach the panel clip edge */
  background: #fff; box-shadow: 0 10px 22px -12px rgba(39, 24, 46, 0.22);
}
.case-shot-bar {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: #efe7dc; border-bottom: 1px solid rgba(39, 24, 46, 0.12);
}
.case-shot-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #cdbfae; }
.case-shot-url { font-family: var(--font-mono); font-size: 11px; opacity: 0.5; margin-left: 10px; }
.case-shot-scroll {
  height: clamp(420px, 62vh, 600px); overflow-y: auto; overflow-x: hidden;
  background: #fff; scrollbar-width: thin; scrollbar-color: #cdbfae transparent;
}
.case-shot-scroll img { display: block; width: 100%; height: auto; }
.case-shot-scroll::-webkit-scrollbar { width: 9px; }
.case-shot-scroll::-webkit-scrollbar-thumb { background: #cdbfae; border-radius: 6px; border: 2px solid #fff; }
.case-shot-scroll::-webkit-scrollbar-track { background: transparent; }

/* Before/After pair of browser viewports — stacks on narrow screens. */
.case-compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  max-width: var(--case-media); margin: var(--media-gap) 0;
}
.case-compare .case-figure { margin: 0; max-width: none; }

/* desktop browser viewport + phone viewport side by side (e.g. a service detail).
   The desktop browser is pinned to the phone's exact height (bezel 10+10 + screen
   650 = 670px) so both viewports are identical in height and flush top + bottom. */
.case-devices {
  display: flex; gap: 1.5rem; align-items: flex-start;
  max-width: var(--case-media); margin: 1rem 0;
}
.case-devices > .case-figure { margin: 0; }
.case-devices > .case-figure:first-child { flex: 1 1 auto; min-width: 0; max-width: none; }
.case-devices > .case-figure:last-child { flex: 0 0 auto; }
.case-devices .case-phone { margin: 0; }   /* phone flush to the top, like the browser */
.case-devices .case-shot { height: 670px; display: flex; flex-direction: column; min-height: 0; }
.case-devices .case-shot-scroll { flex: 1 1 auto; height: auto; min-height: 0; }

/* iPhone-framed mobile screenshot (static, scrolls inside) — mirrors .tool-embed.phone */
.case-phone { display: flex; flex-direction: column; align-items: center; margin: var(--media-gap) 0; }
.case-phone--left { align-items: flex-start; }
.case-phone-frame {
  position: relative; padding: 10px; background: #0a0a0b; border-radius: 46px;
  box-shadow: inset 0 0 0 2px #2c2c2e, 0 0 0 2px #4b4b4d, 0 14px 36px rgba(0, 0, 0, .18);
}
.case-phone-screen {
  width: 300px; height: 650px; border-radius: 37px; overflow-y: auto; overflow-x: hidden;
  background: #D9D9D9; scrollbar-width: none;
}
.case-phone-screen::-webkit-scrollbar { width: 0; height: 0; }
.case-phone-screen img { display: block; width: 100%; height: auto; }
.case-phone-screen video { display: block; width: 100%; height: 100%; object-fit: cover; }
.case-phone-btn { position: absolute; background: #161617; box-shadow: 0 0 0 1px #3a3a3c; }
.case-phone-btn.action { left: -3px; top: 112px; width: 4px; height: 22px; border-radius: 2px 0 0 2px; }
.case-phone-btn.volup  { left: -3px; top: 148px; width: 4px; height: 40px; border-radius: 2px 0 0 2px; }
.case-phone-btn.voldn  { left: -3px; top: 194px; width: 4px; height: 40px; border-radius: 2px 0 0 2px; }
.case-phone-btn.power  { right: -3px; top: 160px; width: 4px; height: 69px; border-radius: 0 2px 2px 0; }

/* ── Annotated homepage — scroll the screenshot, the reasoning for each
   redesign section tracks alongside it on the right; section limits are
   drawn as bands over the image. JS (§8) builds the bands + drives state. */
.case-annotated { max-width: var(--case-media); margin: 1rem 0; }
.case-annotated figcaption {
  font-family: var(--font-mono); font-size: 9px;
  text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.4; margin-top: 0.5rem;
}
.case-annotated-body { display: flex; height: clamp(460px, 72vh, 680px); }
.case-annotated-scroll {
  flex: 1 1 62%; position: relative; overflow-y: auto; overflow-x: hidden;
  background: #fff; scrollbar-width: thin; scrollbar-color: #cdbfae transparent;
}
.case-annotated-scroll::-webkit-scrollbar { width: 9px; }
.case-annotated-scroll::-webkit-scrollbar-thumb { background: #cdbfae; border-radius: 6px; border: 2px solid #fff; }
.case-annotated-media { position: relative; }
.case-annotated-media img { display: block; width: 100%; height: auto; }
/* one band per section, tiled over the screenshot (top/height set inline by JS) */
/* bands carry only the reference number now — no boundary lines drawn */
.case-band { position: absolute; left: 0; right: 0; box-sizing: border-box; pointer-events: none; }
.case-band-num {
  position: absolute; left: 12px; top: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px;
  background: rgba(255, 248, 241, 0.95); color: var(--blue);
  border: 1px solid rgba(1, 87, 218, 0.4); box-shadow: 0 1px 4px rgba(39, 24, 46, 0.15);
  transition: all 0.3s ease;
  pointer-events: auto; cursor: none;   /* hoverable to jump its reasoning */
}
.case-band-num:hover { background: var(--blue); color: #fff; border-color: var(--blue); transform: scale(1.2); }
.case-band.active .case-band-num { background: var(--blue); color: #fff; border-color: var(--blue); transform: scale(1.14); }

/* Zoom + pan viewport for wide reference boards (JS §9 drives the transform) */
.case-zoom {
  position: relative; overflow: hidden; max-width: var(--case-media);
  height: clamp(440px, 70vh, 680px);
  border: 1px solid rgba(39, 24, 46, 0.2); border-radius: 10px;
  background: #f3ece1; touch-action: none;
}
/* the transform target — the .case-zoom-stage (image + hotspot overlay together)
   when present, or the bare image for boards without translate mode. JS §9 drives
   the transform; both need a top-left origin for the fit/pan math. */
.case-zoom-stage, .case-zoom > .case-zoom-img {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0; will-change: transform;
}
.case-zoom .case-zoom-img {
  display: block; width: auto; max-width: none; height: auto; border-radius: 0;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
}
.case-zoom-overlay { position: absolute; inset: 0; pointer-events: none; }
.case-zoom-hint {
  position: absolute; right: 12px; bottom: 12px; z-index: 2; pointer-events: none;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em;
  color: var(--blue); background: rgba(255, 248, 241, 0.92);
  padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(1, 87, 218, 0.25);
}
/* ── In-viewport translate mode (JS §10) ── */
.case-zoom-translate {
  position: absolute; left: 12px; bottom: 12px; z-index: 3; cursor: none;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em;
  color: var(--blue); background: rgba(255, 248, 241, 0.92);
  padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(1, 87, 218, 0.3);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.case-zoom.translating .case-zoom-translate { background: var(--blue); color: #fff; border-color: var(--blue); }
/* label hotspots — invisible until translate mode is on */
.tl-hotspot {
  position: absolute; box-sizing: border-box; pointer-events: none; border-radius: 3px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.case-zoom.translating .tl-hotspot {
  pointer-events: auto; cursor: none;
  background: rgba(1, 87, 218, 0.08); box-shadow: inset 0 0 0 1.5px rgba(1, 87, 218, 0.4);
}
.case-zoom.translating .tl-hotspot:hover {
  background: rgba(1, 87, 218, 0.2); box-shadow: inset 0 0 0 2px var(--blue);
}
/* the English chip that trails the cursor */
.case-translate-chip {
  position: fixed; z-index: 10000; pointer-events: none; max-width: 320px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5; color: #fff;
  background: var(--blue); padding: 7px 11px; border-radius: 8px;
  box-shadow: 0 6px 22px rgba(39, 24, 46, 0.28);
  opacity: 0; transform: translateY(-50%); transition: opacity 0.12s ease;
}
.case-translate-chip.show { opacity: 1; }
/* right rail — the active section's reasoning */
.case-annotated-rail {
  flex: 0 0 38%; border-left: 1px solid rgba(39, 24, 46, 0.12);
  background: #faf4ec; padding: 1.5rem 1.4rem;
  display: flex; flex-direction: column; justify-content: center;
}
.case-reason { transition: opacity 0.25s ease; }
.case-reason.fading { opacity: 0; }
.case-reason-num { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--blue); opacity: 0.8; }
.case-reason-title { font-family: var(--font-primary); font-weight: 700; font-size: 17px; color: var(--ink); margin: 0.5rem 0 0.7rem; }
.case-reason-text { font-family: var(--font-mono); font-size: 13px; line-height: 1.75; opacity: 0.82; }
.case-reason-hint { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.4; margin-top: 1.2rem; }

/* inline word that reveals an image on hover (italic + underline) */
.img-hover {
  font-style: italic; text-decoration: underline; text-underline-offset: 2px;
}

/* floating preview for inline image-hover words (uncropped, portrait-friendly) */
#img-preview {
  position: fixed; pointer-events: none; opacity: 0; z-index: 100;
  border-radius: 6px; overflow: hidden; transition: opacity 0.2s;
  box-shadow: 0 12px 40px rgba(39, 24, 46, 0.18);
}
#img-preview img { display: block; width: 220px; height: auto; }

/* Floating work hover preview */
.work-preview {
  position: fixed; width: 220px; height: 150px; border-radius: 6px; overflow: hidden;
  pointer-events: none; opacity: 0; z-index: 100; transition: opacity 0.2s; background: #D9D9D9;
}
.work-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ── Mini tools ───────────────────────────────────────── */
#tools { margin-top: 9rem; }
.tool { margin-top: 5rem; }
.tool-head { display: flex; align-items: baseline; gap: 1.5rem; margin-bottom: 2.5rem; }
.tool-num { font-family: var(--font-mono); font-size: 20px; font-weight: 300; color: var(--blue); opacity: 0.6; }
.tool-title {
  font-family: var(--font-primary); font-weight: 700;
  font-size: clamp(48px, 6vw, 84px); line-height: 0.95; letter-spacing: -0.02em;
  color: var(--blue);
}
.tool-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: start; }
/* Ref.Ari: description | Meet Ari (centred between) | Test it */
.tool-grid--ari { grid-template-columns: 1.2fr auto 0.9fr; align-items: center; }
.tool-block { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 2rem; }
.block-label { font-family: var(--font-primary); font-weight: 700; font-size: 17px; color: var(--blue); }
.block-text { font-family: var(--font-mono); font-size: 12px; line-height: 1.9; color: var(--blue); }
.tool-note { font-family: var(--font-mono); font-size: 12px; line-height: 1.9; color: var(--coffee); margin-top: 0.6rem; }
.block-text p + p { margin-top: 1rem; }
.block-text b { font-weight: 700; }

.tool-media {
  background: #D9D9D9; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.12em; color: #8a8a8a; margin-top: 0.5rem;
}
.tool-media.tall { aspect-ratio: 402 / 700; }

/* Meet Ari mascot */
.meet-ari { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; margin: 1rem 0 0; }
.meet-ari .label { font-family: var(--font-primary); font-weight: 700; font-size: 17px; color: var(--blue); }
.meet-ari img { width: 120px; height: auto; image-rendering: pixelated; }

/* ── Tool embed (browser-frame, click-to-load) — LOCKED ── */
.tool-embed { margin-top: 0.5rem; }
.embed-frame {
  border: 1px solid rgba(39, 24, 46, 0.2); border-radius: 10px; overflow: hidden;
  background: #fff; box-shadow: 0 12px 44px rgba(39, 24, 46, 0.10);
}
.embed-bar {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: #efe7dc; border-bottom: 1px solid rgba(39, 24, 46, 0.12);
}
.embed-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #cdbfae; }
.embed-url { font-family: var(--font-mono); font-size: 11px; opacity: 0.5; margin-left: 10px; }
.embed-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.embed-full, .embed-open {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--blue); background: none; border: 0; cursor: none; opacity: 0.7;
}
.embed-full:hover, .embed-open:hover { opacity: 1; }
.embed-stage { position: relative; width: 100%; height: 72vh; min-height: 460px; background: #fff; }
.embed-stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.embed-load {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.9rem;
  background: #D9D9D9; border: 0; cursor: none;
}
.embed-load .cta-play {
  width: 88px; height: 88px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue); color: var(--cream); font-size: 30px; padding-left: 6px;
  transition: transform .2s ease;
}
.embed-load:hover .cta-play { transform: scale(1.06); }
.embed-load .cta-title { font-family: var(--font-primary); font-weight: 700; font-size: 26px; color: var(--blue); }
.embed-load .cta-sub { font-family: var(--font-mono); font-size: 13px; opacity: 0.6; color: var(--blue); }
.embed-frame:fullscreen { border-radius: 0; }
.embed-frame:fullscreen .embed-stage { height: calc(100vh - 41px); }

/* Phone-tool variant (Ref.Ari) — iPhone frame built in the PARENT page so the
   reactive cursor works over the grey-screen "Test it" gate. The app iframe is
   mounted into the screen only on click. */
.tool-embed.phone { display: flex; flex-direction: column; align-items: center; }
.tool-embed.phone .embed-frame {
  position: relative;
  border: 0; padding: 10px;
  background: #0a0a0b; border-radius: 46px; overflow: visible;
  box-shadow:
    inset 0 0 0 2px #2c2c2e,
    0 0 0 2px #4b4b4d,
    0 14px 36px rgba(0, 0, 0, .18);
}
.tool-embed.phone .embed-stage {
  position: relative;
  width: 300px; height: 650px; min-height: 0;
  border-radius: 37px; overflow: hidden;
  background: #D9D9D9;          /* grey screen fill before load */
}
.tool-embed.phone .embed-stage iframe {
  width: 100%; height: 100%; border: 0; display: block; background: #0D0D0D;
}
/* side buttons */
.tool-embed.phone .phone-btn { position: absolute; background: #161617; box-shadow: 0 0 0 1px #3a3a3c; }
.tool-embed.phone .phone-btn.action { left: -3px; top: 112px; width: 4px; height: 22px; border-radius: 2px 0 0 2px; }
.tool-embed.phone .phone-btn.volup  { left: -3px; top: 148px; width: 4px; height: 40px; border-radius: 2px 0 0 2px; }
.tool-embed.phone .phone-btn.voldn  { left: -3px; top: 194px; width: 4px; height: 40px; border-radius: 2px 0 0 2px; }
.tool-embed.phone .phone-btn.power  { right: -3px; top: 160px; width: 4px; height: 69px; border-radius: 0 2px 2px 0; }
/* Full screen / Open links sit quietly under the viewport (phone + desktop) */
.viewport-actions {
  display: flex; justify-content: center; gap: 1.5rem; margin-top: 1rem;
}

/* ── Coffee recipe cards ──────────────────────────────── */
.recipe { margin: 8rem 0; display: flex; flex-direction: column; gap: 1.75rem; }
.recipe-title { font-family: var(--font-mono); font-size: 16px; color: var(--coffee); }
.recipe-row { display: flex; align-items: center; gap: 2.5rem; flex-wrap: wrap; }
.recipe-vessel { height: 84px; width: auto; flex-shrink: 0; }
.recipe-cols { display: flex; gap: 3rem; flex-wrap: wrap; }
/* wrapper around the non-method columns: invisible on desktop (its children act
   as direct flex items of .recipe-cols), becomes a horizontal-scroll strip on
   mobile (see the ≤768px media query). */
.recipe-details { display: contents; }
.recipe-col { display: flex; flex-direction: column; gap: 0.5rem; }
.recipe-col .lbl { font-family: var(--font-primary); font-weight: 700; font-size: 12px; color: var(--coffee); }
.recipe-col .val { font-family: var(--font-mono); font-size: 12px; line-height: 1.45; color: var(--coffee); }

/* ── About ────────────────────────────────────────────── */
#about { margin-top: 9rem; }
.about-top { position: relative; min-height: 880px; }
.about-heading {
  font-family: var(--font-primary); font-weight: 700;
  font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; letter-spacing: -0.02em;
  color: var(--blue); max-width: none; margin-top: 2rem;
}
.about-body {
  font-family: var(--font-mono); font-weight: 300;
  font-size: 12px; line-height: 2; color: var(--blue); max-width: 460px;
  margin: 2.5rem 0 0 auto;
}
.about-body p + p { margin-top: 1.1rem; }
.about-open { margin-top: 1.5rem; }

/* scattered photos — left of the body text, below the title */
.about-photos { position: absolute; left: 0; top: 14.5rem; width: 50%; height: 100%; }
.about-photos .photo {
  position: absolute; height: auto; border-radius: 6px;
  box-shadow: 0 10px 30px rgba(39, 24, 46, 0.18);
}

/* ── Footer + happy-hour easter egg ───────────────────── */
#footer { margin-top: 9rem; padding-top: 2rem; border-top: 1px solid rgba(1, 87, 218, 0.45); }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-left { display: flex; align-items: center; gap: 5rem; flex-wrap: wrap; }
.footer-link {
  font-family: var(--font-mono); font-size: 12px; color: var(--coffee);
  background: none; border: 0; cursor: none; transition: opacity 0.2s;
}
.footer-link.u { text-decoration: underline; }
.footer-link:hover { opacity: 0.7; }
/* left group is blue; the happy-hour trigger stays coral */
.footer-left .footer-link { color: var(--blue); }

/* easter egg: Espresso Martini recipe, hidden until trigger */
#happy-hour {
  margin: 0;                 /* override .recipe's 8rem so the collapsed footer stays compact */
  overflow: hidden; max-height: 0; opacity: 0;
  transition: max-height 0.55s ease, opacity 0.4s ease;
}
#happy-hour.open { max-height: 400px; opacity: 1; margin-top: 3.5rem; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1080px) {
  :root { --gutter: 1.5rem; }
  #brand { top: 1.2rem; left: 1.5rem; z-index: 9994; }   /* stays visible over the drawer */
  #brand img { height: 56px; }
  /* nav un-pins and stacks above the content */
  /* burger toggle, top-right — bars only (no box); colour adapts to the bg */
  #nav-toggle {
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    position: fixed; top: 1.2rem; right: 1.5rem; z-index: 9993;
    width: 44px; height: 44px; padding: 0;
    background: none; border: 0; cursor: pointer;
  }
  .nav-toggle-bar {
    display: block; width: 26px; height: 2px; background: var(--blue);
    border-radius: 2px; transition: transform .3s ease, opacity .2s ease, background .25s ease;
  }
  /* light bars over the blue hero, or while open (over the dark scrim); blue otherwise */
  body.over-hero .nav-toggle-bar,
  body.nav-open .nav-toggle-bar { background: var(--cream); }
  body.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* nav becomes a side drawer that slides in from the left */
  #sidenav {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100%;
    width: min(82vw, 300px); margin: 0; z-index: 9992;
    background: var(--cream); border-right: 1px solid rgba(1, 87, 218, 0.18);
    box-shadow: 0 0 40px rgba(39, 24, 46, 0.18);
    padding: 6rem 2rem 2rem; gap: 1.75rem;
    transform: translateX(-100%); transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    overflow-y: auto; overscroll-behavior: contain;
  }
  body.nav-open #sidenav { transform: translateX(0); }

  /* dimmed scrim behind the drawer */
  #nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 9991;
    background: rgba(39, 24, 46, 0.45);
    opacity: 0; pointer-events: none; transition: opacity .35s ease;
  }
  body.nav-open #nav-scrim { opacity: 1; pointer-events: auto; }
  /* lock the page while the drawer is open — freezing the body (set via JS with
     top:-scrollY) is the only reliable way to stop background scroll on iOS */
  body.nav-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
  main { padding-left: var(--gutter); }
  .hero-greeting { max-width: 100%; }
  .hero-portrait { position: static; height: auto; width: 60%; max-width: 312px; margin: 1.5rem 0 0 auto; }
  .hero-band { flex-direction: column; align-items: flex-start; gap: 1.5rem; }
  .traits-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-grid, .tool-grid--ari { grid-template-columns: 1fr; align-items: start; }
  .case-compare { grid-template-columns: 1fr; }
  .case-devices { flex-direction: column; align-items: center; }
  .case-devices > .case-figure:first-child { width: 100%; }
  /* keep media inside the viewport on small screens (no horizontal scroll).
     The phone shrinks proportionally only when it wouldn't otherwise fit. */
  .work-panel-inner img, .work-panel-inner video { max-width: 100%; }
  .case-phone-frame { max-width: 100%; }
  .case-phone-screen { width: min(300px, calc(100vw - 6rem)); height: auto; aspect-ratio: 300 / 650; }
  .pc-stage .pc-card { min-width: 0; }
  /* stacked: the pinned 670px desktop height still applies and is fine */
  /* annotated homepage: rail moves above the screenshot, both auto-height */
  .case-annotated-body { flex-direction: column; height: auto; }
  .case-annotated-rail { flex: none; border-left: 0; border-bottom: 1px solid rgba(39, 24, 46, 0.12); }
  .case-annotated-scroll { flex: none; height: clamp(420px, 60vh, 560px); }
  .about-body { margin-left: 0; }
  /* photos flow into a simple row instead of the absolute scatter */
  .about-top { min-height: 0; }
  .about-photos { position: static; width: auto; height: auto; display: flex; flex-wrap: wrap; gap: 1rem; margin: 2rem 0; }
  .about-photos .photo { position: static; transform: none !important; width: 30% !important; min-width: 150px; }
  body { cursor: auto; }
  #cursor { display: none; }
}

@media (max-width: 600px) {
  .traits-grid { grid-template-columns: 1fr; }
  .footer-left { gap: 1.5rem; }
  .footer-row { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

/* Coffee-recipe dividers on mobile: centre the message, illustration and the
   method (Extraction) name; the remaining columns become a horizontal-scroll
   strip. Only the strip scrolls sideways — the page never does. */
@media (max-width: 768px) {
  /* Hero (phones): full-bleed blue band, photo beside smaller text, shorter
     overall so the next section starts to peek. */
  .hero-band {
    flex-direction: row; align-items: flex-end; gap: 0.75rem;
    margin-inline: calc(50% - 50vw);   /* break out to full screen width */
    min-height: 0; border-radius: 0 0 56px 0;
    /* top space clears the fixed logo (~75px) and burger (~63px) so neither sits
       over the text or photo; also makes the block a touch taller. */
    padding: 5.5rem 0 0 var(--gutter);
  }
  .hero-greeting {
    /* scales down on narrow screens so the no-wrap line fits beside the photo */
    font-size: clamp(11px, 3.5vw, 15px); line-height: 1.7; max-width: none;
    padding: 1.25rem 0; flex: 1 1 0; min-width: 0; align-self: center;
  }
  .hero-portrait {
    position: static; align-self: flex-end; margin: 0;
    width: 42%; max-width: 200px; height: auto;
    object-fit: contain; object-position: bottom right;
  }

  .recipe, .recipe-title { text-align: center; }
  .recipe-row { flex-direction: column; align-items: center; flex-wrap: nowrap; gap: 1.25rem; }
  /* method (Extraction) and the remaining columns live on ONE horizontal line
     that scrolls; the method sits centred at rest, swipe to reveal the rest.
     Only this strip scrolls sideways — the page never does. */
  .recipe-cols {
    flex-flow: row nowrap; align-items: flex-start; gap: 2.5rem;
    width: 100%; overflow-x: auto; overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory;
    /* 50% side padding lets EVERY column (incl. the first) rest dead-centre,
       regardless of its width; mandatory snap centres the method on load. */
    padding: 0.25rem 50% 1rem;
  }
  .recipe-details { display: contents; }   /* its columns join the same scroll row */
  .recipe-cols .recipe-col { flex: 0 0 auto; align-items: center; text-align: center; scroll-snap-align: center; }
}
