/* =========================================================
   ADA Chess Club — 3D layer + section details
   Pairs with js/chess3d.js and js/details.js
   ========================================================= */

/* ---------- Home banner: text column + 3D still life column ---------- */
.hero { align-items: center; min-height: min(92vh, 820px); }
.hero::after { background:
  linear-gradient(90deg, rgba(14,30,22,.95) 0%, rgba(14,30,22,.86) 45%, rgba(14,30,22,.74) 100%),
  linear-gradient(180deg, rgba(14,30,22,.2) 0%, rgba(14,30,22,.85) 100%); }
.hero .container.hero-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-top: 110px; padding-bottom: 90px; }
.hero-copy { min-width: 0; }
.hero .hero-bg { filter: saturate(.65); }
.hero h1 { font-size: clamp(2.6rem, 5.2vw, 4.6rem); line-height: 1.02; margin: 14px 0 22px; }
.hero p.lead { font-size: 1.15rem; max-width: 560px; }
.hero-btns { margin-top: 30px; }
.hero-visual { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 620px; justify-self: end; }
.hero-visual::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(closest-side, rgba(242,194,48,.14), transparent 70%); pointer-events: none; }
.gl-hero { position: absolute; inset: 0; width: 100%; height: 100%; display: block; -webkit-mask-image: radial-gradient(circle farthest-corner, #000 62%, transparent 92%); mask-image: radial-gradient(circle farthest-corner, #000 62%, transparent 92%); cursor: pointer; opacity: 0; transition: opacity 1s var(--ease-out, ease); }
.gl-hero-on .gl-hero { opacity: 1; }
.hero-glyph { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(9rem, 22vw, 18rem); line-height: 1; color: var(--yellow); opacity: .9; font-family: "Segoe UI Symbol", "Apple Symbols", "DejaVu Sans", serif; text-shadow: 0 30px 60px rgba(0,0,0,.45); }
.gl-hero-ok .hero-glyph { display: none; }
@media (max-width: 900px) {
  .hero { min-height: 0; }
  .hero .container.hero-inner { grid-template-columns: 1fr; gap: 0; padding-top: 24px; padding-bottom: 64px; }
  .hero-visual { order: -1; aspect-ratio: auto; height: 300px; max-width: 420px; justify-self: center; margin-bottom: 8px; }
  .hero-glyph { font-size: 9rem; }
  .hero::after { background: linear-gradient(180deg, rgba(14,30,22,.7) 0%, rgba(14,30,22,.88) 45%, rgba(14,30,22,.96) 100%); }
}

/* ---------- Events / Join banners: floating board ---------- */
.page-hero[data-scene] { min-height: 520px; display: flex; align-items: center; }
.page-hero[data-scene] .container { width: 100%; }
.gl-side { position: absolute; top: 0; right: 0; bottom: 0; width: 52%; z-index: 2; pointer-events: none; opacity: 0; animation: gl-fade 1.4s var(--ease-out, ease) .5s forwards; }
.gl-side canvas { width: 100%; height: 100%; display: block; }
@keyframes gl-fade { to { opacity: 1; } }
.gl-label {
  position: absolute; right: 26px; bottom: 22px; font-family: var(--font-head); font-weight: 800; font-size: .82rem; letter-spacing: .06em;
  color: var(--green-900); background: var(--yellow); padding: 7px 14px; border-radius: 999px; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
@media (min-width: 861px) {
  .gl-side-on .page-hero[data-scene] h1, .gl-side-on .page-hero[data-scene] p { max-width: 50%; }
}
@media (max-width: 860px) {
  .page-hero[data-scene] { min-height: 0; display: block; padding-bottom: 330px; }
  .gl-side { top: auto; height: 330px; width: 100%; }
  .gl-label { right: 50%; translate: 50% 0; bottom: 14px; }
}

/* ---------- Small 3D piece slots ---------- */
.p3d { display: none; pointer-events: none; }
.gl-ok .p3d { display: block; }
.p3d canvas { width: 100%; height: 100%; display: block; }

.gl-ok .stat .glyph { display: none; }
.stat-piece { width: 84px; height: 98px; margin: -8px auto 2px; }
@media (max-width: 860px) { .stat-piece { width: 66px; height: 78px; } }

.card-piece { position: absolute; top: -54px; right: 10px; width: 108px; height: 130px; z-index: 6; filter: drop-shadow(0 16px 18px rgba(0, 0, 0, .25)); }
.gl-ok .card:has(> .card-piece) { padding-top: 34px; }
.gl-ok .grid:has(.card-piece) { padding-top: 34px; }
@media (max-width: 700px) { .card-piece { width: 84px; height: 104px; top: -40px; } }

.gl-ok .event-media .placeholder { font-size: 0; }
.ph-piece { position: absolute; inset: 6% 0 0; }
.event-media .placeholder::after { content: ""; position: absolute; left: 50%; bottom: 10%; width: 46%; height: 12%; translate: -50% 0; border-radius: 50%; background: radial-gradient(rgba(242, 194, 48, .35), transparent 70%); pointer-events: none; }

/* ---------- Notation ticker ---------- */
.ticker { background: var(--green-900); color: rgba(255, 255, 255, .78); overflow: hidden; border-top: 1px solid rgba(242, 194, 48, .25); border-bottom: 1px solid rgba(242, 194, 48, .25); position: relative; }
.ticker::before, .ticker::after { content: ""; position: absolute; top: 0; bottom: 0; width: 80px; z-index: 1; pointer-events: none; }
.ticker::before { left: 0; background: linear-gradient(90deg, var(--green-900), transparent); }
.ticker::after { right: 0; background: linear-gradient(-90deg, var(--green-900), transparent); }
.tk-track { display: flex; width: max-content; animation: tk-move 70s linear infinite; }
.ticker:hover .tk-track { animation-play-state: paused; }
.tk-run { display: flex; align-items: center; gap: 22px; padding: 14px 11px; white-space: nowrap; font-family: var(--font-head); font-weight: 700; font-size: .95rem; letter-spacing: .02em; }
.tk-run b { color: var(--yellow); text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; }
.tk-run i { font-style: normal; color: var(--yellow); opacity: .7; font-family: "Segoe UI Symbol", "Apple Symbols", serif; }
.tk-run span:last-of-type { color: var(--yellow); }
@keyframes tk-move { to { transform: translateX(-50%); } }

/* ---------- Giant outline piece watermarks ---------- */
.has-wm { position: relative; overflow: clip; }
.has-wm > .container { position: relative; z-index: 1; }
.wm {
  position: absolute; top: 8%; z-index: 0; font-size: clamp(16rem, 34vw, 30rem); line-height: 1; pointer-events: none; user-select: none;
  color: transparent; -webkit-text-stroke: 2px rgba(31, 58, 43, .075); font-family: "Segoe UI Symbol", "Apple Symbols", "DejaVu Sans", serif;
  will-change: transform;
}
.wm-r { right: -4vw; }
.wm-l { left: -4vw; }
.section-dark .wm { -webkit-text-stroke-color: rgba(242, 194, 48, .09); }

/* paper grain + light on sand sections */
.section-sand {
  background-image:
    radial-gradient(60% 50% at 85% 0%, rgba(255, 255, 255, .55), transparent 70%),
    radial-gradient(50% 60% at 0% 100%, rgba(242, 194, 48, .12), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.2 0 0 0 0 0.15 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* heading underline drawn after the letters flip in */
.section-head h2::after { content: ""; display: block; width: 72px; height: 5px; margin-top: 16px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--yellow) 0 12px, var(--green) 12px 24px); transform: scaleX(0); transform-origin: left; transition: transform 1s var(--ease-out, ease) .5s; }
.section-dark .section-head h2::after { background: repeating-linear-gradient(90deg, var(--yellow) 0 12px, rgba(255, 255, 255, .85) 12px 24px); }
.section-head.center h2::after { margin-left: auto; margin-right: auto; transform-origin: center; }
.section-head h2.flip-in::after, html:not(.js) .section-head h2::after, .section-head .reveal.in h2::after, .section-head.in h2::after { transform: scaleX(1); }

/* ---------- Home: chess by the numbers (flip cards) ---------- */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 960px) { .facts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; } }
.fact { all: unset; box-sizing: border-box; display: block; cursor: pointer; perspective: 1100px; min-height: 300px; border-radius: var(--radius); }
.fact:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
.fact-in { position: relative; display: block; width: 100%; height: 100%; min-height: 300px; transform-style: preserve-3d; transition: transform .9s var(--ease-back, ease); }
.fact[aria-pressed="true"] .fact-in { transform: rotateY(180deg); }
@media (hover: hover) and (pointer: fine) { .fact:hover .fact-in { transform: rotateY(180deg); } .fact[aria-pressed="true"]:hover .fact-in { transform: none; } }
.fact-front, .fact-back { position: absolute; inset: 0; border-radius: var(--radius); backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; padding: 24px; box-shadow: var(--shadow); }
/* front: the club's dark green with a faint board pattern and a soft light behind the piece */
.fact-front { background-color: var(--green); color: var(--white); align-items: center; justify-content: flex-end; text-align: center; overflow: hidden; border: 1px solid rgba(242, 194, 48, .22); }
.fact-front::before { content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(closest-side at 50% 30%, rgba(246, 241, 228, .16), transparent 100%),
    linear-gradient(45deg, rgba(255, 255, 255, .045) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .045) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, .045) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, .045) 75%);
  background-size: 100% 100%, 36px 36px, 36px 36px; background-position: 0 0, 0 0, 18px 18px; }
.fact-front > * { position: relative; }
.fact-front .p3d { width: 110px; height: 132px; margin-bottom: auto; }
.fact-front b { font-family: var(--font-head); font-weight: 900; font-size: 3.4rem; line-height: 1; color: var(--yellow); letter-spacing: -.03em; }
.fact-front b sup { font-size: .45em; color: var(--white); }
.fact-front small { font-weight: 700; color: rgba(255, 255, 255, .9); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; margin-top: 8px; }
.fact-front em { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--green-900); background: var(--yellow); padding: 3px 10px; border-radius: 999px; margin-top: 12px; letter-spacing: .08em; text-transform: uppercase; }
/* back: a deeper green so the two sides are easy to tell apart */
.fact-back { background: var(--green-900); color: rgba(255, 255, 255, .92); transform: rotateY(180deg); justify-content: center; gap: 10px; font-size: .95rem; line-height: 1.55; border: 1px solid rgba(242, 194, 48, .35); }
.fact-back b { font-family: var(--font-head); color: var(--yellow); font-size: 1.3rem; }
.fact-back b sup { color: var(--yellow); }
.fact-back::after { content: "\265E\FE0E"; position: absolute; right: 16px; bottom: 6px; font-size: 4.5rem; color: rgba(242, 194, 48, .1); font-family: "Segoe UI Symbol", "Apple Symbols", serif; pointer-events: none; }
/* without WebGL the front shows no piece: keep the number centred */
html:not(.gl-ok) .fact-front { justify-content: center; }

/* ---------- Events: formats explained ---------- */
.formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 960px) { .formats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .formats { grid-template-columns: 1fr; } }
.fmt { position: relative; display: grid; grid-template-columns: 88px 1fr; gap: 4px 16px; align-items: start; background: var(--green-700); border-radius: var(--radius); padding: 20px 22px 20px 14px; border: 1px solid rgba(255, 255, 255, .06); overflow: hidden; transition: transform .35s var(--ease-out, ease), border-color .35s; }
.fmt:hover { transform: translateY(-4px); border-color: rgba(242, 194, 48, .5); }
.fmt::after { content: attr(data-code); position: absolute; right: 14px; top: 12px; font-family: var(--font-head); font-weight: 900; font-size: .72rem; letter-spacing: .12em; color: rgba(242, 194, 48, .55); }
.fmt .p3d { width: 88px; height: 116px; grid-row: span 3; margin-top: -10px; }
.fmt:not(:has(.p3d)) { grid-template-columns: 1fr; }
.fmt h3 { margin: 2px 0 2px; font-size: 1.1rem; color: var(--white); padding-right: 40px; }
.fmt p { margin: 0; font-size: .92rem; }
.fmt .seen { margin-top: 10px; font-size: .78rem; color: var(--sage); }
.fmt .seen strong { color: var(--yellow); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .7rem; margin-right: 6px; }
.html-nogl .fmt { grid-template-columns: 1fr; }
html:not(.gl-ok) .fmt { grid-template-columns: 1fr; padding-left: 22px; }

/* ---------- Join: three moves ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: s; position: relative; }
.steps::before { content: ""; position: absolute; left: 12%; right: 12%; top: 64px; height: 3px; background: repeating-linear-gradient(90deg, var(--green) 0 10px, transparent 10px 20px); opacity: .35; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } .steps::before { display: none; } }
.step { position: relative; background: var(--white); border-radius: var(--radius); padding: 22px 24px 26px; box-shadow: var(--shadow); text-align: center; }
.step .p3d { width: 100px; height: 120px; margin: -6px auto 4px; }
.step-n { display: inline-grid; place-items: center; min-width: 44px; height: 30px; padding: 0 10px; border-radius: 999px; background: var(--yellow); color: var(--green-900); font-family: var(--font-head); font-weight: 900; margin-bottom: 10px; }
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.step a { color: var(--green); font-weight: 700; }

/* ---------- About: our journey ---------- */
.journey { position: relative; background: var(--green-900); color: var(--white); }
.jr-pin { padding: 90px 0 70px; overflow: hidden; }
.jr-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px 30px; margin-bottom: 34px; }
.jr-head .section-head { margin: 0; }
.jr-count { font-family: var(--font-head); font-weight: 800; color: var(--yellow); letter-spacing: .04em; }
.journey { --jr-pad: max(20px, calc((100vw - var(--max)) / 2 + 20px)); }
/* a sideways row: swipe / trackpad / drag / arrows; vertical scrolling passes straight through to the page */
.jr-track { display: flex; gap: 22px; padding: 16px var(--jr-pad) 26px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--jr-pad); overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-x pan-y; outline: none; }
.jr-track::-webkit-scrollbar { display: none; }
.jr-track:focus-visible { box-shadow: inset 0 0 0 3px rgba(242, 194, 48, .6); }
@media (hover: hover) and (pointer: fine) { .jr-track { cursor: grab; } }
.jr-track.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.jr-track.dragging .jr-item { pointer-events: none; }
.jr-item img { -webkit-user-drag: none; user-select: none; }
.jr-side { display: flex; align-items: center; gap: 18px; }
.jr-nav { display: flex; gap: 8px; }
.jr-nav button { width: 46px; height: 46px; border-radius: 50%; border: 2px solid rgba(242, 194, 48, .55); background: transparent; color: var(--yellow); display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s, opacity .2s, transform .25s var(--ease-back, ease); }
.jr-nav button:hover:not(:disabled) { background: var(--yellow); color: var(--green-900); transform: scale(1.06); }
.jr-nav button:disabled { opacity: .3; cursor: default; }
.jr-nav svg { width: 22px; height: 22px; }
.jr-slot { flex: none; display: flex; scroll-snap-align: start; }
.jr-item { width: 270px; background: var(--green-700); border-radius: var(--radius); overflow: hidden; box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .8); border: 1px solid rgba(255, 255, 255, .06); transition: opacity .3s; }
.jr-item.up { background: #2f5a43; border-color: rgba(242, 194, 48, .55); }
.jr-item.award-item { background: var(--yellow); color: var(--green-900); }
.jr-item.award-item time { color: var(--green-700); }
.jr-media { position: relative; aspect-ratio: 16/10; background: var(--green); display: grid; place-items: center; overflow: hidden; }
.jr-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jr-glyph { font-size: 4rem; color: var(--yellow); font-family: "Segoe UI Symbol", "Apple Symbols", serif; }
.jr-move { position: absolute; left: 10px; top: 10px; font-family: var(--font-head); font-weight: 900; font-size: .85rem; background: rgba(10, 24, 17, .8); color: var(--yellow); padding: 4px 10px; border-radius: 999px; }
.jr-body { padding: 16px 18px 20px; display: grid; gap: 6px; justify-items: start; }
.jr-body time { font-size: .8rem; font-weight: 700; color: var(--sage); text-transform: uppercase; letter-spacing: .08em; }
.jr-body h3 { font-size: 1.02rem; margin: 0; line-height: 1.3; }
.jr-progress { margin: 6px var(--jr-pad) 0; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.jr-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), #ffe07a); transform-origin: left; transform: scaleX(0); }
.jr-hint { margin: 14px var(--jr-pad) 0; font-size: .78rem; color: rgba(255, 255, 255, .55); letter-spacing: .14em; text-transform: uppercase; }
.js .jr-item { opacity: 0; }
.js .jr-item.in { opacity: 1; }

/* ---------- Team: board legend + counts ---------- */
.legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; background: var(--green); color: var(--white); border-radius: 20px; padding: 18px 24px; margin-bottom: 64px; box-shadow: var(--shadow); }
.legend-title { font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; }
.legend-title small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .85rem; color: var(--sage); }
.legend ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; }
.legend-item { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: .92rem; }
.legend-item .p3d { width: 40px; height: 52px; }
.legend-item .g { font-size: 1.6rem; color: var(--yellow); width: 30px; text-align: center; font-family: "Segoe UI Symbol", "Apple Symbols", serif; }
.gl-ok .legend-item .g { display: none; }
.team-stats { display: flex; gap: 22px; font-family: var(--font-head); }
.team-stats b { display: block; font-size: 2rem; font-weight: 900; color: var(--yellow); line-height: 1; }
.team-stats span { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .7); font-family: var(--font-body); font-weight: 700; }
.count-chip { display: inline-flex; align-items: center; gap: 8px; margin: -6px 0 18px; font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--green); background: var(--cream-200); padding: 6px 12px; border-radius: 999px; }
.count-chip::before { content: "♟\FE0E"; color: var(--yellow-600); font-family: "Segoe UI Symbol", "Apple Symbols", serif; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .tk-track { animation: none; }
  .gl-side { animation: none; opacity: 1; }
  .fact-in { transition: none; }
  .wm { transform: none !important; }
  .jr-item { opacity: 1 !important; }
}

.journey .eyebrow { color: var(--yellow); }
.journey .lead { color: rgba(255, 255, 255, .78); }
.journey h2 { color: var(--white); }
.journey .section-head h2::after { background: repeating-linear-gradient(90deg, var(--yellow) 0 12px, rgba(255, 255, 255, .85) 12px 24px); }
.jr-body { min-height: 150px; align-content: start; }

