/* Friends of St Andrew's: Proposal 4E. Phone first; wider screens from 768px. */
:root {
  --blue: #28258C;
  --deep: #1B1A5E;
  --ink: #14132B;
  --muted: #4A4A63;
  --paper: #F6F4EE;
  --rule: #DAD9E6;
  --edge: #E7E6EF;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Figtree", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.55; color: var(--muted); background: #fff; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
a { color: var(--blue); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap--narrow > * { max-width: 720px; }
main { flex: 1; }
.stack > * + * { margin-top: 16px; }

/* Headings */
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--ink); font-optical-sizing: auto; }
h2 { font-size: 30px; }
.h2--small { font-size: 26px; }
h3 { font-family: var(--sans); font-weight: 600; font-size: 18px; line-height: 1.3; color: var(--ink); }
.stack > h3 { margin-top: 28px; }
.lead { font-family: var(--sans); font-weight: 600; font-size: 19px; line-height: 1.35; color: var(--blue); }
.eyebrow { font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--blue); }
.small { font-size: 15px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--edge); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding-right: 8px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand span { font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.15; color: var(--ink); }
.nav-desktop { display: none; }
.nav-phone summary { list-style: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.nav-phone summary::-webkit-details-marker { display: none; }
.nav-phone svg path { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; fill: none; }
.nav-phone .i-close, .nav-phone[open] .i-open { display: none; }
.nav-phone[open] .i-close { display: inline; }
.nav-phone nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--edge); box-shadow: 0 12px 24px rgba(20, 19, 43, 0.12); padding: 8px 0; }
.nav-phone nav a { display: flex; align-items: center; min-height: 56px; padding: 0 24px; border-left: 4px solid transparent; font-family: var(--sans); font-weight: 600; font-size: 18px; color: var(--ink); text-decoration: none; }
.nav-phone nav a[aria-current] { color: var(--blue); background: #EEEFF8; border-left-color: var(--blue); }

/* Hero and page banners */
/* Home hero: big type on white, with the Royal Crescent as a skyline fading up into the white */
.hero { padding: 36px 0 0; background: #fff; }
.hero h1 { font-size: 46px; line-height: 1.02; letter-spacing: -0.01em; }
.hero__sub { margin-top: 12px; font-family: var(--sans); font-weight: 600; font-size: 18px; line-height: 1.35; color: var(--blue); }
.hero h1 em { font-style: normal; color: var(--blue); background: linear-gradient(transparent 70%, #F2C230 70%, #F2C230 90%, transparent 90%); }
.hero__buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero__skyline { position: relative; margin-top: 30px; height: 150px; overflow: hidden; }
.hero__skyline::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(#fff 0%, rgba(255, 255, 255, 0) 45%); }
.hero__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }

/* Page banners */
.banner { position: relative; display: flex; align-items: flex-end; overflow: hidden; background: var(--deep); height: 150px; }
.banner__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner::after { content: ""; position: absolute; inset: 0; background: rgba(20, 19, 43, 0.5); }
.banner__text { position: relative; z-index: 1; padding-bottom: 22px; }
.banner h1 { font-size: 34px; color: #fff; }

/* Sections */
.section { padding: 36px 0; }
.section--paper { background: var(--paper); padding-bottom: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 16px; }

/* Raffle band: a fanned hand of raffle tickets */
.raffle-wrap { padding: 20px 0; }
.raffle { padding: 36px 20px 40px; border-radius: 18px; color: rgba(255, 255, 255, 0.88); background-color: var(--blue);
  /* Confetti in the ticket colours, over a soft light from the top left */
  background-image:
    radial-gradient(circle at 12px 18px, rgba(242, 194, 48, 0.55) 2.5px, transparent 3px),
    radial-gradient(circle at 58px 64px, rgba(246, 184, 200, 0.5) 2px, transparent 2.5px),
    radial-gradient(circle at 96px 22px, rgba(185, 227, 207, 0.5) 2px, transparent 2.5px),
    radial-gradient(circle at 34px 98px, rgba(255, 255, 255, 0.35) 1.5px, transparent 2px),
    radial-gradient(circle at 110px 104px, rgba(242, 194, 48, 0.4) 1.8px, transparent 2.3px),
    radial-gradient(circle at 40px 140px, rgba(246, 184, 200, 0.45) 2.2px, transparent 2.7px),
    radial-gradient(circle at 150px 60px, rgba(255, 255, 255, 0.3) 1.6px, transparent 2.1px),
    radial-gradient(circle at 120px 160px, rgba(185, 227, 207, 0.45) 2.4px, transparent 2.9px),
    radial-gradient(120% 90% at 15% 0%, rgba(255, 255, 255, 0.14), transparent 55%),
    radial-gradient(90% 80% at 100% 100%, rgba(10, 8, 50, 0.45), transparent 60%);
  background-size: 128px 128px, 128px 128px, 128px 128px, 128px 128px, 128px 128px, 197px 197px, 197px 197px, 197px 197px, auto, auto;
  animation: raffle-snow 40s linear infinite; }
/* Confetti drifts down like slow snow. Each layer moves exactly one tile per loop, so it never jumps;
   the larger, sparser layer falls faster, which reads as depth. The lighting layers stay put. */
@keyframes raffle-snow {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 0 128px, 0 128px, 0 128px, 0 128px, 0 128px, 0 197px, 0 197px, 0 197px, 0 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) { .raffle { animation: none; } }
.raffle__kicker { font-family: var(--sans); font-weight: 700; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: #F2C230; }
.raffle__title { margin-top: 2px; font-size: 28px; color: #fff; }
.raffle__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.raffle__inner > div:first-child { display: flex; flex-direction: column; align-items: center; }
.fan { list-style: none; margin: 22px auto 0; padding: 0; width: 100%; max-width: 270px; text-align: left; }
/* The shadow sits on the li's filter so it follows the cut-out shape. */
.fan li { filter: drop-shadow(0 6px 10px rgba(10, 9, 40, 0.35)); }
.fan li + li { margin-top: -6px; }
.fan li:nth-child(1) { transform: rotate(-3deg); }
.fan li:nth-child(2) { transform: rotate(2deg) translateX(6px); }
.fan li:nth-child(3) { transform: rotate(-1.5deg); }
.ticket { --cut: 9px; --at: 72%; position: relative; display: flex; border-radius: 10px; color: var(--ink);
  -webkit-mask: radial-gradient(circle at var(--at) 0, #0000 var(--cut), #000 calc(var(--cut) + 0.5px)) top / 100% 51% no-repeat,
                radial-gradient(circle at var(--at) 100%, #0000 var(--cut), #000 calc(var(--cut) + 0.5px)) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle at var(--at) 0, #0000 var(--cut), #000 calc(var(--cut) + 0.5px)) top / 100% 51% no-repeat,
                radial-gradient(circle at var(--at) 100%, #0000 var(--cut), #000 calc(var(--cut) + 0.5px)) bottom / 100% 51% no-repeat; }
.ticket--gold { background: #F2C230; }
.ticket--pink { background: #F6B8C8; }
.ticket--mint { background: #B9E3CF; }
.ticket__main { flex: 0 0 var(--at); display: flex; align-items: center; min-height: 112px; padding: 12px 10px 12px 16px; border-right: 2px dashed rgba(20, 19, 43, 0.3); }
.ticket__name { font-family: var(--serif); font-weight: 700; font-size: 19px; line-height: 1.1; text-wrap: balance; }
.ticket__stub { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 2px; color: var(--deep); font-family: var(--sans); font-weight: 600; font-size: 11px; text-align: center; }
.ticket__stub b { font-weight: 800; font-size: 22px; line-height: 1.05; }
.raffle__info { margin-top: 28px; }
.raffle__detail { font-size: 15px; }
.raffle__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; margin-top: 14px; }
.raffle__days { font-family: var(--sans); font-weight: 600; font-size: 15px; color: #fff; }
.raffle .button { background: #F2C230; border-color: #F2C230; color: var(--ink); }
.raffle .button:hover { background: #fff; border-color: #fff; }
.raffle a:focus-visible { outline-color: #fff; }

/* Events */
.event-list { list-style: none; margin: 0; padding: 0; }
.event { display: flex; gap: 16px; align-items: flex-start; padding: 18px 0; border-top: 1px solid var(--rule); text-decoration: none; }
.event-list li:last-child .event { border-bottom: 1px solid var(--rule); }
.event--plain { padding: 14px 0; }
.date-box { flex: 0 0 60px; height: 64px; background: #fff; border: 1px solid var(--rule); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.date-box__day { font-family: var(--sans); font-weight: 600; font-size: 22px; line-height: 1; color: var(--ink); }
.date-box__mon { font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.event__body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.event__when { font-family: var(--sans); font-weight: 600; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue); }
.event__title { font-family: var(--sans); font-weight: 600; font-size: 18px; line-height: 1.25; color: var(--ink); }
.event__tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #EEEFF8; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; vertical-align: 2px; white-space: nowrap; }
.event__after { display: block; margin-top: 4px; font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--blue); }
.event__tag--today { background: #F2C230; color: var(--ink); }
.event__detail { font-size: 15px; line-height: 1.45; color: var(--muted); }
.event__link { font-family: var(--sans); font-weight: 600; font-size: 15px; text-underline-offset: 3px; margin-top: 2px; }
.event--link:hover .event__title { text-decoration: underline; text-underline-offset: 3px; }
.events-subhead { padding-bottom: 12px; }
.event-list + .events-subhead { margin-top: 32px; }
.events-empty { padding: 18px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

/* Buttons and links */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 1px solid var(--blue); border-radius: 4px; background: var(--blue); color: #fff; font-family: var(--sans); font-weight: 600; font-size: 16px; text-decoration: none; }
.button:hover { background: var(--deep); border-color: var(--deep); }
.button--ghost { background: transparent; color: var(--blue); }
.button--ghost:hover { background: var(--blue); color: #fff; }
.button--gold { background: #F2C230; border-color: #F2C230; color: var(--ink); }
.button--gold:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.button--block { display: flex; width: 100%; min-height: 52px; margin-top: 24px; border-radius: 0; }
.text-link { font-family: var(--sans); font-weight: 600; text-underline-offset: 3px; }
.actions { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 4px; }

/* Get involved */
.involved { display: flex; flex-direction: column; gap: 20px; }
.involved__img { width: 100%; height: 190px; object-fit: cover; object-position: center 45%; }

/* About */
.committee { list-style: none; margin: 8px 0 0; padding: 0; }
.committee li { padding: 10px 0; border-top: 1px solid var(--rule); }
.committee__name { font-family: var(--sans); font-weight: 600; color: var(--ink); }

/* Footer */
.footer { border-top: 1px solid var(--edge); padding: 28px 0 36px; font-size: 14px; line-height: 1.5; }
.footer p + p { margin-top: 8px; }
.footer__logo { width: 130px; height: 110px; object-fit: cover; margin-bottom: 16px; }
.footer__name { color: var(--ink); font-weight: 500; }

@media (min-width: 768px) {
  .wrap { padding: 0 32px; }
  .nav-phone { display: none; }
  .nav-desktop { display: flex; gap: 4px; }
  .nav-desktop a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; font-family: var(--sans); font-weight: 600; font-size: 16px; color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
  .nav-desktop a:hover { color: var(--blue); }
  .nav-desktop a[aria-current] { color: var(--blue); border-bottom-color: var(--blue); }
  .topbar__inner { min-height: 72px; padding-right: 32px; }
  .brand span { font-size: 20px; }

  .hero { padding-top: 64px; }
  .hero h1 { font-size: 88px; }
  .hero__sub { font-size: 22px; }
  .hero__skyline { height: 260px; margin-top: 44px; }
  .banner { height: 240px; }
  .banner h1 { font-size: 44px; }
  .banner__text { padding-bottom: 32px; }

  .section { padding: 64px 0; }
  .section--paper { padding-bottom: 56px; }
  h2 { font-size: 36px; }
  .h2--small { font-size: 30px; }
  .button--block { display: inline-flex; width: auto; min-width: 240px; }

  .raffle-wrap { padding: 32px 0; }
  .raffle { padding: 56px 40px 60px; }
  .raffle__title { font-size: 40px; }
  .raffle__info { margin-top: 36px; }
  .raffle__detail { font-size: 17px; }
  .ticket__name { font-size: 20px; }
  .ticket__main { min-height: 104px; }
  .involved { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
  .involved__img { height: 360px; }
}

@media (min-width: 960px) {
  .fan { display: flex; justify-content: center; gap: 18px; max-width: none; margin-top: 30px; }
  .fan li { width: 250px; }
  .fan li + li { margin-top: 0; }
  .fan li:nth-child(1) { transform: rotate(-4deg) translateY(6px); }
  .fan li:nth-child(2) { transform: rotate(2deg) translateY(-6px); }
  .fan li:nth-child(3) { transform: rotate(-2deg) translateY(4px); }
}
