/* The school's public home page (templates/home/index.php).
 * The whole page follows the theme, hero included: light is a pale page
 * with a soft wash of the school's colour, dark is charcoal lit by it.
 * The school's colour is --color-primary (from Branding), already tuned per
 * theme for contrast, so nothing here hard-codes a hue. Durations read the
 * --dur-* tokens, so Reduce motion stops it. */

.lp {
  margin: 0; min-height: 100vh;
  font-family: var(--font-sans); color: var(--color-text); background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
.lp a:not(.lp-btn) { color: inherit; }
.lp *, .lp *::before, .lp *::after { box-sizing: border-box; }
/* A part of the page reached by a link stops clear of the fixed bar,
 * also when the browser follows the address itself (#contact typed in). */
.lp [id] { scroll-margin-top: 88px; }
/* Leaving for a sign-in page, where there is no page transition (landing.js). */
.lp main, .lp .lp-footer { transition: opacity 200ms ease, transform 200ms ease; }
.lp.is-leaving main, .lp.is-leaving .lp-footer, .lp.is-leaving .lp-nav { opacity: 0; transform: translateY(-10px); }

/* ---- Navigation ---------------------------------------------------------- */
.lp-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 18px max(20px, calc((100vw - 1200px) / 2));
  color: var(--color-text);
  transition: background-color var(--dur-md) ease, box-shadow var(--dur-md) ease, padding var(--dur-md) ease, color var(--dur-md) ease;
}
.lp-nav.is-scrolled {
  padding-top: 10px; padding-bottom: 10px;
  background: var(--color-surface);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  box-shadow: 0 1px 0 var(--color-border);
  color: var(--color-text);
}
.lp-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 1.1rem; min-width: 0; }
.lp-brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-logo { height: 40px; width: auto; max-width: 56px; object-fit: contain; border-radius: 10px; }
.lp-logo-mark {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--color-primary); color: var(--color-on-accent); font-weight: 800; font-size: .95rem; letter-spacing: .02em;
}
.lp-links { display: flex; gap: 28px; margin: 0 auto; font-size: .95rem; }
.lp-links a { text-decoration: none; opacity: .78; transition: opacity var(--dur-sm) ease; }
.lp-links a:hover { opacity: 1; }
.lp-nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.lp-icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--color-border-strong); background: transparent; color: inherit; cursor: pointer;
  transition: background-color var(--dur-sm) ease, transform var(--dur-xs) ease;
}
.lp-icon-btn:hover { background: rgba(127,127,127,.15); }

/* ---- Buttons --------------------------------------------------------------- */
.lp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform var(--dur-sm) var(--ease-out), box-shadow var(--dur-md) ease, background-color var(--dur-sm) ease, border-color var(--dur-sm) ease;
}
.lp-btn:hover { transform: translateY(-2px); }
.lp-btn:active { transform: translateY(0) scale(.98); }
.lp-btn:focus-visible, .lp-icon-btn:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 3px; }
.lp-btn .bi-arrow-right { transition: transform var(--dur-md) var(--ease-out); }
.lp-btn:hover .bi-arrow-right { transform: translateX(4px); }
.lp-btn-primary { background: var(--color-primary); color: var(--color-on-accent); box-shadow: 0 10px 30px -10px var(--color-primary); }
.lp-btn-primary:hover { background: var(--color-primary-hover); box-shadow: 0 16px 40px -12px var(--color-primary); }
.lp-btn-outline { border-color: var(--color-border-strong); color: var(--color-text); background: var(--color-surface); }
.lp-btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }
.lp-btn-quiet { min-height: 40px; padding: 0 18px; border-color: var(--color-border-strong); color: inherit; background: transparent; }

/* ---- Hero ------------------------------------------------------------------ */
.lp-hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 150px 20px 88px; color: var(--color-text); text-align: center;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.lp-hero-glow {
  position: absolute; inset: -20% -10% 30%; z-index: -1;
  background:
    radial-gradient(ellipse 60% 55% at 50% 0%, var(--color-primary) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 90% 30%, var(--color-primary) 0%, transparent 70%);
  opacity: .2; filter: blur(10px);
}
[data-theme="dark"] .lp-hero-glow { opacity: .42; }
.lp-hero-shapes { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.lp-hero-shapes span {
  position: absolute; width: 140px; height: 520px; border-radius: 999px;
  background: currentColor; opacity: .035; transform: rotate(-38deg);
  animation: lpDrift 18s ease-in-out infinite alternate;
}
.lp-hero-shapes span:nth-child(1) { left: 3%; top: -120px; }
.lp-hero-shapes span:nth-child(2) { left: 22%; top: 160px; height: 380px; animation-delay: -6s; }
.lp-hero-shapes span:nth-child(3) { right: 18%; top: -160px; animation-delay: -3s; }
.lp-hero-shapes span:nth-child(4) { right: 2%; top: 220px; height: 420px; animation-delay: -9s; }
@keyframes lpDrift { from { translate: 0 0; } to { translate: 30px 40px; } }

.lp-hero-inner { max-width: 980px; margin: 0 auto; }
.lp-eyebrow {
  display: inline-block; padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text-muted);
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
}
.lp-title {
  margin: 22px 0 18px; font-weight: 800; letter-spacing: -.035em; line-height: 1.04;
  font-size: clamp(2.4rem, 6.2vw, 4.6rem); text-wrap: balance;
}
.lp-sub { max-width: 640px; margin: 0 auto; font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.6; color: var(--color-text-muted); text-wrap: pretty; }
.lp-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }

/* Arriving: the hero text, then the cards rising from below. */
.lp-in { animation: lpUp var(--dur-xl) var(--ease-out) backwards; }
.lp-in:nth-child(2) { animation-delay: 80ms; }
.lp-in:nth-child(3) { animation-delay: 160ms; }
.lp-in:nth-child(4) { animation-delay: 240ms; }
@keyframes lpUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---- Doors and the term ---------------------------------------------------
 * Each card is a door (the parent portal, staff sign-in) or the term dates.
 * A door carries a drawing of what is behind it, made of shapes only: no
 * name or mark, so nothing on it can be mistaken for a real pupil's. */
.lp-motto { margin: -6px 0 14px; font-size: 1.1rem; font-style: italic; font-weight: 600; color: var(--color-primary); }

.lp-notice {
  display: flex; align-items: flex-start; gap: 10px; max-width: 760px; margin: 44px auto 0; padding: 12px 18px;
  border-radius: 14px; text-align: left; font-size: .95rem; line-height: 1.5;
  background: var(--color-primary-soft); border: 1px solid var(--color-border);
}
.lp-notice > .bi { color: var(--color-primary); font-size: 1.1rem; line-height: 1.35; }
.lp-notice strong { margin-right: 6px; }

.lp-doors {
  display: grid; grid-template-columns: 1.15fr .8fr 1.15fr; gap: 18px; align-items: stretch;
  max-width: 1080px; margin: 56px auto 0; text-align: left;
}
.lp-doors.no-term { grid-template-columns: 1fr 1fr; max-width: 860px; }
.lp-doors.no-parents { grid-template-columns: .8fr 1.15fr; max-width: 860px; }
.lp-doors.no-term.no-parents { grid-template-columns: minmax(0, 440px); justify-content: center; }

.lp-door, .lp-term {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 24px; border-radius: 26px; background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border); box-shadow: 0 24px 48px -30px rgba(0,0,0,.45);
  text-decoration: none;
  transition: transform var(--dur-lg) var(--ease-out), box-shadow var(--dur-lg) ease, border-color var(--dur-md) ease;
}
.lp-door:hover { transform: translateY(-6px); border-color: var(--color-primary); box-shadow: 0 30px 60px -30px rgba(0,0,0,.55); }
.lp-door:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 3px; }
.lp-door-head { display: flex; align-items: center; gap: 10px; }
.lp-door-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--color-primary-soft); color: var(--color-primary); font-size: 1.1rem; }
.lp-door-kicker { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--color-text-muted); }
.lp-door-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.lp-door-list { display: grid; gap: 6px; font-size: .9rem; color: var(--color-text-muted); }
.lp-door-list .bi { color: var(--color-primary); margin-right: 4px; }
.lp-door-go { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--color-primary); }
.lp-door-go .bi { transition: transform var(--dur-md) var(--ease-out); }
.lp-door:hover .lp-door-go .bi { transform: translateX(4px); }

/* The drawing. */
.lp-preview {
  display: grid; gap: 9px; padding: 14px; border-radius: 16px;
  background: var(--color-bg); border: 1px solid var(--color-border);
}
.lp-pv-tabs { display: flex; gap: 6px; margin-bottom: 2px; }
.lp-pv-tabs span { padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; color: var(--color-text-muted); background: var(--color-surface); border: 1px solid var(--color-border); }
.lp-pv-tabs .is-on { background: var(--color-primary-soft); color: var(--color-primary); border-color: transparent; }
.lp-pv-row { display: grid; grid-template-columns: 30% 1fr 26px; align-items: center; gap: 10px; height: 14px; }
.lp-pv-line { display: block; height: 7px; border-radius: 4px; background: var(--color-border-strong); opacity: .7; }
.lp-pv-row:nth-of-type(2) .lp-pv-line { width: 80%; }
.lp-pv-row:nth-of-type(3) .lp-pv-line { width: 64%; }
.lp-pv-row:nth-of-type(4) .lp-pv-line { width: 92%; }
.lp-pv-row:nth-of-type(5) .lp-pv-line { width: 72%; }
.lp-pv-bar { height: 7px; border-radius: 4px; background: var(--color-border); overflow: hidden; }
.lp-pv-bar i { display: block; height: 100%; border-radius: inherit; background: var(--color-primary); transform-origin: left; animation: lpGrow 1.1s var(--ease-out) 700ms backwards; }
.lp-pv-row:nth-of-type(2) .lp-pv-bar i { width: 78%; }
.lp-pv-row:nth-of-type(3) .lp-pv-bar i { width: 62%; animation-delay: 780ms; }
.lp-pv-row:nth-of-type(4) .lp-pv-bar i { width: 88%; animation-delay: 860ms; }
.lp-pv-row:nth-of-type(5) .lp-pv-bar i { width: 70%; animation-delay: 940ms; }
@keyframes lpGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.lp-pv-pill { height: 14px; border-radius: 7px; background: var(--color-primary-soft); }
.lp-pv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px dashed var(--color-border); }
.lp-pv-foot .lp-pv-line { width: 40%; }
.lp-pv-chip { font-size: .72rem; font-weight: 600; color: var(--color-text-muted); }
.lp-pv-chip .bi { color: var(--color-primary); }

.lp-preview-staff .lp-pv-row { grid-template-columns: 14px 1fr auto; }
.lp-pv-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--color-primary-soft); }
.lp-pv-marks { display: flex; gap: 4px; }
.lp-pv-marks i { width: 18px; height: 12px; border-radius: 4px; background: var(--color-border); }
.lp-pv-marks i.is-p { background: var(--color-primary); opacity: .85; }
.lp-pv-marks i.is-a { background: var(--color-danger, #c0392b); opacity: .75; }

/* The term. */
.lp-term { justify-content: flex-start; background: linear-gradient(170deg, var(--color-primary-soft), var(--color-surface) 70%); }
.lp-term-name { margin-top: 6px; font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.lp-term-year { font-size: .9rem; color: var(--color-text-muted); }
.lp-term-left { align-self: flex-start; margin-top: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: .95rem; background: var(--color-primary); color: var(--color-on-accent); }
.lp-term-progress { display: grid; gap: 8px; margin-top: 18px; }
.lp-term-week { font-size: .85rem; font-weight: 600; color: var(--color-text-muted); }
.lp-term-track { height: 8px; border-radius: 4px; background: var(--color-border); overflow: hidden; }
.lp-term-track i { display: block; height: 100%; border-radius: inherit; background: var(--color-primary); transform-origin: left; animation: lpGrow 1.2s var(--ease-out) 900ms backwards; }
.lp-term-track .lp-w0 { width: 0%; }
.lp-term-track .lp-w5 { width: 5%; }
.lp-term-track .lp-w10 { width: 10%; }
.lp-term-track .lp-w15 { width: 15%; }
.lp-term-track .lp-w20 { width: 20%; }
.lp-term-track .lp-w25 { width: 25%; }
.lp-term-track .lp-w30 { width: 30%; }
.lp-term-track .lp-w35 { width: 35%; }
.lp-term-track .lp-w40 { width: 40%; }
.lp-term-track .lp-w45 { width: 45%; }
.lp-term-track .lp-w50 { width: 50%; }
.lp-term-track .lp-w55 { width: 55%; }
.lp-term-track .lp-w60 { width: 60%; }
.lp-term-track .lp-w65 { width: 65%; }
.lp-term-track .lp-w70 { width: 70%; }
.lp-term-track .lp-w75 { width: 75%; }
.lp-term-track .lp-w80 { width: 80%; }
.lp-term-track .lp-w85 { width: 85%; }
.lp-term-track .lp-w90 { width: 90%; }
.lp-term-track .lp-w95 { width: 95%; }
.lp-term-track .lp-w100 { width: 100%; }
.lp-term-date { margin-top: auto; font-weight: 600; line-height: 1.4; }
.lp-term-date span { display: block; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--color-text-muted); font-weight: 400; }
.lp-term-next { font-size: .88rem; color: var(--color-text-muted); padding-top: 10px; border-top: 1px dashed var(--color-border); }

.lp-rise { animation: lpRise 900ms var(--ease-out) backwards; }
.lp-doors > :nth-child(1) { animation-delay: 300ms; }
.lp-doors > :nth-child(2) { animation-delay: 400ms; }
.lp-doors > :nth-child(3) { animation-delay: 500ms; }
@keyframes lpRise { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }

/* Highlights: the school's own words, in a strip under the cards. */
.lp-highlights {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 44px;
  max-width: 1080px; margin: 44px auto 0; padding: 0;
}
.lp-highlights div { text-align: center; }
.lp-highlights dt { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--color-primary); }
.lp-highlights dd { margin: 2px 0 0; font-size: .85rem; color: var(--color-text-muted); }

/* ---- Sections -------------------------------------------------------------- */
.lp-section { max-width: 1200px; margin: 0 auto; padding: 96px 20px 24px; }
.lp-section-head { text-align: center; margin-bottom: 44px; }
.lp-kicker { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--color-primary); }
.lp-section h2 { margin: 10px 0 0; font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; }


.lp-about-inner {
  max-width: 980px; margin: 0 auto; padding: 48px; border-radius: 28px; text-align: center;
  background: linear-gradient(180deg, var(--color-primary-soft), transparent);
  border: 1px solid var(--color-border);
}
.lp-about-inner.has-photo { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; text-align: left; padding: 28px; }
.lp-about-photo { border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--color-surface); }
.lp-about-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lp-about p { color: var(--color-text-muted); font-size: 1.05rem; line-height: 1.75; margin: 16px 0 0; }

.lp-contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; max-width: 980px; margin: 0 auto; }
.lp-contact { display: flex; gap: 14px; padding: 22px; border-radius: 18px; background: var(--color-surface); border: 1px solid var(--color-border); }
.lp-contact > .bi { font-size: 1.3rem; color: var(--color-primary); }
.lp-contact div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lp-contact strong { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-muted); }
.lp-contact a { text-decoration: none; overflow-wrap: anywhere; }
.lp-contact-note { font-size: .85rem; color: var(--color-text-muted); }
.lp-contact a:hover { color: var(--color-primary); }

.lp-footer {
  max-width: 1200px; margin: 80px auto 0; padding: 28px 20px 40px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--color-border); color: var(--color-text-muted); font-size: .9rem;
}
.lp-footer-links { display: flex; gap: 20px; }
.lp-footer a { text-decoration: none; }
.lp-footer a:hover { color: var(--color-primary); }

/* Sections arrive as they scroll in (landing.js adds .is-in). Without
 * script they are simply there. */
.lp-js .lp-reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-xl) var(--ease-out), transform var(--dur-xl) var(--ease-out); }
.lp-js .lp-reveal.is-in { opacity: 1; transform: none; }

/* ---- Narrow screens ------------------------------------------------------- */
@media (max-width: 900px) {
  .lp-links { display: none; }
  .lp-hero { padding-bottom: 56px; }
  .lp-doors, .lp-doors.no-term, .lp-doors.no-parents { grid-template-columns: 1fr; max-width: 520px; margin-top: 40px; }
  .lp-term { order: -1; }
  .lp-about-inner.has-photo { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 560px) {
  .lp-hide-sm { display: none; }
  .lp-hero { padding-top: 120px; }
  .lp-cta .lp-btn { width: 100%; }
  .lp-about-inner { padding: 30px 20px; }
  .lp-section { padding-top: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-hero-shapes span, .lp-in, .lp-rise, .lp-pv-bar i, .lp-term-track i { animation: none; }
  .lp-js .lp-reveal { opacity: 1; transform: none; }
}
:root[data-motion="reduced"] .lp-hero-shapes span { animation: none; }
