/* Spread Golf's site. Colours are the app's: SpreadGreen and the strokes gained gain and loss
   tones (StrokesGainedTone.swift), on iOS's grouped backgrounds. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f2f2f7;
  --card: #ffffff;
  --card-2: #f2f2f7;
  --text: #0b0b0c;
  --text-2: #6e6e73;
  --line: rgba(60, 60, 67, 0.16);
  --accent: #2a9142;
  --accent-text: #1a6b3c;
  --accent-tint: rgba(42, 145, 66, 0.12);
  --on-accent: #ffffff;
  --gain: #1a6b3c;
  --loss: #b3261e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
  --font-display:
    -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', system-ui, sans-serif;
  --font-rounded: ui-rounded, 'SF Pro Rounded', -apple-system, system-ui, sans-serif;
}

/* Dark when the device is dark and no Light choice overrides it, and whenever Dark is chosen. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #000000;
    --bg-alt: #0d0d0f;
    --card: #1c1c1e;
    --card-2: #2c2c2e;
    --text: #f5f5f7;
    --text-2: #98989f;
    --line: rgba(235, 235, 245, 0.14);
    --accent: #46b864;
    --accent-text: #5bd08e;
    --accent-tint: rgba(70, 184, 100, 0.16);
    --on-accent: #04170a;
    --gain: #5bd08e;
    --loss: #ff8a80;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #000000;
  --bg-alt: #0d0d0f;
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --text: #f5f5f7;
  --text-2: #98989f;
  --line: rgba(235, 235, 245, 0.14);
  --accent: #46b864;
  --accent-text: #5bd08e;
  --accent-tint: rgba(70, 184, 100, 0.16);
  --on-accent: #04170a;
  --gain: #5bd08e;
  --loss: #ff8a80;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.5);
}

.theme-changing,
.theme-changing * {
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    fill 0.35s ease,
    stroke 0.35s ease !important;
}

@media (prefers-reduced-motion: reduce) {
  .theme-changing,
  .theme-changing * {
    transition: none !important;
  }
}

/* Base */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.022em;
  line-height: 1.1;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

.num {
  font-variant-numeric: tabular-nums;
}

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

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

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

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 720px) {
  .wrap {
    padding: 0 32px;
  }
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 10;
  background: var(--card);
  padding: 8px 12px;
  border-radius: 8px;
}

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

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.badge {
  width: 30px;
  height: 30px;
}

.badge-fill {
  fill: var(--accent);
}

.badge-mark {
  fill: #fff;
}

.site-nav {
  display: none;
  gap: 24px;
  margin-right: auto;
}

.site-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--text);
}

@media (min-width: 860px) {
  .site-nav {
    display: flex;
  }
}

/* The app's segmented Appearance picker. Without script it cannot act, so it is hidden. */
.appearance {
  display: none;
  margin-left: auto;
  padding: 2px;
  border-radius: 9px;
  background: var(--card-2);
  border: 1px solid var(--line);
}

.js .appearance {
  display: inline-flex;
}

.appearance button {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 5px 11px;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: 500 13px/1.2 var(--font);
  cursor: pointer;
}

.appearance button[aria-checked='true'] {
  background: var(--card);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.15),
    0 0 0 0.5px rgba(0, 0, 0, 0.06);
  font-weight: 600;
}

:root[data-theme='dark'] .appearance button[aria-checked='true'] {
  background: #636366;
}

@media (min-width: 860px) {
  .appearance {
    margin-left: 0;
  }
}

/* Buttons and pills */

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  border: 1px solid transparent;
}

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

.button-quiet {
  border-color: var(--line);
  color: var(--text);
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 14px;
}

/* Hero */

.hero {
  padding: 56px 0 72px;
  background: radial-gradient(60% 50% at 80% 30%, var(--accent-tint), transparent 70%), var(--bg);
}

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

.hero-grid > *,
.feature > * {
  min-width: 0;
}

@media (min-width: 960px) {
  .hero {
    padding: 88px 0 104px;
  }

  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
  }
}

.hero h1 {
  font-size: clamp(40px, 7vw, 68px);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.lead {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--text-2);
  max-width: 34em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 18px;
}

.hero-note {
  font-size: 14px;
  color: var(--text-2);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 0 0 8px;
}

.float-card {
  position: absolute;
  z-index: 2;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.35;
  max-width: 240px;
}

.float-card strong {
  display: block;
  font-family: var(--font-rounded);
  font-size: 28px;
  letter-spacing: -0.02em;
}

.float-stat {
  left: 0;
  top: 18%;
}

.float-social {
  right: 0;
  bottom: 14%;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* On a phone the cards sit above and below the device, clear of its controls. */
@media (max-width: 600px) {
  .hero-visual {
    padding: 64px 0 44px;
  }

  .float-stat {
    left: 0;
    top: 0;
  }

  .float-social {
    right: 0;
    bottom: 0;
  }
}

/* Proof ribbon */

.ribbon {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}

.ribbon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
}

.ribbon-item {
  background: var(--bg-alt);
  padding: 22px 16px;
}

.ribbon-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  margin-bottom: 2px;
}

.ribbon-item span {
  color: var(--text-2);
  font-size: 14px;
}

@media (min-width: 860px) {
  .ribbon-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .ribbon-item {
    padding: 28px 24px;
  }
}

/* Sections */

.section {
  padding: 88px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: 720px;
  margin-bottom: 56px;
}

.section-head h2 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
}

.feature {
  display: grid;
  gap: 40px;
  align-items: center;
  padding: 32px 0;
}

.feature + .feature {
  border-top: 1px solid var(--line);
  padding-top: 64px;
  margin-top: 32px;
}

.feature h3 {
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 700;
}

.feature-copy p {
  color: var(--text-2);
  font-size: 18px;
}

.checks {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 10px;
}

.checks li {
  position: relative;
  padding-left: 30px;
  font-size: 16px;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-tint);
}

.checks li::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  width: 4px;
  height: 8px;
  border: solid var(--accent-text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

@media (min-width: 900px) {
  .feature {
    grid-template-columns: 1fr 1fr;
    gap: 72px;
  }

  .feature.reverse .feature-copy {
    order: 2;
  }
}

.feature-visual {
  display: flex;
  justify-content: center;
}

/* Strokes gained explainer */

.explainer {
  display: grid;
  gap: 24px;
  margin-top: 64px;
}

@media (min-width: 900px) {
  .explainer {
    grid-template-columns: 1.1fr 1fr 1fr;
  }
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
}

.panel h3 {
  font-size: 22px;
}

.formula {
  font-family: var(--font-rounded);
  font-size: 22px;
  font-weight: 600;
  margin: 12px 0 16px;
  letter-spacing: -0.01em;
}

.worked {
  font-variant-numeric: tabular-nums;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  font-size: 15px;
}

.worked dt {
  color: var(--text-2);
}

.worked dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

.worked .total {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  font-size: 17px;
}

/* Pricing */

.pricing {
  display: grid;
  gap: 24px;
}

@media (min-width: 860px) {
  .pricing {
    grid-template-columns: 1fr 1fr;
  }
}

.plan {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
}

.plan-premium {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow);
}

.plan h3 {
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tag {
  font: 600 12px/1 var(--font);
  letter-spacing: 0.02em;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-text);
}

.price {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 8px 0 0;
}

.price small {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0;
}

.fine {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 20px;
}

/* FAQ */

.faq {
  max-width: 820px;
}

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

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

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

.faq summary::after {
  content: '+';
  color: var(--text-2);
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
}

.faq details[open] summary::after {
  content: '−';
}

.faq details p {
  color: var(--text-2);
  margin: 12px 0 0;
}

/* Closing call to action */

.cta {
  text-align: center;
  padding: 96px 0;
}

.cta .badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
}

.cta .lead {
  margin-left: auto;
  margin-right: auto;
}

.cta h2 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
}

/* Legal and support pages */

.doc {
  max-width: 760px;
  padding-top: 56px;
  padding-bottom: 88px;
}

.doc h1 {
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 800;
}

.doc h2 {
  font-size: 24px;
  margin-top: 2.2em;
}

.doc h3 {
  font-size: 18px;
  margin-top: 1.6em;
}

.doc li {
  margin-bottom: 0.5em;
}

.doc .updated {
  color: var(--text-2);
  font-size: 15px;
}

.summary-box {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 28px 0;
}

.summary-box ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.table-scroll {
  overflow-x: auto;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
}

.doc th {
  font-weight: 600;
}

.contact-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 28px 0;
}

.not-found {
  text-align: center;
  padding: 120px 16px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 48px 0 32px;
  font-size: 15px;
}

.footer-grid {
  display: grid;
  gap: 32px;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-grid nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-grid h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin: 0 0 4px;
}

.footer-grid nav a {
  color: var(--text);
  text-decoration: none;
}

.footer-grid nav a:hover {
  color: var(--accent-text);
}

.footer-grid .brand + p {
  margin-top: 12px;
}

.footer-fine {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.footer-fine p {
  margin: 0 0 4px;
}

/* Phones: real screenshots from the app, in the scheme the page shows. */

.phone {
  position: relative;
  width: 300px;
  max-width: 82vw;
  margin: 0;
  padding: 10px;
  border-radius: 50px;
  background: #111113;
  box-shadow:
    0 0 0 1px #2a2a2e inset,
    0 30px 60px rgba(0, 0, 0, 0.25),
    0 8px 20px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

/* The image sets the screen's height: map screens are the whole iPhone 17 Pro screen, and the
   others end above the tab bar, so nothing scrolled under its glass shows. */
.screen {
  position: relative;
  overflow: hidden;
  border-radius: 40px;
  background: var(--bg-alt);
  container-type: inline-size;
}

.screen::before {
  /* The Dynamic Island, which a screenshot leaves out; sized from the screen's width. */
  content: '';
  position: absolute;
  z-index: 1;
  top: 2.8cqw;
  left: 50%;
  width: 31cqw;
  height: 9.2cqw;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #000;
}

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

.shot-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .shot-light {
    display: none;
  }

  :root:not([data-theme='light']) .shot-dark {
    display: block;
  }
}

:root[data-theme='dark'] .shot-light {
  display: none;
}

:root[data-theme='dark'] .shot-dark {
  display: block;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font: 700 12px/1 var(--font-rounded);
  flex-shrink: 0;
}

/* The app's avatar palette (AvatarPalette.swift). */
.av-1 {
  background: #1d4ed8;
}

/* Insights, card by card: each crop keeps a margin of the app's own background, so the panel
   is painted that exact colour (iOS grouped background) and the edges never show. */

.app-canvas {
  --app-bg: #f2f2f7;
  margin-top: 56px;
  padding: 28px 20px 8px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--app-bg);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .app-canvas {
    --app-bg: #000000;
  }
}

:root[data-theme='dark'] .app-canvas {
  --app-bg: #000000;
}

.app-canvas h3 {
  font-size: 22px;
  margin: 0 8px 4px;
}

.app-canvas > p {
  margin: 0 8px 20px;
  color: var(--text-2);
}

.cards {
  columns: 3 300px;
  column-gap: 12px;
}

.cards figure {
  break-inside: avoid;
  margin: 0 0 12px;
}

.cards .shot {
  border-radius: 12px;
}

/* Two phones side by side, the second a step lower, for a feature told in two screens. */
.phone-pair {
  gap: 0;
  align-items: flex-start;
}

.phone-pair .phone {
  width: 260px;
  max-width: 46vw;
  padding: 8px;
  border-radius: 44px;
}

.phone-pair .screen {
  border-radius: 36px;
}

.phone-pair .phone + .phone {
  margin-left: -28px;
  margin-top: 64px;
}
