/* ============================================================
   ACT Acoustics Employee Handbook — Basecamp-style web edition
   Minimal, editorial, sans-serif. Brand tokens from GL-003.
   ============================================================ */

:root {
  /* Brand (GL-003) */
  --navy: #303060;
  --navy-hover: #262650;
  --navy-active: #1c1c40;

  /* Ink */
  --ink: #17171a; /* headings / strong */
  --body: #2f2f33; /* running text */
  --muted: #77776f; /* eyebrows, captions, footer */

  /* Surfaces & rules */
  --bg: #ffffff;
  --rule: #e7e7e1;
  --rule-strong: #d4d4cd;
  --table-head: #f5f5ef;

  /* Rhythm */
  --measure: 40rem; /* ~68–72ch reading width */
  --page-pad: 1.5rem;

  --font: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-size: 19px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.4rem var(--page-pad) 1.1rem;
  border-bottom: 1px solid var(--rule);
}

.site-header__brand img {
  display: block;
  height: 60px;
  width: auto;
}

.site-header__contents {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
}
.site-header__contents:hover {
  text-decoration: underline;
}

.site-header__tools {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

/* ---------- Search ---------- */
.search {
  position: relative;
}

.search__input {
  width: 210px;
  max-width: 46vw;
  padding: 0.45rem 0.7rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--body);
  background: #fbfbf7;
  border: 1px solid var(--rule-strong);
  border-radius: 7px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, width 140ms ease;
}
.search__input::placeholder {
  color: var(--muted);
}
.search__input:focus {
  width: 260px;
  background: #fff;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(48, 48, 96, 0.12);
}

.search__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: min(90vw, 440px);
  max-height: min(70vh, 460px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  box-shadow: 0 12px 34px rgba(23, 23, 26, 0.16);
  padding: 0.35rem;
  z-index: 50;
}

.search__empty {
  margin: 0;
  padding: 0.7rem 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.search__result {
  display: block;
  padding: 0.6rem 0.7rem;
  border-radius: 7px;
  text-decoration: none;
  color: var(--body);
}
.search__result:hover,
.search__result.is-active {
  background: #f3f2ea;
}

.search__result-kind {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.1rem;
}
.search__result-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.25;
}
.search__result-snippet {
  display: block;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  margin-top: 0.15rem;
}
.search mark {
  background: #fff1b8;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

/* ---------- Page shell ---------- */
.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3.5rem var(--page-pad) 1rem;
}

/* ---------- Landing / contents ---------- */
.home__title {
  font-size: 2.6rem;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 1.6rem;
}

.home__intro {
  margin-bottom: 3rem;
}

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.toc__item {
  border-bottom: 1px solid var(--rule);
}

.toc__link {
  display: block;
  padding: 1.15rem 0.25rem;
  text-decoration: none;
  color: var(--ink);
  transition: background-color 120ms ease, padding-left 120ms ease;
}
.toc__link:hover {
  background: #faf9f4;
  padding-left: 0.75rem;
}

.toc__num {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.toc__name {
  display: block;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--navy);
}
.toc__link:hover .toc__name {
  color: var(--navy-hover);
}

.toc__heading {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.75rem 0 0;
}
.toc__list--appendix .toc__name {
  font-size: 1.15rem;
}

/* ---------- Chapter ---------- */
.chapter__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.4rem;
}

.chapter__title {
  font-size: 2.2rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0 0 2rem;
}

/* ---------- Prose ---------- */
.prose {
  font-size: 1.06rem;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  margin: 2.6rem 0 0.9rem;
}

.prose h3 {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
  margin: 2rem 0 0.7rem;
}

.prose p {
  margin: 0 0 1.15rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.15rem;
  padding-left: 1.4rem;
}
.prose li {
  margin: 0 0 0.5rem;
}
.prose li::marker {
  color: var(--muted);
}

.prose a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(48, 48, 96, 0.35);
}
.prose a:hover {
  color: var(--navy-hover);
  text-decoration-color: currentColor;
}

.prose strong {
  color: var(--ink);
  font-weight: 700;
}

.prose em {
  font-style: italic;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.1rem 0 0.1rem 1.1rem;
  border-left: 3px solid var(--rule-strong);
  color: var(--muted);
}
.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* Contractual / non-contractual flags rendered as a small note line. */
.prose .note,
.prose p em:only-child {
  color: var(--muted);
}

/* ---------- Tables ---------- */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule-strong);
}
.prose thead th {
  background: var(--table-head);
  font-weight: 700;
  color: var(--ink);
}
.prose tbody tr:nth-child(even) {
  background: #fbfbf7;
}

/* ---------- Chapter navigation ---------- */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 3.5rem 0 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.chapter-nav__link {
  display: flex;
  flex-direction: column;
  max-width: 48%;
  text-decoration: none;
}
.chapter-nav__link--next {
  text-align: right;
  margin-left: auto;
}
.chapter-nav__dir {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.chapter-nav__name {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--navy);
}
.chapter-nav__link:hover .chapter-nav__name {
  color: var(--navy-hover);
  text-decoration: underline;
}

.chapter__back {
  font-size: 0.92rem;
  margin: 0 0 1rem;
}
.chapter__back a {
  color: var(--muted);
  text-decoration: none;
}
.chapter__back a:hover {
  color: var(--navy);
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--measure);
  margin: 4rem auto 0;
  padding: 1.6rem var(--page-pad) 2.6rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.82rem;
}
.site-footer p {
  margin: 0 0 0.25rem;
}
.site-footer__org {
  font-weight: 600;
  color: var(--body);
}

/* ---------- Responsive ---------- */
@media (max-width: 34rem) {
  body {
    font-size: 18px;
  }
  .page {
    padding-top: 2.5rem;
  }
  .home__title {
    font-size: 2.1rem;
  }
  .chapter__title {
    font-size: 1.85rem;
  }
  .chapter-nav {
    flex-direction: column;
  }
  .chapter-nav__link,
  .chapter-nav__link--next {
    max-width: 100%;
    text-align: left;
    margin-left: 0;
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header__contents,
  .chapter-nav,
  .chapter__back {
    display: none;
  }
  body {
    font-size: 11pt;
    color: #000;
  }
}
