/* Layout: a single long page, left-aligned on a 12-column feel; the group
   diagram is the hero and the company list is the body. */
:root {
  /* Palette taken from ehzee.ca (navy, signal yellow, sky blue on cool paper) */
  --paper: #f3f5f7;
  --surface: #ffffff;
  --ink: #0b2035;
  --muted: #4b5b6c;
  --rule: #cbd3dc;
  --green: #031b33;       /* brand navy (token name kept for the layout rules) */
  --brass: #946a00;       /* yellow, darkened for text on light paper */
  --yellow: #fec10e;      /* signal yellow for fills */
  --sky: #7cbee1;
  --on-green: #ffffff;

  --display: "Raleway", "Helvetica Neue", Arial, sans-serif;
  --body: "Raleway", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --max: 72rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #021226; --surface: #06213d; --ink: #e8eef4; --muted: #a3b3c4;
    --rule: #1e3b58; --green: #7cbee1; --brass: #fec10e; --on-green: #031b33;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #021226; --surface: #06213d; --ink: #e8eef4; --muted: #a3b3c4;
  --rule: #1e3b58; --green: #7cbee1; --brass: #fec10e; --on-green: #031b33;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--body);
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Header */
body::before {
  content: ""; position: fixed; inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper);
}
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .85rem;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none; font: 800 1.05rem/1 var(--display);
  letter-spacing: .02em;
}
.brand-mark {
  width: 1.9rem; height: 1.9rem; display: grid; place-items: center;
  background: var(--yellow); color: #031b33;
  font: 700 .7rem/1 var(--mono); letter-spacing: .04em;
}
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav a {
  text-decoration: none; font-size: .9rem; color: var(--muted);
}
.nav a:hover { color: var(--ink); }

/* Hero: navy band with the building illustration on the right */
.hero {
  background-color: #031b33;
  background-image: linear-gradient(90deg, #031b33 30%, rgba(3,27,51,.55) 55%, rgba(3,27,51,0) 75%), url("images/hero.jpg");
  background-size: cover, auto 100%;
  background-position: center, right center;
  background-repeat: no-repeat;
  color: #ffffff;
}
.hero-inner { padding-block: clamp(3.5rem, 9vw, 7rem); }
.eyebrow {
  font: 600 .75rem/1 var(--mono); text-transform: uppercase;
  letter-spacing: .14em; color: var(--yellow); margin: 0 0 1.25rem;
}
.hero h1 {
  font: 800 clamp(2.4rem, 6vw, 4.4rem)/1.04 var(--display);
  letter-spacing: -.02em; margin: 0; max-width: 14ch; text-wrap: balance;
}
.hero .lede {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: #b7c5d3;
  max-width: 46ch; margin: 1.5rem 0 0;
}
.cta {
  display: inline-block; margin-top: 2rem; padding: .85rem 1.3rem;
  background: var(--yellow); color: #031b33; font-weight: 700; text-decoration: none;
}
.cta:hover { background: #ffd24d; }
@media (max-width: 760px) {
  .hero {
    background-image: linear-gradient(180deg, rgba(3,27,51,.92), rgba(3,27,51,.8)), url("images/hero.jpg");
    background-size: cover, cover;
    background-position: center, 70% center;
  }
}
.structure-band { padding-block: clamp(2rem, 5vw, 3rem) clamp(2.5rem, 6vw, 4rem); }

/* Group structure diagram: parent -> sectors with counts */
.structure-parent {
  display: inline-flex; align-items: baseline; gap: .75rem;
  background: var(--green); color: var(--on-green);
  padding: .8rem 1.1rem; font: 700 1rem/1.2 var(--display);
}
.structure-parent small { font: 400 .75rem/1 var(--mono); opacity: .8; letter-spacing: .06em; }
.structure-tree {
  list-style: none; margin: 0 0 0 1.1rem; padding: .75rem 0 0 1.25rem;
  border-left: 2px solid var(--green);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: .5rem 1.5rem;
}
.structure-sector { min-width: 0; }
.structure-sector a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .55rem 0; border-bottom: 1px solid var(--rule);
  text-decoration: none; font-weight: 600;
}
.structure-sector a:hover .structure-name { color: var(--brass); }
.structure-count { font: 500 .8rem/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }

/* Sections */
.section { padding-block: clamp(3rem, 7vw, 5rem); border-top: 1px solid var(--rule); }
.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: 1rem 2rem; margin-bottom: 2rem;
}
.section h2 {
  font: 800 clamp(1.7rem, 3.5vw, 2.4rem)/1.1 var(--display);
  margin: 0; text-wrap: balance;
}
.section-head p { margin: .5rem 0 0; color: var(--muted); max-width: 52ch; }

/* Sector filter */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters button {
  font: 500 .82rem/1 var(--body); color: var(--ink);
  background: transparent; border: 1px solid var(--rule);
  padding: .55rem .85rem; cursor: pointer;
}
.filters button[aria-pressed="true"] {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.filters .count { font-family: var(--mono); opacity: .7; margin-left: .3rem; font-variant-numeric: tabular-nums; }

/* Company list */
.companies {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  border-top: 1px solid var(--rule); border-left: 1px solid var(--rule);
}
.company {
  display: flex; flex-direction: column; gap: .75rem;
  padding: 1.5rem; min-width: 0;
  background: var(--surface);
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.company-top { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.company .tag {
  font: 500 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--brass);
}
.company .no { font: 400 .75rem/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.company h3 { font: 700 1.3rem/1.2 var(--display); margin: 0; }
.company p { margin: 0; color: var(--muted); flex: 1; }
.company .visit {
  font-weight: 600; font-size: .92rem; color: var(--green);
  text-decoration: none; overflow-wrap: anywhere;
}
.company .visit:hover { text-decoration: underline; }
.company .soon { font-size: .9rem; color: var(--muted); font-style: italic; }

/* About */
.about-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 2rem;
}
.about-grid > div { min-width: 0; }
.about-grid h3 { font: 700 1.1rem/1.3 var(--display); margin: 0 0 .5rem; }
.about-grid p { margin: 0; color: var(--muted); }
.about-intro { font-size: 1.15rem; max-width: 60ch; margin: 0 0 2.5rem; }

/* Contact */
.contact { background: #031b33; color: #ffffff; }
.contact .email { color: var(--yellow); }
.contact .wrap { padding-block: clamp(3rem, 7vw, 5rem); display: grid; gap: 1.5rem; }
.contact h2 { font: 800 clamp(1.7rem, 3.5vw, 2.4rem)/1.1 var(--display); margin: 0; }
.contact p { margin: 0; max-width: 52ch; opacity: .9; }
.contact .email {
  font: 600 clamp(1.2rem, 3vw, 1.6rem)/1.2 var(--mono); overflow-wrap: anywhere;
  user-select: all;
}

/* Footer */
.site-footer { padding-block: 2rem; font-size: .85rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

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

/* Graphics */
.company { padding: 0; }
.company-art { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; max-width: 100%; background: #031b33; }
.company-body { display: flex; flex-direction: column; gap: .75rem; padding: 1.5rem; flex: 1; }

.hero h1 .hl { color: var(--yellow); }

/* Featured cards */
.company .tag { display: block; }
.company-links { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }

/* Directory */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dir-tools { display: grid; gap: 1rem; margin-bottom: 2rem; }
.search input {
  width: 100%; max-width: 32rem; font: 500 1rem/1.2 var(--body); color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule); padding: .8rem 1rem;
}
.search input:focus { outline: 2px solid var(--yellow); outline-offset: 1px; }
.dir-group { padding-block: 1.5rem; border-top: 1px solid var(--rule); }
.dir-head {
  display: flex; align-items: baseline; gap: .75rem;
  font: 700 1.15rem/1.2 var(--display); margin: 0 0 1rem;
}
.dir-count { font: 500 .78rem/1 var(--mono); color: var(--muted); }
.dir-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1.25rem 2rem;
}
.dir-item { min-width: 0; display: grid; gap: .25rem; align-content: start; }
.dir-item h4 { font: 700 1rem/1.3 var(--display); margin: 0; }
.dir-item p { margin: 0; font-size: .92rem; color: var(--muted); }
.dir-links { display: flex; flex-wrap: wrap; gap: .1rem .9rem; }
.dir-link { font-size: .88rem; font-weight: 600; color: var(--green); text-decoration: none; overflow-wrap: anywhere; }
.dir-link:hover { text-decoration: underline; }
.dir-item .soon { font-size: .85rem; color: var(--muted); font-style: italic; }
.dir-empty { color: var(--muted); padding-block: 1rem; }
