/* MH Software · Entwurf K2 · Geräte-Komponenten
   iPhone 16 (reines CSS, keine Apple-Bilder) und dunkles Browserfenster.

   iPhone-16-Maße als Grundlage:
   Gehäuse 71,6 × 147,6 mm, Display 393 × 852 pt (2,168:1), Display-Ecke 55 pt.
   Display-Breite ≈ 65,1 mm → 90,9 % der Gehäusebreite, also 4,55 % Rand je Seite
   (davon ~1,7 % Aluminium-Kante, ~2,85 % schwarzer Display-Rand).
   Alle Innenmaße in cqw (1 cqw = 1 % der Gehäusebreite), damit die Komponente
   in jeder Größe exakt gleich aussieht. 1 pt = 90,9 / 393 = 0,2313 cqw.

   Markup:
   <div class="iphone [iphone--tilt]" [data-rb-tilt]>
     <div class="iphone__body">
       <span class="iphone__btn iphone__btn--action"></span> … (5 Tasten)
       <div class="iphone__screen"><img …><span class="iphone__island"></span><span class="iphone__glare"></span></div>
     </div>
   </div> */

.iphone {
  --iw: 300px;
  --ry: 0deg;
  --rx: 0deg;
  position: relative;
  width: var(--iw);
  aspect-ratio: 71.6 / 147.6;
  container-type: inline-size;
  flex: none;
}
.iphone__body {
  position: absolute;
  inset: 0;
  border-radius: 17.3cqw;
  /* Aluminium-Kante: Graphit mit Licht oben links, 3 Stops */
  background: linear-gradient(140deg, #6b6c70 0%, #232325 34%, #2e2f32 68%, #4c4d51 100%);
  box-shadow:
    inset 0 0 0 .35cqw rgba(255, 255, 255, .16),   /* feine Highlight-Linie außen */
    inset 0 0 0 .9cqw #161617,                     /* Übergang Kante → Glas */
    0 2.5cqw 5cqw -1cqw rgba(0, 0, 0, .55),
    0 12cqw 24cqw -6cqw rgba(0, 0, 0, .75);
  transform-style: preserve-3d;
}
/* schwarzer Display-Rand (Glas) */
.iphone__body::before {
  content: "";
  position: absolute;
  inset: 1.7cqw;
  border-radius: 15.6cqw;
  background: #050505;
  box-shadow: inset 0 0 0 .18cqw rgba(255, 255, 255, .07);
}
/* Gehäusedicke: zweite Ebene leicht nach hinten versetzt, sichtbar nur bei Neigung */
.iphone__body::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, #3a3b3e, #151516 60%, #2a2b2e);
  transform: translateZ(-2.2cqw);
}
.iphone__screen {
  position: absolute;
  left: 4.55cqw;
  right: 4.55cqw;
  top: 4.55cqw;
  bottom: 4.55cqw;
  border-radius: 12.72cqw;        /* 55/393 der Display-Breite */
  overflow: hidden;
  background: #000;
  transform: translateZ(0);
  isolation: isolate;
}
.iphone__screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
/* Dynamic Island: 126 × 37 pt bei 11 pt Abstand. Wir zeichnen 128 × 40 pt ab 10 pt,
   damit die in manchen Screenshots schon vorhandene Pille vollständig verdeckt ist. */
.iphone__island {
  position: absolute;
  z-index: 2;
  top: 2.31cqw;
  left: 50%;
  width: 29.6cqw;
  height: 9.25cqw;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #000;
  box-shadow: 0 0 0 .12cqw rgba(0, 0, 0, .9);
}
/* Frontkamera-Linse in der Island, kaum sichtbar */
.iphone__island::after {
  content: "";
  position: absolute;
  right: 3.4cqw;
  top: 50%;
  width: 2.6cqw;
  height: 2.6cqw;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #1d2a3a 0 22%, #0a0d12 48%, #000 70%);
}
/* sehr dezente Glanzkante: ein diagonaler Lichtstreifen */
.iphone__glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, .02) 22%, transparent 34%, transparent 62%, rgba(255, 255, 255, .035) 70%, transparent 78%);
}

/* Seitentasten: links Action-Button + Lautstärke ±, rechts Power + Kamerataste */
.iphone__btn {
  position: absolute;
  width: 1.1cqw;
  border-radius: .5cqw;
  background: linear-gradient(90deg, #2a2b2e, #5a5b5f 55%, #2a2b2e);
  transform: translateZ(-1.1cqw);
}
.iphone__btn--action { left: -.75cqw; top: 18.5%; height: 4.4%; }
.iphone__btn--volup  { left: -.75cqw; top: 26%;   height: 8%; }
.iphone__btn--voldn  { left: -.75cqw; top: 35.6%; height: 8%; }
.iphone__btn--power  { right: -.75cqw; top: 28%;  height: 12.5%; }
.iphone__btn--cam    { right: -.45cqw; top: 58%;  height: 7%; width: .8cqw; background: linear-gradient(90deg, #1a1a1c, #3a3b3e); }

/* Varianten */
.iphone--tilt {
  transform: perspective(1800px) rotateY(calc(-18deg + var(--ry))) rotateX(calc(6deg + var(--rx)));
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.2, .9, .25, 1.15);
}
.iphone--tilt.is-tracking { transition: transform .25s ease-out; }
.iphone--flat { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .iphone--tilt, .iphone--tilt.is-tracking { transition: none; }
}

/* ---------- Browserfenster ---------- */
.browser {
  position: relative;
  background: #111;
  border: 1px solid #262626;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 10px 24px -8px rgba(0, 0, 0, .6);
}
.browser__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid #262626;
  background: #141414;
}
.browser__dot { width: 10px; height: 10px; border-radius: 50%; background: #333; flex: none; }
.browser__url {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0 0 0 14px;
  padding: 4px 14px;
  border: 1px solid #262626;
  border-radius: 6px;
  background: #0c0c0c;
  color: #9a9a9a;
  font: 400 11.5px/1.2 var(--mono, monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser__view { position: relative; aspect-ratio: 16 / 10; background: #0c0c0c; }
.browser__view img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
