/*
 * varko.css — shared structural tokens for the Varko design system.
 * Non-colour primitives only (type scale, spacing, radii, shadows, motion, card/pill
 * structure). Lifted from the snag.varko.dev system so golf and snag stay one family in
 * everything but hue. Colour lives in a per-app theme layer (theme-golf.css). §8.4.
 */

:root {
  /* Type scale */
  --font-sans:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-display:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-sans-masters:
    "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  --font-display-masters:
    "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;

  --fs-hero: 3.25rem;
  --fs-xxl: 2.25rem;
  --fs-xl: 1.625rem;
  --fs-lg: 1.25rem;
  --fs-md: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;

  --fw-regular: 400; /* @kind font */
  --fw-medium: 500; /* @kind font */
  --fw-semibold: 600; /* @kind font */
  --fw-bold: 700; /* @kind font */

  --lh-tight: 1.05; /* @kind font */
  --lh-snug: 1.25; /* @kind font */
  --lh-normal: 1.5; /* @kind font */

  --tracking-tight: -0.02em; /* @kind font */
  --tracking-wide: 0.04em; /* @kind font */
  --tracking-caps-masters: 0.14em; /* @kind font */

  /* Spacing scale (4pt base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Corner radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(20, 30, 24, 0.06), 0 1px 3px rgba(20, 30, 24, 0.08);
  --shadow-md: 0 4px 10px rgba(20, 30, 24, 0.08), 0 2px 4px rgba(20, 30, 24, 0.06);
  --shadow-lg: 0 12px 28px rgba(20, 30, 24, 0.14), 0 4px 10px rgba(20, 30, 24, 0.08);

  /* Motion */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1); /* @kind other */
  --ease-emphasis: cubic-bezier(0.3, 0, 0, 1); /* @kind other */
  --ease-masters: cubic-bezier(0.22, 1, 0.36, 1); /* @kind other */
  --dur-fast: 120ms; /* @kind other */
  --dur-med: 220ms; /* @kind other */
  --dur-slow: 360ms; /* @kind other */

  /* Touch + safe-area baselines (iPhone hard reqs §8.4) */
  --touch-min: 44px;
  --bottom-nav-h: 64px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Momentum scrolling on iOS */
.scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}

/* Card — the core surface primitive */
.card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  transition:
    transform var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard);
}

.card:active {
  transform: scale(0.99);
  box-shadow: var(--shadow-md);
}

/* Pill */
/* The `hidden` attribute must win over component `display` rules (e.g. `.pill` below sets
   inline-flex, which would otherwise keep a `hidden` element visible — the HI chip showed "HI –"
   with no handicap). Make `hidden` authoritative app-wide. */
[hidden] {
  display: none !important;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  line-height: 1;
}

/* Button base (touch-target safe) */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-pill);
  min-height: var(--touch-min);
  padding: 0 var(--space-5);
  font-size: var(--fs-md);
  transition:
    transform var(--dur-fast) var(--ease-standard),
    background var(--dur-fast) var(--ease-standard),
    box-shadow var(--dur-fast) var(--ease-standard);
}

.btn:active {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
