.device-phone, .device-tablet, .device-laptop { --f1: oklch(0.3 0.004 270); --f2: oklch(0.52 0.004 270); --f3: oklch(0.22 0.004 270); --glass: oklch(0.1 0.003 270); position: relative; flex: none; isolation: isolate; }
.device-phone--island, .device-laptop { --f1: oklch(0.62 0.008 80); --f2: oklch(0.84 0.006 80); --f3: oklch(0.5 0.008 80); }
.device-laptop { --f1: oklch(0.8 0.004 250); --f2: oklch(0.95 0.002 250); --f3: oklch(0.66 0.005 250); }
.device-phone.device--graphite, .device-tablet.device--graphite, .device-laptop.device--graphite { --f1: oklch(0.3 0.004 270); --f2: oklch(0.52 0.004 270); --f3: oklch(0.22 0.004 270); }
.device-phone.device--silver, .device-tablet.device--silver, .device-laptop.device--silver { --f1: oklch(0.8 0.004 250); --f2: oklch(0.95 0.002 250); --f3: oklch(0.66 0.005 250); }
.device-phone.device--titanium, .device-tablet.device--titanium, .device-laptop.device--titanium { --f1: oklch(0.62 0.008 80); --f2: oklch(0.84 0.006 80); --f3: oklch(0.5 0.008 80); }

/* a. THE PHONE. Two variants, both without any brand mark:
   .device-phone                 the Android-like phone: a punch-hole camera, a gesture bar, power key and volume rocker on the right
   .device-phone--island         the iPhone-like phone: a pill-shaped camera island; on the left the action button and two
                                 separate volume buttons, on the right the side button
   Pick one and keep its traits whole: never an island with Android buttons, never a punch-hole with an action button.
   <div class="device-phone device-phone--island" style="--device-w:320px">
     <div class="device-phone__screen">
       <div class="device-status"><time>9:41</time><span class="device-status__icons"><i class="i-signal"></i><i class="i-wifi"></i><i class="i-battery"></i></span></div>
       <div class="device-app">…the app's real screen, written in em…</div>
     </div>
   </div>
   A screenshot instead: <img class="device-shot" src="…" alt="…"> as the only child of the screen (it has its own status bar).
   A dark app: add .device-screen--dark to the screen (the status bar and the home bar turn light). */
.device-phone { width: var(--device-w, 300px); aspect-ratio: 9 / 19.5; font-size: calc(var(--device-w, 300px) / 30); padding: 0.26em; border-radius: 4.6em;
  background: linear-gradient(100deg, var(--f3), var(--f2) 9%, var(--f1) 22%, var(--f1) 78%, var(--f2) 91%, var(--f3));
  box-shadow: inset 0 0 0 0.05em color-mix(in oklch, white 30%, transparent), 0 0 0 0.04em color-mix(in oklch, black 45%, transparent), 0 0.15em 0.3em color-mix(in oklch, var(--shadow-tint) 20%, transparent), 0 2.4em 4.5em -1.2em color-mix(in oklch, var(--shadow-tint) 42%, transparent); }
.device-phone--island { border-radius: 4.75em; }
/* the side buttons: outside the frame, behind it, by a hair (positions in em on a 65em-high phone, from real phones:
   iPhone: action button from 20.5 to 25% of the height, volume up 28.5 to 36%, volume down 38 to 45.5%, side button 31 to 43% on the right;
   Android: power key at about 22% on the right, volume rocker at about 33% below it, nothing on the left) */
.device-phone::before, .device-phone::after { content: ""; position: absolute; top: 0; z-index: -1; width: 0.34em; height: 100%; --b: linear-gradient(90deg, var(--f3), var(--f2) 45%, var(--f1)); }
.device-phone::before { left: -0.28em; background: none; }
.device-phone::after { right: -0.28em; background: var(--b) 0 14.4em / 100% 4.2em no-repeat, var(--b) 0 21.2em / 100% 8.4em no-repeat; }
.device-phone--island::before { background: var(--b) 0 13.3em / 100% 3em no-repeat, var(--b) 0 18.5em / 100% 4.9em no-repeat, var(--b) 0 24.7em / 100% 4.9em no-repeat; }
.device-phone--island::after { background: var(--b) 0 20.2em / 100% 7.7em no-repeat; }
/* the screen: its black border IS the bezel, even on all four sides; the inside radius is about 12% of the width */
.device-phone__screen { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 0.78em solid var(--glass); border-radius: 4.34em; background: var(--card); color: var(--ink); font: 400 1em / 1.3 var(--f-text); box-shadow: 0 0 0 0.04em color-mix(in oklch, white 12%, transparent); }
.device-phone--island .device-phone__screen { border-radius: 4.49em; }
/* the camera: a punch-hole (Android-like) or the island (iPhone-like, a pill), always centered, always above the content */
.device-phone__screen::before { content: ""; position: absolute; z-index: 20; left: 50%; top: 0.95em; width: 1em; height: 1em; translate: -50% 0; border-radius: 50%; background: radial-gradient(circle at 38% 36%, oklch(0.42 0.04 260) 0 12%, var(--glass) 30%); box-shadow: 0 0 0 0.12em color-mix(in oklch, var(--glass) 60%, transparent); }
.device-phone--island .device-phone__screen::before { top: 0.8em; width: 9.2em; height: 2.75em; border-radius: 99px; background: radial-gradient(circle at 76% 50%, oklch(0.3 0.03 260) 0 0.32em, transparent 0.42em), var(--glass); box-shadow: none; }
/* the home bar at the bottom (it takes the text color: dark on a light app, light on a dark one) */
.device-phone__screen::after { content: ""; position: absolute; z-index: 20; left: 50%; bottom: 0.6em; width: 30%; height: 0.3em; translate: -50% 0; border-radius: 99px; background: currentColor; opacity: 0.85; }
.device-phone--island .device-phone__screen::after { width: 36%; height: 0.38em; bottom: 0.55em; }
.device-screen--dark { background: oklch(0.14 0.004 270); color: oklch(0.97 0.002 270); }
.device-app { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.device-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* b. THE STATUS BAR: a real time, real icons (drawn once, here, as masks: they take the text color).
   Write a plausible time ("9:41", "10:08"): never "00:00", never a ticking clock. */
.device-status { flex: none; display: flex; align-items: center; justify-content: space-between; height: 3.1em; padding: 0.35em 1.7em 0 1.9em; font: 500 1.05em / 1 var(--f-text); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.device-status > :first-child { font: inherit; }
.device-phone--island .device-status { display: grid; grid-template-columns: 1fr 9.2em 1fr; height: 4.35em; padding: 0.55em 0.6em 0; font-size: 1.2em; font-weight: 600; }
.device-phone--island .device-status > :first-child { justify-self: center; }
.device-phone--island .device-status__icons { grid-column: 3; justify-self: center; font-size: 0.86em; }
.device-status__icons { display: inline-flex; align-items: center; gap: 0.32em; }
.device-status__icons > * { display: block; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.i-signal { width: 1.3em; height: 0.86em; --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Crect x='0' y='8' width='3' height='4' rx='1'/%3E%3Crect x='5' y='5.5' width='3' height='6.5' rx='1'/%3E%3Crect x='10' y='3' width='3' height='9' rx='1'/%3E%3Crect x='15' y='0' width='3' height='12' rx='1'/%3E%3C/svg%3E"); }
.i-wifi { width: 1.2em; height: 0.9em; --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-0.5 -0.5 17 13' stroke='black' stroke-width='0.7' stroke-linejoin='round'%3E%3Cpath d='M8 11.5 L5.454 8.954 A3.6 3.6 0 0 1 10.546 8.954 Z'/%3E%3Cpath d='M2.767 6.267 A7.4 7.4 0 0 1 13.233 6.267 L11.818 7.682 A5.4 5.4 0 0 0 4.182 7.682 Z'/%3E%3Cpath d='M0.08 3.58 A11.2 11.2 0 0 1 15.92 3.58 L14.505 4.995 A9.2 9.2 0 0 0 1.495 4.995 Z'/%3E%3C/svg%3E"); }
.i-battery { width: 1.95em; height: 0.92em; --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 13'%3E%3Crect x='0.5' y='0.5' width='23' height='12' rx='3.8' fill='none' stroke='black' stroke-opacity='0.4'/%3E%3Crect x='2' y='2' width='17' height='9' rx='2.3'/%3E%3Cpath d='M25 4.4 a1.6 1.6 0 0 1 0 4.2 z' fill-opacity='0.45'/%3E%3C/svg%3E"); }

/* c. THE PHONE CUT OFF AT THE BOTTOM: only the top shows, and it fades out at the bottom (NEVER at the top:
   the top of a phone, its camera and its status bar, is what makes it a phone).
   <div class="device-cut" style="--device-w:320px;--show:0.62"><div class="device-phone">…</div></div>
   --device-w goes on .device-cut (the phone inherits it) · --show: the visible share of the phone's height (0.4 to 0.8)
   · --fade: the height of the fade (default 28%) */
.device-cut { --pad: calc(var(--device-w, 300px) * 0.14); width: fit-content; height: calc(var(--device-w, 300px) / 0.4615 * var(--show, 0.62) + var(--pad)); margin: calc(var(--pad) * -1) calc(var(--pad) * -1) 0; padding: var(--pad) var(--pad) 0; overflow: hidden; -webkit-mask: linear-gradient(to bottom, #000 calc(100% - var(--fade, 28%)), transparent); mask: linear-gradient(to bottom, #000 calc(100% - var(--fade, 28%)), transparent); }

/* d. THE TABLET (landscape by default; .device-tablet--portrait). Same rules: an even black border, a thin frame,
   the camera in the middle of the long edge, the buttons on the top edge and the right side.
   <div class="device-tablet" style="--device-w:620px"><div class="device-tablet__screen"><div class="device-status">…</div><div class="device-app">…</div></div></div> */
.device-tablet { width: var(--device-w, 560px); aspect-ratio: 1.39; font-size: calc(var(--device-w, 560px) / 60); padding: 0.24em; border-radius: 3.1em;
  background: linear-gradient(100deg, var(--f3), var(--f2) 5%, var(--f1) 14%, var(--f1) 86%, var(--f2) 95%, var(--f3));
  box-shadow: inset 0 0 0 0.05em color-mix(in oklch, white 30%, transparent), 0 0 0 0.04em color-mix(in oklch, black 45%, transparent), 0 0.15em 0.3em color-mix(in oklch, var(--shadow-tint) 18%, transparent), 0 2.4em 4.5em -1.6em color-mix(in oklch, var(--shadow-tint) 40%, transparent); }
.device-tablet--portrait { aspect-ratio: 1 / 1.39; }
.device-tablet::before { content: ""; position: absolute; z-index: -1; top: -0.3em; right: -0.3em; width: 12em; height: 12em; --b: linear-gradient(var(--f2), var(--f3)); --c: linear-gradient(90deg, var(--f3), var(--f2)); background: var(--b) right 4.6em top 0 / 4.2em 0.36em no-repeat, var(--c) right 0 top 4.8em / 0.36em 2.8em no-repeat, var(--c) right 0 top 8em / 0.36em 2.8em no-repeat; }
.device-tablet::after { content: ""; position: absolute; z-index: 2; left: 50%; top: 1.05em; width: 0.62em; height: 0.62em; translate: -50% 0; border-radius: 50%; background: radial-gradient(circle at 38% 36%, oklch(0.42 0.04 260) 0 14%, oklch(0.16 0.004 270) 34%); }
.device-tablet--portrait::after { top: 50%; left: 1.05em; translate: 0 -50%; }
.device-tablet__screen { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 2.1em solid var(--glass); border-radius: 2.86em; background: var(--card); color: var(--ink); font: 400 1em / 1.3 var(--f-text); }
.device-tablet .device-status { height: 2.4em; padding: 0 1.6em; font-size: 1em; }

/* e. THE LAPTOP: the lid (a black bezel, thicker at the bottom, a camera at the top, no logo) on a metal base
   with its thumb notch. The base is a bit wider than the lid, as in a real front view.
   <div class="device-laptop" style="--device-w:720px"><div class="device-laptop__screen">…the real site or app…</div></div> */
.device-laptop { width: var(--device-w, 640px); font-size: calc(var(--device-w, 640px) / 64); padding-bottom: 1.5em; }
.device-laptop__screen { position: relative; width: 87%; margin-inline: auto; aspect-ratio: 16 / 10.3; overflow: hidden; border: solid var(--glass); border-width: 1.55em 1.2em 2em; border-radius: 2em 2em 0.5em 0.5em; background: var(--card); color: var(--ink); font: 400 1em / 1.3 var(--f-text);
  box-shadow: 0 0 0 0.14em var(--f1), 0 0 0 0.2em color-mix(in oklch, black 25%, transparent); }
.device-laptop::before { content: ""; position: absolute; z-index: 2; left: 50%; top: 0.55em; width: 0.5em; height: 0.5em; translate: -50% 0; border-radius: 50%; background: radial-gradient(circle at 38% 36%, oklch(0.42 0.04 260) 0 14%, oklch(0.18 0.004 270) 36%); }
.device-laptop::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.65em; border-radius: 0.15em 0.15em 2.2em 2.2em / 0.15em 0.15em 1.3em 1.3em;
  background: radial-gradient(ellipse 5em 0.5em at 50% 0, color-mix(in oklch, var(--f3) 85%, black) 0 96%, transparent 100%), linear-gradient(var(--f2), var(--f1) 35%, var(--f3) 92%, color-mix(in oklch, var(--f3) 70%, black));
  box-shadow: 0 1.4em 2em -0.8em color-mix(in oklch, var(--shadow-tint) 45%, transparent), 0 0.2em 0.3em -0.1em color-mix(in oklch, var(--shadow-tint) 35%, transparent); }

