/* ==========================================================================
   Jan Paranič: Portfolio
   Tokens, base, components and page modules (see 06-Website-design-spec.md)
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, .1);
  --ph: #f2f2f4;
  --media-bg: #e9e9ec; /* behind images, so transparent PNG/WebP stand out from the page */
  --ph2: #ebebee;
  --chip: #f0f0f3;
  --accent: #c4570c;
  --on-accent: #ffffff;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --glow: rgba(0, 0, 0, .025);
  --gutter: clamp(24px, 6vw, 96px); /* subpage side padding */
  --measure: 720px;                 /* max line length for reading text */
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #000000;
  --card: #161617;
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --line: rgba(255, 255, 255, .14);
  --ph: #161617;
  --media-bg: #1e1e20;
  --ph2: #1c1c1e;
  --chip: #232325;
  --accent: #ff9f45;
  --on-accent: #1d1d1f;
  --glow: rgba(255, 255, 255, .05);
  color-scheme: dark;
}
/* Home uses a grey ground so white cards stand out */
body.home { --bg: #f5f5f7; --line: rgba(0, 0, 0, .08); --ph: #ececf0; --ph2: #e3e3e8; }
html[data-theme="dark"] body.home { --bg: #000000; --line: rgba(255, 255, 255, .1); --ph: #1f1f21; --ph2: #262628; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}
img { display: block; max-width: 100%; }
a { color: var(--accent); }
a:hover { color: var(--text); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p, blockquote, figure { margin: 0; }
svg { flex: none; }

.muted { color: var(--muted); }
.label { font-size: 14px; color: var(--muted); font-weight: 500; }
.overline { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

/* Striped image placeholder: replace with <img> when materials are ready */
.ph {
  background: repeating-linear-gradient(135deg, var(--ph) 0 14px, var(--ph2) 14px 28px);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px; font-weight: 500; text-align: center;
}
.media { width: 100%; border-radius: 16px; overflow: hidden; object-fit: cover; }
img.media { height: auto; }
img.media, img.cover, .pvideo, .compare { background-color: var(--media-bg); }
.r-16-9 { aspect-ratio: 16 / 9; }
.r-21-9 { aspect-ratio: 21 / 9; }
.r-4-3 { aspect-ratio: 4 / 3; }
.r-1-1 { aspect-ratio: 1 / 1; }

/* ---------- Buttons ---------- */
.btn {
  min-height: 48px; padding: 0 26px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 500; text-decoration: none;
  transition: opacity .2s, transform .2s var(--ease);
}
.btn:hover { opacity: .85; }
.btn:active { transform: scale(.97); }
.btn-primary, .btn-primary:hover { background: var(--text); color: var(--bg); }
.btn-accent, .btn-accent:hover { background: var(--accent); color: var(--on-accent); }
.btn-chip, .btn-chip:hover { background: var(--chip); color: var(--text); }
.btn-outline, .btn-outline:hover { border: 1px solid var(--line); color: var(--text); }

.theme-toggle {
  width: 44px; height: 44px; padding: 0; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
body.home .theme-toggle { background: var(--card); }
.theme-toggle .i-sun { display: none; }
html[data-theme="dark"] .theme-toggle .i-sun { display: block; }
html[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* Arrow button: circle with ↗, turns 45° to point right when its link is hovered */
.arrow {
  flex: none; width: 44px; height: 44px; border-radius: 999px;
  background: var(--chip); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .35s var(--ease);
}
.arrow svg { width: 16px; height: 16px; }
.arrow.lg { width: 64px; height: 64px; }
.arrow.lg svg { width: 24px; height: 24px; }
.arrow.sm { width: 28px; height: 28px; }
.arrow.sm svg { width: 12px; height: 12px; }
a:hover .arrow, a:focus-visible .arrow { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .arrow { transition: none; } }

.ext { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding: 20px 0;
}
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; font-size: 15px; }
.nav { color: var(--muted); text-decoration: none; transition: color .2s; }
.nav:hover, .nav[aria-current="page"] { color: var(--text); }
.back { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--text); }
.logo { font-size: 21px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--text); }
.nav-cta { min-height: 44px; padding: 0 20px; font-size: 15px; font-weight: 600; }

/* ==========================================================================
   Home: bento
   ========================================================================== */
.screen { height: 100vh; min-height: 640px; overflow: hidden; }
.home-wrap {
  height: 100%; max-width: 1980px; margin: 0 auto; padding: 0 24px 24px;
  display: flex; flex-direction: column;
}
.home .site-header { flex: none; padding: 16px 0; }

.bento {
  flex: 1; min-height: 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "p p c1 c1 c1 fw"
    "p p c1 c1 c1 fw"
    "s s c2 c2 c3 c3"
    "r r c4 c4 c5 c5";
}
.a-p { grid-area: p; } .a-s { grid-area: s; } .a-r { grid-area: r; } .a-fw { grid-area: fw; }
.a-c1 { grid-area: c1; } .a-c2 { grid-area: c2; } .a-c3 { grid-area: c3; } .a-c4 { grid-area: c4; } .a-c5 { grid-area: c5; }

.card {
  background: var(--card); border-radius: 24px; overflow: hidden;
  min-width: 0; min-height: 0;
}
a.card { color: inherit; text-decoration: none; transition: transform .35s var(--ease); }
a.card:hover { transform: scale(1.015); color: inherit; }
/* Card title turns accent on hover */
.card-t { transition: color .2s; }
a.card:hover .card-t, a.card:focus-visible .card-t { color: var(--accent); }

/* Dark cards keep light text in both themes */
a.card-profile, a.card-profile:hover { color: #f5f5f7; }
@media (prefers-reduced-motion: reduce) { a.card, a.card:hover { transition: none; transform: none; } }

.big-t { font-size: clamp(26px, 2.6vw, 36px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }

/* Profile */
.card-profile {
  position: relative; background: #000; padding: 24px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.card-profile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 32%; }
.card-profile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 55%);
}
.card-profile .profile-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; }
.card-profile .big-t { letter-spacing: -0.03em; line-height: 1.05; }
.card-profile .bio { font-size: 14px; color: #c7c7cc; line-height: 1.45; }
.card-profile .more { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.card-profile .chev { transition: transform .3s var(--ease-out); }
a.card-profile:hover .chev, a.card-profile:focus-visible .chev { transform: translateX(4px); }
.card-profile .profile-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 10px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.18); }
.card-profile .profile-stat { display: flex; align-items: flex-end; gap: 12px; min-width: 0; }
.card-profile .num { font-size: 44px; font-weight: 600; letter-spacing: -0.04em; line-height: .85; }
.card-profile .cap { font-size: 13px; color: #c7c7cc; line-height: 1.3; }

/* Featured */
.card-featured { display: flex; flex-direction: column; }
.card-featured .ph, .card-featured .cover { flex: 1; min-height: 0; font-size: 13px; }
.card-featured .cover { width: 100%; object-fit: cover; }
.card-featured .foot {
  flex: none; padding: 20px 24px 24px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
}
.card-featured .text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card-featured .desc { font-size: 15px; color: var(--muted); line-height: 1.4; }

/* Framer */
.card-framer { padding: 20px 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.card-framer .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-framer .site-t { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin-top: 4px; }
.card-framer ul { list-style: none; margin: 0; padding: 0; }
.card-framer li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.card-framer li b { font-size: 15px; font-weight: 600; }
.card-framer li span { font-size: 12px; color: var(--muted); }

/* Contact */
.card-contact { padding: 20px 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.card-contact .top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-contact h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.card-contact .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card-contact .actions .btn { flex: 1 1 120px; min-height: 44px; padding: 0 16px; font-size: 15px; font-weight: 600; }
.socials { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.soc { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; transition: color .2s; }
.soc-ic { width: 16px; height: 16px; flex: none; }
.soc:hover { color: var(--accent); }

/* Companies (logo carousel) */
.card-logos { padding: 20px 0; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.logos-t { padding: 0 24px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 50s linear infinite; }
.card-logos:hover .marquee-track { animation-play-state: paused; }
.logo-set { list-style: none; margin: 0; padding: 0 0 0 40px; display: flex; align-items: center; gap: 40px; }
.logo-item { flex: none; display: flex; align-items: center; height: 40px; color: var(--muted); }
.logo-item img { height: 28px; width: auto; max-width: 140px; object-fit: contain; filter: grayscale(1); opacity: .7; transition: opacity .2s; }
.logo-item img:hover { opacity: 1; }
.logo-ph { font-size: 22px; font-weight: 400; letter-spacing: -0.01em; white-space: nowrap; opacity: .55; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { animation: none; width: auto; }
  .logo-set { flex-wrap: wrap; gap: 12px 24px; padding: 0 24px; }
  .logo-set[aria-hidden] { display: none; }
  .card-profile .chev { transition: none; }
}

/* Small case study */
.card-sm { display: flex; }
.card-sm .text {
  flex: 1 1 50%; min-width: 0; padding: 18px 20px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
}
.card-sm .ph, .card-sm .cover { flex: 1 1 50%; min-width: 0; font-size: 12px; }
.card-sm .cover { object-fit: cover; height: 100%; }
.cs-m { font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-t { font-size: clamp(16px, 1.5vw, 20px); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-d { font-size: 13px; color: var(--muted); line-height: 1.35; margin-top: 4px; }

@media (max-width: 1024px) {
  .screen { height: auto; min-height: 100vh; overflow: visible; }
  .bento {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: 220px;
    grid-template-areas:
      "p p s s"
      "p p r r"
      "c1 c1 c1 c1"
      "c1 c1 c1 c1"
      "fw fw fw fw"
      "c2 c2 c3 c3"
      "c4 c4 c5 c5";
  }
}
@media (max-width: 640px) {
  .bento {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
    grid-template-areas: "p" "c1" "fw" "s" "r" "c2" "c3" "c4" "c5";
  }
  .a-p { min-height: 360px; }
  .a-c1 { min-height: 360px; }
  .a-s, .a-r { min-height: 170px; }
  .card-sm { min-height: 200px; }
}

/* ==========================================================================
   Inner pages: editorial
   ========================================================================== */
.page {
  max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter) 64px;
  display: flex; flex-direction: column; gap: 120px;
}
.sections { display: flex; flex-direction: column; gap: 120px; }
/* Keep reading text at a comfortable line length */
.sections p, .lead, .body, .statement, .quote, .intro-p, .h2, .h2-lg, .row-n .t, .job .what { max-width: var(--measure); }
.hero { display: flex; flex-direction: column; gap: 56px; margin-top: -64px; }
.hero-text { display: flex; flex-direction: column; gap: 24px; max-width: 980px; }
.h1 { font-size: 72px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.02; text-wrap: balance; }
.h2 { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; text-wrap: balance; }
.h2-lg { font-size: 44px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; }
.statement { font-size: 36px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.25; text-wrap: pretty; }
.lead { font-size: 28px; line-height: 1.4; letter-spacing: -0.015em; text-wrap: pretty; }
.intro-p { font-size: 20px; line-height: 1.55; color: var(--muted); }
.body { font-size: 18px; line-height: 1.65; color: var(--muted); }
.title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }

.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.stack-20 { display: flex; flex-direction: column; gap: 20px; }
.stack-24 { display: flex; flex-direction: column; gap: 24px; }
.stack-40 { display: flex; flex-direction: column; gap: 40px; }
.stack-56 { display: flex; flex-direction: column; gap: 56px; }

/* Section: label column + content */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; }
.two > .label { padding-top: 8px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.meta.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.cell { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.cell .k { font-size: 13px; color: var(--muted); }
.cell .v { font-size: 16px; line-height: 1.5; }
/* Availability badge */
.status { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 12px; border-radius: 999px; background: color-mix(in srgb, #22c55e 12%, transparent); color: var(--text); font-size: 15px; white-space: nowrap; }
.status-note { display: block; margin-top: 8px; color: var(--muted); font-size: 15px; }
.status-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex: none; }
.status-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #22c55e; animation: status-pulse 2s var(--ease-out, ease-out) infinite; }
@keyframes status-pulse { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(2.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .status-dot::after { animation: none; } }
.cell .d { font-size: 16px; line-height: 1.6; color: var(--muted); }

/* Numbered rows (outcomes, jobs, projects) */
.rows { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.row-n { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.row-n .n { font-size: 15px; color: var(--muted); }
.row-n .t { font-size: 20px; line-height: 1.45; }
.job { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.job .when { font-size: 15px; color: var(--muted); }
.job .what { display: flex; flex-direction: column; gap: 4px; }
.job .role { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.job .proj { font-size: 18px; font-weight: 600; }
.job .org { font-size: 15px; color: var(--muted); }
.job p { margin-top: 8px; font-size: 16px; line-height: 1.6; color: var(--muted); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 24px; padding: 24px 0; border-top: 1px solid var(--line); font-size: 16px; }
.kv:last-child { border-bottom: 1px solid var(--line); }
.kv .k { font-size: 14px; color: var(--muted); }

/* Testimonials */
.quote { font-size: 36px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.25; text-wrap: pretty; }
.ref { display: flex; flex-direction: column; gap: 20px; padding-top: 24px; border-top: 1px solid var(--line); }
.ref blockquote { font-size: 20px; line-height: 1.5; letter-spacing: -0.01em; }
.who { font-size: 15px; font-weight: 600; }
.who-role { font-size: 14px; color: var(--muted); }

/* Large link rows */
.big-link {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
  padding: 48px 0; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none;
}
.big-link .t { font-size: 48px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; transition: color .2s; }
.big-link:hover { color: inherit; }
.big-link:hover .t { color: var(--accent); }
.big-link.xl { flex-wrap: nowrap; padding: 32px 0; border-top: 1px solid var(--line); border-bottom: 0; }
.big-link.xl:last-child { border-bottom: 1px solid var(--line); }
.big-link.xl .t { font-size: 56px; font-weight: 500; line-height: 1.1; word-break: break-word; }

.soc-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 24px; align-items: center;
  padding: 28px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none;
}
.soc-row .t { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; transition: color .2s; }
.soc-row .handle { font-size: 16px; color: var(--muted); }
.soc-row:hover { color: inherit; }
.soc-row:hover .t { color: var(--accent); }

.end { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.cta-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-top: 48px; }
.cta-bar .t { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
.cta-bar.ruled { border-top: 1px solid var(--line); }

.intro { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: end; }
.intro img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: 16px; background: #000; }

.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding-top: 24px; margin-top: -48px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}

@media (max-width: 900px) {
  .two, .intro { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta.three, .cols3 { grid-template-columns: minmax(0, 1fr); }
  .cols2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .page, .sections { gap: 72px; }
  .h1 { font-size: 40px; }
  .h2, .h2-lg, .big-link .t, .statement { font-size: 28px; }
  .quote { font-size: 26px; }
  .lead { font-size: 22px; }
  .big-link.xl .t { font-size: 30px; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .row-n { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
  .job, .kv { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .soc-row { grid-template-columns: minmax(0, 1fr) 44px; gap: 4px 12px; }
  .soc-row .handle { grid-row: 2; }
  .arrow.lg { width: 48px; height: 48px; }
  .arrow.lg svg { width: 18px; height: 18px; }
}

/* ==========================================================================
   Motion: entrances, hover details, page transitions
   Everything here is off when the visitor prefers reduced motion
   (theme.js only adds .motion when motion is allowed).
   ========================================================================== */

/* Reveal on scroll. Selector list must match REVEAL in assets/js/motion.js */
.motion :is(
  .bento > .card, .hero-text > :not(.h1), .hero > .meta > *, .big-link,
  .intro > :not(img),
  .two > *, .rows > *, .cols2 > *, .cols3 > *, .pair > *,
  .sections > section:not(.hero) > .media, .end > *, .cta-bar, .site-footer, .process, .industries > *,
  .stats > *, .checklist > *, .tension > *
):not(.is-in) { opacity: 0; }
.motion :is(
  .bento > .card, .hero-text > :not(.h1), .hero > .meta > *, .big-link,
  .intro > :not(img),
  .two > *, .rows > *, .cols2 > *, .cols3 > *, .pair > *,
  .sections > section:not(.hero) > .media, .end > *, .cta-bar, .site-footer, .process, .industries > *,
  .stats > *, .checklist > *, .tension > *
).is-in { animation: var(--rv, rise) .9s var(--ease-out) var(--d, 0ms) backwards; }
.card { --rv: card-in; }
.media { --rv: media-in; }

@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes media-in {
  from { opacity: 0; transform: translateY(40px); clip-path: inset(6% 4% 0 4% round 16px); }
  to { clip-path: inset(0 round 16px); }
}

/* Page titles rise in word by word */
.h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding: .16em 0 .12em; margin: -.16em 0 -.12em; }
.h1 .w > span { display: inline-block; }
.motion .h1:not(.split) { opacity: 0; }
.motion .h1:not(.is-in) .w > span { transform: translateY(110%); }
.motion .h1.is-in .w > span { animation: word 1s var(--ease-out) calc(var(--i) * 45ms + 60ms) backwards; }
@keyframes word { from { transform: translateY(110%); } }

/* Header settles in on load */
.motion .site-header { animation: header-in .8s var(--ease-out) backwards; }
@keyframes header-in { from { opacity: 0; transform: translateY(-10px); } }

/* Cards: soft accent light follows the cursor, covers zoom gently */
.card { position: relative; }
@media (hover: hover) {
  a.card::before {
    content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
    border-radius: inherit; opacity: 0; transition: opacity .5s var(--ease-out);
    background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 70%);
  }
  a.card:hover::before { opacity: 1; }
}
a.card .ph, a.card .cover, .card-profile img { transition: transform 1.1s var(--ease-out); }
a.card:hover .ph, a.card:hover .cover, a.card-profile:hover img { transform: scale(1.04); }
.num { font-variant-numeric: tabular-nums; }

/* Nav underline slides in */
.site-nav .nav:not(.btn) {
  padding-bottom: 2px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: color .2s, background-size .45s var(--ease-out);
}
.site-nav .nav:not(.btn):hover, .site-nav .nav[aria-current="page"] { background-size: 100% 1px; }

.theme-toggle svg { transition: transform .6s var(--ease-out); }
.theme-toggle:hover svg { transform: rotate(30deg); }

/* Page transitions (Chrome, Edge, Safari 18.2+): cross-fade with lift,
   portrait and featured cover morph between pages */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out .28s cubic-bezier(.4, 0, 1, 1) both; }
  ::view-transition-new(root) { animation: vt-in .6s cubic-bezier(.16, 1, .3, 1) .08s both; }
  ::view-transition-group(portrait), ::view-transition-group(cover-featured) {
    animation-duration: .75s; animation-timing-function: cubic-bezier(.16, 1, .3, 1);
    overflow: hidden; border-radius: 16px;
  }
  ::view-transition-old(portrait), ::view-transition-new(portrait),
  ::view-transition-old(cover-featured), ::view-transition-new(cover-featured) { height: 100%; object-fit: cover; }
}
@keyframes vt-out { to { opacity: 0; transform: scale(.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(24px); } }
.card-profile img, .intro img { view-transition-name: portrait; }
.card-featured > :first-child, .hero-media { view-transition-name: cover-featured; }

/* Fallback page transition (other browsers) */
.page-fade body { animation: page-in .6s var(--ease-out) backwards; }
.page-fade.leaving body { opacity: 0; transform: translateY(-8px); transition: opacity .26s ease-in, transform .26s ease-in; }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  a.card .ph, a.card .cover, .card-profile img, .theme-toggle svg, .btn { transition: none; }
  a.card:hover .ph, a.card:hover .cover, a.card-profile:hover img { transform: none; }
}

/* ==========================================================================
   About: niche icons, process, highlights
   Icons: Tabler Icons (MIT), https://tabler.io/icons
   ========================================================================== */
.ti { width: 24px; height: 24px; flex: none; }
.ti-sm { width: 16px; height: 16px; }
.ti path { stroke-dasharray: 1; stroke-dashoffset: 0; }
@keyframes draw { from { stroke-dashoffset: 1; } }

.niche .cell { gap: 10px; padding-top: 20px; }
.niche .title { display: flex; align-items: center; gap: 10px; }
.ti-box {
  width: 48px; height: 48px; margin-bottom: 8px; border-radius: 14px;
  background: var(--chip); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: transform .5s var(--ease-out);
}
.niche-item:hover .ti-box { transform: translateY(-3px) rotate(-6deg); }

.motion .niche-item.is-in .ti path { animation: draw 1.2s var(--ease-out) calc(var(--d, 0ms) + 250ms) backwards; }

/* Process: a line draws across, steps light up one by one, then a soft pulse
   keeps moving through the steps */
.process-wrap { --soft: color-mix(in srgb, var(--text) 60%, transparent); display: flex; flex-direction: column; gap: 64px; }
.process {
  list-style: none; margin: 0; padding: 0; position: relative;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px;
}
.process::before, .process::after {
  content: ""; position: absolute; left: 24px; right: calc((100% - 128px) / 5 - 24px); top: 24px; height: 1px; background: var(--line);
}
.process::after { background: var(--soft); transform-origin: left center; }
.process { grid-template-rows: repeat(5, auto); row-gap: 10px; }
.step { position: relative; display: grid; grid-row: span 5; grid-template-rows: subgrid; align-content: start; }
.step-dot {
  position: relative; z-index: 1; width: 48px; height: 48px; margin-bottom: 14px;
  border-radius: 999px; border: 1px solid var(--soft); background: var(--bg); color: var(--soft);
  display: flex; align-items: center; justify-content: center;
}
.step-dot::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  border: 1px solid var(--soft); opacity: 0; pointer-events: none;
}
.step-n { font-size: 13px; color: var(--muted); }
.step-t { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.step-d { font-size: 15px; line-height: 1.55; color: var(--muted); }
.step-ai {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 4px; padding-top: 12px;
  border-top: 1px solid var(--line); font-size: 15px; line-height: 1.55; color: var(--muted);
}
.step-ai .ti { margin-top: 3px; }

.motion .process:not(.is-in)::after { transform: scaleX(0); }
.motion .process.is-in::after { transition: transform 2.4s var(--ease-out) .2s; }
.motion .process:not(.is-in) .step { opacity: 0; transform: translateY(16px); }
.motion .process.is-in .step {
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  transition-delay: calc(var(--s) * 380ms + 250ms);
}
.motion .process:not(.is-in) .step-dot { border-color: var(--line); color: var(--text); }
.motion .process.is-in .step-dot {
  transition: border-color .5s, color .5s;
  transition-delay: calc(var(--s) * 380ms + 450ms);
}
.motion .process.is-in .step-dot .ti path { animation: draw 1.2s var(--ease-out) calc(var(--s) * 380ms + 450ms) backwards; }
.motion .process.is-in .step-dot::after { animation: ping 6s var(--ease-out) calc(var(--s) * 600ms + 2.8s) infinite; }
@keyframes ping {
  0% { opacity: .7; transform: scale(1); }
  25%, 100% { opacity: 0; transform: scale(1.6); }
}

@media (max-width: 900px) {
  .process { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 40px; }
  .step { display: flex; flex-direction: column; gap: 10px; grid-row: auto; padding-left: 72px; }
  .step-dot { position: absolute; left: 0; top: 0; margin: 0; }
  .process::before, .process::after { left: 24px; right: auto; top: 24px; bottom: 24px; width: 1px; height: auto; }
  .process::after { transform-origin: center top; }
  .motion .process:not(.is-in)::after { transform: scaleY(0); }
  .step-n { padding-top: 4px; }
}

/* Industries: chips */
.industries { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.chip-ind {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px 0 18px;
  border-radius: 999px; background: var(--chip); font-size: 17px; font-weight: 500;
}
.chip-ind .ti { width: 20px; height: 20px; color: var(--muted); }
.chip-ind.is-next { background: transparent; border: 1px dashed var(--muted); }
.chip-note { margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.motion .chip-ind.is-in .ti path { animation: draw 1.1s var(--ease-out) calc(var(--d, 0ms) + 200ms) backwards; }

/* References: equal-height cards, full text in a dialog */
.kind { display: flex; flex-direction: column; gap: 72px; }
.refs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 40px; }
.refs .ref blockquote { flex: 1; }
.ref-open {
  align-self: flex-start; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--muted);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line);
  transition: color .2s, text-decoration-color .2s;
}
.ref-open:hover { color: var(--text); text-decoration-color: currentColor; }
.ref-dialog {
  width: min(640px, calc(100vw - 32px)); max-height: min(82vh, 760px); padding: 40px;
  border: 1px solid var(--line); border-radius: 24px; background: var(--card); color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .25); overscroll-behavior: contain;
}
.ref-dialog::backdrop { background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); }
.ref-dialog[open] { animation: dlg-in .5s var(--ease-out); }
.ref-dialog[open]::backdrop { animation: fade-in .4s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
.dlg-close {
  position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 999px; background: var(--chip); color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.dlg-close svg { width: 18px; height: 18px; }
.dlg-who { padding-right: 56px; margin-bottom: 24px; }
.ref-full { display: flex; flex-direction: column; gap: 14px; font-size: 17px; line-height: 1.6; }
.ref-full ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.ref-full p { margin: 0; }

@media (max-width: 1100px) { .refs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .refs { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .ref-dialog { padding: 28px 24px; }
  .chip-ind { font-size: 15px; min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) { .ref-dialog[open], .ref-dialog[open]::backdrop { animation: none; } }

/* Rotating greeting in the About title */
.greet {
  display: inline-block; position: relative; vertical-align: top; white-space: nowrap;
  overflow: hidden; padding: .16em 0 .12em; margin: -.16em 0 -.12em;
  transition: width .7s var(--ease-out);
}
.greet-word { display: inline-block; color: var(--muted); }
.greet-word:not(.is-settled):not(:only-child) {
  transition: transform .75s var(--ease-out), opacity .6s var(--ease-out), filter .6s var(--ease-out);
}
.greet-word.is-entering, .greet .greet-word + .greet-word { position: absolute; left: 0; top: .16em; }
.greet-word.is-settled { position: static; }
.greet-word.is-entering { transform: translateY(70%); opacity: 0; filter: blur(6px); }
.greet-word.is-leaving { transform: translateY(-70%); opacity: 0; filter: blur(6px); }

/* Contact: billing details */
.billing .v a { color: inherit; text-decoration: none; }
.billing .v a:hover { color: var(--accent); }

/* About: experience anchor and project links */
#experience { scroll-margin-top: 32px; }
.proj-link { color: inherit; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }
.proj-link:hover { color: var(--accent); text-decoration-color: currentColor; }

/* Case study: what changed, the real problem, constraints */
h2.label { margin: 0; font-size: 14px; font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
.stat-item { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.stat-n { font-size: 48px; font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
.stat-item p { font-size: 16px; line-height: 1.55; color: var(--muted); max-width: 38ch; }
.tension { display: flex; flex-direction: column; gap: 32px; padding: 72px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tension-t { font-size: 36px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.3; text-wrap: pretty; max-width: 28ch; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-bottom: 1px solid var(--line); max-width: var(--measure); }
.checklist li { position: relative; padding: 18px 0 18px 32px; border-top: 1px solid var(--line); font-size: 18px; line-height: 1.5; }
.checklist li::before { content: ""; position: absolute; left: 4px; top: 29px; width: 8px; height: 8px; border-radius: 999px; background: var(--muted); }
.cs-end-note { padding: 32px 0; font-size: 15px; color: var(--muted); }
@media (max-width: 640px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat-n { font-size: 36px; }
  .tension { padding: 48px 0; }
  .tension-t { font-size: 26px; }
}

/* Case studies: problem and solution, phone screens */
.ps .v { font-size: 17px; line-height: 1.6; }
.r-phone { aspect-ratio: 9 / 19.5; }
.phones { max-width: 900px; }
.row-n .t strong { font-weight: 600; }

/* Embedded motion clips (HTML animations shown like a video) */
.r-16-10 { aspect-ratio: 16 / 10; }
.clip-frame { position: relative; background: #E6E8EC; }
.clip-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

/* Password-protected case study */
.lock-note { display: flex; align-items: center; gap: 6px; }
.lock-ic { width: 13px; height: 13px; flex: none; }
.locked { max-width: 560px; display: flex; flex-direction: column; gap: 24px; padding: 24px 0 64px; }
.locked .lock-badge { width: 56px; height: 56px; border-radius: 16px; background: var(--chip); display: flex; align-items: center; justify-content: center; }
.locked .lock-badge svg { width: 24px; height: 24px; }
.unlock-form { display: flex; flex-direction: column; gap: 10px; }
.unlock-form label { font-size: 14px; font-weight: 500; color: var(--muted); }
.unlock-row { display: flex; flex-wrap: wrap; gap: 12px; }
.unlock-row input {
  flex: 1 1 240px; min-height: 48px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 16px;
}
.unlock-row input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.unlock-row .btn { border: 0; cursor: pointer; font: inherit; font-size: 16px; font-weight: 500; }
.unlock-error { min-height: 22px; font-size: 15px; color: var(--accent); }
.unlock-remember { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }

/* Before / after comparison slider */
.compare { position: relative; display: block; background: var(--media-bg); user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-tag { position: absolute; top: 20px; z-index: 2; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; transition: opacity .3s; }
.compare-tag.before { left: 20px; background: rgba(0,0,0,.6); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.compare-tag.after { right: 20px; background: rgba(255,255,255,.85); color: #111; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.compare-line { position: absolute; top: 0; bottom: 0; left: var(--pos); z-index: 2; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 12px rgba(0,0,0,.25); pointer-events: none; }
.compare-knob { position: absolute; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: #fff; color: #111; box-shadow: 0 0 0 4px var(--accent), 0 8px 24px rgba(0,0,0,.25); display: grid; place-items: center; transition: transform .25s var(--ease-out); }
.compare-knob svg { width: 22px; height: 22px; }
.compare:hover .compare-knob, .compare.dragging .compare-knob, .compare-range:focus-visible ~ .compare-line .compare-knob { transform: scale(1.08); }
.compare { cursor: ew-resize; }
.compare.dragging, .compare.dragging * { cursor: grabbing; }
/* Kept for keyboard and screen readers; dragging is handled in motion.js */
.compare-range { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; opacity: 0; }
.compare:has(.compare-range:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 640px) {
  .compare-tag { top: 12px; padding: 6px 12px; font-size: 11px; }
  .compare-tag.before { left: 12px; } .compare-tag.after { right: 12px; }
  .compare-knob { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
}
@media (prefers-reduced-motion: reduce) { .compare-knob { transition: none; } }

/* Product video: 16:10 box, poster first, plays only in view (motion.js) */
.pvideo { position: relative; margin: 0; background: var(--media-bg); }
.pvideo video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pvideo-btn { position: absolute; right: 16px; bottom: 16px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff; background: rgba(0,0,0,.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity .25s, transform .25s var(--ease-out), background .2s; }
.pvideo-btn svg { width: 18px; height: 18px; }
.pvideo:hover .pvideo-btn, .pvideo-btn:focus-visible, .pvideo:not(.is-playing) .pvideo-btn { opacity: 1; }
.pvideo-btn:hover { background: rgba(0,0,0,.65); }
.pvideo-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pvideo .i-play, .pvideo.is-playing .i-pause { display: block; }
.pvideo .i-pause, .pvideo.is-playing .i-play { display: none; }
/* Reduce Motion: poster with a large play button until the visitor starts it */
.pvideo.wait-play .pvideo-btn { right: 50%; bottom: 50%; transform: translate(50%, 50%); width: 72px; height: 72px; background: rgba(255,255,255,.92); color: #111; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.pvideo.wait-play .pvideo-btn svg { width: 28px; height: 28px; }

/* Overflowing screen carousel: starts at the content edge, bleeds to the window edge */
html { overflow-x: clip; }
.carousel { --edge: max(var(--gutter), calc(50vw - 720px + var(--gutter))); }
.carousel-head { align-items: center; }
.carousel-nav { display: flex; gap: 8px; justify-content: flex-end; }
.carousel-nav .arrow { border: 0; cursor: pointer; transition: background .2s, opacity .2s, transform .2s var(--ease-out); }
.carousel-nav .arrow:hover:not(:disabled) { background: var(--accent); color: #fff; }
.carousel-nav .arrow:active:not(:disabled) { transform: scale(.94); }
.carousel-nav .arrow:disabled { opacity: .35; cursor: default; }
.carousel-nav .arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.carousel-track {
  list-style: none; margin: 0 calc(50% - 50vw); padding: 4px var(--edge) 8px;
  display: flex; gap: 20px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--edge); scroll-behavior: smooth;
  scrollbar-width: none; cursor: grab;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.carousel-track.dragging * { pointer-events: none; }
.carousel-track:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.carousel-item { flex: none; width: clamp(200px, 21vw, 290px); scroll-snap-align: start; }
.carousel-item .media { border-radius: 28px; aspect-ratio: 390 / 844; width: 100%; height: auto; object-fit: cover; user-select: none; -webkit-user-drag: none; }
@media (max-width: 640px) { .carousel-item { width: 62vw; } .carousel-track { gap: 14px; } }
@media (prefers-reduced-motion: reduce) { .carousel-track { scroll-behavior: auto; } }

/* Screen-reader-only text */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Process flow: animated Double Diamond. Black and white, follows the theme, accent only at the end */
.flow { position: relative; margin: 0; color: var(--text); }
.flow-svg { display: block; width: 100%; height: auto; overflow: visible; }
.flow-svg text { font-family: inherit; text-anchor: middle; }
.flow-phases text { font-size: 17px; font-weight: 600; fill: var(--text); }
.flow-tags text { font-size: 13px; fill: var(--muted); font-weight: 500; }
.flow-diamond { fill: url(#flow-fill); stroke: url(#flow-stroke); stroke-width: 1.25; }
.flow-lanes path { fill: none; stroke: var(--text); stroke-width: 1; stroke-opacity: .07; stroke-dasharray: 2 6; }
.flow-dots circle { fill: var(--text); }
.flow-node { fill: var(--bg); stroke: var(--text); stroke-width: 1.5; }
.flow-node.core { fill: var(--text); stroke: var(--text); }
.flow-node.end { fill: var(--accent); stroke: var(--accent); }
.flow-pop { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.flow-tags text.end { fill: var(--text); }
.flow-ring { fill: none; stroke: var(--text); stroke-opacity: .25; stroke-width: 1; transform-origin: 460px 160px; animation: flow-ring 4s var(--ease-out) infinite; }
@keyframes flow-ring { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.flow.is-paused .flow-ring { animation-play-state: paused; }
.flow-steps { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.flow-steps > li { padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--glow); transition: border-color .5s, background-color .5s; }
.flow-steps > li.is-on { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.flow-k { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); transition: color .5s; }
.flow-steps > li.is-on .flow-k { color: var(--accent); }
.flow-t { margin-top: 6px; font-size: 16px; font-weight: 600; }
.flow-steps ul { margin: 10px 0 0; padding: 0 0 0 16px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.flow-steps ul li + li { margin-top: 4px; }
.flow-btn { position: absolute; right: 0; top: 0; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text); background: var(--chip); transition: background .2s; }
.flow-btn:hover { background: var(--line); }
.flow-btn svg { width: 18px; height: 18px; }
.flow .i-play, .flow.is-paused .i-pause { display: none; }
.flow.is-paused .i-play { display: block; }
@media (max-width: 900px) { .flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .flow { padding-top: 48px; }
  .flow-phases text { font-size: 22px; }
  .flow-tags text { font-size: 18px; }
  .flow-steps { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { .flow-ring { animation: none; } .flow-steps > li { transition: none; } }

/* Before/after slider with placeholders instead of images */
.compare > .ph { position: absolute; inset: 0; pointer-events: none; }
.compare > .ph.compare-before { background: var(--ph2); justify-content: flex-start; padding-left: 10%; }
.compare > .ph.compare-after { justify-content: flex-end; padding-right: 10%; }

/* Framer: linked website screenshots */
.shot { display: block; background: var(--media-bg); }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease-out); }
.shot:hover img { transform: scale(1.02); }
@media (prefers-reduced-motion: reduce) { .shot img { transition: none; } .shot:hover img { transform: none; } }
