/* ============================================================
   HP AI Foundry — landing page styles
   Branding mirrors HP Gaming Garage:
   - Palette: black / white, with HP blue accents
   - Type:    HP Forma DJR Office (self-hosted, assets/ttf/)
   - Buttons: solid black, square corners (0 radius)
   - Layout:  high-contrast, generous whitespace, square cards,
              alternating light/dark feature sections
   ============================================================ */

/* ---------- Brand font: HP Forma DJR Office (self-hosted) ---------- */
@font-face {
  font-family: "HP Forma DJR";
  src: url("../assets/ttf/HPFormaDJROffice-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "HP Forma DJR";
  src: url("../assets/ttf/HPFormaDJROffice-Italic.ttf") format("truetype");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "HP Forma DJR";
  src: url("../assets/ttf/HPFormaDJROffice-Medium.ttf") format("truetype");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "HP Forma DJR";
  src: url("../assets/ttf/HPFormaDJROffice-MediumItalic.ttf") format("truetype");
  font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "HP Forma DJR";
  src: url("../assets/ttf/HPFormaDJROffice-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "HP Forma DJR";
  src: url("../assets/ttf/HPFormaDJROffice-BoldItalic.ttf") format("truetype");
  font-weight: 700; font-style: italic; font-display: swap;
}

:root {
  --black:   #000000;
  --ink:     #1E1E22;   /* near-black for dark sections */
  --white:   #FFFFFF;
  --gray:    #595959;   /* muted body text — darkened to ~7:1 on white for WCAG AA */
  --gray-2:  #555555;
  --line:    #E0E0E0;   /* hairline borders */
  --bg-soft: #F4F4F4;   /* light card / section fill */
  --accent:  #024AD8;   /* electric blue accent (matches source site) */
  --hp-blue: #0096D6;   /* HP master-brand blue */

  --font: "HP Forma DJR", "Archivo", Arial, Helvetica, sans-serif;
  --maxw: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Anchor targets clear the sticky header */
section[id], .track[id] { scroll-margin-top: 84px; }

/* ---------- Scroll-reveal (elements get .reveal via JS, .in when visible) ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Accessibility: visible keyboard focus (WCAG 2.4.7) ---------- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Typography ---------- */
h1, h2, h3 { font-weight: 700; line-height: 1.1; margin: 0 0 0.4em; }
h1 { font-size: clamp(40px, 6vw, 64px); }
h2 { font-size: clamp(32px, 4.5vw, 50px); }
h3 { font-size: 22px; }
p  { font-size: 16px; color: var(--gray); margin: 0 0 1em; }
.eyebrow { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 12px; }

/* ---------- Buttons (square, high-contrast) ---------- */
.btn { display: inline-block; background: var(--black); color: var(--white); padding: 12px 28px; font-size: 15px; font-weight: 700; border: 2px solid var(--black); border-radius: 0; cursor: pointer; transition: background .15s, color .15s; }
.btn:hover { background: var(--white); color: var(--black); }
/* Arrow that slides in on hover */
.btn::after {
  content: "\2192"; display: inline-block; width: 0; opacity: 0; overflow: hidden;
  transform: translateX(-6px); vertical-align: baseline;
  transition: width .2s ease, opacity .2s ease, transform .2s ease, margin-left .2s ease;
}
.btn:hover::after, .btn:focus-visible::after { width: 1em; opacity: 1; transform: none; margin-left: 8px; }
.btn--ghost { background: transparent; color: var(--black); }
.btn--ghost:hover { background: var(--black); color: var(--white); }
.btn--sm { padding: 8px 18px; font-size: 14px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white); border-bottom: 1px solid var(--line);
  transition: background .25s, box-shadow .25s;
}
.site-header.is-scrolled {
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; transition: height .25s; }
.site-header.is-scrolled .nav { height: 56px; }
/* Thin reading-progress bar under the header */
.scroll-progress {
  position: absolute; left: 0; bottom: -1px; height: 2px; width: 0;
  background: var(--accent); z-index: 51;
}
.nav__logo { display: flex; align-items: center; gap: 10px; }
.nav__logo img { height: 40px; width: auto; }
.nav__logo span { font-weight: 700; font-size: 18px; }
.nav__links { display: flex; gap: 28px; align-items: center; }
.nav__links a { font-size: 15px; }
.nav__links a:hover { color: var(--accent); }
/* Animated underline + scrollspy active state (desktop) */
.nav__links a:not(.btn) { position: relative; }
.nav__links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.nav__links a:not(.btn):hover::after,
.nav__links a:not(.btn).is-active::after { transform: scaleX(1); }
.nav__links a.is-active { color: var(--accent); }

/* Hamburger toggle — hidden on desktop, shown on mobile */
.nav__toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 10px;
  flex-direction: column; gap: 5px;
}
.nav__toggle span {
  display: block; width: 24px; height: 2px; background: var(--black);
  transition: transform .2s, opacity .2s;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- FAQ accordion ---------- */
/* Smooth open/close on modern browsers (Chrome/Edge 131+); others fall back to instant */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .faq__item::details-content {
    block-size: 0; overflow: hidden; opacity: 0;
    transition: block-size .35s ease, opacity .3s ease, content-visibility .35s allow-discrete;
  }
  .faq__item[open]::details-content { block-size: auto; opacity: 1; }
}
.faq { max-width: 820px; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  list-style: none; cursor: pointer; padding: 18px 36px 18px 0; position: relative;
  font-weight: 700; font-size: 17px; color: var(--black);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 24px; font-weight: 400; color: var(--accent); transition: transform .2s;
}
.faq__item[open] summary::after { content: "\2212"; }
.faq__item p { margin: 0 0 18px; max-width: 70ch; }
.faq__item a { color: var(--accent); text-decoration: underline; }

/* ---------- Legal pages ---------- */
.legal { max-width: 760px; }
.legal h1 { font-size: clamp(32px, 5vw, 46px); margin-bottom: 6px; }
.legal h2 { font-size: 22px; margin: 32px 0 8px; }
.legal p { max-width: 70ch; }
.legal__date { color: var(--gray); font-size: 14px; margin-bottom: 28px; }
.legal a { color: var(--accent); text-decoration: underline; }
.legal__back { margin-top: 40px; font-weight: 700; }
.legal__back a { text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 120px 0;
  overflow: hidden;
  color: var(--white);
  background: #080C18; /* fallback while the image loads */
}
/* Image layer — animated with a slow Ken Burns zoom */
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(90deg, rgba(8,12,24,.92) 0%, rgba(8,12,24,.78) 45%, rgba(8,12,24,.45) 100%),
    url("../assets/images/hero.webp");
  background-size: cover;
  background-position: center right;
  animation: hero-zoom 26s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes hero-zoom { from { transform: scale(1); } to { transform: scale(1.07); } }
@media (prefers-reduced-motion: reduce) { .hero::before { animation: none; } }
.hero__inner { max-width: 660px; position: relative; z-index: 1; }
/* Subtle animated gradient on a key phrase */
.grad {
  background: linear-gradient(100deg, #FFFFFF 0%, #8FB4FF 35%, #59C4F7 55%, #FFFFFF 80%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: grad-shift 7s ease-in-out infinite;
}
@keyframes grad-shift { 0%,100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
.hero .eyebrow { color: #8FB4FF; }
.hero h1 { color: var(--white); text-wrap: balance; }
.hero__lede { color: #E6E9F2; font-size: 18px; max-width: 52ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.btn--on-dark { color: var(--white); border-color: var(--white); }
.btn--on-dark:hover { background: var(--white); color: var(--black); }

/* ---------- Section scaffolding ---------- */
.section { padding: 72px 0; }
.section--soft { background: var(--bg-soft); }
.section--dark { background: var(--ink); color: var(--white); }
.section--dark h2, .section--dark h3 { color: var(--white); }
.section--dark p { color: #c9c9cf; }
.section__head { max-width: 760px; margin-bottom: 40px; }

/* ---------- Course cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--white); border: 1px solid var(--line); display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 14px 36px rgba(0,0,0,.10); border-color: #cfcfcf; }
.card__img { aspect-ratio: 3/2; object-fit: cover; width: 100%; height: auto; display: block; transition: transform .45s ease; }
.card:hover .card__img { transform: scale(1.04); }
.card__body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin-bottom: 8px; min-height: 2.4em; }
.nowrap { white-space: nowrap; }
.card p { flex: 1; }
.card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.card__dur { font-size: 13px; font-weight: 700; color: var(--gray-2); }
.card .eyebrow { margin-bottom: 6px; }

/* Coming-soon course cards */
.card--soon { position: relative; }
.card--soon:hover { transform: none; box-shadow: 0 1px 3px rgba(0,0,0,.06); border-color: var(--line); }
.card--soon:hover .card__img { transform: none; }
.badge-soon {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  background: var(--ink); color: var(--white);
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px;
}
.btn--disabled {
  background: var(--bg-soft); color: var(--gray-2); border: 1px solid var(--line);
  cursor: not-allowed; pointer-events: none;
}
.track__soon {
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--gray-2); background: var(--bg-soft); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}

/* ---------- Stats / facts row ---------- */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { text-align: center; padding: 24px 8px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font-size: clamp(28px, 3vw, 40px); font-weight: 700; line-height: 1.1; color: var(--accent); }
.stat span { font-size: 13px; text-transform: uppercase; letter-spacing: 2px; color: var(--gray); }

/* ---------- Feature grid (programme overview) ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.feature { background: var(--white); border: 1px solid var(--line); padding: 24px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { margin: 0; }

/* ---------- Curriculum tracks ---------- */
.track { margin-bottom: 40px; }
.track > h3 { font-size: 22px; border-left: 4px solid var(--accent); padding-left: 14px; margin-bottom: 18px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.track__link { font-size: 14px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.track__link:hover { text-decoration: underline; }
.modules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 32px; }
.modules li { display: flex; align-items: baseline; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px; color: var(--black); }
.modules li span { font-weight: 700; color: var(--accent); font-size: 14px; min-width: 24px; }

/* ---------- Split (text + media) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.split img { border: 1px solid var(--line); width: 100%; }
/* Transparent instructor cutout — no border, no crop, sits on the section background */
.split__img { border: 1px solid var(--line); height: auto; display: block; width: 100%; max-width: 380px; margin: 0 auto; }
.split__cta { display: flex; flex-wrap: wrap; gap: 14px; }
@media (min-width: 901px) {
  .split > div:last-child { align-self: start; }
  /* Lift the instructor photo grid up to align with the heading */
  .teach-grid { margin-top: -150px; }
}

/* ---------- Instructor photo grid (2×2 squares, right column) ---------- */
.teach-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: auto; gap: 16px; align-content: start;
}
.split .teach-grid__img {
  width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover;
  display: block; border: 1px solid var(--line); max-width: none;
  border-radius: 14px;
}

.checklist { list-style: none; margin: 0 0 24px; padding: 0; }
.checklist li { position: relative; padding: 10px 0 10px 32px; border-bottom: 1px solid var(--line); font-size: 16px; color: var(--gray); }
.checklist li strong { color: var(--black); }
.checklist li::before { content: ""; position: absolute; left: 0; top: 16px; width: 14px; height: 8px; border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg); }

/* ---------- Meet your instructor ---------- */
.instructor { display: grid; grid-template-columns: 320px 1fr; gap: 48px; align-items: start; }
.instructor__photo img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border: 1px solid var(--line); }
.instructor__name { margin-top: 16px; }
.instructor__name strong { display: block; font-size: 20px; }
.instructor__name span { font-size: 14px; color: var(--accent); font-weight: 700; }
.instructor__bio .lead { font-size: 24px; font-weight: 700; color: var(--black); line-height: 1.3; margin-bottom: 20px; border-left: 4px solid var(--accent); padding-left: 16px; }
.instructor__bio p { font-size: 16px; }
.instructor__bio strong { color: var(--black); }

/* ---------- Faculty ---------- */
.people { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.person { text-align: center; }
.person img { aspect-ratio: 1/1; object-fit: cover; width: 100%; margin-bottom: 12px; }
.person strong { display: block; font-size: 16px; }
.person span { font-size: 13px; color: var(--gray); }

/* ---------- Labs / hackathons gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery figure { margin: 0; }
.gallery img { aspect-ratio: 3/2; object-fit: cover; width: 100%; }
.gallery figcaption { font-size: 14px; font-weight: 700; margin-top: 8px; }

/* ---------- Partners ---------- */
.partners { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; align-items: center; }
.partners img { width: 100%; opacity: .9; }

/* ---------- Testimonial ---------- */
.quote { max-width: 820px; margin: 0 auto; text-align: center; }
.quote__mark { width: 64px; margin: 0 auto 16px; }
.quote__text { font-size: 22px; line-height: 1.5; color: var(--white); font-weight: 400; }
.quote__person { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 24px; }
.quote__person img { width: 56px; height: 56px; object-fit: cover; }
.quote__person strong { display: block; }
.quote__person span { font-size: 13px; color: #c9c9cf; }

/* ---------- How to enroll: 5-step stepper ---------- */
.steps { list-style: none; margin: 0 0 32px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.step { background: var(--white); border: 1px solid var(--line); padding: 24px 20px; position: relative; }
.step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-bottom: 14px;
  background: var(--accent); color: var(--white); font-weight: 700; font-size: 18px;
}
.step h3 { font-size: 17px; margin-bottom: 8px; }
.step p { font-size: 15px; margin: 0; }
.step code {
  font-family: inherit; font-weight: 700; color: var(--black);
  background: var(--bg-soft); border: 1px dashed var(--accent); padding: 2px 6px;
  font-size: 14px; word-break: break-all; display: inline-block; margin: 2px 0;
}
.steps__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.steps__tip { font-size: 14px; color: var(--gray); margin: 0; }
@media (max-width: 1100px) { .steps { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .steps { grid-template-columns: 1fr; } }

/* ---------- Back-to-top ---------- */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 48px; height: 48px; border: 2px solid var(--black); border-radius: 0;
  background: var(--black); color: var(--white); font-size: 20px; line-height: 1; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s, transform .25s, visibility .25s, background .15s, color .15s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--white); color: var(--black); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--gray); }
.site-footer .row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.site-footer a { color: var(--gray); }
.site-footer a:hover { color: var(--accent); }
.site-footer nav { display: flex; gap: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { padding: 88px 0; }
  .hero::before { background-image:
    linear-gradient(180deg, rgba(8,12,24,.82) 0%, rgba(8,12,24,.70) 100%),
    url("../assets/images/hero.webp"); background-position: center; }
  .hero__inner { max-width: 100%; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .people { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .partners { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .instructor { grid-template-columns: 1fr; gap: 24px; }
  .instructor__photo { max-width: 320px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--line); }
  .modules { grid-template-columns: 1fr; }

  .nav__toggle { display: flex; }
  .nav__links {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    padding: 8px 24px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
  .nav__links a.btn { margin-top: 12px; border: 2px solid var(--black); text-align: center; padding: 12px; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .stat { border-right: 0; }
}

/* ---------- Cookie consent banner ---------- */
.cookie-consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  max-width: 640px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  background: var(--ink); color: var(--white);
  padding: 16px 20px; border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.28);
}
.cookie-consent__text { flex: 1 1 260px; font-size: 14px; line-height: 1.5; margin: 0; }
.cookie-consent__text a { color: #fff; text-decoration: underline; }
.cookie-consent__actions { display: flex; gap: 10px; flex: 0 0 auto; }
.cookie-consent__btn {
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  padding: 10px 20px; border-radius: 6px; border: 2px solid transparent;
}
.cookie-consent__btn--accept { background: var(--accent); color: var(--white); }
.cookie-consent__btn--accept:hover { filter: brightness(1.1); }
.cookie-consent__btn--ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.5); }
.cookie-consent__btn--ghost:hover { border-color: #fff; }
