/* ================================================================
   HOW MANY PEOPLE ARE OLDER THAN YOU — Stylesheet
   Branding aligned with age-calculator.css
   All selectors scoped to #hmo-root to avoid WordPress theme conflicts
   ================================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── Reset ── */
#hmo-root *,
#hmo-root *::before,
#hmo-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Root / Variables ── */
#hmo-root {
  /* Brand colours — matches age-calculator palette */
  --bg:          #eef2f7;
  --card:        #ffffff;
  --border:      #b0c4de;
  --shadow:      0 2px 16px rgba(10, 61, 122, 0.08);
  --shadow-lg:   0 8px 40px rgba(10, 61, 122, 0.14);
  --blue-dark:   #0a3d7a;
  --blue-mid:    #1565c0;
  --blue-light:  #0288d1;
  --red:         #c62828;
  --teal:        #00897b;
  --orange:      #f57c00;
  --purple:      #7b1fa2;
  --navy:        #1a2332;
  --label:       #4a5568;
  --white:       #ffffff;
  --radius:      14px;
  --radius-sm:   9px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', Arial, Helvetica, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', Courier, monospace;

  font-family: var(--font-body);
  color: var(--navy);
  background: var(--bg);
  padding: 20px 14px 36px;
  min-width: 280px;
  isolation: isolate;
}

/* ── Layout ── */
#hmo-root .hmo-wrap {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Hero ── */
#hmo-root .hmo-hero {
  background: var(--blue-dark);
  border-radius: var(--radius);
  padding: 30px 28px;
  color: var(--white);
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}
#hmo-root .hmo-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 18%, rgba(255,255,255,0.07) 0%, transparent 52%),
    radial-gradient(circle at 12% 82%, rgba(2,136,209,0.18) 0%, transparent 50%);
  pointer-events: none;
}
#hmo-root .hmo-hero::after {
  content: '';
  position: absolute;
  right: -55px;
  top: -55px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.09);
  box-shadow: 0 0 0 40px rgba(255,255,255,0.03), 0 0 0 80px rgba(255,255,255,0.015);
  pointer-events: none;
}
#hmo-root .hmo-hero-inner { position: relative; z-index: 1; }
#hmo-root .hmo-hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 8px;
}
#hmo-root .hmo-hero-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 28px);
  line-height: 1.2;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 10px;
}
#hmo-root .hmo-hero-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  font-weight: 300;
  max-width: 480px;
  line-height: 1.65;
}

/* ── Card base ── */
#hmo-root .hmo-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
#hmo-root .hmo-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 18px;
}

/* ── Form fields ── */
#hmo-root .hmo-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
#hmo-root .hmo-field { display: flex; flex-direction: column; gap: 5px; }
#hmo-root .hmo-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #2d3748;
}
#hmo-root .hmo-input,
#hmo-root .hmo-select {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  background: #f0f4f9;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
#hmo-root .hmo-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath fill='%232d3748' d='M6 7L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
#hmo-root .hmo-input:focus,
#hmo-root .hmo-select:focus {
  border-color: var(--blue-dark);
  box-shadow: 0 0 0 3px rgba(10,61,122,0.12);
  background: var(--white);
}
#hmo-root .hmo-input.hmo-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(198,40,40,0.10);
}
#hmo-root .hmo-err-msg {
  font-size: 11px;
  color: var(--red);
  font-weight: 700;
  min-height: 14px;
}

/* ── Primary button ── */
#hmo-root .hmo-btn {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  background: var(--blue-dark);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 26px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(10,61,122,0.28);
}
#hmo-root .hmo-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(10,61,122,0.38); }
#hmo-root .hmo-btn:active { transform: translateY(0); }

/* ── Ghost button ── */
#hmo-root .hmo-btn-ghost {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-dark);
  background: transparent;
  border: 2px solid var(--blue-dark);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}
#hmo-root .hmo-btn-ghost:hover { background: rgba(10,61,122,0.07); }

/* ── Results wrapper ── */
#hmo-root .hmo-result { display: none; flex-direction: column; gap: 18px; }
#hmo-root .hmo-result.hmo-visible { display: flex; }

/* ── Age strip ── */
#hmo-root .hmo-age-strip {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
#hmo-root .hmo-age-block { display: flex; flex-direction: column; gap: 2px; }
#hmo-root .hmo-age-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--label);
}
#hmo-root .hmo-age-val {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--navy);
  line-height: 1;
}
#hmo-root .hmo-age-val-sm { font-size: 16px; }
#hmo-root .hmo-age-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Split banner ── */
#hmo-root .hmo-split-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
#hmo-root .hmo-banner-half {
  border-radius: var(--radius);
  padding: 26px 22px;
  color: var(--white);
  text-align: center;
  position: relative;
  overflow: hidden;
}
#hmo-root .hmo-banner-half::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.08) 0%, transparent 65%);
  pointer-events: none;
}
#hmo-root .hmo-banner-older  { background: var(--blue-dark); }
#hmo-root .hmo-banner-younger { background: var(--teal); }
#hmo-root .hmo-banner-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
#hmo-root .hmo-banner-num {
  font-family: var(--font-mono);
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 500;
  line-height: 1;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}
#hmo-root .hmo-banner-label {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  font-weight: 300;
  position: relative;
  z-index: 1;
  line-height: 1.4;
}

/* ── Stats grid ── */
#hmo-root .hmo-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
#hmo-root .hmo-stat {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
#hmo-root .hmo-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
#hmo-root .hmo-stat-accent {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
}
#hmo-root .hmo-stat:nth-child(1) .hmo-stat-accent { background: var(--blue-dark); }
#hmo-root .hmo-stat:nth-child(2) .hmo-stat-accent { background: var(--teal); }
#hmo-root .hmo-stat:nth-child(3) .hmo-stat-accent { background: var(--red); }
#hmo-root .hmo-stat:nth-child(4) .hmo-stat-accent { background: var(--orange); }
#hmo-root .hmo-stat:nth-child(5) .hmo-stat-accent { background: var(--purple); }
#hmo-root .hmo-stat:nth-child(6) .hmo-stat-accent { background: var(--blue-light); }
#hmo-root .hmo-stat-icon { font-size: 16px; margin-bottom: 4px; line-height: 1; display: block; }
#hmo-root .hmo-stat-val {
  font-family: var(--font-mono);
  font-size: clamp(12px, 2.5vw, 16px);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  display: block;
}
#hmo-root .hmo-stat-lbl {
  font-size: 11px;
  color: var(--label);
  font-weight: 700;
  display: block;
}

/* ── Pyramid card ── */
#hmo-root .hmo-pyramid-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
#hmo-root .hmo-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#hmo-root .hmo-section-title span { font-size: 16px; }

/* ── Stacked bar ── */
#hmo-root .hmo-pop-bar-wrap { margin-bottom: 18px; }
#hmo-root .hmo-pop-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--label);
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}
#hmo-root .hmo-pop-bar-track {
  height: 26px;
  border-radius: 100px;
  background: #e0e8f0;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  position: relative;
}
#hmo-root .hmo-pop-seg {
  height: 100%;
  transition: width 1.1s cubic-bezier(0.16,1,0.3,1);
  width: 0%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#hmo-root .hmo-pop-seg-older   { background: var(--blue-dark); }
#hmo-root .hmo-pop-seg-you     { background: var(--orange); min-width: 3px; }
#hmo-root .hmo-pop-seg-younger { background: var(--teal); }
#hmo-root .hmo-pop-seg-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  padding: 0 6px;
  pointer-events: none;
}
#hmo-root .hmo-pop-bar-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px;
  color: var(--label);
  font-weight: 700;
}
#hmo-root .hmo-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}
#hmo-root .hmo-dot-blue   { background: var(--blue-dark); }
#hmo-root .hmo-dot-orange { background: var(--orange); }
#hmo-root .hmo-dot-teal   { background: var(--teal); }

/* ── Age bracket rows ── */
#hmo-root .hmo-brackets { display: flex; flex-direction: column; gap: 7px; margin-top: 16px; }
#hmo-root .hmo-bracket-row {
  display: grid;
  grid-template-columns: 110px 1fr 70px;
  align-items: center;
  gap: 10px;
}
#hmo-root .hmo-bracket-age { font-size: 12px; font-weight: 700; color: var(--navy); }
#hmo-root .hmo-bracket-bar-track {
  background: #e0e8f0;
  border: 1px solid var(--border);
  border-radius: 100px;
  height: 7px;
  overflow: hidden;
}
#hmo-root .hmo-bracket-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 1.1s cubic-bezier(0.16,1,0.3,1);
  width: 0%;
}
#hmo-root .hmo-bracket-pop {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--label);
  font-weight: 700;
  text-align: right;
}
#hmo-root .hmo-bracket-row.hmo-you-row .hmo-bracket-age    { color: var(--orange); font-weight: 700; }
#hmo-root .hmo-bracket-row.hmo-you-row .hmo-bracket-fill   { background: var(--orange); }
#hmo-root .hmo-bracket-row.hmo-older-row .hmo-bracket-fill { background: var(--blue-dark); }
#hmo-root .hmo-bracket-row.hmo-younger-row .hmo-bracket-fill { background: var(--teal); }

/* ── Context card ── */
#hmo-root .hmo-context-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
#hmo-root .hmo-context-text {
  font-size: 14px;
  color: var(--label);
  line-height: 1.78;
}
#hmo-root .hmo-hl      { color: var(--blue-dark);  font-weight: 700; }
#hmo-root .hmo-hl-teal { color: var(--teal);        font-weight: 700; }
#hmo-root .hmo-hl-red  { color: var(--red);         font-weight: 700; }
#hmo-root .hmo-hl-org  { color: var(--orange);      font-weight: 700; }

/* ── Life expectancy strip ── */
#hmo-root .hmo-life-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
#hmo-root .hmo-life-box {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#hmo-root .hmo-life-lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #2d3748;
}
#hmo-root .hmo-life-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}
#hmo-root .hmo-life-sub { font-size: 12px; color: var(--label); font-weight: 600; }

/* ── Action row ── */
#hmo-root .hmo-action-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Footnote ── */
#hmo-root .hmo-footnote {
  text-align: center;
  font-size: 12px;
  color: var(--label);
  font-weight: 600;
  line-height: 1.65;
}

/* ── Animations ── */
@keyframes hmo-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
#hmo-root .hmo-anim    { animation: hmo-fade-up 0.55s cubic-bezier(0.16,1,0.3,1) both; }
#hmo-root .hmo-anim-d1 { animation-delay: 0.05s; }
#hmo-root .hmo-anim-d2 { animation-delay: 0.12s; }
#hmo-root .hmo-anim-d3 { animation-delay: 0.19s; }
#hmo-root .hmo-anim-d4 { animation-delay: 0.26s; }
#hmo-root .hmo-anim-d5 { animation-delay: 0.33s; }

/* ── Responsive ── */
@media (max-width: 580px) {
  #hmo-root .hmo-card,
  #hmo-root .hmo-pyramid-card,
  #hmo-root .hmo-context-card { padding: 20px 18px; }
  #hmo-root .hmo-hero          { padding: 28px 22px 24px; }
  #hmo-root .hmo-fields        { grid-template-columns: 1fr 1fr; }
  #hmo-root .hmo-stats         { grid-template-columns: 1fr 1fr; }
  #hmo-root .hmo-stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  #hmo-root .hmo-bracket-row   { grid-template-columns: 90px 1fr 55px; }
}
@media (max-width: 400px) {
  #hmo-root .hmo-fields        { grid-template-columns: 1fr; }
  #hmo-root .hmo-stats         { grid-template-columns: 1fr; }
  #hmo-root .hmo-split-banner  { grid-template-columns: 1fr; }
  #hmo-root .hmo-life-strip    { grid-template-columns: 1fr; }
  #hmo-root .hmo-bracket-row   { grid-template-columns: 80px 1fr 50px; }
}