/* ==========================================================================
   CP Capital — cp.capital
   Visual Brand Guidelines v2.1

   Type roles
     Libre Baskerville 400 — headline
     Lora 400              — body
     Source Sans 3 400     — footer, small text
     Libre Franklin 500    — letterspaced uppercase

   All four are self-hosted from /fonts. The site makes no third-party
   requests of any kind: no font CDN, no analytics, no trackers, no scripts.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts (latin subset, woff2)
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Libre Baskerville';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/libre-baskerville-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/lora-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/source-sans-3-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/libre-franklin-500.woff2') format('woff2');
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */

:root {
  --cream:  #F5F1E8;  /* Limestone — page ground                             */
  --forest: #053D1E;  /* CP Green  — headline, links, focus ring on light    */
  --deep:   #16231D;  /* Deep Forest — footer ground                         */
  --gold:   #C39D4E;  /* Gold — rules and the mark only, never text on light */
  --ink:    #201F1D;  /* body text                                           */

  /* Hairlines. Gold is deliberately absent on light grounds: it measures
     2.26:1 on Limestone, which the brand guidelines restrict to the mark
     and to underline rules where the link text itself carries the contrast. */
  --rule-light:        rgba(5, 61, 30, 0.22);
  --rule-light-strong: rgba(5, 61, 30, 0.28);
  --rule-dark:         rgba(245, 241, 232, 0.18);

  --serif:   'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --body:    'Lora', Georgia, 'Times New Roman', serif;
  --sans:    'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Libre Franklin', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }

a {
  color: var(--forest);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--gold);
}

a:hover {
  color: var(--deep);
  text-decoration-color: var(--forest);
}

/* Focus ring. The canvas specified gold, but gold on Limestone is 2.26:1 —
   below the 3:1 WCAG 2.2 requires of a focus indicator. CP Green measures
   11.01:1 on Limestone; gold is kept on the dark footer, where it is 6.39:1. */
:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
  border-radius: 1px;
}

.site-footer :focus-visible { outline-color: var(--gold); }

::selection { background: rgba(195, 157, 78, 0.28); }

/* 44px minimum touch target on the two email links. */
.tap-target {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* --------------------------------------------------------------------------
   4. Header
   -------------------------------------------------------------------------- */

.site-header {
  padding: 26px 6vw;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--rule-light);
}

/* 200px sits above the sans wordmark's 140px floor at every width down to
   360px, where max-width caps it at 180px. */
.site-header__wordmark {
  width: 200px;
  max-width: 50vw;
  height: auto;
}

/* The wordmark links home on the error page only; no rule under artwork. */
.site-header a {
  display: inline-block;
  text-decoration: none;
}

/* Short hairline used under the headline on both pages. */
.rule {
  width: 64px;
  height: 1px;
  background: var(--rule-light-strong);
}

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */

.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(48px, 8vw, 116px) 6vw;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
}

.hero__mark {
  padding-right: clamp(40px, 6vw, 88px);
  border-right: 1px solid var(--rule-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Floor of 216px keeps the mark clear of its 128px full-color digital
   minimum, below which the 6-unit clearance hairline sub-pixels out. */
.hero__mark img {
  width: clamp(216px, 30vw, 468px);
  height: auto;
}

.hero__copy {
  padding-left: clamp(40px, 6vw, 88px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.6vw, 30px);
}

.hero__title {
  margin: 0;
  max-width: 20em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.1vw, 58px);
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--forest);
  text-wrap: pretty;
}

.hero__contact {
  margin: 0;
  max-width: 30em;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.6;
  text-wrap: pretty;
}

.hero__contact a {
  font-family: var(--serif);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding: clamp(34px, 4.5vw, 56px) 6vw clamp(26px, 3.5vw, 38px);
  background: var(--deep);
  color: rgba(245, 241, 232, 0.72);
  font-family: var(--sans);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
}

.site-footer__brand {
  padding-right: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.site-footer__wordmark {
  width: 166px;
  max-width: 48vw;
  height: auto;
}

.site-footer__email {
  align-self: flex-start;
  font-size: 16px;
  color: var(--cream);
  text-decoration-color: rgba(195, 157, 78, 0.7);
}

.site-footer__email:hover {
  color: var(--cream);
  text-decoration-color: var(--gold);
}

.site-footer__legal {
  padding-left: clamp(28px, 5vw, 64px);
  border-left: 1px solid var(--rule-dark);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.site-footer__notice {
  margin: 0;
  max-width: 48em;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(245, 241, 232, 0.62);  /* 6.35:1 on Deep Forest */
  text-wrap: pretty;
}

/* Raised from the canvas's 0.45 alpha, which measured 4.01:1 and failed AA
   for 11px text. 0.55 measures 5.28:1 and stays quieter than the notice. */
.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding-top: 6px;
  border-top: 1px solid var(--rule-dark);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 241, 232, 0.55);
}

/* --------------------------------------------------------------------------
   7. Error page
   -------------------------------------------------------------------------- */

.error {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.6vw, 30px);
  max-width: 38em;
}

.error__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: var(--forest);
  text-wrap: pretty;
}

.error__body {
  margin: 0;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.6;
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   8. Narrow viewports
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(30px, 6vw, 44px);
  }

  .hero__mark {
    padding-right: 0;
    border-right: 0;
    justify-content: flex-start;
  }

  .hero__copy { padding-left: 0; }

  .site-footer__grid { grid-template-columns: minmax(0, 1fr); }

  .site-footer__brand { padding-right: 0; }

  .site-footer__legal {
    margin-top: 26px;
    padding-top: 26px;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--rule-dark);
  }
}
