/* ============================================================
   WELCOME HERO — the shared opening for the Academy programme pages
   and the Library resource pages.

   Same language as the homepage and library.html heroes: Playfair
   headline, gold kicker and underline, two soft pill buttons, and a
   warm photo cut by the homepage's arc (traced in gold) and pinned
   flush to the frame's right edge. The photo eases in slowly on load.

   Loaded after each page's own <style>, so it only adds; the markup
   carries its own <svg> clipPath (#welcome-arc-clip).
   ============================================================ */
.welcome-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(440px, calc(100vh - 190px), 660px);
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem 0 3rem 6%;
  overflow: hidden;
}
.welcome-hero-text {
  position: relative;
  z-index: 2;
  width: 46%;
  max-width: 560px;
}

.welcome-crumb {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 2.2rem;
}
.welcome-crumb a { color: var(--gold-dark); text-decoration: none; }
.welcome-crumb a:hover { text-decoration: underline; }
.welcome-crumb .crumb-sep { margin: 0 6px; opacity: 0.5; }

.welcome-kicker {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--gold-dark); margin-bottom: 1.1rem;
}
.welcome-title {
  font-family: 'Playfair Display', serif; font-weight: 400;
  font-size: clamp(2.5rem, 4.6vw, 4rem); line-height: 1.12;
  color: var(--dark-green); margin: 0 0 1.3rem 0;
}
.welcome-title em { font-style: italic; color: var(--gold-dark); }
.welcome-underline { width: 72px; height: 2px; background: var(--gold-dark); margin-bottom: 1.4rem; }
.welcome-desc {
  font-size: 1.05rem; line-height: 1.8; color: var(--text-muted);
  max-width: 470px; margin: 0;
}

/* Two soft pill buttons, as in the homepage hero. */
.welcome-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.welcome-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  padding: 0.95rem 1.6rem; border-radius: 999px;
  font-family: 'Montserrat', sans-serif; font-size: 0.92rem; font-weight: 600; letter-spacing: 0.02em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  background: rgba(255, 255, 255, 0.45); color: var(--dark-green);
  border: 1px solid rgba(12, 30, 20, 0.2);
  transition: background-color 400ms ease, color 400ms ease, border-color 400ms ease, box-shadow 400ms ease, transform 160ms ease;
}
.welcome-btn--primary {
  background: var(--dark-green); color: #FAF9F6; border-color: var(--dark-green);
  box-shadow: 0 10px 24px -14px rgba(12, 30, 20, 0.7);
}
.welcome-btn svg { width: 15px; height: 15px; flex: none; transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1); }
@media (hover: hover) and (pointer: fine) {
  .welcome-btn:hover { background: rgba(255, 255, 255, 0.85); border-color: rgba(12, 30, 20, 0.4); }
  .welcome-btn--primary:hover { background: #163322; color: #FAF9F6; border-color: #163322; box-shadow: 0 14px 30px -14px rgba(12, 30, 20, 0.75); }
  .welcome-btn:hover svg { transform: translateX(4px); }
  .welcome-btn--down:hover svg { transform: translateY(3px); }
}
.welcome-btn:active { transform: scale(0.98); }
.welcome-btn:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 3px; }

/* Small facts already stated on the page, set as quiet ticks. */
.welcome-facts {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem;
  list-style: none; margin: 1.8rem 0 0 0; padding: 0;
  font-size: 0.82rem; font-weight: 500; color: var(--text-muted);
}
.welcome-facts li { display: inline-flex; align-items: center; gap: 0.5rem; }
.welcome-facts li::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-dark); opacity: 0.8; flex: none;
}

/* ---------- Photo ---------- */
.welcome-photo-wrap {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 50%; z-index: 1;
}
.welcome-photo {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  clip-path: url(#welcome-arc-clip);
  -webkit-clip-path: url(#welcome-arc-clip);
  background: #E9E1D2;
}
.welcome-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform-origin: 62% 50%;
}
.welcome-photo::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(155deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 42%, rgba(12,30,20,0.14) 100%);
}
/* The arc's edge, traced in gold (same objectBoundingBox geometry). */
.welcome-arc-line {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible; pointer-events: none;
}
.welcome-arc-line path { fill: none; stroke: var(--gold-dark); vector-effect: non-scaling-stroke; }
.welcome-arc-line .arc-a { stroke-width: 1.4; opacity: 0.85; }
.welcome-arc-line .arc-b { stroke-width: 1; opacity: 0.4; }

/* ---------- Entrance ---------- */
@media (prefers-reduced-motion: no-preference) {
  .welcome-hero-text > * { animation: welcome-rise 900ms cubic-bezier(0.16, 1, 0.3, 1) both; }
  .welcome-hero-text > :nth-child(2) { animation-delay: 80ms; }
  .welcome-hero-text > :nth-child(3) { animation-delay: 160ms; }
  .welcome-hero-text > :nth-child(4) { animation-delay: 240ms; }
  .welcome-hero-text > :nth-child(5) { animation-delay: 320ms; }
  .welcome-hero-text > :nth-child(n+6) { animation-delay: 400ms; }
  .welcome-photo { animation: welcome-fade 1200ms ease both; }
  .welcome-photo img { animation: welcome-settle 9s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .welcome-arc-line path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: welcome-draw 1800ms 300ms cubic-bezier(0.65, 0, 0.35, 1) forwards; }
  .welcome-arc-line .arc-b { animation-delay: 520ms; }
}
@keyframes welcome-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes welcome-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes welcome-settle { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes welcome-draw { to { stroke-dashoffset: 0; } }

/* Short laptop screens: scale the type to the height so the buttons
   stay in the first screen. */
@media (min-width: 901px) and (max-height: 820px) {
  .welcome-hero { padding-top: 1.2rem; padding-bottom: 2rem; }
  .welcome-crumb { margin-bottom: 1.4rem; }
  .welcome-kicker { margin-bottom: 0.8rem; }
  .welcome-title { font-size: clamp(2.2rem, min(4.6vw, 7vh), 4rem); margin-bottom: 1rem; }
  .welcome-underline { margin-bottom: 1.1rem; }
  .welcome-desc { font-size: 1rem; line-height: 1.7; }
  .welcome-actions { margin-top: 1.5rem; }
  .welcome-facts { margin-top: 1.3rem; }
}

/* ---------- Tablet / phone ---------- */
@media (max-width: 900px) {
  .welcome-hero {
    min-height: 0; flex-direction: column; align-items: stretch; gap: 2rem;
    padding: 1.6rem 6% 2.6rem 6%;
  }
  .welcome-hero-text { width: auto; max-width: none; }
  .welcome-crumb { margin-bottom: 1.6rem; }
  .welcome-photo-wrap { position: relative; inset: auto; width: 100%; height: clamp(220px, 52vw, 340px); }
  .welcome-photo { clip-path: none; -webkit-clip-path: none; border-radius: 18px; }
  .welcome-arc-line { display: none; }
}
@media (max-width: 480px) {
  .welcome-title { font-size: 2.2rem; }
  .welcome-desc { font-size: 0.98rem; }
  .welcome-actions { flex-direction: column; align-items: stretch; }
  .welcome-btn { white-space: normal; text-align: center; }
}
