/* ═══════════════════════════════════════════
   VARIABLES
   ═══════════════════════════════════════════ */

:root {
  /* Colors — core palette */
  --color-ink: #070707;
  --color-white: #ffffff;
  --color-mint: #97f4e8;
  --color-lavender: #97bbf4;

  /* Colors — score index badges */
  --color-index-low-bg: var(--color-mint);
  --color-index-mid-bg: #cecece;
  --color-index-high-bg: #efd657;

  /* Colors — glass surfaces */
  --glass-bg: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.6));
  --glass-bg-focus: rgba(255, 255, 255, 0.85);
  --glass-pill-bg-hover: linear-gradient(rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.8));
  --glass-pill-border: var(--color-white);

  /* Gradients — page background */
  --gradient: #f4fff9, #f0f6d2 25%, #0bc9af 70%, #ffffff;
  --gradient-mobile: #f4fff9, #f0f6d2 25%, #0bc9af 70%, #ffffff;
  --gradient-angle: 40deg;
  --gradient-linear: 0deg;

  /* Typography */
  --font-primary: "Funnel Display", "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Shadows */
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 12px 36px rgba(0, 0, 0, 0.28);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-pill: 128px;

  /* Spacing */
  --content-max-width: 1140px;
  --content-padding: 24px;
  --section-gap: 3rem;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-smooth: 1.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Texture */
  --texture-url: url("https://cdn.prod.website-files.com/69a1ac8f207e841165988245/69a48c392bd5eabab74febc1_asfalt-light-more.png");
}

/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  background-color: var(--color-white);
}

body {
  font-family: var(--font-primary);
  color: var(--color-ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-ink);
  -webkit-text-fill-color: var(--color-link);
}

button,
input,
select,
textarea {
  color: inherit;
  -webkit-text-fill-color: inherit;
}

/* ═══════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════ */

.noise {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  background-image: var(--texture-url), linear-gradient(var(--gradient-angle), var(--gradient));
  background-size: 300px, cover;
  transition: filter var(--transition-smooth);
}

body.mode-move .noise {
  /* filter: hue-rotate(100deg) saturate(50%); */
  filter: hue-rotate(90deg) saturate(0.6);
  filter: hue-rotate(60deg) saturate(0.5);
}

.container {
  position: relative;
  z-index: 1;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════ */

header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

.logo-link {
  text-decoration: none;
  color: inherit;
  -webkit-text-fill-color: inherit;
}

.logo {
  display: inline-block;
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -0.5px;
  margin-top: 2rem;
}

.hero-heading {
  font-size: 60px;
  font-weight: 300;
  line-height: 64px;
  text-wrap: balance;
  text-align: center;
}

/* ═══════════════════════════════════════════
   MODE TOGGLE (Visit / Live)
   ═══════════════════════════════════════════ */

.mode-toggle {
  display: flex;
  justify-content: center;
}

.mode-switch {
  position: relative;
  background: var(--color-ink);
  border-radius: 50px;
  border: 4px solid var(--color-ink);
  display: flex;
  width: 160px;
  height: 40px;
}

.mode-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: var(--color-mint);
  border-radius: 46px;
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.mode-switch.move .mode-slider {
  left: 50%;
  background: var(--color-lavender);
}

.mode-option {
  position: relative;
  z-index: 2;
  border: none;
  background: none;
  color: color-mix(in srgb, var(--color-white) 80%, transparent);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.01em;
  white-space: nowrap;
  width: 100%;
}

.mode-option.active {
  color: var(--color-ink);
}

.mode-option:hover:not(.active) {
  color: color-mix(in srgb, var(--color-white) 100%, transparent);
}

/* ═══════════════════════════════════════════
   QUICK COMPARE PILLS
   ═══════════════════════════════════════════ */

.quick-compare {
  text-align: center;
  margin-top: var(--section-gap);
}

.quick-compare-label {
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 16px;
}

.quick-compare-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 700px;
  margin: 0 auto;
}

.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  border: 1px solid var(--color-white);
  background: var(--glass-bg);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.quick-pill:hover {
  background: var(--glass-pill-bg-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.quick-pill .pill-vs {
  font-weight: 400;
  font-size: 11px;
}

.quick-compare-or {
  font-size: 18px;
  font-weight: 400;
  margin-top: var(--section-gap);
}

/* ═══════════════════════════════════════════
   CITY SELECTOR (frosted glass card)
   ═══════════════════════════════════════════ */

.selector-section {
  max-width: 700px;
  width: 100%;
  margin: 16px auto 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: nowrap;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 5px solid var(--color-ink);
  background: var(--glass-bg);
}

.city-picker {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: none;
  padding: 20px 14px 14px 24px;
}

.city-picker:first-child {
  border-right: 1px solid var(--color-ink);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.city-picker:last-child {
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
}

.city-picker label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.city-picker input {
  width: 100%;
  padding: 8px 0;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 0;
  background: transparent;
  outline: none;
  transition: background var(--transition-base);
}

.city-picker:focus-within {
  background: var(--glass-bg-focus);
}

.city-picker input::placeholder {
  color: var(--color-ink);
  -webkit-text-fill-color: var(--color-ink);
  font-weight: 300;
  opacity: 1;
}

/* Clear input button */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  padding-right: 32px;
}

.clear-input {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-52%);
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: var(--color-ink);
  -webkit-text-fill-color: var(--color-ink);
  border-radius: 50%;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  padding: 0;
}

.input-wrap input:not(:placeholder-shown) ~ .clear-input {
  display: flex;
}

/* ═══════════════════════════════════════════
   DROPDOWN (local + Google Places autocomplete)
   ═══════════════════════════════════════════ */

.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border-hard);
  max-height: 260px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.dropdown.active {
  display: block;
}

.dropdown-item {
  padding: 12px 18px;
  cursor: pointer;
  font-size: 14px;
  transition: background var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dropdown-item:first-child {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.dropdown-item:hover,
.dropdown-item.highlighted {
  background-color: color-mix(in srgb, var(--color-mint) 50%, transparent);
}

.dropdown-item .state {
  font-size: 12px;
}

.dropdown-item .metro-hint {
  font-size: 11px;
  font-weight: 400;
}

/* ═══════════════════════════════════════════
   COMPARE BUTTON
   ═══════════════════════════════════════════ */

.compare-btn {
  display: none;
  align-items: center;
  justify-content: center;
  margin: 28px auto 0;
  height: 50px;
  padding: 0 40px;
  font-size: 16px;
  font-weight: 500;
  background: var(--color-ink);
  color: var(--color-white);
  border: none;
  border-radius: 160px;
  cursor: pointer;
  transition: all var(--transition-base);
  letter-spacing: 0.3px;
  box-shadow: var(--shadow);
}

.compare-btn:enabled {
  display: flex;
}

.compare-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

/* ═══════════════════════════════════════════
   RESULTS
   ═══════════════════════════════════════════ */

.results {
  margin-top: 48px;
  display: none;
}

.results.active {
  display: block;
}

.results-header {
  text-align: center;
  margin-bottom: 36px;
}

.results-title {
  font-size: 36px;
  margin-bottom: 8px;
}

.results-subtitle {
  font-size: 16px;
}

/* Data confidence & same-metro notices */
.data-confidence-notice {
  text-align: center;
  margin: 0 0 20px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 18px;
  line-height: 1.5;
}

.data-confidence-notice .confidence-icon {
  font-size: 20px;
  margin-right: 6px;
}

.same-metro-notice {
  text-align: center;
  margin: -20px 0 20px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 18px;
  line-height: 1.5;
  text-wrap: balance;
}

.same-metro-notice strong {
  color: var(--color-ink);
}

/* ═══════════════════════════════════════════
   SCORE CARDS
   ═══════════════════════════════════════════ */

.score-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
  align-items: stretch;
}

.score-card {
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  background: var(--glass-bg);
  border: 5px solid var(--color-white);
}

.confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.score-card.cheaper::before {
  content: "Better Value";
  position: absolute;
  top: 22px;
  right: -35px;
  background: var(--color-ink);
  color: var(--color-white);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 36px;
  transform: rotate(35deg);
  animation: fadeIn 1s ease 2s both;
}

.score-city {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0;
}

.choosy-score {
  font-size: 64px;
  font-weight: 900;
  line-height: 1.25;
}

.choosy-score-label {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.score-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.score-amount-small {
  font-size: 15px;
  font-weight: 600;
}

.score-index {
  display: inline-block;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--color-ink) 40%, transparent);
  background:
    linear-gradient(
      40deg,
      rgba(255, 255, 255, 0.2),
      rgba(255, 255, 255, 0.5),
      rgba(255, 255, 255, 0)
    ),
    var(--index-bg);
}

.index-low {
  --index-bg: var(--color-index-low-bg);
}

.index-mid {
  --index-bg: var(--color-index-mid-bg);
}

.index-high {
  --index-bg: var(--color-index-high-bg);
}

/* ═══════════════════════════════════════════
   SAVINGS BANNER
   ═══════════════════════════════════════════ */

.savings-banner {
  background: var(--color-ink);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  margin: 0;
  box-shadow: var(--shadow);
}

.savings-amount {
  font-size: 42px;
  font-weight: 900;
  color: var(--color-mint);
  flex-shrink: 0;
  line-height: 1;
}

.savings-text {
  font-size: 17px;
  line-height: 1.5;
}

.savings-text strong {
  color: var(--color-mint);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition-base);
  letter-spacing: 0.3px;
  border: none;
  background: var(--color-ink);
}

.share-btn:hover {
  background: color-mix(in srgb, var(--color-ink), white 20%);
}

.share-btn.copied {
  background: var(--color-mint);
  color: var(--color-ink);
}

/* ═══════════════════════════════════════════
   COST BREAKDOWN
   ═══════════════════════════════════════════ */

.breakdown {
  background-color: var(--color-white);
  border-radius: var(--radius-xl);
  padding: 26px;
  max-width: 700px;
  margin: auto;
  box-shadow: var(--shadow);
}

.breakdown-title {
  font-size: 22px;
  margin-bottom: 24px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  padding: 16px 0;
  gap: 10px;
  border-bottom: 1px solid var(--color-border);
}

.breakdown-row:last-child {
  border-bottom: none;
}

.breakdown-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-right: 16px;
  flex-shrink: 0;
}

.breakdown-label {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
}

.breakdown-label small {
  display: block;
  font-size: 13px;
  font-weight: 400;
  margin-top: 2px;
}

.breakdown-values {
  display: flex;
  gap: 24px;
  text-align: right;
}

.breakdown-val {
  width: 90px;
  flex-shrink: 0;
}

.breakdown-val .amount {
  font-size: 18px;
  font-weight: 900;
  background-color: var(--color-white);
  display: inline;
  padding: 0 4px;
  border-radius: var(--radius-sm);
}

.breakdown-val .city-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
}

.breakdown-val .amount.cheaper-val {
  background-color: color-mix(in srgb, var(--color-mint) 70%, transparent);
}

.breakdown-val .amount.no-tax-badge {
  font-weight: 700;
  font-size: 14px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
}

/* Tax dollar amounts (/yr label) */
.breakdown-val .amount small {
  font-size: 0.65em;
  font-weight: 400;
  margin-left: 1px;
  color: var(--color-ink);
}

/* ═══════════════════════════════════════════
   LOCAL INTEL ACCORDION
   ═══════════════════════════════════════════ */

.more-stats-accordion {
  margin-top: 10px;
}

.more-stats-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 1rem 0.5rem 0.5rem 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: opacity var(--transition-base);
}

.more-stats-label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-ink);
}

.more-stats-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.more-stats-hint {
  font-size: 11px;
  font-weight: 400;
  flex: 1;
}

.more-stats-chevron {
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.more-stats-accordion.open .more-stats-chevron {
  transform: rotate(180deg);
}

.more-stats-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.more-stats-accordion.open .more-stats-content {
  max-height: 500px;
}

.more-stats-content .breakdown-row:first-child {
  border-top: none;
}

.amount.coming-soon {
  font-size: 13px;
}

.more-stats-placeholder {
  display: none;
}

/* ═══════════════════════════════════════════
   FOOTER & NOTES
   ═══════════════════════════════════════════ */

.cost-index-note {
  text-align: center;
  text-wrap: balance;
  font-size: 16px;
  line-height: 1.5;
  max-width: 780px;
  margin: 0 auto 30px;
}

.cost-index-note strong {
  font-weight: 700;
}

.disclaimer {
  margin-top: 32px;
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.attribution {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  padding-bottom: 32px;
}

.attribution a {
  color: var(--color-link);
  -webkit-text-fill-color: var(--color-link);
  text-decoration: underline;
}

.contact-footer {
  margin-top: auto;
  text-align: center;
  padding: 60px 0 40px;
  font-size: 13px;
}

.contact-footer .email-link {
  color: var(--color-link);
  -webkit-text-fill-color: var(--color-link);
  text-decoration: underline;
  font-weight: 500;
  transition: opacity var(--transition-base);
}

.contact-footer .email-link:hover {
  opacity: 0.7;
}

/* ═══════════════════════════════════════════
   LIVE MODE OVERRIDES
   ═══════════════════════════════════════════ */

body.mode-move .savings-amount {
  color: var(--color-mint);
}

body.mode-move .savings-text strong {
  color: var(--color-mint);
}

body.mode-move .share-btn.copied {
  background: var(--color-mint);
  border-color: var(--color-mint);
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.results.active .score-card {
  animation: fadeUp 0.5s ease both;
}

.results.active .score-card:nth-child(2) {
  animation-delay: 0.1s;
}

.results.active .savings-banner {
  animation: fadeUp 0.5s ease 0.2s both;
}

.results.active .breakdown {
  animation: fadeUp 0.5s ease 0.3s both;
}

/* ═══════════════════════════════════════════
   RESPONSIVE — Mobile (≤ 640px)
   ═══════════════════════════════════════════ */

@media (max-width: 640px) {
  .noise {
    background-image:
      var(--texture-url), linear-gradient(var(--gradient-linear), var(--gradient-mobile));
  }

  header {
    gap: 2rem;
  }

  .container {
    padding: 0 16px;
  }

  .logo {
    font-size: 28px;
    margin-top: 1.5rem;
  }

  .hero-heading {
    font-size: 34px;
    line-height: 42px;
  }

  .quick-compare {
    text-align: center;
    margin-top: 2rem;
  }

  .quick-compare-or {
    margin-top: 2rem;
  }

  .quick-pill:nth-child(n + 4) {
    display: none;
  }

  .mode-switch {
    height: 40px;
  }

  .selector-section {
    flex-direction: column;
    max-width: 90%;
  }

  .city-picker:first-child {
    border-right: none;
    border-bottom: 1px solid var(--color-border-hard);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .city-picker:last-child {
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  }

  .city-picker {
    max-width: 100%;
    padding: 16px 16px 13px 16px;
  }

  .score-cards {
    grid-template-columns: 1fr;
  }

  .savings-banner {
    order: -1;
    padding: 24px 20px 28px 20px;
  }

  .breakdown-values {
    gap: 4px;
  }
  .breakdown-val {
    width: 80px;
  }

  .breakdown-title {
    text-align: center;
  }
  .breakdown-icon {
    margin-right: 0;
  }

  .more-stats-toggle {
    padding: 1rem 0.5rem 0.5rem 0.5rem;
  }

  .breakdown {
    padding: 24px 20px;
  }
  .breakdown-val .amount {
    font-size: 16px;
  }
  .choosy-score {
    font-size: 50px;
    line-height: 1;
    margin-bottom: 4px;
  }

  .score-card {
    padding: 20px;
  }

  .score-city {
    margin-bottom: 4px;
  }
}
