/* Shared portal, shell, dialogs, and typography. Game styles live with each game. */
:root {
  color-scheme:light;
  --paper:#f7f5ef;
  --white:#fffefa;
  --ink:#39263d;
  --muted:#726873;
  --lime:#d8eb86;
  --lime-dark:#566329;
  --line:#dfdadc;
  --lavender:#eee8f1;
  --serif:Georgia,'Times New Roman',serif;
  --sans:'Avenir Next',Avenir,'Segoe UI',sans-serif;
  --mono:'SFMono-Regular',Consolas,'Liberation Mono',monospace;
  --text-small:12px;
  font-family:var(--sans);
  color:var(--ink);
  background:var(--paper);
  font-synthesis:none;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

button,
input,
select,
textarea {
  font:inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color:transparent;
}

button,
a {
  touch-action:manipulation;
}

button {
  cursor:pointer;
}

button:disabled {
  cursor:default;
}

a {
  color:inherit;
  text-decoration-thickness:1px;
  text-underline-offset:4px;
}

button {
  color:inherit;
}

p {
  line-height:1.65;
}

h1,
h2,
h3,
p {
  margin-top:0;
}

h1,
h2,
h3 {
  text-wrap:balance;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline:3px solid #736236;
  outline-offset:5px;
}

h2:focus,
h3:focus,
main:focus {
  outline:none;
}

[hidden] {
  display:none!important;
}

.skip-link {
  position:absolute;
  top:-80px;
  left:20px;
  padding:14px;
  background:var(--lime);
  z-index:10;
}

.skip-link:focus {
  top:10px;
}

.site-header {
  max-width:1328px;
  margin:auto;
  padding:29px 48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  gap:24px;
}

.brand {
  display:flex;
  align-items:center;
  font-weight:750;
  letter-spacing:-1.2px;
  font-size:31px;
  text-decoration:none;
  white-space:nowrap;
}

.brand-mark {
  display:block;
  flex-shrink:0;
  width:38px;
  height:38px;
  margin-right:12px;
}

.site-header nav {
  display:flex;
  align-items:center;
  gap:32px;
  font-size:13px;
  font-weight:600;
}

.site-header nav a {
  text-decoration:none;
  padding:10px 0;
  position:relative;
}

.site-header nav a[aria-current]:after {
  content:'';
  position:absolute;
  bottom:0;
  left:0;
  right:0;
  height:2px;
  background:var(--ink);
}

.nav-button {
  border:0;
  background:none;
  padding:10px 0;
}

.nav-button span {
  margin-left:12px;
}

main {
  max-width:1328px;
  margin:auto;
  padding:0 48px;
}

.eyebrow,
.micro {
  font-family:var(--mono);
  font-size:var(--text-small);
  letter-spacing:1.4px;
  line-height:1.6;
  font-weight:500;
}

.eyebrow {
  margin-bottom:20px;
}

.micro {
  font-size:var(--text-small);
  letter-spacing:1px;
}
.about-page h1 em {
  font-weight:400;
  color:#736078;
}

.home-hero {
  padding:40px 0 32px;
  max-width:680px;
}

.home-hero h1 {
  font:normal clamp(34px,4.5vw,54px)/1.15 var(--serif);
  letter-spacing:-1.5px;
  margin-bottom:16px;
}

.hero-copy {
  font-size:16px;
  color:var(--muted);
  margin-bottom:16px;
}

.home-hero>a {
  display:inline-block;
  padding:10px 0;
  font-size:14px;
}

.catalog {
  margin-bottom:48px;
}

.button {
  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  gap:30px;
  min-height:49px;
  padding:14px 22px;
  border:1px solid transparent;
  border-radius:5px;
  text-decoration:none;
  font-size:13px;
  font-weight:650;
  line-height:1.4;
  transition:background .15s,transform .15s;
}

.button:hover:not(:disabled) {
  transform:translateY(-1px);
}

.button.primary {
  background:var(--ink);
  color:var(--white);
}

.button.primary:hover:not(:disabled) {
  background:#523b57;
}

.button.primary:disabled {
  background:#e7e2e5;
  color:#746b75;
}

.button.dark {
  background:var(--ink);
  color:var(--white);
}

.button.secondary {
  border-color:var(--line);
  background:var(--white);
}

.button span {
  font-size:19px;
  line-height:1;
}

.section-heading {
  border-top:1px solid var(--line);
  padding-top:28px;
  margin-bottom:25px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

.section-heading h2 {
  font:normal 25px var(--serif);
  letter-spacing:-.7px;
  margin:0;
}

.section-heading .micro {
  color:var(--muted);
}

.game-cards {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:19px;
}

.catalog-card {
  position:relative;
  border:1px solid var(--line);
  border-radius:7px;
  padding:24px;
  background:var(--white);
  border-color:#aa9bb0;
  box-shadow:0 4px 0 #e7e0e9;
  display:flex;
  flex-direction:column;
}

.card-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.game-number {
  font:12px var(--mono);
}

.catalog-symbol {
  font:normal 59px/1 var(--serif);
  height:77px;
  padding-top:5px;
  margin-top:12px;
  margin-bottom:11px;
}

.catalog-card .eyebrow {
  font-size:var(--text-small);
  margin-bottom:9px;
}

.catalog-card h3 {
  font:normal 25px/1.15 var(--serif);
  letter-spacing:-.7px;
  margin-bottom:12px;
}

.catalog-card>p:not(.eyebrow):not(.progress-caption) {
  font-size:13px;
  color:var(--muted);
  line-height:1.7;
  margin-bottom:22px;
  max-width:290px;
}

.card-meta {
  display:flex;
  justify-content:space-between;
  font:var(--text-small) var(--mono);
  color:var(--muted);
  margin-top:auto;
  margin-bottom:19px;
}

.catalog-card .button {
  width:100%;
  min-height:44px;
  font-size:12px;
}

.progress-caption {
  font-size:var(--text-small)!important;
  margin:11px 0 0;
}

.progress-caption span {
  color:var(--muted);
}

.site-footer {
  max-width:1328px;
  margin:auto;
  padding:0 48px 30px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:25px;
  font-size:var(--text-small);
  color:var(--muted);
}

.footer-brand {
  font:italic 14px var(--serif);
  text-decoration:none;
}

.site-footer>div {
  display:flex;
  gap:25px;
}

.site-footer a {
  text-decoration:none;
}

.game-toolbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:24px 0 0;
  font-size:var(--text-small);
}

.back-link {
  text-decoration:none;
  color:var(--muted);
  padding:10px 0;
}

.game-toolbar>div {
  display:flex;
  align-items:center;
  gap:18px;
}

.text-button {
  border:0;
  background:none;
  padding:10px 0;
  font-size:12px;
  text-decoration:none;
  line-height:1.5;
}

.text-button:hover:not(:disabled) {
  text-decoration:underline;
  text-underline-offset:4px;
}

.text-button:disabled {
  color:var(--muted);
}

.text-button span {
  margin-left:6px;
}

.toolbar-divider {
  height:14px;
  width:1px;
  background:var(--line);
}

.game-heading {
  padding:30px 0 37px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
}

.game-heading .eyebrow {
  font-size:var(--text-small);
  margin-bottom:13px;
}

.eyebrow-dash {
  color:#a699ab;
  margin:0 12px;
}

.game-heading h1 {
  font:normal clamp(38px,4.1vw,57px)/1.15 var(--serif);
  letter-spacing:-2px;
  margin-bottom:13px;
}

.game-heading p:last-child {
  font-size:13px;
  color:var(--muted);
  margin:0;
}

select {
  width:100%;
  min-height:43px;
  padding:9px 30px 9px 11px;
  border:1px solid #d8cfdc;
  border-radius:4px;
  color:var(--ink);
  background:var(--white);
  font-size:12px;
}

.facts-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}

.facts-heading h3 {
  font-size:12px;
  margin:0;
}

.facts-heading>span {
  font-size:var(--text-small);
  color:var(--muted);
}

.replay-banner {
  display:flex;
  align-items:center;
  gap:15px;
  background:var(--lime);
  padding:16px 20px;
  border-radius:5px;
  margin-top:20px;
  font-size:12px;
}

.replay-banner>span {
  font-size:var(--text-small);
}

.replay-banner button {
  margin-left:auto;
  white-space:nowrap;
}

.about-page {
  padding:67px 0 65px;
}

.about-page h1 {
  font:normal clamp(44px,5vw,66px)/1.1 var(--serif);
  letter-spacing:-2px;
}

.about-lead {
  font-size:18px;
  max-width:650px;
  color:var(--muted);
}

.about-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:65px;
  border-top:1px solid var(--line);
  margin-top:40px;
  padding:35px 0 20px;
}

.about-grid h2 {
  font:normal 26px var(--serif);
  margin-top:20px;
}

.about-grid p {
  font-size:14px;
  color:var(--muted);
}

.storage-notice {
  max-width:1232px;
  margin:16px auto 0;
  padding:12px 20px;
  font-size:12px;
  background:#ede9d8;
  border:1px solid #d6cdad;
}

.noscript {
  padding:48px;
  position:absolute;
  top:100px;
  background:var(--paper);
}

dialog {
  width:min(650px,calc(100% - 32px));
  max-height:calc(100dvh - 48px);
  border:1px solid #c8bfce;
  border-radius:10px;
  background:var(--white);
  color:var(--ink);
  padding:28px 32px 32px;
  box-shadow:0 25px 100px #25152f33;
}

dialog::backdrop {
  background:#281d2dcc;
  backdrop-filter:blur(3px);
}

.dialog-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  margin-bottom:19px;
  color:var(--muted);
}

.close-button {
  background:var(--lavender);
  border:0;
  border-radius:50%;
  width:36px;
  height:36px;
  font-size:24px;
  line-height:1;
}

.dialog-top .micro {
  font-size:var(--text-small);
}

dialog h2 {
  font:normal 37px/1.1 var(--serif);
  letter-spacing:-1.3px;
  margin-bottom:20px;
}

dialog>p {
  font-size:13px;
  color:var(--muted);
}

dialog h3 {
  font-size:14px;
}

dialog .eyebrow {
  font-size:var(--text-small);
}

.worked-example {
  padding:22px;
  background:var(--lavender);
  border-radius:5px;
  margin:22px 0;
}

.worked-example ol {
  padding-left:20px;
  font-size:13px;
  line-height:1.7;
}

.worked-example li {
  padding-bottom:7px;
}

.worked-example p {
  font-size:13px;
  margin-bottom:12px;
}

.worked-example p:last-child {
  margin-bottom:0;
}

.worked-example .tutorial-answer {
  font-weight:700;
  font-size:16px;
}

.dialog-actions {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:17px;
  margin-top:25px;
}

.setting-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:25px;
  padding:23px 0;
  border-bottom:1px solid var(--line);
}

.setting-row strong {
  font-size:13px;
}

.setting-row p {
  font-size:12px;
  color:var(--muted);
  margin:5px 0 0;
}

.setting-row input,
.checkbox-row input {
  accent-color:var(--ink);
  width:20px;
  height:20px;
  flex-shrink:0;
}

.data-inspector {
  margin:24px 0;
  border:1px solid var(--line);
  border-radius:4px;
  padding:16px;
}

.data-inspector summary {
  font-size:12px;
  font-weight:600;
  cursor:pointer;
}

.data-inspector p {
  font-size:12px;
}

.data-inspector p:first-of-type {
  margin-top:18px;
}

.data-inspector code {
  overflow-wrap:anywhere;
}

.data-inspector pre {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  max-height:260px;
  overflow:auto;
  background:#f1edf3;
  padding:14px;
  font:var(--text-small)/1.6 var(--mono);
  border-radius:4px;
}

.data-inspector h3 {
  margin-top:20px;
}

.data-inspector dl {
  font-size:var(--text-small);
  line-height:1.6;
}

.data-inspector dt {
  font-weight:650;
  margin-top:10px;
  overflow-wrap:anywhere;
}

.data-inspector dd {
  margin:3px 0 0;
  color:var(--muted);
}

.clear-progress {
  border-top:1px solid var(--line);
  padding-top:23px;
}

.clear-progress p {
  font-size:12px;
  color:var(--muted);
}

.clear-progress .button {
  font-size:12px;
}

.clear-progress #clear-status {
  margin-bottom:0;
}

.form-label {
  display:block;
  font-size:12px;
  font-weight:650;
  margin:23px 0 8px;
}

.form-label span {
  font-weight:400;
  color:var(--muted);
}

textarea {
  width:100%;
  padding:12px;
  border:1px solid #d8cfdc;
  border-radius:4px;
  resize:vertical;
  font-size:13px;
  background:var(--white);
  color:var(--ink);
}

.input-note {
  font-size:var(--text-small);
  color:var(--muted);
  margin:7px 0 17px;
}

.prototype-notice {
  padding:14px;
  background:#f0eddf;
  border:1px solid #ded6b7;
  border-radius:4px;
  color:#635632;
  font-size:12px;
}

.checkbox-row {
  display:flex;
  align-items:center;
  gap:10px;
  font-size:12px;
}

.reduced-motion *,
.reduced-motion *:before,
.reduced-motion *:after {
  animation:none!important;
  transition:none!important;
  scroll-behavior:auto!important;
}

@media(prefers-reduced-motion:reduce) {
  *,
  *:before,
  *:after {
    animation:none!important;
    transition:none!important;
    scroll-behavior:auto!important;
  }
}

@media(min-width:1400px) {
  .site-header {
    padding-top:32px;
    padding-bottom:32px;
  }
}

@media(max-width:1050px) {
  .site-header,
  main {
    padding-left:30px;
    padding-right:30px;
  }

  .site-footer {
    padding-left:30px;
    padding-right:30px;
  }

  .game-cards {
    gap:14px;
  }

  .catalog-card {
    padding:20px;
  }

  .catalog-card h3 {
    font-size:23px;
  }
}

@media(max-width:780px) {
  .site-header {
    padding:21px 24px;
  }

  .site-header nav {
    gap:20px;
    font-size:12px;
  }

  .brand {
    font-size:27px;
  }

  .brand-mark {
    width:33px;
    height:33px;
  }

  main {
    padding:0 24px;
  }

  .catalog-card {
    padding:18px;
  }

  .catalog-card h3 {
    font-size:21px;
  }

  .catalog-card>p:not(.eyebrow):not(.progress-caption) {
    font-size:12px;
  }

  .catalog-card .card-top {
    gap:7px;
  }

  .catalog-card .button {
    padding:12px;
    gap:10px;
    font-size:var(--text-small);
  }

  .card-meta {
    font-size:var(--text-small);
  }

  .progress-caption {
    font-size:var(--text-small)!important;
  }

  .progress-caption span {
    display:block;
  }

  .game-heading {
    padding-bottom:28px;
  }

  .site-footer {
    padding-left:24px;
    padding-right:24px;
  }

  .site-footer>div>span {
    display:none;
  }

  .about-grid {
    gap:30px;
  }
}

@media(max-width:580px) {
  .site-header {
    gap:14px;
    padding:20px;
  }

  .site-header nav {
    gap:15px;
    font-size:var(--text-small);
  }

  .site-header nav a[data-nav=about] {
    display:none;
  }

  .brand {
    font-size:23px;
  }

  .brand-mark {
    margin-right:9px;
  }

  .nav-button span {
    margin-left:5px;
  }

  main {
    padding:0 20px;
  }

  .section-heading {
    padding-top:24px;
    margin-bottom:19px;
    align-items:flex-start;
    gap:14px;
    flex-direction:column;
  }

  .section-heading h2 {
    font-size:26px;
  }

  .section-heading .micro {
    font-size:var(--text-small);
  }

  .game-cards {
    grid-template-columns:1fr;
    gap:17px;
  }

  .catalog-card {
    padding:23px;
  }

  .catalog-card h3 {
    font-size:28px;
  }

  .catalog-card .eyebrow {
    font-size:var(--text-small);
  }

  .catalog-card>p:not(.eyebrow):not(.progress-caption) {
    font-size:14px;
    max-width:none;
  }

  .catalog-symbol {
    height:60px;
    margin-top:8px;
    font-size:51px;
    margin-bottom:15px;
  }

  .catalog-card .card-meta {
    font-size:var(--text-small);
  }

  .catalog-card .button {
    padding:13px 18px;
    font-size:13px;
  }

  .progress-caption {
    font-size:var(--text-small)!important;
  }

  .progress-caption span {
    display:inline;
  }

  .site-footer {
    padding:0 20px 24px;
    gap:16px;
    align-items:flex-start;
  }

  .footer-brand {
    font-size:12px;
    max-width:155px;
    line-height:1.6;
  }

  .site-footer>div {
    font-size:var(--text-small);
  }

  .game-toolbar {
    padding-top:15px;
    font-size:var(--text-small);
  }

  .game-toolbar>div {
    gap:12px;
  }

  .game-toolbar .text-button {
    font-size:var(--text-small);
  }

  .game-toolbar .text-button span {
    display:none;
  }

  .toolbar-divider {
    display:none;
  }

  .game-heading {
    padding:23px 0;
  }

  .game-heading .eyebrow {
    font-size:var(--text-small);
    letter-spacing:1px;
  }

  .game-heading h1 {
    font-size:37px;
    letter-spacing:-1.7px;
  }

  .game-heading p:last-child {
    font-size:12px;
    max-width:275px;
  }

  .facts-heading h3 {
    font-size:var(--text-small);
  }

  .facts-heading>span {
    font-size:var(--text-small);
  }

  .replay-banner {
    flex-wrap:wrap;
    gap:7px;
    padding:15px;
  }

  .replay-banner button {
    margin-left:0;
  }

  .replay-banner>span {
    width:100%;
  }

  .about-page {
    padding:40px 0;
  }

  .about-page h1 {
    font-size:43px;
  }

  .about-lead {
    font-size:16px;
  }

  .about-grid {
    grid-template-columns:1fr;
    gap:5px;
    margin-top:28px;
    padding-top:10px;
  }

  .about-grid h2 {
    font-size:25px;
  }

  .storage-notice {
    margin:12px 20px 0;
    padding:12px;
    font-size:var(--text-small);
  }

  dialog {
    padding:21px 21px 25px;
    width:calc(100% - 24px);
    max-height:calc(100dvh - 24px);
  }

  dialog h2 {
    font-size:32px;
  }

  .dialog-actions {
    flex-wrap:wrap;
    gap:12px;
  }

  .dialog-actions .button {
    font-size:12px;
    gap:14px;
  }

  .setting-row {
    gap:14px;
  }

  .worked-example {
    padding:18px;
  }

  .data-inspector {
    padding:12px;
  }
}

@media(max-width:360px) {
  .site-header {
    padding-left:15px;
    padding-right:15px;
  }

  .site-header nav {
    gap:10px;
  }

  .brand {
    font-size:21px;
  }

  .brand-mark {
    width:29px;
    height:29px;
  }

  main {
    padding-left:15px;
    padding-right:15px;
  }

  .game-heading h1 {
    font-size:33px;
  }
}

.game-toolbar .text-button,
.back-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 580px) {
  .input-note {
    font-size: 12px;
  }

  textarea,
  select {
    font-size: 16px;
  }
}

.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
  border:0;
}

.catalog-search {
  max-width:680px;
  margin-bottom:24px;
}

.catalog-search label,
.catalog-filter {
  display:block;
  font-size:14px;
  font-weight:600;
}

.catalog-search>div {
  display:flex;
  gap:10px;
  margin-top:8px;
}

.catalog-search input,
.catalog-filter select {
  min-width:0;
  width:100%;
  min-height:48px;
  padding:10px 12px;
  border:1px solid #aa9bb0;
  border-radius:5px;
  background:var(--white);
  color:var(--ink);
  font-size:16px;
}

.subject-cards {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));
  gap:18px;
}

.subject-card {
  display:block;
  padding:24px;
  border:1px solid #aa9bb0;
  border-radius:7px;
  background:var(--lavender);
  text-decoration:none;
}

.subject-card h3 {
  font:normal 28px var(--serif);
  margin-bottom:12px;
}

.subject-card p {
  font-size:15px;
  margin-bottom:16px;
}

.subject-card>span {
  font-size:14px;
  font-weight:600;
}

.catalog-breadcrumbs,
.catalog-result-heading,
.catalog-pagination {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
  font-size:14px;
}

.catalog-breadcrumbs {
  padding-top:24px;
}

.catalog-heading {
  padding:20px 0 8px;
}

.catalog-filters {
  display:flex;
  flex-wrap:wrap;
  gap:16px;
}

.catalog-filter {
  flex:1 1 190px;
  max-width:300px;
  min-width:0;
}

.catalog-filter select {
  display:block;
  margin-top:8px;
}

.catalog-result-heading {
  justify-content:space-between;
  margin:20px 0;
}

.catalog-result-heading p {
  margin:0;
}

.catalog-result-heading a,
.catalog-breadcrumbs a {
  display:inline-flex;
  min-height:44px;
  align-items:center;
}

.catalog-empty {
  padding:24px;
  border:1px solid var(--line);
  border-radius:7px;
}

.catalog-pagination {
  justify-content:center;
  margin-top:28px;
}

.catalog-card {
  min-width:0;
  overflow-wrap:anywhere;
}

.card-meta {
  flex-wrap:wrap;
  gap:8px;
}

@media(max-width:580px) {
  .catalog-search .button {
    padding:12px;
  }
  .catalog-filter {
    max-width:none;
  }
}
