/* Aamin AI home: device frames (lib/devices.js explains the scaling). Real proportions:
   - laptop: a MacBook-style lid with a thin black bezel and camera, a 16:10 screen, and a base about
     8% wider than the lid with a thumb notch. At most 600 px wide.
   - phone: an iPhone-style body (radius 46 px, 10 px bezel, a dynamic island, a status bar), 300 px wide.
   The kit screen is laid out at its real size inside .hf-dev__viewport and scaled down (--hf-dev-k).
   Below 768 px the laptop is drawn as the phone. No glass, no photos. */

.hf-dev {
  --dev-ink: #0D0F12;
  --dev-rim: #C9CDD2;
  --dev-alu-1: #ECEEF0;
  --dev-alu-2: #C4C8CD;
  --dev-alu-3: #A8ADB3;
  --dev-shadow: 0 34px 60px -34px rgb(24 32 44 / 0.42), 0 14px 24px -18px rgb(24 32 44 / 0.22);
  position: relative;
  margin: 0;
  min-inline-size: 0;
}

/* ---- the screen and its scaled viewport (both devices) ---- */
.hf-dev__screen {
  position: relative;
  overflow: hidden;
  background: #FFFFFF;
  isolation: isolate;
}
.hf-dev__viewport {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  inline-size: var(--hf-dev-vw, 1024px);
  block-size: var(--hf-dev-vh, 640px);
  transform: scale(var(--hf-dev-k, 0.55));
  transform-origin: 0 0;
  overflow: hidden;
  background: #FFFFFF;
}
[dir="rtl"] .hf-dev__viewport { transform-origin: 100% 0; }
/* the kit screen fills the viewport like an app window: no outer card, no page margins */
.hf-dev__viewport > * { margin: 0 !important; max-inline-size: none !important; min-block-size: 100%; border-radius: 0 !important; box-shadow: none !important; }
/* ...and no bezel, card radius, shadow or ring of its own: its frame and window are a flex column that
   runs to the bottom of the device's screen (each section then lets its own screen body grow). */
.hf-dev__viewport > .hf-screen {
  --hf-screen-bezel: 0px; --hf-screen-radius: 0px; --hf-screen-radius-window: 0px;
  --hf-screen-shadow: none; --hf-screen-frame-ring: transparent;
  display: flex; flex-direction: column; block-size: 100%;
}
.hf-dev__viewport .hf-screen__frame,
.hf-dev__viewport .hf-screen__window { display: flex; flex-direction: column; flex: 1 1 auto; min-block-size: 0; }
/* before the kit mounts: the kit's window white, so a still never flashes grey */
.hf-dev__viewport:empty { background: #FDFDFC; }
/* Pause / Play stays in the kit's corner. It is drawn at the device's scale (x0.56 in a laptop, x0.72
   in a phone), so its hit area, focus ring and name tip are scaled back up: 44 px, 2 px and 12.5 px
   on the page. */
.hf-dev__viewport .hf-screen .hf-screen__ctl { position: absolute; }
.hf-dev__viewport .hf-screen__ctl::before { inset: calc((44px / var(--hf-dev-k, 1) - var(--hf-screen-ctl)) / -2); }
.hf-dev__viewport .hf-screen__ctl:focus-visible { outline-width: calc(2px / var(--hf-dev-k, 1)); outline-offset: calc(2px / var(--hf-dev-k, 1)); }
.hf-dev__viewport .hf-screen .hf-screen__ctl::after { font-size: calc(12.5px / var(--hf-dev-k, 1)); padding: calc(5px / var(--hf-dev-k, 1)) calc(10px / var(--hf-dev-k, 1)); border-radius: calc(8px / var(--hf-dev-k, 1)); }

/* ---- laptop ---- */
.hf-dev--laptop { inline-size: min(100%, 600px); margin-inline: auto; padding-block-end: 4px; }
.hf-dev--laptop .hf-dev__frame {
  position: relative;
  background: var(--dev-ink);
  border-radius: 14px 14px 4px 4px;
  padding: 2.4% 2.4% 3%;
  box-shadow: 0 0 0 1px var(--dev-rim), inset 0 0 0 1px #2A2E34;
}
.hf-dev--laptop .hf-dev__frame::before { /* camera */
  content: ""; position: absolute; inset-block-start: 0.9%; inset-inline-start: 50%;
  inline-size: 5px; block-size: 5px; margin-inline-start: -2.5px; border-radius: 50%;
  background: #23272D; box-shadow: inset 0 0 0 1px #343940;
}
.hf-dev--laptop .hf-dev__screen { aspect-ratio: 16 / 10; border-radius: 3px; }
.hf-dev--laptop .hf-dev__base {
  position: relative;
  inline-size: 108%;
  margin-inline-start: -4%;
  block-size: 0;
  padding-block-end: 2.6%;
  background: linear-gradient(180deg, var(--dev-alu-1) 0%, var(--dev-alu-2) 62%, var(--dev-alu-3) 100%);
  border-radius: 1px 1px 12px 12px / 1px 1px 8px 8px;
  box-shadow: var(--dev-shadow), inset 0 1px 0 #FFFFFF;
}
.hf-dev--laptop .hf-dev__base::before { /* thumb notch */
  content: ""; position: absolute; inset-block-start: 0; inset-inline-start: 50%;
  inline-size: 15%; block-size: 38%; transform: translateX(-50%);
  background: linear-gradient(180deg, #B5BAC0, #CFD3D7); border-radius: 0 0 7px 7px;
}
[dir="rtl"] .hf-dev--laptop .hf-dev__base::before { transform: translateX(50%); }

/* ---- phone ---- */
.hf-dev--phone { inline-size: min(100%, 300px); margin-inline: auto; }
.hf-dev--phone .hf-dev__frame,
.hf-dev--laptop[data-device-mode="phone"] .hf-dev__frame {
  position: relative;
  background: var(--dev-ink);
  border-radius: 46px;
  padding: 10px;
  box-shadow: 0 0 0 1px var(--dev-rim), inset 0 0 0 1.5px #2A2E34, var(--dev-shadow);
}
.hf-dev--phone .hf-dev__screen,
.hf-dev--laptop[data-device-mode="phone"] .hf-dev__screen {
  aspect-ratio: 280 / 600;
  border-radius: 36px;
}
/* status bar with the dynamic island; the viewport starts below it */
.hf-dev--phone .hf-dev__screen::before,
.hf-dev--laptop[data-device-mode="phone"] .hf-dev__screen::before {
  content: ""; position: absolute; z-index: 2; inset-block-start: 9px; inset-inline-start: 50%;
  inline-size: 31%; block-size: 24px; transform: translateX(-50%);
  background: var(--dev-ink); border-radius: 14px;
}
[dir="rtl"] .hf-dev--phone .hf-dev__screen::before,
[dir="rtl"] .hf-dev--laptop[data-device-mode="phone"] .hf-dev__screen::before { transform: translateX(50%); }
.hf-dev--phone .hf-dev__viewport,
.hf-dev--laptop[data-device-mode="phone"] .hf-dev__viewport { inset-block-start: 40px; }

/* below 768 px a laptop is drawn as the phone */
@media (max-width: 47.99rem) {
  .hf-dev--laptop { inline-size: min(100%, 300px); padding-block-end: 0; }
  .hf-dev--laptop .hf-dev__frame::before { display: none; }
  .hf-dev--laptop .hf-dev__base { display: none; }
}

/* optional caption under a device: one short line saying what the sample shows */
.hf-dev__caption {
  margin-block-start: 18px;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
  /* v7-fix: text-2, not text-3: the light part ("· Example data") measured 4.22–4.52:1 on the lustre grounds, under AA */
  color: var(--hf-color-text-2, #454C55);
}
.hf-dev__caption b { color: var(--hf-color-text-1, #0B0D10); font-weight: 600; }
/* phones: the caption may run 24 px past each side of the 300 px device (still inside the column), so a
   short caption keeps to one line */
@media (max-width: 47.99rem) { .hf-dev__caption { margin-inline: -24px; } }

/* on the night ground (Secure): a hairline rim instead of the silver one, a deeper shadow, night inks */
.hf-ground--night .hf-dev { --dev-rim: rgb(233 238 244 / 0.22); --dev-shadow: 0 40px 80px -36px rgb(0 0 0 / 0.75); }
.hf-ground--night .hf-dev__caption { color: #A9B0B8; }
.hf-ground--night .hf-dev__caption b { color: #F5F5F1; }

@media (forced-colors: active) {
  .hf-dev__frame, .hf-dev__base { forced-color-adjust: none; }
}
