* { box-sizing: border-box }
:root { font-family: Inter, "Segoe UI", sans-serif; font-size: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.landing { --bg:#10140f; --ink:#eff2e8; --muted:#b4bdac; --rule:#363f31; --accent:#c0ed88; min-height:100vh; display:flex; flex-direction:column; }
a { color:inherit; text-underline-offset:.3em }
a:focus-visible,select:focus-visible { outline:3px solid currentColor; outline-offset:5px }
header,footer,.hero { width:min(90%,92rem); margin-inline:auto }
header,footer { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
header { min-height:5.6rem; border-bottom:1px solid var(--rule) }
.brand,nav a,.action { text-decoration:none }
.brand { display:inline-flex; align-items:center; gap:.7rem; font:700 .95rem/1.1 "Courier New",monospace; letter-spacing:.09em }
.brand img { width:2.8rem; height:2.8rem }
nav { display:flex; gap:clamp(1rem,3vw,3rem); font-size:.94rem }
nav a:hover { text-decoration:underline }
.hero { display:grid; grid-template-columns:.88fr 1.12fr; align-items:center; flex:none; padding-block:clamp(.45rem,.9vw,1.05rem); gap:.4rem }
.kicker,figcaption,footer { font-family:"Courier New",monospace }
.kicker { color:var(--accent); text-transform:uppercase; font-size:.82rem; letter-spacing:.13em; line-height:1.6 }
.kicker span { display:inline-block; width:2rem; height:1px; background:currentColor; vertical-align:middle; margin-right:.5rem }
.intro h1 { font-size:clamp(3.28rem,5.6vw,6.4rem); line-height:.97; letter-spacing:-.075em; margin:1.5rem 0 .3rem; font-weight:550 }
.hero .intro > :first-child { margin-block-start:.3rem }
.hero .intro > :last-child { margin-block-end:.2em }
.intro h1 i { display:block; font-family:Georgia,serif; font-weight:400; color:var(--accent); letter-spacing:-.08em }
.intro > .lede {margin-block:.3rem}
.lede,.summary { max-width:36ch; font-size:clamp(1.12rem,1.45vw,1.45rem); line-height:1.6; color:var(--muted) }
.action { display:inline-block; background:var(--accent); color:#18200e; padding:1rem 1.4rem; margin-top:.8rem; font-weight:650; border-radius:3px }
.action:hover { background:#dcffac }
figure { margin:0 }
.instrument { aspect-ratio:1.18; position:relative; background:radial-gradient(ellipse,#222d1b55,transparent 68%),radial-gradient(#48523c99 .7px,transparent .85px); background-size:auto,16px 16px; border:1px solid var(--rule); overflow:hidden }
.instrument img { width:100%; height:100%; object-fit:cover }
figcaption,footer { font-size:.82rem; color:var(--muted); line-height:1.6 }
.landing figcaption { display:flex; justify-content:space-between; padding:.7rem 0; gap:.8rem }
footer { border-top:1px solid var(--rule); padding:1.25rem 0 }
.reader { --bg:#fafbf9; --ink:#15232b; --muted:#43535d; --rule:#ccd5d7; --accent:#345b4a; color-scheme:light }
.reader.night { --bg:#141a1e; --ink:#edf1ee; --muted:#b4c2c5; --rule:#39484b; --accent:#b3dfad; color-scheme:dark }
.reader .brand img { background:#11170e; border-radius:4px }
.reader header label { display:flex; gap:.65rem; align-items:center; font-size:.94rem }
select { padding:.55rem; background:var(--bg); color:var(--ink); border:1px solid var(--muted); border-radius:4px; font:inherit }
.paper { max-width:44rem; margin:clamp(2.5rem,7vw,6rem) auto; width:90% }
.paper h1 { font-size:clamp(2.8rem,6vw,4.8rem); letter-spacing:-.055em; line-height:1.04; margin:1rem 0 }
.paper section { margin-top:2.3rem; border-top:1px solid var(--rule); padding-top:.9rem }
.paper section p { line-height:1.75; font-size:1.125rem }
.paper figure img { width:100%; height:15rem; object-fit:contain; background:#10140f }
@media(max-width:720px){ .hero {grid-template-columns:1fr; gap:.315rem} .hero .intro > .invitation:last-child {margin-block-end:.04em} .intro h1 i {display:inline} .reader header {flex-wrap:wrap;padding-block:1rem} .landing header .brand {font-size:.8rem;gap:.25rem} .landing .brand img{width:2rem} footer{flex-wrap:wrap} }
.landing header { min-height:3.65rem }
.landing header > nav:only-child {margin-inline-start:auto}
.landing footer { padding-block:.65rem }
.landing footer {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,auto) minmax(0,1fr);column-gap:clamp(.4rem,2vw,1rem)}
.landing footer > :last-child {text-align:right}
@media(max-width:720px){.landing footer{grid-template-columns:minmax(0,1fr) minmax(0,2.3fr) minmax(0,1fr);overflow-wrap:anywhere}}
.landing::after {content:"";flex:1 1 0px}
.blocks-credit {text-align:center;font-size:.72rem}
.invitation { text-align:center; text-transform:uppercase; color:var(--accent); margin-top:.3rem; font:700 .94rem/1.5 "Courier New",monospace }
.register { color:#939c8b; letter-spacing:.12em }
.admin { width:min(90%,72rem); margin:3rem auto }
.admin summary { cursor:pointer; font-size:1.25rem; font-weight:650; padding:.8rem 0 }
.admin form { max-width:40rem }
.admin label { display:grid; gap:.4rem; margin:1rem 0; font-weight:600 }
.admin input,.admin textarea,.admin button { font:inherit; padding:.6rem; border:1px solid #77857e; border-radius:4px }
.admin textarea { min-height:4rem }
.admin button { cursor:pointer; background:#203b2e; color:white; margin-bottom:.5rem }
.admin iframe { width:100%; height:65vh; border:1px solid var(--rule) }
@media(min-width:721px) {
  .hero { padding-block:clamp(.15rem,calc(7.5vh - 3.6vw),2rem) }
  .instrument { height:min(62vh,39rem); aspect-ratio:auto }
  .instrument img { object-fit:contain }
  .intro h1 { font-size:clamp(2.8rem,min(5.6vw,11.2vh),6.4rem) }
}
.kicker b { font-weight:inherit }
.editor-bar { background:#e1e9dc; color:#182218; padding:.55rem 5%; display:flex; flex-wrap:wrap; gap:.7rem; align-items:center; font:1rem/1.4 "Segoe UI",sans-serif }
.editor-bar button,.editor-bar input { font:inherit; padding:.35rem .7rem; border-radius:4px; border:1px solid #64745f }
.editor-bar button,.editor-bar summary { cursor:pointer }
.editor-bar #actions:not([hidden]) { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem }
.editor-bar details label { display:block; padding:.25rem }
.editing [data-field] { outline:1px dashed #b2c39d; outline-offset:3px; cursor:text }
.editing [data-field]:focus { outline:2px solid #c0ed88 }
.builder input,.builder button { font:inherit; padding:.48rem .7rem; border-radius:4px; border:1px solid var(--muted); background:var(--bg); color:var(--ink) }
.builder button { margin:.22rem; cursor:pointer }
.builder button:disabled { opacity:.45; cursor:default }
.builder #drop { border:2px dashed var(--muted); padding:1rem; margin-top:1rem }
.block-image { max-width:100%; max-height:24rem; background:#10140f }
.block-text { white-space:pre-wrap }
.builder [contenteditable] { outline:1px dashed var(--muted); outline-offset:3px }
.image-pins {position:relative;display:table;max-width:100%}
.image-pins img {display:block}
.builder .pin {position:absolute;transform:translate(-50%,-50%);border-radius:100%;margin:0;background:#263c25;color:white;font-weight:bold;padding:.2rem .45rem}
.discussion-panel {margin:1.2rem 0;border-top:1px solid var(--rule);padding-top:.8rem}
.discussion-panel small {display:block}
.discussion-panel details {padding:.6rem .4rem;border-bottom:1px solid var(--rule)}
.builder summary {cursor:pointer;font-weight:600}
.builder textarea {display:block;width:100%;min-height:4rem;font:inherit;padding:.5rem}
.discussion-panel details p {white-space:pre-wrap;overflow-wrap:anywhere}
.builder mark {background:#d7eab9;color:#202c20;cursor:pointer}
.editor-bar {background:#17271d;color:#eaf0e6;padding:.65rem 4%;gap:1rem}
.editor-bar a {color:#d0e7bd}.editor-bar button {background:#e3efd9;color:#1c3223;border:0;padding:.5rem .85rem;border-radius:6px;font-weight:600}
.editor-bar input {background:white;color:#17271d}
/* The rally is drawn in normalized court coordinates so returns meet the
   paddles at every aspect ratio. The same clock drives all three elements. */
.rally {position:relative; isolation:isolate; padding:clamp(.825rem,2.25vw,2.1rem) clamp(1.1rem,3vw,2.8rem); border:1px solid #43523a; border-radius:.5rem; background:radial-gradient(ellipse at center,#293923,#10190f 80%); box-shadow:inset 0 0 3rem #080d09}
.court {position:relative; aspect-ratio:7/3; border-block:1px solid #728765; background-image:radial-gradient(#8da87f44 .8px,transparent 1px); background-size:15px 15px}
.baseline {position:absolute; left:50%; inset-block:0; border-left:1px dashed #7f946773}
.playfield {position:absolute; inset:4px 7%}
.paddle,.ball {position:absolute; background:#c7f89c; box-shadow:0 0 10px #9be87985; animation:12s linear infinite; transform:translate(-50%,-50%)}
.paddle {width:5px; height:18%; border-radius:2px}
.west {left:0; top:35%; animation-name:west-return}
.east {left:100%; top:65%; animation-name:east-return}
.ball {left:48%;top:54%;width:8px;height:8px;border-radius:50%;background:#edffbf;animation-name:rally-flight}
@keyframes rally-flight {
  0%,100% {left:0;top:35%} 12.5% {left:50%;top:100%} 25% {left:100%;top:35%}
  32% {left:72%;top:0} 50% {left:0;top:90%} 53% {left:12%;top:100%}
  75% {left:100%;top:27%} 86% {left:56%;top:0}
}
@keyframes west-return {0%,100%{top:35%} 20%{top:52%} 46%,54%{top:90%} 72%{top:56%} 96%{top:35%}}
@keyframes east-return {0%,100%{top:58%} 22%,28%{top:35%} 47%{top:61%} 71%,79%{top:27%}}
.rally input,.rally label {position:relative; z-index:1; cursor:pointer}
.rally input {accent-color:#c0ed88; margin:0 .4rem .75rem 0}
.rally label {color:#c0ccba;font: .76rem/1.4 "Courier New",monospace}
.rally input:checked ~ .court i {animation-play-state:paused}
@media(prefers-reduced-motion:reduce) {
  .rally i {animation:none}
  .rally input,.rally label {display:none}
}

dialog.desktop-suggestion {
  box-sizing:border-box; width:min(28rem,calc(100% - 2rem)); max-height:90dvh;
  padding:1.5rem; border:1px solid var(--muted); border-radius:.75rem;
  background:var(--bg); color:var(--ink); line-height:1.55;
}
dialog.desktop-suggestion::backdrop { background:rgb(0 0 0 / .65) }
dialog.desktop-suggestion h2 { margin:0; font-size:1.45rem; line-height:1.2 }
dialog.desktop-suggestion button { width:100%; min-height:48px; background:var(--ink); color:var(--bg); border:0; border-radius:.35rem; font:inherit; font-weight:bold; cursor:pointer }

.home-rich-section .rich-body > :first-child { margin-top:0 }
.home-rich-section .rich-body > :last-child { margin-bottom:0 }
.landing .kicker .rich-body span { display:inline;width:auto;height:auto;background:transparent;margin:0 }
.landing .home-accent {font-family:Georgia,serif;color:var(--accent);font-style:italic;font-weight:400}
.landing .rich-dialog label[hidden] { display:none }

#reading-nav {position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;background:var(--bg);padding:.45rem 0;border-bottom:1px solid var(--rule)}
#reading-nav[hidden],#reading-nav [hidden]{display:none}
#reading-nav summary {cursor:pointer;border:1px solid var(--muted);border-radius:4px;padding:.48rem .7rem}
#contents ol {position:absolute;top:100%;left:0;width:min(100%,32rem);max-height:50vh;overflow:auto;margin:0;padding:.5rem 1rem .5rem 2.6rem;background:var(--bg);border:1px solid var(--rule);border-radius:4px}
#contents a {display:block;padding:.4rem;overflow-wrap:anywhere}
#blocks > section,#blocks [id^="thread-"],#blocks [id^="reply-"] {scroll-margin-top:4rem}

.block-search {margin:1rem 0;max-width:46rem}
.block-search[hidden],.block-search [hidden] {display:none!important}
.block-search label {display:block;font-weight:600}
.block-search input[type=search] {display:block;width:100%;padding:.65rem .8rem;margin-top:.35rem;font:inherit;background:var(--surface,var(--bg));color:var(--fg,var(--ink));border:1px solid var(--soft,var(--muted));border-radius:5px}
.search-results {max-height:min(55vh,28rem);overflow:auto;border:1px solid var(--line,var(--rule));padding:.6rem .85rem;background:var(--surface,var(--bg));border-radius:5px}
.search-results p,.search-group h3 {margin:.4rem 0}
.search-group {margin:.75rem 0}
.search-group button,.workspace .search-group button:not(.pin) {display:block;width:100%;padding:.55rem .4rem;text-align:left;background:transparent;color:inherit;border:0;border-bottom:1px solid var(--line,var(--rule));font:inherit;overflow-wrap:anywhere}
.search-group small {display:block;color:var(--soft,var(--muted));font-weight:600}
.search-group mark {background:#dfedaa;color:#182314}

.referral-page .referral-panel {width:min(90%,32rem);margin:clamp(.15rem,.5vh,.35rem) auto clamp(3rem,10vh,7rem)}
.referral-panel h1 {font-size:clamp(2.1rem,5vw,3.25rem);letter-spacing:-.055em;margin:0}
.referral-panel p {line-height:1.6;color:var(--muted)}
.referral-panel form {margin-top:2rem}
.referral-panel h1 + form {margin-top:1rem}
.referral-panel label {display:block;font-weight:600;margin-bottom:.45rem}
.referral-panel input {box-sizing:border-box;width:100%;padding:.75rem;border:1px solid var(--muted);border-radius:3px;background:var(--bg);color:var(--ink);font:1.1rem "Courier New",monospace}
.referral-panel input:focus-visible,.referral-panel button:focus-visible {outline:2px solid var(--accent);outline-offset:3px}
.referral-panel .action {font:inherit;font-weight:650;border:0;cursor:pointer}
#referral-feedback {color:#f5c5aa}
#referral-feedback:not(.visible):not(:target) span {display:none}

.referral-panel input + label {margin-top:1rem}
#login-feedback {color:#f5c5aa}
#login-feedback:not(.visible):not(:target) span {display:none}
@media(max-width:480px){.landing header:has(nav){flex-wrap:wrap;padding-block:.55rem}.landing header nav{flex-wrap:wrap}}
.landing .site-header { min-height:3.65rem; padding-block:.2rem; gap:.45rem 1rem }
.site-logo { display:block; flex:none; max-width:100% }
.site-logo img { display:block; width:auto; height:clamp(34px,8vh,52px); max-width:100%; object-fit:contain }
.site-tagline { display:block; font-size:.72rem }
.reader .brand img[src$="ns31-icon.svg"] { width:1.85rem; height:1.85rem }
@media(max-width:720px){
  .landing .site-header { flex-direction:column; justify-content:center; padding-block:.3rem }
  .site-logo img { height:clamp(30px,6.5vh,48px) }
  .landing .site-header nav { justify-content:center; flex-wrap:wrap; gap:.2rem 1rem }
  .landing .site-footer-name { grid-column:1 / -1; text-align:center }
  .landing footer .blocks-credit { grid-column:2 }
}

@media(max-width:480px) and (max-height:650px){
  .landing .site-header { padding-block:.2rem; row-gap:.25rem }
  .site-logo img { height:clamp(30px,6vh,39px) }
  .landing .hero { padding-block:.3rem }
  .landing .intro h1 { font-size:clamp(2.35rem,12vw,3.28rem) }
  .landing .hero .lede { font-size:1rem; line-height:1.4 }
  .landing .hero .invitation { line-height:1.3 }
  .landing .rally { padding-block:.4rem }

  .landing footer { grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:.25rem .5rem; padding-block:.4rem }
  .landing footer .blocks-credit { grid-column:1; text-align:left; line-height:1.35 }
  .landing .site-tagline { line-height:1.35 }
}

/* On phones the court can double in height within the space above the footer. */
@media (max-width:720px) {
  .landing:has(.hero .rally) {
    height:100svh;
    min-height:0;
  }
  .landing:has(.hero .rally) > header,
  .landing:has(.hero .rally) > footer { flex:none }
  .landing .hero:has(.rally) {
    flex:0 1 auto;
    grid-template-rows:auto minmax(5rem,1fr);
    min-height:0;
    overflow-y:auto;
  }
  .landing .hero .rally {
    align-self:stretch;
    min-height:0;
    display:flex;
    flex-direction:column;
  }
  .landing .hero .court {
    aspect-ratio:7/6;
    min-height:0;
    flex:0 1 auto;
  }
}
