/* ============================================================
   Bend Field Operations — product demos (Nov 2026)
   Loaded only by pages that show a demo (home, work).

   What this is: real captures of software the studio has built, shown in
   device frames. Websites are captured from the live site, at desktop width
   and again at phone width; apps are captured from their own code running on
   sample data. Nothing here is redrawn. The
   frames, the screen switch and the scrolling window are plain CSS: screens
   change with radio inputs and sibling selectors, so there is no JavaScript
   and nothing leaves the site's content-security policy.

   The phone frame is adapted from Devices.css v0.2.0 by Yan Zhu (MIT; see
   docs/licenses/MIT-devices-css.txt): its iPhone 14 Pro, converted to em
   units and redrawn in the site's own Basalt and Bone tones.

   Color note (Chance, Nov 19 2026): product colors appear only inside the
   captured images. Every rule in this file uses the six brand colors from
   styles.css and tones derived from them.

   Contents
   D1. Demo shell: screen switch, view switching, notes, stage
   D2. Device frames: phone, browser window
   D3. Captured screens
   ============================================================ */

/* ---------- D1. Demo shell ---------- */
.demo-set { border: 0; margin: 0; padding: 0; min-width: 0; }
.demo { position: relative; min-width: 0; }
/* the radios stay in the accessibility tree and take keyboard focus (arrow
   keys move between screens); they are drawn by their labels */
.demo-tab { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }

/* the screen switch: a site-styled index of the demo's screens */
.demo-switch { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; }
.demo-switch label { display: inline-block; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.2; color: var(--basalt); padding: 0.7rem 0.9rem 0.65rem; border: 1px solid var(--basalt); border-radius: var(--radius); background: transparent; cursor: pointer; user-select: none; }
.demo-switch label:hover { background: var(--bone); }
.demo-tab:nth-of-type(1):checked ~ .demo-switch label:nth-of-type(1),
.demo-tab:nth-of-type(2):checked ~ .demo-switch label:nth-of-type(2),
.demo-tab:nth-of-type(3):checked ~ .demo-switch label:nth-of-type(3),
.demo-tab:nth-of-type(4):checked ~ .demo-switch label:nth-of-type(4),
.demo-tab:nth-of-type(5):checked ~ .demo-switch label:nth-of-type(5),
.demo-tab:nth-of-type(6):checked ~ .demo-switch label:nth-of-type(6) { background: var(--basalt); color: var(--bone); }
.demo-tab:nth-of-type(1):focus-visible ~ .demo-switch label:nth-of-type(1),
.demo-tab:nth-of-type(2):focus-visible ~ .demo-switch label:nth-of-type(2),
.demo-tab:nth-of-type(3):focus-visible ~ .demo-switch label:nth-of-type(3),
.demo-tab:nth-of-type(4):focus-visible ~ .demo-switch label:nth-of-type(4),
.demo-tab:nth-of-type(5):focus-visible ~ .demo-switch label:nth-of-type(5),
.demo-tab:nth-of-type(6):focus-visible ~ .demo-switch label:nth-of-type(6) { outline: 3px solid var(--basalt); outline-offset: 3px; }
/* WebKit stops matching :focus-visible on a radio once the arrow keys move
   the selection, so the ring above vanished as soon as a screen was chosen
   from the keyboard. Safari does not give a radio focus on a click or tap,
   so plain :focus there is still a keyboard-only ring. The @supports test
   is one that only WebKit passes. */
@supports (font: -apple-system-body) {
  .demo-tab:nth-of-type(1):focus ~ .demo-switch label:nth-of-type(1),
  .demo-tab:nth-of-type(2):focus ~ .demo-switch label:nth-of-type(2),
  .demo-tab:nth-of-type(3):focus ~ .demo-switch label:nth-of-type(3),
  .demo-tab:nth-of-type(4):focus ~ .demo-switch label:nth-of-type(4),
  .demo-tab:nth-of-type(5):focus ~ .demo-switch label:nth-of-type(5),
  .demo-tab:nth-of-type(6):focus ~ .demo-switch label:nth-of-type(6) { outline: 3px solid var(--basalt); outline-offset: 3px; }
}

/* one view shows at a time: the nth radio shows the nth view and its note */
.demo-view { display: none; }
.demo-tab:nth-of-type(1):checked ~ .device .demo-view:nth-of-type(1),
.demo-tab:nth-of-type(2):checked ~ .device .demo-view:nth-of-type(2),
.demo-tab:nth-of-type(3):checked ~ .device .demo-view:nth-of-type(3),
.demo-tab:nth-of-type(4):checked ~ .device .demo-view:nth-of-type(4),
.demo-tab:nth-of-type(5):checked ~ .device .demo-view:nth-of-type(5),
.demo-tab:nth-of-type(6):checked ~ .device .demo-view:nth-of-type(6) { display: block; }
.demo-note { display: none; max-width: 40rem; }
.demo-tab:nth-of-type(1):checked ~ .demo-notes .demo-note:nth-of-type(1),
.demo-tab:nth-of-type(2):checked ~ .demo-notes .demo-note:nth-of-type(2),
.demo-tab:nth-of-type(3):checked ~ .demo-notes .demo-note:nth-of-type(3),
.demo-tab:nth-of-type(4):checked ~ .demo-notes .demo-note:nth-of-type(4),
.demo-tab:nth-of-type(5):checked ~ .demo-notes .demo-note:nth-of-type(5),
.demo-tab:nth-of-type(6):checked ~ .demo-notes .demo-note:nth-of-type(6) { display: block; }
.demo-note-title { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.2; letter-spacing: 0.035em; text-transform: uppercase; color: var(--basalt); margin: 0 0 0.6rem; }
.demo-note p { margin: 0 0 0.9rem; color: var(--basalt); }
.demo-note p:last-child { margin-bottom: 0; }
/* the build's standing facts sit under the note, beside the phone */
.demo-facts { list-style: none; margin: 2rem 0 0; padding: 0; max-width: 40rem; border-top: 2px solid var(--basalt); }
.demo-facts li { padding: 0.85rem 0; border-bottom: 1px solid var(--rule); font-size: var(--text-sm); color: var(--basalt-80); }
.demo-facts strong { color: var(--basalt); font-weight: 600; }
/* keep the note block a steady height so the facts do not jump between screens */
.demo--phone .demo-note { min-height: 9.5rem; }
@keyframes demo-view-in { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .demo-view, .demo-note { animation: demo-view-in 220ms ease-out both; }
  .demo-switch label { transition: background-color 160ms ease-out, color 160ms ease-out; }
}

/* layout: a phone demo sets the device beside its screen switch and notes;
   a window demo stacks switch, window, notes */
.demo--phone { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "device switch" "device notes"; column-gap: 3rem; column-gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: start; }
.demo--phone > .device { grid-area: device; }
.demo--phone > .demo-switch { grid-area: switch; }
.demo--phone > .demo-notes { grid-area: notes; }
.demo--browser > .demo-notes { margin-top: 1.75rem; }
@media (max-width: 820px) {
  .demo--phone { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "switch" "device" "notes"; }
  .demo--phone > .device { justify-self: center; margin-bottom: 2rem; }
}

/* stage: the Tuff Sand sheet a demo sits on, gridded like the home hero */
.stage { position: relative; background-color: var(--tuff); background-image: linear-gradient(to right, var(--rule-soft) 1px, transparent 1px), linear-gradient(to bottom, var(--rule-soft) 1px, transparent 1px); background-size: 3rem 3rem; border: 1px solid var(--rule); border-radius: var(--radius); padding: 2rem; padding: clamp(1.25rem, 0.5rem + 3.2vw, 3.5rem); }
.stage + .stage { margin-top: 1.5rem; }
.stage-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.5rem; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.4; color: var(--basalt); margin: 0 0 1.5rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule); }

/* ---------- D2. Device frames ---------- */
.device { position: relative; line-height: 1.3; }
.device, .device * { box-sizing: border-box; }

/* phone: Devices.css iPhone 14 Pro, in em so the frame scales by font-size.
   The screen is 23em wide at 393:852, the shape of the captures. */
.device--phone { font-size: var(--device-fs, 13px); flex: none; width: 25.24em; padding: 1.12em; border: 1px solid rgba(247, 243, 236, 0.3); border-radius: 4em; background: var(--basalt); box-shadow: inset 0 0 0.24em 0.12em rgba(247, 243, 236, 0.85), inset 0 0 0 0.35em rgba(247, 243, 236, 0.38), 0 2.4em 3.4em -1.8em rgba(28, 26, 23, 0.6); }
.device--phone .device-screen { position: relative; width: 23em; aspect-ratio: 393 / 852; border-radius: 2.89em; overflow: hidden; background: var(--basalt); }
/* sensor housing and lens */
.device--phone .device-screen::before { content: ""; position: absolute; z-index: 5; top: 0.62em; left: 50%; width: 7.08em; height: 2.06em; margin-left: -3.54em; border-radius: 1.18em; background: var(--basalt); pointer-events: none; }
.device--phone .device-screen::after { content: ""; position: absolute; z-index: 6; top: 1.39em; left: 50%; width: 0.53em; height: 0.53em; margin-left: 2.1em; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(247, 243, 236, 0.3), transparent 60%); pointer-events: none; }
/* side buttons */
.device-btns, .device-power { position: absolute; width: 0.2em; border-radius: 0.12em; background: var(--basalt); background: color-mix(in srgb, var(--bone) 32%, var(--basalt)); }
.device-btns { left: -0.16em; top: 6.8em; height: 1.9em; }
.device-btns::before, .device-btns::after { content: ""; position: absolute; left: 0; width: 100%; height: 3.66em; border-radius: inherit; background: inherit; }
.device-btns::before { top: 3.54em; }
.device-btns::after { top: 8.26em; }
.device-power { right: -0.16em; top: 11.8em; height: 5.9em; }
/* status bar, drawn over the top strip of a captured screen */
.device-status { position: absolute; z-index: 4; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; height: 3.3em; padding: 0.5em 2em 0 2.75em; font-family: var(--font-body); font-weight: 600; font-size: 1em; line-height: 1; color: var(--basalt); pointer-events: none; }
.device-status span:first-child { font-size: 0.94em; letter-spacing: 0.01em; }
.device-status .glyphs { display: inline-flex; align-items: center; gap: 0.36em; }
.device-status .glyphs i { display: block; background: currentColor; }
.device-status .glyphs i:nth-child(1) { width: 1.02em; height: 0.66em; clip-path: polygon(0 100%, 0 70%, 18% 70%, 18% 100%, 27% 100%, 27% 48%, 45% 48%, 45% 100%, 54% 100%, 54% 24%, 72% 24%, 72% 100%, 81% 100%, 81% 0, 100% 0, 100% 100%); }
.device-status .glyphs i:nth-child(2) { width: 1.5em; height: 0.7em; border-radius: 0.2em; }
/* home indicator, drawn over the bottom strip */
.shot--phone::after { content: ""; position: absolute; z-index: 4; bottom: 0.5em; left: 50%; width: 8.1em; height: 0.3em; margin-left: -4.05em; border-radius: 0.3em; background: var(--basalt); pointer-events: none; }
/* a screen whose top or bottom edge is dark takes Bone marks instead */
.status-light .device-status { color: var(--bone); }
.home-light.shot--phone::after { background: var(--bone); }

/* browser window: a ruled frame with a mono address bar */
.device--browser { width: 100%; border: 1px solid var(--basalt); border-radius: 6px; background: var(--white); overflow: hidden; box-shadow: 0 1.75rem 2.75rem -1.75rem rgba(28, 26, 23, 0.5); }
.device-chrome { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--basalt); background: var(--bone); }
.device-chrome .dots { display: inline-flex; gap: 0.3rem; flex: none; }
.device-chrome .dots i { display: block; width: 0.55rem; height: 0.55rem; border: 1px solid var(--basalt-50); border-radius: 50%; }
.device-chrome .url { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.04em; line-height: 1.2; color: var(--basalt-80); background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.3rem 0.6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device--browser .device-screen { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--white); }

/* ---------- D3. Captured screens ---------- */
.shot { position: relative; width: 100%; height: 100%; }
.shot img { display: block; width: 100%; height: auto; max-width: none; }
.shot--phone img { height: 100%; object-fit: cover; }
.shot picture { display: block; }
/* a bar the live site pins to the bottom of a phone screen: phones only */
.shot .shot-bar { display: none; }
/* a whole page, captured top to bottom, scrolls inside the window as the
   live site does */
.shot--scroll { overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--basalt-50) transparent; }
.shot--scroll:focus-visible, .shot--pan:focus-visible { outline: 3px solid var(--basalt); outline-offset: -3px; }

@media (max-width: 640px) {
  .device--browser .device-screen { aspect-ratio: 4 / 5; }
  /* the home hero's window holds one wide capture, so it keeps its own shape */
  .hero-devices .device--browser .device-screen { aspect-ratio: 16 / 10; }
  /* phones get the site's own phone layout (a second capture, chosen by the
     picture element), with any pinned bar held at the bottom of the window */
  .shot--scroll .shot-bar { display: block; position: sticky; bottom: 0; }
  .device--browser .shot--pan { overflow-x: auto; }
  .device--browser .shot--pan img { width: auto; height: 100%; }
}
@media (max-width: 430px) {
  .device--phone { --device-fs: 3.05vw; }
}
@media (forced-colors: active) {
  .device--phone, .device--browser { border: 1px solid CanvasText; }
  .demo-tab:nth-of-type(1):checked ~ .demo-switch label:nth-of-type(1),
  .demo-tab:nth-of-type(2):checked ~ .demo-switch label:nth-of-type(2),
  .demo-tab:nth-of-type(3):checked ~ .demo-switch label:nth-of-type(3),
  .demo-tab:nth-of-type(4):checked ~ .demo-switch label:nth-of-type(4),
  .demo-tab:nth-of-type(5):checked ~ .demo-switch label:nth-of-type(5),
  .demo-tab:nth-of-type(6):checked ~ .demo-switch label:nth-of-type(6) { outline: 3px solid Highlight; outline-offset: -3px; }
}
@media print {
  .demo-switch { display: none; }
  .device--phone, .device--browser { box-shadow: none; }
  .demo-view, .demo-note { animation: none; }
  .shot--scroll { overflow: hidden; }
}
/* a demo with one screen has no switch: its view and note simply show */
.demo--single .demo-view, .demo--single .demo-note { display: block; }
