/* ==========================================================================
   Design tokens — NYC Soccer Field Permits
   Single source of truth for color, type, spacing, and shared component
   primitives. Loaded by every page/section partial in site/.

   Palette + typographic spirit are a deliberate spoof of a well-known NYC
   host-committee microsite: same color roles, different fonts, different
   layout. No shared branding, never named anywhere on this site.

   Light-mode only — beige background is the site's only background color,
   full stop. No dark-mode branch (unlike the working prototypes this reskins,
   which had one from their placeholder styling — intentionally dropped here).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@800;900&display=swap');

:root {
  /* ---- color: green ---- */
  --color-green-50: #edfcf6;
  --color-green-100: #d4f7e9;
  --color-green-200: #aceed6;
  --color-green-300: #76dfc0;
  --color-green-400: #3fc8a4;
  --color-green-500: #1bae8c;
  --color-green-600: #0e856c;
  --color-green-700: #0c705e;
  --color-green-800: #0c594b;
  --color-green-900: #0b493f;
  --color-green-950: #052924;

  /* ---- color: blue ---- */
  --color-blue-50: #eff6ff;
  --color-blue-100: #dbebfe;
  --color-blue-200: #bfdcfe;
  --color-blue-300: #93c7fd;
  --color-blue-400: #60a8fa;
  --color-blue-500: #3b86f6;
  --color-blue-600: #2b6beb;
  --color-blue-700: #1d52d8;
  --color-blue-800: #1e43af;
  --color-blue-900: #1e3c8a;
  --color-blue-950: #172654;

  /* ---- color: red ---- */
  --color-red-50: #fff1f2;
  --color-red-100: #ffe0e3;
  --color-red-200: #ffc6cb;
  --color-red-300: #ff9fa7;
  --color-red-400: #ff6774;
  --color-red-500: #fb3848;
  --color-red-600: #eb2b3b;
  --color-red-700: #c41120;
  --color-red-800: #a2121e;
  --color-red-900: #86161f;
  --color-red-950: #49060c;

  /* ---- color: orange ---- */
  --color-orange-50: #fef6ee;
  --color-orange-100: #fdead7;
  --color-orange-200: #fbd1ad;
  --color-orange-300: #f7b17a;
  --color-orange-400: #f38644;
  --color-orange-500: #f06924;
  --color-orange-600: #e14c15;
  --color-orange-700: #bb3813;
  --color-orange-800: #942e18;
  --color-orange-900: #782816;
  --color-orange-950: #411109;

  /* ---- color: yellow (display/headline text; --subcat-other below is the
     one deliberate reuse for data, sharing color with the headline rather
     than getting its own) ---- */
  --color-yellow-50: #fffaeb;
  --color-yellow-100: #fdefc8;
  --color-yellow-200: #fbdd8c;
  --color-yellow-300: #f9c650;
  --color-yellow-400: #f8b538;
  --color-yellow-500: #f18d0f;
  --color-yellow-600: #d5690a;
  --color-yellow-700: #b1480c;
  --color-yellow-800: #903810;
  --color-yellow-900: #762e11;
  --color-yellow-950: #441604;

  /* ---- color: beige (site background) ---- */
  --color-beige-50: #fbf8ef;
  --color-beige-100: #f2e9cd; /* the only page background used anywhere */
  --color-beige-200: #e6d5a1;
  --color-beige-300: #dabc6f;
  --color-beige-400: #d1a74e;
  --color-beige-500: #c78c39;
  --color-beige-600: #b06f2f;
  --color-beige-700: #93532a;
  --color-beige-800: #784328;
  --color-beige-900: #633824;
  --color-beige-950: #381c10;

  /* ---- color: for-profit orgs (permit breakdown 9-way expansion, all 3
     parks + revenue calculator's org selector). One shade per org, the one
     actually used in --org-* below -- a second unused neighbor used to
     linger here from when these were picked (full 50-950 scale each was
     drawn from is in docs/visual-design-notes.md); nothing ever referenced
     it, so deleted. ---- */
  --color-nyc-footy-pink-400: #fe6380;
  --color-nyc-soccer-navy-950: #00183d;
  --color-ny-coed-red-700: #c1141b; /* not 600 -- see --org-ny-coed below */
  --color-love-ny-red-500: #f7464c;
  --color-group-stage-yellow-500: #f4f000;
  --color-volo-blue-700: #013af5;
  --color-round-play-green-700: #46572a;

  --color-sunday-league-blue-300: #5ed5ed; /* now live -- Sternberg for-profit permit holder */
  --color-nycwsoc-cyan-500: #36ffe6; /* McCarren for-profit permit holder, user-supplied color */

  /* ---- semantic roles ---- */
  --bg-page: var(--color-beige-100);
  --text-primary: #000000;
  --text-secondary: var(--text-primary); /* all text is black — no tinted grays */
  --border-strong: var(--text-primary);
  --gridline: #d4d4d4; /* tailwind neutral-300 -- no neutral scale exists elsewhere in this file */

  --surface-0: var(--color-beige-50);  /* hover cards */
  --surface-1: #ffffff;
  --surface-stat: var(--color-beige-200); /* stat cards specifically -- one step tanner than --bg-page, its own step in the scale rather than a --surface-2 since it's tied to one component, not a general elevation level */

  --brand-headline: var(--color-yellow-400);
  --brand-cta: var(--color-orange-500);
  --brand-cta-hover: var(--color-orange-600);
  --brand-cta-text: var(--text-primary);

  /* selected/active state shared by segmented controls, chip toggles, radio
     dots, and the org-picker's selection ring -- previously every one of
     these reached for --color-blue-600 directly instead of a shared name. */
  --state-selected: var(--color-blue-600);

  /* category (Youth/City) — Figma node 114:1719. No --category-adult: Adult
     always splits into the subcategory tints below instead of its own bar. */
  --category-city: var(--color-green-600);     /* NYC Parks' real leaf-logo green */
  --category-youth: var(--color-blue-600);

  /* adult-family subcategory tints (For-profit/Pickup/Semi-pro share one hue) —
     darkens as it goes: for-profit 600, pickup 700, semi-pro 800 */
  --subcat-for-profit: var(--color-red-600);
  --subcat-pickup: var(--color-red-700);
  --subcat-semipro: var(--color-red-800);
  --subcat-unknown: #a1a1a1; /* plain neutral gray, not part of the adult tint family */
  --subcat-other: var(--brand-headline); /* reuses the headline yellow rather than a new color */

  /* the 9 for-profit orgs, on expansion — named colors, not a numbered scale */
  --org-nyc-footy: var(--color-nyc-footy-pink-400);
  --org-nyc-soccer: var(--color-nyc-soccer-navy-950);
  --org-ny-coed: var(--color-ny-coed-red-700);
  --org-love-ny: var(--color-love-ny-red-500);
  --org-group-stage: var(--color-group-stage-yellow-500);
  --org-round-play: var(--color-round-play-green-700);
  --org-volo: var(--color-volo-blue-700);
  --org-sunday-league: var(--color-sunday-league-blue-300);
  --org-nycwsoc: var(--color-nycwsoc-cyan-500);

  /* confidence badges (revenue calculator edit-panel only, per revenue-calculator-notes.md) */
  --badge-confirmed: var(--color-green-700);
  --badge-confirmed-bg: var(--color-green-200);
  --badge-estimated: var(--color-yellow-800);
  --badge-estimated-bg: var(--color-yellow-200);

  /* dollar-figure emphasis in the formula display -- happens to share
     --badge-confirmed's value, but it's a coincidence, not the same
     concept (a confidence level vs. a number worth drawing the eye to), so
     it gets its own name rather than reusing --badge-confirmed directly. */
  --money-accent: var(--color-green-700);
  --badge-none: #52525b; /* tailwind zinc-600 — a plain neutral, not a data hue */
  --badge-none-bg: #f4f4f5; /* tailwind zinc-100 */

  /* ---- type ---- */
  --font-display: 'Poppins', sans-serif;
  --font-display-weight: 900;
  --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Full type scale per assets/design-system/Frame 3.png (the refined-text-styles
     reference — supersedes the earlier "buttons = 24px, scale from there" system
     and the separate leading/tracking-tier tokens). Each size carries its own
     line-height + letter-spacing, Tailwind-config style. 5xl/6xl aren't in Frame 3;
     extrapolated continuing the same growth curve as 3xl->4xl. xs isn't in Frame 3
     either; extrapolated one step below sm for badges/fine print. */
  --text-6xl: 5rem;       /* 80px */
  --text-6xl-leading: 0.8;
  --text-6xl-tracking: -0.025em;
  --text-5xl: 4rem;       /* 64px */
  --text-5xl-leading: 0.8;
  --text-5xl-tracking: -0.025em;
  --text-4xl: 3rem;       /* 48px */
  --text-4xl-leading: 0.8;
  --text-4xl-tracking: -0.025em;
  --text-3xl: 2.25rem;    /* 36px */
  --text-3xl-leading: 0.8;
  --text-3xl-tracking: -0.025em;
  --text-2xl: 1.75rem;    /* 28px */
  --text-2xl-leading: 1.1;
  --text-2xl-tracking: -0.02em;
  --text-xl: 1.375rem;    /* 22px */
  --text-xl-leading: 1.15;
  --text-xl-tracking: -0.01em;
  --text-lg: 1.125rem;    /* 18px */
  --text-lg-leading: 1.15;
  --text-lg-tracking: 0em;
  --text-base: 1rem;      /* 16px */
  --text-base-leading: 1.15;
  --text-base-tracking: 0em;
  --text-sm: 0.875rem;    /* 14px */
  --text-sm-leading: 1.15;
  --text-sm-tracking: 0em;
  --text-xs: 0.75rem;     /* 12px */
  --text-xs-leading: 1.15;
  --text-xs-tracking: 0em;

  /* the black text-stroke technique used on display type (text-3xl and up —
     the sizes that get the uppercase/stroke "title" treatment), and anywhere
     else contrast against beige or a neighboring similar hue needs help (bar
     segments, Group Stage's yellow swatch, etc.). em, not px, so it scales
     with font-size. 0.03em per Frame 3. */
  --display-stroke: 0.06em var(--border-strong);
  --outline-thick: 2px solid var(--border-strong); /* Figma consistently uses border-2 (2px) */
  /* --outline-thin (1.5px) used to exist for 2 consumers; collapsed into this */

  /* ---- spacing ---- */
  --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;
  --space-9: 6rem;
  --space-10: 8rem;

  /* ---- shape ---- */
  --radius-sm: 8px;
  --radius-md: 16px; /* dropdowns, segmented control — per Figma node 114:1719 */
  --radius-xl: 24px; /* stat cards — per Figma node 114:1719 */
  --radius-lg: 32px; /* cards, accordion items */
  --radius-pill: 999px;

  --control-height: 3.25rem; /* fixed height for primary controls (dropdowns, segmented toggles), so unrelated rows stay aligned */
  --control-icon-size: 1.5rem; /* dropdown chevrons, chip-toggle track -- a size, not a spacing gap, so its own token rather than --space-5 */

  --content-max: 800px; /* matches the Figma frame width — shared by every section */
}

/* ==========================================================================
   Reset + base
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: var(--text-base-leading);
  letter-spacing: var(--text-base-tracking);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* Shared vertical rhythm between feature sections (permit breakdown, revenue
   calculator, and anything else that gets this class later). */
.feature { padding: var(--space-9) 0; }

/* ==========================================================================
   Type scale utilities — one class per size, each carrying its own
   line-height + letter-spacing (see the --text-*-leading/-tracking tokens
   above). Compose with .display-text for the uppercase/stroke title look.
   ========================================================================== */
.text-xs  { font-size: var(--text-xs);  line-height: var(--text-xs-leading);  letter-spacing: var(--text-xs-tracking); }
.text-sm  { font-size: var(--text-sm);  line-height: var(--text-sm-leading);  letter-spacing: var(--text-sm-tracking); }
.text-base{ font-size: var(--text-base);line-height: var(--text-base-leading);letter-spacing: var(--text-base-tracking); }
.text-lg  { font-size: var(--text-lg);  line-height: var(--text-lg-leading);  letter-spacing: var(--text-lg-tracking); }
.text-xl  { font-size: var(--text-xl);  line-height: var(--text-xl-leading);  letter-spacing: var(--text-xl-tracking); }
.text-2xl { font-size: var(--text-2xl); line-height: var(--text-2xl-leading); letter-spacing: var(--text-2xl-tracking); }
.text-3xl { font-size: var(--text-3xl); line-height: var(--text-3xl-leading); letter-spacing: var(--text-3xl-tracking); }
.text-4xl { font-size: var(--text-4xl); line-height: var(--text-4xl-leading); letter-spacing: var(--text-4xl-tracking); }
.text-5xl { font-size: var(--text-5xl); line-height: var(--text-5xl-leading); letter-spacing: var(--text-5xl-tracking); }
.text-6xl { font-size: var(--text-6xl); line-height: var(--text-6xl-leading); letter-spacing: var(--text-6xl-tracking); }

/* Larger copy tier — hero intro, lead paragraphs. Just an alias onto text-xl. */
.text-body-lg {
  font-size: var(--text-xl);
  line-height: var(--text-xl-leading);
  letter-spacing: var(--text-xl-tracking);
}

/* The uppercase black-stroke display treatment — compose with a text-3xl+ size class. */
.display-text {
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  color: var(--brand-headline);
  -webkit-text-stroke: var(--display-stroke);
  paint-order: stroke fill;
  text-transform: uppercase;
}

.section-title {
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  color: var(--brand-headline);
  line-height: var(--text-4xl-leading);
  letter-spacing: var(--text-4xl-tracking);
  -webkit-text-stroke: var(--display-stroke);
  paint-order: stroke fill;
  font-size: var(--text-4xl);
  margin: 0 0 var(--space-3);
  text-transform: uppercase;
}

/* ==========================================================================
   Shared primitives — consumed by hero, both feature reskins, and about.
   ========================================================================== */

/* Buttons: oval, black outline, orange fill — per Frame 2 reference. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-lg); /* 24px — the scale's anchor point */
  color: var(--brand-cta-text);
  background: var(--brand-cta);
  border: var(--outline-thick);
  border-radius: var(--radius-pill);
  padding: var(--space-3) var(--space-6);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--brand-cta-hover); }
.btn:active { transform: translateY(1px); }
/* Secondary: outline-style — beige fill (matches page background), same black border as everything else. */
.btn.btn-secondary { background: var(--bg-page); color: var(--text-primary); }
.btn.btn-secondary:hover { background: var(--color-beige-200); }
.btn.disabled { cursor: not-allowed; opacity: 0.5; }
.btn.disabled:hover { background: var(--bg-page); }

/* Shared keyboard-focus ring (reuses --state-selected). Exceptions:
   - .segmented button (not .active): flush siblings, outward ring would
     overlap the neighbor -- inset instead.
   - .org-tile.active: already has its own 2px box-shadow ring -- extra
     offset (4px) so the focus ring doesn't land right on top of it.
   - .bar-segment: flush siblings + outline paints outside the box, so it
     gets clipped/covered inconsistently depending on position -- inset
     box-shadow instead (self-contained, order-independent). outline:none
     needed alongside it or the browser's own default ring still shows. */
.btn:focus-visible,
select:focus-visible,
.segmented button:focus-visible,
.org-tile:focus-visible,
.chip-toggle input:focus-visible + .chip-track,
.radio-option input:focus-visible + .radio-dot,
.field-box:focus-within,
.clear-all:focus-visible,
.bar-label-cell:focus-visible,
.hero-scroll-indicator:focus-visible {
  outline: 2px solid var(--state-selected);
  outline-offset: 2px;
}
.segmented button:not(.active):focus-visible { outline-offset: -2px; }
.org-tile.active:focus-visible { outline-offset: 4px; }
.bar-segment:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--state-selected); }

/* Cards: rounded, black outline, no drop shadow — flat per Frame 2 + reference site cards. */
.card {
  background: var(--surface-1);
  border: var(--outline-thick);
  border-radius: var(--radius-lg);
}

/* Pills: tab-style selectable buttons (Park / Period selectors, etc). Selected = blue. */
.pill-group { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.pill {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: var(--outline-thick);
  background: var(--surface-1);
  color: var(--text-secondary);
  cursor: pointer;
}
.pill.active { background: var(--state-selected); border-color: var(--border-strong); color: var(--surface-1); }
.pill.disabled { cursor: not-allowed; opacity: 0.5; }

/* Badges: small pill labels (confidence status — the revenue calculator's
   league snapshot card is the only current user). Sized/colored per the
   Figma frame: no border, 4px radius, green-200/yellow-200 fill rather than
   the lighter -100 step, uniform 4px padding on every side (re-checked
   directly against the Figma export -- p-[4px], not an asymmetric
   vertical/horizontal split). */
.badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 4px;
  border-radius: 4px;
}
.badge.confirmed { color: var(--badge-confirmed); background: var(--badge-confirmed-bg); }
.badge.estimated { color: var(--badge-estimated); background: var(--badge-estimated-bg); }
.badge.none { color: var(--badge-none); background: var(--badge-none-bg); }

/* Accordion: about/methodology sections. */
.accordion-item {
  border: var(--outline-thick);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  margin-bottom: var(--space-3);
  overflow: hidden;
}
.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: none;
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}
/* Chevron icon: a real chevron shape (CSS mask, currentColor), not a text glyph.
   Markup only needs an empty <span class="chevron"></span> inside the trigger. */
.chevron {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.15s ease;
}
.accordion-item.open .accordion-trigger .chevron { transform: rotate(180deg); }
.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease;
}
.accordion-item.open .accordion-panel { grid-template-rows: 1fr; }
.accordion-panel-inner { overflow: hidden; }
.accordion-panel-inner > .accordion-body {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--text-secondary);
  line-height: 1.6;
}
