/* Putt Pro
   Palette taken from the surface the app is used on: cut bentgrass in early
   light, a chalk practice line, brass from a milled putter face, and
   flagstick red held back for the things that are actually wrong. */

:root {
  --turf-900: #131E17;
  --turf-800: #1C2C22;
  --turf-700: #24382C;
  --turf-600: #2F4A39;
  --turf-400: #5E7D68;
  --turf-200: #A9BFAF;
  --chalk:    #EFF2EA;
  --chalk-dim:#DFE5D8;
  --paper:    #FFFFFF;
  --ink:      #101710;
  --ink-soft: #46534A;
  --flag:     #BE3226;
  --flag-soft:#F6E3E0;
  --brass:    #A8862A;
  --brass-soft:#F5EDD6;
  --good:     #2F6B45;
  --good-soft:#E2EFE5;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 72px;

  --r-sharp: 3px;    /* capture surfaces, video */
  --r-card:  10px;   /* data */
  --r-pill:  999px;  /* actions */

  --shell: 560px;
  --font: 'Archivo', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100dvh; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.021em; }
h1 { font-size: 2.1rem; line-height: 1.08; font-stretch: 92%; }
h2 { font-size: 1.32rem; line-height: 1.2; }
h3 { font-size: 1.02rem; line-height: 1.25; }
p  { margin: 0 0 var(--sp-3); max-width: 62ch; }
a  { color: var(--turf-600); }

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ---------------------------------------------------------------- shell */

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-4) var(--sp-8);
}

.topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  max-width: var(--shell);
  margin: 0 auto;
  min-height: 56px;
}

.wordmark {
  font-size: 0.98rem;
  font-weight: 700;
  font-stretch: 85%;
  letter-spacing: 0.04em;
  color: var(--turf-700);
  text-decoration: none;
}
.wordmark span { color: var(--brass); }

.topbar .spacer { flex: 1; }

.screen { display: none; }
.screen.active { display: block; }

.stack > * + * { margin-top: var(--sp-4); }

/* ---------------------------------------------------------------- hero */

.hero {
  padding: var(--sp-5) 0 var(--sp-4);
}
.hero h1 { margin-bottom: var(--sp-3); }
.hero .lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 40ch;
}

.arc-figure {
  margin: var(--sp-5) 0;
  background: var(--turf-900);
  border-radius: var(--r-sharp);
  padding: var(--sp-4) var(--sp-3) var(--sp-3);
  color: var(--chalk);
}
.arc-figure svg { display: block; width: 100%; height: auto; }
.arc-figure figcaption {
  margin-top: var(--sp-3);
  font-size: 0.82rem;
  color: var(--turf-200);
  padding: 0 var(--sp-2);
}

/* The one piece of unprompted motion in the app: the stroke draws itself
   once, because a putting stroke is the thing this whole product is about. */
.arc-path {
  stroke-dasharray: var(--len, 900);
  stroke-dashoffset: var(--len, 900);
  animation: draw 2.2s cubic-bezier(.4,.05,.35,1) .25s forwards;
}
.arc-tick { opacity: 0; animation: appear .4s ease 2.1s forwards; }
@keyframes draw   { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .arc-path { animation: none; stroke-dashoffset: 0; }
  .arc-tick { animation: none; opacity: 1; }
  * { transition: none !important; }
}

/* ---------------------------------------------------------------- actions */

button { font-family: inherit; font-size: 1rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 52px;
  padding: 0 var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--turf-700);
  color: var(--chalk);
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
.btn:hover  { background: var(--turf-600); }
.btn:active { background: var(--turf-800); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }

.btn.secondary {
  background: transparent;
  color: var(--turf-700);
  border-color: var(--turf-400);
}
.btn.secondary:hover { background: var(--chalk-dim); }

.btn.quiet {
  background: none;
  border: none;
  color: var(--ink-soft);
  min-height: 44px;
  padding: 0 var(--sp-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn.quiet:hover { color: var(--ink); }

.btn.record {
  background: var(--flag);
  color: #fff;
}
.btn.record:hover { background: #A82A20; }
.btn.record.armed { background: var(--chalk); color: var(--flag); }

:where(button, a, input, select):focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

.actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.actions .btn { flex: 1 1 auto; }

/* ---------------------------------------------------------------- steps */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--chalk-dim);
}
.steps li::before {
  content: counter(step);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-stretch: 85%;
  color: var(--brass);
  padding-top: 1px;
}
.steps li h3 { margin-bottom: 2px; }
.steps li p { margin: 0; font-size: .93rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------- capture */

.stage {
  position: relative;
  background: var(--turf-900);
  border-radius: var(--r-sharp);
  overflow: hidden;
  aspect-ratio: 3 / 4;
}
.stage video, .stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stage canvas { pointer-events: none; }

.stage-hint {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  background: linear-gradient(transparent, rgba(9,16,11,.88));
  color: var(--chalk);
  font-size: .88rem;
}

.rec-dot {
  position: absolute;
  top: var(--sp-3); left: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 5px 11px 5px 8px;
  border-radius: var(--r-pill);
  background: rgba(9,16,11,.72);
  color: #fff;
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}
.rec-dot i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--flag);
  animation: pulse 1s steps(2, end) infinite;
}
@keyframes pulse { 50% { opacity: .25; } }

.framing-guide { position: absolute; inset: 0; }
.framing-guide rect, .framing-guide line {
  fill: none;
  stroke: rgba(239,242,234,.45);
  stroke-width: 1.5;
  stroke-dasharray: 7 6;
}

/* ---------------------------------------------------------------- score */

.score-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--turf-700);
}
.score-head .big {
  font-size: 4.4rem;
  line-height: .84;
  font-weight: 700;
  font-stretch: 88%;
  font-variant-numeric: tabular-nums;
  color: var(--turf-700);
}
.score-head .of { font-size: 1rem; color: var(--ink-soft); }
.score-head .label { margin-left: auto; text-align: right; font-size: .9rem; color: var(--ink-soft); }

.bars { display: grid; gap: var(--sp-2); margin: var(--sp-4) 0; }
.bar-row {
  display: grid;
  grid-template-columns: 108px 1fr 44px;
  align-items: center;
  gap: var(--sp-3);
  font-size: .9rem;
}
.bar-track { height: 9px; background: var(--chalk-dim); border-radius: var(--r-pill); overflow: hidden; }
.bar-fill  { height: 100%; border-radius: var(--r-pill); background: var(--turf-600); }
.bar-fill.watch   { background: var(--brass); }
.bar-fill.work-on { background: var(--flag); }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

/* ---------------------------------------------------------------- cards */

.finding {
  background: var(--paper);
  border-radius: var(--r-card);
  border-left: 4px solid var(--brass);
  padding: var(--sp-4);
}
.finding.high { border-left-color: var(--flag); }
.finding.low  { border-left-color: var(--turf-400); }
.finding h3 { margin-bottom: var(--sp-2); }
.finding p  { margin: 0; font-size: .94rem; color: var(--ink-soft); }
.finding .reading {
  display: inline-block;
  margin-bottom: var(--sp-2);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--chalk);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  color: var(--turf-700);
}

.drill {
  background: var(--paper);
  border-radius: var(--r-card);
  padding: var(--sp-4);
}
.drill header { display: flex; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.drill header h3 { flex: 1; }
.drill .mins { font-size: .85rem; color: var(--ink-soft); white-space: nowrap; }
.drill dl { margin: 0; display: grid; gap: var(--sp-3); }
.drill dt {
  font-size: .78rem;
  font-weight: 700;
  font-stretch: 85%;
  color: var(--brass);
  margin-bottom: 2px;
}
.drill dd { margin: 0; font-size: .93rem; color: var(--ink-soft); }
.drill .why {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--chalk-dim);
  font-size: .89rem;
  color: var(--ink-soft);
}

.trace {
  background: var(--turf-900);
  border-radius: var(--r-sharp);
  padding: var(--sp-4) var(--sp-3) var(--sp-3);
}
.trace svg { display: block; width: 100%; height: auto; }
.trace .legend {
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
  margin-top: var(--sp-3);
  font-size: .8rem;
  color: var(--turf-200);
}
.trace .legend i { display: inline-block; width: 12px; height: 3px; margin-right: 6px; vertical-align: middle; }

/* ---------------------------------------------------------------- misc */

.note {
  font-size: .87rem;
  color: var(--ink-soft);
  background: var(--paper);
  border-radius: var(--r-card);
  padding: var(--sp-3) var(--sp-4);
}
.note.warn { background: var(--flag-soft); color: #7A231B; }
.note.win  { background: var(--good-soft); color: #1F4C31; }

.section-title {
  margin: var(--sp-6) 0 var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--chalk-dim);
}

.meta { font-size: .84rem; color: var(--ink-soft); }

.progress-track { height: 5px; background: var(--chalk-dim); border-radius: var(--r-pill); overflow: hidden; }
.progress-fill { height: 100%; background: var(--turf-600); width: 0; transition: width .2s ease; }

.history-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--chalk-dim);
  font-size: .92rem;
}
.history-row .score { font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.better { color: var(--good); }
.delta.worse  { color: var(--flag); }

.choice {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--chalk-dim);
  border-radius: var(--r-card);
  padding: var(--sp-4);
  cursor: pointer;
}
.choice:hover { border-color: var(--turf-400); }
.choice[aria-pressed="true"] { border-color: var(--turf-700); box-shadow: inset 0 0 0 1px var(--turf-700); }
.choice strong { display: block; margin-bottom: 3px; }
.choice span { font-size: .88rem; color: var(--ink-soft); }

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

@media (min-width: 620px) {
  html, body { font-size: 18px; }
  h1 { font-size: 2.6rem; }
  .stage { aspect-ratio: 4 / 3; }
}

/* ------------------------------------------------------ framing feedback */

.framing-status {
  position: absolute;
  top: var(--sp-3); right: var(--sp-3);
  max-width: 62%;
  display: flex; align-items: flex-start; gap: var(--sp-2);
  padding: 7px 12px 7px 9px;
  border-radius: var(--r-pill);
  background: rgba(9,16,11,.78);
  color: var(--chalk);
  font-size: .8rem;
  line-height: 1.35;
}
.framing-status i {
  width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto;
  margin-top: 5px;
  background: var(--brass);
}
.framing-status.ready i { background: #58C07A; }
.framing-status.ready  { background: rgba(20,60,32,.82); }
.framing-status.blocked i { background: var(--flag); }

/* -------------------------------------------------------------- outcomes */

.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.chip {
  min-height: 46px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--chalk-dim);
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { border-color: var(--turf-400); }
.chip[aria-pressed="true"] {
  background: var(--turf-700);
  border-color: var(--turf-700);
  color: var(--chalk);
}

.putt-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--chalk-dim);
}
.putt-row .n { font-size: .88rem; color: var(--ink-soft); }
.putt-row .chips { gap: 6px; }
.putt-row .chip {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 var(--sp-2);
  font-size: .86rem;
  font-weight: 600;
}

.outcome-tally {
  display: flex; flex-wrap: wrap; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--paper);
  border-radius: var(--r-card);
  font-size: .9rem;
}
.outcome-tally b { font-variant-numeric: tabular-nums; }

.drill-record {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  align-items: baseline;
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--chalk-dim);
  font-size: .92rem;
}
