/* ============================================================
   SB Labs Hub (sb-labs.de/)
   Umsetzung von Main.dc.html aus Claude Design: ein Gerät mit
   Home-Bildschirm. Querformat zeigt ein iPad, Hochformat ein iPhone.
   Hell ist Standard, dunkel folgt der Systemeinstellung.
   Innenmasse in Container-Query-Einheiten (cqw) wie im Entwurf.
   ============================================================ */

:root {
  color-scheme: light dark;
  --bg: #F2F0E9;
  --ink: #171613;
  --muted: #5F5B52;
  --wall: #E4E0D4;
  --widget: #FBFAF6;
  --widget-muted: #6B665C;
  --widget-shadow: 0 1px 2px rgba(23, 22, 19, 0.06);
  --label: #171613;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121210;
    --ink: #EEEBE3;
    --muted: #A39F95;
    --wall: #1C1B18;
    --widget: #2A2925;
    --widget-muted: #ABA79D;
    --widget-shadow: none;
    --label: #EEEBE3;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* ---------- Seitenrahmen ---------- */
.hub {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(20px, 4vh, 48px) 20px 0;
  padding: clamp(20px, 4svh, 48px) 20px 0;
}
.hub__main {
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.6vh, 28px);
  gap: clamp(16px, 2.6svh, 28px);
}
.hub__hint {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Gerät: Querformat iPad, Hochformat iPhone ---------- */
.device { position: relative; }
.device--iphone { display: none; }
@media (orientation: portrait) {
  .device--ipad { display: none; }
  .device--iphone { display: block; }
}

.device--ipad {
  width: min(94vw, 1120px, max(760px, calc((100vh - 190px) * 1.3043)));
  width: min(94vw, 1120px, max(760px, calc((100svh - 190px) * 1.3043)));
  aspect-ratio: 3000 / 2300;
}
.device--iphone {
  width: min(calc(100vw - 40px), 400px);
  aspect-ratio: 1470 / 3000;
}

/* Bildschirmfläche: Lage aus den Apple-Vorlagen (iPad x124 y118 w2752 h2064
   auf 3000x2300, iPhone x75 y66 w1320 h2868 auf 1470x3000) */
.screen {
  position: absolute;
  container-type: size;
  background: var(--wall);
  overflow: hidden;
}
.device--ipad .screen {
  left: 4.1333%;
  top: 5.1304%;
  width: 91.7333%;
  height: 89.7391%;
  border-radius: 2.4%;
}
.device--iphone .screen {
  left: 5.102%;
  top: 2.2%;
  width: 89.7959%;
  height: 95.6%;
  border-radius: 12% / 5.6%;
}

/* Gerätebild liegt über dem Bildschirm */
.device__frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- Home-Bildschirm ---------- */
.home {
  position: absolute;
  inset: 0;
  display: flex;
}
.device--ipad .home {
  padding: 6cqw;
  align-items: flex-start;
  gap: 6cqw;
}
.device--iphone .home {
  padding: 17cqw 7cqw 0;
  flex-direction: column;
  gap: 6.5cqw;
}

.widgets {
  flex: 0 0 37cqw;
  display: flex;
  flex-direction: column;
  gap: 2.4cqw;
}

.widget {
  background: var(--widget);
  box-shadow: var(--widget-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink);
  text-decoration: none;
}
.widget p { margin: 0; }
.widget__kicker {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--widget-muted);
}
.widget__head { display: flex; flex-direction: column; }
.widget__title {
  font-weight: 600;
  text-wrap: balance;
}
.widget__text {
  color: var(--widget-muted);
  text-wrap: pretty;
}
.widget__mail { font-weight: 600; }
.widget__note { color: var(--widget-muted); }

/* SB-Labs-Widget */
.device--ipad .widget--about {
  min-height: 20cqw;
  padding: 2.4cqw;
  border-radius: 2.2cqw;
  gap: 1.6cqw;
}
.device--ipad .widget--about .widget__head { gap: 0.9cqw; }
.device--ipad .widget--about .widget__kicker { font-size: max(11px, 1.15cqw); }
.device--ipad .widget--about .widget__title {
  font-size: max(20px, 2.9cqw);
  line-height: 1.1;
  letter-spacing: -0.022em;
}
.device--ipad .widget--about .widget__text {
  font-size: max(13px, 1.45cqw);
  line-height: 1.42;
}
.device--iphone .widget--about {
  min-height: 40cqw;
  padding: 5.2cqw;
  border-radius: 5.5cqw;
  gap: 3cqw;
}
.device--iphone .widget--about .widget__head { gap: 2cqw; }
.device--iphone .widget--about .widget__kicker { font-size: max(11px, 3cqw); }
.device--iphone .widget--about .widget__title {
  font-size: max(18px, 6.2cqw);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.device--iphone .widget--about .widget__text {
  font-size: max(12px, 3.7cqw);
  line-height: 1.4;
}

/* Kontakt-Widget */
.device--ipad .widget--contact {
  min-height: 10.5cqw;
  padding: 2.1cqw 2.4cqw;
  border-radius: 2.2cqw;
  gap: 0.8cqw;
}
.device--ipad .widget--contact .widget__kicker { font-size: max(11px, 1.15cqw); }
.device--ipad .widget--contact .widget__mail {
  font-size: max(15px, 1.9cqw);
  letter-spacing: -0.012em;
}
.device--ipad .widget--contact .widget__note { font-size: max(13px, 1.3cqw); }
.device--iphone .widget--contact {
  grid-column: span 2;
  aspect-ratio: 1;
  padding: 4.6cqw;
  border-radius: 5.5cqw;
}
.device--iphone .widget--contact .widget__kicker { font-size: max(11px, 3cqw); }
.device--iphone .widget--contact .widget__mail {
  font-size: max(13px, 4.2cqw);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.device--iphone .widget--contact .widget__note {
  font-size: max(11px, 3.2cqw);
  line-height: 1.3;
}

/* ---------- App-Icons ---------- */
.apps { align-items: start; }
.device--ipad .apps {
  display: flex;
  align-items: flex-start;
  gap: 3cqw;
}
.device--iphone .apps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 6cqw;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--label);
  text-decoration: none;
}
.device--ipad .app { width: 10cqw; gap: 0.9cqw; }
.device--iphone .app { gap: 2cqw; }

.app__icon {
  position: relative;
  display: block;
}
.app__icon img {
  display: block;
  width: 100%;
  height: 100%;
}
.device--ipad .app__icon { width: 7.6cqw; height: 7.6cqw; }
.device--iphone .app__icon { width: 15.5cqw; height: 15.5cqw; }
.device--ipad .app__icon img,
.device--ipad .app__loading { border-radius: 1.7cqw; }
.device--iphone .app__icon img,
.device--iphone .app__loading { border-radius: 3.5cqw; }

.app__name {
  line-height: 1.2;
  white-space: nowrap;
}
.device--ipad .app__name { font-size: max(11px, 1.2cqw); }
.device--iphone .app__name { font-size: max(11px, 2.8cqw); }

/* iOS-Ladezustand über dem Cindy-Icon: abgedunkelt, Ring mit Kreissegment (72 %), statisch */
.app__loading {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 11, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.app__ring {
  width: 44%;
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 9%;
  display: flex;
}
.device--ipad .app__ring { border: max(1.5px, 0.18cqw) solid rgba(255, 255, 255, 0.92); }
.device--iphone .app__ring { border: 1.5px solid rgba(255, 255, 255, 0.92); }
.app__progress {
  flex: 1;
  border-radius: 50%;
  background: conic-gradient(rgba(255, 255, 255, 0.92) 0 72%, transparent 72% 100%);
}

/* ---------- Fuss ---------- */
.footer {
  width: 100%;
  max-width: 1120px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 28px;
  padding: 24px 0 32px;
  font-size: 13px;
  color: var(--muted);
}
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.footer__nav a {
  color: var(--muted);
  text-decoration: none;
}

/* ---------- Hover und Drücken: nur dezent ---------- */
@media (hover: hover) {
  .footer__nav a:hover,
  .widget--contact:hover .widget__mail,
  .app:hover .app__name {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
  }
}
.app:active .app__icon { filter: brightness(0.85); }
.widget--contact:active { filter: brightness(0.97); }
