:root {
  --bg: #0f1512;
  --bg-2: #141b17;
  --panel: #1a221d;
  --panel-2: #222c26;
  --panel-3: #2c3730;
  --wash: #1d2f2b;
  --line: #28332c;
  --floor: #3d4d43;
  --text: #ece6d6;
  --text-2: #aaa799;
  --accent: #d4b06a;
  --accent-fill: #1f6b5a;
  --accent-fill-hover: #277b68;
  --on-accent: #f6f1e4;
  --live: #8fcfae;
  --ornament: rgba(212, 176, 106, 0.09);
  --nav-hover: #1a221d;
  --nav-current: #222c26;

  --gutter: 20px;
  --measure: 36rem;
  --runner-h: 56px;

  --star-8: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpolygon fill='black' points='100,50 85.36,64.64 85.36,85.36 64.64,85.36 50,100 35.36,85.36 14.64,85.36 14.64,64.64 0,50 14.64,35.36 14.64,14.64 35.36,14.64 50,0 64.64,14.64 85.36,14.64 85.36,35.36'/%3E%3C/svg%3E");
  --girih: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='black' stroke-width='1.2'%3E%3Cpolygon points='78,48 69.2,56.8 69.2,69.2 56.8,69.2 48,78 39.2,69.2 26.8,69.2 26.8,56.8 18,48 26.8,39.2 26.8,26.8 39.2,26.8 48,18 56.8,26.8 69.2,26.8 69.2,39.2'/%3E%3Cpath d='M0 48 L18 48 M78 48 L96 48 M48 0 L48 18 M48 78 L48 96'/%3E%3Cpath d='M0 0 L10 0 L0 10 Z M96 0 L86 0 L96 10 Z M0 96 L10 96 L0 86 Z M96 96 L86 96 L96 86 Z' fill='black' stroke='none'/%3E%3C/g%3E%3C/svg%3E");

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4ecdc;
    --bg-2: #ede3cf;
    --panel: #faf5ea;
    --panel-2: #f0e7d4;
    --panel-3: #e3d8c0;
    --wash: #e2ebe3;
    --line: #dacdb1;
    --floor: #b9a98a;
    --text: #1e2922;
    --text-2: #5f665d;
    --accent: #7e601b;
    --accent-fill: #1f6b5a;
    --accent-fill-hover: #185a4a;
    --on-accent: #faf5ea;
    --live: #2d8a62;
    --ornament: rgba(138, 106, 30, 0.1);
    --nav-hover: #f0e7d4;
    --nav-current: #fcf8ef;

    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "EB Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { padding-top: var(--runner-h); }
body.has-player { padding-bottom: 96px; }

[lang="ar"] {
  font-family: "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Geeza Pro", serif;
  font-style: normal;
  font-weight: 400;
  font-feature-settings: "liga", "calt";
}

p { margin: 0; }
a { color: inherit; }

.instr a,
.aside a {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.instr a:hover,
.aside a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.page {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* pictograms */

.body-ink { fill: none; stroke: currentColor; stroke-width: var(--ink-w, 9); stroke-linecap: round; stroke-linejoin: round; }
.knock { fill: none; stroke: var(--knock, var(--bg)); stroke-width: calc(var(--ink-w, 9) + 7); stroke-linecap: round; stroke-linejoin: round; }
.halo { fill: var(--halo, none); }
.cue { visibility: var(--cue-visibility, visible); fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cue-dots { visibility: var(--cue-visibility, visible); fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 0.1 5.5; }
.finger { fill: none; stroke: var(--accent); stroke-width: 3.6; stroke-linecap: round; }

/* opening */

.mast {
  position: relative;
  isolation: isolate;
  padding: 40px 0 4px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.mast::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 calc(var(--gutter) * -1) 0 auto;
  width: min(100%, 36rem);
  background: var(--ornament);
  -webkit-mask-image: var(--girih), linear-gradient(to left, rgba(0, 0, 0, 0.9), transparent);
  -webkit-mask-size: 96px 96px, 100% 100%;
  -webkit-mask-repeat: repeat, no-repeat;
  -webkit-mask-composite: source-in;
  mask-image: var(--girih), linear-gradient(to left, rgba(0, 0, 0, 0.9), transparent);
  mask-size: 96px 96px, 100% 100%;
  mask-repeat: repeat, no-repeat;
  mask-composite: intersect;
  pointer-events: none;
}

h1 {
  margin: 0;
  font-size: 2.625rem;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.mast-ar {
  margin-top: 8px;
  font-size: 2.375rem;
  line-height: 1.6;
  text-align: right;
  color: var(--accent);
}

.sub {
  margin-top: 8px;
  font-size: 1.1875rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text-2);
}

.lede {
  margin-top: 18px;
  max-width: 32rem;
  font-size: 1.125rem;
  color: var(--text-2);
}

.lede em { color: var(--text); }

/* the shape of a rak'ah */

.profile {
  margin: 32px calc(var(--gutter) * -1) 0;
  padding: 26px var(--gutter) 20px;
  background: var(--bg-2);
  --knock: var(--bg-2);
  --halo: var(--bg-2);
  --rule: color-mix(in srgb, var(--accent) 55%, transparent);
}

.band {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  padding: 0 2%;
  border-bottom: 2px solid var(--floor);
  --cue-visibility: hidden;
  --ink-w: 6.5;
}

.band svg.p {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  color: var(--text);
}

.trail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2%;
  right: 2%;
  width: 96%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.trail path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 0.1 5;
  vector-effect: non-scaling-stroke;
}

.flow {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  padding: 0 2%;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: var(--text-2);
}

.flow-steps {
  grid-column: 2 / 8;
  grid-row: 1;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  position: relative;
}

.flow-steps::before,
.flow-steps::after {
  content: "";
  position: absolute;
  top: -5px;
  height: 9px;
  border-left: 1px solid var(--rule);
}

.flow-steps::before { left: 0; }
.flow-steps::after { right: -1px; }

.flow-steps li {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.flow-name {
  grid-column: 2 / 8;
  grid-row: 2;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin-top: 8px;
}

.flow-next {
  grid-column: 7 / 9;
  grid-row: 1 / 3;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding-top: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-align: right;
}

.flow-next svg { width: 26px; height: 18px; }

.flow-loop { display: none; }

.flow-sentence {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-2);
  text-align: center;
}

.toc {
  margin-top: 28px;
  padding: 20px 0 36px;
  border-top: 1px solid var(--line);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.toc a {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  column-gap: 10px;
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: 8px;
  text-decoration: none;
}

.toc a:hover { background: var(--panel); }

.toc .toc-extra {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.toc-extra .toc-n {
  align-self: start;
  margin-top: 0.45em;
  width: 11px;
  height: 11px;
  background: var(--accent);
  -webkit-mask: var(--star-8) center / contain no-repeat;
  mask: var(--star-8) center / contain no-repeat;
}

.toc-n {
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.toc-name {
  font-weight: 600;
  line-height: 1.3;
}

.toc-says {
  grid-column: 2;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--text-2);
}

.toc-ar { display: none; }

/* position nav: a fixed top bar, icons only on phones, names on wide screens */

.runner {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto 0;
  height: var(--runner-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  --knock: var(--bg-2);
}

.brand { display: none; }

.runner ol {
  flex: 1;
  min-width: 0;
  list-style: none;
  margin: 0;
  padding: 4px 8px;
  height: 100%;
  display: flex;
  gap: 0;
}

.runner li { flex: 1 1 0; display: flex; min-width: 0; }
.runner .r-extra { display: none; }

.runner a {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-2);
}

.runner svg {
  width: 32px;
  height: 32px;
  flex: none;
  color: var(--text-2);
}

.runner .r-n {
  position: absolute;
  top: 1px;
  left: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.runner .r-name { display: none; }

.runner a:hover { background: var(--nav-hover); --knock: var(--nav-hover); }
.runner a:hover svg { color: var(--text); }

.runner a[aria-current] {
  background: var(--nav-current);
  color: var(--text);
  --knock: var(--nav-current);
}

.runner a[aria-current] svg { color: var(--text); }
.runner a[aria-current] .r-n { color: var(--accent); }
.runner a[aria-current]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.runner a:focus-visible { outline-offset: -2px; }

/* positions */

.pos {
  position: relative;
  padding: 44px 0 48px;
  scroll-margin-top: calc(var(--runner-h) + 16px);
}

.pos + .pos { border-top: 1px solid var(--line); }

/* an eight-point star sitting on the rule between positions */
.pos + .pos::before,
.counts::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 15px;
  height: 15px;
  margin-left: -7.5px;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--bg);
  -webkit-mask: var(--star-8) center / contain no-repeat;
  mask: var(--star-8) center / contain no-repeat;
}

.pos.is-brief { padding-bottom: 36px; }

.stage {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  background: linear-gradient(var(--floor), var(--floor)) left bottom / 92px 2px no-repeat;
}

.stage .fig {
  width: 92px;
  height: 92px;
  flex: none;
  color: var(--text);
  display: block;
}

.is-brief .stage { background-size: 76px 2px; }
.is-brief .stage .fig { width: 76px; height: 76px; }

.stage h2 {
  margin: 0;
  padding-bottom: 4px;
  font-size: 1.625rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: 0;
}

.stage .n { color: var(--accent); }

.h-ar {
  display: inline-block;
  font-size: 1.3em;
  line-height: 1;
  color: var(--accent);
  opacity: 0.85;
  margin-left: 0.2em;
}

.cap {
  margin-top: 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.instr {
  margin-top: 6px;
  max-width: var(--measure);
  color: var(--text);
}

.aside {
  max-width: var(--measure);
  font-size: 0.9375rem;
  color: var(--text-2);
}

/* the words */

.say-col {
  margin: 22px calc(var(--gutter) * -1 + 8px) 0;
  padding: 4px 16px;
  display: grid;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.say-col > .aside { padding: 2px 0 18px; }

.say {
  position: relative;
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 16px 16px 18px;
  margin: 0 -16px;
  border-radius: 12px;
}

.verse {
  position: relative;
  display: grid;
  gap: 6px;
  justify-items: start;
  padding: 14px 16px;
  margin: 0 -16px;
  border-radius: 10px;
}

.say + .say::before,
.verse + .verse::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  border-top: 1px solid var(--line);
}

.verse.pair { padding-top: 4px; padding-bottom: 6px; gap: 0; }
.verse.pair + .verse.pair::before { display: none; }

.say.is-playing,
.verse.is-playing { background: var(--wash); }

.say.is-playing::before,
.say.is-playing + .say::before,
.verse.is-playing::before,
.verse.is-playing + .verse::before { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .say, .verse { transition: background-color 0.25s ease; }
}

.when {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}

.ar {
  justify-self: stretch;
  text-align: right;
  text-wrap: balance;
  font-size: 2.375rem;
  line-height: 1.95;
  padding: 0 0 4px;
}

.ar.sm { font-size: 2rem; line-height: 2; }

.ar-wrap {
  justify-self: stretch;
  display: grid;
}

.ar-progress {
  height: 2px;
  border-radius: 2px;
  background: var(--live);
  transform-origin: right;
  transform: scaleX(0);
  visibility: hidden;
}

.is-reading .ar-progress {
  visibility: visible;
  transform: scaleX(var(--p, 0));
}

.tr {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.45;
  max-width: 40rem;
}

.tr .ar-inline {
  font-size: 1.5em;
  line-height: 1;
  padding: 0 0.12em;
}

.tr em { font-style: italic; }

.en {
  color: var(--text-2);
  line-height: 1.55;
  max-width: var(--measure);
}

.note { color: var(--text-2); max-width: 40rem; }
.note strong { color: var(--text); font-weight: 600; }

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

button { font: inherit; color: inherit; }

.listen,
.more-btn,
.share-btn {
  appearance: none;
  border: 0;
  height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
}

.listen {
  position: relative;
  overflow: hidden;
  padding-left: 14px;
  min-width: 6.75rem;
  background: var(--accent-fill);
  color: var(--on-accent);
}

.listen:hover { background: var(--accent-fill-hover); }

.listen .glyph { width: 12px; height: 12px; flex: none; }
.listen .i-stop { display: none; }

.listen[data-state="loading"],
.listen[data-state="playing"] {
  background: var(--panel-3);
  color: var(--text);
}

.listen[data-state="loading"] .i-play,
.listen[data-state="playing"] .i-play { display: none; }

.listen[data-state="loading"] .i-stop,
.listen[data-state="playing"] .i-stop { display: block; color: var(--live); }

.listen .elapsed {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--live);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  display: none;
}

.listen[data-state="playing"] .elapsed { display: block; }

.listen .state-note { display: none; font-weight: 400; color: var(--text-2); }
.listen[data-state="loading"] .state-note { display: inline; }

@media (prefers-reduced-motion: no-preference) {
  .listen, .more-btn, .share-btn { transition: background-color 0.15s ease; }
  .listen[data-state="loading"] .state-note { animation: breathe 1.2s ease-in-out infinite; }
}

@keyframes breathe {
  50% { opacity: 0.4; }
}

.more-btn {
  background: var(--panel-2);
  color: var(--text);
  font-weight: 500;
}

.more-btn:hover { background: var(--panel-3); }

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 20px;
}

.share p { margin: 0; }

.share-btn {
  background: var(--accent-fill);
  color: var(--on-accent);
}

.share-btn:hover { background: var(--accent-fill-hover); }

.more-btn svg { width: 11px; height: 11px; flex: none; color: var(--text-2); }

@media (prefers-reduced-motion: no-preference) {
  .more-btn svg { transition: transform 0.2s ease; }
}

.more-btn[aria-expanded="true"] svg { transform: rotate(45deg); }

.more { justify-self: stretch; }

.more-in {
  display: grid;
  margin-top: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

/* rak'ah counts */

.counts {
  position: relative;
  padding: 48px 0 40px;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--runner-h) + 16px);
}

.counts h2 {
  margin: 0 0 14px;
  font-size: 1.625rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: 0;
}

.counts-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px 16px 14px;
  margin: 0 calc(var(--gutter) * -1 + 8px);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 14px 10px 14px 0;
  border-bottom: 1px solid var(--line);
}

tbody tr:last-child th,
tbody tr:last-child td { border-bottom: 0; }

thead th {
  padding: 10px 10px 8px 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
}

tbody th { font-weight: 600; white-space: nowrap; }

.c-num {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
  width: 2.25rem;
  padding-top: 12px;
}

.c-note { display: block; color: var(--text-2); line-height: 1.4; }

.marks {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.marks i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--text-2);
}

.marks i.aloud { background: var(--accent); border-color: var(--accent); }
.marks i.sit { margin-right: 9px; }

.marks-key {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 0.875rem;
  color: var(--text-2);
}

.marks-key > span { display: inline-flex; align-items: center; gap: 7px; }
.marks-key .marks { margin: 0; }

.counts .aside { margin-top: 18px; }

.foot {
  padding: 24px 0 64px;
  border-top: 1px solid var(--line);
  max-width: var(--measure);
  font-size: 1rem;
  color: var(--text-2);
}

.foot::before {
  content: "";
  display: block;
  width: 13px;
  height: 13px;
  margin: 0 0 18px;
  background: var(--accent);
  -webkit-mask: var(--star-8) center / contain no-repeat;
  mask: var(--star-8) center / contain no-repeat;
}

/* now playing */

.now {
  position: fixed;
  z-index: 30;
  inset: auto 10px calc(10px + env(safe-area-inset-bottom)) 10px;
  max-width: 30rem;
  margin: 0 auto;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--panel-3);
  border-radius: 14px;
  padding: 0 10px 0 16px;
}

.now[hidden] { display: none; }

.now-in {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.now-text {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--text-2);
}

.now-text b { font-weight: 600; color: var(--text); }

.now-where {
  display: inline-block;
  padding: 6px 0;
  margin: -6px 0;
  color: var(--text-2);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.now-where:hover { color: var(--text); }

.now-stop {
  appearance: none;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.now-stop:hover { background: var(--accent-fill-hover); }
.now-stop[hidden] { display: none; }
.now-stop svg { width: 11px; height: 11px; }

/* wider */

@media (min-width: 600px) {
  :root { --gutter: 32px; }

  .runner ol { justify-content: center; gap: 4px; }
  .runner li { flex: 0 1 64px; }

  .profile { margin-left: 0; margin-right: 0; border-radius: 16px; }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .toc .toc-extra { grid-column: 1 / -1; }
  .say-col, .counts-panel { margin-left: 0; margin-right: 0; padding-left: 24px; padding-right: 24px; }
  .say, .verse { margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
  .say + .say::before, .verse + .verse::before { left: 24px; right: 24px; }
}

@media (min-width: 900px) {
  .mast {
    padding: 64px 0 4px;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 40px;
    align-items: baseline;
  }

  h1 { grid-column: 1; grid-row: 1; font-size: 3.5rem; }

  .mast-ar {
    grid-column: 2;
    grid-row: 1;
    font-size: 3.5rem;
    line-height: 1.4;
  }

  .sub, .lede { grid-column: 1 / -1; }
  .sub { font-size: 1.25rem; }
  .lede { font-size: 1.125rem; }

  .profile { margin-top: 40px; padding: 34px 40px 26px; }

  .flow { font-size: 0.875rem; }

  .flow-steps li {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    text-align: center;
    padding-top: 12px;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-2);
  }

  .flow-steps { margin-top: 26px; }
  .flow-steps::before, .flow-steps::after { top: -5px; height: 9px; }

  .flow-name {
    grid-row: 1;
    align-self: start;
    justify-self: center;
    margin-top: 16px;
    padding: 0 12px;
    line-height: 20px;
    background: var(--bg-2);
    position: relative;
    z-index: 1;
  }

  .flow-next {
    grid-column: 8;
    grid-row: 1;
    align-self: start;
    justify-self: center;
    flex-direction: row;
    align-items: center;
    gap: 0;
    margin-top: 16px;
    padding: 0;
    line-height: 20px;
    white-space: nowrap;
    background: var(--bg-2);
    position: relative;
    z-index: 1;
  }

  .flow-next svg { display: none; }

  .flow-loop {
    display: block;
    grid-column: 2 / 9;
    grid-row: 2 / 4;
    position: relative;
    margin: 2px calc(100% / 14) 0;
    min-height: 30px;
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    border-radius: 0 0 12px 12px;
    pointer-events: none;
  }

  .flow-loop::before {
    content: "";
    position: absolute;
    left: -1px;
    bottom: 0;
    height: 12px;
    border-left: 1px solid var(--rule);
  }

  .flow-loop::after {
    content: "";
    position: absolute;
    left: -4px;
    bottom: 9px;
    width: 6px;
    height: 6px;
    border-left: 1px solid var(--accent);
    border-top: 1px solid var(--accent);
    transform: rotate(45deg);
  }

  .flow-sentence { display: none; }

  .pos {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: 48px;
    padding: 56px 0 64px;
  }

  .pos.is-brief { padding-bottom: 48px; }

  .do {
    position: sticky;
    top: calc(var(--runner-h) + 28px);
    align-self: start;
  }

  .stage { grid-column: 1 / -1; gap: 20px; background-size: 132px 2px; }
  .stage .fig { width: 132px; height: 132px; }
  .is-brief .stage { background-size: 104px 2px; }
  .is-brief .stage .fig { width: 104px; height: 104px; }
  .stage h2 { font-size: 1.875rem; padding-bottom: 6px; }

  .say-col { margin-top: 20px; align-self: start; }

  .ar { font-size: 2.75rem; }
  .ar.sm { font-size: 2.25rem; }
  .tr { font-size: 1.3125rem; }

  .counts { padding-top: 56px; }
  .counts h2 { font-size: 1.875rem; }
}

@media (min-width: 1100px) {
  .page {
    max-width: none;
    padding: 0 clamp(40px, 4vw, 88px);
  }

  .band, .flow { max-width: 68rem; margin-left: auto; margin-right: auto; }

  .toc { display: none; }

  .counts table,
  .counts tbody,
  .counts tr,
  .counts th,
  .counts td { display: block; }

  .counts thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .counts tbody {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 8px 0 4px;
  }

  .counts tbody tr {
    padding: 14px 24px 18px;
    border-left: 1px solid var(--line);
  }

  .counts tbody tr:first-child { border-left: 0; padding-left: 0; }

  .counts th,
  .counts td { padding: 0; border: 0; width: auto; }

  .counts tbody th { font-size: 1.0625rem; }

  .counts .c-num {
    font-size: 3rem;
    padding: 10px 0 6px;
    line-height: 1;
  }

  .counts .marks { margin-top: 12px; }
  .counts .marks-key .marks { margin: 0; }

  .runner { padding: 0 clamp(40px, 4vw, 88px); }
  .runner ol { padding: 6px 0; justify-content: flex-start; }
  .runner li { flex: 1 1 0; }

  .runner a {
    justify-content: flex-start;
    gap: 8px;
    padding: 0 10px 0 6px;
  }

  .runner svg { width: 36px; height: 36px; }

  .runner .r-n {
    position: static;
    font-size: 0.8125rem;
  }

  .runner .r-extra { display: flex; flex: 0 1 9.5rem; margin-left: auto; }
  .runner .r-extra .r-name { display: block; font-size: 0.875rem; font-weight: 500; white-space: nowrap; }
  .runner .r-extra a { padding-left: 12px; border-left: 1px solid var(--line); border-radius: 0; }
  .runner .r-extra a:hover { border-radius: 8px; }
}

@media (min-width: 1500px) {
  body { font-size: 1.1875rem; }

  .mast { padding-top: 80px; }
  h1 { font-size: 4.25rem; }
  .mast-ar { font-size: 4.25rem; }
  .lede { font-size: 1.1875rem; max-width: 36rem; }

  .profile { padding: 44px 60px 32px; }
  .flow { font-size: 0.9375rem; }

  .pos {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    column-gap: clamp(56px, 5vw, 112px);
    padding: 72px 0 80px;
  }

  .stage { background-size: 156px 2px; }
  .stage .fig { width: 156px; height: 156px; }
  .is-brief .stage { background-size: 120px 2px; }
  .is-brief .stage .fig { width: 120px; height: 120px; }
  .stage h2 { font-size: 2.25rem; }

  .say-col, .counts-panel { padding-left: 32px; padding-right: 32px; }
  .say, .verse { margin: 0 -32px; padding-left: 32px; padding-right: 32px; }
  .say + .say::before, .verse + .verse::before { left: 32px; right: 32px; }

  .ar { font-size: 3.25rem; }
  .ar.sm { font-size: 2.625rem; }
  .tr { font-size: 1.4375rem; }

  .counts h2 { font-size: 2.25rem; }
  th, td { padding-top: 18px; padding-bottom: 18px; }

  .brand {
    display: none;
    align-items: center;
    padding-right: 28px;
    margin-right: 12px;
    border-right: 1px solid var(--line);
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
  }

  .say:has(> .ar, > .ar-wrap),
  .verse:not(.pair):has(> .ar, > .ar-wrap):not(:has(> .ar ~ .ar)) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
    column-gap: 48px;
    align-items: start;
  }

  .say:has(> .ar, > .ar-wrap) > *,
  .verse:not(.pair):has(> .ar, > .ar-wrap):not(:has(> .ar ~ .ar)) > * { grid-column: 1; }

  .say > .ar,
  .say > .ar-wrap,
  .verse:not(.pair):not(:has(> .ar ~ .ar)) > .ar,
  .verse:not(.pair):not(:has(> .ar ~ .ar)) > .ar-wrap {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: center;
  }

  .say > .more { grid-column: 1 / -1; }
}

@media (min-width: 1280px) {
  .runner .r-name {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
  }

  .runner a[aria-current] .r-name { color: var(--text); }
}

@media (min-width: 1800px) {
  .brand { display: flex; }
}

@media (min-width: 1240px) {
  .verse.pair {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    column-gap: 28px;
    align-items: center;
  }

  .verse.pair .ar { grid-column: 2; grid-row: 1; }
  .verse.pair .tr { grid-column: 1; grid-row: 1; }
}
