/* NIVAL — case page. Self-contained: nothing is borrowed from another case. */
.nival-case .nv-media{padding:0 var(--gut) clamp(35px,6vw,90px)}
.nv-figure{margin:0 0 clamp(24px,4vw,65px);min-width:0;position:relative}
.nv-figure img{display:block;width:100%;height:auto;background:#e7eaee}
.nv-figure figcaption{font-size:clamp(11px,.85vw,13px);line-height:1.6;padding-top:12px;color:var(--mute)}
.nv-grid{display:grid;gap:clamp(16px,2.4vw,34px)}
.nv-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.nv-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.nv-grid .nv-figure{margin-bottom:0}
.nv-chapters{margin:0 var(--gut);padding:25px 0;display:flex;flex-wrap:wrap;gap:22px 35px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.nv-chapters a{color:inherit;text-underline-offset:5px;font-size:13px;line-height:1.7;min-height:44px;display:flex;align-items:center}

/* pretty link out to the live site, sized like the toolbar buttons */
.nv-open{display:inline-flex;align-items:center;gap:.5em;min-height:44px;color:inherit;text-underline-offset:5px;font-size:13px;line-height:1.7;white-space:nowrap}
.nv-open b{font-weight:500;color:var(--red)}

@media (max-width:900px){
    .nv-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:600px){
  .nv-grid-2,.nv-grid-3{grid-template-columns:1fr}
}

/* ---- interactive preview (device frame, toolbar, stage) ---- */
.nv-live{padding:clamp(50px,7vw,110px) var(--gut);border-top:1px solid var(--line);scroll-margin-top:110px}
.nv-live-head{display:grid;grid-template-columns:1fr .65fr;gap:8vw;align-items:end;margin-bottom:38px}
.nv-live h2{font:800 clamp(32px,4.6vw,68px)/1.08 var(--f-display);margin:22px 0 0;max-width:700px}
.nv-live-head p{font-size:clamp(14px,1.2vw,18px);line-height:1.75;margin:0}
.nv-toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px 25px;flex-wrap:wrap;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:14px 0;margin-bottom:35px}
.nv-toolbar button,.nv-menu-footer button,.nv-return-live{font:500 12px/1.5 var(--f-body);color:inherit;background:none;border:0;padding:12px 0;cursor:pointer;min-height:44px;text-decoration:none}
.nv-segment,.nv-tools{display:flex;gap:22px;flex-wrap:wrap;align-items:center}
.nv-segment button{border-bottom:2px solid transparent;color:var(--mute,#6b6b70)}
/* was #747479 — 4.04:1 on var(--paper); --mute is 4.61:1 (WCAG 1.4.3) */
.nv-segment button[aria-pressed=true]{border-bottom-color:var(--red);color:var(--ink)}
.nv-tools button{border-bottom:1px solid var(--line)}
.nv-demo-layout{display:grid;grid-template-columns:.6fr 1fr;gap:6vw;align-items:center}
.nv-demo-notes ol{list-style:none;padding:0;margin:24px 0}
.nv-demo-notes li{padding:18px 0;border-bottom:1px solid var(--line)}
.nv-demo-notes button{padding:8px 0;background:none;border:0;font:500 clamp(14px,1.3vw,19px)/1.5 var(--f-body);text-align:left;cursor:pointer;color:inherit}
.nv-demo-notes button:hover{color:var(--red)}
.nv-demo-notes p{font-size:13px;line-height:1.75;max-width:350px;margin:7px 0 0;color:var(--mute)}
.nv-hint{padding-top:15px;font-size:11px!important}
.nv-stage{min-width:0;display:flex;justify-content:center;padding:20px 0 35px;position:relative;background:#e7e7e7;border-radius:3px}
.nv-device-space{position:relative;flex-shrink:0}
.nv-device{position:absolute;top:0;left:0;width:390px;height:800px;box-sizing:border-box;border:2px solid #303033;background:#202023;border-radius:40px;padding:24px 12px;transform-origin:top left;box-shadow:0 18px 40px #1f202414}
.nv-viewport{width:100%;height:100%;overflow:hidden;border-radius:22px;background:#fafaf7}
.nv-viewport iframe{width:100%;height:100%;display:block;border:0;background:#fafaf7;pointer-events:auto}
.nv-camera{position:absolute;width:38px;height:5px;border-radius:5px;background:#09090a;top:10px;left:calc(50% - 19px)}
.nv-home{position:absolute;width:96px;height:4px;border-radius:4px;background:#a4a4a6;bottom:10px;left:calc(50% - 48px)}
.nv-device-browser{display:none}
.nv-device[data-mode=desktop]{width:1280px;height:830px;border:1px solid #303033;border-radius:8px;background:#25252a;padding:38px 0 0;box-shadow:0 12px 40px #1f20241a}
.nv-device[data-mode=desktop] .nv-viewport{border-radius:0 0 7px 7px}
.nv-device[data-mode=desktop] .nv-camera,.nv-device[data-mode=desktop] .nv-home{display:none}
.nv-device[data-mode=desktop] .nv-device-browser{display:flex;position:absolute;inset:0 0 auto;align-items:center;height:38px;gap:7px;padding:0 15px;color:#ddd;font:11px/1 var(--f-body)}
.nv-device-browser i{width:7px;height:7px;border-radius:50%;border:1px solid #919194}
.nv-device-browser span{margin:auto}
.nv-demo-layout:has(.is-desktop){grid-template-columns:1fr}
.nv-demo-layout:has(.is-desktop) .nv-demo-notes{display:none}
.nv-demo-dialog{padding:0;border:1px solid var(--line);width:calc(100% - 24px);height:calc(100svh - 24px);max-width:1500px;max-height:none;color:inherit;background:var(--paper);overscroll-behavior:contain}
.nv-demo-dialog::backdrop,.nv-lightbox::backdrop{background:#141416bc;backdrop-filter:blur(5px)}
.nv-demo-dialog .nv-live{padding:25px clamp(20px,4vw,70px);border:0}
.nv-demo-dialog .nv-live-head{display:none}
.nv-demo-dialog .nv-toolbar{position:sticky;top:0;z-index:2;background:var(--paper)}
.nv-demo-dialog .nv-stage{background:none}
@media(max-width:760px){.nv-live-head,.nv-demo-layout{grid-template-columns:1fr;gap:25px}.nv-live-head p{max-width:500px}.nv-live h2{font-size:clamp(26px,7.4vw,44px)}.nv-demo-notes{order:2}.nv-stage{order:1;padding:15px 10px 20px}.nv-demo-notes ol{display:grid;grid-template-columns:1fr;gap:0}.nv-segment,.nv-tools{gap:10px 18px}.nv-toolbar{margin-bottom:20px;gap:10px}.nv-toolbar button{font-size:11px}.nv-demo-dialog{width:calc(100% - 12px);height:calc(100svh - 12px)}.nv-demo-dialog .nv-live{padding:15px}.nv-demo-dialog .nv-demo-notes{display:none}.nv-demo-dialog .nv-toolbar{padding-top:0}.nv-demo-dialog .nv-stage{padding:10px 0}}
@media(max-width:760px){.nv-toolbar{align-items:flex-start;gap:8px 18px}.nv-toolbar .pw-kicker{width:100%}.nv-segment,.nv-tools{min-width:0;gap:5px 16px}.nv-toolbar button,.nv-menu-footer button,.nv-return-live{font-size:12px;line-height:1.5;white-space:normal;text-align:left}.nv-demo-notes p,.nv-hint{font-size:12px!important;line-height:1.65}}

.nival-case .nv-open b{display:none}

/* Phone: case headings never push the page wider than the screen */
.nival-case .pw-case-copy>div{min-width:0}
@media (max-width:760px){
  .nival-case .pw-case-copy h2{font-size:clamp(40px,11vw,68px);overflow-wrap:anywhere;line-height:.95}
}
.nival-case .pw-actions{display:flex;flex-wrap:wrap;gap:12px 28px;min-width:0}
.nival-case .pw-actions a{min-width:0;overflow-wrap:anywhere}
.nival-case .pw-exit>div{min-width:0}
.nival-case .pw-actions a{white-space:normal}

/* NIVAL: concept disclosure + phone trio */
.nv-note{margin:0 var(--gut) clamp(35px,6vw,90px);padding:22px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);display:grid;grid-template-columns:auto 1fr;gap:12px 28px;align-items:baseline}
.nv-note p{margin:0;font-size:clamp(13px,1.1vw,15px);line-height:1.7;color:var(--mute);max-width:760px}
.nv-grid-phones{grid-template-columns:repeat(3,minmax(0,1fr));max-width:980px}
.nv-grid-phones .nv-figure img{background:#fafaf7;box-shadow:0 0 0 1px var(--line)}
@media (max-width:600px){.nv-note{grid-template-columns:1fr}.nv-grid-phones{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.nv-grid-phones figcaption{font-size:10px}}

/* Phone: the long script line and the closing heading stay inside the screen */
@media (max-width:760px){
  .nival-case .pw-case-script{font-size:clamp(30px,9vw,64px);left:0;right:0;width:auto;text-align:center;transform:translateY(-60%) rotate(-7deg);white-space:nowrap}
  .nival-case .pw-exit h2{font-size:clamp(40px,11vw,68px);overflow-wrap:anywhere;line-height:.95}
}

/* Switchable figures: light on / off, warm / neutral / cool */
.nival-case .nv-media-narrow{display:block}
.nv-switch{max-width:1100px;margin-left:auto;margin-right:auto}
.nv-switch-ctl{display:flex;gap:6px 22px;flex-wrap:wrap;padding:0 0 12px}
.nv-switch-ctl button{font:500 12px/1.5 var(--f-body);color:var(--mute,#6b6b70);background:none;border:0;border-bottom:2px solid transparent;padding:12px 0;min-height:44px;cursor:pointer}
.nv-switch-ctl button[aria-pressed=true]{color:var(--ink);border-bottom-color:var(--red)}
.nv-switch-stage{position:relative;background:#e7eaee;overflow:hidden}
.nv-switch-stage .nv-layer{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;transition:opacity .45s ease}
.nv-switch-stage .nv-layer.is-on{opacity:1}
@media (prefers-reduced-motion:reduce){.nv-switch-stage .nv-layer{transition:none}}
.nv-segment button[aria-pressed=true]{border-bottom-color:var(--red);color:var(--ink)}
.nv-toolbar .nv-segment{gap:18px}
.nv-toolbar button:focus-visible,.nv-switch-ctl button:focus-visible{outline:2px solid var(--red);outline-offset:3px}

/* Phone: the preview is shown at its real size (no scaling), so text stays sharp */
@media (max-width:760px){
  .nv-device[data-mode=mobile]{padding:14px 7px;border-radius:30px}
  .nv-device[data-mode=mobile] .nv-viewport{border-radius:18px}
  .nv-device[data-mode=mobile] .nv-camera{top:5px}
  .nv-device[data-mode=mobile] .nv-home{display:none}
  .nv-stage{padding:12px 8px}
  .nv-toolbar{flex-direction:column;align-items:flex-start}
}

/* Decisions list and portrait switch */
.nv-steps{list-style:none;margin:0;padding:0;counter-reset:d}
.nv-steps li{padding:18px 0;border-bottom:1px solid var(--line);counter-increment:d}
.nv-steps li:first-child{border-top:1px solid var(--line)}
.nv-steps b{display:block;font-weight:500;font-size:clamp(16px,1.4vw,20px);line-height:1.4}
.nv-steps b::before{content:"0" counter(d);color:var(--red);font:500 12px/1 var(--f-body);letter-spacing:.12em;margin-right:16px}
.nv-steps p{margin:8px 0 0!important;font-size:clamp(14px,1.2vw,16px)!important;color:var(--mute)}
.nv-switch.nv-switch-portrait{max-width:620px}

/* Long headings: keep every word inside its own column on desktop */
@media (min-width:761px){
  .nival-case .pw-case-copy h2{font-size:clamp(56px,7vw,112px);overflow-wrap:anywhere}
  .nival-case #decisions h2{font-size:clamp(48px,5.4vw,86px)}
}
