/* Storello — storelloapp.com
   A gentle bedtime landing. Re-skin of the pim site into Storello's world:
   warm cream + soft gold + dusk-purple, a rounded display face, and a hero that
   slowly drifts day → dusk → night. Tokens mirror the app's Theme.swift. */

:root {
  --cream:   #FFF7EE;   /* warm page background (app: StorelloColor.background) */
  --card:    #FFFFFF;
  --border:  #F1E7DB;   /* warm hairline on cream */
  --ink:     #2A2440;   /* primary text (app: ink) */
  --muted:   #6A6385;   /* secondary text (app: inkSoft) */
  --gold:    #F5C66B;   /* primary accent — moon + sparkle */
  --dusk:    #9E8AEB;   /* secondary accent — dream purple */
  --link:    #6A4FC7;   /* readable purple for links on white */
  --night:      #12152B; /* bedtime surfaces (app: night) */
  --night-deep: #0B0D1C; /* app: nightDeep */
  --night-top:  #1B1746; /* app: nightTop */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* ---------- bilingual visibility (flash-free: root class set in <head>) ---------- */
html.lang-en .only-pt,
html.lang-pt .only-en { display: none; }

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 24px;
  gap: 16px;
}

/* wordmark rendered as live text (matches the app — Storello has no locked logotype) */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: ui-rounded, 'Nunito', 'Inter', sans-serif;
  font-weight: 900;
  font-size: 25px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.wordmark .moon { font-size: 0.86em; filter: saturate(1.05); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease-out;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); }

/* language toggle — a small pill */
.lang-toggle {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 11px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.lang-toggle:hover { color: var(--ink); border-color: var(--muted); }

/* story title top-left on the hero — the current cover's name, swapped by the reel */
.now-showing {
  font-family: ui-rounded, 'Nunito', 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.005em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
  max-width: 52vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- hero (index) ---------- */

.hero-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* full-bleed rotating art sits behind everything; body stays transparent so it shows */
.on-photo { background: transparent; }

.bg-rotator {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--night-deep); /* no white flash before the first slide decodes */
}

.bg-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}
.bg-slide.is-active { opacity: 1; }

/* blurred, enlarged copy of the same cover — fills the frame with a colour-matched wash so
   portrait covers show WHOLE on wide screens instead of hard-cropping (the "now playing" look). */
.slide-fill {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(26px) saturate(1.06) brightness(0.64);
  transform: scale(1.18);
}
/* the sharp cover, shown whole and centred over its own blur */
.slide-art {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
/* on phones, fill the screen (like the app's onboarding) — no empty blur bands. Portrait
   covers ≈ fill; the two landscape covers crop to their central subject. */
@media (max-width: 640px) {
  .slide-art { background-size: cover; }
}

/* indigo scrim: light at top, heavy at the bottom where the headline + CTA sit.
   deepens the whole frame toward the night palette and keeps white text legible
   over the brighter 'day' slide too. */
.bg-scrim {
  position: absolute;
  inset: 0;
  background:
    /* soft top so the story title + nav read over any cover */
    linear-gradient(to bottom, rgba(11,13,28,0.58), rgba(11,13,28,0.14) 15%, rgba(11,13,28,0) 30%),
    /* strong bottom where the wordmark + tagline + CTA sit (onboarding-style) */
    linear-gradient(to top, rgba(11,13,28,0.94), rgba(11,13,28,0.72) 20%, rgba(11,13,28,0.20) 46%, rgba(11,13,28,0) 64%);
}

.on-photo .wordmark { color: #FFFFFF; text-shadow: 0 1px 10px rgba(0,0,0,0.35); }
.on-photo .site-nav a { color: rgba(255,255,255,0.82); }
.on-photo .site-nav a:hover { color: #FFFFFF; }
.on-photo .lang-toggle {
  color: rgba(255,255,255,0.82);
  border-color: rgba(255,255,255,0.32);
}
.on-photo .lang-toggle:hover { color: #FFFFFF; border-color: rgba(255,255,255,0.7); }

.hero {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;   /* bottom-left, like the app's onboarding welcome */
  text-align: left;
  padding: 24px 24px 4vh;
}

.hero-wordmark {
  font-size: clamp(30px, 4.4vw, 44px);
  margin: 0;
}
.on-photo .hero-wordmark {
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 3px 30px rgba(0,0,0,0.5);
}

.hero-tagline {
  font-size: clamp(17px, 2.1vw, 22px);
  font-weight: 500;
  line-height: 1.45;
  max-width: 22ch;
  margin: 12px 0 0;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 4px rgba(0,0,0,0.4), 0 2px 22px rgba(0,0,0,0.5);
}

.hero-cta {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.store-badge { display: inline-block; transition: transform .15s ease-out; }
.store-badge img { height: 54px; width: auto; display: block; }
.store-badge:hover { transform: scale(1.03); }
.store-badge:active { transform: scale(0.97); }

.hero .caption {
  font-size: 14px;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5), 0 1px 16px rgba(0,0,0,0.4);
}

/* ---------- slide indicator (stories-style dashes that fill over each slide) ---------- */

.slides-nav {
  display: flex;
  gap: 8px;
  justify-content: flex-start;   /* align under the bottom-left content */
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 8px;
}
.seg {
  width: 26px;
  height: 4px;
  border-radius: 2px;
  border: 0;
  padding: 0;
  background: rgba(255,255,255,0.30);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background .25s ease-out;
}
.seg:hover { background: rgba(255,255,255,0.5); }
.seg .fill {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: #FFFFFF;
  transform: scaleX(0);
  transform-origin: left;
}
.seg.is-active .fill { animation: segfill 5s linear forwards; }
@keyframes segfill { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .seg.is-active .fill { animation: none; transform: scaleX(1); }
}

/* gentle staggered entrance */
@media (prefers-reduced-motion: no-preference) {
  .rise {
    opacity: 0;
    transform: translateY(14px);
    animation: rise .7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  .rise-1 { animation-delay: .06s; }
  .rise-2 { animation-delay: .16s; }
  .rise-3 { animation-delay: .28s; }
  .rise-4 { animation-delay: .42s; }
  @keyframes rise { to { opacity: 1; transform: translateY(0); } }
}

/* ---------- footer ---------- */

.site-footer {
  text-align: center;
  padding: 22px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.on-photo .site-footer,
.on-photo .site-footer a { color: rgba(255,255,255,0.72); }
.on-photo .site-footer a:hover { color: #FFFFFF; }

/* ---------- legal pages ---------- */

.legal { max-width: 720px; margin: 0 auto; padding: 20px 24px 80px; }
.legal h1 {
  font-family: ui-rounded, 'Nunito', 'Inter', sans-serif;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 22px 0 6px;
}
.legal .updated { color: var(--muted); font-size: 15px; margin: 0 0 34px; }
.legal h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 38px 0 12px;
}
.legal p, .legal li { font-size: 16px; line-height: 1.65; color: #3F3A52; }
.legal li { margin-bottom: 8px; }
.legal strong { color: var(--ink); }
.legal a { color: var(--link); text-decoration: none; }
.legal a:hover { text-decoration: underline; }
.legal .summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 28px;
  margin: 26px 0;
}
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
.legal th, .legal td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
  vertical-align: top;
}
.legal th { color: var(--muted); font-weight: 600; }
.legal .closing { margin-top: 46px; color: var(--muted); font-style: italic; }

@media (max-width: 560px) {
  .site-header { padding: 18px 18px; }
  .site-nav { gap: 16px; }
  .site-nav .nav-link-hideable { display: none; } /* keep only the essentials on tiny screens */
  .legal h1 { font-size: 29px; }
}

/* ---------- contact modal ---------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-root[hidden] { display: none; }

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(11,13,28,0.52);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity .26s ease;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 452px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 34px 32px 32px;
  box-shadow: 0 24px 70px rgba(15,10,40,0.34);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity .28s ease, transform .34s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-root.is-open .modal-scrim { opacity: 1; }
.modal-root.is-open .modal-card { opacity: 1; transform: none; }
.modal-root.no-anim .modal-scrim,
.modal-root.no-anim .modal-card { transition: none; }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease-out, color .15s ease-out;
}
.modal-close:hover { background: #F3ECFF; color: var(--ink); }

.modal-title {
  font-family: ui-rounded, 'Nunito', 'Inter', sans-serif;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  padding-right: 28px;
}
.modal-sub {
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 22px;
  max-width: 38ch;
}

.contact-form .field { margin-bottom: 22px; }
.contact-form label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid #E7E0F0;
  border-radius: 12px;
  padding: 12px 14px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s ease-out, box-shadow .15s ease-out;
}
.contact-form textarea { resize: vertical; min-height: 104px; line-height: 1.5; }
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: #6A6385; } /* >=4.5:1 on white */
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--dusk);
  box-shadow: 0 0 0 3px rgba(158,138,235,0.18);
}

/* honeypot — visually hidden, off the tab order */
.contact-form .hp {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.form-error {
  font-size: 14px;
  line-height: 1.45;
  color: #D6453B;
  margin: 0 0 10px;
}

.btn-send {
  width: 100%;
  margin-top: 8px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--ink);
  border: 0;
  border-radius: 100px;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform .12s ease-out, background .15s ease-out, opacity .15s ease-out;
}
.btn-send:hover { background: #3A3358; }
.btn-send:active { transform: scale(0.98); }
.btn-send[disabled] { opacity: 0.6; cursor: default; }

.contact-done { text-align: center; padding: 10px 0 4px; }
.contact-done .done-mark {
  width: 60px; height: 60px;
  margin: 6px auto 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  background: rgba(158,138,235,0.14);
  border-radius: 50%;
}
.contact-done h3 {
  font-family: ui-rounded, 'Nunito', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 8px;
}
.contact-done p {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 auto 22px;
  max-width: 34ch;
}

@media (prefers-reduced-motion: reduce) {
  .modal-scrim, .modal-card { transition: none; }
  .bg-slide { transition: none; }
}
@media (max-width: 560px) {
  .modal-card { padding: 30px 22px 26px; border-radius: 22px; }
  .modal-title { font-size: 23px; }
  .store-badge img { height: 50px; }
}
