/*
  Perda website – home page (/), loaded after styles.css.
  The phone recreates the app's player in HTML, CSS and inline SVG: the logo's curtain opens on the
  stage, with the AI mark, the part's caption and a money note. Gold means money, as in the app.
  Motion is CSS only, ends within 5 seconds of loading and is off with prefers-reduced-motion.
*/

:root {
  --glow-1: #F3D2D0;
  --glow-2: #F2DDB8;
  --gold-soft: #F7E7C6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --glow-1: #4A2228;
    --glow-2: #3D2B1C;
    --gold-soft: #4A3720;
  }
}

.home {
  overflow-x: clip;
}

.hero,
.faq-grid,
.money-panel,
.money-options {
  grid-template-columns: minmax(0, 1fr);
}

/* Header */

.topnav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

/* Phones show the brand only; the section links follow from 760px. */
.topnav a {
  display: none;
  padding-block: 10px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.topnav a:hover {
  color: var(--accent);
}

@media (min-width: 760px) {
  .topnav a {
    display: inline;
  }
}

/* Shared type */

.kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-head {
  max-width: 780px;
  margin-bottom: clamp(24px, 4vw, 44px);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(2.125rem, 1.35rem + 3.3vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.028em;
}

.section-head > p:not(.kicker) {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.1875rem;
}

/* Hero */

.hero {
  display: grid;
  gap: 48px;
  align-items: center;
  padding-block: clamp(20px, 5vw, 56px) clamp(64px, 9vw, 120px);
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 40px;
  }

  .hero h1 {
    font-size: clamp(3.75rem, 1rem + 4.8vw, 5.5rem);
  }
}

.hero h1 {
  margin: 0 0 24px;
  font-size: clamp(2.875rem, 1.6rem + 5.6vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.lede {
  max-width: 28ch;
  margin: 0 0 34px;
  color: var(--muted);
  font-size: clamp(1.1875rem, 1rem + 0.8vw, 1.5rem);
  line-height: 1.4;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Not links until the apps are live: quiet outlined badges with "Coming soon". */
.store {
  display: grid;
  min-width: 170px;
  padding: 10px 22px 12px 18px;
  border: 1px solid var(--outline);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.2;
}

.store small {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.store b {
  font-family: var(--display);
  font-size: 1.375rem;
  letter-spacing: -0.01em;
}

.hero-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-visual {
  position: relative;
  display: grid;
  justify-items: center;
  isolation: isolate;
}

.hero-visual::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 4% -4% 0;
  background:
    radial-gradient(closest-side at 40% 40%, var(--glow-1), transparent),
    radial-gradient(closest-side at 66% 72%, var(--glow-2), transparent);
}

/* The phone with the player. Everything inside scales with the phone width (1em = 1/26). */

.phone {
  position: relative;
  width: min(100%, 320px);
  padding: 10px;
  border-radius: 54px;
  background: #1E1B19;
  box-shadow:
    inset 0 0 0 1.5px #4A4440,
    inset 0 0 0 6px #121010,
    0 14px 30px -14px rgb(33 27 23 / 0.35),
    0 60px 90px -40px rgb(33 27 23 / 0.5);
  container-type: inline-size;
}

.screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 390 / 844;
  border-radius: 44px;
  background: #0B0A0F;
  color: #FFFFFF;
  font-size: 12px;
  font-size: calc(100cqw / 26);
  line-height: 1.3;
}

:where(.screen) p {
  margin: 0;
}

.stage {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* The app's AI mark (lib/core/widgets/ai_mark.dart): light on dark, on everything AI-made. */
.ai-mark {
  position: absolute;
  top: 16.5%;
  left: 6%;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.25em 0.6em;
  border: 1px solid rgb(255 255 255 / 0.38);
  border-radius: 0.65em;
  background: rgb(0 0 0 / 0.26);
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.ai-mark svg {
  width: 0.95em;
  height: 0.95em;
  fill: #FFFFFF;
}

/* Below the right drape's tie-back. */
.ph-side {
  position: absolute;
  right: 5%;
  bottom: 18.5%;
  display: grid;
  gap: 0.9em;
}

.ph-action {
  display: grid;
  place-items: center;
  width: 2.7em;
  height: 2.7em;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.32);
}

.ph-action svg {
  width: 1.45em;
  height: 1.45em;
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ph-action:first-child svg {
  fill: #FFFFFF;
  stroke: none;
}

.ph-caption {
  position: absolute;
  right: 22%;
  bottom: 6%;
  left: 6%;
}

.ph-part {
  font-family: var(--display);
  font-size: 2em;
  line-height: 1.1;
}

.ph-meta {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin: 0.35em 0 1em;
  color: rgb(255 255 255 / 0.8);
  font-size: 0.95em;
}

.ph-free {
  padding: 0.12em 0.6em;
  border: 1px solid rgb(255 255 255 / 0.55);
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 0.9em;
  font-weight: 600;
}

.ph-progress {
  display: block;
  width: 128%;
  height: 0.24em;
  overflow: hidden;
  border-radius: 1em;
  background: rgb(255 255 255 / 0.25);
}

.ph-progress i {
  display: block;
  width: 34%;
  height: 100%;
  border-radius: inherit;
  background: #FFFFFF;
}

/* The money note: confirms a money moment, as in the app (lib/core/widgets/money_note.dart). */
.note-chip {
  position: absolute;
  top: 7%;
  right: max(0px, calc(50% - 236px));
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 9px 18px 9px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}

/* The coin: gold with an embossed "P", never a play mark. */
.coin {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #FFE9A8 0%, #E8AA3E 55%, #B9781F 100%);
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.32), inset 0 -2px 0 rgb(0 0 0 / 0.14);
  color: #6B4310;
  font-family: var(--display);
  font-size: 0.9375rem;
  line-height: 1;
  text-shadow: 0 1px 0 rgb(255 255 255 / 0.55);
}

.coin.big {
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
}

/* The curtain opens once: the drapes part from the middle, then the play mark lights up. */
.drape {
  transform-box: view-box;
}

.drape-left {
  transform-origin: 0 0;
}

.drape-right {
  transform-origin: 390px 0;
}

.ph-play {
  transform-box: fill-box;
  transform-origin: center;
}

/* How it works */

.how {
  padding-block: clamp(24px, 4vw, 48px) clamp(48px, 7vw, 88px);
}

.cards {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  padding: 24px 24px 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
}

.card h3 {
  margin: 18px 0 8px;
  font-size: 1.3125rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card-icon {
  display: block;
  width: 46px;
  height: 46px;
  padding: 11px;
  border-radius: 14px;
  background: var(--accent-tint);
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-icon.gold {
  background: var(--gold-soft);
  stroke: var(--gold);
}

/* Coins & VIP: the dark wine stage of Curtain's dark mode, with gold for money. */

.money {
  padding-block: clamp(16px, 3vw, 40px) clamp(40px, 6vw, 80px);
}

.money-panel {
  display: grid;
  gap: 32px;
  padding: clamp(28px, 5.5vw, 64px);
  border: 1px solid rgb(255 255 255 / 0.06);
  border-radius: clamp(28px, 4vw, 40px);
  background: radial-gradient(120% 100% at 100% 0%, #4A2228 0%, #2D1C1D 55%, #1F1314 100%);
  color: #F5EDDF;
}

@media (min-width: 960px) {
  .money-panel {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 36px 64px;
  }

  .money-panel .fine {
    grid-column: 1 / -1;
  }
}

.money-panel .kicker {
  color: #E9BE72;
}

.money-panel h2 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.028em;
}

.money-panel p {
  margin: 0;
  color: rgb(245 237 223 / 0.84);
  font-size: 1.125rem;
}

.money-options {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .money-options {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.option {
  padding: 22px 22px 24px;
  border: 1.5px solid rgb(233 190 114 / 0.6);
  border-radius: 22px;
  background: rgb(255 255 255 / 0.04);
}

.option h3 {
  margin: 16px 0 6px;
  color: #F5EDDF;
  font-size: 1.375rem;
}

.money-panel .option p {
  font-size: 1rem;
}

.vip-badge {
  display: inline-grid;
  place-items: center;
  height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFD978, #E59A2F);
  color: #2B1A04;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.money-panel .fine {
  color: rgb(245 237 223 / 0.72);
  font-size: 0.9375rem;
}

/* FAQ */

.faq {
  padding-block: clamp(48px, 7vw, 104px);
}

.faq-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 960px) {
  .faq-grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 72px;
  }

  .faq .section-head {
    position: sticky;
    top: 32px;
    align-self: start;
  }
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 18px 22px;
  border-radius: 22px;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    linear-gradient(var(--accent), var(--accent)) center / 12px 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) center / 2px 12px no-repeat,
    var(--tint);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  margin: 0;
  padding: 0 22px 20px;
  color: var(--muted);
}

/* Closing */

.closing {
  padding-block: clamp(24px, 4vw, 56px) clamp(24px, 4vw, 48px);
  text-align: center;
}

.closing .wrap {
  display: grid;
  justify-items: center;
}

.closing-mark {
  width: 72px;
  height: 72px;
  margin-bottom: 22px;
  border-radius: 22.5%;
  box-shadow: var(--shadow);
}

.closing h2 {
  margin: 0 0 14px;
  font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.closing p {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 1.1875rem;
}

.closing .stores {
  justify-content: center;
}

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* Plays once and is over 3 s after load (WCAG 2.2.2: at most 5 s). */
  .phone {
    animation: rise 1s cubic-bezier(0.2, 0.75, 0.25, 1) both;
  }

  .drape {
    animation: part 1.5s cubic-bezier(0.65, 0, 0.25, 1) 0.45s both;
  }

  .ph-play {
    animation: light 0.6s ease-out 1.35s both;
  }

  .note-chip {
    animation: note 0.45s ease-out 2.3s both;
  }

  .faq summary::after {
    transition: transform 0.25s ease;
  }

  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 90%;
    }
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.98);
  }
}

/* Closed, the drapes meet in the middle (their inner edge at 172 of 390 units, 1.16 × 172 > 195). */
@keyframes part {
  from {
    transform: scaleX(1.16);
  }
}

@keyframes light {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
}

@keyframes note {
  from {
    opacity: 0;
    translate: 0 -10px;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    translate: 0 48px;
  }
}

@media print {
  .hero-visual {
    display: none;
  }

  .reveal {
    animation: none;
  }
}
