/* AITCOH™ Organizational Chart Theme */
:root {
  --trust-blue: #255ea0;
  --trust-blue-dark: #1b477e;
  --trust-blue-deep: #14345e;
  --trust-blue-light: #d9ecff;
  --radiant-gold: #fdd841;
  --radiant-gold-dark: #d7ad15;
  --charcoal: #333333;
  --cream-white: #fffce5;
  --paper: #fffdf0;
  --white: #ffffff;
  --line: rgba(37, 94, 160, 0.22);
  --line-strong: rgba(37, 94, 160, 0.42);
  --shadow: 0 22px 70px rgba(20, 52, 94, 0.16);
  --shadow-soft: 0 12px 35px rgba(20, 52, 94, 0.10);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max: 1240px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--charcoal);
  background:
    radial-gradient(circle at 12% 6%, rgba(253, 216, 65, 0.24), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(37, 94, 160, 0.20), transparent 28%),
    linear-gradient(135deg, var(--trust-blue-light) 0%, var(--cream-white) 46%, #f7fbff 100%);
  background-attachment: fixed;
  line-height: 1.55;
}

body.modal-open { overflow: hidden; }

a { color: var(--radiant-gold-dark); }

button, input { font: inherit; }

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--white);
  background: var(--trust-blue-deep);
  text-decoration: none;
}

.skip-link:focus { top: 12px; }

.site-header {
  position: relative;
  overflow: hidden;
  color: var(--cream-white);
  background: linear-gradient(135deg, var(--trust-blue) 0%, var(--trust-blue-dark) 62%, var(--trust-blue-deep) 100%);
  padding: 46px 0 58px;
  box-shadow: 0 10px 35px rgba(20, 52, 94, 0.25);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.12), transparent 35%),
    radial-gradient(circle at 80% 20%, rgba(253, 216, 65, 0.25), transparent 28%);
  pointer-events: none;
}

.header-grid {
  position: relative;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 38px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  min-height: 152px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.brand-mark img { width: 100%; max-width: 180px; height: auto; display: block; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--radiant-gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow.dark { color: var(--trust-blue); }

h1, h2, h3, h4 {
  margin: 0;
  font-family: Montserrat, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.08;
  color: var(--trust-blue-dark);
}

.site-header h1 {
  color: var(--cream-white);
  font-size: clamp(1.8rem, 3.5vw, 3.25rem);
  letter-spacing: -0.04em;
}

.lede {
  max-width: 850px;
  margin: 20px 0 0;
  color: rgba(255, 252, 229, 0.90);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
}

main { padding: 34px 0 0; }

.glass-card {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel { margin: -74px 0 28px; position: relative; z-index: 2; }

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 30px;
  align-items: center;
  padding: clamp(24px, 4vw, 42px);
}

.hero-card h2 { font-size: clamp(1.75rem, 3vw, 3.1rem); letter-spacing: -0.04em; }
.hero-card p { margin: 16px 0 0; font-size: 1.05rem; }

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric {
  display: grid;
  align-content: center;
  min-height: 118px;
  padding: 20px 14px;
  border: 1px solid rgba(37, 94, 160, 0.18);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(217, 236, 255, 0.76), rgba(255, 252, 229, 0.76));
  text-align: center;
}

.metric strong {
  display: block;
  color: var(--trust-blue-dark);
  font-family: Montserrat, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 2.2rem;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 8px;
  color: rgba(51, 51, 51, 0.78);
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.controls-section { margin: 24px 0 40px; }
.controls-card { display: grid; grid-template-columns: minmax(280px, 1fr) auto; gap: 22px; align-items: end; padding: 22px; }
.search-wrap label { display: block; margin: 0 0 8px; font-weight: 800; color: var(--trust-blue-dark); }
.search-wrap input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--charcoal);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.search-wrap input:focus { border-color: var(--trust-blue); box-shadow: 0 0 0 4px rgba(37, 94, 160, 0.13); }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 4px solid rgba(253, 216, 65, 0.7); outline-offset: 2px; }
.btn-primary { color: var(--cream-white); background: var(--trust-blue); box-shadow: 0 10px 22px rgba(37, 94, 160, 0.24); }
.btn-primary:hover { background: var(--trust-blue-dark); }
.btn-secondary { color: var(--charcoal); background: var(--radiant-gold); box-shadow: 0 10px 22px rgba(253, 216, 65, 0.25); }
.btn-outline { color: var(--trust-blue-dark); background: rgba(255, 255, 255, 0.72); border: 1px solid var(--line-strong); }
.btn-outline:hover { background: rgba(217, 236, 255, 0.88); color: var(--trust-blue-dark); }

.chart-section { padding: 28px 0 34px; }
.section-heading { max-width: 900px; margin: 0 auto 28px; text-align: center; }
.section-heading.compact { margin-bottom: 20px; }
.section-heading h2 { font-size: clamp(1.8rem, 3vw, 3rem); letter-spacing: -0.04em; }
.section-heading p:last-child { margin: 12px auto 0; color: rgba(51, 51, 51, 0.78); font-size: 1.05rem; }

.org-chart { position: relative; }
/* CEO -> straight drop to the rail (24px above the leader row) */
.ceo-row { display: flex; justify-content: center; position: relative; margin-bottom: 24px; }
.ceo-row::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: 2px; height: 24px; background: var(--line-strong); }
.leadership-row { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; padding-top: 24px; }
.lane { position: relative; }
/* vertical drop from the rail down into each leader card */
.lane::before { content: ""; position: absolute; top: -24px; left: 50%; transform: translateX(-50%); width: 2px; height: 24px; background: var(--line-strong); }
/* horizontal rail segment, aligned to each card's center; extends half the
   28px column gap (14px) each side so segments join into one straight rail */
.lane::after { content: ""; position: absolute; top: -24px; left: -14px; right: -14px; height: 2px; background: var(--line-strong); }
.lane:first-child::after { left: 50%; right: -14px; }
.lane:last-child::after { left: -14px; right: 50%; }

.node-card {
  width: 100%;
  padding: 20px;
  border: 1px solid rgba(37, 94, 160, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  color: var(--charcoal);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.node-card:hover { transform: translateY(-3px); border-color: rgba(37, 94, 160, 0.38); box-shadow: var(--shadow); }
.node-card:focus-visible { outline: 4px solid rgba(253, 216, 65, 0.65); outline-offset: 2px; }
.node-card h3, .node-card h4 { font-size: 1.05rem; letter-spacing: -0.015em; }
.node-card p { margin: 6px 0 0; color: rgba(51, 51, 51, 0.74); }
.node-card .role-title { margin: 8px 0 0; color: var(--trust-blue); font-weight: 900; }
.node-card .micro-copy { margin: 12px 0 0; color: rgba(51, 51, 51, 0.75); font-size: 0.95rem; }
.node-card.ceo { max-width: 500px; background: linear-gradient(135deg, var(--trust-blue-dark), var(--trust-blue-deep)); border-color: rgba(253, 216, 65, 0.52); text-align: center; }
.node-card.ceo h3, .node-card.ceo .role-title, .node-card.ceo .micro-copy { color: var(--cream-white); }
.node-card.ceo .micro-copy { color: rgba(255, 252, 229, 0.84); }
.node-card.leader { min-height: 230px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(217, 236, 255, 0.70)); }
.node-card.leader.open { border-style: dashed; border-color: rgba(37, 94, 160, 0.5); background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(217, 236, 255, 0.4)); }
.node-card.role { min-height: 0; padding: 12px 14px; border-radius: 13px; background: rgba(255, 255, 255, 0.72); box-shadow: none; }
.node-card.role::before { display: none; }
.node-card.role p { display: none; }
.node-card.role h4 { font-size: 0.94rem; line-height: 1.25; color: var(--charcoal); font-family: "Source Sans 3", "Source Sans Pro", sans-serif; font-weight: 900; }

.department-grid { margin-top: 18px; display: grid; grid-template-columns: 1fr; gap: 16px; }
.department-grid.single { grid-template-columns: 1fr; }
.department-card {
  overflow: hidden;
  border: 1px solid rgba(37, 94, 160, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow-soft);
}
.department-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 18px;
  border: 0;
  text-align: left;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(217, 236, 255, 0.62));
  cursor: pointer;
}
.department-toggle:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(217, 236, 255, 0.76)); }
.department-toggle h4 { margin: 0; color: var(--trust-blue-dark); font-size: 1.05rem; }
.department-toggle p { margin: 6px 0 0; color: rgba(51, 51, 51, 0.70); font-size: 0.92rem; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  border-radius: 999px;
  color: var(--trust-blue-deep);
  background: var(--radiant-gold);
  font-size: 0.78rem;
  font-weight: 900;
}
.chevron { color: var(--trust-blue); font-weight: 900; transition: transform 180ms ease; }
.department-card.collapsed .chevron { transform: rotate(-90deg); }
.department-body { padding: 14px; display: grid; gap: 8px; }
.department-card.collapsed .department-body { display: none; }

[data-hidden="true"] { display: none !important; }
.highlight { box-shadow: 0 0 0 4px rgba(253, 216, 65, 0.42), var(--shadow-soft); }
.empty-state {
  padding: 28px;
  text-align: center;
  border: 1px dashed rgba(37, 94, 160, 0.35);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
  color: var(--trust-blue-dark);
  font-weight: 900;
}

.summary-section { padding: 28px 0 34px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-auto-rows: 1fr; gap: 18px; }
.summary-card { padding: 26px; }
.summary-card h2 { font-size: clamp(1.65rem, 2.3vw, 2.5rem); letter-spacing: -0.04em; }
.summary-card h3 { font-size: 1.45rem; }
.role-line { margin: 8px 0 14px; color: var(--trust-blue); font-weight: 900; }
ul { padding-left: 1.25rem; }
.summary-card li { margin: 5px 0; }

.directory-section { padding: 28px 0 34px; }
.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 16px; }
.directory-card { padding: 20px; border: 1px solid rgba(37, 94, 160, 0.16); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.70); box-shadow: var(--shadow-soft); }
.directory-card h3 { font-size: 1.08rem; margin-bottom: 10px; }
.directory-card ul { margin: 0; padding-left: 1.25rem; }
.directory-card li { margin: 5px 0; }

.site-footer { margin-top: 32px; color: var(--cream-white); background: linear-gradient(135deg, var(--trust-blue), var(--trust-blue-dark)); padding: 34px 0; }
.footer-inner { display: grid; gap: 12px; justify-items: center; text-align: center; }
.footer-inner img { width: min(150px, 55vw); height: auto; }
.footer-inner p { margin: 0; color: rgba(255, 252, 229, 0.88); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 52, 94, 0.62);
  backdrop-filter: blur(8px);
}
.modal-backdrop.active { display: flex; }
.modal-card {
  position: relative;
  width: min(620px, 100%);
  max-height: min(78vh, 720px);
  overflow: auto;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.30);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  color: var(--trust-blue-dark);
  background: var(--trust-blue-light);
  font-size: 1.45rem;
  font-weight: 900;
  cursor: pointer;
}
.modal-role { color: var(--trust-blue); font-weight: 900; }
.modal-list-wrap { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(37, 94, 160, 0.18); }
.modal-list-wrap h3 { font-size: 1rem; margin-bottom: 10px; }

@media (max-width: 1050px) {
  .hero-card, .controls-card, .leadership-row, .summary-grid { grid-template-columns: 1fr; }
  .leadership-row { padding-top: 0; }
  .lane::before, .lane::after, .ceo-row::after { display: none; }
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .container { width: min(100% - 26px, var(--max)); }
  .site-header { padding: 28px 0 94px; }
  .header-grid { grid-template-columns: 1fr; gap: 22px; text-align: center; }
  .brand-mark { min-height: 118px; max-width: 280px; margin: 0 auto; }
  .hero-panel { margin-top: -70px; }
  .hero-card { padding: 22px; }
  .metric-strip, .department-grid, .directory-grid { grid-template-columns: 1fr; }
  .button-row { justify-content: stretch; }
  .button-row .btn { width: 100%; }
  .node-card.leader { min-height: 0; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media print {
  body { background: #fff; }
  .site-header, .controls-section, .site-footer, .modal-backdrop { display: none !important; }
  main { padding: 0; }
  .hero-panel { margin: 0 0 16px; }
  .glass-card, .node-card, .department-card, .directory-card { box-shadow: none; background: #fff; border-color: #d8d8d8; }
  .department-card.collapsed .department-body { display: grid; }
  .leadership-row, .department-grid, .summary-grid, .directory-grid { break-inside: avoid; }
}
