/* ============================================
   IRIA · PHONE FRAME · Mockup mòbil al navegador
   ============================================ */

.app-stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  max-width: 1100px;
  width: 100%;
}

/* SIDE PANEL · landing copy + controls */
.side-panel {
  flex: 1;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.side-eyebrow {
  font-family: 'Bebas Neue';
  font-size: 13px;
  letter-spacing: .22em;
  color: var(--rust);
  text-transform: uppercase;
}

.side-title {
  font-family: 'Fraunces';
  font-size: 44px;
  font-weight: 480;
  line-height: 1;
  letter-spacing: -.035em;
  color: var(--ink);
  font-variation-settings: "SOFT" 58, "WONK" .35;
}

.side-title em {
  font-style: italic;
  color: var(--rust);
}

.side-lead {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 340px;
}

.side-controls {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-family: Inter;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -.005em;
  color: var(--ink);
  box-shadow: 3px 3px 0 rgba(30, 30, 30, .10);
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast);
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(30, 30, 30, .14);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 rgba(30, 30, 30, .10);
}

.btn-primary {
  background: var(--rust);
  color: var(--cream);
}

.btn-ghost {
  background: transparent;
  box-shadow: none;
  border-color: rgba(42, 33, 25, .3);
}

.btn-ghost:hover {
  background: rgba(255, 249, 238, .5);
  border-color: var(--line);
}

.side-meta {
  display: flex;
  gap: 8px;
  font-family: 'Bebas Neue';
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted);
  border-top: 1.5px solid rgba(42, 33, 25, .15);
  padding-top: 14px;
  margin-top: 6px;
}

.side-meta span + span::before {
  content: "·";
  margin-right: 8px;
}

/* DEVICE FRAME · iPhone style
   Figma: 375×812 · marc +10px per costat → 395×832 exterior */
.device-frame {
  position: relative;
  width: 395px;
  height: 832px;
  background: #1a1714;
  border-radius: 50px;
  padding: 10px;
  box-shadow:
    0 30px 80px rgba(30, 30, 30, .35),
    0 0 0 1px rgba(30, 30, 30, .9),
    inset 0 0 0 1.5px rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--cream);
  border-radius: 40px;
  overflow: hidden;
  border: 1.5px solid #0a0805;
}

.device-screen:has(#screen-18.active) {
  background: var(--closing-bg);
}

/* Notch */
.device-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 122px;
  height: 32px;
  background: #1a1714;
  border-radius: 999px;
  z-index: 100;
  pointer-events: none;
}

/* Status bar */
.status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 36px 0;
  font-family: 'Inter';
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  pointer-events: none;
}

.status-time {
  letter-spacing: -.02em;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.status-icons .signal {
  display: inline-block;
  width: 16px;
  height: 10px;
  position: relative;
}

.status-icons .signal::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(to right, currentColor 22%, transparent 22%, transparent 28%, currentColor 28%, currentColor 50%, transparent 50%, transparent 56%, currentColor 56%, currentColor 78%, transparent 78%, transparent 84%, currentColor 84%);
  -webkit-mask: linear-gradient(to top, black 30%, transparent 30%);
  mask: linear-gradient(to top, black 30%, transparent 30%);
}

.status-icons .battery {
  display: inline-block;
  width: 24px;
  height: 11px;
  border: 1px solid currentColor;
  border-radius: 3px;
  position: relative;
}

.status-icons .battery::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 3px;
  width: 2px;
  height: 5px;
  background: currentColor;
  border-radius: 0 1px 1px 0;
}

.status-icons .battery::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  width: 75%;
  height: 7px;
  background: currentColor;
  border-radius: 1.5px;
}

/* Screens container · totes les pantalles viuen aquí */
.screens-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.screen {
  position: absolute;
  inset: 0;
  background: var(--cream);
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform var(--t-mid) var(--ease-out), opacity var(--t-fast);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  z-index: 2;
}

.device-screen.is-app-launch {
  animation: app-launch 0.55s var(--ease-out);
}

@keyframes app-launch {
  0%   { opacity: 0.55; transform: scale(0.985); }
  100% { opacity: 1; transform: scale(1); }
}

.screen.prev {
  transform: translateX(-100%);
  z-index: 1;
}

/* Nav controls · fixed bottom of side panel */
.nav-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1.5px solid rgba(42, 33, 25, .15);
}

.nav-controls .nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  display: grid;
  place-items: center;
  font-family: 'Bebas Neue';
  font-size: 18px;
  color: var(--ink);
  box-shadow: 3px 3px 0 rgba(30, 30, 30, .10);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.nav-controls .nav-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(30, 30, 30, .14);
}

.nav-controls .nav-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.nav-controls .nav-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-progress-bar {
  height: 4px;
  background: rgba(42, 33, 25, .15);
  border-radius: 999px;
  overflow: hidden;
}

.nav-progress-fill {
  height: 100%;
  background: var(--rust);
  width: 0%;
  transition: width var(--t-mid) var(--ease-out);
}

.nav-progress-label {
  font-family: 'Bebas Neue';
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted);
}

/* Audio toggle */
.audio-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--ink);
  box-shadow: 4px 4px 0 rgba(30, 30, 30, .14);
  z-index: 1000;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.audio-toggle:hover {
  transform: translate(-1px, -1px);
}

.audio-toggle.muted {
  background: var(--muted);
  color: var(--cream);
}

/* Responsive · mòbil / tablet estreta · només prototip a pantalla completa */
@media (max-width: 980px) {
  html {
    height: 100%;
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
  }

  body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    min-height: 0;
    max-height: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    align-items: stretch;
    justify-content: stretch;
    overscroll-behavior: none;
  }

  .app-stage {
    flex-direction: column;
    gap: 0;
    max-width: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
  }

  /* Panell desktop amagat: copy, tour, fletxes nav */
  .side-panel {
    display: none !important;
  }

  .device-frame {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 0;
    padding: 0;
    background: var(--cream);
    box-shadow: none;
    flex: 1 1 auto;
  }

  .device-screen {
    height: 100%;
    border-radius: 0;
    border: none;
  }

  .screens-container {
    height: 100%;
  }

  .screen {
    min-height: 0;
  }

  .device-notch,
  .status-bar {
    display: none !important;
  }

  .app-header {
    padding-top: var(--pad-top-ui);
    padding-bottom: 10px;
    padding-left: var(--pad-inline);
    padding-right: var(--pad-inline-end);
  }

  .audio-toggle {
    bottom: max(16px, env(safe-area-inset-bottom, 0px) + 8px);
    right: max(16px, env(safe-area-inset-right, 0px) + 8px);
  }
}

/* Mòbil petit · iPhone mini, SE, etc. */
@media (max-width: 480px) {
  .app-header {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .screen-content {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .mic-bar {
    padding-bottom: max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .academy-bottom,
  .step-bottom {
    padding-bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) + 8px));
  }

  .cover-top {
    padding-top: max(10px, calc(env(safe-area-inset-top, 0px) + 8px));
    padding-left: max(20px, env(safe-area-inset-left, 0px) + 12px);
    padding-right: max(20px, env(safe-area-inset-right, 0px) + 12px);
  }

  .cover-main {
    padding-left: max(24px, env(safe-area-inset-left, 0px) + 16px);
    padding-right: max(24px, env(safe-area-inset-right, 0px) + 16px);
  }

  .cover-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px) + 8px);
  }
}
