/* Self-hosted fonts (no external CDN). Loaded site-wide via this stylesheet,
   which every content page links. font-display:swap avoids invisible text. */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/space-grotesk-400.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/space-grotesk-500.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/space-grotesk-600.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/space-grotesk-700.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/inter-600.woff2") format("woff2"); }

:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --line: #d9e1ed;
  --line-strong: #b5c1d3;
  --text: #0f172a;
  --muted: #475569;
  --accent: #159389;
  --accent-soft: #d7efee;
  --shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 28px 60px rgba(15, 23, 42, 0.12);
  --nav-bg: rgba(255, 255, 255, 0.8);
}

* {
  box-sizing: border-box;
}

/* Visually hidden but available to screen readers (for heading structure,
   labels, etc.). Standard clip pattern. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Skip link: hidden until focused by keyboard, then pinned top-left. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent, #159389);
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

#main:focus {
  outline: none;
}

body.h2res-shell {
  margin: 0;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 460px at 8% -10%, #d8f0ec 0%, transparent 60%),
    radial-gradient(900px 420px at 92% -16%, #dfeafb 0%, transparent 55%),
    var(--bg);
}

body.h2res-shell.mobile-nav-open {
  overflow: hidden;
}

.h2res-shell .container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.h2res-shell .page-shell {
  padding: 110px 0 48px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 0 0;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.site-header.scrolled {
  border-bottom-color: rgba(148, 163, 184, 0.24);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.site-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-nav-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 14px;
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.site-header.scrolled .site-nav-pill {
  border-bottom-color: rgba(148, 163, 184, 0.34);
}

.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex: 0 0 auto;
}

.site-logo img {
  height: 34px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  position: relative;
  padding: 10px 0;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--accent);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.85;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s ease;
}

.site-nav a:hover::after,
.site-nav a.active::after {
  transform: scaleX(1);
}

.site-nav a.has-arrow {
  padding-right: 16px;
}

.site-nav a.has-arrow::before {
  content: "↗";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-52%);
  font-size: 12px;
  line-height: 1;
  opacity: 0.85;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* Social icon group (GitHub / LinkedIn / X). Hidden on small phones, where
   the footer carries the same links, to keep the header bar uncrowded. */
.site-social {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 640px) {
  .site-social {
    display: none;
  }
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover {
  border-color: rgba(21, 147, 137, 0.26);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.icon-btn:focus-visible,
.site-nav a:focus-visible,
.mobile-nav-links a:focus-visible,
.btn:focus-visible {
  outline: 3px solid rgba(21, 147, 137, 0.24);
  outline-offset: 3px;
}

.mobile-menu-btn {
  display: none;
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.mobile-nav.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(360px, 100%);
  background: #ffffff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: -20px 0 50px rgba(15, 23, 42, 0.16);
  transform: translateX(18px);
  transition: transform 0.2s ease;
}

.mobile-nav.open .mobile-nav-panel {
  transform: translateX(0);
}

.mobile-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mobile-nav-links a {
  text-decoration: none;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.mobile-nav-links a:hover {
  color: var(--accent);
}

.crumb {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 18px;
}

.crumb a {
  color: inherit;
  text-decoration: none;
}

.page-hero,
.page-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.94));
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.page-hero {
  box-shadow: var(--shadow-strong);
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.page-title {
  margin: 0 0 10px;
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 920px;
  font-size: 18px;
  line-height: 1.72;
}

.callout-box {
  margin-top: 24px;
  padding: 22px 24px;
  border-radius: 20px;
  background: #f0fdfa;
  border: 1px solid rgba(21, 147, 137, 0.18);
  color: var(--text);
  font-size: 17px;
  line-height: 1.7;
}

.page-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid var(--accent);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
}

.page-section-title {
  margin: 0 0 14px;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.site-footer {
  background: #ffffff;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  padding: 28px 0 24px;
}

.site-footer-card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.site-footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 28px;
}

.site-footer-brand .site-logo img {
  height: 130px;
}

.site-footer-brand p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
  max-width: 420px;
}

.site-footer-links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.site-footer-links-group h2 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
}

.site-footer-links-group a {
  display: block;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 10px;
  font-size: 14px;
}

.site-footer-links-group a:hover {
  color: var(--accent);
}

.site-footer-divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0 18px;
}

.site-footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  .site-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .page-title {
    font-size: 34px;
  }

  .site-footer-main,
  .site-footer-links-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .page-shell {
    padding-top: 98px;
  }

  .page-hero,
  .page-card {
    padding: 22px;
  }

  .page-title {
    font-size: 28px;
  }

  .page-subtitle,
  .callout-box {
    font-size: 16px;
  }

  .site-nav-pill {
    padding-bottom: 12px;
  }

  .site-logo img {
    height: 32px;
  }

  .site-footer-brand .site-logo img {
    height: 80px;
  }

  .site-footer-card {
    padding: 22px;
  }
}

/* ============================================================
   Inline SVG logo — ink follows the theme, brand accents fixed
   ============================================================ */
:root { --logo-ink: #4C4C4C; }
[data-theme="dark"] { --logo-ink: #E8EDEF; }

.site-logo svg,
.site-logo-svg {
  width: auto;
  display: block;
}
.site-logo .site-logo-mark { height: 40px; }  /* header + mobile: H2RES + road, no tagline */
.site-logo .site-logo-full { height: 34px; }  /* full lockup with tagline */
.site-logo-svg .st0,
.site-logo-svg .st3 { fill: var(--logo-ink); transition: fill 0.2s ease; }
.site-logo-svg .st1 { fill: #99C443; }  /* brand green */
.site-logo-svg .st2 { fill: #40B59D; }  /* brand teal  */

.site-footer-brand .site-logo svg { height: 130px; }

@media (max-width: 620px) {
  .site-logo .site-logo-mark { height: 34px; }
  .site-footer-brand .site-logo svg { height: 80px; }
}

/* ============================================================
   Dark theme — shell chrome (header, nav, footer, cards)
   Applies only when <html data-theme="dark"> is set (home page).
   ============================================================ */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1417;
  --card: #171F23;
  --line: #26323A;
  --line-strong: #33424B;
  --text: #E8EDEF;
  --muted: #A6B6BC;
  --accent: #40B59D;
  --accent-soft: rgba(64, 181, 157, 0.16);
  --shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
  --shadow-strong: 0 28px 60px rgba(0, 0, 0, 0.55);
  --nav-bg: rgba(14, 20, 23, 0.8);
}
[data-theme="light"] { color-scheme: light; }

[data-theme="dark"] body.h2res-shell {
  background:
    radial-gradient(1200px 460px at 8% -10%, rgba(64, 181, 157, 0.10) 0%, transparent 60%),
    radial-gradient(900px 420px at 92% -16%, rgba(79, 131, 191, 0.10) 0%, transparent 55%),
    var(--bg);
}
[data-theme="dark"] .site-header {
  background: rgba(14, 20, 23, 0.90);
  border-bottom-color: rgba(148, 163, 184, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.40);
}
[data-theme="dark"] .site-header.scrolled { border-bottom-color: rgba(148, 163, 184, 0.24); }
[data-theme="dark"] .site-nav-pill { border-bottom-color: rgba(148, 163, 184, 0.18); }
[data-theme="dark"] .site-header.scrolled .site-nav-pill { border-bottom-color: rgba(148, 163, 184, 0.28); }
[data-theme="dark"] .icon-btn {
  background: #171F23;
  border-color: rgba(148, 163, 184, 0.18);
  color: var(--text);
}
[data-theme="dark"] .icon-btn:hover {
  background: #1E282D;
  border-color: rgba(64, 181, 157, 0.40);
  color: var(--accent);
}
[data-theme="dark"] .mobile-nav { background: rgba(0, 0, 0, 0.60); }
[data-theme="dark"] .mobile-nav-panel {
  background: #12181B;
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.50);
}
[data-theme="dark"] .site-footer {
  background: #0E1417;
  border-top-color: rgba(148, 163, 184, 0.12);
}
[data-theme="dark"] .site-footer-links-group h2 { color: #8A99A0; }
[data-theme="dark"] .page-hero,
[data-theme="dark"] .page-card {
  background: linear-gradient(145deg, #171F23, #131A1E);
  border-color: var(--line);
}
[data-theme="dark"] .callout-box {
  background: rgba(64, 181, 157, 0.10);
  border-color: rgba(64, 181, 157, 0.22);
}
[data-theme="dark"] .btn-primary { background: var(--accent); color: #08211D; }

/* Theme toggle button — moon icon in light mode, sun icon in dark mode */
.theme-toggle .theme-icon-sun { display: none; }
.theme-toggle .theme-icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }

/* Back-to-top: floating control injected on every page by site-shell.js.
   Hidden until scrolled down; fades in/out and respects reduced motion. */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.2s ease, color 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: opacity 0.15s ease;
    transform: none;
  }
  .back-to-top.is-visible {
    transform: none;
  }
}

@media (max-width: 640px) {
  .back-to-top {
    right: 16px;
    bottom: 16px;
  }
}

/* AA-contrast section badge in light mode; dark keeps the lighter accent. */
.section-badge { color: #0c7a6f; }
.section-badge::before { background: #0c7a6f; }
[data-theme="dark"] .section-badge { color: var(--accent); }
[data-theme="dark"] .section-badge::before { background: var(--accent); }
