/* ==========================================================================
   Pragmatic Coders 2026 redesign - home page
   Sections: hero transition ("from classroom to Pragmatic"), numbers band, why us,
   testimonials, call to action. Course cards are shared by the hero.
   Loaded only by the home page (see Views/Partials/Pages/HomePage.cshtml).
   ========================================================================== */

.seats { font-size: 12.5px; margin-top: 3px; color: var(--muted); }
.seats.low { color: var(--accent-text); font-weight: 600; }

/* ---------- Stats band ---------- */
.stats-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 34px 28px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-value { font-size: clamp(34px, 4vw, 52px); font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.stat-value small { font-size: .55em; color: var(--accent-text); margin-left: 2px; }
.stat-label { margin-top: 10px; color: var(--muted); font-size: 14.5px; }

/* ---------- Sections ---------- */
.section { padding: 104px 0; }
.section-tight { padding: 72px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.section-head p { margin-top: 14px; }

/* Course card cover (tech logo on a coloured tile) */
.course-cover {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center;
  background: var(--cover-bg, var(--navy));
}
.course-cover::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 75%);
}
.course-cover .cover-logo {
  position: relative; width: 34%; max-width: 120px; aspect-ratio: 1; display: grid; place-items: center;
  border-radius: 26%; background: rgba(255,255,255,.96); box-shadow: 0 20px 40px -12px rgba(0,0,0,.45);
  transition: transform .5s var(--ease);
}
.cover-logo img { width: 58%; height: 58%; }
.cover-word {
  position: absolute; left: 20px; bottom: 14px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  color: rgba(255,255,255,.8); text-transform: uppercase;
}
.price { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.price small { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: 0; }

.hero-copy .eyebrow { color: var(--accent-text); }
.hero-copy h1 { font-size: clamp(48px, 6.4vw, 92px); line-height: .96; letter-spacing: -.048em; margin-top: 18px; }
.hero-copy h1 em { font-style: normal; color: var(--red); }
.hero-copy p { margin-top: 22px; font-size: 19px; line-height: 1.6; color: var(--muted); max-width: 44ch; }

/* Course cards (used in the hero) */
.deal-card {
  display: flex; flex-direction: column; border-radius: var(--r-card); overflow: hidden;
  background: #FCFCFD; color: var(--navy); text-decoration: none !important;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06);
  will-change: transform; transition: box-shadow .3s var(--ease);
}
.deal-card:hover { box-shadow: 0 36px 70px -18px rgba(0, 0, 0, .65), 0 0 0 2px var(--red); }
.deal-card .course-cover { aspect-ratio: 16 / 10; }
/* Preset cover colours, in turn; a colour picked on the card in Umbraco (inline --cover-bg) wins */
.deal-card:nth-child(4n+1) .course-cover { --cover-bg: #0B2738; }
.deal-card:nth-child(4n+2) .course-cover { --cover-bg: #01131D; }
.deal-card:nth-child(4n+3) .course-cover { --cover-bg: #E00E19; }
.deal-card:nth-child(4n+4) .course-cover { --cover-bg: #2E3B45; }
.deal-card .cover-logo { width: 38%; }
.deal-card-body { padding: 14px 16px 16px; display: grid; gap: 8px; }
.deal-card-body h3 { font-size: 17px; letter-spacing: -.02em; line-height: 1.25; min-height: 2.5em; }
.deal-meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; font-size: 13.5px; color: #56636E; }
.deal-meta .seats { display: block; margin-top: 1px; font-size: 12px; }
.deal-meta .seats.low { color: #C40B15; }
.deal-meta .price { font-size: 18px; color: var(--navy); }

/* Why section: sticky split */
.why-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 72px; align-items: start; }
.why-sticky { position: sticky; top: 108px; }
.photo-slot { margin-top: 32px; border-radius: var(--r-card); aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); }
.photo-slot .slot-photo { width: 100%; height: 100%; object-fit: cover; }
.why-list { display: grid; gap: 0; }
.why-item { display: grid; grid-template-columns: 56px 1fr; gap: 22px; padding: 34px 0; border-top: 1px solid var(--line); }
.why-item:last-child { border-bottom: 1px solid var(--line); }
.why-icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-size: 26px;
}
.why-item h3 { font-size: 23px; letter-spacing: -.025em; }
.why-item p { margin-top: 10px; color: var(--muted); font-size: 16px; max-width: 52ch; }

/* Testimonials */
.quotes-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.quote-feature {
  grid-row: span 2; border-radius: 24px; padding: 44px; color: #ECECEC; position: relative; overflow: hidden;
  background: radial-gradient(90% 70% at 100% 0%, rgba(224,14,25,.45), transparent 60%), linear-gradient(170deg, #0B2738, var(--navy));
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-height: 420px;
}
.quote-feature blockquote { margin: 0; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.22; letter-spacing: -.025em; font-weight: 600; text-wrap: balance; }
.quote-feature .rating { color: #FFB020; display: flex; gap: 3px; font-size: 18px; }
.quote-small { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.quote-small blockquote { margin: 0; font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.who { display: flex; align-items: center; gap: 12px; }
.who strong { display: block; font-size: 15px; }
.who span { font-size: 13px; color: var(--muted); }
.quote-feature .who span { color: rgba(236,236,236,.7); }
.quote-feature .who .avatar { background: #ECECEC; color: var(--navy); }
.rating-summary { display: flex; align-items: center; gap: 14px; }
.rating-summary .big { font-size: 44px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }

/* CTA band */
.cta-band {
  border-radius: 28px; padding: 64px; position: relative; overflow: hidden; color: #fff; background: var(--red);
  display: grid; grid-template-columns: 1.3fr auto; gap: 32px; align-items: center;
}
.cta-band h2 { font-size: clamp(32px, 4vw, 54px); color: #fff; }
.cta-band p { margin-top: 14px; font-size: 18px; color: rgba(255,255,255,.88); max-width: 46ch; }
.cta-band .btn-dark { background: var(--navy); color: #ECECEC; }
.cta-band .btn-dark:hover { background: #fff; color: var(--navy); }
.cta-band .band-mark { position: absolute; right: -90px; bottom: -150px; width: 420px; opacity: .16; pointer-events: none; }

/* ---------- Responsive: home sections ---------- */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .section { padding: 72px 0; }
  .why-grid, .quotes-grid { grid-template-columns: 1fr; }
  .why-sticky { position: static; }
  .why-grid { gap: 32px; }
  .quote-feature { grid-row: auto; min-height: 0; padding: 32px; }
  .cta-band { grid-template-columns: 1fr; padding: 40px 28px; }
}
@media (max-width: 640px) {
  .stat { padding: 24px 16px; }
  .hero-copy h1 { font-size: 46px; }
  .hero-copy p { font-size: 17px; }
  .deal-card-body { padding: 12px 12px 14px; }
  .deal-card-body h3 { font-size: 15px; }
  .deal-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
  .deal-card .cover-word { display: none; }
  .deal-card .cover-logo { width: 44%; }
}

/* ==========================================================================
   Hero: "from classroom to Pragmatic" (animated by scripts/redesign/home-hero.js)
   ========================================================================== */
.he-stage { position: relative; }

/* Photo hero */
.he-photo { position: relative; height: min(78dvh, 760px); min-height: 520px; overflow: hidden; background: var(--surface-2); }
/* Photo layout (desktop): anchored right and sized so the group always starts just past the copy
   (width capped at 94% of the screen). On screens taller than the photo, the wooden table simply
   continues below it, and on very wide screens the wall continues on the left. */
.he-photo { background: linear-gradient(180deg, #ABAEA6 0%, #C9CAC7 30%, #CBCCCA 62%, #B39A84 82%, #B8977C 100%); }
/* Wide screens (2:1 and wider): the photo fills the full height, so only wall shows around it */
@media (min-aspect-ratio: 2/1) { .he-photo { background: linear-gradient(180deg, #ABAEA6 0%, #C9CAC7 30%, #CBCCCA 100%); } }
.he-photo img {
  --h: min(107%, 52.5vw);                 /* 52.5vw = 94vw / 1.791 (the photo's aspect ratio) */
  position: absolute; right: 0; left: auto; width: auto; height: var(--h); min-width: 0;
  top: min(0px, calc(100% - var(--h)));  /* full-height: lifted 7% so the group sits higher; capped: flush top */
  object-fit: cover; object-position: right 40%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%), linear-gradient(180deg, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0, #000 9%), linear-gradient(180deg, #000 88%, transparent 100%);
  mask-composite: intersect;
}
.he-fade { display: none; } /* no overlay: the photo's own clean wall carries the text */
.he-tint { position: absolute; inset: 0; opacity: 0; visibility: hidden; background: radial-gradient(60% 60% at 40% 35%, #FF3B45, #E00E19 60%, #C40B15); }
.he-mark { display: none; }

.he-copy-wrap { position: absolute; inset: 0; display: flex; align-items: center; padding-top: 68px; pointer-events: none; }
.he-copy { pointer-events: auto; max-width: 600px; }
.he-copy h1 { font-size: clamp(56px, 7.2vw, 116px); line-height: .92; letter-spacing: -.055em; margin-top: 0; max-width: 7.5ch; }
.he-copy p { font-size: 19px; color: var(--ink-2); max-width: 30ch; }
/* The photo is always light, so the hero copy keeps light-theme colours even in dark mode */
.he-copy-wrap { --ink: #01131D; --ink-2: #2E3B45; --line-strong: rgba(1, 19, 29, .22); color: var(--ink); }
.he-copy h1 { color: var(--ink); }
.he-copy .hero-ctas { margin-top: 32px; }
.he-ghost { background: rgba(252, 252, 253, .7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* One real product moment over the photo: tonight's live session */
.he-live {
  position: absolute; right: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))); bottom: 9%;
  width: 290px; padding: 18px 20px; border-radius: 20px;
  background: rgba(252, 252, 253, .92); border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 30px 60px -24px rgba(1, 19, 29, .35);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--navy);
}
.he-live-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #C40B15; }
.he-dot { width: 8px; height: 8px; border-radius: 50%; background: #E00E19; box-shadow: 0 0 0 4px rgba(224, 14, 25, .15); }
@media (prefers-reduced-motion: no-preference) {
  .he-dot { animation: heLive 1.8s ease-in-out infinite; }
  @keyframes heLive { 50% { box-shadow: 0 0 0 7px rgba(224, 14, 25, .05); } }
}
.he-live strong { display: block; font-size: 19px; letter-spacing: -.02em; margin-top: 8px; }
.he-live-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: #56636E; }
.he-faces { display: flex; }
.he-faces span {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; margin-left: -8px;
  font-size: 10px; font-weight: 700; color: #fff; background: var(--navy); border: 2px solid #FCFCFD;
}
.he-faces span:first-child { margin-left: 0; background: #E00E19; }
.he-faces span:nth-child(3) { background: #2E3B45; }

/* After the transition: logo, title, the four courses */
.he-after { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 72px var(--gutter) 88px; text-align: center; }
.he-logo-slot { width: 88px; height: 88px; }
.he-logo { width: 100%; height: 100%; display: block; filter: drop-shadow(0 16px 30px rgba(224, 14, 25, .35)); }
.he-title { font-size: clamp(36px, 4.4vw, 60px); letter-spacing: -.045em; }
.he-cards { text-align: left; display: grid; grid-template-columns: repeat(4, minmax(0, 260px)); gap: 20px; justify-content: center; width: 100%; perspective: 1400px; }
.he .deal-card { box-shadow: 0 1px 2px rgba(1, 19, 29, .06), 0 28px 50px -26px rgba(1, 19, 29, .35); border: 1px solid var(--line); }
.he .deal-card:hover { box-shadow: 0 32px 60px -24px rgba(1, 19, 29, .4), 0 0 0 2px var(--red); }

/* Live (pinned) layout */
.he.is-live .he-stage { height: 100vh; height: 100svh; min-height: 700px; overflow: hidden; background: var(--bg); }
.he.is-live .he-photo { position: absolute; inset: 0; height: auto; min-height: 0; will-change: clip-path; }
.he.is-live .he-mark { display: block; position: absolute; overflow: visible; z-index: 2; pointer-events: none; visibility: hidden;
  left: var(--mark-x, 0); top: var(--mark-y, 0); width: var(--mark-size, 0); height: var(--mark-size, 0); }
.he-mark-path { fill: #fff; stroke: #fff; stroke-width: 7; stroke-linejoin: round; }
.he.is-live .he-copy-wrap { z-index: 3; }
.he.is-live .he-live { z-index: 3; }
.he.is-live .he-after { position: absolute; inset: 0; justify-content: center; padding: 100px var(--gutter) 32px; z-index: 1; }
.he.is-live .he-logo-slot, .he.is-live .he-title, .he.is-live .he-cta, .he.is-live .he-cards .deal-card { visibility: hidden; }

@media (max-width: 900px) {
  .he-photo { height: auto; min-height: 0; aspect-ratio: auto; }
  .he-photo img { position: relative; width: 100%; height: 340px; min-width: 0; object-position: 64% 50%; -webkit-mask-image: none; mask-image: none; }
  .he-fade { display: none; }
  .he-copy-wrap { position: relative; display: block; padding: 40px var(--gutter) 8px; }
  .he:not(.is-live) .he-photo { margin-top: 0; }
  .he:not(.is-live) .he-photo img { height: 408px; padding-top: 0; }
  .he-copy { max-width: none; }
  .he-copy h1 { max-width: none; }
  .he-live { display: none; }
  .he-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; }
}
@media (max-width: 640px) {
  .he-copy h1 { font-size: 52px; }
  .he-copy p { font-size: 17px; }
  .he-after { padding: 48px var(--gutter) 64px; }
}

/* ==========================================================================
   Phones & tablets: the same transition, laid out for portrait screens.
   Landscape phones (height under 540px) get the static layout instead (see canAnimate).
   ========================================================================== */

/* Phones: courses become a compact list so all four fit on one screen (static and live) */
@media (max-width: 640px) {
  .he-cards { grid-template-columns: 1fr; max-width: 460px; gap: 10px; }
  .he .deal-card { flex-direction: row; align-items: stretch; border-radius: 16px; }
  .he .deal-card .course-cover { width: 76px; flex: none; aspect-ratio: auto; }
  .he .deal-card .cover-logo { width: 62%; border-radius: 24%; }
  .he .deal-card .cover-word { display: none; }
  .he .deal-card-body { flex: 1; min-width: 0; padding: 12px 14px; gap: 4px; align-content: center; }
  .he .deal-card-body h3 { font-size: 15.5px; min-height: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .he .deal-meta { flex-direction: row; align-items: flex-end; font-size: 12.5px; }
  .he .deal-meta .price { font-size: 16px; }
}

/* Animated mode on phones and tablets */
@media (max-width: 900px) {
  .he.is-live .he-stage { min-height: 548px; }
  /* Phones/tablets: the photo starts below the copy (--photo-top is measured in scripts/redesign/home-hero.js);
     above it the wall continues in the photo's own colour, softly blended */
  .he.is-live .he-photo { background: linear-gradient(180deg, #E7E5E1 0%, #DFDBD7 100%); }
  .he.is-live .he-photo img {
    position: absolute; inset: auto 0 0 0; top: var(--photo-top, 0px); width: 100%; height: calc(100% - var(--photo-top, 0px));
    min-width: 0; object-position: 64% 50%;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 72px); mask-image: linear-gradient(180deg, transparent 0, #000 72px);
  }
  .he.is-live .he-copy-wrap { position: absolute; inset: 0; display: block; padding: 96px var(--gutter) 0; }
  .he.is-live .he-copy { max-width: 560px; }
  .he.is-live .he-copy h1 { max-width: none; }
  .he.is-live .he-copy .hero-ctas { margin-top: 22px; }
  .he.is-live .he-live {
    display: block; left: var(--gutter); right: var(--gutter); bottom: 16px; width: auto; max-width: 380px; margin: 0 auto;
    padding: 14px 16px;
  }
  .he.is-live .he-live strong { font-size: 17px; margin-top: 6px; }
  .he.is-live .he-live-foot { margin-top: 10px; }
  .he.is-live .he-after { gap: 20px; padding: 88px var(--gutter) 20px; }
  .he-logo-slot { width: 72px; height: 72px; }
  .he-title { font-size: clamp(30px, 6.4vw, 48px); }
}

/* Phones: tighter hero copy, buttons side by side */
@media (max-width: 640px) {
  .he.is-live .he-copy-wrap { padding-top: 88px; }
  .he.is-live .he-copy h1 { font-size: clamp(42px, 13vw, 56px); }
  .he.is-live .he-copy p { font-size: 16px; margin-top: 14px; }
  .he.is-live .he-copy .hero-ctas { flex-wrap: nowrap; gap: 8px; margin-top: 18px; }
  .he.is-live .he-copy .hero-ctas .btn { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 0 12px; font-size: 14.5px; }
  .he.is-live .he-after { gap: 14px; }
  .he-logo-slot { width: 60px; height: 60px; }
  .he-title { font-size: clamp(28px, 8.4vw, 36px); }
}
@media (max-width: 360px) {
  .he.is-live .he-copy .hero-ctas .btn i { display: none; }
  .he.is-live .he-copy p { font-size: 15px; }
}
/* Short phones: drop the live-session card so the photo and headline breathe */
@media (max-width: 900px) and (max-height: 720px) {
  .he.is-live .he-live { display: none; }
}
@media (max-width: 640px) and (max-height: 620px) {
  .he.is-live .he-copy p { display: none; }
  .he .deal-card-body { padding: 9px 12px; }
  .he .deal-card .course-cover { width: 64px; }
}
/* Short phones (iPhone SE class): the logo, title, 4 courses and button must fit one screen */
@media (max-width: 640px) and (max-height: 760px) {
  .he.is-live .he-after { gap: 10px; padding: 80px var(--gutter) 12px; }
  .he-logo-slot { width: 44px; height: 44px; }
  .he.is-live .he-title { font-size: clamp(22px, 7vw, 28px); }
  .he.is-live .he-cards { gap: 8px; }
  .he.is-live .deal-card .course-cover { width: 58px; }
  .he.is-live .deal-card-body { padding: 8px 12px; gap: 2px; }
  .he.is-live .deal-card-body h3 { font-size: 14.5px; }
  .he.is-live .deal-meta .seats { display: none; }
  .he.is-live .he-cta { min-height: 44px; font-size: 14.5px; }
}
