/* Prototype stage: phone mockup (testable) and desktop preview (static). Not part of the product UI. */
html, body { height: 100%; }
body { margin: 0; background: radial-gradient(120% 90% at 50% 0%, #121a22 0%, var(--stage-bg) 60%); color: var(--color-text-primary); font-family: var(--font-sans); }
.stage { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 16px; }

/* Project credit, beside the phone */
.credit { position: absolute; top: 50%; right: calc(100% + 72px); width: 300px; transform: translateY(-50%); text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.credit-rule { width: 44px; height: 3px; border-radius: 2px; background: var(--color-bg-accent); }
.credit-title { margin: 0; font: 600 34px/40px var(--font-sans); letter-spacing: -0.4px; color: var(--color-text-primary); }
.credit-sub { margin: 0; font: 400 16px/24px var(--font-sans); color: var(--color-text-secondary); }
@media (max-width: 1150px) { .credit { display: none; } }

/* Phone mockup (drawn in CSS) */
.device-wrap { position: relative; isolation: isolate; }
/* Soft glow in the primary color behind the phone */
.device-wrap::before { content: ''; position: absolute; z-index: -1; inset: -12% -75%; pointer-events: none; filter: blur(28px);
  background: radial-gradient(closest-side, rgba(53, 191, 174, 0.5), rgba(53, 191, 174, 0.22) 50%, rgba(53, 191, 174, 0) 78%);
  animation: glow 7s ease-in-out infinite; }
@keyframes glow { 0%, 100% { opacity: 0.8; transform: scale(0.97); } 50% { opacity: 1; transform: scale(1.03); } }
body { overflow-x: hidden; }
.device { position: absolute; top: 0; left: 0; width: 418px; height: 872px; padding: 14px; border-radius: 68px; transform-origin: top left;
  background: linear-gradient(145deg, #5a5f66, #1b1e22 38%, #3a3f45 70%, #1b1e22);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.65), inset 0 0 0 2px #7a8087, inset 0 0 0 6px #0b0c0e; }
.device-screen { position: relative; width: 390px; height: 844px; border-radius: 54px; overflow: clip; background: #000; }
.device-screen .app { --safe-top: 50px; }
.device-screen .composer { padding-bottom: 30px; }
.device-screen .sidebar { padding-bottom: 38px; }
.device-screen .sheet { padding-bottom: 42px; }
.is-narrow .device-screen .sheet { padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom, 0px)); }
.device-screen .source-footer { padding-bottom: 30px; }
.island { position: absolute; z-index: 100; top: 11px; left: 50%; transform: translateX(-50%); width: 122px; height: 34px; border-radius: 20px; background: #000; }
.statusbar { position: absolute; z-index: 90; top: 0; left: 0; right: 0; height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 8px 34px 0 40px; color: var(--color-text-primary); font: 600 15px var(--font-sans); }
.sb-icons { display: flex; align-items: center; gap: 6px; }
.home-indicator { position: absolute; z-index: 100; bottom: 8px; left: 50%; transform: translateX(-50%); width: 134px; height: 5px; border-radius: 3px; background: var(--color-text-primary); opacity: 0.85; }
.hw { position: absolute; width: 4px; border-radius: 2px; background: #3a3f45; }
.hw--action { left: -3px; top: 120px; height: 30px; }
.hw--vol1 { left: -3px; top: 176px; height: 56px; }
.hw--vol2 { left: -3px; top: 246px; height: 56px; }
.hw--power { right: -3px; top: 220px; height: 92px; }

/* Controls */
.stage-note { margin: 0; max-width: 420px; text-align: center; color: var(--color-text-muted); font: 400 12px/18px var(--font-sans); }
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.ctl { min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--color-border-default); background: var(--color-bg-subtle); color: var(--color-text-primary); font: 500 14px/20px var(--font-sans); cursor: pointer; }
.ctl:hover { background: var(--color-bg-muted); }
.ctl:focus-visible { outline: 2px solid var(--color-border-accent); outline-offset: 2px; }
.ctl--primary, .ctl[aria-pressed='true'] { background: var(--color-bg-accent); border-color: var(--color-border-accent); color: var(--color-text-on-accent); }
.ctl--primary:hover { background: var(--color-bg-accent); filter: brightness(1.08); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Desktop preview (static) */
#view-desktop { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#view-desktop[hidden], #view-mobile[hidden] { display: none; }
.desk-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.desk-note { margin: 0; padding: 6px 12px; border: 1px solid var(--color-border-warning); border-radius: 999px; background: var(--color-bg-warning-subtle); color: var(--color-text-warning); font: 500 13px/19px var(--font-sans); }
.desk-tabs { display: flex; gap: 8px; }
.desk-wrap { position: relative; }
.browser { position: absolute; top: 0; left: 0; width: 1440px; transform-origin: top left; border-radius: 14px; overflow: hidden; border: 1px solid #2c3743; background: var(--color-bg-surface); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55); }
.browser-bar { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: #1f2730; }
.browser-bar i { width: 12px; height: 12px; border-radius: 50%; background: #3a4551; }
.browser-bar .addr { margin-left: 16px; padding: 4px 16px; border-radius: 999px; background: var(--color-bg-surface); color: var(--color-text-muted); font: 400 13px/19px var(--font-sans); }

/* Real phones: no mockup, the app fills the screen */
.is-narrow .device-wrap::before, .is-narrow .credit { display: none; }
@media (prefers-reduced-motion: reduce) { .device-wrap::before { animation: none; } }
.is-narrow .stage { height: 100dvh; min-height: 0; padding: 0; gap: 0; align-items: stretch; justify-content: flex-start; }
.is-narrow #view-mobile { flex: 1 1 auto; min-height: 0; width: 100%; }
.is-narrow .device-wrap { width: 100% !important; height: 100% !important; }
.is-narrow .device { position: static; width: 100%; height: 100%; padding: 0; border-radius: 0; background: none; box-shadow: none; transform: none; }
.is-narrow .device-screen { width: 100%; height: 100%; border-radius: 0; }
.is-narrow .app { width: 100%; height: 100%; --safe-top: env(safe-area-inset-top, 0px); }
.is-narrow .device-screen .composer, .is-narrow .device-screen .source-footer { padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px)); }
.is-narrow .statusbar, .is-narrow .island, .is-narrow .home-indicator, .is-narrow .hw, .is-narrow .controls, .is-narrow #view-desktop { display: none; }
.is-narrow .stage-note { padding: var(--space-sm) var(--space-lg) var(--space-lg); }
