/* Coir Bond navbar — presentation only. Loaded on every route, because the
   homepage and the exported pages share one <header> markup even though their
   page bodies come from different design systems. Heights, flex layout and the
   mobile breakpoint rules in the bundle are left untouched: the bar reacts to
   scroll through colour, weight and elevation, never by resizing, so the sticky
   header never reflows the page under the reader. */
:root {
  --cb-forest: #12382D;
  --cb-gold: #B88A2F;
  --cb-bone: #F6F1E7;
  --cb-espresso: #2B1B12;
  --cb-nav-ease: cubic-bezier(.4, 0, .2, 1);
  --cb-gold-line: color-mix(in srgb, var(--cb-gold) 62%, transparent);
}

/* Announcement strip: deepening to espresso at both ends gives the band some
   depth instead of reading as one flat rectangle. */
.topbar {
  background: linear-gradient(90deg, var(--cb-espresso), var(--cb-forest) 26%, var(--cb-forest) 74%, var(--cb-espresso));
  color: color-mix(in srgb, var(--cb-bone) 90%, var(--cb-gold));
  letter-spacing: .12em;
}

/* The bar: bone glass that firms up and lifts once the page scrolls under it. */
header {
  background: color-mix(in srgb, var(--cb-bone) 88%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  border-bottom: 0;
  position: sticky;
  transition: background .35s var(--cb-nav-ease), box-shadow .35s var(--cb-nav-ease);
}
header[data-cb-scrolled] {
  background: color-mix(in srgb, var(--cb-bone) 97%, transparent);
  box-shadow: 0 12px 34px color-mix(in srgb, var(--cb-forest) 11%, transparent);
}

/* A gold rule that fades out at both ends, rather than a hard border edge to
   edge. This is the detail that carries the whole bar. */
header:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--cb-gold-line) 16%, color-mix(in srgb, var(--cb-gold) 78%, transparent) 50%, var(--cb-gold-line) 84%, transparent);
  opacity: .85;
  transition: opacity .35s var(--cb-nav-ease);
}
header[data-cb-scrolled]:after { opacity: 1; }

/* Wordmark */
.brand {
  position: relative;
  padding: 7px 12px;
  margin-left: -12px;
  border-radius: 12px;
  transition: background .3s var(--cb-nav-ease);
}
.brand:hover { background: color-mix(in srgb, var(--cb-gold) 12%, transparent); }
.brand b {
  color: var(--cb-forest);
  letter-spacing: .005em;
}
.brand small {
  color: var(--cb-gold);
  letter-spacing: .22em;
}

/* Nav: a little more air and tracking, and a gold rule that opens from the
   centre with a soft glow. The page you are on keeps its rule open. */
header nav { gap: 28px; }
header nav a {
  position: relative;
  padding: 8px 1px;
  letter-spacing: .015em;
  white-space: nowrap;
  transition: color .22s var(--cb-nav-ease);
}
header nav a:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--cb-gold), transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--cb-gold) 50%, transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .32s var(--cb-nav-ease);
}
header nav a:hover, header nav a:focus-visible { color: var(--cb-forest); }
header nav a:hover:after, header nav a:focus-visible:after { transform: scaleX(1); }

header nav a[aria-current="page"] { color: var(--cb-forest); font-weight: 700; }
header nav a[aria-current="page"]:after {
  transform: scaleX(1);
  background: linear-gradient(90deg, transparent, var(--cb-gold) 28%, var(--cb-gold) 72%, transparent);
}

/* Phone reads as a quiet link with a small gold marker, not a filled block. */
.headercta { background: none; gap: 22px; }
.headercta > a:first-child {
  color: var(--cb-forest);
  font-weight: 600;
  letter-spacing: .03em;
  white-space: nowrap;
  transition: color .22s var(--cb-nav-ease);
}
.headercta > a:first-child:before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 9px;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--cb-gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cb-gold) 18%, transparent);
  transition: box-shadow .25s var(--cb-nav-ease);
}
.headercta > a:first-child:hover { color: var(--cb-gold); }
.headercta > a:first-child:hover:before { box-shadow: 0 0 0 4px color-mix(in srgb, var(--cb-gold) 26%, transparent); }

/* The single filled element in the bar, so the call to action stands alone.
   The inset hairline is what makes it read as gilded rather than flat. */
.headercta .button {
  background: linear-gradient(180deg, color-mix(in srgb, var(--cb-forest) 88%, #ffffff), var(--cb-forest));
  color: var(--cb-bone);
  border-radius: 999px;
  padding: 12px 26px;
  letter-spacing: .04em;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cb-gold) 40%, transparent),
              0 7px 18px color-mix(in srgb, var(--cb-forest) 24%, transparent);
  transition: background .28s var(--cb-nav-ease), box-shadow .28s var(--cb-nav-ease), transform .28s var(--cb-nav-ease);
}
.headercta .button:hover {
  background: linear-gradient(180deg, var(--cb-forest), var(--cb-espresso));
  color: var(--cb-bone);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cb-gold) 72%, transparent),
              0 13px 28px color-mix(in srgb, var(--cb-forest) 32%, transparent);
  transform: translateY(-1px);
}
.headercta .button:active { transform: translateY(0); }

/* Replaces the browser's default black focus box, which was framing the
   wordmark after a click. */
header a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--cb-gold) 80%, transparent);
  outline-offset: 3px;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  header, header:after, .brand, header nav a, header nav a:after,
  .headercta > a:first-child, .headercta > a:first-child:before, .headercta .button { transition: none; }
  .headercta .button:hover { transform: none; }
}
