/* Ewida portfolio — layout follows SnowUI (shell 212 / 68 / 28 / 280), look follows the Ewida brand v1.1 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }

body { min-height: 100vh; }

.mono { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--pebble); font-weight: 500; font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.muted { color: var(--pebble); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 16px; border-radius: var(--radius-sm); z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- App shell (SnowUI) ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: var(--border); padding: 20px 16px; display: flex; flex-direction: column; gap: 24px; background: var(--paper); }
.profile { display: flex; align-items: center; gap: 8px; padding: 4px 8px; font-size: 14px; color: var(--ink); font-weight: 500; }
.monogram { width: 24px; height: 24px; border-radius: var(--radius-sm); background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--font-serif); font-style: italic; font-size: 16px; line-height: 1; flex: none; }
.profile small { display: block; font-size: 12px; color: var(--pebble); font-weight: 400; line-height: 16px; }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-group > .label { font-size: 12px; color: var(--pebble); padding: 4px 12px; }
.nav-item { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14px; line-height: 20px; color: var(--slate); transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.nav-item:hover { background: var(--linen); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--bone); color: var(--ink); font-weight: 500; }
.nav-item .dot { width: 8px; height: 8px; border-radius: var(--radius-xs); flex: none; border: 1px solid var(--stone); }
.sidebar .foot { margin-top: auto; padding: 8px 12px; }
.wordmark { font-weight: 500; font-size: 20px; letter-spacing: -.035em; color: var(--ink); line-height: 1; }
.wordmark .dot-accent { color: var(--accent); }

.frame { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 28px; border-bottom: var(--border); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--pebble); min-width: 0; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--stone); }
.topbar .actions { display: flex; align-items: center; gap: 16px; }
.brand-sm { display: none; }
.menu-btn { display: none; font-size: 14px; color: var(--ink); padding: 8px 12px; border: 1px solid var(--stone); border-radius: var(--radius-sm); min-height: 36px; }

.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--slate); white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--available); box-shadow: 0 0 0 4px #E2EBDC; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--rail-w); flex: 1; }
.content { padding: var(--content-padding); min-width: 0; max-width: 1080px; width: 100%; }
.rail { padding: 20px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
.layout { position: relative; }
.layout:has(.rail)::after { content: ""; position: absolute; top: 0; bottom: 0; right: var(--rail-w); width: 1px; background: var(--linen); }
.rail h2 { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 20px; margin-bottom: 8px; }
.rail-row { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; font-size: 14px; line-height: 20px; color: var(--ink); }
.rail-row .sw { width: 24px; height: 24px; border-radius: var(--radius-sm); flex: none; }
.rail-row small { display: block; font-size: 12px; line-height: 16px; color: var(--pebble); }
.rail-row:hover .t { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.rail p { font-size: 14px; color: var(--slate); line-height: 20px; }

.site-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 28px; border-top: var(--border); font-size: 12px; color: var(--pebble); }
.site-foot nav { display: flex; gap: 16px; }
.site-foot a:hover { color: var(--ink); }

/* ---------- Buttons, links, tags ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: var(--radius-pill); font-size: 15px; font-weight: 500; border: 1px solid transparent; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); white-space: nowrap; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #34322E; }
.btn-secondary { border-color: var(--stone); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-sm { height: 32px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 14px; }
.link { color: var(--ink); border-bottom: 1px solid var(--stone); transition: border-color var(--dur-fast) var(--ease); }
.link:hover { border-color: var(--accent); }
.tag { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--radius-pill); background: var(--bone); border: var(--border); font-size: 13px; color: var(--slate); white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Editorial type ---------- */
.display { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--tr-display); font-weight: 500; color: var(--ink); }
.h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: var(--tr-h1); font-weight: 500; color: var(--ink); }
.h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--tr-h2); font-weight: 500; color: var(--ink); }
.h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--tr-h3); font-weight: 500; color: var(--ink); }
.lede { font-size: var(--fs-body-l); line-height: var(--lh-body); color: var(--slate); max-width: var(--max-text); }
.prose { max-width: var(--max-text); }
.prose p + p { margin-top: 16px; }
.prose p { color: var(--slate); }

/* ---------- Home ---------- */
.hero { padding: 80px 0 64px; display: flex; flex-direction: column; gap: 28px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 28px 48px; border-top: var(--border); padding-top: 20px; margin-top: 12px; }
.hero .meta div { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink); }

.section { padding: 48px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head .h2 { margin-top: 8px; }

.toolbar { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; border-bottom: var(--border); margin-bottom: 28px; }
.tabs { display: flex; gap: 20px; }
.tab { font-size: 14px; color: var(--pebble); padding: 8px 0 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 4px; align-items: baseline; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"], .tab[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
.tab .count { font-family: var(--font-mono); font-size: 12px; color: var(--pebble); }
.toolbar .views { margin-left: auto; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--card-gap); }

.card { display: flex; flex-direction: column; gap: 16px; }
.card[hidden], .grid[hidden] { display: none; }
.media { aspect-ratio: 4 / 3; border-radius: var(--radius-lg); overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative; }
.media.desk img { width: 78%; border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); transition: transform var(--dur-base) var(--ease); }
.media.phones { gap: 12px; }
.media.phones img { width: 26%; border-radius: var(--radius-md); box-shadow: var(--shadow-lift); transition: transform var(--dur-base) var(--ease); }
.media.phones img:nth-child(2) { transform: translateY(-16px); }
.card:hover .media img { transform: scale(1.02); }
.card:hover .media.phones img:nth-child(2) { transform: translateY(-16px) scale(1.02); }
.card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.card h3 { font-size: 18px; line-height: 28px; font-weight: 500; color: var(--ink); }
.card p { font-size: 14px; line-height: 20px; color: var(--slate); }
.card:focus-visible { outline-offset: 8px; border-radius: var(--radius-lg); }

.tint-sage { background: var(--sage); } .tint-sky { background: var(--sky); }
.tint-butter { background: var(--butter); } .tint-blush { background: var(--blush); }

.index { width: 100%; border-collapse: collapse; font-size: 14px; }
.index th { text-align: left; font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--pebble); padding: 12px 16px 12px 0; border-bottom: var(--border); }
.index td { padding: 16px 16px 16px 0; border-bottom: var(--border); color: var(--pebble); vertical-align: top; }
.index td:first-child a { color: var(--ink); font-weight: 500; }
.index tr:hover td:first-child a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }

.approach li { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 20px 0; border-top: var(--border); }
.approach li:last-child { border-bottom: var(--border); }
.approach b { font-weight: 500; color: var(--ink); }
.approach p { color: var(--slate); }

.closing { padding: 96px 0 48px; display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }

/* ---------- Case study ---------- */
.case-head { padding: 64px 0 40px; display: flex; flex-direction: column; gap: 24px; }
.panel { background: var(--bone); border-radius: var(--radius-lg); padding: var(--card-padding); }
.panel h2 { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); margin-bottom: 16px; }
.details { display: grid; grid-template-columns: 160px 1fr; gap: 12px 24px; font-size: 14px; line-height: 20px; }
.details dt { font-size: 12px; color: var(--pebble); line-height: 20px; }
.details dd { color: var(--ink); }

.figure { border-radius: var(--radius-lg); padding: 40px; display: flex; justify-content: center; }
.figure img.shot { border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); }
.figure.scroll { padding: 28px; }
.figure.scroll .viewport { max-height: 720px; overflow: auto; border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); width: 100%; background: var(--paper); }
.figure.scroll .viewport img { width: 100%; }
.figure.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 28px; }
.figure.pair .viewport { max-height: 640px; }
.figure.embed { flex-direction: column; align-items: flex-start; gap: 16px; padding: 28px; }
.figure.embed .embed-frame { width: 100%; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-lift); background: var(--paper); }
.figure.embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.phones-row { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.phones-row img { width: 200px; border-radius: var(--radius-md); box-shadow: var(--shadow-lift); }
.strip { display: flex; gap: 20px; overflow-x: auto; padding: 28px; border-radius: var(--radius-lg); scroll-snap-type: x proximity; }
.strip img { width: 200px; flex: none; border-radius: var(--radius-md); box-shadow: var(--shadow-lift); scroll-snap-align: start; }
.caption { font-size: 13px; color: var(--pebble); margin-top: 12px; }

.chapter { padding: 48px 0; display: flex; flex-direction: column; gap: 28px; }
.chapter + .chapter { border-top: var(--border); }
.chapter .num { margin-bottom: 8px; }

.next { margin: 48px 0 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: var(--card-padding); border-radius: var(--radius-lg); background: var(--bone); }
.next .h3 { margin-top: 4px; }

/* ---------- About ---------- */
.profile-card { display: flex; flex-direction: column; gap: 20px; }
.profile-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.profile-card .info { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--pebble); }
.avatar { width: 64px; height: 64px; border-radius: 18px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--font-serif); font-style: italic; font-size: 36px; line-height: 1; flex: none; }
.stack { display: flex; flex-direction: column; gap: var(--card-gap); }
.rows li { display: grid; grid-template-columns: 160px 1fr; gap: 24px; padding: 16px 0; border-top: var(--border); font-size: 14px; }
.rows li:first-child { border-top: 0; padding-top: 0; }
.rows b { font-weight: 500; color: var(--ink); display: block; }
.rows span { color: var(--pebble); }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Mobile sheet ---------- */
.sheet { position: fixed; inset: 0; background: var(--paper); z-index: 40; padding: 20px; display: none; flex-direction: column; gap: 28px; overflow-y: auto; }
.sheet.open { display: flex; }
.sheet .top { display: flex; justify-content: space-between; align-items: center; }
.sheet nav a { display: block; font-size: 36px; line-height: 1.15; letter-spacing: -.02em; font-weight: 500; color: var(--ink); padding: 8px 0; }
.sheet nav a[aria-current="page"] { color: var(--pebble); }
.sheet .group + .group { margin-top: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .layout:has(.rail)::after { display: none; }
}
@media (max-width: 959px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .menu-btn { display: inline-flex; align-items: center; }
  .brand-sm { display: inline-block; }
  .topbar { padding: 16px 20px; }
  .topbar .status { display: none; }
  .content { padding: 20px; }
  .display { font-size: 64px; }
  .h1 { font-size: 44px; }
  .approach li, .rows li { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 639px) {
  .content { padding: 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .display { font-size: 48px; }
  .h1 { font-size: 36px; }
  .h2 { font-size: 28px; }
  .hero { padding: 48px 0 40px; }
  .figure { padding: 16px; }
  .figure.pair { grid-template-columns: 1fr; }
  .figure.embed { padding: 16px; }
  .figure.embed .embed-frame { aspect-ratio: 4 / 3; }
  .phones-row img { width: 44%; }
  .details { grid-template-columns: 1fr; gap: 4px; }
  .details dd { margin-bottom: 12px; }
  .crumbs { display: none; }
  .topbar .actions .btn-sm { display: none; }
  .site-foot { padding: 20px 16px; }
  .next { flex-direction: column; align-items: flex-start; }
}

/* ---------- Outcomes (SnowUI metric tiles, real results only) ---------- */
.outcomes { padding: 28px 0 0; }
.outcomes h2 { margin-bottom: 16px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric { border-radius: var(--radius-md); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.metric span { font-size: 14px; line-height: 20px; color: var(--slate); }
.metric strong { font-size: 24px; line-height: 32px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.rows .org { display: block; color: var(--pebble); }
.rows .desc { display: block; color: var(--slate); margin-top: 4px; }
@media (max-width: 959px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.table-wrap { overflow-x: auto; }
.ds-table td:first-child { color: var(--ink); font-weight: 500; white-space: nowrap; }
.ds-table td:nth-child(3), .ds-table td:nth-child(4) { white-space: nowrap; }
.ds-table tfoot td { color: var(--ink); font-weight: 500; border-bottom: 0; }

/* ---------- Illustrated flows, ownership, effort map ---------- */
.figure.flow { padding: 28px; display: block; }
.figure.flow svg { width: 100%; height: auto; display: block; }
.owned { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; max-width: 880px; }
.owned li { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; border-top: var(--border); font-size: 15px; color: var(--ink); }
.phases { list-style: none; counter-reset: none; display: flex; flex-direction: column; position: relative; max-width: 880px; }
.phases li { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 4px 24px; padding: 0 0 28px 28px; }
.phases li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.phases li::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 1px; background: var(--stone); }
.phases li:last-child::after { display: none; }
.phases li .mono { grid-row: span 3; padding-top: 2px; }
.phases b { font-weight: 500; color: var(--ink); font-size: 18px; line-height: 28px; }
.phases p { color: var(--slate); font-size: 15px; }
.phases .out { justify-self: start; margin-top: 8px; font-size: 13px; color: var(--slate); background: var(--bone); border: var(--border); border-radius: var(--radius-pill); padding: 4px 12px; }
@media (max-width: 639px) {
  .owned { grid-template-columns: 1fr; }
  .phases li { grid-template-columns: 1fr; }
  .phases li .mono { grid-row: auto; }
  .figure.flow { padding: 12px; overflow-x: auto; }
  .figure.flow svg { min-width: 640px; }
}

/* ---------- Portrait (brand imagery: natural light, warm, −15% saturation, 4:5, 16px radius) ---------- */
.with-portrait { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: end; }
.with-portrait .hero-text { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-lg); background: var(--bone); }
.case-head.with-portrait .hero-text { gap: 24px; }
.avatar-photo { width: 64px; height: 64px; border-radius: var(--radius-pill); object-fit: cover; flex: none; background: var(--bone); }
@media (max-width: 1279px) { .with-portrait { grid-template-columns: minmax(0, 1fr) 240px; gap: 40px; } }
@media (max-width: 959px) {
  .with-portrait { grid-template-columns: minmax(0, 1fr) 200px; align-items: start; }
}
@media (max-width: 640px) {
  .with-portrait { grid-template-columns: minmax(0, 1fr); }
  .hero.with-portrait, .case-head.with-portrait { gap: 24px; }
  .with-portrait .portrait { width: 120px; order: -1; }
}
.contact-lines { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; }

/* ---------- True-size screens: keep every Figma frame at its own proportions ---------- */
.content img[width][height] { height: auto; }
.phones-row { align-items: flex-start; }
.strip { align-items: flex-start; }
.phone-scroll { width: 300px; max-width: 100%; height: 650px; overflow-y: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-lift); background: var(--paper); }
.phone-scroll img { width: 100%; height: auto; display: block; }
.media.phones { align-items: center; }
.media.phones img { height: auto; align-self: center; }
.phones-row { flex-wrap: nowrap; }
.phones-row img { flex: 1 1 0; min-width: 0; width: auto; max-width: 200px; }
@media (max-width: 639px) {
  .phones-row { flex-wrap: wrap; }
  .phones-row img { flex: 0 0 44%; max-width: 44%; }
}

/* ---------- Phone frame: flat, straight-on Pro-style device (brand: no dramatic angles) ---------- */
.device { container-type: inline-size; width: 200px; flex: none; }
.device-body { position: relative; padding: 3.2cqi; border-radius: 16cqi; background: var(--ink); box-shadow: var(--shadow-lift), inset 0 0 0 1px var(--slate); }
.device-body::before, .device-body::after { content: ""; position: absolute; width: 1.2cqi; background: var(--slate); border-radius: var(--radius-xs); }
.device-body::before { left: -1cqi; top: 22%; height: 9%; box-shadow: 0 14cqi 0 var(--slate), 0 26cqi 0 var(--slate); }
.device-body::after { right: -1cqi; top: 30%; height: 15%; }
.device-screen { position: relative; aspect-ratio: 393 / 852; border-radius: 13cqi; overflow: hidden; background: var(--paper); }
.device-screen::before { content: ""; position: absolute; z-index: 1; top: 2.8cqi; left: 50%; transform: translateX(-50%); width: 30cqi; height: 8.6cqi; border-radius: var(--radius-pill); background: var(--ink); pointer-events: none; }
.device-screen img { display: block; width: 100%; height: auto; border-radius: 0; box-shadow: none; }
.device-screen.scrolls { overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
.device-screen.scrolls::-webkit-scrollbar { display: none; }
.device-screen.scrolls::before { position: sticky; display: block; margin: 0 auto -8.6cqi; transform: none; left: auto; }
.device-screen:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* layouts that hold devices */
.phones-row { align-items: flex-start; }
.phones-row .device { flex: 1 1 0; min-width: 0; max-width: 220px; width: auto; }
.phones-row.single .device { flex: 0 0 280px; max-width: 280px; }
.strip { gap: 24px; }
.strip .device { width: 200px; }
.media.phones { gap: 12px; padding: 0 16px; }
.media.phones .device { width: 28%; flex: none; transition: transform var(--dur-base) var(--ease); }
.media.phones .device:nth-child(2) { transform: translateY(-16px); }
.card:hover .media.phones .device { transform: scale(1.02); }
.card:hover .media.phones .device:nth-child(2) { transform: translateY(-16px) scale(1.02); }
@media (max-width: 639px) {
  .phones-row .device { flex: 0 0 44%; max-width: 44%; }
  .phones-row.single .device { flex: 0 0 72%; max-width: 72%; }
}
.media.phones .device .device-screen img, .phones-row .device .device-screen img, .strip .device .device-screen img { width: 100%; max-width: none; flex: none; transform: none; border-radius: 0; box-shadow: none; }
.figure .phones-row { width: 100%; justify-content: center; }
.device-screen.pad-status { padding-top: 12cqi; }
.device-screen.scrolls.pad-status::before { top: 2.8cqi; margin: -9.2cqi auto 0.6cqi; }
.device-screen.scrolls::before { top: 2.8cqi; }
.device-screen.scrolls.pad-status::before { top: -9.2cqi; }

/* =====================================================================
   Premium layer — restraint, rhythm and finer typographic detail.
   No dark mode, gold or gradients (brand); premium comes from space,
   scale, precision and calm motion.
   ===================================================================== */
html { font-feature-settings: "calt", "kern"; text-rendering: optimizeLegibility; }
h1, h2, h3, .display, .h1, .h2, .h3 { text-wrap: balance; }
p, .lede { text-wrap: pretty; }
.mono { font-variant-numeric: tabular-nums; }

/* Hero: more air, a clearer reading order */
.hero { padding: 96px 0 128px; }
.hero .display { font-size: var(--fs-display); max-width: 11ch; }
.hero-actions { display: flex; align-items: center; gap: 28px; }
.hero .meta { gap: 24px 48px; padding-top: 24px; }
.with-portrait { gap: 64px; }
.portrait { box-shadow: 0 1px 2px rgba(28,27,25,.06); }

/* Sections: numbered overline on a hairline */
.section { padding: 96px 0; }
.section-head { border-top: var(--border); padding-top: 24px; margin-bottom: 40px; }
.section-head .h2 { margin-top: 12px; }

/* Selected impact: real outcomes, large and quiet */
.impact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--card-gap); }
.impact-tile { display: flex; flex-direction: column; gap: 12px; padding: 28px; border-radius: var(--radius-lg); background: var(--bone); transition: background var(--dur-base) var(--ease); }
.impact-tile:hover { background: var(--linen); }
.impact-tile strong { font-size: 48px; line-height: 1.05; font-weight: 500; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.impact-tile p { color: var(--slate); font-size: 15px; line-height: 1.5; }
.impact-tile .mono { margin-top: auto; padding-top: 12px; }

/* Work cards: editorial meta, featured first project, quiet call to action */
.grid { gap: 64px var(--card-gap); }
.card { gap: 12px; }
.card .media { margin-bottom: 8px; }
.card-meta { display: flex; gap: 16px; }
.card h3 { font-size: 22px; line-height: 1.3; letter-spacing: -.01em; }
.card p { font-size: 15px; line-height: 1.55; max-width: 52ch; }
.card .more { font-size: 14px; color: var(--ink); display: inline-flex; gap: 8px; align-items: center; margin-top: 4px; }
.card .more span { transition: transform var(--dur-fast) var(--ease); }
.card:hover .more span { transform: translateX(4px); }
.card:hover h3 { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.card.featured { grid-column: 1 / -1; }
.card.featured .media { aspect-ratio: 2 / 1; }
.card.featured .media.desk img { width: 64%; }
.card.featured h3 { font-size: 28px; }

/* Staggered, calm reveals (fade + rise 12px, brand motion) */
.grid .card:nth-child(2n).reveal { transition-delay: 80ms; }
.impact .reveal:nth-child(2) { transition-delay: 80ms; }
.impact .reveal:nth-child(3) { transition-delay: 160ms; }

/* How I lead */
.approach li { padding: 24px 0; grid-template-columns: 240px 1fr; }
.approach b { font-size: 18px; line-height: 28px; }

/* Closing */
.closing { padding: 128px 0 64px; border-top: var(--border); margin-top: 32px; }
.closing .h1 { max-width: 14ch; }

/* Case studies: bigger statement, calmer chapters */
.case-head { padding: 80px 0 48px; }
.case-head .h1 { font-size: 64px; line-height: 1.02; letter-spacing: -.035em; max-width: 16ch; }
.chapter { padding: 64px 0; gap: 28px; }
.chapter .num { display: block; margin-bottom: 12px; }
.panel { padding: 28px; }
.next { padding: 28px; transition: background var(--dur-base) var(--ease); }
.next:hover { background: var(--linen); }

@media (max-width: 1279px) {
  .impact { grid-template-columns: 1fr; }
  .impact-tile { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; }
  .impact-tile strong { font-size: 36px; min-width: 200px; }
  .impact-tile p { flex: 1 1 280px; }
  .impact-tile .mono { margin: 0; padding: 0; flex-basis: 100%; }
}
@media (max-width: 959px) {
  .hero { padding: 48px 0 64px; }
  .hero .display { font-size: 64px; }
  .section { padding: 64px 0; }
  .case-head .h1 { font-size: 44px; }
  .approach li { grid-template-columns: 1fr; }
  .closing { padding: 96px 0 48px; }
}
@media (max-width: 639px) {
  .hero .display { font-size: 48px; }
  .card.featured .media { aspect-ratio: 4 / 3; }
  .card.featured .media.desk img { width: 78%; }
  .grid { gap: 48px; }
  .impact-tile strong { min-width: 0; }
  .case-head .h1 { font-size: 36px; }
  .closing .h1 { font-size: 36px; }
}
.impact-tile strong { font-size: 44px; white-space: nowrap; letter-spacing: -.035em; }
.panel-links { margin-top: 20px; padding-top: 16px; border-top: var(--border); font-size: 14px; display: flex; gap: 24px; flex-wrap: wrap; }
/* An odd card left alone on the last row spans the full width */
.grid:not(.js) .card.featured ~ .card:last-child:nth-child(even), .grid .card.span-last { grid-column: 1 / -1; }
.grid:not(.js) .card.featured ~ .card:last-child:nth-child(even) .media, .grid .card.span-last .media { aspect-ratio: 2 / 1; }

/* Card thumbnails: size phones by the frame's height too, so wide cards never overflow */
.media.phones { container-type: size; }
.media.phones .device { width: min(28cqw, 34cqh); }

/* Contact follows the last section directly: one divider, no empty band */
.section:has(+ .closing) { padding-bottom: 0; }
.closing { border-top: 0; margin-top: 0; padding-top: 80px; }
@media (max-width: 959px) { .closing { padding-top: 64px; } }

/* ---------- Expertise (home 03) and certificates (home 05, about) ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.expertise { list-style: none; padding: 0; margin: 0; }
.expertise > li { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 40px 0; border-top: var(--border); }
.expertise > li:last-child { border-bottom: 0; padding-bottom: 0; }
.ex-head { display: flex; flex-direction: column; gap: 8px; }
.ex-head .h3 { margin: 0; }
.ex-body { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.ex-body > p { color: var(--slate); max-width: var(--max-text); }
.ex-proof { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 0; }
.ex-proof div { border-top: var(--border); padding-top: 12px; }
.ex-proof dd { margin: 8px 0 0; font-size: 24px; line-height: 1.3; font-weight: 500; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.ex-table td:first-child { color: var(--ink); }
.ex-table td:last-child { color: var(--slate); }
.ex-figure { margin: 0; }
.ex-figure .figure { padding: 28px; }
.ex-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.certs-lede { margin: -16px 0 28px; }
.certs td:first-child { color: var(--ink); font-weight: 500; }
.certs td:last-child { white-space: nowrap; text-align: right; }
.panel .certs { margin-top: 8px; }
@media (max-width: 959px) {
  .expertise > li { grid-template-columns: 1fr; gap: 16px; padding: 28px 0; }
}
@media (max-width: 639px) {
  .ex-proof { grid-template-columns: 1fr; gap: 16px; }
  .ex-figure .figure { padding: 16px; }
}

/* ---------- Recommendations (home 05) ---------- */
.quotes { columns: 2; column-gap: 40px; }
.quotes-lede { margin: -16px 0 40px; }
.quote { margin: 0 0 40px; display: flex; flex-direction: column; gap: 20px; padding-top: 24px; border-top: var(--border); break-inside: avoid; }
.quote blockquote { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.quote blockquote p { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink); }
.quote figcaption { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.quote figcaption b { font-weight: 500; color: var(--ink); }
.quote figcaption span { color: var(--pebble); }
.quote figcaption .mono { margin-top: 4px; }
.quotes-more { margin-top: 40px; padding-top: 24px; border-top: var(--border); }
.certs .note { display: block; margin-top: 4px; font-weight: 400; font-size: 12px; color: var(--pebble); }
@media (max-width: 959px) { .quotes { columns: 1; } .quote { margin-bottom: 28px; } }

/* ---------- Featured certificate ---------- */
.cert-feature { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; padding: 28px; margin-bottom: 40px; border-radius: var(--radius-lg); background: var(--bone); }
.cf-main { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.cf-main .h3 { margin: 4px 0 0; }
.cf-main p { color: var(--slate); max-width: var(--max-text); }
.cf-main .link { margin-top: 8px; }
.cf-facts { margin: 0; display: flex; flex-direction: column; gap: 16px; }
.cf-facts div { border-top: var(--border); padding-top: 12px; }
.cf-facts dd { margin: 4px 0 0; color: var(--ink); font-size: 14px; }
.panel .cert-feature { background: var(--paper); margin-top: 8px; }
@media (max-width: 959px) { .cert-feature { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- Success story (About) ---------- */
.story-section { padding-top: 0; }
.story { list-style: none; padding: 0; margin: 0; }
.story > li { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 40px 0; border-top: var(--border); }
.story > li:first-child { border-top: 0; padding-top: 0; }
.story p { color: var(--slate); max-width: var(--max-text); margin-top: 12px; }
.story-proof { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 24px; }
.story-proof dt { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--pebble); font-weight: 500; }
.story-proof dd { font-size: 24px; line-height: 32px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 4px; }
@media (max-width: 960px) { .story > li { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- Spot the fix (home) ---------- */
.spot-lede { margin-bottom: 12px; }
.spot-time { display: block; margin-bottom: 40px; }
.spot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--card-gap); align-items: start; }
.spot-stage { background: var(--blush); border-radius: var(--radius-lg); padding: 48px 28px; display: grid; place-items: center; }
.sf { width: 100%; max-width: 400px; background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow-lift); padding: 24px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.sf .hot { display: flex; flex-direction: column; justify-content: center; min-height: 44px; width: 100%; text-align: left; padding: 4px; margin: -4px; border-radius: var(--radius-sm); border: 1px dashed transparent; cursor: pointer; position: relative; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.sf .hot:hover { border-color: var(--stone); }
.sf .hot.hint { border-color: var(--accent); }
.sf .hot.found { border-color: var(--linen); border-style: solid; cursor: default; }
.sf .hot.found::after { content: attr(data-issue); position: absolute; top: -8px; left: -8px; width: 20px; height: 20px; border-radius: var(--radius-pill); background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 500; line-height: 20px; text-align: center; }
.sf-steps { display: flex; flex-direction: column; gap: 8px; }
.sf-small { font-size: 12px; color: var(--pebble); }
.sf-dots { display: flex; gap: 4px; }
.sf-dots i { flex: 1; height: 4px; border-radius: var(--radius-pill); background: var(--linen); }
.sf-dots i.on { background: var(--ink); }
.sf-title { font-size: 18px; line-height: 24px; font-weight: 500; color: var(--ink); margin-top: 4px; }
.sf-chips { display: flex; gap: 8px; }
.sf-chips span { flex: 1; height: 44px; border: 1px solid var(--stone); border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 14px; color: var(--ink); }
.sf-chips span.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.sf-chips-tiny { gap: 4px; }
.sf-chips-tiny span { flex: none; height: 20px; padding: 0 4px; font-size: 12px; border-radius: var(--radius-xs); }
.sf-label { font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: -4px; }
.sf-input { display: block; height: 44px; border: 1px solid var(--stone); border-radius: var(--radius-sm); padding: 0 12px; line-height: 42px; font-size: 14px; color: var(--ink); }
.sf-input-ghost { color: var(--stone); } /* deliberately poor contrast: it is one of the problems */
.sf-err { display: block; font-size: 12px; color: var(--accent); }
.sf-err-good { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); margin-top: -4px; }
.sf-err-icon { width: 16px; height: 16px; flex: none; }
.sf-err-icon circle { fill: var(--accent); }
.sf-err-icon path { stroke: var(--paper); stroke-width: 1.75; stroke-linecap: round; fill: none; }
.sf-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--slate); }
.sf-box { width: 16px; height: 16px; border: 1px solid var(--stone); border-radius: var(--radius-xs); flex: none; position: relative; }
.sf-box.on { background: var(--ink); border-color: var(--ink); }
.sf-box.on::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--paper); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.sf-btn { display: grid; place-items: center; height: 44px; border-radius: var(--radius-pill); background: var(--ink); color: var(--paper); font-size: 15px; font-weight: 500; margin-top: 4px; }
.sf-btn-weak { background: var(--linen); color: var(--stone); }
.sf[hidden], .spot-done[hidden] { display: none; }
.spot-miss { min-height: 20px; font-size: 14px; color: var(--pebble); }
.spot-side { display: flex; flex-direction: column; gap: 20px; }
.spot-progress { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 16px; }
.spot-progress strong { font-size: 24px; line-height: 32px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; justify-self: end; }
.spot-bar { grid-column: 1 / -1; display: flex; gap: 4px; }
.spot-bar i { flex: 1; height: 4px; border-radius: var(--radius-pill); background: var(--linen); transition: background var(--dur-base) var(--ease); }
.spot-bar i.on { background: var(--ink); }
.spot-list { list-style: none; padding: 0; margin: 0; }
.spot-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: var(--border); }
.spot-num { width: 20px; height: 20px; border-radius: var(--radius-pill); border: 1px solid var(--stone); font-size: 12px; line-height: 18px; text-align: center; color: var(--pebble); font-variant-numeric: tabular-nums; }
.spot-item.found .spot-num { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.spot-answer b { font-weight: 500; color: var(--ink); display: block; }
.spot-answer p { font-size: 14px; line-height: 1.5; color: var(--slate); margin: 4px 0 8px; }
.spot-locked { display: none; padding-top: 2px; }
.spot.js .spot-item:not(.found) .spot-answer { display: none; }
.spot.js .spot-item:not(.found) .spot-locked { display: block; }
.spot-item.found .spot-answer { animation: spot-in var(--dur-base) var(--ease); }
@keyframes spot-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.spot-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.spot-actions .link { font-size: 14px; min-height: 44px; padding: 0 8px; }
.spot-actions [aria-pressed="true"] { border-color: var(--ink); }
.spot-done { padding: 16px 20px; background: var(--bone); border-radius: var(--radius-md); color: var(--slate); }
.spot:not(.js) .spot-actions { display: none; }
@media (max-width: 960px) { .spot { grid-template-columns: 1fr; } .spot-stage { padding: 40px 16px; } }

/* Each found problem repairs itself in place */
.sf-field { display: flex; flex-direction: column; gap: 8px; }
.sf:not(.force-fixed) .hot:not(.found) .v-fixed, .sf.force-broken .v-fixed { display: none; }
.sf:not(.force-broken) .hot.found .v-broken, .sf.force-fixed .v-broken { display: none; }
.sf .hot.found .v-fixed { animation: spot-fix var(--dur-base) var(--ease); }
@keyframes spot-fix { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Touch: 44px hit areas without moving text or underlines */
@media (pointer: coarse) {
  .menu-btn { min-height: 44px; }
  .link, .topbar .wordmark, .site-foot nav a { position: relative; }
  .link::after, .topbar .wordmark::after, .site-foot nav a::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 44px; transform: translateY(-50%); }
  .ex-links, .contact-lines { row-gap: 16px; }
  .site-foot nav { gap: 24px; }
}

/* Home hero rhythm (accepted from the polish variants) */
.hero.with-portrait { align-items: start; }
.hero .hero-text { gap: 0; }
.hero .hero-text > .mono:first-child { margin-bottom: 16px; }
.hero .display { text-wrap: balance; }
.hero .lede { margin-top: 28px; max-width: 56ch; }
.hero .hero-actions { margin-top: 40px; }
.hero .meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 48px; }
.hero .portrait { margin-top: 40px; }
@media (max-width: 640px) {
  .hero .meta { grid-template-columns: 1fr; gap: 16px; }
  .hero .portrait { margin-top: 0; }
}

/* Hero orbit: a slow field of short dashes circling the portrait (drawn by site.js) */
.hero { position: relative; isolation: isolate; }
.hero > .orbit { position: absolute; top: 0; bottom: 0; left: -28px; right: -28px; width: calc(100% + 56px); height: 100%; pointer-events: none; z-index: -1; opacity: 0; transition: opacity var(--dur-slow) var(--ease); }
.hero > .orbit.on { opacity: 1; }
/* Hero text arrives line by line: fade and rise 12px, 80ms apart */
.hero.reveal .hero-text > * { opacity: 0; transform: translateY(12px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.hero.reveal.in .hero-text > * { opacity: 1; transform: none; }
.hero.reveal.in .hero-text > :nth-child(2) { transition-delay: 80ms; }
.hero.reveal.in .hero-text > :nth-child(3) { transition-delay: 160ms; }
.hero.reveal.in .hero-text > :nth-child(4) { transition-delay: 240ms; }
.hero.reveal.in .hero-text > :nth-child(5) { transition-delay: 320ms; }

/* Home hero: less empty space above the label (owner's request, 1 Dec 2026) */
.hero.with-portrait { padding-top: 12px; } /* + 28px page padding = 40px below the header */
.hero.with-portrait .portrait { margin-top: 0; }

/* ---------- Usability heuristics pass (1 Dec 2026) ---------- */
/* H1, H6: "On this page" in the rail, with the current section marked */
.rail nav h2 { margin-bottom: 4px; }
.toc-row { display: block; padding: 8px 0 8px 12px; margin-left: -12px; border-radius: var(--radius-sm); font-size: 14px; line-height: 20px; color: var(--pebble); transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.toc-row:hover { color: var(--ink); }
.toc-row[aria-current] { color: var(--ink); font-weight: 500; background: var(--bone); }
h1[id], h2[id] { scroll-margin-top: 96px; }
/* Case studies below 1280px (no rail): the chapters as a short list in the details panel */
.toc-inline { margin-top: 20px; padding-top: 16px; border-top: var(--border); }
.toc-inline ol { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; counter-reset: ch; }
.toc-inline li { counter-increment: ch; display: flex; gap: 12px; font-size: 14px; line-height: 20px; }
.toc-inline li::before { content: counter(ch, decimal-leading-zero); font-family: var(--font-mono); font-size: var(--fs-label); color: var(--pebble); font-variant-numeric: tabular-nums; padding-top: 2px; }
@media (min-width: 1280px) { .toc-inline { display: none; } }
/* H3, H7: previous and next project side by side, then a way back to all work */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--card-gap); margin: 48px 0 0; }
.pager .next { margin: 0; flex-direction: column; align-items: flex-start; justify-content: space-between; }
.pager .next:only-child { grid-column: 1 / -1; }
.all-work { margin: 24px 0; font-size: 14px; }
@media (max-width: 640px) { .pager { grid-template-columns: 1fr; } }
/* H5, H9: copy the email for visitors without a mail app */
button.link { background: none; border: 0; border-bottom: 1px solid var(--stone); padding: 0; font: inherit; cursor: pointer; }
button.link:hover { border-bottom-color: var(--accent); }
/* H3: play the game again */
.spot-again { align-self: flex-start; }
.spot-again[hidden], .copy-email[hidden] { display: none; }
/* H9: 404 page */
.hero.notfound { padding-top: 64px; min-height: 60vh; }

/* ---------- Audit backlog (1 Dec 2026) ---------- */
/* B6: three pull quotes on the home page; the full set lives on About */
.quotes.quotes-featured { columns: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--card-gap); }
.quotes-featured .quote { margin: 0; }
.quotes-featured .quote blockquote p { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--tr-h3); }
.quotes-more { display: flex; flex-wrap: wrap; gap: 16px 28px; }
@media (max-width: 959px) { .quotes.quotes-featured { grid-template-columns: minmax(0, 1fr); } }
/* B8: "In short" at the top of a case study */
.in-short { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--card-gap); margin: 8px 0 4px; padding: 24px 0; border-top: var(--border); border-bottom: var(--border); }
.in-short dt { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--pebble); font-weight: 500; }
.in-short dd { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink); }
@media (max-width: 959px) { .in-short { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
