/* 214 - site styles. Palette mirrors the app's design system (useColors.ts). */

:root {
  --background: #eeeef3;
  --card: #ffffff;
  --text: #000000;
  --muted: rgba(0, 0, 0, 0.6);
  --border: rgba(0, 0, 0, 0.1);

  /* Wainwright grouping palette */
  --g-eastern: #638a27;
  --g-far-eastern: #a42116;
  --g-central: #071d93;
  --g-southern: #82190f;
  --g-northern: #150605;
  --g-north-western: #f1b23e;
  --g-western: #14340a;

  --display: 'Sour Gummy', cursive;
  --body: 'Gill Sans', 'Gill Sans MT', 'Trebuchet MS', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #000000;
    --card: #101020;
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.65);
    --border: rgba(255, 255, 255, 0.12);
    --g-northern: #eaf9fa;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Seven-colour ribbon - one stripe per Wainwright grouping */
.ribbon {
  display: flex;
  height: 6px;
}

.ribbon span {
  flex: 1;
}

.ribbon .e { background: var(--g-eastern); }
.ribbon .fe { background: var(--g-far-eastern); }
.ribbon .c { background: var(--g-central); }
.ribbon .s { background: var(--g-southern); }
.ribbon .n { background: var(--g-northern); }
.ribbon .nw { background: var(--g-north-western); }
.ribbon .w { background: var(--g-western); }

header.site {
  padding: 1.25rem 0;
}

header.site .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

nav.site a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.25rem;
}

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

/* Hero */
.hero {
  text-align: center;
  padding-block: 2.5rem 2.5rem;
}

.app-icon {
  /* iOS squircle approximation */
  border-radius: 22.37%;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 5rem);
  line-height: 1.1;
  margin: 0;
}

.hero p.subtitle {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  margin: 0 0 0.75rem;
}

/* Tick demo - mirrors the app's TickButton (pulse, spring fill, confetti) */
.tick-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 1.5rem;
}

.tick {
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
  color: var(--g-eastern);
  animation: tick-pulse 2.2s ease-in-out infinite;
}

.tick.bagged {
  animation: none;
}

@keyframes tick-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.tick-icon {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tick-soft {
  opacity: 0.12;
  transition: opacity 0.3s ease;
}

.tick-outline {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.tick-fill {
  opacity: 0;
  transform: scale(0.85);
  /* transform-box is required for Safari to honour transform-origin on SVG */
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.25s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tick.bagged .tick-soft,
.tick.bagged .tick-outline {
  opacity: 0;
}

.tick.bagged .tick-fill {
  opacity: 1;
  transform: scale(1);
}

.tick-confetti {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.tick-confetti i {
  position: absolute;
  width: 10px;
  height: 3px;
  margin: -1.5px 0 0 -5px;
  border-radius: 1.5px;
}

.tick-caption {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  font-family: var(--display);
  font-weight: 400;
}

.tick.bagged + .tick-caption {
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .tick {
    animation: none;
    transition: none;
  }
  .tick-fill {
    transition: opacity 0.2s ease;
    transform: scale(1);
  }
}

.stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin: 2rem 0 0;
}

.stats div {
  text-align: center;
}

.stats .num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2rem;
  display: block;
}

.stats .label {
  color: var(--muted);
  font-size: 0.95rem;
}

.appstore {
  display: inline-block;
  background: var(--text);
  color: var(--background);
  text-decoration: none;
  font-weight: 600;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
}

.appstore:hover {
  opacity: 0.85;
}

/* Feature cards */
.features {
  display: grid;
  /* min(18rem, 100%) stops cards forcing horizontal overflow on narrow screens */
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: 1rem;
  padding-block: 1.5rem 2.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem 1.5rem;
}

.card h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0 0 0.6rem;
}

.card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.card li {
  margin-bottom: 0.35rem;
}

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

/* Grouping chips */
.groupings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding-block: 0 3rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem 0.3rem 0.5rem;
  font-size: 0.9rem;
}

.chip i {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  display: inline-block;
}

/* Prose pages (privacy, terms) */
.prose {
  padding-block: 1.5rem 3rem;
}

.prose h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1.2;
}

.prose h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.4rem;
  margin-top: 2.25rem;
}

.prose h3 {
  font-size: 1.1rem;
  margin-top: 1.75rem;
}

.prose a {
  color: inherit;
}

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

footer.site {
  border-top: 1px solid var(--border);
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

footer.site a {
  color: inherit;
}

footer.site .links {
  margin-bottom: 1rem;
}

footer.site .links a {
  margin-right: 1.25rem;
  text-decoration: none;
}

footer.site .links a:hover {
  text-decoration: underline;
}

footer.site p.disclaimer {
  max-width: 38rem;
}
