/* Public website — editorial, paper and ink. */
body.site { background: var(--bg); }
.s-head { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.s-head.scrolled { border-bottom-color: var(--line); }
.s-head .wrap { display: flex; align-items: center; gap: 14px; min-height: 68px; }
.s-nav { display: flex; gap: 4px; margin-left: 26px; }
.s-nav a { padding: 8px 10px; color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 500; border-radius: 6px; }
.s-nav a:hover { color: var(--ink); background: var(--surface-2); }
.s-login { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14.5px; padding: 8px 6px; }
.s-login-m, .s-menu { display: none; }
@media (max-width: 980px) {
  .s-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; margin: 0; gap: 0; }
  .s-nav.open { display: flex; }
  .s-nav a { padding: 13px 4px; font-size: 17px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .s-login-m, .s-menu { display: inline-flex; }
  .s-login { display: none; }
}

/* hero */
.hero { padding: 64px 0 74px; border-bottom: 1px solid var(--line); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: center; }
.kicker { font-size: 14px; color: var(--accent-text); font-weight: 500; margin: 0 0 18px; }
.hero h1 { font-size: clamp(42px, 6.6vw, 80px); line-height: 1; letter-spacing: -.03em; font-weight: 600; margin: 0 0 22px; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.lead { font-size: clamp(16.5px, 1.6vw, 19px); color: var(--ink-2); max-width: 540px; line-height: 1.6; margin: 0; }
.hero-facts { margin: 30px 0 0; font-size: 14.5px; color: var(--muted); }
.hero-facts b { color: var(--ink); font-weight: 600; }
.hero-abacus { margin: 0; }
.hero-abacus figcaption { margin-top: 14px; font-size: 14.5px; color: var(--muted); text-align: center; }
.hero-abacus figcaption span { color: var(--ink); font-weight: 600; }
.hero-abacus figcaption b { font: 600 20px var(--display); color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
@media (max-width: 900px) {
  .hero { padding: 30px 0 46px; }
  .hero-in { grid-template-columns: 1fr; gap: 34px; }
}

/* the soroban (Japanese abacus) */
.soroban svg { width: 100%; height: auto; display: block; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.soroban .frame { fill: #2b2140; }
.soroban .frame-in { fill: #f3ede2; }
.soroban .rod { stroke: #b9ad97; stroke-width: 3; }
.soroban .beam { fill: #2b2140; }
.soroban .dotm { fill: #f3ede2; }
.soroban .bead { cursor: pointer; transition: transform .26s cubic-bezier(.3, .7, .3, 1); }
.soroban .bead path { fill: #5a3cb8; stroke: #3a2380; stroke-width: 1.5; transition: fill .2s; }
.soroban .bead.on path { fill: #e2611d; stroke: #a8450c; }
.soroban .bead:hover path { filter: brightness(1.12); }
.soroban .bead .shine { fill: rgba(255, 255, 255, .22); stroke: none; pointer-events: none; }
:root[data-theme="dark"] .soroban .frame-in { fill: #221e2e; }
:root[data-theme="dark"] .soroban .rod { stroke: #4a4360; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .soroban .frame-in { fill: #221e2e; } :root:not([data-theme="light"]) .soroban .rod { stroke: #4a4360; } }

/* sections */
.s-sec { padding: 80px 0; border-bottom: 1px solid var(--line); }
.s-sec.paper { background: var(--surface); }
.s-title { font-size: clamp(30px, 4.2vw, 46px); letter-spacing: -.02em; margin: 0 0 22px; max-width: 760px; }
.two { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
@media (max-width: 900px) { .s-sec { padding: 54px 0; } .two { grid-template-columns: 1fr; gap: 22px; } }

/* how it works: numbered columns separated by hairlines */
.journey { list-style: none; margin: 34px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.journey li { padding: 20px 22px 0 0; }
.journey li + li { padding-left: 22px; border-left: 1px solid var(--line); }
.journey .n { font: 500 46px/1 var(--display); color: var(--primary-text); font-variant-numeric: lining-nums; }
.journey li:last-child .n { color: var(--accent); }
.journey h3 { font-size: 21px; margin: 16px 0 6px; }
.journey p { color: var(--muted); margin: 0; font-size: 15px; }
@media (max-width: 860px) {
  .journey { grid-template-columns: 1fr 1fr; }
  .journey li:nth-child(3) { border-left: 0; padding-left: 0; }
  .journey li:nth-child(n+3) { border-top: 1px solid var(--line); margin-top: 18px; }
}
@media (max-width: 520px) { .journey { grid-template-columns: 1fr; } .journey li, .journey li + li { padding: 18px 0 0; border-left: 0; } .journey li + li { border-top: 1px solid var(--line); margin-top: 18px; } }

/* programmes comparison */
.prog-table table.t th { background: var(--surface); font-size: 13px; }
.prog-table table.t th:not(:first-child) { font: 600 20px/1.2 var(--display); color: var(--ink); }
.prog-table table.t td:first-child { color: var(--muted); width: 32%; }
.prog-table .lv { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.prog-table .lv span { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font: 600 12px var(--ui); border: 1px solid var(--line-2); color: var(--ink-2); }
.prog-table .lv span.m { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* branch directory */
.dir { border-top: 1px solid var(--ink); margin-top: 30px; }
.dir-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: start; }
.dir-row h3 { font-size: 25px; margin: 0 0 4px; }
.dir-row .who { color: var(--muted); font-size: 14.5px; }
.dir-row .addr { font-size: 14.5px; color: var(--ink-2); }
.dir-row .tm { font-size: 14.5px; white-space: pre-wrap; }
.dir-row .tags { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.dir-row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 900px) { .dir-row { grid-template-columns: 1fr; gap: 8px; } .dir-row .acts { justify-content: flex-start; margin-top: 6px; } }

/* competition — a poster on dark ink */
.s-sec.ink { background: #17132a; color: #ece6f6; border-bottom: 0; }
.s-sec.ink h2, .s-sec.ink h3 { color: #fff; }
.s-sec.ink .muted { color: #a59cbd; }
.poster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
.poster .date { font: 500 clamp(56px, 8vw, 104px)/.95 var(--display); letter-spacing: -.03em; color: #ffb085; margin: 4px 0 16px; font-variant-numeric: lining-nums; }
.poster .date small { display: block; font: 500 16px var(--ui); color: #a59cbd; letter-spacing: 0; margin-top: 10px; }
.fees { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 15px; }
.fees th, .fees td { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); text-align: left; }
.fees th { font-weight: 500; color: #a59cbd; font-size: 13px; }
.fees td.n { text-align: right; font: 600 18px var(--display); font-variant-numeric: lining-nums tabular-nums; color: #fff; }
.fees th.n { text-align: right; }
.rules { list-style: none; margin: 0; padding: 0; counter-reset: r; columns: 1; font-size: 14.5px; color: #d3cce3; }
.rules li { counter-increment: r; padding: 9px 0 9px 36px; border-bottom: 1px solid rgba(255, 255, 255, .08); position: relative; break-inside: avoid; }
.rules li::before { content: counter(r); position: absolute; left: 0; top: 8px; font: 600 15px var(--display); color: #ffb085; font-variant-numeric: lining-nums; }
.s-sec.ink .btn.ghost { --b: transparent; --bh: rgba(255, 255, 255, .08); --bi: #fff; --bb: rgba(255, 255, 255, .3); }
.s-sec.ink a:not(.btn) { color: #ffb085; }
@media (max-width: 900px) { .poster { grid-template-columns: 1fr; gap: 30px; } }

/* results */
.hof { border-top: 1px solid var(--ink); margin-top: 26px; }
.hof-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr) 80px; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.hof-row .aw { font-size: 13px; font-weight: 600; color: var(--accent-text); }
.hof-row .nm { font: 600 18px var(--display); }
.hof-row .lv { color: var(--muted); font-size: 14px; }
.hof-row .sc { text-align: right; font: 600 18px var(--display); font-variant-numeric: lining-nums tabular-nums; }
@media (max-width: 700px) { .hof-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; } .hof-row .aw { grid-column: 1 / -1; } .hof-row .lv { grid-column: 1; } .hof-row .sc { grid-row: 2; grid-column: 2; } }

.gal { columns: 3 260px; column-gap: 14px; }
.gal figure { margin: 0 0 14px; break-inside: avoid; }
.gal img { border-radius: 8px; width: 100%; }
.gal figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.quotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 36px; }
.quotes blockquote { margin: 0; font: italic 400 20px/1.45 var(--display); color: var(--ink); }
.quotes cite { display: block; margin-top: 14px; font: 600 14px var(--ui); font-style: normal; }
.quotes cite span { display: block; font-weight: 400; color: var(--muted); }

.faqs { border-top: 1px solid var(--ink); }
.faqs details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faqs summary { cursor: pointer; font: 600 19px/1.3 var(--display); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faqs summary::-webkit-details-marker { display: none; }
.faqs summary::after { content: '+'; font: 400 24px/1 var(--ui); color: var(--accent); transition: transform .2s; }
.faqs details[open] summary::after { transform: rotate(45deg); }
.faqs p { margin: 10px 0 0; color: var(--ink-2); }

.s-foot { background: #17132a; color: #a59cbd; padding: 56px 0 34px; font-size: 14px; }
.s-foot .brand b { color: #fff; }
.s-foot .brand span { color: #a59cbd; }
.s-foot a { color: #e3dcf3; text-decoration: none; }
.s-foot a:hover { color: #ffb085; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.foot-grid h4 { color: #fff; font: 600 15px var(--display); margin-bottom: 12px; }
.foot-grid div a { display: block; margin: 7px 0; }
.foot-copy { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 34px; padding-top: 20px; font-size: 12.5px; display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

[data-reveal] { opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; } .soroban .bead { transition: none; } }

/* phones: programme table becomes label-above rows; header keeps only what matters */
@media (max-width: 560px) {
  .prog-table table.t, .prog-table tbody, .prog-table thead { display: block; }
  .prog-table tr { display: grid; grid-template-columns: 1fr 1fr; }
  .prog-table thead th:first-child { display: none; }
  .prog-table table.t td:first-child { grid-column: 1 / -1; width: auto; padding-bottom: 0; border-bottom: 0; font-size: 12.5px; text-transform: none; }
  .prog-table td[colspan] { grid-column: 1 / -1; }
  .s-head #tb { display: none; }
  .s-head .brand span { display: none; }
}
