/* ============================================================
   Friendly Wagers — shared stylesheet
   Tokens match Sources/FriendlyWagersUI/Theme exactly so the
   website and the app feel like the same brand.
   ============================================================ */

/* --- Brand tokens (exact hex values from docs/DESIGN_SYSTEM.md) --- */
:root {
  /* Primary brand greens */
  --fw-primary-green: #006B54;
  --fw-dark-green:    #004D3D;
  --fw-deep-green:    #174038;
  --fw-accent-green:  #036635;
  --fw-palm-shadow:   #2F4A35;

  /* Accents */
  --fw-gold:          #FFDE00;
  --fw-warm-gold:     #F4D946;
  --fw-premium-gold:  #C9A14B;
  --fw-founding:      #B08A3E;

  /* Florida tertiary palette */
  --fw-terracotta:      #C4654E;
  --fw-terracotta-soft: #D89579;
  --fw-sand-cream:      #F2E8D5;
  --fw-travertine:      #E8DCC4;
  --fw-water-feature:   #4F8B96;
  --fw-bougainvillea:   #D68B8B;
  --fw-sunset-peach:    #F5C5A8;
  --fw-sunset-amber:    #E9A87A;

  /* Surfaces — never pure white. Augusta linen. */
  --fw-bg:             #FBFAF6;
  --fw-surface:        #EFEDE6;
  --fw-card-bg:        #FCFBF7;
  --fw-card-elevated:  #FFFCF2;
  --fw-warm-cream:     #FFFCEB;

  /* Neutrals */
  --fw-medium-gray: #6B6B6B;
  --fw-dark-gray:   #333333;
  --fw-black:       #1A1A1A;

  /* Money / score */
  --fw-money-positive: #006B54;
  --fw-money-negative: #CC0000;

  /* Spacing — 4pt grid */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  12px;
  --space-lg:  16px;
  --space-xl:  20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --space-4xl: 40px;
  --space-5xl: 48px;
  --space-6xl: 64px;
  --space-7xl: 80px;
  --space-8xl: 96px;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  18px;
  --radius-2xl: 22px;
  --radius-3xl: 28px;
  --radius-full: 999px;

  /* Type scale */
  --font-display: "Playfair Display", "Times New Roman", serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;

  /* Layout */
  --container-max: 1120px;
  --container-padding: clamp(20px, 5vw, 48px);

  /* Motion */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* --- Reset / base --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--fw-dark-gray);
  background: var(--fw-bg);
  font-feature-settings: "tnum" 0; /* tabular off by default */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--fw-primary-green); text-decoration: none; transition: color 200ms var(--ease-out); }
a:hover { color: var(--fw-dark-green); }
a:focus-visible { outline: 2px solid var(--fw-primary-green); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--fw-deep-green);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 var(--space-lg);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(36px, 6vw, 64px); }
h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: var(--space-xl); }
h3 { font-size: clamp(22px, 2.5vw, 28px); }
h4 { font-size: 20px; }

p { margin: 0 0 var(--space-lg); max-width: 70ch; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 var(--space-lg); padding-left: 1.4em; }
li + li { margin-top: var(--space-xs); }

hr {
  border: 0;
  border-top: 1px solid var(--fw-surface);
  margin: var(--space-4xl) 0;
}

::selection {
  background: var(--fw-primary-green);
  color: var(--fw-warm-cream);
}

/* --- Layout primitives --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}
.container-narrow {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.section {
  padding-block: clamp(var(--space-5xl), 10vw, var(--space-8xl));
}
.section--tight {
  padding-block: clamp(var(--space-3xl), 6vw, var(--space-5xl));
}

/* --- Header / nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 246, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 77, 61, 0.08);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-md);
  min-height: 64px;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--fw-deep-green);
  font-weight: 500;
}
.site-header__brand img { height: 52px; width: 52px; }
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}
.site-nav a {
  color: var(--fw-dark-gray);
  font-size: 15px;
  font-weight: 500;
}
.site-nav a:hover { color: var(--fw-primary-green); }
@media (max-width: 640px) {
  .site-nav { gap: var(--space-lg); }
  .site-nav a:not(.btn) { display: none; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 200ms var(--ease-out), background 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--fw-primary-green); outline-offset: 3px; }
.btn-primary {
  background: var(--fw-primary-green);
  color: var(--fw-warm-cream);
  box-shadow: 0 2px 8px rgba(0, 77, 61, 0.18);
}
.btn-primary:hover {
  background: var(--fw-dark-green);
  color: var(--fw-warm-cream);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 77, 61, 0.24);
}
.btn-ghost {
  background: transparent;
  color: var(--fw-deep-green);
  border-color: rgba(0, 77, 61, 0.18);
}
.btn-ghost:hover {
  background: rgba(0, 107, 84, 0.06);
  color: var(--fw-deep-green);
}
.btn-large {
  padding: 16px 32px;
  font-size: 16px;
}
.btn--app-store {
  padding: 10px 18px;
}
.btn--app-store img { height: 24px; width: auto; }

/* --- Hero (used on landing + invite landing) --- */
.hero {
  position: relative;
  padding-block: clamp(var(--space-5xl), 10vw, var(--space-8xl));
  background:
    linear-gradient(180deg, rgba(251, 250, 246, 0) 0%, rgba(251, 250, 246, 0.6) 70%, var(--fw-bg) 100%),
    linear-gradient(180deg, rgba(245, 197, 168, 0.08) 0%, rgba(233, 168, 122, 0.04) 100%);
  overflow: hidden;
}
.hero__eyebrow {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fw-primary-green);
  margin-bottom: var(--space-lg);
}
.hero__headline {
  font-family: var(--font-display);
  font-weight: 500;
  margin-bottom: var(--space-lg);
}
.hero__subhead {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--fw-dark-gray);
  max-width: 58ch;
  margin-bottom: var(--space-2xl);
  line-height: 1.5;
}
.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}
.hero__image {
  margin-top: var(--space-4xl);
  border-radius: var(--radius-3xl);
  overflow: hidden;
  box-shadow:
    0 24px 60px -20px rgba(23, 64, 56, 0.35),
    0 0 0 1px rgba(0, 77, 61, 0.05);
  background: var(--fw-card-elevated);
  aspect-ratio: 16 / 9;
}
.hero__image img { width: 100%; height: 100%; object-fit: cover; }

/* --- Feature grid --- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
}
.feature-card {
  padding: var(--space-2xl);
  background: var(--fw-card-bg);
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(0, 77, 61, 0.06);
}
.feature-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(0, 107, 84, 0.08);
  color: var(--fw-primary-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
}
.feature-card__icon svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: 22px; margin-bottom: var(--space-sm); }
.feature-card p { color: var(--fw-medium-gray); margin: 0; font-size: 16px; }

/* --- Steps (how it works) --- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3xl);
  counter-reset: step;
}
.step {
  position: relative;
  padding-top: var(--space-2xl);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 500;
  color: var(--fw-primary-green);
  opacity: 0.18;
  line-height: 1;
}
.step h3 { font-size: 20px; margin-bottom: var(--space-xs); }
.step p { color: var(--fw-medium-gray); font-size: 16px; }

/* --- Founding member band --- */
.founding-band {
  background: var(--fw-sand-cream);
  padding-block: clamp(var(--space-4xl), 7vw, var(--space-6xl));
  position: relative;
  overflow: hidden;
}
.founding-band__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3xl);
  align-items: center;
}
@media (max-width: 720px) {
  .founding-band__inner { grid-template-columns: 1fr; }
}
.founding-band h2 { color: var(--fw-founding); margin-bottom: var(--space-md); }
.founding-band p { color: var(--fw-dark-gray); margin-bottom: 0; }
.founding-band__crest {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  background: var(--fw-founding);
  color: var(--fw-sand-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(176, 138, 62, 0.32);
}

/* --- Footer --- */
.site-footer {
  background: var(--fw-deep-green);
  color: rgba(255, 252, 235, 0.78);
  padding-block: var(--space-5xl) var(--space-3xl);
  margin-top: var(--space-6xl);
}
.site-footer h4 {
  color: var(--fw-warm-cream);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}
@media (max-width: 720px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-2xl); }
}
.site-footer__brand {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--fw-warm-cream);
  margin-bottom: var(--space-sm);
}
.site-footer__tagline { font-size: 14px; opacity: 0.7; max-width: 32ch; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-top: 0; margin-bottom: var(--space-sm); }
.site-footer a {
  color: rgba(255, 252, 235, 0.78);
  font-size: 15px;
}
.site-footer a:hover { color: var(--fw-warm-cream); }
.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding-top: var(--space-2xl);
  border-top: 1px solid rgba(255, 252, 235, 0.12);
  font-size: 13px;
  opacity: 0.6;
}

/* --- Legal / Support pages (long-form) --- */
.legal {
  padding-block: var(--space-5xl);
  background: var(--fw-bg);
}
.legal h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin-bottom: var(--space-sm);
}
.legal__meta {
  font-size: 14px;
  color: var(--fw-medium-gray);
  margin-bottom: var(--space-4xl);
}
.legal h2 {
  font-size: 24px;
  margin-top: var(--space-4xl);
  margin-bottom: var(--space-md);
  color: var(--fw-deep-green);
}
.legal h3 {
  font-size: 18px;
  font-family: var(--font-body);
  font-weight: 600;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-sm);
  color: var(--fw-deep-green);
}
.legal p, .legal li {
  color: var(--fw-dark-gray);
  font-size: 16px;
  line-height: 1.7;
}
.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0 var(--space-2xl);
  font-size: 15px;
}
.legal th, .legal td {
  text-align: left;
  padding: var(--space-md);
  border-bottom: 1px solid var(--fw-surface);
  vertical-align: top;
}
.legal th {
  font-weight: 600;
  color: var(--fw-deep-green);
  background: rgba(0, 107, 84, 0.04);
}

/* --- Support / FAQ --- */
.faq details {
  border-top: 1px solid var(--fw-surface);
  padding-block: var(--space-lg);
}
.faq details:last-child { border-bottom: 1px solid var(--fw-surface); }
.faq summary {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--fw-deep-green);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 24px;
  font-weight: 400;
  color: var(--fw-primary-green);
  transition: transform 200ms var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: var(--space-md); color: var(--fw-medium-gray); }

/* --- Invite landing page --- */
.invite-page { min-height: 100dvh; display: flex; flex-direction: column; }
.invite-page main { flex: 1; }
.invite-hero {
  background: linear-gradient(180deg, var(--fw-primary-green) 0%, var(--fw-dark-green) 100%);
  color: var(--fw-warm-cream);
  padding-block: var(--space-5xl);
  text-align: center;
}
.invite-hero__eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fw-gold);
  margin-bottom: var(--space-md);
}
.invite-hero h1 {
  color: var(--fw-warm-cream);
  font-size: clamp(32px, 5vw, 44px);
  margin-bottom: var(--space-md);
}
.invite-hero p { color: rgba(255, 252, 235, 0.88); margin-inline: auto; }
.invite-code-card {
  background: var(--fw-warm-cream);
  color: var(--fw-deep-green);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl) var(--space-3xl);
  margin: var(--space-2xl) auto 0;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.invite-code-card__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fw-medium-gray);
  margin-bottom: var(--space-sm);
}
.invite-code-card__code {
  font-family: var(--font-display);
  font-size: clamp(36px, 7vw, 48px);
  font-weight: 500;
  color: var(--fw-deep-green);
  letter-spacing: 0.08em;
  margin: 0;
}
.invite-cta {
  display: flex;
  justify-content: center;
  margin-top: var(--space-2xl);
}

/* --- Utility helpers --- */
.text-center { text-align: center; }
.text-balance { text-wrap: balance; }
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fw-primary-green);
  margin-bottom: var(--space-md);
}
.mt-xl { margin-top: var(--space-xl); }
.mb-xl { margin-bottom: var(--space-xl); }

/* --- Reduce motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
