/* Saeid Portfolio — editorial, precise. Tokens first, then components. */
:root {
  --c-base: #f6f5f1; --c-surface: #ffffff; --c-ink: #111214; --c-muted: #5c6066;
  --c-line: #dedcd5; --c-signal: #2f5bff; --c-signal-ink: #ffffff;
  --glass: rgba(246, 245, 241, 0.72);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --r-sm: 4px; --r-md: 12px; --r-lg: 28px;
  --font-display: var(--wp--preset--font-family--display);
  --font-mono: var(--wp--preset--font-family--mono);
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(5rem, 12vw, 10rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-base: #0d0e10; --c-surface: #16181b; --c-ink: #edebe6; --c-muted: #9a9da3;
    --c-line: #2a2d31; --c-signal: #7b93ff; --c-signal-ink: #0d0e10; --glass: rgba(13, 14, 16, 0.7);
  }
}
:root[data-theme="dark"] {
  --c-base: #0d0e10; --c-surface: #16181b; --c-ink: #edebe6; --c-muted: #9a9da3;
  --c-line: #2a2d31; --c-signal: #7b93ff; --c-signal-ink: #0d0e10; --glass: rgba(13, 14, 16, 0.7);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--c-base); color: var(--c-ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--c-signal); color: var(--c-signal-ink); }
:focus-visible { outline: 2px solid var(--c-signal); outline-offset: 3px; border-radius: 4px; }
.screen-reader-text, .skip-link { position: absolute; left: -9999px; }

.label { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-muted); line-height: 1.4; margin: 0; }
.label a { color: inherit; text-decoration: none; }
.label a:hover { color: var(--c-signal); }
.lede { color: var(--c-muted); max-width: 40rem; }

/* ---------- layout primitives ---------- */
.site-main { position: relative; z-index: 1; padding-top: 6.5rem; }
.is-home .site-main { padding-top: 0; }
.wrap { width: 100%; max-width: 84rem; margin-inline: auto; padding-inline: var(--gutter); }
.wrap--wide { max-width: 96rem; }
.chapter { padding-block: var(--section); position: relative; }
.chapter > .wrap > * + * { margin-top: 1.5rem; }
.chapter h2 { max-width: 18ch; margin-top: 1rem; }
.chapter h1 { max-width: 18ch; }
.chapter p { margin-block: 0; }
.chapter .lede { margin-top: 1.5rem; }
.wp-block-group.chapter > .wrap { display: block; }
.page-wrap { padding: 2rem var(--gutter) var(--section); max-width: 52rem; margin-inline: auto; }
.page-title { margin-bottom: 2rem; }

/* ---------- site header (floating pill) ---------- */
.site-header { position: fixed; inset: 1rem 0 auto 0; z-index: 40; display: flex; justify-content: center; padding-inline: 1rem; pointer-events: none; }
.site-header > * { pointer-events: auto; }
.site-header__pill { display: flex; align-items: center; gap: 0.25rem; padding: 0.4rem 0.4rem 0.4rem 1rem; border-radius: 999px; background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 0 0 1px var(--c-line), 0 12px 40px -18px rgba(0,0,0,0.25); transition: transform 700ms var(--ease-spring); }
.site-header__brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 0.9375rem; text-decoration: none; color: var(--c-ink); margin-right: 1rem; letter-spacing: -0.01em; }
.site-header__mark { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--c-signal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-signal) 22%, transparent); }
.site-header__nav { display: flex; gap: 0.15rem; }
.site-header__nav a { color: var(--c-muted); text-decoration: none; font-size: 0.875rem; padding: 0.5rem 0.85rem; border-radius: 999px; transition: color 300ms var(--ease-out), background 300ms var(--ease-out); }
.site-header__nav a:hover, .site-header__nav a[aria-current] { color: var(--c-ink); background: color-mix(in srgb, var(--c-ink) 7%, transparent); }
.site-header__cta { margin-left: 0.5rem; }
.theme-toggle { width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; margin-left: 0.25rem; }
.theme-toggle span { width: 1rem; height: 1rem; border-radius: 50%; border: 1.5px solid var(--c-ink); background: linear-gradient(90deg, var(--c-ink) 50%, transparent 50%); transition: transform 700ms var(--ease-spring); }
.theme-toggle:hover span { transform: rotate(180deg); }
.menu-toggle { display: none; width: 2.5rem; height: 2.5rem; border: 0; background: transparent; position: relative; cursor: pointer; border-radius: 50%; }
.menu-toggle span { position: absolute; left: 50%; top: 50%; width: 1.1rem; height: 1.5px; background: var(--c-ink); transition: transform 600ms var(--ease-spring); }
.menu-toggle span:first-child { transform: translate(-50%, -4px); }
.menu-toggle span:last-child { transform: translate(-50%, 4px); }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translate(-50%, 0) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translate(-50%, 0) rotate(-45deg); }
.site-menu { position: fixed; inset: 0; z-index: -1; background: color-mix(in srgb, var(--c-base) 88%, transparent); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); display: grid; align-content: center; padding: 6rem var(--gutter) 3rem; opacity: 0; visibility: hidden; transition: opacity 500ms var(--ease-spring), visibility 0s linear 500ms; }
.site-menu[hidden] { display: grid; }
.site-menu.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.site-menu nav { display: grid; gap: 0.25rem; }
.site-menu a { font-family: var(--font-display); font-size: clamp(2.5rem, 11vw, 4.5rem); line-height: 1.05; color: var(--c-ink); text-decoration: none; transform: translateY(2.5rem); opacity: 0; transition: transform 800ms var(--ease-spring), opacity 800ms var(--ease-spring); transition-delay: calc(var(--i) * 60ms); }
.site-menu.is-open a { transform: none; opacity: 1; }
@media (max-width: 860px) {
  .site-header__nav, .site-header__cta { display: none; }
  .menu-toggle { display: block; }
  .site-header__pill { width: 100%; max-width: 26rem; justify-content: space-between; }
  .site-header__brand { margin-right: auto; }
}

/* ---------- buttons ---------- */
.wp-block-buttons { gap: 0.75rem; margin-top: 2rem; }
.wp-block-button__link { display: inline-flex; align-items: center; gap: 0.9rem; padding: 0.5rem 0.5rem 0.5rem 1.4rem !important; transition: transform 500ms var(--ease-spring), background 300ms var(--ease-out), color 300ms var(--ease-out); text-decoration: none !important; }
.wp-block-button__link::after, .btn-pill__icon { content: ""; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: color-mix(in srgb, currentColor 14%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 12 12 4M5.5 4H12v6.5' fill='none' stroke='%23888' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.9rem no-repeat; transition: transform 500ms var(--ease-spring); flex: none; }
.wp-block-button__link:hover { transform: scale(1.02); }
.wp-block-button__link:active { transform: scale(0.98); }
.wp-block-button__link:hover::after { transform: translate(2px, -2px) scale(1.06); }
.wp-block-button.is-style-outline .wp-block-button__link, .wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; color: var(--c-ink); box-shadow: inset 0 0 0 1px var(--c-line); }
.wp-block-button.is-style-outline .wp-block-button__link:hover { box-shadow: inset 0 0 0 1px var(--c-ink); }
.wp-block-button.is-style-fill .wp-block-button__link { background: var(--c-ink); color: var(--c-base); }
.btn-pill { display: inline-flex; align-items: center; gap: 0.9rem; padding: 0.4rem 0.4rem 0.4rem 1.2rem; border-radius: 999px; background: var(--c-ink); color: var(--c-base); font-size: 0.9375rem; font-weight: 500; text-decoration: none; transition: transform 500ms var(--ease-spring); }
.btn-pill__icon { display: grid; place-items: center; width: 2rem; height: 2rem; background-image: none; background-color: color-mix(in srgb, currentColor 16%, transparent); }
.btn-pill--sm { padding: 0.3rem 0.3rem 0.3rem 1rem; font-size: 0.875rem; }
.btn-pill--sm .btn-pill__icon { width: 1.75rem; height: 1.75rem; }
.btn-pill:hover { transform: scale(1.02); }
.btn-pill:hover .btn-pill__icon { transform: translate(2px, -2px); }

/* ---------- hero ---------- */
.chapter-hero { min-height: 100dvh; display: grid; align-items: end; padding-top: 9rem; padding-bottom: clamp(3rem, 8vw, 6rem); }
.chapter-hero .wrap > * + * { margin-top: 1.75rem; }
.hero-eyebrow { display: inline-flex; padding: 0.4rem 0.8rem; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--c-line); background: var(--glass); }
.hero-title, .chapter-hero h1 { font-size: clamp(2.75rem, 5.6vw, 6.25rem); max-width: 26ch !important; line-height: 1; letter-spacing: -0.025em; }
.hero-sub { max-width: 34rem; color: var(--c-muted); }
.logo-strip { padding-top: 2.5rem; margin-top: 2.5rem !important; border-top: 1px solid var(--c-line); }
.system-field { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s var(--ease-out); }
.system-field.is-ready { opacity: 1; }
.system-field canvas { width: 100%; height: 100%; display: block; }
.is-home .chapter { background: transparent; }
.is-home .chapter-people, .is-home .chapter-method { background: color-mix(in srgb, var(--c-base) 72%, transparent); }

/* ---------- principles (pinned on desktop) ---------- */
.pin-steps { display: grid; gap: 2.5rem; margin-top: 3rem; }
.pin-step { padding-top: 1.5rem; border-top: 1px solid var(--c-line); max-width: 46rem; }
.pin-step h3 { margin: 0.75rem 0 0.75rem; }
.pin-step p:last-child { color: var(--c-muted); }

/* ---------- counters / info grid / timeline ---------- */
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 2.5rem 2rem; margin-block: 3rem; }
.counter { border-top: 1px solid var(--c-line); padding-top: 1.25rem; }
.counter__num { font-family: var(--font-display); font-size: clamp(3.5rem, 8vw, 6.5rem); line-height: 0.95; letter-spacing: -0.03em; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.info-card { padding: 1.75rem; border-radius: var(--r-md); background: var(--c-surface); box-shadow: 0 0 0 1px var(--c-line); transition: transform 600ms var(--ease-spring); }
.info-card:hover { transform: translateY(-4px); }
.info-card h3 { margin-top: 0; font-size: 1.5rem; }
.info-card p { color: var(--c-muted); font-size: 0.9375rem; margin-top: 0.75rem; }
.timeline { margin-top: 2.5rem; border-top: 1px solid var(--c-line); }
.tl__row { display: grid; grid-template-columns: 1.2fr 2fr auto; gap: 1rem; align-items: baseline; padding-block: 1.1rem; border-bottom: 1px solid var(--c-line); }
.tl__co { font-weight: 600; margin: 0; } .tl__role { color: var(--c-muted); margin: 0; }
@media (max-width: 700px) { .tl__row { grid-template-columns: 1fr; gap: 0.25rem; } }
.chapter-prose p { font-size: var(--wp--preset--font-size--lead); max-width: 40rem; color: var(--c-ink); }
.chapter-prose p + p { margin-top: 1.5rem; }
.cv-role { padding-block: 2rem; border-top: 1px solid var(--c-line); display: grid; grid-template-columns: minmax(12rem, 1fr) 2fr; gap: 2rem; }
.cv-role__head h3 { margin: 0; font-size: 1.75rem; } .cv-role__head p { margin: 0.35rem 0 0; }
.cv-role ul { margin: 0; padding-left: 1.1rem; color: var(--c-muted); } .cv-role li { margin-bottom: 0.5rem; }
@media (max-width: 800px) { .cv-role { grid-template-columns: 1fr; gap: 1rem; } }
@media print { .site-header, .site-footer, .system-field, .wp-block-buttons { display: none !important; } body { background: #fff; color: #000; } .chapter { padding-block: 1.5rem; } }

/* ---------- bezel + cards ---------- */
.bezel { display: block; padding: 0.4rem; border-radius: calc(var(--r-lg) + 0.4rem); background: color-mix(in srgb, var(--c-ink) 5%, transparent); box-shadow: 0 0 0 1px var(--c-line); }
.bezel__core { display: block; border-radius: var(--r-lg); overflow: hidden; background: var(--c-surface); box-shadow: inset 0 1px 1px rgba(255,255,255,0.35); }
.case-card { display: grid; gap: 1.25rem; color: inherit; text-decoration: none !important; }
.case-card__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.case-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1200ms var(--ease-out); }
.case-card:hover .case-card__media img { transform: scale(1.04); }
.case-card__ph { display: block; width: 100%; height: 100%; background: repeating-linear-gradient(45deg, var(--c-line) 0 1px, transparent 1px 14px); }
.case-card__body { display: grid; gap: 0.6rem; justify-items: start; padding-inline: 0.4rem; }
.case-card__title { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.03; letter-spacing: -0.015em; }
.case-card__line { color: var(--c-muted); max-width: 34rem; }
.case-card .btn-pill { margin-top: 0.75rem; }
.pill { display: inline-block; margin-left: 0.5rem; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--c-signal); color: var(--c-signal-ink); font-size: 0.65rem; }
.work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: clamp(2rem, 4vw, 3.5rem) 2rem; }
.work-tier { margin-top: clamp(4rem, 8vw, 7rem); } .work-tier:first-child { margin-top: 0; }
.work-tier__title { font-size: var(--wp--preset--font-size--sub) !important; font-family: var(--font-mono) !important; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-muted); margin-bottom: 1.5rem !important; max-width: none !important; }
.work-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--c-line); }
.work-row { display: grid; grid-template-columns: 5rem 1fr minmax(8rem, 16rem) 1.5rem; gap: 1rem; align-items: baseline; padding-block: 1.4rem; border-bottom: 1px solid var(--c-line); text-decoration: none !important; color: var(--c-ink); transition: padding 500ms var(--ease-spring), color 300ms; }
.work-row__title { font-family: var(--font-display); font-size: clamp(1.75rem, 3.2vw, 2.75rem); line-height: 1.05; }
.work-row:hover { padding-left: 1rem; color: var(--c-signal); }
.work-row__arrow { transform: translate(-6px, 6px); opacity: 0; transition: all 500ms var(--ease-spring); }
.work-row:hover .work-row__arrow { transform: none; opacity: 1; }
@media (max-width: 700px) { .work-row { grid-template-columns: 3.5rem 1fr; } .work-row__domain, .work-row__arrow { display: none; } }
.work-preview { position: fixed; left: 0; top: 0; z-index: 30; width: 22rem; aspect-ratio: 4/3; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(0.9); border-radius: var(--r-md); overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0,0,0,0.4); transition: opacity 300ms var(--ease-out), transform 500ms var(--ease-spring); }
.work-preview.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.work-preview img { width: 100%; height: 100%; object-fit: cover; }
@media (pointer: coarse) { .work-preview { display: none; } }

/* featured stack (CSS sticky, no JS) */
.featured-stack { margin-top: 3rem; }
.featured-stack__item { position: sticky; top: calc(5.5rem + var(--n) * 1.1rem); padding-bottom: 3rem; }
.case-card--large { background: var(--c-base); border-radius: calc(var(--r-lg) + 0.4rem); padding: clamp(0.75rem, 2vw, 1.5rem); box-shadow: 0 0 0 1px var(--c-line), 0 40px 80px -50px rgba(0,0,0,0.35); grid-template-columns: 1.35fr 1fr; align-items: center; gap: clamp(1.5rem, 4vw, 3.5rem); }
.case-card--large .bezel { padding: 0; background: none; box-shadow: none; }
.case-card--large .case-card__media { aspect-ratio: 16 / 11; }
@media (max-width: 860px) { .case-card--large { grid-template-columns: 1fr; } .featured-stack__item { position: static; } }

/* ---------- case study pages ---------- */
.case-hero { padding-block: clamp(2rem, 6vw, 4rem) 0; }
.case-hero .wrap > * + * { margin-top: 1.5rem; }
.case-title { font-size: var(--wp--preset--font-size--display) !important; max-width: 16ch; line-height: 1; }
.case-outcome { font-size: var(--wp--preset--font-size--lead); color: var(--c-muted); max-width: 42rem; }
.case-cover { margin-block: 2rem; } .case-cover img { width: 100%; border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--c-line); }
.fact-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1.5rem 2rem; margin: 0; padding-block: 1.75rem; border-block: 1px solid var(--c-line); }
.fact-bar dd { margin: 0.35rem 0 0; font-size: 0.9375rem; } .fact-bar dt { margin: 0; }
.case-body { padding-block: clamp(3rem, 8vw, 6rem); }
.case-content { padding-inline: 0; }
.case-content > :not(.story-chapter):not(.story-statement):not(.story-close) { padding-inline: var(--gutter); }
.case-content > * { max-width: 44rem; margin-inline: auto; }
.case-content > * + * { margin-top: 1.25rem; }
.case-content > h2 { font-size: var(--wp--preset--font-size--section); margin-top: clamp(4rem, 8vw, 7rem); max-width: 54rem; }
.case-content > h3 { font-size: var(--wp--preset--font-size--sub); margin-top: 3rem; max-width: 54rem; }
.case-content > .wp-block-image, .case-content > .wp-block-gallery { max-width: 64rem; margin-block: 2.5rem; }
.case-content > .wp-block-image img { width: 100%; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--c-line); }
.case-content > .overview { max-width: 64rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; padding-block: 2rem; border-bottom: 1px solid var(--c-line); margin-bottom: 3rem; }
.case-content .overview h3 { margin: 0 0 0.6rem; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-muted); line-height: 1.4; }
.case-content .overview ul { margin: 0; padding-left: 1.1rem; } .case-content .overview p { margin: 0 0 .5rem; }
.case-content ul { padding-left: 1.2rem; } .case-content li { margin-bottom: 0.4rem; }
.case-content a { color: var(--c-signal); }
.case-content video { width: 100%; max-width: 64rem; border-radius: var(--r-md); }
.placeholder-note { padding: 2rem; border-radius: var(--r-md); background: var(--c-surface); box-shadow: 0 0 0 1px var(--c-line); }
.case-next { padding-block: var(--section) 4rem; } .case-next .label { margin-bottom: 1.5rem; }

/* ---------- process diagram ---------- */
.process { position: relative; margin-top: 3rem; }
.process__line { position: absolute; left: 0; right: 0; top: 0.5rem; width: 100%; height: 8px; overflow: visible; }
.process__line line { stroke: var(--c-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.process__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2rem; position: relative; }
.process__step { position: relative; padding-top: 2.25rem; }
.process__node { position: absolute; top: 0; left: 0; width: 1rem; height: 1rem; border-radius: 50%; background: var(--c-base); box-shadow: 0 0 0 1px var(--c-ink); }
.process__node::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--c-signal); transform: scale(0); transition: transform 700ms var(--ease-spring); transition-delay: calc(var(--i) * 140ms); }
.process.is-in .process__node::after { transform: scale(1); }
.process__step h3 { margin: 0.5rem 0; font-size: 1.75rem; } .process__step p { color: var(--c-muted); font-size: 0.9375rem; margin: 0; }
.process__loop { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px dashed var(--c-line); }
@media (max-width: 900px) { .process__steps { grid-template-columns: 1fr; } .process__line { display: none; } .process__step { padding: 0 0 0 2rem; } .process__node { top: 0.45rem; } }

/* ---------- footer / invitation ---------- */
.chapter-invite { padding-block: clamp(6rem, 16vw, 14rem); }
.chapter-invite .invite-title, .chapter-invite h2 { font-size: clamp(2.75rem, 8vw, 7.5rem); max-width: 14ch; line-height: 1; }
.site-footer { position: relative; z-index: 1; padding: 4rem var(--gutter) 2rem; border-top: 1px solid var(--c-line); background: var(--c-base); }
.site-footer__inner { max-width: 84rem; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.site-footer__name { font-family: var(--font-display); font-size: 2rem; margin: 0 0 0.5rem; }
.site-footer p { margin-block: 0.5rem; font-size: 0.9375rem; } .site-footer a { text-decoration: none; color: var(--c-ink); } .site-footer a:hover { color: var(--c-signal); }
.site-footer__legal { max-width: 84rem; margin: 3rem auto 0 !important; }
@media (max-width: 700px) { .site-footer__inner { grid-template-columns: 1fr; } }

/* ---------- motion (enhancement only; content is visible without JS) ---------- */
.motion-ready .reveal, .motion-ready .case-card[data-motion], .motion-ready .info-card, .motion-ready .counter, .motion-ready .pin-step { opacity: 0; transform: translateY(2.5rem); }
.motion-ready .wp-block-image img { clip-path: inset(0 0 100% 0); }
.motion-ready .wp-block-image.is-in img { clip-path: inset(0 0 0 0); transition: clip-path 1200ms var(--ease-out); }
.progress-bar { position: fixed; left: 0; top: 0; height: 2px; width: 100%; background: var(--c-signal); transform-origin: 0 50%; transform: scaleX(0); z-index: 60; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .motion-ready .reveal, .motion-ready .case-card[data-motion], .motion-ready .info-card, .motion-ready .counter, .motion-ready .pin-step { opacity: 1; transform: none; }
  .motion-ready .wp-block-image img { clip-path: none; }
  .featured-stack__item { position: static; }
}

/* static fallback for the 3D field */
.system-field.is-static { background-image: radial-gradient(circle, var(--c-line) 1.2px, transparent 1.4px); background-size: 34px 34px; opacity: 0.9; }
.system-field.is-static canvas { display: none; }

body.admin-bar .site-header { top: calc(1rem + 32px); }
@media (max-width: 782px) { body.admin-bar .site-header { top: calc(1rem + 46px); } }

.split .line-inner-mask { padding-bottom: 0.1em; margin-bottom: -0.1em; }

h1, h2, h3 { text-wrap: balance; }

/* =====================================================================
   STORY CASE STUDIES
   ===================================================================== */
.case-content > .story-chapter, .case-content > .story-close { max-width: 84rem; margin: 0 auto; padding: var(--section) var(--gutter); }
.case-content > .story-statement { max-width: none; margin: 0; padding: clamp(5rem, 14vw, 11rem) 0; }
.case-content > .overview { max-width: 84rem; padding-inline: var(--gutter); margin-inline: auto; }
.case-content > .story-chapter > * + *, .case-content > .story-close > * + * { margin-top: 0; }

.story-chapter { position: relative; }
.story-chapter__head { display: grid; gap: 1rem; margin-bottom: clamp(2.5rem, 6vw, 5rem); max-width: 60rem; }
.chapter-label { color: var(--c-signal); }
.story-title { font-size: clamp(2.25rem, 5.4vw, 5rem) !important; max-width: 18ch; line-height: 1.02; }
.story-chapter__body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 3.5rem) 2rem; }
.story-chapter__body > * { grid-column: 1 / -1; margin: 0; max-width: none; }
.story-chapter__body > .story-text { grid-column: 5 / -1; max-width: 42rem; }
.story-text > * + * { margin-top: 1.25rem; }
.story-text p { font-size: var(--wp--preset--font-size--lead); line-height: 1.55; color: var(--c-ink); }
.story-chapter__body > .pullquote { grid-column: 3 / -1; }
@media (max-width: 900px) { .story-chapter__body > .story-text, .story-chapter__body > .pullquote { grid-column: 1 / -1; } }

/* statement: scrubbed words */
.story-statement { position: relative; z-index: 1; }
.statement { font-family: var(--font-display); font-size: clamp(2rem, 5.6vw, 5.5rem); line-height: 1.08; letter-spacing: -0.02em; max-width: 22ch; margin: 0; text-wrap: balance; }
.story-statement--small .statement { font-size: clamp(1.75rem, 4vw, 3.5rem); max-width: 26ch; }

/* pull quote */
.pullquote { position: relative; padding: clamp(2rem, 4vw, 3.5rem) 0 clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 4vw, 3rem); border-left: 2px solid var(--c-signal); }
.pq__text { font-family: var(--font-display); font-style: italic; font-size: clamp(1.75rem, 3.6vw, 3.25rem); line-height: 1.12; letter-spacing: -0.015em; max-width: 30ch; margin: 0; text-wrap: balance; }
.pq__who { margin-top: 1.25rem !important; }

/* problem list */
.problems { display: grid; gap: 0; border-top: 1px solid var(--c-line); }
.problem { display: grid; grid-template-columns: 4rem 1fr; gap: 1rem; align-items: baseline; padding-block: 1.1rem; border-bottom: 1px solid var(--c-line); position: relative; }
.problem__t { font-family: var(--font-display); font-size: clamp(1.4rem, 2.4vw, 2.1rem); line-height: 1.15; margin: 0; position: relative; display: inline-block; justify-self: start; }
.problem__t::after { content: ""; position: absolute; left: 0; right: 0; top: 55%; height: 1.5px; background: var(--c-signal); transform: scaleX(var(--strike, 0)); transform-origin: 0 50%; }
.problem.is-struck { --strike: 1; }
.problem.is-struck .problem__t { color: var(--c-muted); transition: color 600ms var(--ease-out) 500ms; }
.problem.is-struck .problem__t::after { transition: transform 900ms var(--ease-out) 300ms; }

/* stats */
.stats.counters { margin-block: 0; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.stats .label { max-width: 18ch; margin-top: 0.75rem; }

/* decision */
.decision { border-radius: var(--r-lg); background: var(--c-surface); box-shadow: 0 0 0 1px var(--c-line); padding: clamp(1.5rem, 4vw, 3.5rem); display: grid; gap: 1.5rem; position: relative; overflow: hidden; }
.decision::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c-signal); transform: scaleY(var(--grow, 0)); transform-origin: 50% 0; }
.decision.is-in { --grow: 1; } .decision::before { transition: transform 1200ms var(--ease-out); }
.decision__title { font-size: clamp(1.75rem, 3.4vw, 3rem) !important; max-width: 24ch; margin: 0; }
.decision__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin-top: 0.5rem; }
.decision__col .label { margin-bottom: 0.6rem; color: var(--c-signal); }
.decision__col p:last-child { margin: 0; font-size: 0.9875rem; line-height: 1.6; }
@media (max-width: 860px) { .decision__grid { grid-template-columns: 1fr; gap: 1.25rem; } }

/* method / steps row */
.steps-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0; border-top: 1px solid var(--c-line); }
.step { padding: 1.5rem 1.5rem 1.5rem 0; border-right: 1px solid var(--c-line); }
.step:last-child { border-right: 0; } .step .label { color: var(--c-signal); }
.step__t { font-size: 1.0625rem; margin: 0.75rem 0 0; }
@media (max-width: 700px) { .step { border-right: 0; border-bottom: 1px solid var(--c-line); } }

/* frames: browser-like chrome around screenshots */
.case-content figure.frame { margin: 0; position: relative; border-radius: var(--r-md); background: var(--c-surface); box-shadow: 0 0 0 1px var(--c-line), 0 40px 80px -40px rgba(0,0,0,0.35); overflow: hidden; }
.case-content figure.frame::before { content: ""; display: block; height: 1.5rem; background: color-mix(in srgb, var(--c-ink) 6%, var(--c-surface)); border-bottom: 1px solid var(--c-line); background-image: radial-gradient(circle, #ff6159 3px, transparent 3.5px), radial-gradient(circle, #ffbd2e 3px, transparent 3.5px), radial-gradient(circle, #28c941 3px, transparent 3.5px); background-size: 14px 14px; background-repeat: no-repeat; background-position: 0.8rem 50%, 1.6rem 50%, 2.4rem 50%; }
.case-content figure.frame img { width: 100%; height: auto; border-radius: 0 !important; box-shadow: none !important; cursor: zoom-in; }
.case-content figure.frame--dark { background: #111214; } .case-content figure.frame--dark::before { display: none; }
.case-content figure.frame--narrow { max-width: 44rem; margin-inline: auto; }
.case-content figcaption { padding: 0.9rem 1.1rem 1.1rem; font-size: 0.875rem; color: var(--c-muted); text-align: left; line-height: 1.5; background: var(--c-surface); }
.case-content figure.frame--dark figcaption { background: #16181b; color: #9a9da3; }
.case-content figure.frame--tilt { transform-origin: 50% 100%; will-change: transform; }

/* pan (very wide diagrams) */
.case-content figure.pan { margin: 0; border-radius: var(--r-md); background: var(--c-surface); box-shadow: 0 0 0 1px var(--c-line); overflow: hidden; position: relative; }
.pan__stage { overflow-x: auto; overflow-y: hidden; height: min(62vh, 34rem); }
.case-content figure.pan img { height: 100%; width: auto; max-width: none; border-radius: 0 !important; box-shadow: none !important; cursor: zoom-in; }
.case-content figure.pan.is-pan .pan__stage { overflow: hidden; }

/* horizontal gallery */
.hscroll { display: flex; gap: clamp(1rem, 3vw, 2rem); overflow-x: auto; scroll-snap-type: x mandatory; padding: 0.5rem 0 1.5rem; scrollbar-width: thin; }
.hscroll > figure, .hscroll > .wp-block-image { flex: 0 0 min(86%, 46rem); scroll-snap-align: start; }
.hscroll.is-pinned { overflow: hidden; display: block; padding: 0; }
.hscroll__track { display: flex; gap: clamp(1.5rem, 4vw, 3rem); width: max-content; padding-inline: var(--gutter); }
.hscroll.is-pinned .hscroll__track > figure { flex: none; width: min(70vw, 58rem); }

/* pinned sequence */
.pin-seq { display: grid; gap: 2.5rem; }
.pin-seq .seq-step { display: grid; gap: 1rem; }
.seq__cap { color: var(--c-muted); margin: 0; font-size: 0.9375rem; }
.pin-seq.is-pinned { display: grid; grid-template-columns: 17rem 1fr; gap: 2.5rem; min-height: min(86vh, 52rem); align-items: center; }
.seq-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; align-self: center; }
.seq-nav li { padding: 0.55rem 0 0.55rem 1rem; border-left: 1px solid var(--c-line); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-muted); transition: color 400ms var(--ease-out), border-color 400ms var(--ease-out), padding 500ms var(--ease-spring); }
.seq-nav li.is-active { color: var(--c-ink); border-color: var(--c-signal); padding-left: 1.5rem; }
.seq-stage { position: relative; display: grid; align-items: center; }
.seq-stage .seq-step { grid-area: 1 / 1; opacity: 0; pointer-events: none; }
.seq-stage .seq-step .label { display: none; }
.seq-stage .seq-step.is-active { opacity: 1; pointer-events: auto; }
@media (max-width: 899px) { .pin-seq.is-pinned { display: grid; grid-template-columns: 1fr; } }

/* closing */
.story-close { text-align: left; } .story-close h2 { max-width: 16ch; margin: 1rem 0; } .story-close .lede { max-width: 36rem; }

/* editor notes: only editors see these */
.todo { padding: 1.25rem 1.5rem; border: 1.5px dashed #c9a227; background: color-mix(in srgb, #ffd54a 14%, var(--c-base)); border-radius: var(--r-md); }
.todo p { margin: 0.4rem 0 0; font-size: 0.9375rem; }

/* side chapter nav */
.story-nav { position: fixed; right: 1.25rem; top: 50%; transform: translateY(-50%); z-index: 20; display: grid; gap: 0.9rem; opacity: 0; pointer-events: none; transition: opacity 500ms var(--ease-out); }
.story-nav.is-on { opacity: 1; pointer-events: auto; }
.story-nav a { position: relative; display: block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--c-line); transition: transform 500ms var(--ease-spring), background 300ms; }
.story-nav a span { position: absolute; right: 1.4rem; top: 50%; transform: translateY(-50%); white-space: nowrap; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-ink); opacity: 0; pointer-events: none; transition: opacity 300ms; background: var(--glass); padding: 0.25rem 0.6rem; border-radius: 999px; backdrop-filter: blur(10px); }
.story-nav a:hover span, .story-nav a:focus-visible span { opacity: 1; }
.story-nav a.is-active { background: var(--c-signal); transform: scale(1.6); }
@media (max-width: 1100px) { .story-nav { display: none; } }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-rows: 1fr auto; background: color-mix(in srgb, var(--c-base) 92%, transparent); backdrop-filter: blur(16px); padding: 4rem 2rem 2rem; opacity: 0; visibility: hidden; transition: opacity 400ms var(--ease-spring), visibility 0s linear 400ms; }
.lightbox.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.lightbox__stage { overflow: auto; display: flex; min-height: 0; }
.lightbox__img { margin: auto; border-radius: var(--r-md); box-shadow: 0 40px 100px -30px rgba(0,0,0,0.5); flex: none; }
.lightbox__img.is-fit { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; cursor: zoom-in; }
.lightbox__img.is-actual { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox__cap { text-align: center; color: var(--c-muted); font-size: 0.9rem; padding-top: 1rem; max-width: 52rem; margin-inline: auto; }
.lightbox__close { position: absolute; top: 1.25rem; right: 1.25rem; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; cursor: pointer; background: var(--c-ink); color: var(--c-base); font-size: 1.25rem; line-height: 1; }

/* story motion initial states (JS adds .motion-ready) */
.motion-ready .problem, .motion-ready .decision, .motion-ready .pullquote, .motion-ready .step { opacity: 0; transform: translateY(2rem); }
.motion-ready .scrub .word { opacity: 0.14; }
@media (prefers-reduced-motion: reduce) {
  .motion-ready .problem, .motion-ready .decision, .motion-ready .pullquote, .motion-ready .step { opacity: 1; transform: none; }
  .motion-ready .scrub .word { opacity: 1; } .problem { --strike: 1; } .decision { --grow: 1; }
  .seq-stage .seq-step { opacity: 1 !important; }
}

/* ---- scroll-through window for tall mockups, pairs, phones, video ---- */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2rem); align-items: start; }
@media (max-width: 700px) { .pair { grid-template-columns: 1fr; } }
.shot__stage { height: min(72vh, 44rem); overflow-y: auto; overflow-x: hidden; position: relative; scrollbar-width: thin; }
.pair .shot__stage { height: min(60vh, 36rem); }
.case-content figure.scrollshot img { width: 100%; height: auto; display: block; cursor: zoom-in; }
.case-content figure.scrollshot.is-pinned .shot__stage { overflow: hidden; }
.device-row { display: flex; justify-content: center; align-items: flex-start; gap: clamp(1rem, 4vw, 3rem); padding-block: 1rem 3rem; flex-wrap: wrap; }
.case-content figure.phone { margin: 0; background: transparent; box-shadow: none; max-width: min(20rem, 42vw); }
.case-content figure.phone img { width: 100%; height: auto; border-radius: 1.75rem !important; box-shadow: 0 0 0 1px var(--c-line), 0 40px 70px -30px rgba(0,0,0,0.45) !important; cursor: zoom-in; }
.case-content figure.wp-block-video { max-width: 64rem; margin: 0 !important; border-radius: var(--r-md); overflow: hidden; box-shadow: 0 0 0 1px var(--c-line), 0 40px 80px -40px rgba(0,0,0,0.35); }
.case-content figure.wp-block-video video { width: 100%; display: block; background: #000; }
.story-chapter__body > .wp-block-video { grid-column: 1 / -1; }

/* CV print button: hidden unless enabled in Settings > Portfolio */
.wp-block-button.cv-print { display: none !important; }
body.show-cv-print .wp-block-button.cv-print { display: inline-block !important; }
.wp-block-buttons:has(> .cv-print:only-child) { margin-top: 0; }

/* About: particle portrait */
.portrait-field { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.6s var(--ease-out); }
.portrait-field.is-ready { opacity: 1; }
.portrait-field canvas { width: 100%; height: 100%; display: block; }
.page-id-about .site-main, body:has(.portrait-field) .site-main { position: relative; z-index: 1; }
@media print { .portrait-field { display: none !important; } }

/* 3D icons beside the three leadership principles */
.pin-steps .pin-step { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(1.25rem, 3vw, 2.5rem); align-items: start; }
.pin-steps .pin-step > * { margin: 0; grid-column: 2; }
.pin-steps .pin-step > .pin-step__icon { grid-column: 1; grid-row: 1 / span 3; width: clamp(6rem, 11vw, 9.5rem); aspect-ratio: 1; opacity: 0; transform: scale(0.85); transition: opacity 900ms var(--ease-out), transform 1200ms var(--ease-spring); }
.pin-step__icon.is-ready { opacity: 1 !important; transform: none !important; }
.pin-step__icon canvas { width: 100%; height: 100%; display: block; }
.pin-steps .pin-step h3 { margin: 0.6rem 0 0.7rem; }
@media (max-width: 560px) { .pin-steps .pin-step { grid-template-columns: 4.5rem minmax(0, 1fr); } }
@media print { .pin-step__icon { display: none; } }
