:root {
  /* iSTEM palette: green and blue lead, with red and orange from the logo. Edit here to retheme. */
  --green-900: #0b3d2e;
  --green-800: #0f5240;
  --green-700: #14694f;
  --green-600: #1b8a63;
  --green-100: #e3f3ea;
  --green-50:  #f2faf5;
  --blue-700:  #0f4c9a;
  --blue-500:  #1f8fe5;
  --blue-300:  #7fd1ff;
  --red:       #d9412f;
  --red-dark:  #b82f1f;
  --orange:    #f5a21d;
  --orange-light: #ffb740;
  --yellow:    #fcc419;
  --logo-green:#5cb82f;
  --logo-blue: #1fb0e8;
  --hero-bg:   #c6ebfb;
  --ink: #17261f;
  --muted: #5a6b63;
  --line: #d9e6df;
  --bg: #ffffff;
  --radius: 12px;
  --yellow-50: #fff8dc;
  --sky-50:    #edf7fd;
  --charcoal:  #2f3336;
  --stripe: linear-gradient(90deg, #5cb82f 0 25%, #d9412f 25% 50%, #1fb0e8 50% 75%, #f5a21d 75% 100%);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 112px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font-family: var(--font-body); line-height: 1.55;
}
h1, h2, h3 { font-family: var(--font-heading); font-weight: 500; line-height: 1.2; margin: 0 0 .5em; }
a { color: var(--blue-700); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 2000; }
.skip:focus { left: 8px; top: 8px; }

/* Header: solid white so the full-color iSTEM logo reads clearly; four-color stripe underneath */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: #fff;
  border-bottom: 5px solid; border-image: var(--stripe) 1; transition: box-shadow .25s; }
.site-header.scrolled, .site-header.menu-open { box-shadow: 0 4px 18px rgba(0,0,0,.18); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 92px; }
.brand { display: block; line-height: 0; }
.logo { height: 76px; width: auto; display: block; }
.logo-fallback { font: 700 1.3rem var(--font-heading); color: var(--green-900); border: 2px dashed var(--green-600); padding: 6px 12px; border-radius: 6px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.has-menu { position: relative; }
.nav-btn { font: 400 1rem var(--font-ui); text-transform: uppercase; letter-spacing: .04em; color: var(--green-900); background: none; border: 0;
  padding: 10px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; text-decoration: none; }
.nav-btn:hover, .has-menu.open > .nav-btn { background: var(--green-100); }
.nav-btn:focus-visible { outline: 3px solid var(--logo-blue); outline-offset: 1px; }
.nav-cta, .nav-cta:hover { background: var(--red); color: #fff; margin-left: 8px; padding: 10px 20px; text-transform: none; }
.nav-cta:hover { background: var(--red-dark); }
.chev { width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.has-menu.open > .nav-btn .chev { transform: rotate(-135deg) translateY(-2px); }
.nav .menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; background: #fff; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.28); border: 1px solid var(--line); padding: 8px; flex-direction: column; align-items: stretch; gap: 0; z-index: 1100; }
.nav .menu-right { left: auto; right: 0; }
.nav .has-menu.open > .menu { display: flex; }
.nav .menu a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--green-900); text-decoration: none; font: 600 .92rem var(--font-body); }
.nav .menu a:hover, .nav .menu a:focus-visible { background: #fff1d6; color: var(--red-dark); outline: none; }
.menu-toggle { display: none; font: 400 1rem var(--font-ui); text-transform: uppercase; letter-spacing: .04em; color: var(--green-900);
  background: #fff; border: 1.5px solid var(--green-700); border-radius: 6px; padding: 8px 14px; cursor: pointer; }

/* Buttons */
.btn { display: inline-block; background: var(--orange); color: #1c1c1c; border: 1.5px solid var(--orange);
  padding: 11px 24px; border-radius: 6px; font: 400 1.05rem var(--font-ui); letter-spacing: .02em; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--orange-light); border-color: var(--orange-light); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--green-900); border-color: var(--green-900); }
.btn-ghost:hover { background: var(--green-900); color: #fff; border-color: var(--green-900); }

/* Hero: floating-icon GIF on a deep blue-green background */
.hero { position: relative; min-height: 640px; display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--ink); background: var(--hero-bg); overflow: hidden; padding: 137px 0 157px; }
.hero-media, .hero-media picture, .hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-media img { object-fit: cover; object-position: center; }
.hero-copy { position: relative; max-width: 980px; }
.hero h1 { font-family: var(--font-hero); font-weight: 400; font-size: clamp(2.2rem, 4.1vw, 3.5rem); line-height: 1.14; letter-spacing: .015em;
  color: var(--green-900); margin-bottom: .4em; }
.lead { font-style: italic; font-size: 1.15rem; max-width: 620px; margin: 0 auto; color: var(--green-900); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

/* Panel overlapping the hero (like their feature panel) */
.panel-wrap { position: relative; z-index: 2; margin-top: -90px; }
.panel { margin: 0; background: #dde5e2; border-radius: 16px; padding: 22px; box-shadow: 0 10px 30px rgba(6,28,22,.25); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stats div { background: #fff; border-radius: 10px; padding: 18px 20px; box-shadow: 0 2px 8px rgba(0,0,0,.12); border-top: 5px solid var(--logo-green); }
.stats div:nth-child(2) { border-top-color: var(--red); }
.stats div:nth-child(3) { border-top-color: var(--logo-blue); }
.stats div:nth-child(4) { border-top-color: var(--orange); }
.stats dt { font: 400 .9rem var(--font-ui); text-transform: uppercase; letter-spacing: .05em; color: var(--blue-700); }
.stats dd { margin: 4px 0 0; font: 500 2.4rem var(--font-heading); color: var(--green-900); line-height: 1.1; }

/* Sections */
.section { padding: 56px 0; }
.section-tint { background: #ffffff; }
.section-title { font-size: 1.7rem; color: var(--green-900); margin-bottom: 22px; }
.section-title::after { content: ""; display: block; width: 84px; height: 5px; margin-top: 10px; border-radius: 3px; background: var(--stripe); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: #fff; }
.step h3 { color: var(--green-800); font-size: 1.1rem; }
.step p { margin: 0; color: var(--muted); }
.step:nth-child(1) .num { background: #dff1d3; color: #2f7d1a; }
.step:nth-child(2) .num { background: #fbdcd6; color: var(--red-dark); }
.step:nth-child(3) .num { background: #ffe9c2; color: #9a5b00; }
.num { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--green-100); color: var(--green-800); font-weight: 700; margin-bottom: 10px; }

/* Map tool */
.tool { display: grid; grid-template-columns: 410px 1fr; height: 760px; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: 0 6px 24px rgba(11,61,46,.08); }
#sidebar { position: relative; overflow-y: auto; padding: 16px; border-right: 1px solid var(--line); }
#sidebar h3 { font-size: 1rem; color: var(--green-900); }
#map-wrap { position: relative; }
#map { position: absolute; inset: 0; background: #eaf3f8; }

#filters label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
select, input, textarea { font: inherit; color: var(--ink); }
#filters select, #filters input {
  display: block; width: 100%; margin-top: 2px; padding: 7px 9px; font-size: .9rem;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
button#reset { padding: 7px 16px; font: 400 .95rem var(--font-ui); border: 1.5px solid var(--blue-700); background: #fff;
  color: var(--blue-700); border-radius: 6px; cursor: pointer; }
button#reset:hover { background: var(--blue-700); color: #fff; }
.hint { font-size: .75rem; color: var(--muted); margin: 0 0 10px; }

.card { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; margin-bottom: 10px; cursor: pointer; }
.card:hover, .card.active { border-color: #8fcdf0; background: #e3f3fc; }
.card h3 { margin: 0 0 4px; font-size: .95rem; }
.badges { margin-bottom: 6px; }
.badge { display: inline-block; font-size: .68rem; padding: 1px 8px; margin: 0 4px 3px 0; border-radius: 999px; background: #eef2f0; color: var(--muted); }
.badge.free { background: #d9f2e3; color: #11663f; }
.badge.paid { background: #dcecfb; color: #0f4c9a; }
.badge.mixed { background: #ffe9c2; color: #8a5200; }
.card dl { margin: 0; font-size: .8rem; }
.card dt { font-weight: 700; margin-top: 5px; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.card dd { margin: 0; }
.card .desc { font-size: .82rem; margin: 6px 0 0; }
.card .note { font-size: .75rem; color: #7a5a00; margin-top: 6px; }
.card a { word-break: break-all; }

.legend { background: #fff; padding: 8px 10px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.3); font-size: .75rem; line-height: 1.5; }
.legend i { display: inline-block; width: 16px; height: 12px; margin-right: 6px; vertical-align: -1px; border: 1px solid #0002; }
.info { background: rgba(255,255,255,.96); padding: 6px 10px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.3); font-size: .8rem; min-width: 140px; }
.popup h4 { margin: 0 0 4px; }

/* Bottom: left info, application at the bottom right */
.bottom { background: var(--sky-50); }
.bottom-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 40px; align-items: start; }
.bottom-left { position: sticky; top: 100px; }
.checks { list-style: none; padding: 0; margin: 0 0 16px; }
.checks li { position: relative; padding: 0 0 12px 32px; }
.checks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--green-600); }
.checks li:nth-child(2)::before { background: var(--red); }
.checks li:nth-child(3)::before { background: var(--orange); }
.checks li::after { content: ""; position: absolute; left: 7px; top: 7px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(40deg); }
.fine { font-size: .82rem; color: var(--muted); }

.apply { position: relative; overflow: hidden; background: #fff; color: var(--ink); border: 1px solid #d3e4ee; border-radius: var(--radius); padding: 28px; box-shadow: 0 10px 30px rgba(30,60,90,.14); }
.apply h2 { font-size: 1.5rem; margin-bottom: 6px; color: #000; }
.apply-intro { margin: 0 0 18px; opacity: .9; font-size: .92rem; }
.apply label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 12px; }
.apply input:not([type=checkbox]), .apply select, .apply textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px; font-size: .92rem;
  border: 1px solid #b4d8ee; border-radius: 8px; background: #dff1fb;
}
.apply input:focus, .apply select:focus, .apply textarea:focus, #filters select:focus, #filters input:focus {
  outline: 3px solid var(--blue-300); outline-offset: 1px;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 1.5px solid #8fd05f; border-radius: 10px; margin: 0 0 14px; padding: 10px 12px 6px; }
fieldset:nth-of-type(2) { border-color: #5cc8f5; }
fieldset:nth-of-type(3) { border-color: #ffb74d; }
fieldset:nth-of-type(4) { border-color: #ff8a78; }
legend { font-size: .8rem; font-weight: 700; padding: 0 6px; color: #3f9a1f; }
fieldset:nth-of-type(2) legend { color: #1479c9; }
fieldset:nth-of-type(3) legend { color: #c97a00; }
fieldset:nth-of-type(4) legend { color: #d9412f; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; }
.apply label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin-bottom: 6px; }
.apply label.check input { margin-top: 3px; }
.inline-label { margin-top: 8px; }
.consent { margin: 4px 0 10px; }
.err { display: block; color: #c0392b; font-size: .76rem; min-height: 0; margin-top: 3px; }
.err:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.apply .btn { width: 100%; margin-top: 4px; font-size: 1.05rem; }
.apply .btn:hover { background: var(--orange-light); border-color: var(--orange-light); }
.status { margin: 12px 0 0; font-weight: 600; }
.status.ok { color: #1e7a3a; }
.status.bad { color: #c0392b; }

.site-footer { background: var(--charcoal); color: #fff; padding: 28px 0; border-top: 6px solid; border-image: var(--stripe) 1; }
.site-footer p { margin: 0 0 6px; }
.site-footer .fine { color: #ffffffb3; }
.site-footer { font-family: var(--font-body); }

@media (max-width: 960px) {
  .bottom-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .logo { height: 60px; }
  .menu-toggle { display: inline-block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line);
    padding: 8px 20px 18px; max-height: calc(100vh - 100px); overflow-y: auto; box-shadow: 0 12px 24px rgba(0,0,0,.18); }
  .site-header.menu-open .nav { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-btn { width: 100%; justify-content: space-between; padding: 14px 8px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-cta, .nav-cta:hover { margin: 12px 0 0; justify-content: center; border-radius: 6px; border-bottom: 0; }
  .nav .menu { position: static; box-shadow: none; border: 0; background: var(--green-50); margin: 4px 0 8px; }
  .hero { min-height: 560px; }
  .bottom-left { position: static; }
  .steps { grid-template-columns: 1fr; }
  .tool { grid-template-columns: 1fr; height: auto; }
  #map-wrap { height: 440px; order: -1; }
  #sidebar { max-height: 620px; border-right: 0; border-top: 1px solid var(--line); }

}
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } .row2 { grid-template-columns: 1fr; } .section { padding: 40px 0; } }

@media (max-width: 700px) {
  .header-inner { min-height: 80px; }
  .logo { height: 54px; }
  .hero { padding-top: 232px; padding-bottom: 150px; min-height: 0; }
  .hero-media { inset: auto; top: 86px; left: 0; right: 0; height: auto; }
  .hero-media picture { position: static; display: block; }
  .hero-media img { position: static; width: 100%; height: auto; object-fit: initial; }
}

/* Headings set in Impact (falls back to Anton where Impact is not installed) */
#map-tool .section-title, #why { font-family: var(--font-hero); font-weight: 400; font-size: 2rem; letter-spacing: .015em; }
#why { text-transform: uppercase; letter-spacing: .03em; }
#why::after { display: none; }

#map-tool .section-title, .hero .btn { text-transform: uppercase; }
@media (max-width: 700px) { .hero h1 br.brd { display: none; } }

.hero h1 .h1-logo { height: 1.15em; width: auto; vertical-align: -.22em; margin-left: .1em; }
