/* TrainingPlanner marketing site. Colours follow Branding/BRAND.md in the app repository. */

:root {
  color-scheme: light dark;
  --bg: #F4F5F6;
  --bg-deep: #E3E7E8;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #FFFFFF;
  --line: rgba(46, 54, 64, 0.12);
  --text: #2E3640;
  --muted: #5B6570;
  --accent: #3A7478;
  --accent-soft: rgba(78, 142, 146, 0.12);
  --on-accent: #FFFFFF;
  --progress: #40A02B;
  --mark-grey: #8C9799;
  --mark-teal: #4E8E92;
  --mark-charcoal: #2E3640;
  --glow: rgba(78, 142, 146, 0.28);
  --shadow: 0 18px 40px -22px rgba(46, 54, 64, 0.35);
  --radius: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #222831;
    --bg-deep: #1A1E24;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-strong: #2A3039;
    --line: rgba(238, 238, 238, 0.12);
    --text: #EEEEEE;
    --muted: #B5BCC4;
    --accent: #76ABAE;
    --accent-soft: rgba(118, 171, 174, 0.16);
    --on-accent: #1A1E24;
    --progress: #A6E3A1;
    --mark-grey: #909D9E;
    --mark-teal: #76ABAE;
    --mark-charcoal: #EEEEEE;
    --glow: rgba(118, 171, 174, 0.2);
    --shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.7);
  }
}

/* Base */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60rem 40rem at 85% -10%, var(--glow), transparent 70%),
    radial-gradient(50rem 36rem at -10% 110%, var(--glow), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

::selection {
  background: #4E8E92;
  color: #FFFFFF;
}

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

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

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.85rem, 4.2vw, 2.6rem);
  font-weight: 800;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

p {
  margin: 0;
}

p + p {
  margin-top: 0.9em;
}

.wrap {
  width: min(72rem, 100% - 2.5rem);
  margin-inline: auto;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.section {
  padding-block: clamp(4rem, 9vw, 7rem);
}

.section-head {
  max-width: 40rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-head p {
  margin-top: 1rem;
  font-size: 1.15rem;
  color: var(--muted);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85em 1.5em;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--text);
  color: var(--bg);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.btn svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}

.topbar.scrolled {
  border-bottom-color: var(--line);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-right: auto;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand .mark {
  width: 1.75rem;
  height: 1.75rem;
}

.topnav {
  display: none;
  gap: 1.75rem;
}

.topnav a {
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

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

.topbar .btn {
  padding: 0.6em 1.1em;
  font-size: 0.95rem;
}

@media (min-width: 52rem) {
  .topnav {
    display: flex;
  }
}

/* Mark */

.mark rect,
.mark polyline {
  transform-box: view-box;
}

.mark-hero {
  width: clamp(4.5rem, 9vw, 5.5rem);
  height: auto;
  margin-bottom: 1.75rem;
}

.mark-hero rect {
  animation: bar-lift 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mark-hero rect:nth-of-type(1) {
  --lift: 430px;
}

.mark-hero rect:nth-of-type(2) {
  --lift: 580px;
  animation-delay: 0.15s;
}

.mark-hero rect:nth-of-type(3) {
  --lift: 730px;
  animation-delay: 0.3s;
}

.mark-hero polyline {
  animation: chevron-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.6s both;
}

@keyframes bar-lift {
  from {
    transform: translateY(var(--lift, 430px));
  }
  to {
    transform: translateY(0);
  }
}

@keyframes chevron-rise {
  from {
    transform: translateY(56px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Hero */

.hero {
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3rem, 7vw, 5rem);
}

.hero .wrap {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.hero h1 .progress {
  color: var(--progress);
}

.lede {
  max-width: 32rem;
  margin-top: 1.4rem;
  font-size: clamp(1.15rem, 2.2vw, 1.3rem);
  color: var(--muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.trust li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.trust svg {
  width: 1rem;
  height: 1rem;
  color: var(--progress);
}

/* A framed capture: the app on Apple's own iPhone chrome, from the simulator, as a
   transparent PNG (948 x 1980, see scripts/update-screenshots.sh). The frame is in the
   image, so the page only sizes it and adds depth. */

.phone {
  --w: 18rem;
  position: relative;
  width: var(--w);
  max-width: 100%;
  aspect-ratio: 474 / 990;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.45));
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-visual .phone-main {
  --w: min(19rem, 72vw);
  z-index: 1;
}

.hero-visual .phone-back {
  --w: 14rem;
  display: none;
  position: absolute;
  right: 0;
  top: 4rem;
  rotate: 7deg;
  opacity: 0.92;
}

@media (min-width: 52rem) {
  .hero .wrap {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2rem;
  }

  .hero-visual {
    justify-content: flex-start;
    padding-left: 2rem;
    min-height: 40rem;
  }

  .hero-visual .phone-main {
    --w: 19rem;
  }

  .hero-visual .phone-back {
    display: block;
    right: max(0rem, calc(50% - 15rem));
  }
}

@media (min-width: 70rem) {
  .hero-visual .phone-back {
    right: 1rem;
  }
}

/* Logos strip of plain facts */

.facts {
  border-block: 1px solid var(--line);
}

.facts ul {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 2rem;
  margin: 0;
  padding: 2rem 0;
  list-style: none;
}

.facts li strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.facts li span {
  color: var(--muted);
  font-size: 0.95rem;
}

@media (min-width: 52rem) {
  .facts ul {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Steps */

.step {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.step + .step {
  border-top: 1px solid var(--line);
}

.step-copy {
  max-width: 32rem;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.step-copy h3 {
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  font-weight: 800;
}

.step-copy p {
  margin-top: 1rem;
  font-size: 1.1rem;
  color: var(--muted);
}

.step-copy ul {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.step-copy li {
  position: relative;
  padding-left: 1.8rem;
  margin-top: 0.6rem;
}

.step-copy li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--progress);
}

.step-visual {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
}

.step-visual .phone {
  --w: min(16rem, 62vw);
}

.step-visual .phone + .phone {
  --w: min(13rem, 44vw);
  display: none;
  align-self: flex-end;
}

@media (min-width: 52rem) {
  .step {
    grid-template-columns: 1fr 1fr;
  }

  .step:nth-child(even) .step-copy {
    order: 2;
  }

  .step-visual .phone + .phone {
    display: block;
  }
}

/* Feature cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.75rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.35rem;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.card-icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

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

.tag {
  align-self: flex-start;
  margin-top: auto;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Gallery */

.gallery {
  overflow: hidden;
}

.strip {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 1rem calc((100% - min(72rem, 100% - 2.5rem)) / 2) 1.5rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: calc((100% - min(72rem, 100% - 2.5rem)) / 2);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.strip li {
  flex: 0 0 auto;
  width: 15rem;
  scroll-snap-align: start;
}

.strip .phone {
  --w: 15rem;
}

.strip h3 {
  margin: 1rem 0 0.25rem;
  font-size: 1.05rem;
}

.strip p {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Privacy */

.privacy .panel {
  display: grid;
  gap: 2rem;
  padding: clamp(2rem, 5vw, 3.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  box-shadow: var(--shadow);
}

.privacy ul {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.privacy li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
}

.privacy li svg {
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.15rem;
  color: var(--accent);
}

.privacy li strong {
  display: block;
}

.privacy li span {
  color: var(--muted);
}

@media (min-width: 52rem) {
  .privacy .panel {
    grid-template-columns: 1fr 1.2fr;
    align-items: center;
  }
}

/* Pro */

.pro .section-head {
  margin-inline: auto;
  text-align: center;
}

.compare {
  display: grid;
  gap: 1.25rem;
}

.tier {
  padding: 1.75rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tier-pro {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), transparent 60%), var(--surface);
}

.tier header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 0.5rem;
}

.tier header h3 {
  font-size: 1.4rem;
}

.tier header span {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}

.tier > p {
  color: var(--muted);
}

.ticks {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding-left: 1.9rem;
  margin-top: 0.7rem;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--progress);
}

.ticks li::after {
  content: "";
  position: absolute;
  left: 0.33rem;
  top: calc(0.35em + 0.22rem);
  width: 0.42rem;
  height: 0.24rem;
  border-left: 2px solid var(--bg);
  border-bottom: 2px solid var(--bg);
  rotate: -45deg;
}

@media (min-width: 52rem) {
  .compare {
    grid-template-columns: 1fr 1.15fr;
    align-items: start;
  }
}

.plans {
  display: grid;
  gap: 1.25rem;
  max-width: 44rem;
  margin: 2.5rem auto 0;
}

.plan {
  position: relative;
  padding: 1.6rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.plan-best {
  border-color: var(--accent);
}

.plan-best .badge {
  position: absolute;
  top: -0.85rem;
  left: 50%;
  translate: -50% 0;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.plan h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--muted);
}

.plan-price {
  margin-top: 0.4rem;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.plan-price small {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.plan-note {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

@media (min-width: 40rem) {
  .plans {
    grid-template-columns: 1fr 1fr;
  }
}

.fineprint {
  max-width: 44rem;
  margin: 1.5rem auto 0;
  font-size: 0.9rem;
  text-align: center;
  color: var(--muted);
}

.fineprint a {
  color: inherit;
}

/* FAQ */

.faq-list {
  max-width: 46rem;
  margin-inline: auto;
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

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

.faq-list summary::after {
  content: "";
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  rotate: 45deg;
  transition: rotate 0.2s ease;
  margin-right: 0.3rem;
}

.faq-list details[open] summary::after {
  rotate: -135deg;
}

.faq-list details p {
  padding-bottom: 1.25rem;
  color: var(--muted);
}

/* Final call to action */

.closing {
  text-align: center;
}

.closing .panel {
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
  border-radius: calc(var(--radius) + 8px);
  background:
    radial-gradient(40rem 20rem at 50% 120%, var(--glow), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
}

.closing .mark {
  width: 4rem;
  height: 4rem;
  margin-bottom: 1.25rem;
}

.closing p {
  max-width: 30rem;
  margin: 1rem auto 0;
  color: var(--muted);
}

.closing .cta-row {
  justify-content: center;
}

/* Footer */

footer {
  padding: 3rem 0 3.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--muted);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

footer a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

footer a:hover,
footer a:focus-visible {
  color: var(--accent);
}

footer .legal {
  width: 100%;
  font-size: 0.85rem;
}

/* Scroll-driven reveal, only where supported and motion is welcome */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

  .mark-hero rect,
  .mark-hero polyline {
    animation: none;
  }

  .btn,
  .topbar,
  .faq-list summary::after {
    transition: none;
  }
}
