.mag-page, .mag-nav {
  --mag-ink: #122d22;
  --mag-paper: #f8efde;
  --mag-red: #a62a17;
  --mag-gold: #f1cf83;
  --mag-line: #cbbd9f;
}

.mag-nav { background: var(--mag-red); color: #fff9ed; }
.mag-nav .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 clamp(12px, 3vw, 40px);
}
.mag-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: .84rem;
  font-weight: 700;
}
.mag-nav a[aria-current="page"], .mag-nav a:hover { text-decoration: underline; text-underline-offset: .24em; }
.mag-nav a:focus-visible { outline-color: #fff9ed !important; outline-offset: 2px !important; }

.mag-header { background: #0e2d20; color: #fff9ed; padding-block: clamp(27px, 5.5vw, 77px); }
.mag-header h1 {
  max-width: 17ch;
  margin: 8px 0 12px;
  font: italic 700 clamp(2.65rem, 6.8vw, 6.35rem)/.98 var(--serif);
  letter-spacing: -.055em;
  text-wrap: balance;
}
.mag-header h1 + p { max-width: 53ch; color: inherit; font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.55; }
.mag-header .hub-kicker, .mag-header .mag-kicker { color: #f5cf82; }
.mag-header .mahjong-back { color: inherit; font-weight: 700; display: inline-block; margin-bottom: 12px; }
.mag-header .mag-checked { color: #f5cf82; margin-top: 15px; font-size: .86rem; }
.mag-kicker { color: #87301d; text-transform: uppercase; letter-spacing: .1em; font-size: .77rem; font-weight: 800; line-height: 1.4; }

.mag-content { padding-block: clamp(30px, 5.5vw, 79px); }
.mag-content h2, .mag-related h2 {
  margin: 0 0 10px;
  font: 400 clamp(1.65rem, 3.7vw, 3.15rem)/1.05 var(--serif);
  letter-spacing: -.047em;
  text-wrap: pretty;
}
.mag-content h3 { margin: 5px 0 8px; font: 400 clamp(1.32rem, 2.3vw, 2.1rem)/1.1 var(--serif); letter-spacing: -.035em; }
.mag-content p:not([class]), .mag-content dd { font-size: 1.01rem; line-height: 1.65; color: inherit; }
.mag-content p + p:not([class]) { margin-top: 8px; }
.mag-content .object-panel figcaption { font-size: .94rem; }
.mag-content .visual-story-copy h3 { font: italic 700 clamp(1.95rem, 4vw, 4rem)/1 var(--serif); letter-spacing: -.055em; }
.mag-content .visual-story { margin-bottom: clamp(20px, 4vw, 55px); }

.mag-link, .mag-content .mahjong-link, .mag-related a {
  display: inline-block;
  padding-block: 9px;
  color: inherit;
  font-size: .93rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.mag-related { margin-top: clamp(25px, 5vw, 65px); padding-top: 17px; border-top: 1px solid #ab9d82; }
.mag-related h2 { font-size: clamp(1.45rem, 2.4vw, 2.2rem); }
.mag-related ul { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 22px; margin: 0; padding: 0; list-style: none; }
.mag-related li { padding: 4px 12px; background: #eadded; }
.mag-related li:has(a:focus-visible) { outline: 2px solid #122d22; outline-offset: 2px; }

.mag-directory-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.mag-directory-grid article { padding: clamp(13px, 2vw, 23px); background: #fff9ed; border-top: 2px solid #a62a17; }
.mag-directory-grid .mag-directory-lead { grid-row: span 3; }
.mag-directory-grid article:last-child { grid-column: span 2; }
.mag-directory-lead img { width: 100%; height: auto; aspect-ratio: 1.22; object-fit: contain; background: white; }
.mag-directory-grid h3 a:hover { text-decoration: underline; text-underline-offset: .17em; }
.mag-credit { margin: 4px 0 10px; font-size: .72rem; }
.mag-credit a { text-decoration: underline; }

.mag-finds { margin-top: clamp(28px, 5vw, 63px); }
.mag-find-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.mag-find { padding: clamp(16px, 3vw, 36px); background: #eadbbb; scroll-margin-top: 20px; }
.mag-find + .mag-find { background: #e1e8d6; }

.mag-prose { max-width: 69ch; }
.mag-prose + .mag-prose, .mag-content > section + section:not(.mag-finds) { margin-top: clamp(20px, 4vw, 45px); }
.mag-prose > p + p { margin-top: 10px; }
.mag-content .set-gallery { margin-bottom: 32px; }
.mag-term-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 1px;
  margin: 0 0 clamp(23px, 4vw, 48px);
  background: #b4a68c;
  border: 1px solid #b4a68c;
}
.mag-term-grid > div { padding: clamp(12px, 2vw, 23px); background: #fff9ed; }
.mag-term-grid dt { font: 400 clamp(1.25rem, 2.1vw, 1.85rem)/1 var(--serif); }
.mag-term-grid dd { margin: 7px 0 0; }
.mag-content .bird-note { margin-bottom: 10px; }

.mag-maker-feature { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.82fr); align-items: start; gap: 24px 5vw; }
.mag-maker-feature > :first-child { max-width: 60ch; }
.mag-set-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: clamp(20px, 4vw, 48px); }
.mag-card { border-top: 2px solid #87301d; padding: 14px clamp(11px,1.4vw,20px); background: #fff9ed; }
.mag-card:nth-child(2) { background: #e3e8d9; }
.mag-card h2 { font-size: clamp(1.55rem, 2.65vw, 2.7rem); }
.mag-card .mag-kicker { margin-bottom: 6px; }
.mag-variant-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.mag-variant-grid > section { padding: clamp(15px, 2.6vw, 32px); border-top: 2px solid var(--mag-red); background: #fff9ed; }

.mag-event-list { display: grid; gap: 15px; }
.mag-event { display: grid; grid-template-columns: minmax(0,.47fr) minmax(0,1fr); background: #fff9ed; border-top: 1px solid #cbbd9f; }
.mag-event-when, .mag-event > :nth-child(2) { padding: clamp(15px, 2.8vw, 36px); }
.mag-event-when { background: #ebdec1; color: #122d22; }
.mag-event:first-child .mag-event-when { background: #a62a17; color: #fff9ed; }
.mag-event-when .mag-kicker { color: inherit; }
.mag-date { margin-top: 5px; color: inherit; font: 400 clamp(1.3rem, 2.7vw, 2.15rem)/1.1 var(--serif); }
.mag-place { margin-bottom: 7px; color: inherit; font-weight: 700; }
.mag-links { display: flex; flex-wrap: wrap; column-gap: 12px; color: inherit; }

.hub-mag-front { padding-block: clamp(35px, 6vw, 81px); }
.mag-front-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 8px 22px; margin-bottom: clamp(15px, 3vw, 36px); }
.mag-front-heading h2, .mag-hub-events h2 { font: italic 700 clamp(3.15rem, 7.9vw, 7.4rem)/.93 var(--serif); letter-spacing: -.066em; }
.mag-front-grid { display: grid; grid-template-columns: minmax(0,1.68fr) minmax(0,1fr); gap: clamp(15px, 3.3vw, 48px); }
.mag-front-lead { background: #fff9ed; }
.mag-front-lead figure { margin: 0; background: #fff; }
.mag-front-lead img { display: block; width: 100%; height: clamp(260px, 37vw, 530px); object-fit: contain; }
.mag-front-lead figcaption { padding: 6px 14px; background: #efe0c6; font-size: .73rem; }
.mag-front-lead figcaption a { text-decoration: underline; }
.mag-front-lead > div, .mag-front-side article { padding: clamp(17px, 2.7vw, 36px); }
.mag-front-lead h3, .mag-front-side h3, .mag-hub-events h3 {
  margin: 6px 0 9px;
  font: 400 clamp(1.65rem, 3.4vw, 3.2rem)/1.025 var(--serif);
  letter-spacing: -.04em;
}
.mag-front-lead h3 { font-size: clamp(2.15rem, 4.3vw, 4.2rem); }
.mag-front-side { display: grid; align-content: stretch; gap: 14px; }
.mag-front-side article { background: #122d22; color: #fff9ed; }
.mag-front-side article.mag-front-rules { background: #ebd3a5; color: #122d22; }
.mag-front-side p, .mag-workbench p, .mag-hub-events p, .mag-front-lead > div p, .mag-hub-tiles p { color: inherit; }

.mag-workbench { background: #e5dcc6; color: #122d22; }
.mag-workbench-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding-block: clamp(20px, 3.6vw, 48px); }
.mag-workbench-grid > div { padding-right: clamp(15px, 5vw, 72px); }
.mag-workbench-grid > div + div { border-left: 1px solid #aa9a79; padding-inline: clamp(15px, 5vw, 72px) 0; }
.mag-workbench h2, .mag-hub-tiles h2 {
  margin: 5px 0 9px;
  font: 400 clamp(1.95rem, 4.5vw, 4.65rem)/1 var(--serif);
  letter-spacing: -.049em;
}
.mag-hub-tiles { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.8fr); align-items: center; gap: 14px 5vw; padding-block: clamp(25px, 5.1vw, 75px); }
.mag-mini-tiles { display: flex; justify-content: center; min-width: 0; gap: clamp(2px, 1vw, 15px); }
.mag-mini-tiles img { width: min(28%,110px); height: auto; max-width: 100%; }
.mag-mini-tiles img:nth-child(1) { transform: rotate(-9deg); }
.mag-mini-tiles img:nth-child(3) { transform: rotate(9deg); }

.mag-hub-events { background: #f1cf83; color: #122d22; }
.mag-hub-events-inner { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,.9fr); gap: 15px 4vw; align-items: center; padding-block: clamp(21px, 4vw, 54px); }
.mag-hub-events h2 { font-size: clamp(2.6rem, 5.8vw, 5.7rem); }
.mag-hub-events h3 { font-size: clamp(1.6rem, 2.7vw, 2.65rem); }
.mag-event-past { margin-top: 6px; font-size: .88rem; }

@media(max-width: 760px) {
  .mag-front-grid, .mag-hub-events-inner, .mag-maker-feature { grid-template-columns: 1fr; }
  .mag-directory-grid, .mag-set-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mag-directory-grid .mag-directory-lead { grid-row: auto; grid-column: 1/-1; }
  .mag-directory-lead img { max-height: 320px; }
  .mag-front-side { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mag-event { grid-template-columns: 1fr; }
  .mag-hub-tiles { grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); }
}

@media(max-width: 520px) {
  .mag-nav .wrap { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 0; }
  .mag-nav a { grid-column: span 2; justify-content: center; text-align: center; }
  .mag-nav a:nth-child(-n+2) { grid-column: span 3; }
  .mag-nav a:nth-child(n+3) { border-top: 1px solid #ffffff40; }
  .mag-directory-grid, .mag-set-grid, .mag-term-grid, .mag-find-grid,
  .mag-front-side, .mag-workbench-grid, .mag-hub-tiles, .mag-variant-grid { grid-template-columns: 1fr; }
  .mag-directory-grid article:last-child { grid-column: auto; }
  .mag-workbench-grid > div + div { margin-top: 14px; padding: 13px 0 0; border: 0; border-top: 1px solid #aa9a79; }
  .mag-front-heading { align-items: start; }
  .mag-mini-tiles { justify-content: start; padding-left: 5px; }
  .mag-mini-tiles img { width: min(27%,83px); }
  .mag-related ul { grid-template-columns: 1fr; }
}
