/* =============================================================================
   Henry Weston — layout & design. You normally won't need to touch this file;
   all text lives in content.js. Colours are set once, right here:
   ============================================================================= */
:root {
  --black: #000000;
  --panel: #0b0b0d;      /* slightly lifted panel background */
  --panel-2: #121216;
  --white: #ffffff;
  --muted: #a7adba;      /* secondary text */
  --line: #24262e;       /* hairline borders */
  --accent: #78C8FF;     /* light blue accent */
  --accent-ink: #04121f; /* text on top of accent */
  --wrap: 1080px;
  --radius: 14px;
}

/* ---- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--black);
  color: var(--white);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Accessibility: visible focus + skip link */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ---- Layout helpers ------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.wrap--narrow { max-width: 720px; }

.section { padding: 72px 0; border-top: 1px solid var(--line); }
.section--alt { background: var(--panel); }
.section__title {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 32px;
  padding-left: 16px;
  border-left: 5px solid var(--accent);
  line-height: 1.15;
}

/* =====================  HERO  ===================== */
.hero {
  position: relative;
  min-height: 92vh;
  min-height: 92svh;
  display: flex;
  align-items: flex-end;
  background: var(--black);
  overflow: hidden;
}
/* Hero photo as a real <img> — better LCP than a CSS background, and lets the
   browser pick WebP with a JPEG fallback. */
.hero__bg {
  position: absolute;
  inset: 0;
  display: block;
}
.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
/* Gradient scrim so text stays legible over any photo */
.hero__overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.15) 40%, rgba(0,0,0,0.92) 100%),
    radial-gradient(120% 80% at 15% 100%, rgba(0,0,0,0.6), transparent 60%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px 56px;
}
.badge {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero__name {
  font-size: clamp(2.8rem, 11vw, 6rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.hero__position {
  color: var(--accent);
  font-weight: 700;
  font-size: clamp(1rem, 3.5vw, 1.4rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 12px;
}
.hero__tagline { color: var(--muted); margin-top: 6px; font-size: 1rem; }

.hero__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 28px;
}
.hero__nav a {
  color: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.hero__nav a:hover { border-color: var(--accent); text-decoration: none; }

/* =====================  VIDEO  ===================== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.video-card__title {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--accent);
}
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-embed iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: 0;
}
/* Click-to-play facade: no YouTube code loads until the visitor hits play,
   which keeps the page fast (big Lighthouse win). */
.video-facade {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  padding: 0; border: 0; margin: 0;
  background: var(--panel-2);
  cursor: pointer;
  display: block;
}
.video-facade__thumb {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.video-facade__play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 72px; height: 50px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  transition: background 0.15s ease, transform 0.1s ease;
}
.video-facade__play::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
}
.video-facade:hover .video-facade__play,
.video-facade:focus-visible .video-facade__play {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.05);
}
.video-facade:hover .video-facade__play::after,
.video-facade:focus-visible .video-facade__play::after {
  border-left-color: var(--accent-ink);
}

/* =====================  PROFILE  ===================== */
.facts {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 44px;
}
.facts li {
  background: var(--panel-2);
  padding: 16px 18px;
}
.facts .facts__label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.facts .facts__value { font-weight: 800; font-size: 1.05rem; }

.profile-block { margin-bottom: 40px; }
.profile-block:last-child { margin-bottom: 0; }
.profile-block--technical { overflow: hidden; } /* contains the floated portrait */

/* Portrait photo that the Technical Profile text wraps around */
.profile-portrait {
  float: right;
  width: 320px;
  max-width: 42%;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 18px 26px;
}
.profile-portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}
.profile-block__heading {
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.profile-block__intro { color: var(--muted); margin-bottom: 18px; max-width: 60ch; }

/* Attribute chips */
.attributes {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.attributes li {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}

/* Experience / academy cards */
.card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.card:last-child { margin-bottom: 0; }
.card__club { font-weight: 800; font-size: 1.05rem; }
.card__meta {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 3px;
}
.card__lines { list-style: none; margin-top: 12px; }
.card__lines li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  margin-bottom: 6px;
}
.card__lines li::before {
  content: ""; position: absolute; left: 0; top: 0.7em;
  width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
}
.academy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.academy-grid .card { margin-bottom: 0; }

/* =====================  IN ACTION (GALLERY)  ===================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.gallery a {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-2);
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.gallery a:hover { transform: translateY(-2px); border-color: var(--accent); }
.gallery picture { display: block; }
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

/* =====================  PROSE / AVAILABILITY  ===================== */
.prose p { color: var(--muted); margin-bottom: 14px; max-width: 65ch; }
.prose p:first-child { color: var(--white); font-size: 1.1rem; font-weight: 600; }

/* =====================  BUTTONS  ===================== */
.btn {
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.9rem;
  padding: 14px 26px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #96d5ff; }
.btn--resume { margin-top: 26px; }

/* =====================  CONTACT  ===================== */
.contact__intro { color: var(--muted); margin-bottom: 22px; }
.contact__direct { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }
.contact__direct a {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: 10px;
  color: var(--white);
  font-weight: 600;
}
.contact__direct a:hover { border-color: var(--accent); text-decoration: none; }
.contact__direct .lbl { color: var(--muted); font-size: 0.85rem; }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field textarea {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--white);
  font: inherit;
  padding: 13px 15px;
  width: 100%;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(120,200,255,0.2);
}
.field textarea { resize: vertical; }
.form__status { color: var(--accent); font-weight: 600; min-height: 1.2em; }

/* =====================  FOOTER  ===================== */
.footer { padding: 40px 0; border-top: 1px solid var(--line); text-align: center; }
.footer p:first-child { font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.footer__small { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.footer__top { display: inline-block; margin-top: 14px; font-weight: 700; font-size: 0.85rem; }

/* =====================  RESPONSIVE  ===================== */
@media (max-width: 760px) {
  .section { padding: 54px 0; }
  .video-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .academy-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .hero { min-height: 88vh; min-height: 88svh; }
  /* Portrait sits full-width above the text on phones instead of floating */
  .profile-portrait {
    float: none;
    width: 100%;
    max-width: 340px;
    margin: 0 0 20px 0;
  }
}
@media (max-width: 380px) {
  .facts { grid-template-columns: 1fr; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
