/* Terenex — stylesheet
   Plain CSS, no build step. Mobile-first, progressively enhanced. */

/* ---------- Fonts (self-hosted, no third-party requests) ---------- */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-sans-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-serif-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-serif-600.woff2") format("woff2");
}

/* ---------- Design tokens ---------- */

:root {
  --navy: #0b2341;
  --navy-soft: #1d3757;
  --gold: #8b6f4e; /* muted bronze (was warm gold #b98b3d) */
  --gold-text: #6b5539; /* darker than --gold: meets 4.5:1 on white for text use */
  --white: #ffffff;
  --off-white: #f7f5f0;
  --pale-grey: #eeece5;
  --line: #e2ded4;
  --ink: #2e2b26; /* warm charcoal (was near-black #1a1a1a) */
  --ink-soft: #57524a;
  --ink-muted: #6e685e; /* darkened slightly from the brief's #7a7468 — that value
    only cleared 3.9-4.3:1 against --pale-grey/--off-white, short of the site's
    4.5:1 text-contrast bar; this hits ~4.7:1+ on both while staying warm/muted */

  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  --font-serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;

  --wrap: 1120px;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 7rem;

  --radius: 3px;
}

/* ---------- Reset ---------- */

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

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

body,
h1,
h2,
h3,
p,
figure,
ul,
ol {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Base ---------- */

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  scroll-margin-top: 84px;
}

h1,
h2,
h3 {
  font-weight: 600;
  color: var(--navy);
  line-height: 1.25;
}

h1 {
  font-size: clamp(2.1rem, 5.6vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.7rem);
}

/* IBM Plex Serif — used only on the hero h1 and the three stat numbers,
   nowhere else. Pairs with Plex Sans as one type family (chosen over a more
   characterful serif that read as "two fonts accidentally mixed"). */
.serif {
  font-family: var(--font-serif);
}

h3 {
  font-size: 1.05rem;
}

p {
  color: var(--ink-soft);
}

.lede {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 42em;
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold-text);
  font-weight: 600;
}

.rule {
  width: 48px;
  height: 2px;
  background: var(--gold);
  border: 0;
  margin: var(--space-md) 0 0;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  z-index: 1000;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
  font-size: 0.9rem;
}

.skip-link:focus {
  left: 0;
  top: 0;
}

/* ---------- Focus visibility ---------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  height: 54px;
  width: auto;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}

.site-nav a {
  display: inline-block;
  padding: 6px 2px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

/* Visually hidden but still available to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Mobile nav toggle ----------
   Hidden on desktop (nav stays as a plain row). On mobile, collapses the
   nav behind a button; see the <noscript> fallback in index.html for the
   no-JS case. */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--navy);
  border-radius: 1px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
  padding: var(--space-xl) 0 var(--space-lg);
}

.hero .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero .inner {
  max-width: 44em;
  flex: 0 1 auto;
}

.hero-watermark {
  flex: 1 1 0;
  min-width: 0;
  max-width: 380px;
  height: auto;
  opacity: 0.05;
  pointer-events: none;
}

@media (max-width: 1000px) {
  .hero-watermark {
    display: none;
  }
}

.hero h1 {
  margin: 18px 0 22px;
}

.hero .role {
  font-size: 1.05rem;
  color: var(--navy);
  font-weight: 500;
  margin-bottom: 14px;
}

.hero .lede {
  margin-top: 6px;
}

.proof-line {
  margin-top: var(--space-md);
  padding-left: 18px;
  border-left: 2px solid var(--navy);
  max-width: 34em;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--navy-soft);
}

/* Quiet hero link — not a button, so it doesn't compete with the stats
   band that follows. Same label/destination as the primary Contact CTA,
   just a low-emphasis way to reach it sooner. */
.hero-cta {
  display: inline-block;
  margin-top: var(--space-md);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--navy-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

.hero-cta:hover {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

/* ---------- Stats strip ---------- */

.stats {
  background: var(--off-white);
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats h2 {
  max-width: 30em;
  margin-bottom: var(--space-lg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 56px 48px;
}

.stat .num {
  font-size: clamp(1.85rem, 3.3vw, 2.6rem);
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.stat .label {
  font-size: 0.98rem;
  color: var(--ink-muted);
  margin-top: 12px;
  max-width: 24em;
}

/* ---------- Generic section ---------- */

.section {
  padding: var(--space-xl) 0;
}

.section-head {
  max-width: 42em;
  margin-bottom: var(--space-lg);
}

.section-head h2 {
  margin-top: 14px;
}

/* ---------- About ---------- */

.about .body p + p {
  margin-top: 1.1em;
}

.about .body {
  max-width: 46em;
  font-size: 1.05rem;
}

.about .note {
  margin-top: var(--space-md);
  font-size: 0.85rem;
  color: var(--ink-muted);
  border-left: 2px solid var(--line);
  padding-left: 14px;
}

/* ---------- About photo (experimental — self-contained, remove this block plus
   the .about-photo element in index.html to revert) ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  align-items: start;
}

.about-photo img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

@media (max-width: 640px) {
  .about-grid {
    display: block;
  }

  .about-photo {
    max-width: 320px;
    margin-top: var(--space-lg);
  }
}

/* ---------- Services ---------- */

.services {
  /* Matches .stats treatment — otherwise About and Focus sit back-to-back
     as plain white with no break, reading as one long undifferentiated
     block instead of two distinct sections. */
  background: var(--off-white);
  border-top: 1px solid var(--line);
}

.services-body {
  max-width: 46em;
}

.services-body > .lede {
  /* Tight paragraph-to-paragraph rhythm, matching .about .body p + p,
     since these two ledes read as one continuous intro. */
  margin-bottom: 1.1em;
}

.services-body > .lede:last-of-type {
  /* Bigger gap before the distinct list of service items below. */
  margin-bottom: var(--space-lg);
}

.services-list {
  display: flex;
  flex-direction: column;
}

.service-item {
  font-size: 1.05rem;
  padding-top: 26px;
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.service-item:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.service-item strong {
  color: var(--navy);
  font-weight: 600;
}

/* ---------- Speaking ---------- */

/* .speaking is plain white — navy interstitial above and cream Contact
   below already mark its boundaries, so no tint or border needed here. */

.engagements {
  margin-top: var(--space-lg);
}

.engagement {
  display: grid;
  grid-template-columns: 11em 1fr;
  gap: 6px 28px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.engagement:last-child {
  border-bottom: 1px solid var(--line);
}

.engagement time {
  color: var(--ink-muted);
  font-size: 0.85rem;
  padding-top: 2px;
}

.engagement h3 {
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.engagement p {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.other-engagements {
  margin-top: var(--space-lg);
}

.other-engagements ul {
  margin-top: 16px;
}

.other-engagements li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.other-engagements li:last-child {
  border-bottom: 1px solid var(--line);
}

.other-name {
  color: var(--ink-soft);
}

.other-date {
  color: var(--ink-muted);
  white-space: nowrap;
}

.quiet-label {
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: 16px;
}

.media {
  margin-top: var(--space-lg);
}

.dot-list {
  font-size: 0.92rem;
  color: var(--navy-soft);
  line-height: 1.9;
}

/* ---------- Topics ---------- */

.topics {
  margin-top: var(--space-lg);
}

/* ---------- Contact ---------- */

.contact {
  /* Closes the page on a warmer note than plain white, and marks the
     boundary with white Speaking above. */
  background: var(--off-white);
  border-top: 1px solid var(--line);
}

.contact .inner {
  max-width: 40em;
}

.contact-links {
  margin-top: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--navy-soft);
}

.btn-secondary {
  border-color: var(--navy);
  color: var(--navy);
}

.btn-secondary:hover {
  background: var(--off-white);
}

.contact-fallback {
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.contact-fallback a {
  color: var(--navy-soft);
  text-decoration: underline;
}

.contact-fallback a:hover {
  color: var(--navy);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-lg) 0;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.site-footer a {
  color: var(--navy);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.footer-note {
  margin-top: var(--space-sm);
  font-size: 0.8rem;
}

.footer-brand img {
  opacity: 0.8;
}

/* ---------- Dark interstitial (experimental — self-contained, remove this
   whole block plus the .interstitial section in index.html to revert) ---------- */

.interstitial {
  background: var(--navy);
  padding: var(--space-xl) 0;
  text-align: center;
}

.interstitial .wrap {
  max-width: 38em;
}

.interstitial p {
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  color: var(--white);
  line-height: 1.5;
}

.interstitial-rule {
  width: 48px;
  height: 2px;
  background: #b9a995; /* bronze-light, for use on the navy background only */
  border: 0;
  margin: var(--space-md) auto;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  :root {
    --space-xl: 4.25rem;
    --space-lg: 2.25rem;
  }

  .engagement {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .site-header .wrap {
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
  }

  /* Collapse behaviour is opt-in via the .nav-js class, added by nav.js
     once it loads. Without JS, .nav-toggle stays display:none (its base
     rule, above) and .site-nav stays fully visible — the nav just always
     shows, uncollapsed, which is the correct no-JS fallback. */
  .nav-js .nav-toggle {
    display: flex;
  }

  .nav-js .site-nav {
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
  }

  .nav-toggle[aria-expanded="true"] + .site-nav {
    max-height: 320px;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 4px;
    padding: 14px 0 6px;
  }

  /* "Other engagements" list: always stack name above date on mobile,
     rather than relying on flex-wrap (which left the date awkwardly
     flush-left, alone, when a long name wrapped to two lines). */
  .other-engagements li {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle-bar,
  .site-nav {
    transition: none;
  }
}

/* ---------- Print ---------- */

@media print {
  .site-header {
    position: static;
  }
  .btn-primary {
    background: none;
    color: var(--navy);
    border-color: var(--navy);
  }
}
