/* Itte Dojo — "scoresheet" design. See docs/DESIGN.md.
   Paper, printed form lines, ink, one highlighter yellow. Grade colors only for grades. */
:root {
  --paper: #fbfcfd; --paper-2: #f1f4f7; --surface: #ffffff;
  --rule: #d5dde5; --rule-2: #b9c5d0; --grid: rgba(120, 145, 170, .085);
  --ink: #0f1419; --ink-2: #3b4652; --muted: #66727e;
  --hl: #ffe03d; --hl-ink: #0f1419;
  --btn: #0f1419; --btn-ink: #ffffff;
  --g-best: #0a7a3e; --g-good: #1f5fa8; --g-inacc: #a26a00; --g-mist: #c2410c; --g-blun: #c0182b; --chip-ink: #ffffff;
  --warn: #c0182b;
  --felt: #1f7a4d; --felt-2: #1b7047; --felt-line: #0f1419;
  --display: "Dela Gothic One", "BIZ UDPGothic", sans-serif;
  --sans: "BIZ UDPGothic", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1013; --paper-2: #151a1f; --surface: #12161a;
    --rule: #232c34; --rule-2: #34404b; --grid: rgba(140, 170, 200, .07);
    --ink: #e9eef2; --ink-2: #b4bec8; --muted: #8995a1;
    --hl: #ffe03d; --hl-ink: #0f1419;
    --btn: #ffe03d; --btn-ink: #0f1419;
    --g-best: #3fcf7f; --g-good: #6aa8ff; --g-inacc: #e8b23a; --g-mist: #ff8a4c; --g-blun: #ff5a6a; --chip-ink: #0d1013;
    --warn: #ff5a6a;
    --felt: #1b6b44; --felt-2: #18623e; --felt-line: #05070a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1013; --paper-2: #151a1f; --surface: #12161a;
  --rule: #232c34; --rule-2: #34404b; --grid: rgba(140, 170, 200, .07);
  --ink: #e9eef2; --ink-2: #b4bec8; --muted: #8995a1;
  --btn: #ffe03d; --btn-ink: #0f1419;
  --g-best: #3fcf7f; --g-good: #6aa8ff; --g-inacc: #e8b23a; --g-mist: #ff8a4c; --g-blun: #ff5a6a; --chip-ink: #0d1013;
  --warn: #ff5a6a;
  --felt: #1b6b44; --felt-2: #18623e; --felt-line: #05070a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background-color: var(--paper); color: var(--ink); font-family: var(--sans);
  font-size: 15px; line-height: 1.8; word-break: auto-phrase; line-break: strict;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--g-blun); }
:focus-visible { outline: 3px solid var(--hl); outline-offset: 2px; }
mark, .hl { background: linear-gradient(transparent 52%, var(--hl) 52%, var(--hl) 92%, transparent 92%); color: inherit; padding: 0 .08em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, .mono { font-family: var(--mono); font-feature-settings: "tnum"; }

/* header: a form's title strip */
.site-head { background: var(--surface); border-bottom: 3px solid var(--ink); }
.site-head .in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 10px 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-family: var(--sans); font-weight: 700; font-size: 19px; letter-spacing: .08em; line-height: 1.1; }
.brand-sub { font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }
.site-nav { display: flex; gap: 0; align-items: stretch; flex-wrap: wrap; font-size: 13.5px; border: 1px solid var(--rule-2); }
.site-nav a, .site-nav span { padding: 6px 12px; text-decoration: none; color: var(--ink-2); border-right: 1px solid var(--rule-2); }
.site-nav > :last-child { border-right: 0; }
.site-nav a[aria-current="page"] { background: var(--hl); color: var(--hl-ink); font-weight: 700; }
.site-nav a:hover { color: var(--ink); background: var(--paper-2); }
.site-nav .lang { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; }
@media (max-width: 640px) {
  .site-nav { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; font-size: 12.5px; }
  .site-nav a, .site-nav span { padding: 6px 2px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--rule-2); }
  .site-nav a:nth-child(4n) { border-right: 0; }
  .site-nav > :last-child { grid-column: span 2; border-bottom: 0; }
  .site-nav > :nth-last-child(2), .site-nav > :nth-last-child(3) { border-bottom: 0; }
}

/* footer */
.site-foot { border-top: 3px solid var(--ink); margin-top: 64px; background: var(--surface); }
.site-foot .in { max-width: 1120px; margin: 0 auto; padding: 16px 16px 30px; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12.5px; color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 11px 18px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border-radius: 0; box-shadow: 3px 3px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--btn); color: var(--btn-ink); }
.btn .arrow { font-family: var(--mono); }

/* page frame */
.main { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hero { padding: 48px 0 24px; display: grid; gap: 28px; }
@media (min-width: 940px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 48px; } }
.hero-text { display: grid; gap: 18px; align-content: end; }
.kicker { font-size: 14px; font-weight: 700; color: var(--ink); display: flex; gap: 10px; align-items: center; }
.kicker::before { content: ""; width: 28px; height: 3px; background: var(--ink); }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 7.4vw, 84px); line-height: 1.06; letter-spacing: .01em; margin: 0; }
.hero p { font-size: 16px; color: var(--ink-2); max-width: 34em; margin: 0; word-break: keep-all; overflow-wrap: anywhere; }
.cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.cta-item { display: grid; gap: 6px; justify-items: start; max-width: 15em; }
.cta-item small { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

/* scoresheet table (home demo) */
.sheet { background: var(--surface); border: 2px solid var(--ink); }
.sheet-head { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 2px solid var(--ink); font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet th { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); font-weight: 400; text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--rule-2); }
.sheet td { padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.sheet tr:last-child td { border-bottom: 0; }
.sheet td.n { font-family: var(--mono); color: var(--muted); width: 3em; }
.sheet td.mv { font-family: var(--mono); font-weight: 700; }
.sheet td.loss { font-family: var(--mono); text-align: right; }
.sheet .why td { padding-top: 0; color: var(--ink); font-size: 14px; }
.sheet .why mark { background: var(--hl); color: var(--hl-ink); }
.sheet-board { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--rule); }
.sheet-board p { margin: 0; flex: 1 1 8em; min-width: 0; font-size: 13px; color: var(--ink-2); max-width: none; }
.sheet-board p b { font-family: var(--mono); color: var(--ink); }
.mini { display: grid; grid-template-columns: 12px auto; grid-template-rows: 12px auto; flex: none; }
.mini-c, .mini-r { display: grid; font-family: var(--mono); font-size: 9px; color: var(--muted); text-align: center; line-height: 12px; }
.mini-c b, .mini-r b { font-weight: 400; }
.mini-c { grid-template-columns: repeat(8, 15px); }
.mini-r { grid-template-rows: repeat(8, 15px); line-height: 15px; }
.mini-b { display: grid; grid-template-columns: repeat(8, 15px); grid-auto-rows: 15px; border: 1px solid var(--ink); }
.mini-b i { position: relative; border: 1px solid var(--rule); box-sizing: border-box; }
.mini-b i.b::after, .mini-b i.w::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; }
.mini-b i.b::after { background: var(--ink); }
.mini-b i.w::after { background: var(--surface); box-shadow: inset 0 0 0 1px var(--ink); }
.mini-b i.you { box-shadow: inset 0 0 0 2px var(--g-blun); }
.mini-b i.best { box-shadow: inset 0 0 0 2px var(--g-best); }
@media (max-width: 640px) { .sheet tr.plain { display: none; } .sheet th, .sheet td { padding-left: 8px; padding-right: 8px; } }
.sheet-foot { padding: 8px 12px; border-top: 2px solid var(--ink); font-size: 12px; color: var(--muted); }

/* grade stamp, shared with the dojo pages */
.stamp { display: inline-block; font-family: var(--sans); font-weight: 700; font-size: 13px; letter-spacing: .1em; line-height: 1; padding: 5px 8px 4px; border: 2px solid var(--g, var(--ink)); color: var(--g, var(--ink)); transform: rotate(-4deg); white-space: nowrap; background: var(--surface); }

/* sections numbered like form fields */
.section { padding: 40px 0 4px; }
.section-h { display: flex; align-items: baseline; gap: 14px; border-bottom: 3px solid var(--ink); padding-bottom: 8px; margin: 0 0 16px; }
.section-h .no { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.section-h h2 { font-family: var(--sans); font-weight: 700; font-size: 24px; letter-spacing: .06em; margin: 0; }

/* dojo index as a table */
.index { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--rule-2); }
.index th, .index td { padding: 14px 14px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
.index th { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 400; border-bottom: 1px solid var(--rule-2); padding-block: 8px; }
.index td.name { font-family: var(--sans); font-weight: 700; font-size: 19px; letter-spacing: .04em; white-space: nowrap; }
.index td.name a { text-decoration: none; }
.index td.name a:hover { background: var(--hl); color: var(--hl-ink); }
.index td.what { color: var(--ink-2); font-size: 14px; }
.index td.go { text-align: right; white-space: nowrap; }
.index td.go .btn { min-width: 9.5em; justify-content: center; }
.index tr.soon td { color: var(--muted); }
.index tr.grp th { font-family: var(--sans); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ink); background: var(--paper-2); padding: 6px 14px; }
.section-note { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.section-note.top { margin: 0 0 10px; color: var(--ink-2); }
.section .cta { margin-top: 14px; }
.live { display: inline-flex; align-items: center; gap: 6px; }
.live::before { content: ""; width: 8px; height: 8px; background: var(--g-best); }
@media (max-width: 640px) {
  .index tr.grp { display: block; padding: 0; }
  .index tr.grp th { display: block; }
  .index tr { display: grid; grid-template-columns: 1fr auto; padding: 12px 12px; border-bottom: 1px solid var(--rule); }
  .index td { border: 0; padding: 2px 0; }
  .index td.what { grid-column: 1 / -1; }
  .index td.go { grid-column: 1 / -1; text-align: left; padding-top: 8px; }
}

/* the grading ruler */
.ruler { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 2px solid var(--ink); background: var(--surface); }
.ruler div { padding: 10px 10px 8px; border-right: 1px solid var(--rule-2); border-top: 6px solid var(--g); min-width: 0; }
.ruler div:last-child { border-right: 0; }
.ruler b { display: block; font-family: var(--sans); font-weight: 700; font-size: 15px; color: var(--g); }
.ruler span { font-size: 12px; color: var(--ink-2); }
@media (max-width: 640px) { .ruler { grid-template-columns: 1fr; } .ruler div { border-right: 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: baseline; } }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; border-top: 1px solid var(--rule-2); }
.steps li { counter-increment: s; display: grid; grid-template-columns: 64px 1fr; gap: 6px 16px; padding: 14px 0; border-bottom: 1px solid var(--rule-2); }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: 22px; color: var(--muted); grid-row: span 2; }
.steps h3 { margin: 0; font-size: 16px; }
.steps p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }

/* prose */
.prose { max-width: 46em; }
.prose h2 { font-family: var(--sans); font-weight: 700; font-size: 21px; letter-spacing: .05em; margin: 36px 0 10px; padding-bottom: 6px; border-bottom: 3px solid var(--ink); }
.prose h3 { font-size: 16px; margin: 22px 0 6px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.2em; }
.gradelist { list-style: none; padding: 0 !important; display: grid; gap: 10px; }
.gradelist li { display: flex; gap: 14px; align-items: center; }
.gradelist .stamp { min-width: 6.6em; text-align: center; }

/* language picker */
.lang-pick { min-height: 100vh; display: grid; align-items: center; padding: 24px 16px; }
.lang-pick .box { max-width: 760px; margin: 0 auto; width: 100%; display: grid; gap: 22px; }
.lang-pick h1 { font-family: var(--display); font-weight: 400; font-size: clamp(44px, 10vw, 96px); margin: 0; line-height: 1.02; }
.lang-pick p { margin: 0; color: var(--ink-2); }
.lang-pick .choices { display: flex; gap: 14px; flex-wrap: wrap; }

@media (prefers-reduced-motion: no-preference) {
  .hero h1 mark { background-size: 0% 100%; background-repeat: no-repeat; animation: sweep .7s .25s cubic-bezier(.3, .7, .2, 1) forwards; }
  @keyframes sweep { to { background-size: 100% 100%; } }
  .stamp.press { animation: press .32s cubic-bezier(.2, 1.4, .4, 1); }
  @keyframes press { from { transform: rotate(-9deg) scale(1.45); opacity: .2; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }
}
