/* Moran Karny portfolio — page layer shared by every page. Layout only, from the system's tokens in mk.css. */
:root { color-scheme: dark; }
html, body { background: var(--ink); }
body { margin: 0; }
.question-lg { font-family: var(--font-display); font-size: 44px; line-height: 1.15; font-weight: 300; letter-spacing: -0.44px; }
.mk-section, .mk-header, .mk-band { padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.mk-header .mk-link, .mk-footer .mk-link { display: inline-block; padding-block: 4px; }
.mk p, .mk figcaption { text-wrap: pretty; }
.mk h1, .mk h2, .mk h3 { text-wrap: pretty; }
.mk h4 { margin: 0; }
.mk-frame img { height: auto; }
main:focus { outline: none; }

/* Skip link */
.s-skip { position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 50; padding: 10px 16px; border-radius: 999px; background: var(--periwinkle); color: var(--ink); font: 600 15px/1.2 var(--font-sans); text-decoration: none; transform: translateY(-200%); }
.s-skip:focus-visible { transform: none; outline: 2px solid var(--paper); outline-offset: 2px; }

/* Side nav for case pages, from 1400px */
.s-side { position: fixed; left: max(20px, env(safe-area-inset-left, 0px)); top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: 4px; font: 400 13px/1.2 var(--font-sans); mix-blend-mode: difference; }
.s-side a { color: #a9a9a4; text-decoration: none; padding: 6px 8px 6px 14px; border-left: 1px solid #5e5e5a; transition: color .15s, border-color .15s; }
.s-side a:hover, .s-side a.on { color: #f1f1ee; border-left-color: #f1f1ee; }
.s-side a:focus-visible { outline: 2px solid #f1f1ee; outline-offset: 2px; }
@media (max-width: 1399px) { .s-side { display: none; } }

/* Shared blocks */
.s-block { display: flex; flex-direction: column; gap: var(--space-28); padding-top: var(--space-40); border-top: 1px solid var(--hairline); }
.s-items { display: flex; flex-direction: column; gap: var(--space-20); }
.s-items .mk-reason { gap: var(--space-4); padding-top: var(--space-10); border-top-width: 1px; }
.s-items .mk-reason__body strong, .s-items .mk-reason__body b { color: var(--text); font-weight: 600; }
.s-split { display: grid; grid-template-columns: var(--column-side) minmax(0, 1fr); gap: var(--space-48); align-items: start; }
.s-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-32); align-items: start; }
.s-lead { color: var(--text-body); max-width: var(--measure-text); }
.s-lead strong, .s-lead b { color: var(--text); font-weight: 600; }
.s-trade { color: var(--text-body); max-width: var(--measure-text); }
.s-trade strong { color: var(--text); font-weight: 600; }
.mk-intro__title { max-width: 980px; }
.mk-cta__title { max-width: none; text-wrap: balance; }

/* Highlight frames on screenshots (periwinkle, 4.5:1 on white) */
.s-hl { position: relative; }
.s-hl > img { display: block; width: 100%; height: auto; }
.s-fr { position: absolute; border: 1.5px solid #5f69e6; background: rgba(174,182,255,.18); border-radius: 4px; pointer-events: none; }

/* Stepper: tabs over one screen (email reuse, destination) */
.s-step { display: flex; flex-direction: column; gap: var(--space-24); }
.s-step__panel { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-40); align-items: start; }
.s-step__stage { display: grid; }
.s-step__stage > .s-step__panel { grid-area: 1 / 1; }
.s-step__stage > .s-step__panel[hidden] { display: grid; visibility: hidden; }
.s-step__panel { transition: opacity .35s ease; }
.s-step__stage > .s-step__panel[hidden] { opacity: 0; }
@media (max-width: 1000px) { .s-step__stage > .s-step__panel[hidden] { display: grid; } }
/* Dim everything outside the highlighted areas */
.s-dim { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.s-dim path { fill: rgba(20,20,20,.42); fill-rule: evenodd; }
.s-hl.has-dim .s-fr { display: none; }
/* Lightbox: close on its own at the top right; count, caption and arrows in one row right above the image */
.lb { position: fixed; inset: 0; z-index: 100; background: var(--ink); color: var(--paper); font-family: var(--font-sans); }
.lb[hidden] { display: none; }
.lb__close { position: absolute; top: max(16px, env(safe-area-inset-top, 0px)); right: max(20px, env(safe-area-inset-right, 0px)); z-index: 2; }
.lb__stage { position: absolute; inset: 72px max(24px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px)); overflow: auto; display: grid; place-items: center; overscroll-behavior: contain; }
.lb__fig { margin: 0; display: flex; flex-direction: column; gap: 12px; width: fit-content; max-width: min(1200px, 100%); }
.lb__top { width: 0; min-width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.lb__ctl { display: flex; gap: 8px; }
.lb__ctl[hidden], .lb__count[hidden] { display: none; }
.lb__count { font: 400 14px/1 var(--font-sans); color: var(--ash-400); font-variant-numeric: tabular-nums; }
.lb__btn { width: 40px; height: 40px; padding: 0; border-radius: 999px; border: 1px solid var(--stone-800); background: transparent; color: var(--paper); display: inline-grid; place-items: center; cursor: pointer; transition: border-color .15s; }
.lb__btn:hover { border-color: var(--ash-400); }
.lb__btn:focus-visible { outline: 2px solid var(--periwinkle); outline-offset: 3px; }
.lb__btn svg { width: 18px; height: 18px; }
.lb__fig img { display: block; max-width: 100%; max-height: calc(100vh - 72px - 24px - 64px - 32px); width: auto; height: auto; border-radius: var(--radius-card); background: #fff; }
.lb__stage.is-tall { place-items: start center; }
.lb__stage.is-tall .lb__fig { width: min(720px, 100%); }
.lb__stage.is-tall .lb__fig img { max-height: none; width: 100%; }
.lb__cap { font: 400 15px/1.5 var(--font-sans); color: var(--ash-300); margin: 0; min-width: 0; }
.lb__cap b { color: var(--paper); font-weight: 600; }
.lb__note { margin: 0; font: 400 13px/1.3 var(--font-sans); color: var(--ash-400); }
img[data-zoom] { cursor: zoom-in; }
.s-step__bar { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-16); }
.s-step__pause { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 10px; border-radius: 999px; border: 1px solid var(--hairline-strong); background: transparent; color: var(--text); font: 500 14px/1 var(--font-sans); cursor: pointer; }
.s-step__pause:hover { border-color: var(--text-muted); }
.s-step__pause:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.s-step__pause svg { width: 16px; height: 16px; }
.s-step__note { display: flex; flex-direction: column; gap: var(--space-10); }
.s-step__note .card-title { color: var(--text); }
.s-step__note p { color: var(--text-body); }
.s-step__tag { align-self: flex-start; }
.mk-tab:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) { .mk * { transition: none !important; } }
@media (max-width: 1100px) { :root { --gutter: 56px; } }
@media (max-width: 1000px) { .s-step__panel { grid-template-columns: minmax(0, 1fr); gap: var(--space-20); } }
@media (max-width: 820px) {
  .mk-section, .mk-header, .mk-band { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
  .mk-wordmark { white-space: nowrap; }
  .mk-header .mk-nav { gap: var(--space-16); flex-wrap: nowrap; }
  .s-split, .s-pair { grid-template-columns: minmax(0, 1fr); gap: var(--space-24); }
  .mk .question-lg { font-size: 32px; letter-spacing: -0.32px; }
}

@media (max-width: 820px) { .s-step__bar { flex-direction: column; align-items: flex-start; gap: var(--space-12); } }
@media (max-width: 640px) { .lb__top { grid-template-columns: minmax(0,1fr) auto; } .lb__cap { grid-column: 1 / -1; grid-row: 2; } }
/* Back to top (case pages, below 1400px where the side nav is hidden) */
.s-top { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 30; width: 48px; height: 48px; border-radius: 999px; border: 0; background: var(--periwinkle); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 16px rgba(20,20,20,.18); transition: background .15s, transform .15s; }
.s-top[hidden] { display: none; }
.s-top:hover { background: var(--periwinkle-tint); }
.s-top:focus-visible { outline: 2px solid var(--focus-ring, #141414); outline-offset: 3px; }
.s-top svg { width: 22px; height: 22px; }
@media (min-width: 1400px) { .s-top { display: none; } }
@media (prefers-reduced-motion: reduce) { .s-top { transition: none; } }

/* Sticky header: solid at the top of the page, frosted ink glass once the page scrolls */
html { scroll-padding-top: 72px; }
.mk-header { position: sticky; top: 0; z-index: 40; transition: background-color .25s ease, border-color .25s ease; }
.mk-header.is-stuck { background: rgba(20,20,20,.8); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); border-bottom-color: rgba(241,241,238,.08); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .mk-header.is-stuck { background: rgba(20,20,20,.94); } }
@media (prefers-reduced-motion: reduce) { .mk-header { transition: none; } }

/* Viewer: screens with their own transparent rounded corners (phones) show without the white card */
.lb__fig img.is-bare { background: transparent; border-radius: 0; }
.lb__stage.is-tall .lb__fig { width: min(1200px, 100%); }
.lb__stage.is-tall .lb__fig img { align-self: center; max-width: 100%; }

/* Viewer layout per Moran's Figma frame (Behaviors page, 529:108176): small arrows with the count between them, the caption on its own line under them at full width, the image 30px below. Always top-aligned; content up to 1200 wide (120px side margins at 1440); close 20px from the top, 23px from the right. */
.lb__close { top: max(20px, env(safe-area-inset-top, 0px)); right: max(23px, env(safe-area-inset-right, 0px)); }
.lb__stage, .lb__stage.is-tall { place-items: start center; }
.lb__fig, .lb__stage.is-tall .lb__fig { width: min(1200px, 100%); max-width: min(1200px, 100%); gap: 30px; }
.lb__top, .lb__top.is-multi { width: auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 6px; }
.lb__ctl { display: contents; }
.lb__ctl[hidden], .lb__count[hidden] { display: none !important; }
.lb__prev { order: 1; } .lb__count { order: 2; flex: none; font: 400 14px/14px var(--font-sans); } .lb__next { order: 3; }
.lb__cap { order: 4; flex: 0 0 100%; max-width: none; }
.lb__top .lb__btn { width: 24px; height: 24px; } .lb__top .lb__btn svg { width: 14px; height: 14px; }
.lb__fig img, .lb__stage.is-tall .lb__fig img { align-self: flex-start; } /* images left-aligned with the caption */
.lb__fig img { max-height: calc(100vh - 72px - 24px - 106px); }
@media (max-width: 640px) { .lb__close { top: max(16px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); } .lb__fig, .lb__stage.is-tall .lb__fig { gap: 20px; } }

.lb__cap .lb__title { display: block; }
