:root {
  --ink: #f4f5f5;
  --muted: #aeb5ba;
  --gunmetal-950: #101315;
  --gunmetal-900: #171b1e;
  --gunmetal-800: #20262a;
  --gunmetal-700: #30373c;
  --orange: #f57921;
  --orange-dark: #bd4d0a;
  --line: rgba(255, 255, 255, .12);
  --max: 1180px;
  --shadow: 0 22px 55px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--gunmetal-950); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 1rem; line-height: 1.7; }
body::before { position: fixed; inset: 0; z-index: -1; content: ""; pointer-events: none; opacity: .32; background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, black, transparent 78%); }
a { color: var(--orange); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: #ffa25c; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
.skip-link { position: fixed; z-index: 100; top: .75rem; left: .75rem; padding: .6rem 1rem; color: #111; background: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.site-header { position: relative; z-index: 20; background: rgba(16, 19, 21, .97); border-bottom: 1px solid var(--line); }
.topbar { display: flex; justify-content: space-between; width: min(calc(100% - 2rem), var(--max)); margin: auto; padding: .45rem 0; color: #8f989e; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,.07); }
.topbar a { color: #cbd0d3; text-decoration: none; }
.brand-row { position: relative; display: flex; align-items: center; justify-content: center; min-height: 250px; padding: 1.15rem max(1rem, calc((100% - var(--max)) / 2)); isolation: isolate; overflow: hidden; background: #111518; border-top: 1px solid rgba(255,255,255,.06); }
.brand-row::before { position: absolute; z-index: -2; inset: 0; content: ""; background: url('../img/waterloo-header-range.jpg') center 48% / cover no-repeat; filter: saturate(.72) contrast(1.08) brightness(.64); transform: scale(1.02); }
.brand-row::after { position: absolute; z-index: -1; inset: 0; content: ""; pointer-events: none; background: radial-gradient(circle at center, rgba(7,9,10,.12) 0, rgba(7,9,10,.32) 48%, rgba(7,9,10,.78) 100%), linear-gradient(180deg, rgba(9,11,12,.2), rgba(9,11,12,.55)); }
.brand { display: block; }
.brand img { width: 245px; max-height: 210px; object-fit: contain; filter: drop-shadow(0 5px 13px rgba(0,0,0,.86)) drop-shadow(0 0 10px rgba(245,121,33,.23)); }
.nav-toggle { position: relative; z-index: 2; display: none; padding: .65rem; color: white; background: rgba(12,15,16,.78); border: 1px solid rgba(255,255,255,.24); border-radius: .35rem; backdrop-filter: blur(5px); }
.nav-toggle span:not(.sr-only) { display: block; width: 24px; height: 2px; margin: 4px; background: currentColor; }
.main-nav { border-top: 1px solid var(--line); background: #14181b; }
.main-nav > ul { display: flex; justify-content: center; width: min(calc(100% - 2rem), var(--max)); margin: 0 auto; padding: 0; list-style: none; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: .95rem 1rem; color: #d4d8da; font-size: .84rem; font-weight: 800; letter-spacing: .075em; text-decoration: none; text-transform: uppercase; border-bottom: 3px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: white; border-color: var(--orange); background: rgba(255,255,255,.035); }
.submenu { position: absolute; z-index: 30; top: 100%; left: 0; display: none; min-width: 240px; margin: 0; padding: .4rem; list-style: none; background: #202529; border: 1px solid var(--line); box-shadow: var(--shadow); }
.has-submenu:hover .submenu, .has-submenu:focus-within .submenu { display: block; }
.submenu a { padding: .7rem .8rem; text-transform: none; letter-spacing: .02em; }

.page-hero { position: relative; min-height: 290px; display: grid; place-items: end center; isolation: isolate; overflow: hidden; background: #242a2e; }
.page-hero::before { position: absolute; z-index: -2; inset: 0; content: ""; background: var(--hero-image) center 52% / cover no-repeat; filter: saturate(.25) contrast(1.18); transform: scale(1.03); }
.page-hero::after { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(90deg, rgba(10,12,13,.94), rgba(20,24,26,.57) 52%, rgba(10,12,13,.84)), linear-gradient(0deg, #101315 0, transparent 45%); }
.hero-inner { width: min(calc(100% - 2rem), var(--max)); padding: 4.5rem 0 2.6rem; }
.eyebrow, .kicker { margin: 0 0 .45rem; color: var(--orange); font-size: .76rem; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.12; text-wrap: balance; }
h1 { max-width: 850px; margin: 0; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: clamp(2.7rem, 7vw, 5.8rem); font-weight: 500; letter-spacing: .025em; text-transform: uppercase; }
h2 { font-size: clamp(1.7rem, 4vw, 3rem); }
h3 { font-size: 1.25rem; }

.site-main { width: min(calc(100% - 2rem), var(--max)); margin: 0 auto; padding: 4rem 0 6rem; }
.content-card { padding: clamp(1.35rem, 4vw, 3.3rem); background: linear-gradient(145deg, #22282c, #191d20); border: 1px solid var(--line); border-top: 3px solid var(--orange); box-shadow: var(--shadow); }
.page-content { max-width: 980px; margin: 0 auto; }
.rich-content { color: #d5d9db; }
.rich-content > :first-child { margin-top: 0; }
.rich-content > :last-child { margin-bottom: 0; }
.rich-content strong { color: white; }
.rich-content h2, .rich-content h3 { margin-top: 2rem; color: white; }
.rich-content ul, .rich-content ol { padding-left: 1.3rem; }
.rich-content li { margin: .42rem 0; }
.rich-content li::marker { color: var(--orange); }
.rich-content table { width: 100% !important; max-width: 100%; border-collapse: collapse; table-layout: auto; }
.rich-content td, .rich-content th { padding: .65rem .8rem; overflow-wrap: anywhere; border: 1px solid var(--line); }
.rich-content img { height: auto; border: 1px solid var(--line); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .75rem 1.2rem; color: #17191a; font-weight: 900; letter-spacing: .04em; text-decoration: none; text-transform: uppercase; background: var(--orange); border: 0; border-radius: .18rem; cursor: pointer; box-shadow: 0 8px 22px rgba(245,121,33,.18); }
.button:hover { color: #111; background: #ff9347; transform: translateY(-1px); }
.button-light { color: #151719; background: white; }
.text-link { font-weight: 800; text-decoration: none; }
.actions { display: flex; align-items: center; gap: 1.5rem; margin-top: 2rem; }

.home-intro { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(220px, .65fr); gap: 3.4rem; align-items: start; margin-top: -5.8rem; position: relative; z-index: 2; }
.fact-panel { display: grid; gap: .2rem; padding: 1.8rem; background: #111416; border-left: 4px solid var(--orange); }
.fact-panel span { color: var(--muted); }
.fact-panel strong { margin-top: .6rem; color: white; font-size: 1.12rem; }
.fact-panel .fact-number { color: white; font: 500 clamp(3.5rem, 8vw, 5.5rem)/1 Impact, sans-serif; letter-spacing: .02em; }
.fact-panel hr { width: 100%; margin: 1.1rem 0; border: 0; border-top: 1px solid var(--line); }
.discipline-section { padding: 5rem 0 1rem; }
.section-heading { max-width: 760px; margin-bottom: 2rem; }
.section-heading h2 { margin: 0; }
.section-heading.compact { margin-bottom: 2.5rem; }
.discipline-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.discipline-grid article { position: relative; min-height: 380px; overflow: hidden; background: #22272a; border: 1px solid var(--line); }
.discipline-grid img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.13) brightness(.72); transition: .35s ease; }
.discipline-grid article:hover img { transform: scale(1.035); filter: grayscale(.5) contrast(1.12) brightness(.78); }
.discipline-grid article > div { position: absolute; inset: auto 0 0; padding: 5rem 1.5rem 1.5rem; background: linear-gradient(transparent, rgba(8,10,11,.97)); }
.discipline-grid article span { color: var(--orange); font-weight: 900; }
.discipline-grid article h3 { margin: .25rem 0; font-size: 1.45rem; text-transform: uppercase; }
.discipline-grid article p { margin: 0; color: #bcc2c6; }
.safety-band { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-top: 4rem; padding: 2.3rem 2.6rem; background: var(--orange); color: #151719; }
.safety-band .kicker { color: #4c2107; }
.safety-band h2 { max-width: 730px; margin: 0; }

.contact-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 1.2rem; align-items: start; }
.contact-layout h2 { margin-top: .25rem; }
.contact-details { display: grid; grid-template-columns: 100px 1fr; margin-top: 2rem; }
.contact-details dt, .contact-details dd { padding: .65rem 0; border-top: 1px solid var(--line); }
.contact-details dt { color: var(--muted); }
.contact-details dd { margin: 0; }
.form-card form { display: grid; gap: 1rem; }
.form-card label { display: grid; gap: .35rem; color: #e5e7e8; font-weight: 700; }
.form-card label span { color: var(--orange); }
input, textarea, select { width: 100%; padding: .75rem .85rem; color: white; background: #111416; border: 1px solid #3c4449; border-radius: .2rem; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(245,121,33,.25); border-color: var(--orange); }
.honey { position: absolute; left: -10000px; }
.notice { margin-bottom: 1rem; padding: .8rem 1rem; border-left: 4px solid; }
.notice.success { color: #c9f7d7; background: #163421; border-color: #4dd77a; }
.notice.error { color: #ffd3d3; background: #431b1b; border-color: #f66; }
.news-list { display: grid; gap: 1rem; }
.news-list article { padding: 1.5rem; background: #131719; border: 1px solid var(--line); }
.news-list time { color: var(--orange); font-size: .8rem; font-weight: 800; }
.news-list h3 { margin: .25rem 0 .8rem; }
.error-card { max-width: 740px; margin: auto; text-align: center; }

.site-footer { position: relative; isolation: isolate; overflow: hidden; color: #fff; background: radial-gradient(circle at 12% 0, rgba(203,76,10,.24), transparent 38%), linear-gradient(135deg, #252b2f 0%, #171b1e 48%, #0e1113 100%); border-top: 4px solid #c95712; }
.site-footer::before { position: absolute; z-index: -1; inset: 0 0 auto; height: 100%; content: ""; opacity: .07; background-image: linear-gradient(120deg, transparent 0 46%, #ef741d 46% 47%, transparent 47% 100%); background-size: 120px 100%; }
.footer-grid { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 1rem; width: min(calc(100% - 2rem), var(--max)); margin: auto; padding: 3.5rem 0; }
.footer-grid section { padding: 1.35rem; background: rgba(0,0,0,.16); border: 1px solid rgba(255,255,255,.09); border-top: 2px solid rgba(220,91,15,.68); backdrop-filter: blur(2px); }
.footer-grid h2 { margin: 0 0 .85rem; color: #fff; font-size: .88rem; letter-spacing: .13em; text-transform: uppercase; }
.footer-grid p, .footer-grid address { margin: 0; color: #f0f2f3; font-style: normal; }
.footer-grid a { color: #fff; font-weight: 800; text-decoration-color: rgba(239,116,29,.78); }
.footer-grid a:hover { color: #ffad73; }
.footer-bottom { display: flex; gap: 1.4rem; width: 100%; margin: auto; padding: 1.15rem max(1rem, calc((100% - var(--max)) / 2)); color: #e7e9ea; font-size: .82rem; background: rgba(7,9,10,.72); border-top: 1px solid rgba(255,255,255,.1); }
.footer-bottom span { margin-right: auto; }
.footer-bottom a { color: #fff; }

@media (max-width: 860px) {
  .brand-row { justify-content: space-between; min-height: 190px; padding: .9rem 1rem; }
  .brand img { width: 180px; max-height: 160px; }
  .nav-toggle { display: block; }
  .main-nav { display: none; }
  .main-nav.open { display: block; }
  .main-nav > ul { display: block; padding: .45rem 0; }
  .main-nav a { padding: .8rem 0; }
  .submenu { position: static; display: block; min-width: 0; margin-left: 1rem; box-shadow: none; }
  .page-hero { min-height: 240px; }
  .home-intro, .contact-layout { grid-template-columns: 1fr; gap: 1rem; }
  .discipline-grid { grid-template-columns: 1fr; }
  .discipline-grid article { min-height: 300px; }
  .safety-band { align-items: flex-start; flex-direction: column; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .brand-row { min-height: 165px; }
  .brand img { width: 150px; max-height: 135px; }
  .topbar span { display: none; }
  .topbar { justify-content: flex-end; }
  .site-main { padding-top: 2.5rem; }
  .home-intro { margin-top: -3.5rem; }
  .actions, .footer-bottom { align-items: flex-start; flex-direction: column; }
  .footer-bottom span { margin-right: 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .contact-details { grid-template-columns: 1fr; }
  .contact-details dd { padding-top: 0; border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
