/* Doze case study figures, built in HTML/CSS instead of images.
   Phones reuse the iPhone 18 Pro frame (.ff-device) and the landscape player (.dz-device / .dz-screen)
   from /demos/following-flights/following-flights.css, which must load first.

   Each figure keeps the 16:9 panel of the image it replaces. Inside, 1fu = 1px of the 1280 × 720 artboard,
   so the whole figure scales with its width. Phone screens use --u (1pt of the device) as on the demo page.
   Figures marked .dzf--flow (pure text and charts) reflow into a column on small screens instead. */

.dzf { container-type: inline-size; background: none; overflow: visible; }
/* without a panel, each figure is only as tall as its content (artboard 1280 wide) */
.dzf--stats, .dzf--th { aspect-ratio: 1280 / 440; }
.dzf--compare { aspect-ratio: 1280 / 540; }
.dzf--wf, .dzf--row { aspect-ratio: 1280 / 640; }
.dzf--tp { aspect-ratio: 1280 / 700; }
.dzf__c { position: absolute; inset: 0; --fu: calc(100cqw / 1280); --dzf-soft: #d9d9d9; color: var(--ink); }
:root[data-theme="dark"] .dzf__c { --dzf-soft: #3b3b3b; }

/* Line icons: ink shapes, soft grey fills */
.dzf-ic { display: block; fill: var(--ink); overflow: visible; }
.dzf-ic .soft { fill: var(--dzf-soft); }
.dzf-ic .ln { fill: none; stroke: var(--ink); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.dzf-ic .soft.ln { fill: var(--dzf-soft); }
.dzf-ic .ln--b { stroke-width: 5.5; }
.dzf-ic .ln--s { stroke-width: 3.2; }

/* ---------- Research insights ---------- */
.dzf--stats .dzf__c { display: grid; grid-template-columns: repeat(3, 1fr); align-content: center; padding: 0 calc(60 * var(--fu)); }
.dzf-stat { display: flex; flex-direction: column; align-items: center; text-align: center; }
.dzf-stat .dzf-ic { width: auto; height: calc(88 * var(--fu)); }
.dzf-stat__n { margin-top: calc(28 * var(--fu)); font-family: var(--font-display); font-weight: 700; font-size: calc(88 * var(--fu)); line-height: 1; letter-spacing: -.01em; }
.dzf-stat__t { margin-top: calc(18 * var(--fu)); max-width: calc(300 * var(--fu)); font-size: calc(22 * var(--fu)); line-height: 1.35; color: var(--muted); }

/* ---------- Thresholds: lux, color temperature, sound level ---------- */
.dzf--th .dzf__c { display: flex; align-items: center; justify-content: center; gap: calc(96 * var(--fu)); }
.dzf-th { display: flex; align-items: center; gap: calc(30 * var(--fu)); }
.dzf-th > .dzf-ic { width: calc(64 * var(--fu)); height: calc(64 * var(--fu)); flex: none; }
.dzf-bar { position: relative; flex: none; height: calc(320 * var(--fu)); border-radius: calc(7 * var(--fu)); overflow: hidden; }
.dzf-bar--lux { width: calc(26 * var(--fu)); background: linear-gradient(#ececec, #c4c4c4 28%, #8c8c8c 55%, #3c3c3c 80%, #1d1d1d); }
.dzf-bar--k { width: calc(42 * var(--fu)); background: linear-gradient(#5a8de0, #a6c7ee 30%, #f5f2ed 50%, #ebcb93 66%, #dea050 84%, #c8702c); }
.dzf-bar--lux i, .dzf-bar--k i { position: absolute; left: 0; right: 0; height: calc(2 * var(--fu)); background: rgba(255, 255, 255, .92); }
.dzf-bar--db { width: calc(22 * var(--fu)); display: flex; flex-direction: column; gap: calc(2.5 * var(--fu)); }
.dzf-bar--db i { flex: 1; }
.dzf-th__ls { position: relative; align-self: stretch; width: calc(150 * var(--fu)); }
.dzf-th__l { position: absolute; left: 0; right: 0; margin: 0; font-size: calc(16 * var(--fu)); line-height: 1.2; color: var(--muted); }
.dzf-th__l b { display: block; margin-bottom: calc(2 * var(--fu)); font-size: calc(22 * var(--fu)); line-height: 1.15; font-weight: 600; color: var(--ink); }

/* ---------- Without / with Doze ---------- */
.dzf--compare .dzf__c { display: flex; align-items: center; justify-content: center; gap: calc(76 * var(--fu)); }
.dzf-col { width: calc(170 * var(--fu)); display: flex; flex-direction: column; gap: calc(28 * var(--fu)); text-align: center; }
.dzf-col__h { margin-bottom: calc(4 * var(--fu)); font-weight: 600; font-size: calc(18 * var(--fu)); line-height: 1.3; color: var(--ink); }
.dzf-col__i { display: flex; flex-direction: column; align-items: center; }
.dzf-col__i .dzf-ic { width: calc(72 * var(--fu)); height: calc(72 * var(--fu)); }
.dzf-col__i p { min-height: 2.7em; margin-top: calc(10 * var(--fu)); font-size: calc(15 * var(--fu)); line-height: 1.35; color: var(--muted); }
/* right half of the screen with Doze's warm + dim layers (same blend layers as the demo animation) */
.dzf .dz-screen .dzf-half { opacity: 1; clip-path: inset(0 0 0 50%); }

/* ---------- Landscape devices ---------- */
.dzf-dev { flex: none; }
.dzf-dev .dz-device { --lu: calc(var(--dw) * var(--fu) / 916); }
.dzf .dz-screen .p { position: absolute; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u)); white-space: nowrap; }
.dzf--stack .dzf__c { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dzf--wf .dzf__c { gap: calc(58 * var(--fu)); }
.dzf--tp .dzf__c { gap: calc(46 * var(--fu)); padding-bottom: calc(42 * var(--fu)); }

/* Player with Doze off on a plain dark screen, arrow under the Doze control */
.dzf .dz-screen.dzf-player { background: #1a1818; }
.dzf-arrow-at { position: absolute; left: calc(var(--ax) * var(--lu)); top: calc(100% + 8 * var(--fu)); transform: translateX(-50%); }
.dzf-arrow { display: block; width: calc(20 * var(--fu)); height: calc(32 * var(--fu)); fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Wireframes: bare grey screens (no device frame), ink outline, pentagon placeholders for icons */
.dzf-wfdev .dz-device { width: calc(874 * var(--lu)); height: calc(402 * var(--lu)); }
.dzf .dzf-wfdev .dz-screen.wf { left: 0; top: 0; clip-path: none; border-radius: calc(40 * var(--u)); overflow: hidden;
  outline: calc(3 * var(--u)) solid #1a1a1a; outline-offset: calc(-3 * var(--u)); box-shadow: 0 calc(8 * var(--u)) calc(24 * var(--u)) rgba(0, 0, 0, .12); }
.dzf .dz-screen.wf { background: #b3b3b3; color: #1a1a1a; font-family: var(--font-body); }
.wf-pc { transform: translate(-50%, -50%); }
.wf-p { display: block; width: calc(20 * var(--u)); height: calc(20 * var(--u)); fill: none; stroke: #1a1a1a; stroke-width: 1.5; stroke-linejoin: round; }
.dzf .wf-title { width: calc(400 * var(--u)); text-align: center; font-size: calc(22 * var(--u)); line-height: calc(28 * var(--u)); font-weight: 500; }
.wf-vbar { width: calc(4 * var(--u)); height: calc(125 * var(--u)); border-radius: calc(2 * var(--u)); background: #fff; overflow: hidden; }
.wf-vbar i { position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: #1a1a1a; }
.wf-shape { width: calc(64 * var(--u)); height: calc(60 * var(--u)); }
.wf-shape::before { content: ""; position: absolute; left: 0; bottom: 0; width: calc(52 * var(--u)); height: calc(52 * var(--u)); border-radius: 50%; background: #9c9c9c; }
.wf-shape::after { content: ""; position: absolute; right: 0; top: 0; width: calc(34 * var(--u)); height: calc(30 * var(--u)); background: #9c9c9c; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.wf-prog { width: calc(var(--w) * var(--u)); height: calc(4 * var(--u)); border-radius: calc(2 * var(--u)); background: #fff; overflow: hidden; }
.wf-prog i { display: block; height: 100%; background: #1a1a1a; }
.wf-time { font-size: calc(15 * var(--u)); line-height: calc(18 * var(--u)); }
.wf-item { display: flex; align-items: center; gap: calc(8 * var(--u)); font-size: calc(15 * var(--u)); line-height: calc(20 * var(--u)); letter-spacing: .02em; }
.wf-btn { width: calc(97 * var(--u)); height: calc(38 * var(--u)); box-sizing: border-box; display: grid; place-items: center; border: calc(2 * var(--u)) solid #1a1a1a; border-radius: calc(4 * var(--u)); background: #fff; font-size: calc(14 * var(--u)); }
.wf-home { width: calc(107 * var(--u)); height: calc(5 * var(--u)); border-radius: 99px; background: #6e6e6e; }

/* ---------- Portrait devices: App Settings (Figma Doze Feature 109:6360) ---------- */
.dzf--row .dzf__c { display: flex; align-items: center; justify-content: center; gap: calc(61 * var(--fu)); }
.dzf-pdev { flex: none; }
.dzf-pdev .ff-device { --w: calc(287 * var(--fu)); }
/* Screen 402 × 874 pt, scaled 1pt over the bezel edge like the demo phone (6pt black border, 62pt corners) */
.dzs { position: absolute; left: calc(19 * var(--u)); top: calc(21 * var(--u)); width: calc(402 * var(--u)); height: calc(874 * var(--u));
  transform: scale(1.004975, 1.002288); border-radius: calc(62 * var(--u)); clip-path: inset(0 round calc(62 * var(--u))); overflow: hidden; isolation: isolate;
  background: #1a1818; color: #fff; text-align: left; font-family: "Netflix Sans", -apple-system, "Helvetica Neue", system-ui, sans-serif; }
.dzs .p { position: absolute; left: calc(var(--x) * var(--u)); top: calc(var(--y) * var(--u)); white-space: nowrap; }
.dzs-ic { display: block; width: calc(24 * var(--u)); height: calc(24 * var(--u)); fill: #fff; }
.dzs-title { font-weight: 500; font-size: calc(20 * var(--u)); line-height: calc(28 * var(--u)); }
.dzs-h { font-weight: 500; font-size: calc(16 * var(--u)); line-height: calc(20.8 * var(--u)); }
.dzs-t { font-size: calc(14 * var(--u)); line-height: calc(20.3 * var(--u)); }
.dzs-s { font-size: calc(12 * var(--u)); line-height: calc(14.4 * var(--u)); color: #a6a4a4; }
.dzs .dzs-s--w { color: #e6e6e6; }
.dzs-row { width: calc(402 * var(--u)); height: calc(56 * var(--u)); background: #262526; }
.dzs-home { width: calc(144 * var(--u)); height: calc(5 * var(--u)); border-radius: 99px; background: #fff; }
.dzs-scrim { width: calc(402 * var(--u)); height: calc(874 * var(--u)); background: rgba(26, 24, 24, .85); }
/* Switch: 27.2 × 11.2 track, 16pt knob */
.dzs-sw { width: calc(32 * var(--u)); height: calc(32 * var(--u)); }
.dzs-sw::before { content: ""; position: absolute; left: calc(2.4 * var(--u)); top: calc(10.4 * var(--u)); width: calc(27.2 * var(--u)); height: calc(11.2 * var(--u)); border-radius: calc(7 * var(--u)); background: #a6a4a4; }
.dzs-sw i { position: absolute; left: calc(2.4 * var(--u)); top: calc(8 * var(--u)); width: calc(16 * var(--u)); height: calc(16 * var(--u)); border-radius: 50%; background: #fff;
  box-shadow: 0 calc(1 * var(--u)) calc(3 * var(--u)) rgba(0, 0, 0, .2), 0 calc(2 * var(--u)) calc(1 * var(--u)) rgba(0, 0, 0, .12), 0 calc(1 * var(--u)) calc(1 * var(--u)) rgba(0, 0, 0, .14); }
.dzs-sw.is-on::before { background: #008bff; }
.dzs-sw.is-on i { left: calc(13.6 * var(--u)); }
/* Color Temperature dialog */
.dzs-dialog { width: calc(360 * var(--u)); height: calc(var(--h) * var(--u)); border-radius: calc(4 * var(--u)); background: #595758;
  box-shadow: 0 calc(8 * var(--u)) calc(10 * var(--u)) rgba(0, 0, 0, .2), 0 calc(6 * var(--u)) calc(30 * var(--u)) rgba(0, 0, 0, .12), 0 calc(16 * var(--u)) calc(24 * var(--u)) rgba(0, 0, 0, .14); }
.dzs-dh { font-size: calc(18 * var(--u)); line-height: calc(24 * var(--u)); }
.dzs-opt { font-size: calc(16 * var(--u)); line-height: calc(22 * var(--u)); }
.dzs-btn { font-size: calc(14 * var(--u)); line-height: calc(14 * var(--u)); }
.dzs-radio { width: calc(32 * var(--u)); height: calc(32 * var(--u)); --rc: #e6e6e6; }
.dzs-radio::before { content: ""; position: absolute; left: calc(6 * var(--u)); top: calc(6 * var(--u)); width: calc(20 * var(--u)); height: calc(20 * var(--u)); box-sizing: border-box;
  border: calc(1.75 * var(--u)) solid var(--rc); border-radius: 50%; }
.dzs-radio.is-on { --rc: #008bff; }
.dzs-radio.is-on::after { content: ""; position: absolute; left: calc(11 * var(--u)); top: calc(11 * var(--u)); width: calc(10 * var(--u)); height: calc(10 * var(--u)); border-radius: 50%; background: var(--rc); }
/* with Automatic on, the presets are disabled */
.dzs-dialog.is-disabled .dzs-radio { --rc: #737272; }
.dzs-dialog.is-disabled .dzs-opt { color: #a6a4a4; }
/* Slider variant: 4 stops (Neutral → Extra Warm), value in --v */
.dzs-slider { width: calc(312 * var(--u)); height: calc(20 * var(--u)); }
.dzs-slider::before, .dzs-slider::after { content: ""; position: absolute; left: 0; top: calc(8 * var(--u)); height: calc(4 * var(--u)); border-radius: calc(2 * var(--u)); }
.dzs-slider::before { right: 0; background: #a6a4a4; }
.dzs-slider::after { width: var(--v); background: #008bff; }
.dzs-slider b { position: absolute; z-index: 1; top: calc(8.5 * var(--u)); width: calc(3 * var(--u)); height: calc(3 * var(--u)); border-radius: 50%; background: rgba(255, 255, 255, .75); transform: translateX(-50%); }
.dzs-slider i { position: absolute; z-index: 2; left: var(--v); top: 0; width: calc(20 * var(--u)); height: calc(20 * var(--u)); border-radius: 50%; background: #008bff; transform: translateX(-50%);
  box-shadow: 0 calc(1 * var(--u)) calc(3 * var(--u)) rgba(0, 0, 0, .3); }

/* ---------- Small screens: text figures reflow into a column ---------- */
@media (max-width: 767.98px) {
  .dzf--flow { aspect-ratio: auto; }
  .dzf--flow .dzf__c { position: relative; --fu: .7px; }
  .dzf--stats .dzf__c { grid-template-columns: 1fr; gap: 44px; padding: 48px 20px; }
  .dzf--th .dzf__c { flex-direction: column; align-items: flex-start; gap: 40px; padding: 44px 0 44px max(24px, calc(50% - 150px)); }
}
