/* ==========================================================================
   The O'Brien Maths Academy — main stylesheet

   Contents
     01  Reset & base
     02  Typography
     03  Layout primitives
     04  Buttons
     05  Site header & navigation
     06  Hero
     07  Section furniture
     08  Cards & grids
     09  Lists, notes, quotes, badges
     10  Timetable
     11  Programme detail cards
     12  Founder & story
     13  Forms
     14  Footer
     15  Decorative motifs
   ========================================================================== */

/* ===========================================================  01 reset === */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem; /* clears the sticky header on anchor jumps */
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
picture,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

ul,
ol {
  padding: 0;
}

:target {
  scroll-margin-top: 6rem;
}

/* focus: always visible, never removed */
:focus-visible {
  outline: 3px solid var(--violet-600);
  outline-offset: 3px;
  border-radius: 4px;
}

.band--dark :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--gold-400);
}

/* Hidden off the top of the viewport until focused. Offset with `top` rather
   than a transform: a transform would promote this into its own compositing
   layer, which some engines then order underneath the sticky header. */
.skip-link {
  position: fixed;
  left: var(--space-md);
  top: -6rem;
  z-index: 1000;
  padding: 0.7rem 1.1rem;
  background-color: var(--violet-600);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: top var(--duration) var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: var(--space-md);
  color: var(--white);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ======================================================  02 typography === */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ink-800);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-5);
}
h2 {
  font-size: var(--step-4);
}
h3 {
  font-size: var(--step-2);
}
h4 {
  font-size: var(--step-1);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--violet-600);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--violet-500);
}

strong {
  font-weight: 600;
  color: var(--ink-800);
}

.lead {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--grey-600);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--violet-600);
  margin-bottom: var(--space-sm);
}

.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: var(--gold-400);
  border-radius: 2px;
}

.band--dark .eyebrow {
  color: var(--gold-400);
}

.band--dark .eyebrow::before {
  background: var(--gold-400);
}

/* body copy set to a comfortable measure */
.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: var(--space-md);
}

.prose--center {
  margin-inline: auto;
}

/* =================================================  03 layout primitives = */

.container {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - var(--gutter) * 2, var(--container-narrow));
}

.band {
  padding-block: var(--section-y);
  position: relative;
  overflow: hidden;
}

.band--tint {
  background: var(--bg-tint);
}

.band--violet {
  background: var(--violet-100);
}

.band--dark {
  background: var(--ink-800);
  color: var(--text-on-dark);
}

.band--dark h1,
.band--dark h2,
.band--dark h3,
.band--dark h4 {
  color: var(--white);
}

.band--dark .lead,
.band--dark p {
  color: var(--text-on-dark);
}

.band--tight {
  padding-block: calc(var(--section-y) * 0.62);
}

.stack > * + * {
  margin-top: var(--space-md);
}

.stack-lg > * + * {
  margin-top: var(--space-xl);
}

/* two-column: content + aside, collapses below 900px */
.split {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}

.split--start {
  align-items: start;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1.15fr 0.85fr;
    gap: var(--space-4xl);
  }
  .split--even {
    grid-template-columns: 1fr 1fr;
  }
  /* editorial layout: heading in the narrow left column, copy on the right */
  .split--lede {
    grid-template-columns: 0.8fr 1.2fr;
    gap: var(--space-3xl);
  }
  .split--reverse > :first-child {
    order: 2;
  }
}

/* ==========================================================  04 buttons == */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: 0.85em 1.6em;
  min-height: 48px; /* comfortable touch target */
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    color var(--duration) var(--ease), transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* gold — the single primary action, used once per view */
.btn--primary {
  background: var(--gold-400);
  color: var(--ink-900);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: #ffc65e;
  color: var(--ink-900);
  box-shadow: var(--shadow-md);
}

/* purple — primary action on light backgrounds */
.btn--brand {
  background: var(--violet-600);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn--brand:hover {
  background: var(--violet-500);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  border-color: var(--violet-200);
  background: var(--white);
  color: var(--violet-600);
}

.btn--outline:hover {
  border-color: var(--violet-600);
  background: var(--violet-50);
  color: var(--violet-600);
}

/* on dark bands */
.btn--ghost {
  border-color: rgba(255, 255, 255, 0.45);
  color: var(--white);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.btn--sm {
  padding: 0.6em 1.15em;
  min-height: 40px;
  font-size: var(--step--1);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
}

/* a text link with a moving arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 600;
  text-decoration: none;
}

.link-arrow::after {
  content: "→";
  transition: transform var(--duration) var(--ease);
}

.link-arrow:hover::after {
  transform: translateX(3px);
}

.link-arrow:hover {
  text-decoration: underline;
}

/* ============================================  05 header & navigation === */

/* Solid, not translucent-with-backdrop-filter: a backdrop-filter here promotes
   the header to its own compositing layer and paints it over the skip link no
   matter what z-index the link is given. At 92% opacity it looked identical
   anyway. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 4.5rem;
  padding-block: 0.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink-800);
  flex-shrink: 0;
}

.brand img {
  width: 44px;
  height: 47px;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
  max-width: 9em;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  min-height: 44px;
  background: var(--white);
  border: 1px solid var(--violet-200);
  border-radius: var(--radius-pill);
  color: var(--violet-600);
  font-size: var(--step--1);
  font-weight: 600;
  cursor: pointer;
}

.nav-toggle__bars {
  position: relative;
  width: 18px;
  height: 12px;
  flex-shrink: 0;
}

.nav-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--duration) var(--ease),
    opacity var(--duration) var(--ease);
}

.nav-toggle__bars span:nth-child(1) {
  top: 0;
}
.nav-toggle__bars span:nth-child(2) {
  top: 5px;
}
.nav-toggle__bars span:nth-child(3) {
  top: 10px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.site-nav__list {
  list-style: none;
  margin: 0;
}

.site-nav__link {
  display: block;
  padding: 0.5rem 0;
  color: var(--grey-700);
  font-weight: 500;
  text-decoration: none;
}

.site-nav__link:hover {
  color: var(--violet-600);
}

.site-nav__link[aria-current="page"] {
  color: var(--violet-600);
  font-weight: 600;
}

/* --- mobile: panel below the header ------------------------------------ */
@media (max-width: 899px) {
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--white);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow-md);
    padding: var(--space-md) var(--gutter) var(--space-xl);
    display: none;
  }

  .site-nav[data-open="true"] {
    display: block;
  }

  .site-nav__list > li + li {
    border-top: 1px solid var(--grey-300);
  }

  .site-nav__link {
    padding: 0.85rem 0;
    font-size: var(--step-1);
  }

  .site-nav__cta {
    margin-top: var(--space-md);
  }

  .site-nav__cta .btn {
    width: 100%;
  }
}

/* --- desktop: inline row ----------------------------------------------- */
@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: flex !important;
    align-items: center;
    gap: var(--space-lg);
  }

  .site-nav__list {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 1.9vw, 1.9rem);
  }

  .site-nav__link {
    padding: 0.35rem 0;
    font-size: var(--step--1);
    position: relative;
  }

  .site-nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    border-radius: 2px;
    background: var(--gold-400);
    transform: scaleX(0);
    transition: transform var(--duration) var(--ease);
  }

  .site-nav__link[aria-current="page"]::after,
  .site-nav__link:hover::after {
    transform: scaleX(1);
  }
}

/* =============================================================  06 hero == */

.hero {
  position: relative;
  background: var(--ink-800);
  color: var(--text-on-dark);
  overflow: hidden;
}

.hero__media {
  position: relative;
}

.hero__media img {
  width: 100%;
  height: auto;
}

.hero__inner {
  position: relative;
  z-index: 2;
  padding-block: clamp(2.5rem, 1rem + 6vw, 5.5rem);
}

.hero__content {
  max-width: 36rem;
}

/* The hero eyebrow matches the one at the top of every other page. Both are
   set explicitly here: .page-head's was previously picking up its size from
   the generic `.page-head p` rule by accident, which is why the two differed. */
.hero .eyebrow,
.page-head .eyebrow {
  font-size: var(--step-1);
  color: var(--gold-400);
}

.hero .eyebrow::before,
.page-head .eyebrow::before {
  width: 2.25rem;
}

.hero h1 {
  /* a notch below --step-5: the headline is long, and four lines reads
     better here than five */
  font-size: clamp(2rem, 1.35rem + 2.2vw, 3.25rem);
  color: var(--white);
  margin-bottom: var(--space-lg);
}

.hero__tagline {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--text-on-dark);
  margin-bottom: var(--space-xl);
  max-width: 30rem;
}

.hero .btn-row {
  margin-bottom: var(--space-lg);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: var(--step--1);
  color: var(--text-on-dark-muted);
}

.hero__meta li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  list-style: none;
}

.hero__meta svg {
  flex-shrink: 0;
  color: var(--gold-400);
}

/* small screens: photo sits above the copy, no cropping */
@media (max-width: 899px) {
  .hero__media img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: 78% center;
  }
}

/* Large screens: the copy sits in the photo's own purple negative space.
   The photo keeps its natural aspect ratio and anchors to the bottom of the
   band — cropping it to fill would swallow exactly the empty purple area the
   headline needs. Whatever height the copy needs beyond the photo is filled
   with the same flat --ink-800, and a top fade hides the seam. */
@media (min-width: 900px) {
  .hero {
    display: grid;
    align-items: end;
  }

  .hero__media,
  .hero__inner {
    grid-area: 1 / 1;
  }

  .hero__media {
    align-self: end;
    justify-self: end;
    width: 100%;
    max-width: 1920px;
  }

  .hero__media img {
    width: 100%;
    height: auto;
  }

  .hero__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        var(--ink-800) 0%,
        rgba(30, 24, 80, 0) 26%
      ),
      linear-gradient(
        to right,
        var(--ink-800) 0%,
        var(--ink-800) 25%,
        rgba(30, 24, 80, 0.78) 40%,
        rgba(30, 24, 80, 0) 62%
      );
  }

  .hero__inner {
    align-self: center;
    padding-block: clamp(3rem, 1.5rem + 5vw, 6rem);
  }
}

/* ================================================  07 section furniture = */

.section-head {
  max-width: var(--measure);
  margin-bottom: var(--space-2xl);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--center .eyebrow {
  justify-content: center;
}

.section-head p {
  margin-top: var(--space-md);
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--grey-600);
}

.band--dark .section-head p {
  color: var(--text-on-dark-muted);
}

.page-head {
  background: var(--ink-800);
  color: var(--text-on-dark);
  padding-block: clamp(3rem, 1.5rem + 6vw, 5.5rem);
  position: relative;
  overflow: hidden;
}

.page-head h1 {
  color: var(--white);
  max-width: 18ch;
}

.page-head p {
  margin-top: var(--space-lg);
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--text-on-dark);
  max-width: var(--measure);
}


/* the CTA strip that closes most pages */
.cta-band {
  background: linear-gradient(135deg, var(--violet-600), #7d2ef0 55%, #4a10c4);
  color: var(--white);
  padding-block: var(--section-y);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-band h2 {
  color: var(--white);
  max-width: 20ch;
  margin-inline: auto;
}

.cta-band p {
  margin: var(--space-md) auto var(--space-xl);
  max-width: 52ch;
  font-size: var(--step-1);
  color: #ece5ff;
}

.cta-band .btn-row {
  justify-content: center;
}

/* ======================================================  08 cards/grids = */

.grid {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 640px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  background: var(--white);
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.card h3 {
  margin-bottom: var(--space-sm);
}

.card p {
  color: var(--grey-600);
}

.card--link:hover,
.card--link:focus-within {
  transform: translateY(-3px);
  border-color: var(--violet-200);
  box-shadow: var(--shadow-lg);
}

.card--link a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card--link {
  position: relative;
}

.card--link a {
  text-decoration: none;
}

/* the four pillars */
.pillar {
  background: var(--white);
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.pillar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--violet-600), var(--gold-400));
}

.pillar__icon {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--violet-100);
  color: var(--violet-600);
  margin-bottom: var(--space-md);
}

.pillar__icon svg {
  width: 1.75rem;
  height: 1.75rem;
}

.pillar h3 {
  font-size: var(--step-2);
  margin-bottom: var(--space-xs);
}

.pillar p {
  color: var(--grey-600);
  font-size: var(--step-0);
}

/* small icon + text row (competition benefits, applied-maths fields) */
.icon-row {
  display: grid;
  gap: var(--space-lg);
  list-style: none;
}

@media (min-width: 640px) {
  .icon-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .icon-row--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* single column, for when the row sits inside one half of a split */
.icon-row--stack {
  grid-template-columns: 1fr !important;
  gap: var(--space-lg);
}

.icon-row li {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.icon-row .icon-chip {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--violet-100);
  color: var(--violet-600);
}

.band--dark .icon-row .icon-chip {
  background: rgba(245, 181, 68, 0.14);
  color: var(--gold-400);
}

.icon-row .icon-chip svg {
  width: 1.4rem;
  height: 1.4rem;
}

.icon-row strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.15rem;
}

.band--dark .icon-row strong {
  color: var(--white);
}

.icon-row span {
  color: var(--grey-600);
  font-size: var(--step--1);
  line-height: 1.55;
}

.band--dark .icon-row span {
  color: var(--text-on-dark-muted);
}

/* ============================================  09 lists, notes, quotes == */

/* "Why choose the Academy" tick grid */
.checklist {
  display: grid;
  gap: var(--space-sm) var(--space-lg);
  list-style: none;
}

@media (min-width: 640px) {
  .checklist {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .checklist {
    grid-template-columns: repeat(3, 1fr);
  }
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--grey-300);
  line-height: 1.45;
}

.band--dark .checklist li {
  border-bottom-color: var(--ink-600);
}

.checklist li::before {
  content: "";
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.15rem;
  border-radius: 50%;
  background: var(--violet-100)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E17EB' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / 0.8rem no-repeat;
}

.band--dark .checklist li::before {
  background-color: rgba(245, 181, 68, 0.16);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F5B544' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

/* a simple bulleted list in brand colours */
.tick-list {
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.tick-list li {
  position: relative;
  padding-left: 1.6rem;
  line-height: 1.5;
}

.tick-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  background: var(--violet-600);
  transform: rotate(45deg);
}

/* bordered clarifying note */
.note {
  border-left: 4px solid var(--gold-400);
  background: var(--gold-200);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-lg);
  color: #5a4308;
}

.note strong {
  color: #4a3706;
}

.note--brand {
  border-left-color: var(--violet-600);
  background: var(--violet-100);
  color: var(--ink-700);
}

.note--brand strong {
  color: var(--ink-800);
}

/* large pull quote */
.pullquote {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: var(--tracking-tight);
  color: var(--ink-800);
  border-left: 4px solid var(--gold-400);
  padding-left: var(--space-lg);
  text-wrap: balance;
}

.band--dark .pullquote {
  color: var(--white);
}

/* highlighted statement / statistic block */
.highlight {
  background: var(--ink-800);
  color: var(--text-on-dark);
  border-radius: var(--radius-xl);
  padding: clamp(1.75rem, 1rem + 3vw, 3rem);
  position: relative;
  overflow: hidden;
}

.highlight p {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.35;
  color: var(--white);
  letter-spacing: var(--tracking-tight);
  position: relative;
  z-index: 1;
  text-wrap: pretty;
}

.highlight cite {
  display: block;
  margin-top: var(--space-md);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-style: normal;
  line-height: 1.5;
  color: var(--text-on-dark-muted);
  position: relative;
  z-index: 1;
}

.highlight cite a {
  color: var(--gold-400);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.highlight cite a:hover {
  color: #ffc65e;
}

/* competition name pills */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  list-style: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-pill);
  background: var(--white);
  border: 1px solid var(--violet-200);
  color: var(--ink-700);
  font-size: var(--step--1);
  font-weight: 600;
}

.badge::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--gold-400);
}

.band--dark .badge {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--ink-600);
  color: var(--white);
}

/* badges that link out to a competition's own site */
a.badge {
  text-decoration: none;
  transition: background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

a.badge:hover {
  border-color: var(--violet-600);
  background: var(--violet-50);
  color: var(--violet-600);
}

.band--dark a.badge:hover {
  background: rgba(245, 181, 68, 0.16);
  border-color: var(--gold-400);
  color: var(--gold-400);
}

.badges li {
  display: flex;
}

/* small status tag */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tag--soon {
  background: var(--gold-200);
  color: #6b4e08;
}

.tag--open {
  background: var(--violet-100);
  color: var(--violet-600);
}

.caption {
  font-size: var(--step--1);
  color: var(--grey-600);
}

.band--dark .caption {
  color: var(--text-on-dark-muted);
}

/* photographs with a caption */
.photo {
  margin: 0;
}

.photo picture,
.photo img {
  display: block;
  width: 100%;
  border-radius: var(--radius-lg);
}

.photo img {
  height: auto;
  box-shadow: var(--shadow-md);
}

.photo figcaption {
  margin-top: var(--space-sm);
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--grey-600);
}

.band--dark .photo figcaption {
  color: var(--text-on-dark-muted);
}

/* portrait-format photos are capped so they stay sharp and don't tower over
   the text beside them */
.photo--portrait {
  max-width: 17rem;
}

/* the class-date list under a term summary */
.dates {
  margin-top: var(--space-md);
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--grey-600);
}

.dates strong {
  color: var(--ink-800);
}

.dates__note {
  display: block;
  margin-top: 0.35rem;
  color: var(--gold-500);
  font-weight: 600;
}

.band--dark .dates,
.page-head .dates {
  color: var(--text-on-dark-muted);
}

.band--dark .dates strong,
.page-head .dates strong {
  color: var(--white);
}

.band--dark .dates__note,
.page-head .dates__note {
  color: var(--gold-400);
}

/* ========================================================  10 timetable == */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.timetable {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  text-align: left;
}

.timetable caption {
  caption-side: top;
  padding: var(--space-lg) var(--space-lg) 0;
  font-size: var(--step--1);
  color: var(--grey-600);
  text-align: left;
}

.timetable th,
.timetable td {
  padding: 1rem var(--space-lg);
  border-bottom: 1px solid var(--grey-300);
  vertical-align: middle;
}

.timetable thead th {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--violet-600);
  background: var(--violet-50);
  border-bottom-color: var(--violet-200);
}

.timetable tbody th {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--ink-800);
  white-space: nowrap;
}

.timetable tbody tr:last-child th,
.timetable tbody tr:last-child td {
  border-bottom: 0;
}

.timetable tbody tr:hover {
  background: var(--violet-50);
}

/* ===============================================  11 programme cards ==== */

.programme {
  background: var(--white);
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.programme__head {
  padding: var(--space-lg) var(--space-xl);
  background: var(--violet-50);
  border-bottom: 1px solid var(--violet-200);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-md);
  justify-content: space-between;
}

.programme__head h3 {
  font-size: var(--step-2);
  margin: 0;
}

.programme__when {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--violet-600);
}

.programme__when svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.programme__body {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  flex: 1;
}

.programme__body h4 {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--grey-600);
}

.programme__body .btn {
  align-self: flex-start;
  margin-top: auto;
}

.group-label {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.group-label h2 {
  font-size: var(--step-3);
  white-space: nowrap;
}

.group-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--grey-300);
}

/* ==========================================  12 founder, story, contact = */

.founder {
  display: grid;
  gap: var(--space-xl);
  align-items: start;
  background: var(--white);
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  box-shadow: var(--shadow-md);
}

@media (min-width: 720px) {
  .founder {
    grid-template-columns: 190px 1fr;
    gap: var(--space-2xl);
  }
}

/* monogram placeholder — swap for a real headshot at the same size */
.founder__portrait {
  width: 190px;
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, var(--violet-600), var(--ink-800));
  display: grid;
  place-items: center;
  color: var(--violet-100);
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.founder__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.founder__role {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--violet-600);
  margin-bottom: var(--space-xs);
}

.founder h3 {
  font-size: var(--step-3);
  margin-bottom: var(--space-md);
}

.credentials {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  margin-top: var(--space-md);
}

.credentials li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: var(--step-0);
  line-height: 1.5;
}

.credentials svg {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.2rem;
  color: var(--gold-500);
}

/* address / details card */
.info-card {
  background: var(--white);
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.info-card h3 {
  font-size: var(--step-2);
  margin-bottom: var(--space-md);
}

.info-card address {
  font-style: normal;
  line-height: 1.7;
  color: var(--grey-600);
}

.info-card + .info-card {
  margin-top: var(--space-lg);
}

/* ============================================================  13 forms = */

.form {
  background: var(--white);
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 1rem + 2.2vw, 2.75rem);
  box-shadow: var(--shadow-md);
}

.form__grid {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 640px) {
  .form__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .field--full {
    grid-column: 1 / -1;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-800);
}

.field .hint {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--grey-600);
}

/* labels wrap to different numbers of lines, so bottom-align the controls
   to keep every row of inputs on the same baseline */
.field input,
.field select,
.field textarea {
  margin-top: auto;
  width: 100%;
  padding: 0.8rem 0.95rem;
  min-height: 48px;
  background: var(--white);
  border: 1px solid var(--violet-200);
  border-radius: var(--radius-md);
  color: var(--ink-800);
  font-size: var(--step-0);
  transition: border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
  line-height: 1.55;
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E17EB' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1.1rem;
  padding-right: 2.75rem;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--violet-500);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--violet-600);
  box-shadow: var(--ring);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--violet-600);
  outline-offset: 2px;
}

.req {
  color: var(--violet-600);
  font-weight: 700;
}

.checkbox {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: var(--space-md);
  background: var(--violet-50);
  border-radius: var(--radius-md);
}

.checkbox input {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  margin-top: 0.2rem;
  accent-color: var(--violet-600);
  padding: 0;
}

.checkbox label {
  font-weight: 400;
  font-size: var(--step--1);
  line-height: 1.55;
  color: var(--grey-700);
}

.form__actions {
  margin-top: var(--space-xl);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md) var(--space-lg);
}

.form__actions .caption {
  flex: 1 1 16rem;
}

/* shown in place of the form once it has sent */
.form-success {
  background: var(--white);
  border: 1px solid var(--violet-200);
  border-left: 4px solid var(--violet-600);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 1rem + 2.2vw, 2.75rem);
  box-shadow: var(--shadow-md);
}

.form-success:focus {
  outline: none;
}

.form-success:focus-visible {
  outline: 3px solid var(--violet-600);
  outline-offset: 3px;
}

.form-success__mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--space-md);
  border-radius: 50%;
  background: var(--violet-100);
  color: var(--violet-600);
}

.form-success__mark svg {
  width: 1.5rem;
  height: 1.5rem;
}

.form-success h3 {
  font-size: var(--step-2);
  margin-bottom: var(--space-md);
}

.form-success p + p {
  margin-top: var(--space-md);
}

.form-success p {
  color: var(--grey-600);
}

/* inline failure message, above the submit button */
.form__error {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border-left: 4px solid #b3261e;
  background: #fdeceb;
  color: #7a1b15;
  font-size: var(--step--1);
  line-height: 1.55;
}

/* honeypot — hidden from people, catches naive bots */
.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* ===========================================================  14 footer = */

.site-footer {
  background: var(--ink-900);
  color: var(--text-on-dark-muted);
  padding-block: var(--space-3xl) var(--space-xl);
  font-size: var(--step--1);
}

.site-footer__grid {
  display: grid;
  gap: var(--space-2xl);
}

@media (min-width: 720px) {
  .site-footer__grid {
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: var(--space-3xl);
  }
}

.site-footer h2 {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: var(--space-md);
}

.site-footer a {
  color: var(--text-on-dark);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--gold-400);
  text-decoration: underline;
}

.site-footer ul {
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.site-footer address {
  font-style: normal;
  line-height: 1.7;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--space-md);
  text-decoration: none;
}

.footer-brand img {
  width: 52px;
  height: 55px;
}

.footer-brand span {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.15;
  color: var(--white);
  max-width: 10em;
}

.site-footer__blurb {
  max-width: 32ch;
  line-height: 1.6;
}

.site-footer__base {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  justify-content: space-between;
  color: var(--grey-400);
}

/* =====================================================  15 decorative === */

/* faint coordinate grid, built from gradients — no image request */
.grid-motif::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.055) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(
    ellipse 80% 70% at 70% 40%,
    #000 20%,
    transparent 75%
  );
}

.grid-motif--light::before {
  background-image: linear-gradient(
      to right,
      rgba(94, 23, 235, 0.07) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(94, 23, 235, 0.07) 1px, transparent 1px);
}

/* big watermark pi behind a dark band */
.pi-motif::after {
  content: "π";
  position: absolute;
  right: -0.08em;
  bottom: -0.34em;
  font-family: var(--font-display);
  font-size: clamp(14rem, 34vw, 26rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.045);
  pointer-events: none;
  user-select: none;
}

.pi-motif--light::after {
  color: rgba(94, 23, 235, 0.05);
}

.band > .container,
.cta-band > .container,
.page-head > .container,
.highlight > * {
  position: relative;
  z-index: 1;
}

/* a soft curve dividing two bands */
.curve-divider {
  display: block;
  width: 100%;
  height: clamp(40px, 5vw, 72px);
  color: var(--bg-tint);
}

/* ==============================================================  404 ==== */

.error-page {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: var(--section-y);
}

.error-page__code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 600;
  line-height: 1;
  /* light enough to read as decoration, dark enough to clear 3:1 on white */
  color: #9b7bef;
  letter-spacing: -0.04em;
}

/* ============================================================  print ==== */

@media print {
  .site-header,
  .cta-band,
  .btn,
  .nav-toggle {
    display: none !important;
  }
  body {
    color: #000;
  }
  .band--dark,
  .page-head,
  .highlight {
    background: #fff !important;
    color: #000 !important;
  }
  .band--dark h1,
  .band--dark h2,
  .page-head h1,
  .highlight p {
    color: #000 !important;
  }
}
