/* ==========================================================================
   Aisha & Sebastián — Jardín Abierto de Flores 1010 (Sin Marcos ni Modales)
   Todo en acceso directo y visible sobre terciopelo rosa oscuro
   ========================================================================== */

:root {
  --bg-canvas: #12070c;
  --bg-pill: rgba(26, 11, 18, 0.78);
  --border-rose-subtle: rgba(244, 143, 177, 0.35);
  --rose-primary: #f48fb1;
  --rose-sheen: #ffccd9;
  --text-ivory: #fdf4f6;
  --text-blush: #f7dfe8;
  --text-muted: #d1b0bd;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Quicksand", system-ui, -apple-system, sans-serif;
  --radius-pill: 9999px;
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--bg-canvas);
  color: var(--text-ivory);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--rose-sheen);
  outline-offset: 2px;
}

.tabular-fig {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   1. Lienzo Abierto a Pantalla Completa
   ========================================================================== */
#binary-garden-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  z-index: 1;
  cursor: crosshair;
  touch-action: none;
  background-color: var(--bg-canvas);
  background: linear-gradient(180deg, #170715 0%, #32112c 24%, #6e2348 44%, #ab3d64 60%, #d46580 73%, #571b37 86%, #160710 100%);
}

/* ==========================================================================
   2. Identidad y Anillo Temporal Flotantes (Sin Barra ni Marco)
   ========================================================================== */
.floating-identity {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.identity-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-monogram {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--rose-sheen);
  letter-spacing: 0.04em;
}

.identity-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.35rem);
  font-weight: 700;
  color: var(--text-ivory);
  line-height: 1.1;
  white-space: nowrap;
}

.brand-date {
  font-size: 12px;
  color: var(--rose-sheen);
  font-weight: 600;
}

.identity-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.petal-ring-svg {
  flex-shrink: 0;
  transform: rotate(-90deg);
}

.ring-track {
  stroke: rgba(244, 143, 177, 0.25);
}

.ring-progress {
  stroke: var(--rose-primary);
  transition: stroke-dashoffset 0.5s ease;
}

.anniv-days {
  font-size: 13px;
  font-weight: 700;
  color: var(--rose-sheen);
  white-space: nowrap;
}

/* ==========================================================================
   3. Centro Poético Abierto (Saludo, Tiempo Vivo y Dedicatoria Visibles)
   ========================================================================== */
.open-sky-centerpiece {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 10;
  width: 90vw;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sky-ribbon-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sky-eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--rose-primary);
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.sky-headline {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 1.5rem + 2.4vw, 3.6rem);
  font-weight: 700;
  font-style: italic;
  color: var(--text-ivory);
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.95);
  line-height: 1.08;
}

.live-time-verse {
  margin: 4px 0 0;
  font-family: var(--font-sans);
  font-size: clamp(0.88rem, 0.82rem + 0.28vw, 1.05rem);
  font-weight: 700;
  color: var(--rose-sheen);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
}

.visible-dedication {
  margin: 2px 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.25rem);
  color: var(--text-blush);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
  line-height: 1.4;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ==========================================================================
   4. Controles Flotantes Sueltos (Sin Caja Contenedora Externa)
   ========================================================================== */
.open-actions-bar {
  position: fixed;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 14px));
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  z-index: 20;
  max-width: 96vw;
}

.action-pill {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.action-primary {
  background: var(--rose-primary);
  color: #1d0811;
  border: 1px solid var(--rose-sheen);
}

.action-primary:hover {
  transform: translateY(-1px);
  background: #ffa8c5;
}

.action-primary:active {
  transform: translateY(1px);
}

.action-soft {
  background: var(--bg-pill);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-rose-subtle);
  color: var(--text-ivory);
}

.action-soft:hover {
  border-color: var(--rose-sheen);
  background: rgba(54, 23, 37, 0.88);
}

.action-quiet {
  background: var(--bg-pill);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-rose-subtle);
  color: var(--text-muted);
}

.action-quiet:hover {
  border-color: var(--rose-primary);
  color: var(--text-ivory);
}

.open-counter {
  font-size: 12px;
  font-weight: 700;
  color: var(--rose-sheen);
  white-space: nowrap;
  padding-left: 4px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
}

/* ==========================================================================
   5. Adaptabilidad Móvil (375 px / 390 px) y Movimiento Reducido
   ========================================================================== */
@media (max-width: 768px) {
  .floating-identity {
    top: max(14px, env(safe-area-inset-top));
    left: 16px;
    right: 16px;
  }
  .brand-date {
    display: none;
  }
  .open-sky-centerpiece {
    top: calc(max(14px, env(safe-area-inset-top)) + 44px);
    width: 92vw;
  }
  .open-actions-bar {
    bottom: max(16px, calc(env(safe-area-inset-bottom) + 12px));
    gap: 8px;
  }
  .open-counter {
    display: none;
  }
}

@media (max-width: 440px) {
  .couture-bow-icon {
    width: 32px;
    height: 14px;
  }
  .sky-ribbon-row {
    gap: 6px;
  }
  .brand-name {
    font-size: 15px;
  }
  .live-time-verse {
    font-size: 13px;
  }
  .visible-dedication {
    font-size: 14px;
  }
  .action-pill {
    padding: 8px 12px;
  }
}

@media (max-width: 380px) {
  .couture-bow-icon {
    width: 26px;
    height: 12px;
  }
  .sky-headline {
    font-size: clamp(1.68rem, 7.4vw, 2.05rem);
  }
  .open-actions-bar {
    gap: 6px;
  }
  .action-pill {
    padding: 8px 11px;
  }
}

@media (max-height: 690px) {
  .floating-identity {
    top: max(10px, env(safe-area-inset-top));
  }
  .open-sky-centerpiece {
    top: calc(max(10px, env(safe-area-inset-top)) + 38px);
    gap: 3px;
  }
  .sky-headline {
    font-size: clamp(1.65rem, 4.6vh, 2.4rem);
  }
  .visible-dedication {
    line-height: 1.3;
  }
}

@media (max-height: 480px) {
  .floating-identity {
    top: 8px;
  }
  .brand-date,
  .sky-ribbon-row {
    display: none;
  }
  .open-sky-centerpiece {
    top: 28px;
    gap: 2px;
    max-width: 680px;
  }
  .sky-headline {
    font-size: 1.5rem;
  }
  .live-time-verse,
  .visible-dedication {
    font-size: 12px;
    margin: 0;
    line-height: 1.25;
  }
  .open-actions-bar {
    bottom: 8px;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
