:root {
  --bg: #ffffff;
  --bg-card: #ececec;
  --ink: #111111;
  --ink-soft: #4a4a4a;
  --ink-muted: #8a8a8a;
  --line: #e6e6e6;
  --accent: #111111;
  --radius: 4px;
  --radius-media: 12px;
  --shadow-media: 0 1px 2px rgba(0, 0, 0, 0.04), 0 14px 34px -14px rgba(0, 0, 0, 0.16);
  --shadow-media-hover: 0 2px 4px rgba(0, 0, 0, 0.05), 0 26px 52px -16px rgba(0, 0, 0, 0.24);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Top navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 56px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}

/* Colorful animated squiggle standing in for the nav's bottom border —
   sits flush on the nav's own bottom edge (never overlapping its
   links/logo) and stays with it since .site-nav is sticky. */
.nav-squiggle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 8px;
  overflow: hidden;
  pointer-events: none;
  line-height: 0;
}
.nav-squiggle svg {
  display: block;
  width: 200%;
  height: 100%;
  animation: nav-squiggle-scroll 26s linear infinite;
}
@keyframes nav-squiggle-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-squiggle svg { animation: none; }
}
/* Logo mark — two overlapping "keycap" tiles, ctrl + home, linking to "/" */
.site-logo {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 42px;
  flex-shrink: 0;
}
.site-logo-key {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 700;
  transition: transform 220ms var(--ease);
}
.site-logo-key-back {
  top: 0;
  left: 0;
  width: 38px;
  height: 32px;
  background: #b9c79a;
  box-shadow: 0 3px 0 #9aa580;
  color: #333f22;
  font-size: 10px;
  letter-spacing: -0.01em;
  transform: rotate(-8deg);
}
.site-logo-key-front {
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  background: #111111;
  box-shadow: 0 3px 0 #000000;
  transform: rotate(5deg);
}
.site-logo-key-front svg { width: 16px; height: 16px; display: block; }
.site-logo:hover .site-logo-key-back { transform: rotate(-12deg) translateY(-2px); }
.site-logo:hover .site-logo-key-front { transform: rotate(8deg) translateY(-2px); }

/* Pill-group nav — a segmented track so the whole group reads as one
   cohesive shape rather than loose links, balancing against the logo. */
.site-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-card);
  padding: 5px;
  border-radius: 999px;
}
.site-nav-links a {
  position: relative;
  color: var(--ink-muted);
  padding: 8px 20px;
  border-radius: 999px;
  transition: color 200ms var(--ease), background 200ms var(--ease);
}
.site-nav-links a:hover { color: var(--ink); background: rgba(0, 0, 0, 0.05); }
/* Active section — solid pill instead of a plain label */
.site-nav-links a.active {
  color: #fff;
  font-weight: 600;
  background: var(--ink);
}
.site-nav-links a.active:hover { background: var(--ink); }

/* ---------- Statement hero (dot field + scroll ring) ---------- */
.statement-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 60px;
}
.statement-band {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
}
/* Design-tool "selection" chrome around the headline — echoes the Figma-style
   node board further down the page (see canvas.css), so the hero and the
   projects section read as one visual language instead of two ideas. */
.hero-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-guide {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 107, 61, 0.28);
}
.hero-frame-box {
  position: absolute;
  border: 1px solid rgba(255, 107, 61, 0.55);
  opacity: 0;
  transition: opacity 400ms var(--ease);
}
.hero-frame-box.is-ready { opacity: 1; }
.hero-handle {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #fff;
  border: 1.5px solid #ff6b3d;
  transform: translate(-50%, -50%);
}
.hero-handle-tl { top: 0; left: 0; }
.hero-handle-tr { top: 0; left: 100%; }
.hero-handle-bl { top: 100%; left: 0; }
.hero-handle-br { top: 100%; left: 100%; }
.hero-frame-label,
.hero-frame-dims {
  position: absolute;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.hero-frame-label {
  left: -1px;
  bottom: calc(100% + 6px);
  color: #fff;
  background: #ff6b3d;
  padding: 2px 6px;
  border-radius: 2px;
}
.hero-frame-dims {
  right: -1px;
  top: calc(100% + 6px);
  color: #ff6b3d;
}
@media (max-width: 820px) {
  .hero-frame-label, .hero-frame-dims { font-size: 9px; }
}

/* A copy of the site's custom cursor, choreographed by script.js to select,
   delete, and retype the second line — a small loop of an actual edit,
   rather than a decorative idle animation. Position (left/top) and
   transition-duration are both set from JS per move so the drag-select
   speed can match the highlight's own width transition. */
.hero-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  opacity: 0;
  transition-property: left, top, opacity;
  transition-timing-function: ease;
  transition-duration: 420ms;
  z-index: 3;
}
.hero-cursor.is-ready { opacity: 1; }
.hero-cursor svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}
.hero-cursor-pill {
  position: absolute;
  top: 14px;
  left: 18px;
  background: #b9c79a;
  color: #333f22;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 12px -2px rgba(185, 199, 154, 0.55);
}
/* Click ripple — plays briefly when the cursor "presses down" to start a drag-select. */
.hero-cursor::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 2px solid rgba(185, 199, 154, 0.9);
  opacity: 0;
  transform: scale(0.2);
}
.hero-cursor.is-clicking::after { animation: hero-cursor-click 380ms ease-out; }
@keyframes hero-cursor-click {
  0% { opacity: 0.9; transform: scale(0.2); }
  100% { opacity: 0; transform: scale(2.2); }
}
@media (max-width: 820px) {
  .hero-cursor { width: 17px; height: 17px; }
  .hero-cursor-pill { font-size: 10px; padding: 2px 8px; top: 11px; left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-cursor { display: none; }
}

/* Statement text sits on top of the field; pointer-events:none lets hover
   pass straight through to the dots underneath. The thick white text-stroke,
   painted before the fill (paint-order: stroke fill), keeps dots from
   visually touching the letterforms. Child spans inherit the stroke. */
.statement-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 0 24px;
  pointer-events: none;
  text-align: center;
  font-family: "Inter", sans-serif;
  font-size: 46px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  -webkit-text-stroke: 8px #fff;
  paint-order: stroke fill;
}
.statement-line2 {
  position: relative;
  display: inline-block;
}
/* Fixed to the width of the longer of the two phrases (measured once in JS)
   so the line never reflows the page while being "typed" — text grows from
   its own left edge instead of the whole block re-centering mid-animation. */
.statement-line2-inner {
  position: relative;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
}
.statement-selection {
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 0;
  background: rgba(255, 107, 61, 0.25);
  border-radius: 2px;
  z-index: 0;
  /* Only width/opacity animate — left is repositioned instantly in JS so the
     box grows from a fixed left edge instead of visibly sliding while it does. */
  transition-property: width, opacity;
  transition-timing-function: ease;
}
.statement-typed {
  position: relative;
  z-index: 1;
}
.statement-caret {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 2px;
  background: #ff6b3d;
  opacity: 0;
  z-index: 2;
}
.statement-caret.is-visible {
  opacity: 1;
  animation: statement-caret-blink 1s step-end infinite;
}
@keyframes statement-caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .statement-selection, .statement-caret { display: none; }
}

/* Custom cursor — skipped on case study pages (body.case-study-page) */
@media (pointer: fine) {
  body:not(.case-study-page),
  body:not(.case-study-page) * { cursor: none; }
}
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  z-index: 9999;
  pointer-events: none;
  transform: translate3d(-100px, -100px, 0);
  will-change: transform;
  transition: opacity 200ms var(--ease);
}
.custom-cursor.hidden { opacity: 0; }
.custom-cursor svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}
.custom-cursor-pill {
  position: absolute;
  top: 14px;
  left: 18px;
  background: #ff6b5b;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 12px -2px rgba(255, 107, 91, 0.45);
}

/* Push the work grid down beneath the hero */
.work { margin-top: 80px; }

@media (max-width: 820px) {
  .statement-hero { padding-top: 32px; }
  .statement-band { height: 280px; }
  .statement-text { font-size: 26px; gap: 2px; -webkit-text-stroke-width: 5px; }
  .work { margin-top: 32px; }
}
/* ---------- Main ---------- */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 56px 64px;
  min-width: 0;
}

/* ---------- Work grid ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 80px;
}
.card {
  display: block;
}
.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 400ms var(--ease);
}
.card:hover .card-media { transform: translateY(-3px); }
.card-title {
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

/* ---------- Placeholder card ---------- */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.placeholder-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---------- Mockups (CSS-only project visuals) ---------- */
.mock { position: relative; }

/* Desktop browser frame */
.mock-desktop {
  width: 78%;
  background: #fff;
  border-radius: 8px;
  box-shadow:
    0 1px 0 rgba(0,0,0,0.04),
    0 24px 50px -28px rgba(0,0,0,0.25),
    0 12px 24px -16px rgba(0,0,0,0.15);
  overflow: hidden;
}
.mock-bar {
  display: flex;
  gap: 5px;
  padding: 8px 10px;
  background: #f4f4f4;
  border-bottom: 1px solid #ececec;
}
.mock-bar span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #d8d8d8;
}
.mock-screen {
  aspect-ratio: 16 / 10;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mock-screen-1 {
  background: linear-gradient(180deg, #1a1a1a, #2a2a2a);
  color: #fff;
  justify-content: center;
  align-items: flex-start;
  padding: 28px;
}
.mock-headline {
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.mock-sub {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}
.mock-grid-row {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.mock-grid-row span {
  width: 32px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.3);
}
.mock-screen-3 {
  background: #fafaf7;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  padding: 22px;
}
.mock-product {
  width: 42%;
  aspect-ratio: 1 / 1.2;
  border-radius: 4px;
  background:
    radial-gradient(circle at 50% 35%, #e8d5a8 0%, #b8965d 70%, #8a6a3a 100%);
  box-shadow: 0 8px 16px -8px rgba(0,0,0,0.2);
}
.mock-product-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mock-line {
  height: 6px;
  width: 100%;
  background: #2a2a2a;
  border-radius: 3px;
}
.mock-line.short { width: 55%; background: #b8b8b8; }
.mock-pill {
  margin-top: 8px;
  padding: 6px 12px;
  background: #1a1a1a;
  color: #fff;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 999px;
  align-self: flex-start;
}

/* Phone frame */
.mock-phone {
  width: 50%;
  aspect-ratio: 9 / 19;
  background: #1a1a1a;
  border-radius: 28px;
  padding: 6px;
  box-shadow:
    0 24px 50px -28px rgba(0,0,0,0.35),
    0 12px 24px -16px rgba(0,0,0,0.2);
  position: relative;
}
.mock-phone.small { width: 40%; }
.mock-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 14px;
  background: #1a1a1a;
  border-radius: 999px;
  z-index: 2;
}
.mock-phone-screen {
  width: 100%;
  height: 100%;
  background: #fafaf7;
  border-radius: 22px;
  padding: 28px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mock-phone-screen.alt {
  background: linear-gradient(180deg, #fff, #f0ece4);
}
.mock-phone-title {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: #1a1a1a;
  margin-bottom: 6px;
}
.mock-phone-title.small { font-size: 11px; }
.mock-phone-entry {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ececec;
}
.mock-phone-date {
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a8a8a;
}
.mock-phone-line {
  height: 4px;
  width: 100%;
  background: #cfcfcf;
  border-radius: 2px;
}
.mock-phone-line.short { width: 60%; }

.mock-phone-pair {
  position: relative;
  width: 78%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mock-phone-pair .mock-phone {
  position: absolute;
  width: 42%;
}
.mock-phone-pair .mock-phone:first-child {
  left: 18%;
  top: 12%;
  transform: rotate(-6deg);
}
.mock-phone-pair .mock-phone.offset {
  right: 14%;
  bottom: 8%;
  transform: rotate(5deg);
}

/* Card background tints — one per case study */
.card-media-1 {
  background-color: #1d3da1;
  background-image: url("images/bottlecap-pattern.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.card-media-2 { background: #f4d8d4; } /* light pink */
.card-media-3 { background: #b9c79a; } /* moss green */
.card-media-4 { background: #e8c66f; } /* gold yellow */

/* ---------- 3D screen card ---------- */
.card-media-3d {
  perspective: 1400px;
  perspective-origin: 50% 60%;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* The grid-level hover (parent rule) translates the whole card-media — disable
   it for the 3D card so our inner device transform owns the motion. */
.card:hover .card-media-3d { transform: none; }

.device-stage {
  position: relative;
  width: 78%;
  transform-style: preserve-3d;
}
.device {
  position: relative;
  background: #1a1a1a;
  border-radius: 12px 12px 8px 8px;
  padding: 4px 4px 0;
  box-shadow:
    0 26px 50px -22px rgba(0, 0, 0, 0.45),
    0 12px 24px -16px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform-origin: center 60%;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(0);
  transition: transform 280ms var(--ease), box-shadow 600ms var(--ease);
  will-change: transform;
}
.device-bar {
  display: flex;
  gap: 5px;
  padding: 6px 8px;
}
.device-bar span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #555;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.device-screen {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  position: relative;
}
.device-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
/* Soft sheen across the screen for a "glassy" 3D feel */
.device-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0) 35%,
    rgba(255, 255, 255, 0) 65%,
    rgba(255, 255, 255, 0.06) 100%
  );
  pointer-events: none;
  transition: opacity 400ms var(--ease);
}
.device-shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -28px;
  height: 24px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35), transparent 70%);
  filter: blur(6px);
  transform: translateZ(-1px);
  transition: transform 600ms var(--ease), opacity 600ms var(--ease);
  opacity: 0.7;
}

.card:hover .device {
  transform: rotateX(8deg) rotateY(-12deg) translateY(-10px) scale(1.03);
  box-shadow:
    0 50px 80px -28px rgba(0, 0, 0, 0.5),
    0 22px 44px -22px rgba(0, 0, 0, 0.3);
}
.card:hover .device-screen::after { opacity: 0.6; }
.card:hover .device-shadow {
  opacity: 0.5;
  transform: translateZ(-1px) translateY(8px) scale(1.08);
}

/* Laptop (clamshell) */
.laptop {
  position: relative;
  width: 92%;
  margin: 0 auto;
  transform-origin: center 75%;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(0);
  transition: transform 280ms var(--ease);
  will-change: transform;
}
.laptop-screen {
  background: #1a1a1a;
  border-radius: 10px 10px 2px 2px;
  padding: 4px 4px 0;
  box-shadow:
    0 18px 36px -18px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.laptop-display {
  background: linear-gradient(160deg, #fafafa 0%, #ececec 100%);
  aspect-ratio: 16 / 10;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.laptop-display::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
    rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 35%,
    rgba(255,255,255,0) 65%, rgba(255,255,255,0.18) 100%);
  pointer-events: none;
}
.laptop-base {
  height: 12px;
  margin: 0 -7%;
  background: linear-gradient(180deg, #d4d4d4 0%, #9d9d9d 60%, #7a7a7a 100%);
  border-radius: 0 0 14px 14px;
  position: relative;
  box-shadow:
    0 14px 24px -12px rgba(0, 0, 0, 0.35);
}
.laptop-base::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  height: 4px;
  background: #6a6a6a;
  border-radius: 0 0 8px 8px;
}

/* Tablet (portrait) */
.tablet {
  position: relative;
  width: 56%;
  margin: 0 auto;
  background: #1a1a1a;
  border-radius: 18px;
  padding: 10px;
  aspect-ratio: 3 / 4;
  transform-origin: center 60%;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(0);
  transition: transform 280ms var(--ease);
  will-change: transform;
  box-shadow:
    0 26px 50px -22px rgba(0, 0, 0, 0.45),
    0 12px 24px -16px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.tablet-camera {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #333;
  z-index: 2;
}
.tablet-display {
  width: 100%;
  height: 100%;
  background: linear-gradient(170deg, #fafafa 0%, #ececec 100%);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.tablet-display::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
    rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 35%,
    rgba(255,255,255,0) 65%, rgba(255,255,255,0.15) 100%);
  pointer-events: none;
}

/* Phone (single, prominent) */
.phone {
  position: relative;
  width: 36%;
  margin: 0 auto;
  background: #1a1a1a;
  border-radius: 28px;
  padding: 6px;
  aspect-ratio: 9 / 19;
  transform-origin: center 55%;
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(0);
  transition: transform 280ms var(--ease);
  will-change: transform;
  box-shadow:
    0 26px 50px -22px rgba(0, 0, 0, 0.45),
    0 12px 24px -16px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 32%;
  height: 16px;
  background: #1a1a1a;
  border-radius: 999px;
  z-index: 2;
}
.phone-display {
  width: 100%;
  height: 100%;
  background: linear-gradient(170deg, #fafafa 0%, #ececec 100%);
  border-radius: 22px;
  position: relative;
  overflow: hidden;
}
.phone-display::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
    rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 35%,
    rgba(255,255,255,0) 65%, rgba(255,255,255,0.15) 100%);
  pointer-events: none;
}

/* Shared hover behavior */
.card:hover .laptop,
.card:hover .tablet,
.card:hover .phone {
  transform: rotateX(8deg) rotateY(-12deg) translateY(-10px) scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
  .device,
  .device-shadow,
  .device-screen::after,
  .laptop, .tablet, .phone { transition: none; }
  .card:hover .device,
  .card:hover .laptop,
  .card:hover .tablet,
  .card:hover .phone { transform: none; }
}

/* ---------- Sections (about) ---------- */
section { scroll-margin-top: 40px; }
.about {
  padding: 56px 0 0;
  max-width: 880px;
}
.about-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 56px;
  align-items: start;
  margin-bottom: 16px;
}
.about-portrait {
  display: block;
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
}
@media (max-width: 720px) {
  .about-header {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .about-portrait {
    max-width: 180px;
    margin: 0 auto;
  }
}
.section-label {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ff6b5b;
  margin-bottom: 18px;
}
.section-title {
  font-weight: 600;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  color: var(--ink);
}
.about p {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 18px;
  max-width: 56ch;
}
.about-block {
  margin-top: 56px;
}
.about-cta {
  margin-top: 28px;
}
.about-block .section-label,
.about-cta .section-label {
  margin-bottom: 14px;
}
.about-link {
  color: var(--ink);
  border-bottom: 1px solid #ff6b5b;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.about-link:hover { color: #ff6b5b; }
.about-social {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 24px;
}
.about-social-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-size: 15px;
  color: var(--ink);
  transition: color 200ms var(--ease);
}
.about-social-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.about-social-link:hover { color: #ff6b5b; }

/* ---------- Case study ---------- */
.case-study {
  padding-top: 80px;
  max-width: 1240px;
}
.case-header {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 80px;
  align-items: start;
  padding-bottom: 112px;
  border-bottom: 1px solid var(--line);
}
.case-title {
  font-size: clamp(48px, 6vw, 84px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 28px;
  color: var(--ink);
}
.case-title-brand img {
  display: block;
  width: clamp(280px, 34vw, 480px);
  height: auto;
}
/* Circular badge mark — the default wordmark width makes a square logo
   dominate the header, so cap it smaller. */
.case-title-brand img[src*="bottlecap-title"] {
  width: clamp(160px, 18vw, 220px);
}
.case-tagline {
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 36ch;
  margin: 0;
}
/* Live-prototype link under the tagline. Only some projects have one. */
.case-header-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-muted);
  padding-bottom: 2px;
  transition: border-color 0.18s ease, opacity 0.18s ease;
}
.case-header-link:hover { border-color: var(--ink); }
.case-header-link .arrow { font-size: 13px; }

.case-meta {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 12px;
}
.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.meta-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.meta-value {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

/* Section rows: title left, body right */
.case-row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 64px;
  padding: 96px 0;
  border-bottom: 1px solid var(--line);
}
.case-row:last-of-type { border-bottom: none; }
.case-row-title {
  font-size: clamp(19px, 1.7vw, 23px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
  position: sticky;
  top: 50vh;
  transform: translateY(-50%);
  align-self: start;
}
.case-row-title h2 {
  font-size: inherit;
  font-weight: inherit;
  margin: 6px 0 0;
  color: inherit;
}
.case-row-body {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-soft);
  min-width: 0;
}
.case-row-body p {
  margin: 0 0 24px;
  max-width: 66ch;
}
.case-row-body p:last-child { margin-bottom: 0; }

/* Phase rows */
.phase-eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}
.phase-block {
  margin-bottom: 48px;
}
.phase-block:last-child { margin-bottom: 0; }

/* Pull quote — research verbatims. Sits inside .case-row-body. */
.case-quote {
  margin: 56px 0;
  padding: 32px 0 32px 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 2px solid var(--ink);
  max-width: 60ch;
}
.case-quote p {
  font-size: 22px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 12px;
  max-width: none;
}
.case-quote cite {
  display: block;
  font-size: 13px;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
/* Pivot diagram — original brief vs. refocused brief, joined by an arrow */
.case-pivot {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 32px 0;
}
.case-pivot-box {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
}
.case-pivot-from { opacity: 0.55; }
.case-pivot-to {
  border-color: #ff6b3d;
  box-shadow: 0 0 0 1px #ff6b3d;
}
.case-pivot-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.case-pivot-to .case-pivot-label { color: #ff6b3d; }
.case-pivot-box p {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  max-width: none;
}
.case-pivot-arrow {
  flex: 0 0 auto;
  width: 60px;
  height: 24px;
}
.case-pivot-arrow svg { width: 100%; height: 100%; display: block; }
@media (max-width: 720px) {
  .case-pivot { flex-direction: column; align-items: stretch; }
  .case-pivot-arrow { align-self: center; transform: rotate(90deg); }
}

/* Media placeholders */
.case-media {
  margin: 64px 0 0;
}
.case-media-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
}
/* An empty board placeholder has no image to size to — give it a frame. */
div.case-media-board { aspect-ratio: 16 / 10; }

/* Shared frame for every media cell in a case study */
.case-media-tile,
.case-media-inline,
.case-media-scroller,
.case-media-board,
.case-hero-viewer {
  border: 1px solid var(--line);
  border-radius: var(--radius-media);
  box-shadow: var(--shadow-media);
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
}
.case-media-tile:hover,
.case-media-inline:hover,
.case-media-scroller:hover,
.case-media-board:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-media-hover);
}

/* Click-to-cycle hero viewer */
.case-hero {
  position: relative;
  margin: 112px 0 128px;
}
.case-hero-static img {
  display: block;
  width: 100%;
  aspect-ratio: 1856 / 598;
  object-fit: cover;
  border-radius: var(--radius-media);
  box-shadow: var(--shadow-media);
}
.case-hero + .case-row { padding-top: 96px; }
.case-video-link {
  margin: 16px 0 0;
}
.case-video-link p {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--ink-muted);
}
/* Carousel embedded inside a phase block, not at the top of the page */
.case-hero-inline {
  margin: 0 0 28px;
}
.case-hero-viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10; /* set by JS to match active image */
  background: transparent;
  border-radius: var(--radius-media);
  overflow: hidden;
  cursor: pointer;
  outline: none;
}
.case-hero-viewer:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}
.case-hero-viewer img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  opacity: 0;
  transition: opacity 320ms var(--ease);
  pointer-events: none;
}
.case-hero-viewer img.active { opacity: 1; }

/* Placeholder slide — stands in for an <img> until the artwork exists. */
.case-hero-viewer .hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  opacity: 0;
  transition: opacity 320ms var(--ease);
  pointer-events: none;
}
.case-hero-viewer .hero-slide.active { opacity: 1; }
.case-hero-viewer .hero-slide::before {
  content: attr(data-label);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
  padding: 0 24px;
}
/* Final-site screenshots include an OS menu strip — crop it from the top */
.case-hero-viewer img[src*="final-bottlecap"] {
  object-fit: cover;
  object-position: center bottom;
}

/* Prev / next nav arrows — minimal, outside the viewer, always visible */
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 8px;
  color: var(--ink);
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 200ms var(--ease), opacity 200ms var(--ease);
}
.hero-nav-prev { left: -40px; }
.hero-nav-next { right: -40px; }
.hero-nav svg { display: block; width: 26px; height: 26px; }
.hero-nav:hover { transform: translateY(-50%) scale(1.18); }
.hero-nav:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Progression indicator dots */
.case-hero-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}
.case-hero-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 200ms var(--ease), transform 200ms var(--ease);
}
.case-hero-dots .dot:hover { background: var(--ink-muted); }
.case-hero-dots .dot.active {
  background: var(--ink);
  transform: scale(1.25);
}
.case-media-tile,
.case-media-inline {
  background: var(--bg-card);
  border-radius: var(--radius-media);
  aspect-ratio: 4 / 3;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.case-media-grid .case-media-tile:first-child { aspect-ratio: 16 / 10; }
img.case-media-tile,
img.case-media-inline {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
/* Placeholder label only renders for non-img elements */
div.case-media-tile::before,
div.case-media-inline::before {
  content: attr(data-label);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
  padding: 0 16px;
}
.case-media-inline {
  margin: 0 0 36px;
  aspect-ratio: 16 / 9;
}
.case-media-tall { aspect-ratio: 16 / 22; margin-bottom: 36px; }
.case-media-split { aspect-ratio: 16 / 7; }

/* Auto-scrolling preview of a long page screenshot */
.case-media-scroller {
  aspect-ratio: 16 / 10;
  background: var(--bg-card);
  border-radius: var(--radius-media);
  overflow: hidden;
  margin: 0 0 36px;
  padding: 0;
}
.case-media-scroller img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 0%;
  animation: case-scroll-preview 10s ease-in-out infinite alternate;
}
@keyframes case-scroll-preview {
  from { object-position: 50% 0%; }
  to { object-position: 50% 100%; }
}
.case-media-scroller:hover img { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .case-media-scroller img { animation: none; }
}

/* FigJam-style board: show the full board, no cropping */
.case-media-board {
  aspect-ratio: auto;
  background: #f4f4f3;
  border-radius: var(--radius-media);
  overflow: hidden;
  margin: 0 0 36px;
  padding: 28px;
  display: block;
}
.case-media-board img,
video.case-media-board {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
/* Near-square capture — full width makes it too tall next to the wider boards */
video.case-media-board[src*="haunted-heist-preview"] {
  width: auto;
  max-width: 60%;
  margin: 0 auto;
}
.case-media-caption {
  grid-column: 1 / -1;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
  margin-top: 14px;
}

/* Stat grid — headline numbers pulled from research */
.case-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin: 40px 0 48px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.case-stats-3 { grid-template-columns: repeat(3, 1fr); }
.case-stats-5 { grid-template-columns: repeat(5, 1fr); }
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-number {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}
.stat-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.stat-item-plain {
  justify-content: center;
}
.stat-item-plain .stat-desc {
  font-size: 15px;
  color: var(--ink-soft);
}

/* Insight-to-feature handoff table */
.case-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 0;
  font-size: 16px;
}
.case-table th,
.case-table td {
  text-align: left;
  padding: 16px 24px 16px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.case-table th {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}
.case-table td {
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 34ch;
}
.case-table tr:last-child td { border-bottom: none; }

.case-footer-nav {
  padding: 64px 0 0;
  font-size: 14px;
}
.case-footer-nav a {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: opacity 200ms var(--ease);
}
.case-footer-nav a:hover { opacity: 0.6; }

@media (max-width: 1024px) {
  .case-header { gap: 48px; padding-bottom: 64px; }
  .case-row { gap: 48px; padding: 72px 0; }
  .case-media-grid { grid-template-columns: 1fr 1fr; }
  .case-media-grid .case-media-tile:first-child { grid-column: 1 / -1; }
  .case-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .case-study { padding-top: 24px; }
  .case-header,
  .case-row {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 48px 0;
  }
  .case-row-title { position: static; }
  .case-meta { padding-top: 0; }
  .case-media-grid { grid-template-columns: 1fr; }
  .case-stats { grid-template-columns: 1fr; gap: 24px; }
  .case-table { font-size: 15px; }
  .case-table td { max-width: none; }
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 120px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---------- Reveal animation (kept for script.js compatibility) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { scroll-behavior: auto !important; }
}
html { scroll-behavior: smooth; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .site-nav { padding: 16px 36px; }
  .main { padding: 40px 36px 48px; }
}
@media (max-width: 820px) {
  .site-nav { padding: 14px 24px; gap: 16px; }
  .site-nav-links a { padding: 7px 14px; }
  .main { padding: 24px 24px 48px; }
  .grid { grid-template-columns: 1fr; gap: 48px; }
}
