/* =========================================================
   ADA Chess Club — motion & detail layer
   Everything here is decorative. Visitors who ask their
   system for reduced motion get a calm, static site
   (see the block at the very bottom).
   ========================================================= */
:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.77, 0, .18, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
}
::selection { background: var(--yellow); color: var(--green-900); }
[id] { scroll-margin-top: 96px; }

/* ---------- Page curtain (between pages + first-visit intro) ---------- */
html.arriving::after {
  content: ""; position: fixed; inset: 0; z-index: 9998; background: var(--green-900); pointer-events: none;
  animation: failsafe-hide .01s linear 2.6s forwards; /* never block the page if JS fails */
}
@keyframes failsafe-hide { to { opacity: 0; visibility: hidden; } }
.curtain { position: fixed; inset: 0; z-index: 9999; display: grid; pointer-events: none; }
.curtain i {
  display: block; background: var(--green-900); transform: scale(1.02);
  transition: transform .5s var(--ease-in-out), border-radius .5s var(--ease-in-out);
  transition-delay: var(--td, 0ms);
}
.curtain i.alt { background: var(--green); }
.curtain.lift i { transform: scale(0) rotate(45deg); border-radius: 30%; }
.curtain.drop i { transform: scale(0) rotate(-45deg); border-radius: 30%; transition: none; }
.curtain-logo {
  position: fixed; left: 50%; top: 50%; z-index: 10000; translate: -50% -50%;
  display: grid; justify-items: center; gap: 18px; color: var(--white); text-align: center; pointer-events: none;
}
.curtain-logo .ring { position: relative; width: 132px; height: 132px; }
.curtain-logo img { position: absolute; inset: 10px; width: 112px; height: 112px; border-radius: 50%; animation: logo-pop .9s var(--ease-back) .15s both; }
.curtain-logo svg { position: absolute; inset: 0; width: 132px; height: 132px; rotate: -90deg; }
.curtain-logo circle { fill: none; stroke: var(--yellow); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 402; stroke-dashoffset: 402; animation: ring-draw 1.1s var(--ease-out) .25s forwards; }
.curtain-logo .words { font-family: var(--font-head); font-weight: 900; font-size: 1.35rem; letter-spacing: .02em; display: flex; gap: .45em; }
.curtain-logo .words span { display: inline-block; opacity: 0; translate: 0 14px; animation: word-up .6s var(--ease-out) forwards; }
.curtain-logo .words span:nth-child(1) { animation-delay: .45s; }
.curtain-logo .words span:nth-child(2) { animation-delay: .6s; }
.curtain-logo .words span:nth-child(3) { animation-delay: .75s; color: var(--yellow); }
.curtain-logo.out { animation: logo-out .45s var(--ease-in-out) forwards; }
@keyframes logo-pop { from { scale: .4; opacity: 0; rotate: -30deg; } to { scale: 1; opacity: 1; rotate: 0deg; } }
@keyframes ring-draw { to { stroke-dashoffset: 0; } }
@keyframes word-up { to { opacity: 1; translate: 0 0; } }
@keyframes logo-out { to { opacity: 0; scale: .85; filter: blur(6px); } }

/* ---------- Scroll progress + header ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: linear-gradient(90deg, var(--yellow), #ffe07a);
  transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
  box-shadow: 0 0 12px rgba(242, 194, 48, .6);
}
.site-header { transition: transform .45s var(--ease-out), background .3s, box-shadow .3s; }
.site-header .nav { transition: height .35s var(--ease-out); }
.site-header.scrolled { box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .45); }
.site-header.scrolled .nav { height: 62px; }
.site-header.scrolled .brand > img { width: 40px; height: 40px; }
.site-header.hidden { transform: translateY(-105%); }
.brand > img { transition: transform .7s var(--ease-back), width .35s, height .35s; }
.brand:hover > img { transform: rotate(360deg); }

/* nav link underline that grows from the centre */
@media (min-width: 861px) {
  .nav-links a:not(.btn) { position: relative; }
  .nav-links a:not(.btn)::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 2px;
    background: var(--yellow); transform: scaleX(0); transition: transform .35s var(--ease-out);
  }
  .nav-links a:not(.btn):hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
}

/* hamburger → X */
.nav-toggle path { transform-box: fill-box; transform-origin: center; transition: transform .35s var(--ease-out), opacity .2s; }
.nav-toggle[aria-expanded="true"] .l1 { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .l2 { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] .l3 { transform: translateY(-5px) rotate(-45deg); }
@media (max-width: 860px) {
  .nav-links { transform: translateY(calc(-100% - 90px)); visibility: hidden; transition: transform .45s var(--ease-out), visibility 0s linear .45s; }
  .nav-links.open { transform: translateY(0); visibility: visible; transition: transform .45s var(--ease-out), visibility 0s; }
  .nav-links li .btn { display: flex; }
  .nav-links li { opacity: 0; translate: -18px 0; transition: opacity .35s, translate .45s var(--ease-out); }
  .nav-links.open li { opacity: 1; translate: 0 0; }
  .nav-links.open li:nth-child(1) { transition-delay: .08s; }
  .nav-links.open li:nth-child(2) { transition-delay: .13s; }
  .nav-links.open li:nth-child(3) { transition-delay: .18s; }
  .nav-links.open li:nth-child(4) { transition-delay: .23s; }
  .nav-links.open li:nth-child(5) { transition-delay: .28s; }
}

/* ---------- Buttons: shine sweep + magnetic ---------- */
.btn { position: relative; overflow: hidden; isolation: isolate; transition: transform .25s var(--ease-out), translate .35s var(--ease-out), background .2s, color .2s, border-color .2s, box-shadow .25s; }
.btn-primary::after {
  content: ""; position: absolute; inset: -2px; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .65) 48%, transparent 66%);
  transform: translateX(-120%); transition: transform .8s var(--ease-out);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:hover { box-shadow: 0 12px 26px -10px rgba(242, 194, 48, .8); }
.btn svg { transition: transform .35s var(--ease-back); }
.btn:hover svg:last-child { transform: translate(2px, -2px); }
.btn:hover svg:first-child:not(:last-child) { transform: rotate(-8deg) scale(1.1); }
.btn:active { transform: translateY(0) scale(.97); }

/* ---------- Reveal system ---------- */
.js .reveal { opacity: 0; transform: none; transition: none; }
.js .reveal.in { opacity: 1; animation: rise .9s var(--ease-out) var(--d, 0ms) backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(34px) scale(.985); } to { opacity: 1; transform: none; } }
.js .split > .reveal:first-child.in { animation-name: from-left; }
.js .split > .reveal:last-child.in { animation-name: from-right; }
.js .split.reverse > .reveal:first-child.in { animation-name: from-right; }
.js .split.reverse > .reveal:last-child.in { animation-name: from-left; }
@keyframes from-left { from { opacity: 0; transform: translateX(-46px); } to { opacity: 1; transform: none; } }
@keyframes from-right { from { opacity: 0; transform: translateX(46px); } to { opacity: 1; transform: none; } }

/* photos wipe open like a curtain, image settles from a zoom */
.js .reveal.in .photo-frame, .js .photo-frame.reveal.in { animation: wipe 1.2s var(--ease-in-out) var(--d, 0ms) backwards; }
.js .reveal.in .photo-frame:nth-child(2) { animation-delay: .35s; }
.js .reveal.in .photo-frame img, .js .photo-frame.reveal.in img { animation: settle 1.6s var(--ease-out) var(--d, 0ms) backwards; }
@keyframes wipe { from { clip-path: inset(0 0 100% 0 round var(--radius)); } to { clip-path: inset(0 0 0 0 round var(--radius)); } }
@keyframes settle { from { transform: scale(1.3); } to { transform: scale(1); } }
.photo-frame img { transition: transform 1.2s var(--ease-out); }
.photo-frame:hover img { transform: scale(1.05); }

/* eyebrow chess square spins in */
.reveal.in .eyebrow::before, .play .eyebrow::before { animation: square-in .9s var(--ease-back) calc(var(--d, 0ms) + .15s) backwards; }
@keyframes square-in { from { transform: rotate(-180deg) scale(0); } to { transform: none; } }

/* checklist knights hop in one by one */
.reveal.in .checklist li { animation: hop .6s var(--ease-back) backwards; }
.reveal.in .checklist li:nth-child(1) { animation-delay: .25s; }
.reveal.in .checklist li:nth-child(2) { animation-delay: .35s; }
.reveal.in .checklist li:nth-child(3) { animation-delay: .45s; }
.reveal.in .checklist li:nth-child(4) { animation-delay: .55s; }
.reveal.in .checklist li:nth-child(5) { animation-delay: .65s; }
.reveal.in .checklist li:nth-child(6) { animation-delay: .75s; }
@keyframes hop { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.checklist li::before { transition: transform .5s var(--ease-back); }
.checklist li:hover::before { transform: rotate(-15deg) scale(1.15) translateY(-3px); }

/* split headline words */
.js .hero h1, .js .page-hero h1 { opacity: 0; animation: failsafe-show .01s linear 2.8s forwards; }
@keyframes failsafe-show { to { opacity: 1; } }
.js .hero h1.split-done, .js .page-hero h1.split-done { opacity: 1; animation: none; }
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.wi { display: inline-block; transform: translateY(110%) rotate(6deg); transform-origin: 0 100%; }
.play .wi { animation: word-rise 1s var(--ease-out) calc(var(--i) * 70ms) forwards; }
@keyframes word-rise { to { transform: none; } }
.wi { position: relative; }
.hero h1 .w, .hero h1 .wi, .page-hero h1 .w, .page-hero h1 .wi { color: inherit; }
.play .wi.mark::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .02em; height: .1em; border-radius: 4px;
  background: var(--yellow); transform: scaleX(0); transform-origin: 0 50%;
  animation: underline-grow .8s var(--ease-out) 1.05s forwards; opacity: .55;
}
@keyframes underline-grow { to { transform: scaleX(1); } }
.js .seq { opacity: 0; transform: translateY(22px); }
.play .seq { animation: seq-in .9s var(--ease-out) var(--sd, .4s) forwards; }
@keyframes seq-in { to { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */
.hero-bg { animation: kenburns 22s ease-in-out infinite alternate; will-change: transform; }
@keyframes kenburns { from { scale: 1.12; } to { scale: 1.02; } }
.hero .container { z-index: 3; }
.hero::after { z-index: 1; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; z-index: 3; translate: -50% 0;
  width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, .6); border-radius: 14px;
  display: grid; justify-items: center; padding-top: 7px; text-decoration: none;
  transition: border-color .2s, opacity .3s;
}
.scroll-cue::before { content: ""; width: 4px; height: 8px; border-radius: 2px; background: var(--yellow); animation: wheel 1.8s var(--ease-in-out) infinite; }
.scroll-cue:hover { border-color: var(--yellow); }
@keyframes wheel { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 80% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }
@media (max-width: 700px) { .scroll-cue { display: none; } }

/* floating chess pieces */
.floaters { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.floaters span {
  position: absolute; left: var(--x); top: var(--y); font-size: var(--s); line-height: 1;
  color: var(--c, rgba(242, 194, 48, .22)); filter: blur(var(--b, 0));
  translate: calc(var(--px, 0) * var(--z) * 1px) calc(var(--py, 0) * var(--z) * 1px);
  transition: translate .9s var(--ease-out);
  font-family: "Segoe UI Symbol", "Apple Symbols", "DejaVu Sans", serif;
}
.floaters span i { display: block; font-style: normal; animation: bob var(--t, 9s) ease-in-out var(--dl, 0s) infinite alternate; }
@keyframes bob { 0% { transform: translateY(0) rotate(-8deg); } 100% { transform: translateY(-26px) rotate(10deg); } }
.page-hero .container { position: relative; z-index: 3; }
@media (max-width: 700px) { .floaters span:nth-child(n+4) { display: none; } }

/* drifting checker pattern on dark sections */
.checker-strip { position: relative; overflow: hidden; background: var(--green); }
.checker-strip::before { content: ""; position: absolute; inset: 0 -28px 0 0; background: repeating-linear-gradient(90deg, var(--green) 0 14px, var(--yellow) 14px 28px); animation: strip-move 3s linear infinite; will-change: transform; }
@keyframes strip-move { to { transform: translateX(-28px); } }

/* pointer spotlight on dark areas */
.section-dark, .page-hero, .cta-band { position: relative; isolation: isolate; }
.spot::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, -30%), rgba(242, 194, 48, .13), transparent 60%);
  opacity: 0; transition: opacity .5s;
}
.spot.lit::before { opacity: 1; }
.section-dark > .container, .cta-band > * { position: relative; z-index: 1; }


/* ---------- Stats ---------- */
.stats { padding: 56px 0; background: var(--cream); position: relative; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 860px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat { text-align: center; padding: 20px 10px; border-radius: var(--radius); position: relative; }
.stat b { display: block; font-family: var(--font-head); font-weight: 900; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; color: var(--green); font-variant-numeric: tabular-nums; }
.stat b sup { font-size: .45em; color: var(--yellow-600); vertical-align: top; margin-left: 2px; }
.stat > span { display: block; margin-top: 8px; font-size: .92rem; font-weight: 600; color: var(--ink-soft); }
.stat .glyph { position: absolute; right: 50%; top: 2px; translate: 50% 0; font-size: 4.6rem; line-height: 1; color: var(--green); opacity: .06; pointer-events: none; z-index: 0; }
.stat b, .stat > span:not(.glyph) { position: relative; z-index: 1; }
.stat + .stat::before { content: ""; position: absolute; left: -10px; top: 22%; bottom: 22%; width: 1px; background: rgba(31, 58, 43, .15); }
@media (max-width: 860px) { .stat:nth-child(3)::before { display: none; } }

/* ---------- Chess-clock countdown ---------- */
.chess-clock {
  display: grid; grid-template-columns: 1fr auto; gap: 0; text-decoration: none; margin-bottom: 32px;
  background: var(--green-900); color: var(--white); border-radius: 20px; overflow: hidden; position: relative;
  box-shadow: 0 22px 40px -22px rgba(20, 42, 31, .8);
}
.chess-clock::before { content: ""; position: absolute; left: 50%; top: 0; width: 64px; height: 8px; translate: -50% 0; background: var(--yellow); border-radius: 0 0 8px 8px; animation: press 1s steps(1) infinite; }
@keyframes press { 50% { height: 4px; } }
.cc-left { padding: 22px 26px; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.cc-left small { color: var(--yellow); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .74rem; display: inline-flex; align-items: center; gap: 8px; }
.cc-left small::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ff5a4f; box-shadow: 0 0 0 0 rgba(255, 90, 79, .6); animation: live 1.6s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 9px rgba(255, 90, 79, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 79, 0); } }
.cc-left strong { font-family: var(--font-head); font-size: 1.25rem; line-height: 1.2; }
.cc-left em { font-style: normal; color: var(--sage); font-size: .9rem; }
.cc-face { display: flex; gap: 6px; align-items: center; padding: 18px 22px; background: var(--green-700); }
.cc-unit { display: grid; justify-items: center; min-width: 58px; }
.cc-unit b { font-family: var(--font-head); font-weight: 900; font-size: 2.1rem; line-height: 1; color: var(--yellow); font-variant-numeric: tabular-nums; display: inline-block; }
.cc-unit b.tick { animation: tick .45s var(--ease-out); }
@keyframes tick { from { transform: translateY(-40%); opacity: 0; } to { transform: none; opacity: 1; } }
.cc-unit span { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .65); margin-top: 6px; }
.cc-sep { color: rgba(255, 255, 255, .35); font-weight: 900; font-size: 1.6rem; margin-top: -16px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chess-clock:hover .cc-face { background: var(--green); }
@media (max-width: 700px) {
  .chess-clock { grid-template-columns: 1fr; }
  .cc-face { justify-content: center; padding: 16px 10px; }
  .cc-unit { min-width: 50px; }
  .cc-unit b { font-size: 1.7rem; }
}

/* ---------- Tilt + glare cards ---------- */
.tilt { position: relative; transform-style: preserve-3d; }
.tilt.hovering { will-change: transform; }
.tilt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 5;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .22), transparent 45%);
  opacity: 0; transition: opacity .35s;
}
.tilt.hovering::after { opacity: 1; }
.tilt.hovering { box-shadow: 0 30px 50px -24px rgba(20, 42, 31, .55); }
.card .icon { transition: transform .6s var(--ease-back), background .3s; }
.card:hover .icon { transform: rotate(-10deg) scale(1.1); }

/* event cards */
.event-media img { transition: transform 1s var(--ease-out); }
.event-card:hover .event-media img { transform: scale(1.07); }
.event-media .placeholder { font-size: 5rem; }
.event-media .placeholder { text-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.event-card:hover .placeholder { animation: piece-jump .8s var(--ease-back); }
@keyframes piece-jump { 0% { transform: none; } 40% { transform: translateY(-18px) rotate(-8deg); } 100% { transform: none; } }
.reveal.in .date-badge { animation: badge-drop .8s var(--ease-back) calc(var(--d, 0ms) + .35s) backwards; }
@keyframes badge-drop { from { transform: translateY(-30px) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.soon { position: absolute; top: 14px; right: 14px; background: rgba(20, 42, 31, .85); color: var(--white); font-size: .74rem; font-weight: 700; padding: 6px 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; backdrop-filter: blur(4px); }
.soon::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); animation: live-y 1.8s infinite; }
@keyframes live-y { 0% { box-shadow: 0 0 0 0 rgba(242, 194, 48, .7); } 70% { box-shadow: 0 0 0 8px rgba(242, 194, 48, 0); } }

/* ---------- Past events timeline ---------- */
.timeline { position: relative; padding-left: 56px; }
.timeline::before { content: ""; position: absolute; left: 18px; top: 8px; bottom: 0; width: 3px; border-radius: 3px; background: rgba(31, 58, 43, .12); }
.tl-fill { position: absolute; left: 18px; top: 8px; width: 3px; height: 0; border-radius: 3px; background: linear-gradient(var(--yellow), var(--green)); }
.tl-knight {
  position: absolute; left: 19px; top: 8px; width: 40px; height: 40px; translate: -50% -50%;
  display: grid; place-items: center; border-radius: 50%; background: var(--yellow); color: var(--green-900);
  font-size: 1.35rem; box-shadow: 0 0 0 6px rgba(242, 194, 48, .25), 0 8px 18px rgba(0, 0, 0, .2); z-index: 2;
}
.timeline .year-label { position: relative; font-size: clamp(3rem, 7vw, 5rem); opacity: 1; color: transparent; -webkit-text-stroke: 2px rgba(31, 58, 43, .25); }
.timeline .year-label::before { content: ""; position: absolute; left: -45px; top: 50%; width: 15px; height: 15px; translate: 0 -50%; border-radius: 4px; rotate: 45deg; background: var(--cream); border: 3px solid var(--green); }
.timeline .year-label.seen { animation: year-fill 1.2s var(--ease-out) forwards; }
@keyframes year-fill { from { letter-spacing: .2em; opacity: 0; } to { letter-spacing: -.01em; opacity: 1; color: rgba(31, 58, 43, .12); } }
.timeline .past-event { position: relative; overflow: visible; }
.timeline .past-event > .event-media { border-radius: var(--radius) 0 0 var(--radius); }
.timeline .past-event::before { content: ""; position: absolute; left: -43px; top: 34px; width: 11px; height: 11px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--cream); transition: background .3s, transform .3s; }
.timeline .past-event:hover::before { background: var(--yellow); transform: scale(1.4); }
@media (max-width: 860px) {
  .timeline { padding-left: 34px; }
  .timeline::before, .tl-fill { left: 8px; }
  .tl-knight { left: 9.5px; width: 30px; height: 30px; font-size: 1rem; }
  .timeline .year-label::before { left: -32px; width: 12px; height: 12px; }
  .timeline .past-event::before { left: -31px; }
  .timeline .past-event > .event-media { border-radius: var(--radius) var(--radius) 0 0; }
}
.past-event { overflow: hidden; }
.thumbs button { transition: transform .35s var(--ease-back), box-shadow .3s; }
.thumbs button:hover { transform: translateY(-3px) scale(1.06); box-shadow: 0 8px 16px -6px rgba(0, 0, 0, .35); }
.past-event .photo-count { transition: transform .4s var(--ease-back); }
.past-event:hover .photo-count { transform: scale(1.08); }

/* filters */
.filters button { transition: background .25s, color .25s, transform .25s var(--ease-back); }
.filters button:hover { transform: translateY(-2px); }
.filters button .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: rgba(31, 58, 43, .12); font-size: .75rem; }
.filters button[aria-pressed="true"] .count { background: var(--yellow); color: var(--green-900); }
[data-past] .past-event, [data-past] .year-label { transition: opacity .22s, transform .22s; }
[data-past].is-filtering .past-event, [data-past].is-filtering .year-label { opacity: 0; transform: translateY(12px) scale(.98); }
.js .past-event.reveal.entering { animation: rise .7s var(--ease-out) calc(var(--i, 0) * 70ms) backwards; }

/* ---------- Mosaic ---------- */
.mosaic button { position: relative; }
.mosaic button::after {
  content: "+"; position: absolute; inset: 0; display: grid; place-items: center;
  font: 300 3rem/1 var(--font-body); color: var(--white); background: rgba(20, 42, 31, .45);
  opacity: 0; transition: opacity .35s;
}
.mosaic button:hover::after { opacity: 1; }
.mosaic.reveal.in button { animation: tile-in .8s var(--ease-out) backwards; }
.mosaic.reveal.in button:nth-child(1) { animation-delay: .05s; }
.mosaic.reveal.in button:nth-child(2) { animation-delay: .12s; }
.mosaic.reveal.in button:nth-child(3) { animation-delay: .19s; }
.mosaic.reveal.in button:nth-child(4) { animation-delay: .26s; }
.mosaic.reveal.in button:nth-child(5) { animation-delay: .33s; }
.mosaic.reveal.in button:nth-child(6) { animation-delay: .40s; }
.mosaic.reveal.in button:nth-child(7) { animation-delay: .47s; }
.mosaic.reveal.in button:nth-child(8) { animation-delay: .54s; }
@keyframes tile-in { from { opacity: 0; transform: scale(.82) rotate(-2deg); } to { opacity: 1; transform: none; } }
.mosaic img { transition: transform .9s var(--ease-out); }
.mosaic button:hover img { transform: scale(1.1); }

/* awards */
.award-photos img { transition: transform .9s var(--ease-out); }
.award-badge { position: relative; overflow: hidden; }
.award-badge::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .8) 50%, transparent 65%); transform: translateX(-120%); animation: badge-shine 4s ease-in-out 1.5s infinite; }
@keyframes badge-shine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* ---------- Team ---------- */
.person .avatar { perspective: 600px; overflow: visible; background: none; position: relative; }
.av-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s var(--ease-back); }
.av-front, .av-back { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.av-front { background: var(--green); color: var(--yellow); }
.av-back { background: var(--yellow); color: var(--green-900); transform: rotateY(180deg); font-size: 1.7rem; font-family: "Segoe UI Symbol", "Apple Symbols", serif; }
.person:hover .av-inner, .person:focus-within .av-inner { transform: rotateY(180deg); }
.person .avatar:has(> img) { overflow: hidden; }
.group-count { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; margin-left: 12px; font-family: var(--font-body); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--green-700); background: var(--cream-200); padding: 5px 11px; border-radius: 999px; }
.team-group.reveal.in .person { animation: rise .8s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 80ms + 200ms); }
.team-poster img { transition: transform 1s var(--ease-out); }
.team-poster:hover img { transform: scale(1.03); }

/* ---------- Mini self-playing chessboard ---------- */
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } .board-figure { max-width: 320px; } }
.board-figure { margin: 0; width: min(340px, 100%); justify-self: end; }
@media (max-width: 960px) { .board-figure { justify-self: start; } }
.board {
  position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .06), 0 30px 60px -20px rgba(0, 0, 0, .6);
  background: conic-gradient(#e9dfc4 25%, #3f6b52 0 50%, #e9dfc4 0 75%, #3f6b52 0) 0 0 / 25% 25%;
}
.board .hl { position: absolute; width: 12.5%; height: 12.5%; background: rgba(242, 194, 48, .55); transition: transform .3s var(--ease-out), opacity .3s; opacity: 0; }
.board .hl.on { opacity: 1; }
.board .hl.check { background: radial-gradient(circle, rgba(255, 70, 60, .9), rgba(255, 70, 60, 0) 70%); }
.board .pc {
  position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; display: grid; place-items: center;
  font-size: clamp(1.4rem, 3.6vw, 2.15rem); line-height: 1; z-index: 2; user-select: none;
  font-family: "Segoe UI Symbol", "Apple Symbols", "DejaVu Sans", serif;
  transition: transform .55s var(--ease-in-out), opacity .35s, scale .35s;
}
.board .pc.w { color: #fff; text-shadow: 0 0 1px #000, 0 0 1px #000, 0 2px 3px rgba(0, 0, 0, .55); }
.board .pc.b { color: #111; text-shadow: 0 0 1px rgba(255, 255, 255, .5), 0 2px 3px rgba(0, 0, 0, .4); }
.board .pc.moving { z-index: 4; scale: 1.15; }
.board .pc.taken { opacity: 0; scale: .2; }
.board-files { display: flex; justify-content: space-around; font-size: .7rem; color: rgba(255, 255, 255, .5); margin-top: 6px; font-weight: 600; letter-spacing: .1em; }
.board-figure figcaption { margin-top: 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .85rem; color: rgba(255, 255, 255, .75); }
.board-figure figcaption b { color: var(--yellow); font-family: var(--font-head); font-variant-numeric: tabular-nums; min-width: 7ch; text-align: right; }
.board .mate { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(20, 42, 31, .72); color: var(--white); font-family: var(--font-head); font-weight: 900; font-size: 1.6rem; text-align: center; opacity: 0; transition: opacity .5s; pointer-events: none; }
.board .mate small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .8rem; color: var(--yellow); margin-top: 6px; }
.board .mate.on { opacity: 1; }

/* ---------- About quote scrub ---------- */
.quote .qw { transition: opacity .25s, color .25s; opacity: .22; }
.quote .qw.lit { opacity: 1; }

/* ---------- Join page ---------- */
.day { position: relative; transition: transform .35s var(--ease-out), background .3s; }
.day.today { background: var(--green); outline: 2px solid var(--yellow); outline-offset: -2px; }
.day .today-chip { position: absolute; top: 16px; right: 16px; background: var(--yellow); color: var(--green-900); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; animation: chip-pulse 2s ease-in-out infinite; }
@keyframes chip-pulse { 50% { transform: scale(1.08); } }
.day .dname { display: inline-block; transition: transform .5s var(--ease-back); }
.day:hover .dname { transform: translateX(6px) scale(1.08); }
.pool > div { transition: transform .35s var(--ease-out), box-shadow .35s, border-color .3s; }
.pool > div:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-left-color: var(--green); }
.table-wrap.in tbody tr { animation: row-in .7s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 110ms + 250ms); }
@keyframes row-in { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
.table-wrap.in .pts span { animation: pop .5s var(--ease-back) backwards; animation-delay: calc(var(--i, 0) * 110ms + var(--j, 0) * 70ms + 450ms); }
@keyframes pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
tbody tr { transition: background .25s; }
tbody tr:hover { background: #fbf8ef; }
.contact-card .icon { transition: transform .6s var(--ease-back); }
.contact-card:hover .icon { transform: rotate(-12deg) scale(1.12); }

/* ---------- Footer & social ---------- */
.socials a { transition: background .25s, color .25s, transform .4s var(--ease-back); }
.socials a:hover { transform: translateY(-4px) rotate(-8deg); }
.site-footer ul a { display: inline-block; transition: color .2s, transform .3s var(--ease-out); }
.site-footer ul a:hover { transform: translateX(5px); }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 55; width: 52px; height: 52px; border-radius: 50%;
  border: 0; cursor: pointer; background: var(--green-900); color: var(--yellow); display: grid; place-items: center;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none;
  transition: opacity .35s, transform .45s var(--ease-back);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { position: absolute; inset: 0; width: 52px; height: 52px; rotate: -90deg; }
.to-top circle { fill: none; stroke: var(--yellow); stroke-width: 3; stroke-dasharray: 145; stroke-dashoffset: 145; }
.to-top .k { font-size: 1.4rem; line-height: 1; transition: transform .4s var(--ease-back); font-family: "Segoe UI Symbol", "Apple Symbols", serif; }
.to-top:hover .k { transform: translateY(-4px); }

/* ---------- Images fade in when loaded ---------- */
img.fade { opacity: 0; transition: opacity .7s ease, transform 1s var(--ease-out); }
img.fade.loaded { opacity: 1; }
.thumbs button, .event-media { background-image: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .12) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* ---------- Lightbox ---------- */
.lightbox { display: flex; opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s linear .35s; backdrop-filter: blur(6px); }
.lightbox.open { opacity: 1; visibility: visible; transition: opacity .35s ease, visibility 0s; }
.lb-stage img { transition: opacity .25s; }
.lb-stage img.loading { opacity: .25; }
.lb-stage img.a-zoom { animation: lb-zoom .55s var(--ease-out); }
.lb-stage img.a-next { animation: lb-next .5s var(--ease-out); }
.lb-stage img.a-prev { animation: lb-prev .5s var(--ease-out); }
@keyframes lb-zoom { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
@keyframes lb-next { from { opacity: 0; transform: translateX(60px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes lb-prev { from { opacity: 0; transform: translateX(-60px) scale(.97); } to { opacity: 1; transform: none; } }
.lb-spin { position: absolute; left: 50%; top: 50%; translate: -50% -50%; font-size: 2.4rem; color: var(--yellow); opacity: 0; transition: opacity .2s; pointer-events: none; font-family: "Segoe UI Symbol", "Apple Symbols", serif; }
.lb-spin.on { opacity: 1; animation: spin-k 1s var(--ease-in-out) infinite; }
@keyframes spin-k { 50% { transform: translateY(-14px) rotate(-20deg); } }
.lb-btn { transition: background .2s, color .2s, transform .3s var(--ease-back); }
.lb-btn:hover { transform: scale(1.1); }
.lb-prev:hover, .lb-next:hover { transform: translateY(-50%) scale(1.1); }
.lb-stage img { max-height: calc(100vh - 190px); }
.lb-strip { display: flex; gap: 6px; padding: 10px 18px 16px; overflow-x: auto; scrollbar-width: thin; justify-content: safe center; }
.lb-strip button { flex: none; width: 58px; height: 58px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--green-700); opacity: .5; transition: opacity .25s, border-color .25s, transform .3s var(--ease-back); }
.lb-strip button:hover { opacity: .9; transform: translateY(-3px); }
.lb-strip button.active { opacity: 1; border-color: var(--yellow); }
.lb-strip img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 600px) {
  .lb-stage img { max-height: calc(100vh - 230px); }
  .lb-prev:hover, .lb-next:hover { transform: scale(1.1); }
  .lb-strip { padding-bottom: 12px; }
  .lb-strip button { width: 46px; height: 46px; }
}

/* =========================================================
   Reduced motion: keep the site still and fully visible
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0ms !important; }
  .js .reveal { opacity: 1; }
  .wi { transform: none; }
  .js .seq { opacity: 1; transform: none; }
  .floaters, .scroll-cue, .curtain, .curtain-logo { display: none !important; }
  html.arriving::after { display: none; }
  .quote .qw { opacity: 1; }
}

/* move arrows on the Opera Game board */
.board .arrows { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; }
.board .arrows line { stroke: #f2c230; stroke-width: .13; stroke-linecap: round; opacity: 0; filter: drop-shadow(0 0 .05px rgba(0,0,0,.6)); }
.board .arrows.show line { opacity: .9; animation: arrow-draw .45s cubic-bezier(.16,1,.3,1) forwards, arrow-fade 1.1s ease .55s forwards; }
@keyframes arrow-draw { to { stroke-dashoffset: 0; } }
@keyframes arrow-fade { to { opacity: .25; } }
.team-poster.tilt { position: sticky; }
@media (max-width: 860px) { .team-poster.tilt { position: static; } }
