/* ============================================================
   ThreeDoors — site.css
   SHARED site layout + chrome. Every page loads this after the
   design-system (tokens.css + components.css). Page-specific
   section styles live in that page's own stylesheet (e.g. home.css).

   The topbar / overlay menu / footer MARKUP is injected by
   site-chrome.js — do not hand-write chrome into a page. This file
   only styles it. One source of truth for both markup (JS) and
   styling (here) means pages cannot drift the chrome.
   ============================================================ */

/* ------------------------------------------------------------
   Page scaffold
   ------------------------------------------------------------ */
.site { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

html { scroll-padding-top: 76px; }   /* keep anchored sections clear of the sticky topbar */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.shell {
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
  width: 100%;
}

/* Section rhythm — editorial breath between bands. */
.band { padding-block: var(--space-7); }
.band--tight { padding-block: var(--space-5); }
.band--roomy { padding-block: var(--space-8); }
.band__head { display: grid; gap: var(--space-2); max-width: 680px; margin-bottom: var(--space-5); }

/* Media frame — reused for any framed image (persona, corporate, artefact). */
.frame { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; background: var(--color-surface); }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

.btn { white-space: nowrap; }

/* ------------------------------------------------------------
   Page intro — the standard top of a simple/interior page.
   eyebrow + h1 + lead, with the back-to-home crumb. Use on any
   page that isn't the homepage; gives parallel page-builders a
   consistent starting block.
   ------------------------------------------------------------ */
.page-intro { padding-block: var(--space-7) var(--space-5); }
.page-intro__crumb {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: var(--t-caption);
  color: var(--color-text-muted); text-decoration: none;
  margin-bottom: var(--space-4);
  transition: color var(--motion-fast) var(--ease-out-slow);
}
.page-intro__crumb:hover { color: var(--color-text); }
.page-intro h1 {
  font-size: var(--t-h1); line-height: var(--lh-h1); letter-spacing: var(--ls-h1);
  margin: var(--space-2) 0 var(--space-3);
}
.page-intro .lead { max-width: 60ch; }

/* ------------------------------------------------------------
   Topbar — full-width bar; inner content matched to .shell so the
   logo + nav line up exactly with page content below.
   ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  padding-block: var(--space-2);
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.topbar__inner {
  display: flex; align-items: center; gap: var(--space-3);
  max-width: var(--shell-max); margin-inline: auto;
  padding-inline: var(--space-4); width: 100%;
}
.topbar__lead { display: flex; align-items: center; flex: none; }

/* Brand lockup — mark + wordmark as ONE tight unit. Cropped #motif-sm
   mark (no dead space) snug against the wordmark. */
.topbar__brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.topbar__brand:hover { text-decoration: none; }
.brand-mark { width: 19px; height: 24px; flex: none; display: block; color: var(--color-text); }
.topbar__wordmark {
  font-family: var(--font-serif); font-optical-sizing: auto;
  font-size: var(--t-h4); letter-spacing: -0.01em; color: var(--color-text); line-height: 1;
}
.topbar__wordmark .l { font-weight: var(--w-regular); }
.topbar__wordmark .b { font-weight: var(--w-bold); }

.topbar__nav { display: none; }
@media (min-width: 1024px) {
  .topbar__nav { display: flex; align-items: center; gap: var(--space-3); margin-inline: auto; }
}
.navlink {
  font-family: var(--font-sans); font-size: var(--t-caption);
  font-weight: var(--w-semibold); letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--color-text-muted);
  text-decoration: none; padding: 6px 2px; white-space: nowrap;
  transition: color var(--motion-fast) var(--ease-out-slow);
}
.navlink:hover { color: var(--color-text); text-decoration: none; }
.navlink--cta { color: var(--color-critical-fg); }
.navlink--cta:hover { color: var(--color-critical); }
.navlink[aria-current="page"] { color: var(--color-text); }

.topbar__right { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
@media (min-width: 1024px) { .topbar__right { margin-left: 0; } }

/* Icon button (the "+" menu / overlay close) — 1.5px round-cap discipline. */
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--color-text); cursor: pointer;
  transition: background-color var(--motion-fast) var(--ease-out-slow),
              border-color var(--motion-fast) var(--ease-out-slow);
}
.iconbtn:hover { background: var(--color-surface); border-color: var(--color-border); }
.iconbtn--inline { width: 36px; height: 36px; color: var(--color-text-muted); margin-left: var(--space-1); }
.iconbtn--inline:hover { color: var(--color-text); background: transparent; }

.toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  border-radius: var(--radius);
  border: 1px solid transparent; background: transparent;
  color: var(--color-text); cursor: pointer;
  transition: background-color var(--motion-fast) var(--ease-out-slow),
              border-color var(--motion-fast) var(--ease-out-slow);
}
.toggle:hover { background: var(--color-surface); border-color: var(--color-border); }

/* ------------------------------------------------------------
   Overlay menu — full-screen, three columns matching the footer.
   ------------------------------------------------------------ */
.overlay { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.overlay.is-open { visibility: visible; }
.overlay__scrim {
  position: absolute; inset: 0;
  background: color-mix(in oklab, var(--color-cipher-ink) 82%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity var(--motion-base) var(--ease-out-slow);
}
.overlay.is-open .overlay__scrim { opacity: 1; }
.overlay__panel {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: var(--space-4) var(--space-5);
  overflow-y: auto;
  background: transparent;
  opacity: 0; transform: translateY(-6px);
  /* ANIM: overlay entrance — fade + tiny lift, refine in motion pass */
  transition: opacity var(--motion-base) var(--ease-out-slow),
              transform var(--motion-base) var(--ease-out-slow);
}
.overlay.is-open .overlay__panel { opacity: 1; transform: translateY(0); }
.overlay__inner { max-width: var(--shell-max); margin-inline: auto; width: 100%; display: flex; flex-direction: column; flex: 1; }
.overlay__top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-5);
}
.overlay__cols { display: grid; grid-template-columns: 1fr; gap: var(--space-5); flex: 1; }
@media (min-width: 760px) {
  .overlay__cols { grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
}
.overlay__col { display: flex; flex-direction: column; gap: var(--space-2); }
.overlay__label { margin-bottom: var(--space-1); color: var(--color-accent); }
.overlay__link {
  font-family: var(--font-serif); font-optical-sizing: auto;
  font-size: var(--t-h3); font-weight: var(--w-semibold);
  letter-spacing: var(--ls-h3); line-height: var(--lh-h3);
  color: var(--color-text); text-decoration: none; padding: 6px 0;
  transition: color var(--motion-fast) var(--ease-out-slow);
}
.overlay__link:hover { color: var(--color-accent); text-decoration: none; }
.overlay__link[aria-current="page"] { color: var(--color-accent); }
.overlay__contact {
  margin-top: var(--space-6); padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  display: flex; flex-wrap: wrap; gap: var(--space-4);
}
.overlay__contact-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-size: var(--t-caption);
  color: var(--color-text-muted); text-decoration: none;
  transition: color var(--motion-fast) var(--ease-out-slow);
}
.overlay__contact-link:hover { color: var(--color-text); text-decoration: none; }
.overlay__contact-link .icon { width: 18px; height: 18px; }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.foot { border-top: 1px solid var(--color-border); padding-block: var(--space-6); margin-top: var(--space-6); }
.foot__top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-5); }
.foot__brand { display: inline-flex; align-items: center; gap: 9px; }
.foot__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); }
.foot__col { display: grid; gap: 8px; align-content: start; }
.foot__col strong { font-family: var(--font-sans); font-size: var(--t-caption); font-weight: var(--w-semibold); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--color-text-muted); }
.foot__col a { color: var(--color-text-body); text-decoration: none; font-size: var(--t-body); transition: color var(--motion-fast) var(--ease-out-slow); }
.foot__col a:hover { color: var(--color-text); }
.foot__contact { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.foot__contact-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-size: var(--t-caption);
  color: var(--color-text-body); text-decoration: none;
  transition: color var(--motion-fast) var(--ease-out-slow);
}
.foot__contact-link:hover { color: var(--color-text); }
.foot__contact-link .icon { width: 18px; height: 18px; }
.foot__fine { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--color-border); color: var(--color-text-soft); font-size: var(--t-caption-xs); letter-spacing: var(--ls-caption-xs); max-width: none; }
.foot__fine a { color: inherit; text-decoration-color: var(--color-border); }
.foot__fine a:hover { color: var(--color-text-body); text-decoration-color: var(--color-text-muted); }
