/* Max Friedle, personal site v2.
   Palette: the metaFox brand tokens (skills/design-kit-metaFox/colors_and_type.css).
   Dark Blue #001848 primary, Dark Red #410C00 gradient companion, Orange #C4480C
   secondary, Yellow #FFBC00 accent, Gray #3A3E43 body text.
   Display face is Fraunces (personal-site signature); body is Inter, the metaFox body face.
   Both self-hosted, no Google Fonts hotlink (GDPR). */

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/Fraunces-Variable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'InterVar';
  src: url('/fonts/Inter-Variable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --blue:      #001848;
  --dark-red:  #410C00;
  --orange:    #C4480C;
  --yellow:    #FFBC00;
  --gray:      #3A3E43;

  --paper:     #FFFFFF;
  --paper-2:   #F4F6F8;
  --ink:       var(--blue);
  --body:      var(--gray);
  --ink-soft:  #6B7280;
  --rule:      #E5E7EB;
  --accent:    var(--orange);
  --on-dark:   #F8FAFC;
  --on-dark-muted: #C7CEDA;

  --grad-button: linear-gradient(90deg, #001848 0%, #410C00 100%);
  --maxw:      1200px;
  --gut:       clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'InterVar', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  color: var(--body);
  background: var(--paper);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'SOFT' 20, 'WONK' 1, 'opsz' 40;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
}
h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); font-weight: 500; }
h2 { font-size: clamp(1.9rem, 3.9vw, 3rem); margin-bottom: 1.15rem; }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); font-variation-settings: 'SOFT' 20, 'WONK' 0, 'opsz' 20; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* height:auto is load-bearing: the width/height attributes on <img> otherwise pin the
   rendered height and defeat both aspect-ratio and object-fit below. */
img { display: block; max-width: 100%; height: auto; }
strong { font-weight: 650; color: var(--ink); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }
.wrap.narrow { max-width: 760px; }
.wrap.medium { max-width: 940px; }
section { padding: clamp(56px, 8vw, 100px) 0; }
.tint { background: var(--paper-2); }
.dark { background: var(--blue); color: var(--on-dark); }
.dark h2, .dark h3 { color: var(--on-dark); }
.dark a { color: var(--yellow); }
.muted { color: var(--ink-soft); }

/* Eyebrow label */
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 1.1rem;
}
.dark .eyebrow { color: var(--yellow); }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; height: 62px;
}
.brand {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'SOFT' 20, 'WONK' 1, 'opsz' 20;
  font-weight: 600; font-size: 1.12rem; color: var(--ink); letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
header nav { display: flex; align-items: center; gap: 1.6rem; }
header nav a { color: var(--ink); font-size: 0.9rem; font-weight: 500; }
header nav a:hover { color: var(--accent); text-decoration: none; }
.lang { display: flex; gap: 0.4rem; font-size: 0.8rem; color: var(--ink-soft); }
.lang a { color: var(--ink-soft); font-weight: 500; }
.lang a.on { color: var(--ink); font-weight: 700; }
.nav-toggle { display: none; }

/* ---------- Buttons (metaFox: rectangles, 8px radius, never full-width strips) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 28px;
  font-size: 1rem; font-weight: 600;
  border-radius: 8px; border: 1.5px solid transparent;
  white-space: nowrap;
  transition: filter 0.15s, background 0.15s, color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-solid { background: var(--grad-button); color: #fff; }
.btn-solid:hover { filter: brightness(1.18); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--blue); }
.btn-ghost:hover { background: var(--blue); color: #fff; }
.dark .btn-solid { background: var(--yellow); color: var(--blue); }
.dark .btn-solid:hover { filter: brightness(1.08); }
.dark .btn-ghost { color: var(--on-dark); border-color: var(--on-dark); }
.dark .btn-ghost:hover { background: var(--on-dark); color: var(--blue); }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }
.cta-note { font-size: 0.86rem; color: var(--ink-soft); margin-top: 0.9rem; }

/* ---------- Hero ---------- */
.hero { padding: clamp(44px, 6vw, 84px) 0 clamp(36px, 5vw, 60px); }
.hero-grid {
  display: grid; grid-template-columns: 1fr 0.68fr;
  gap: clamp(28px, 5vw, 64px); align-items: center;
}
.hero h1 { margin-bottom: 1.4rem; }
.hero .lead { font-size: clamp(1.05rem, 1.4vw, 1.25rem); color: var(--body); max-width: 34em; }
.hero-photo img { width: 100%; max-width: 400px; margin-left: auto; border-radius: 12px; }
.credentials {
  margin-top: clamp(36px, 5vw, 64px);
  border-top: 1px solid var(--rule);
  padding-top: 1.1rem;
  font-size: 0.83rem; color: var(--ink-soft);
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem;
}

/* ---------- Full-bleed photo band ---------- */
.band { padding: 0; }
.band img { width: 100%; height: clamp(240px, 38vw, 460px); object-fit: cover; }
/* Group photos are shown whole: a fixed band height would cut the front row at some
   viewport width. Natural aspect, no cropping at any size. */
.band-group img { height: auto; }
.band figcaption {
  max-width: var(--maxw); margin: 0.7rem auto 0; padding: 0 var(--gut);
  font-size: 0.8rem; color: var(--ink-soft);
}

/* ---------- Chapter intro ---------- */
.lede { font-size: clamp(1.02rem, 1.25vw, 1.15rem); max-width: 46em; color: var(--body); }

/* ---------- Split section ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.split.top { align-items: start; }
.split.text-right { direction: rtl; }
.split.text-right > * { direction: ltr; }
/* Boards are never cropped: contain, not cover. */
.split img { width: 100%; object-fit: contain; border-radius: 8px; }
.split figcaption { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.6rem; }
#about .path h3 { margin-bottom: 0.7rem; }
#about .path p { font-size: 0.96rem; }

/* ---------- Pull quote (sits inside the idea section, not on its own) ---------- */
.pullbox {
  margin-top: clamp(28px, 4vw, 48px);
  padding-top: clamp(24px, 3vw, 36px);
  border-top: 3px solid var(--yellow);
  font-family: 'Fraunces', serif;
  font-variation-settings: 'SOFT' 40, 'WONK' 1, 'opsz' 60;
  font-weight: 400;
  font-size: clamp(1.35rem, 2.6vw, 2.05rem);
  line-height: 1.24; color: var(--ink); max-width: 24em;
}
.pullbox .attrib {
  display: block; margin-top: 0.9rem;
  font-family: 'InterVar', sans-serif; font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
}

/* ---------- Video grids ---------- */
.videos { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); margin-top: 2.4rem; }
.vcard {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit;
}
.vcard:hover { text-decoration: none; }
.vcard:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
.vthumb { display: block; }
.vthumb { position: relative; overflow: hidden; border-radius: 8px; background: var(--rule); }
.vthumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; transition: transform 0.35s ease; }
.vcard:hover .vthumb img { transform: scale(1.035); }
.play { position: absolute; inset: 0; display: grid; place-items: center; }
.play span {
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(0, 24, 72, 0.78); color: #fff;
  display: grid; place-items: center; font-size: 1rem; padding-left: 3px;
}
.vcard .vname {
  display: block; margin-top: 0.7rem; font-size: 1rem;
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'SOFT' 20, 'WONK' 0, 'opsz' 20;
  font-weight: 600; color: var(--ink); line-height: 1.2;
}
.vcard .vsub { display: block; font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.2rem; }
.vcard:hover .play span { background: var(--orange); }
.play span { transition: background 0.15s; }
.more-link { margin-top: 1.6rem; font-size: 0.9rem; }

/* ---------- Video lightbox ----------
   The iframe is written on click and removed on close, so YouTube is contacted only if
   someone actually chooses to watch, and closing genuinely stops playback. */
.lb {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 24, 72, 0.93);
  display: grid; place-items: center; padding: clamp(16px, 4vw, 48px);
}
.lb[hidden] { display: none; }
.lb-frame { width: min(1120px, 100%); aspect-ratio: 16/9; background: #000; border-radius: 8px; overflow: hidden; }
.lb-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.lb-close {
  position: absolute; top: clamp(10px, 2vw, 22px); right: clamp(10px, 2vw, 22px);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.35);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.lb-close:hover { background: rgba(255,255,255,0.24); }

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 36px); margin-top: 2.6rem; }
.projects.two-up { grid-template-columns: repeat(2, 1fr); }
.projects.two-up .pimg { height: 210px; }
/* The card is an <a>, so without this the whole card body inherits the orange link
   colour and the grid reads as three blocks of shouting. */
.project {
  border: 1px solid var(--rule); border-radius: 10px; overflow: hidden;
  background: var(--paper); color: var(--body); display: flex; flex-direction: column;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.project:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,24,72,0.08); }
.project .pimg { height: 168px; background: var(--paper-2); }
.project .pimg img { width: 100%; height: 100%; object-fit: cover; }
.project .pbody { padding: 1.3rem 1.4rem 1.5rem; flex: 1; display: flex; flex-direction: column; }
.project .ptag { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; margin-bottom: 0.5rem; }
.project h3 { margin-bottom: 0.45rem; }
.project p { font-size: 0.92rem; flex: 1; }
.project .plink { margin-top: 1rem; font-size: 0.88rem; font-weight: 600; color: var(--ink); transition: color 0.15s; }
.project:hover .plink { color: var(--accent); }

/* Award sits at the end of the Tools chapter, so it needs a gap and a rule, not a section. */
.split.award { margin-top: clamp(48px, 6vw, 84px); padding-top: clamp(36px, 4vw, 56px); border-top: 1px solid var(--rule); }
.split.award figure { max-width: 460px; }

/* ---------- Testimonials ---------- */
.quotes { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); margin-top: 2.4rem; }
.quote { border-left: 3px solid var(--orange); padding-left: 1.4rem; }
.quote blockquote {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'SOFT' 30, 'WONK' 0, 'opsz' 24;
  font-weight: 400; font-size: 1.08rem; line-height: 1.45; margin-bottom: 1rem; color: var(--ink);
}
.quote .who { font-size: 0.88rem; font-weight: 650; color: var(--ink); }
.quote .role { font-size: 0.84rem; color: var(--ink-soft); }
.quote .ctx { font-size: 0.86rem; color: var(--ink-soft); margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--rule); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 32px); }
.stat { border-top: 3px solid var(--yellow); padding-top: 1rem; }
.stat .n {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'SOFT' 20, 'WONK' 1, 'opsz' 60;
  font-weight: 500; font-size: clamp(2rem, 4vw, 3rem); line-height: 1; color: var(--on-dark);
}
.stat .l { font-size: 0.84rem; color: var(--on-dark-muted); margin-top: 0.5rem; }

/* ---------- Booking embed (/coaching) ---------- */
.booking-embed { margin-top: 1.8rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; }
.booking-embed iframe { width: 100%; min-height: 720px; border: 0; display: block; }

/* ---------- Contact ---------- */
.topics-intro { color: var(--on-dark-muted); margin-bottom: 0.8rem; }
.topics { list-style: none; max-width: 46em; }
.topics li {
  position: relative; padding-left: 1.5rem; margin-bottom: 0.5rem;
  font-size: 0.98rem; color: var(--on-dark);
}
.topics li::before {
  content: ''; position: absolute; left: 0; top: 0.62em;
  width: 8px; height: 8px; background: var(--yellow); border-radius: 2px;
}
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); margin-top: 2.8rem; }
.contact-card { border: 1px solid rgba(248,250,252,0.28); border-radius: 10px; padding: 1.8rem; }
.contact-card h3 { margin-bottom: 0.6rem; }
.contact-card p { font-size: 0.94rem; color: var(--on-dark-muted); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--rule); padding: 2.4rem 0; font-size: 0.85rem; color: var(--ink-soft); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
footer a { color: var(--ink-soft); }
footer strong { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .hero-photo img { margin: 0 auto; }
  .split, .split.text-right { grid-template-columns: 1fr; direction: ltr; }
  .videos { grid-template-columns: repeat(2, 1fr); }
  .projects, .projects.two-up { grid-template-columns: 1fr; }
  .split.award figure { max-width: none; }
  .quotes { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
  .contact-grid { grid-template-columns: 1fr; }
  header nav { display: none; }
  header nav.open {
    display: flex; flex-direction: column; align-items: flex-start;
    position: absolute; top: 62px; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 1.2rem var(--gut); gap: 1rem;
  }
  .nav-toggle {
    display: block; background: none; border: 1px solid var(--rule);
    border-radius: 8px; padding: 6px 10px; font-size: 0.85rem;
    font-family: inherit; color: var(--ink); cursor: pointer;
  }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .videos { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cta-row .btn { width: 100%; }
}
