/*
 * PaddiPop website stylesheet.
 * No external fonts, frameworks, or remote resources. Colours mirror
 * PaddiPop/DesignSystem/DesignTokens.swift in the iOS app.
 */

:root {
  color-scheme: dark;
  --bg: #090c17;
  --bg-deep: #05060d;
  --bg-violet: #140a24;
  --surface: #131729;
  --surface-raised: #1c2138;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f7ff;
  --text-muted: #b9bfd6;
  --cyan: #61f0d4;
  --cyan-strong: #2de2ff;
  --pink: #fa7db8;
  --magenta: #ff3fa4;
  --warning-bg: #3a2a05;
  --warning-line: #ffc94d;
  --warning-text: #ffe29a;
  --radius: 1.5rem;
  --radius-sm: 0.875rem;
  --page: min(72rem, 100% - 2.5rem);
  --prose: min(46rem, 100% - 2.5rem);
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --glow-cyan: 0 0 0.6rem rgba(97, 240, 212, 0.55), 0 0 2rem rgba(45, 226, 255, 0.25);
  --glow-pink: 0 0 0.6rem rgba(250, 125, 184, 0.55), 0 0 2rem rgba(255, 63, 164, 0.25);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(60rem 40rem at 110% -10%, rgba(255, 63, 164, 0.14), transparent 60%),
    radial-gradient(50rem 36rem at -10% 20%, rgba(45, 226, 255, 0.1), transparent 60%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-violet) 100%);
  background-attachment: fixed;
}

main {
  flex: 1 0 auto;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--cyan);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: #9ff8e6;
}

:focus-visible {
  outline: 3px solid var(--cyan-strong);
  outline-offset: 3px;
  border-radius: 0.35rem;
  box-shadow: 0 0 0 6px rgba(9, 12, 23, 0.9);
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  font-weight: 800;
  text-wrap: balance;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}

h1 {
  font-size: clamp(2.25rem, 1.6rem + 3vw, 4rem);
}

h2 {
  font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2.25rem);
}

h3 {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
}

p,
ul,
ol,
dl {
  margin: 0 0 1em;
}

li + li {
  margin-top: 0.35em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--cyan);
  color: #04131a;
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Header / navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 9, 18, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.site-header__inner {
  width: var(--page);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.brand img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.6rem;
  box-shadow: 0 0 1rem rgba(255, 63, 164, 0.35);
}

.wordmark__paddi {
  color: var(--cyan);
}

.wordmark__pop {
  color: var(--pink);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(97, 240, 212, 0.12);
  box-shadow: inset 0 0 0 1px rgba(97, 240, 212, 0.45);
}

@media (max-width: 40rem) {
  .site-header {
    position: static;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav ul {
    gap: 0.15rem;
  }

  .site-nav a {
    padding-inline: 0.7rem;
    font-size: 0.9rem;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(52rem, 92vh);
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.hero__art,
.hero__art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.hero__art img {
  object-fit: cover;
  object-position: 70% 50%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 6, 13, 0.94) 0%, rgba(5, 6, 13, 0.78) 38%, rgba(5, 6, 13, 0.12) 72%),
    linear-gradient(0deg, rgba(5, 6, 13, 0.9) 0%, transparent 35%);
}

.hero__content {
  width: var(--page);
  margin-inline: auto;
  padding-block: clamp(4rem, 10vw, 8rem);
}

.hero__content > * {
  max-width: 36rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(97, 240, 212, 0.45);
  background: rgba(9, 12, 23, 0.7);
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(3.5rem, 2rem + 8vw, 7.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 0.25em;
  line-height: 0.95;
}

.hero h1 .wordmark__paddi {
  text-shadow: var(--glow-cyan);
}

.hero h1 .wordmark__pop {
  text-shadow: var(--glow-pink);
}

.tagline {
  font-size: clamp(1.4rem, 1.1rem + 1.6vw, 2.3rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1.25rem;
}

.tagline span {
  display: block;
}

.tagline span:last-child {
  color: var(--pink);
}

.hero__lede {
  color: var(--text-muted);
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.25rem);
  margin-bottom: 2rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

@media (max-width: 48rem) {
  .hero {
    min-height: auto;
  }

  .hero::after {
    background:
      linear-gradient(0deg, rgba(5, 6, 13, 0.96) 0%, rgba(5, 6, 13, 0.82) 55%, rgba(5, 6, 13, 0.35) 100%);
  }

  .hero__art img {
    object-position: 66% 50%;
  }

  .hero__content {
    padding-top: 12rem;
  }
}

@media (min-width: 48.01rem) and (max-width: 63.99rem) {
  /* Keep the ball to the right of the copy on tablet-portrait widths. */
  .hero__art img {
    object-position: 35% 50%;
  }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.button--primary {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-strong) 100%);
  color: #04131a;
  box-shadow: var(--glow-cyan);
}

.button--primary:hover {
  color: #04131a;
  transform: translateY(-2px);
}

.button--ghost {
  border-color: rgba(250, 125, 184, 0.7);
  color: var(--text);
  background: rgba(9, 12, 23, 0.6);
}

.button--ghost:hover {
  color: var(--text);
  box-shadow: var(--glow-pink);
}

.button--disabled {
  border: 2px dashed rgba(255, 255, 255, 0.4);
  background: rgba(9, 12, 23, 0.72);
  color: var(--text-muted);
  cursor: not-allowed;
}

.button svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.section__inner {
  width: var(--page);
  margin-inline: auto;
}

.section__head {
  max-width: 44rem;
  margin-bottom: 2.5rem;
}

.section__head p {
  color: var(--text-muted);
}

.kicker {
  color: var(--pink);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.feature-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
}

.feature-grid li + li {
  margin-top: 0;
}

.card {
  position: relative;
  height: 100%;
  padding: 1.6rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(28, 33, 56, 0.92), rgba(19, 23, 41, 0.92));
  border: 1px solid var(--line);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.35);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(97, 240, 212, 0.55), transparent 40%, transparent 60%, rgba(250, 125, 184, 0.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card h3 {
  margin-bottom: 0.4em;
}

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

.card__icon {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  margin-bottom: 1.1rem;
}

.card__stat {
  display: block;
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.6rem;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
}

.card__stat--pink {
  color: var(--pink);
  text-shadow: var(--glow-pink);
}

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.split__media img {
  width: min(22rem, 100%);
  margin-inline: auto;
  border-radius: 22%;
  box-shadow: 0 0 3rem rgba(255, 63, 164, 0.35), 0 0 6rem rgba(45, 226, 255, 0.2);
}

.check-list {
  list-style: none;
  padding: 0;
}

.check-list li {
  position: relative;
  padding-left: 1.9rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.55em;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: var(--glow-pink);
}

.store-panel {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  padding: clamp(1.75rem, 4vw, 3rem);
  border-radius: calc(var(--radius) * 1.2);
  background:
    radial-gradient(30rem 16rem at 100% 0%, rgba(255, 63, 164, 0.22), transparent 70%),
    radial-gradient(30rem 16rem at 0% 100%, rgba(45, 226, 255, 0.18), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
}

.store-panel h2 {
  margin-bottom: 0.3em;
}

.store-panel p {
  color: var(--text-muted);
  margin-bottom: 0;
}

.store-panel__cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.store-panel__note {
  font-size: 0.9rem;
}

/* ---------- Document pages ---------- */

.page-hero {
  padding-block: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(40rem 18rem at 85% 0%, rgba(255, 63, 164, 0.16), transparent 70%),
    radial-gradient(40rem 18rem at 10% 100%, rgba(45, 226, 255, 0.12), transparent 70%);
}

.page-hero__inner {
  width: var(--prose);
  margin-inline: auto;
}

.page-hero h1 {
  margin-bottom: 0.35em;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 0;
}

.prose {
  width: var(--prose);
  margin-inline: auto;
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem);
}

.prose h2 {
  margin-top: 2.2em;
  padding-top: 0.2em;
  scroll-margin-top: 5.5rem;
}

.prose h3 {
  margin-top: 1.8em;
  scroll-margin-top: 5.5rem;
}

.lang-block > h3 {
  margin-top: 2.2em;
  font-size: clamp(1.3rem, 1.15rem + 0.8vw, 1.75rem);
}

.prose h4 {
  margin: 1.6em 0 0.5em;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--cyan);
  scroll-margin-top: 5.5rem;
}

.prose h2:first-child,
.prose .lang-block > h2:first-child {
  margin-top: 0;
}

.prose p,
.prose li,
.prose dd {
  color: #dde1f0;
}

.prose strong {
  color: var(--text);
}

.prose dl {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: 0.5rem 1.25rem;
}

.prose dt {
  font-weight: 800;
  color: var(--text);
}

.prose dd {
  margin: 0;
}

@media (max-width: 30rem) {
  .prose dl {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .prose dd {
    margin-bottom: 0.75rem;
  }
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.lang-switch li + li {
  margin-top: 0;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(19, 23, 41, 0.8);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.lang-switch a:hover {
  border-color: var(--cyan);
}

.lang-block + .lang-block {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}

.lang-block__label {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: rgba(250, 125, 184, 0.14);
  color: var(--pink);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toc {
  margin: 0 0 2.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.toc h2,
.toc p {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.3rem;
}

.callout {
  margin: 1.5rem 0;
  padding: 1.1rem 1.3rem;
  border-radius: var(--radius-sm);
  background: rgba(97, 240, 212, 0.07);
  border: 1px solid rgba(97, 240, 212, 0.35);
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout--pink {
  background: rgba(250, 125, 184, 0.08);
  border-color: rgba(250, 125, 184, 0.4);
}

.placeholder {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 0.4rem;
  border: 2px dashed var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning-text);
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.review-banner {
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--warning-line);
  background: var(--warning-bg);
  color: var(--warning-text);
}

.review-banner strong {
  color: #fff3cc;
}

.review-banner > :last-child {
  margin-bottom: 0;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.75rem;
  min-height: 2rem;
}

.steps li + li {
  margin-top: 0.75rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.9rem;
  height: 1.9rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cyan);
  color: #04131a;
  font-weight: 900;
  font-size: 0.95rem;
}

.ui-label {
  font-weight: 800;
  color: var(--text);
}

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
  padding: 1.4rem 1.6rem;
  border-radius: var(--radius);
  background:
    radial-gradient(24rem 10rem at 100% 0%, rgba(255, 63, 164, 0.2), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
}

.contact-card p {
  margin: 0;
}

.contact-card__email {
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.35rem);
  font-weight: 800;
  word-break: break-word;
}

.related-links {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  list-style: none;
  padding: 0;
}

.related-links li + li {
  margin-top: 0;
}

.related-links a {
  display: block;
  height: 100%;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.related-links a span {
  display: block;
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.92rem;
}

.related-links a:hover {
  border-color: var(--cyan);
}

.meta-note {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ---------- 404 ---------- */

.not-found {
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: clamp(4rem, 12vw, 9rem);
}

.not-found__inner {
  width: var(--prose);
}

.not-found__code {
  display: block;
  font-size: clamp(5rem, 3rem + 10vw, 10rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 0.2em;
}

.not-found .hero__actions {
  justify-content: center;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(5, 6, 13, 0.85);
  padding-block: 2.5rem;
  font-size: 0.95rem;
}

.site-footer__inner {
  width: var(--page);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

.site-footer p {
  color: var(--text-muted);
  margin: 0.3rem 0 0;
  max-width: 30rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-footer li + li {
  margin-top: 0;
}

.site-footer a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--text);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero h1 .wordmark__pop {
    animation: pop-glow 3.2s ease-in-out infinite;
  }

  .eyebrow {
    animation: float-in 700ms ease-out both;
  }

  .tagline span {
    animation: float-in 700ms ease-out both;
  }

  .tagline span:nth-child(2) {
    animation-delay: 120ms;
  }

  .tagline span:nth-child(3) {
    animation-delay: 240ms;
  }
}

@keyframes pop-glow {
  0%,
  100% {
    text-shadow: 0 0 0.6rem rgba(250, 125, 184, 0.55), 0 0 2rem rgba(255, 63, 164, 0.25);
  }
  50% {
    text-shadow: 0 0 0.9rem rgba(250, 125, 184, 0.85), 0 0 3rem rgba(255, 63, 164, 0.45);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .button--primary:hover {
    transform: none;
  }
}

@media (forced-colors: active) {
  .button,
  .card,
  .placeholder,
  .review-banner {
    border: 2px solid CanvasText;
  }
}

@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .lang-switch {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .prose p,
  .prose li,
  .prose dd,
  .prose dt,
  .prose strong {
    color: #000;
  }
}
