/* ============================================================
   PARA LARA — styles.css
   Sistema visual Fase 3 + Ajustes aprobados
   Compatibilidad: Safari iOS, Chrome iOS, iPad, escritorio
   ============================================================ */

/* ── Variables del sistema ──────────────────────────────── */
:root {
  /* Paleta base — papel crema */
  --bg:           #F5F0E8;
  --bg-alt:       #EDE8DC;
  --bg-light:     #FAF8F3;

  /* Texto */
  --text:         #2C2A26;
  --text-soft:    #6B6560;
  --text-subtle:  #9E9790;

  /* Acentos naturaleza del norte */
  --moss:         #4A5E45;
  --forest:       #2E3D2A;
  --cantabric:    #3D5268;
  --kraft:        #8B6E4E;
  --kraft-light:  rgba(139, 110, 78, 0.18);

  /* Tipografías */
  --f-title: 'Lora', Georgia, 'Times New Roman', serif;
  --f-body:  'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;

  /* Espaciado */
  --sp-xs: 0.4rem;
  --sp-sm: 0.8rem;
  --sp-md: 1.5rem;
  --sp-lg: 2.4rem;
  --sp-xl: 4rem;

  /* Ancho máximo del frame (cuaderno) */
  --frame-max: 480px;

  /* Timing — ninguno usa APIs experimentales */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --t-slow: 580ms;
  --t-med:  380ms;
  --t-fast: 220ms;
}

/* ── Reset mínimo ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  /* Prevenir resize al abrir teclado en iOS */
  height: -webkit-fill-available;
}

body {
  min-height: 100%;
  min-height: -webkit-fill-available;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* ── Contenedor raíz ─────────────────────────────────────── */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: var(--bg-alt); /* margen lateral en iPad/escritorio */
}

/*
  #frame — el "cuaderno".
  Ancho máximo controlado. En iPhone ocupa todo el ancho.
  En iPad/escritorio se centra con márgenes visuales.
*/
#frame {
  position: relative;
  width: 100%;
  max-width: var(--frame-max);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Sombra lateral sutil en pantallas anchas */
  box-shadow: 0 0 60px rgba(44, 42, 38, 0.12);
}

/* ── Escenario de pantallas ──────────────────────────────── */
#stage {
  position: relative;
  flex: 1;
  overflow: hidden;
}

/* ── Pantalla base ───────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--bg);

  /* Estado inicial — invisible y ligeramente abajo */
  opacity: 0;
  transform: translateY(22px);
  pointer-events: none;
  /* Transition estándar, compatible con todos los navegadores */
  -webkit-transition: opacity var(--t-slow) var(--ease),
                      -webkit-transform var(--t-slow) var(--ease);
  transition: opacity var(--t-slow) var(--ease),
              transform var(--t-slow) var(--ease);
}

.screen.is-active {
  opacity: 1;
  transform: translateY(0);
  -webkit-transform: translateY(0);
  pointer-events: auto;
}

.screen.is-leaving {
  opacity: 0;
  transform: translateY(-18px);
  -webkit-transform: translateY(-18px);
  pointer-events: none;
  -webkit-transition: opacity var(--t-med) var(--ease),
                      -webkit-transform var(--t-med) var(--ease);
  transition: opacity var(--t-med) var(--ease),
              transform var(--t-med) var(--ease);
}

/* ══════════════════════════════════════════════════════════
   PORTADA
   ══════════════════════════════════════════════════════════ */
.screen--cover {
  padding: 0;
  justify-content: flex-end;
}

.cover__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.cover__placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--forest) 0%, var(--cantabric) 55%, var(--moss) 100%);
}

.cover__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 30%,
    rgba(22, 20, 15, 0.50) 72%,
    rgba(22, 20, 15, 0.80) 100%
  );
}

.cover__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: var(--sp-lg) var(--sp-lg) calc(var(--sp-xl) + env(safe-area-inset-bottom, 0px));
}

.cover__name {
  font-family: var(--f-title);
  font-weight: 400;
  font-size: clamp(3rem, 12vw, 4.5rem);
  color: var(--bg-light);
  letter-spacing: 0.015em;
  line-height: 1;
  margin-bottom: var(--sp-sm);
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.25s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.25s both;
}

.cover__tagline {
  font-family: var(--f-body);
  font-weight: 300;
  font-size: clamp(0.95rem, 3.8vw, 1.15rem);
  color: rgba(250, 248, 243, 0.80);
  line-height: 1.6;
  margin-bottom: var(--sp-lg);
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.50s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.50s both;
}

.cover__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(250, 248, 243, 0.68);
  padding: var(--sp-sm) 0;
  min-height: 48px;
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.80s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.80s both;
  -webkit-transition: color var(--t-fast) ease, gap var(--t-fast) ease;
  transition: color var(--t-fast) ease, gap var(--t-fast) ease;
}
.cover__btn:hover, .cover__btn:focus-visible {
  color: rgba(250, 248, 243, 1);
  gap: 16px;
  outline: none;
}
.cover__btn-arrow {
  font-size: 1rem;
  -webkit-transition: transform var(--t-fast) ease;
  transition: transform var(--t-fast) ease;
}
.cover__btn:hover .cover__btn-arrow {
  -webkit-transform: translateX(4px);
  transform: translateX(4px);
}

/* ══════════════════════════════════════════════════════════
   PRÓLOGO
   ══════════════════════════════════════════════════════════ */
.screen--intro {
  padding: var(--sp-xl) var(--sp-lg);
  text-align: center;
}

.intro__text {
  font-family: var(--f-title);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 4.2vw, 1.4rem);
  line-height: 1.8;
  color: var(--text);
  max-width: 320px;
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.2s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.2s both;
}

/* ══════════════════════════════════════════════════════════
   PAUSA VISUAL
   ══════════════════════════════════════════════════════════ */
.screen--pause {
  background: var(--bg-alt);
  padding: var(--sp-xl) var(--sp-lg);
}

.pause__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
  pointer-events: none;
}

.pause__phrase {
  position: relative;
  z-index: 1;
  font-family: var(--f-title);
  font-style: italic;
  font-size: clamp(1rem, 3.8vw, 1.2rem);
  color: var(--text-soft);
  text-align: center;
  max-width: 260px;
  line-height: 1.7;
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.3s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.3s both;
}

/* ══════════════════════════════════════════════════════════
   PERSONA
   ══════════════════════════════════════════════════════════ */
.screen--person {
  justify-content: flex-start;
  padding-top: var(--sp-xl);
  padding-bottom: calc(var(--sp-xl) + env(safe-area-inset-bottom, 0px));
  gap: 0;
}

/* Foto */
.person__photo-wrap {
  width: 100%;
  flex-shrink: 0;
  margin-bottom: var(--sp-lg);
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.1s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.1s both;
}

.person__photo {
  display: block;
  width: calc(100% - var(--sp-md) * 2);
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 1px;
  outline: 1px solid rgba(44, 42, 38, 0.06);
  /* Sombra: foto posada sobre papel */
  box-shadow:
    0 1px 2px rgba(44, 42, 38, 0.06),
    0 5px 20px rgba(44, 42, 38, 0.10);
}

.person__photo--empty {
  background: linear-gradient(135deg, var(--bg-alt) 0%, rgba(139,110,78,0.25) 100%);
}

/* Cuerpo de texto */
.person__body {
  width: 100%;
  padding: 0 var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.person__name {
  font-family: var(--f-title);
  font-weight: 400;
  font-size: clamp(1.65rem, 6.5vw, 2.1rem);
  color: var(--text);
  letter-spacing: 0.01em;
  line-height: 1.1;
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.28s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.28s both;
}

.person__relation {
  font-family: var(--f-body);
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-subtle);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: -0.7rem;
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.38s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.38s both;
}

.person__quote {
  font-family: var(--f-title);
  font-style: italic;
  font-size: clamp(0.95rem, 3.6vw, 1.1rem);
  color: var(--text-soft);
  line-height: 1.65;
  border-left: 2px solid var(--kraft);
  padding-left: var(--sp-md);
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.48s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.48s both;
}

/* ── Reproductor de audio ────────────────────────────────── */
.audio-player {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.62s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.62s both;
}

.audio-invite {
  font-family: var(--f-body);
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

/* Botón circular */
.audio-play-btn {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--kraft);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kraft);
  /* Área táctil mínima 44px — ya cumple con 52px */
  -webkit-transition: background var(--t-fast) ease, color var(--t-fast) ease;
  transition: background var(--t-fast) ease, color var(--t-fast) ease;
}
.audio-play-btn:hover, .audio-play-btn:focus-visible {
  background: var(--kraft);
  color: var(--bg);
  outline: none;
}
.audio-play-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
/* Pulso cuando reproduce */
.audio-play-btn.is-playing::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid var(--kraft);
  opacity: 0;
  -webkit-animation: ripple 2s ease-out infinite;
  animation: ripple 2s ease-out infinite;
  pointer-events: none;
}

.audio-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

/* Barra de progreso — compatible con todos los navegadores */
.audio-bar {
  height: 2px;
  background: var(--kraft-light);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.audio-bar__fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: var(--kraft);
  border-radius: 2px;
  pointer-events: none;
  -webkit-transition: width 0.1s linear;
  transition: width 0.1s linear;
}

.audio-time {
  font-family: var(--f-body);
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--text-subtle);
}

/* ══════════════════════════════════════════════════════════
   URGULL 1 — entrada
   ══════════════════════════════════════════════════════════ */
.screen--urgull-1 {
  padding: 0;
  justify-content: flex-end;
  background: var(--bg-alt);
}

.urgull1__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Desaturación leve — atmósfera contemplativa */
  -webkit-filter: saturate(0.80) brightness(0.90);
  filter: saturate(0.80) brightness(0.90);
}

.urgull1__placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--forest) 0%, #4a5040 60%, var(--bg-alt) 100%);
}

.urgull1__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 28%,
    rgba(22, 20, 15, 0.55) 72%,
    rgba(22, 20, 15, 0.82) 100%
  );
}

.urgull1__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: var(--sp-lg) var(--sp-lg) calc(var(--sp-xl) + env(safe-area-inset-bottom, 0px));
}

.urgull1__text {
  font-family: var(--f-title);
  font-style: italic;
  font-size: clamp(1.05rem, 3.8vw, 1.3rem);
  color: rgba(250, 248, 243, 0.88);
  line-height: 1.68;
  max-width: 300px;
  margin-bottom: var(--sp-lg);
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.25s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.25s both;
}

.urgull1__btn {
  font-family: var(--f-body);
  font-size: 0.84rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(250, 248, 243, 0.72);
  background: none;
  border: 1px solid rgba(250, 248, 243, 0.28);
  border-radius: 2px;
  padding: 12px var(--sp-lg);
  cursor: pointer;
  min-height: 48px;
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.50s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.50s both;
  -webkit-transition: background var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease;
  transition: background var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.urgull1__btn:hover, .urgull1__btn:focus-visible {
  background: rgba(250, 248, 243, 0.10);
  color: rgba(250, 248, 243, 1);
  border-color: rgba(250, 248, 243, 0.55);
  outline: none;
}

/* ══════════════════════════════════════════════════════════
   URGULL 2 — vídeo
   ══════════════════════════════════════════════════════════ */
.screen--urgull-2 {
  background: var(--bg-alt);
  padding: var(--sp-lg) var(--sp-md);
  gap: var(--sp-lg);
  justify-content: center;
}

.urgull2__video-wrap {
  position: relative;
  width: 100%;
  border-radius: 2px;
  overflow: hidden;
  background: #1a1916;
  box-shadow: 0 4px 28px rgba(44, 42, 38, 0.15);
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.2s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.2s both;
}

.urgull2__video {
  width: 100%;
  display: block;
  max-height: 52vh;
  object-fit: contain;
  background: #1a1916;
}

/* Overlay de play manual — compatible con iOS */
.urgull2__play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 20, 15, 0.32);
  cursor: pointer;
  -webkit-transition: background var(--t-fast) ease;
  transition: background var(--t-fast) ease;
}
.urgull2__play-overlay:hover { background: rgba(22, 20, 15, 0.18); }
.urgull2__play-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  -webkit-transition: opacity var(--t-med) ease;
  transition: opacity var(--t-med) ease;
}

.urgull2__play-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1.5px solid rgba(250, 248, 243, 0.70);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(250, 248, 243, 0.90);
}
.urgull2__play-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  margin-left: 3px; /* corrección óptica triángulo */
}

.urgull2__closing {
  font-family: var(--f-title);
  font-style: italic;
  font-size: clamp(1.05rem, 3.8vw, 1.25rem);
  color: var(--text-soft);
  text-align: center;
  opacity: 0;
  -webkit-transition: opacity var(--t-slow) ease;
  transition: opacity var(--t-slow) ease;
}
.urgull2__closing.visible { opacity: 1; }

/* ══════════════════════════════════════════════════════════
   NORA — matiz visual especial
   ══════════════════════════════════════════════════════════ */
.screen--nora {
  background: var(--bg-light);
}
/* Fotos de Nora: ligera luminosidad adicional */
.screen--nora .person__photo {
  -webkit-filter: brightness(1.04) contrast(0.97);
  filter: brightness(1.04) contrast(0.97);
}
/* Invitación de audio de Nora: más íntima */
.screen--nora .audio-invite {
  font-family: var(--f-title);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text-soft);
  letter-spacing: 0;
}

/* ══════════════════════════════════════════════════════════
   MANU — cierre
   ══════════════════════════════════════════════════════════ */
.screen--manu {
  background: var(--bg-alt);
}

.manu__pretext {
  font-family: var(--f-title);
  font-style: italic;
  font-size: clamp(1.45rem, 5.5vw, 1.9rem);
  font-weight: 400;
  color: var(--text);
  text-align: center;
  margin-bottom: var(--sp-xl);
  opacity: 0;
  -webkit-animation: fadeRise var(--t-slow) var(--ease) 0.2s both;
  animation: fadeRise var(--t-slow) var(--ease) 0.2s both;
}
/* Retrasar animaciones internas de Manu */
.screen--manu .person__photo-wrap {
  -webkit-animation-delay: 0.42s;
  animation-delay: 0.42s;
}
.screen--manu .person__name {
  -webkit-animation-delay: 0.58s;
  animation-delay: 0.58s;
}
.screen--manu .audio-player {
  -webkit-animation-delay: 0.74s;
  animation-delay: 0.74s;
}

/* ══════════════════════════════════════════════════════════
   PANTALLA FINAL
   ══════════════════════════════════════════════════════════ */
.screen--final {
  padding: 0;
  justify-content: flex-end;
}

.final__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-filter: saturate(0.85) brightness(0.93);
  filter: saturate(0.85) brightness(0.93);
}

.final__placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--cantabric) 0%, var(--forest) 60%, var(--bg-alt) 100%);
  opacity: 0.72;
}

.final__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 20%,
    rgba(22, 20, 15, 0.40) 68%,
    rgba(22, 20, 15, 0.68) 100%
  );
}

.final__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: var(--sp-lg) var(--sp-lg) calc(var(--sp-xl) + env(safe-area-inset-bottom, 0px));
}

.final__phrase {
  font-family: var(--f-title);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.45rem, 5.5vw, 2rem);
  color: rgba(250, 248, 243, 0.92);
  line-height: 1.35;
  letter-spacing: 0.01em;
  opacity: 0;
  -webkit-animation: fadeRise 900ms var(--ease) 0.4s both;
  animation: fadeRise 900ms var(--ease) 0.4s both;
}

/* ══════════════════════════════════════════════════════════
   NAVEGACIÓN
   ══════════════════════════════════════════════════════════ */
#nav {
  position: absolute;
  bottom: calc(var(--sp-lg) + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 var(--sp-md);
  pointer-events: none;
  z-index: 50;
}

.nav-btn {
  pointer-events: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-subtle);
  padding: var(--sp-sm);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-transition: color var(--t-fast) ease;
  transition: color var(--t-fast) ease;
}
.nav-btn:hover, .nav-btn:focus-visible {
  color: var(--text);
  outline: none;
}
.nav-btn svg {
  width: 22px;
  height: 22px;
}
.nav-btn[hidden] {
  visibility: hidden;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════
   BARRA DE PROGRESO
   ══════════════════════════════════════════════════════════ */
#progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  z-index: 60;
}
#progress-bar {
  height: 100%;
  background: var(--kraft);
  opacity: 0.30;
  width: 0%;
  -webkit-transition: width var(--t-med) var(--ease);
  transition: width var(--t-med) var(--ease);
}

/* ══════════════════════════════════════════════════════════
   KEYFRAMES
   Usamos tanto -webkit- como estándar para máxima compatibilidad
   ══════════════════════════════════════════════════════════ */
@-webkit-keyframes fadeRise {
  from { opacity: 0; -webkit-transform: translateY(14px); transform: translateY(14px); }
  to   { opacity: 1; -webkit-transform: translateY(0);    transform: translateY(0); }
}
@keyframes fadeRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@-webkit-keyframes ripple {
  0%   { -webkit-transform: scale(1);    transform: scale(1);    opacity: 0.5; }
  100% { -webkit-transform: scale(1.6);  transform: scale(1.6);  opacity: 0; }
}
@keyframes ripple {
  0%   { transform: scale(1);    opacity: 0.5; }
  100% { transform: scale(1.6);  opacity: 0; }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE

   La experiencia NO se expande en iPad/escritorio.
   El frame ya tiene max-width controlado.
   Estos breakpoints solo ajustan detalles de margen.
   ══════════════════════════════════════════════════════════ */

/* iPad y escritorio: fondo exterior visible como margen */
@media (min-width: 520px) {
  #app {
    /* Textura muy sutil en el espacio exterior */
    background: var(--bg-alt);
  }
  #frame {
    /* Sombra más pronunciada: el cuaderno "flota" sobre el fondo */
    box-shadow:
      0 0 0 1px rgba(44, 42, 38, 0.06),
      0 8px 48px rgba(44, 42, 38, 0.16);
    /* Separación visual del borde superior/inferior en escritorio */
    margin: auto 0;
    max-height: 100%;
  }
}

/* ══════════════════════════════════════════════════════════
   ACCESIBILIDAD
   ══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    -webkit-animation-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    -webkit-transition-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    opacity: 1 !important;
    -webkit-transform: none !important;
    transform: none !important;
  }
}

:focus-visible {
  outline: 2px solid var(--kraft);
  outline-offset: 3px;
  border-radius: 2px;
}
