/* EMS shell — homepage styling.
   Placeholder shell for the Traffic MVP. Header/footer take their shape from the live EMS site
   (logo left, quiet nav, deep-green footer with columns and a copyright bar); the greens are the
   simulator's own, so the shell and the tool read as one product rather than two.
   Tokens mirror app.css deliberately — if a third surface appears, lift them into one shared file
   rather than copying them again. Always-light, like the simulator. */

:root {
  color-scheme: light;
  --brand-green: #00b22d;   /* sampled from the EMS logo */
  --green-deep: #0a6b52;    /* simulator's --teal-deep; WCAG-AA with white text */
  --green-darker: #085240;
  --footer-bg: #123a2c;     /* deep green, in the simulator's family rather than the legacy olive */
  --footer-bar: #0d2b21;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --text: #21303b;
  --muted: #5b6670;         /* WCAG-AA on white */
  --line: #e3e8ec;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 35, 63, 0.06), 0 6px 20px rgba(16, 35, 63, 0.05);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;         /* footer sits at the bottom on a short page */
}

main { flex: 1 0 auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Keyboard users must always be able to see where they are (design philosophy §43). */
a:focus-visible, .skip:focus-visible {
  outline: 2px solid var(--green-deep);
  outline-offset: 3px;
  border-radius: 4px;
}
.site-footer a:focus-visible { outline-color: #fff; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--surface); color: var(--green-deep);
  padding: 10px 16px; font-weight: 600;
}
.skip:focus { left: 12px; top: 12px; }

.wrap { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }

/* ---------- header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 84px;
  flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { display: block; height: 46px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 550;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--green-deep); border-bottom-color: var(--brand-green); }

/* ---------- main ---------- */

/* Centred while there is one tool, so the whitespace reads as deliberate rather than as a card
   stranded in the corner. It becomes a real multi-column grid the moment a second card exists. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 560px));
  justify-content: center;
  gap: 22px;
  padding: 72px 0 88px;
}

.tool-card {
  display: block;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-green);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 30px 26px;
  text-decoration: none;
  color: inherit;
  /* Clickable things must look clickable before hover (design philosophy §48). */
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(16, 35, 63, 0.07), 0 10px 28px rgba(16, 35, 63, 0.09);
}
.tool-mark { display: block; margin-bottom: 14px; }
.tool-mark img { display: block; width: 44px; height: 44px; }
.tool-card h2 {
  margin: 0 0 10px;
  font-size: 1.3rem;
  font-weight: 650;
  color: var(--green-deep);
  letter-spacing: -0.005em;
}
.tool-card p { margin: 0; color: var(--muted); font-size: 1rem; }
.tool-card .go {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--green-deep);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}
.tool-card:hover .go { background: var(--green-darker); }

/* ---------- footer ---------- */

.site-footer {
  flex-shrink: 0;
  background: var(--footer-bg);
  color: #fff;
  margin-top: auto;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr;
  gap: 40px;
  padding: 46px 0 38px;
}
.footer-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.16;
  color: #fff;
}
.footer-lockup img { display: block; width: 40px; height: 40px; flex: none; }
.footer-line {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.94rem;
  max-width: 34ch;
}
.footer-col h2 {
  margin: 0 0 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; font-size: 0.94rem; color: rgba(255, 255, 255, 0.86); }
.footer-col a { color: rgba(255, 255, 255, 0.86); text-decoration: none; }
.footer-col a:hover { color: #fff; text-decoration: underline; }

.footer-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--footer-bar);
}
.footer-bar p {
  margin: 0;
  padding: 15px 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.68);
}

@media (prefers-reduced-motion: reduce) {
  .tool-card, .tool-card:hover { transition: none; transform: none; }
}

@media (max-width: 860px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 30px; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { min-height: 0; padding: 16px 0; gap: 12px; }
  .brand img { height: 40px; }
  .site-nav a { font-size: 0.9rem; }
  .grid { padding: 34px 0 48px; }
  .footer-inner { grid-template-columns: 1fr; padding: 34px 0 28px; }
}
