/* ---------------------------------------------------------------------------
   Bastion Capital — site layout + components (interior pages, 404).
   The home cover (index.html) is self-contained and does not load this file.
   Nav + footer mirror the wiki's top-nav / .site-footer patterns (custom.scss).
   --------------------------------------------------------------------------- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Static Graphic Element texture (About Us / Philosophy) — the authored
   off-white colourway PNG, used verbatim, never animated. */
body.textured::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #ffffff url("/img/graphic-element-offwhite.png") center / cover no-repeat;
}

::selection {
  background: #e0dcef; /* wiki ::selection — light lavender-grey */
  color: var(--dusk);
}

a {
  color: var(--dusk);
  text-decoration: none;
}
a:hover {
  text-decoration: underline; /* wiki rule: hover = underline, resting colour */
}

:focus-visible {
  outline: 2px solid var(--dusk);
  outline-offset: 2px;
}
/* On the dusk footer band a dusk outline would be invisible. */
.site-footer :focus-visible {
  outline-color: var(--off-white);
}

/* --- Top nav (wiki top-nav pattern: logo left, links right, hairline) ------ */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}

.top-nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 3.4rem;
  padding: 0.55rem clamp(1.6rem, 5vw, 4.5rem);
}

.wordmark {
  flex: 0 0 auto;
  display: block;
  width: 210px;
  aspect-ratio: 582.53 / 52.78; /* wordmark ink bounds — matches the wiki */
  background: url("/img/bastion-logo.svg") left center / contain no-repeat;
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.nav-links a {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--dusk);
  white-space: nowrap;
}

/* Hamburger — hidden on desktop, shown < 800px (wiki breakpoint). */
.nav-toggle {
  display: none;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  padding: 7px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--dusk);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* --- Reading column --------------------------------------------------------- */
main {
  flex: 1;
}

.column {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(3.2rem, 8vh, 5.5rem) 1.6rem clamp(4rem, 10vh, 6.5rem);
}

h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 4.6vw, 2.6rem);
  line-height: 1.24;
  color: var(--dusk);
  margin-bottom: 1.6rem;
}

.column p {
  margin-bottom: 1.2rem;
}

/* Sub-labels (HORIZON / RELATIVE SKILL / RISK / INVESTMENT DISCIPLINE)
   — Brand Guideline p.28 sub-header format via the wiki's face. */
.sublabel {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.35;
  color: var(--dusk);
  margin-bottom: 0.9rem;
}

.column section {
  margin-top: 2.8rem;
}
.column section:first-of-type {
  margin-top: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 2.8rem 0;
}

/* Discipline list — quiet, printed-statement feel. */
.column ul {
  list-style: none;
}
.column li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.9rem;
}
.column li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--gray);
}

address {
  font-style: normal;
}

/* --- Footer band (mirrors the wiki .site-footer, light mode) ----------------- */
.site-footer {
  background: var(--dusk);
  color: var(--off-white);
  padding: 0.85rem clamp(1.6rem, 5vw, 4.5rem);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
}

/* Left: motif with the © block beside it (old-site footer treatment). */
.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 1.3rem;
}

.site-footer-motif {
  flex: 0 0 auto;
  display: block;
  width: 108px; /* 68px tall × the motif's 316.88 / 199.84 aspect ratio */
  height: 68px;
  background: url("/img/bastion-motif-white.svg") left center / contain no-repeat;
}

.site-footer-copy {
  display: grid;
  gap: 0.35rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  line-height: 1.35;
}
.site-footer-copy p {
  margin: 0;
  line-height: 1.35;
}

/* Right: email / address (email assembled by js/site.js), uniform gap. */
.site-footer-contact {
  display: grid;
  gap: 0.35rem;
  text-align: right;
}

.site-footer-contact,
.site-footer-contact a {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  line-height: 1.35;
  color: inherit;
}
.site-footer-contact address,
.site-footer-contact p {
  margin: 0;
  line-height: 1.35;
}
.site-footer-contact a:hover {
  color: inherit;
}

/* --- Fade/rise on first viewport entry (interior pages) ----------------------
   Hidden state applies only once js/site.js has tagged <html class="js">,
   so content is never lost without JavaScript. */
html.js .fade {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
html.js .fade.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  html.js .fade {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --- Mobile (< 800px, wiki breakpoint): slim bar + drawer --------------------- */
@media (max-width: 800px) {
  /* Tighten the reading column's top gap — the desktop top padding leaves too
     much air above the H1 on a short mobile viewport. */
  .column {
    padding-top: clamp(1.8rem, 4vh, 2.8rem);
  }

  .top-nav-inner {
    flex-wrap: wrap;
    gap: 0.6rem 0.75rem;
  }
  .wordmark {
    width: 176px;
  }
  .nav-toggle {
    display: flex;
    order: 1;
    margin-left: auto;
  }
  .nav-links {
    display: none;
  }

  /* Open state — full-width stacked drawer beneath the bar. */
  .top-nav.nav-open .nav-links {
    order: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    flex-basis: 100%;
    margin: 0;
    padding: 0.8rem 0 0.6rem;
    border-top: 1px solid var(--hairline);
  }
  .top-nav.nav-open .nav-links a {
    font-size: 0.95rem;
  }

  /* Hamburger morphs into an X when open. */
  .top-nav.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .top-nav.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }
  .top-nav.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  /* Footer: one row — motif left, email/address right (address wraps to
     two lines). The © block is desktop-only — it squeezes at phone widths. */
  .site-footer-inner {
    gap: 1rem;
  }
  .site-footer-copy {
    display: none;
  }
  .site-footer-motif {
    width: 86px;
    height: 54px;
  }
  .site-footer-contact,
  .site-footer-contact a {
    font-size: 0.72rem;
    white-space: normal;
  }
  .site-footer-contact {
    margin-left: auto;
    min-width: 0;
  }
}
