:root {
  --ink: #13241f;
  --ink-soft: #3d4a44;
  --paper: #f3ead7;
  --paper-dim: rgba(243, 234, 215, 0.72);
  --amber: #f0a202;
  --line: rgba(19, 36, 31, 0.14);
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 58% 46%, rgba(240, 162, 2, 0.16), transparent 28%),
    var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 340;
  letter-spacing: 0.01em;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 58% 46%, transparent 18%, rgba(0, 0, 0, 0.38) 78%);
}

button,
a {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
}

.dial {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.top,
.stage-ui,
.credit {
  position: relative;
  z-index: 2;
}

.stage-ui {
  min-height: 100vh;
  pointer-events: none;
}

.top {
  position: fixed;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem 1.6rem;
  pointer-events: none;
}

.mark {
  pointer-events: auto;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  text-decoration: none;
}

#work-open,
.tools button,
.work-bar button,
.work-foot a,
.case .back,
dialog button,
.missing a {
  pointer-events: auto;
}

#work-open {
  border: 1px solid rgba(243, 234, 215, 0.45);
  border-radius: 999px;
  padding: 0.62rem 1.15rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 500;
}

#work-open:hover,
#work-open[aria-expanded="true"] {
  background: var(--paper);
  color: var(--ink);
}

.date {
  position: absolute;
  left: 4vw;
  top: 18vh;
  margin: 0;
  font-family: var(--serif);
  line-height: 0.84;
}

.date strong {
  display: block;
  font-size: clamp(5.2rem, 11vw, 9.4rem);
  font-weight: 560;
  letter-spacing: -0.045em;
}

.date span {
  display: block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

#weekday {
  margin-bottom: 0.45rem;
}

#month {
  margin-top: 0.55rem;
}

.readout {
  position: absolute;
  right: 4vw;
  top: 22vh;
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.4rem, 2vw, 2rem);
  letter-spacing: 0.08em;
}

.manifesto {
  position: absolute;
  right: 4vw;
  top: 46%;
  transform: translateY(-50%);
  max-width: 16rem;
  margin: 0;
  text-align: right;
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.25;
}

.tools {
  position: absolute;
  left: 4vw;
  bottom: 6.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  pointer-events: auto;
}

.tools button {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--paper-dim);
  border-bottom: 1px solid transparent;
  padding-bottom: 0.12rem;
}

.tools button:hover,
.tools button[aria-pressed="true"] {
  color: var(--paper);
  border-bottom-color: var(--amber);
}

.hint {
  position: absolute;
  left: 4vw;
  bottom: 4.2rem;
  margin: 0;
  max-width: 42ch;
  color: rgba(243, 234, 215, 0.55);
  font-size: 0.82rem;
}

.credit {
  position: fixed;
  z-index: 3;
  left: 50%;
  bottom: 1.15rem;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(243, 234, 215, 0.55);
  white-space: nowrap;
}

.credit a {
  text-decoration: none;
  border-bottom: 1px solid rgba(243, 234, 215, 0.35);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.work {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  color-scheme: light;
  transform: translateY(104%);
  visibility: hidden;
  overflow: auto;
}

.work.is-open {
  transform: none;
  visibility: visible;
}

.work-bar,
.work-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 6vw;
}

.work-bar {
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 500;
}

.work-bar p {
  margin: 0;
}

.work-bar button,
.case .back,
dialog button,
.work-foot a {
  border-radius: 999px;
  border: 1px solid var(--ink);
  padding: 0.5rem 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: none;
}

.work-bar button:hover,
.case .back:hover,
dialog button:hover,
.work-foot a:hover {
  background: var(--ink);
  color: var(--paper);
}

.work-list {
  padding: 0 6vw 2rem;
}

.row {
  width: 100%;
  display: grid;
  grid-template-columns: 3.2rem 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
  text-align: left;
}

.work-list .row:last-child {
  border-bottom: 1px solid var(--line);
}

.row:hover .row-title,
.row:focus-visible .row-title {
  color: #8a5a00;
}

.row-no {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.row-title {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1;
}

.row small {
  display: block;
  margin-top: 0.4rem;
  max-width: 52ch;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 340;
  letter-spacing: 0;
  line-height: 1.4;
}

.row-tags {
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
}

.case {
  padding: 1rem 6vw 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4vw;
  align-items: center;
}

.case[hidden] {
  display: none;
}

.kicker {
  margin: 0 0 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.case h2,
.missing h1 {
  margin: 0.4rem 0 1rem;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(3rem, 6vw, 5.4rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.lede {
  margin: 0;
  max-width: 38ch;
  font-size: 1.12rem;
  line-height: 1.5;
}

.case .back {
  margin-bottom: 1.6rem;
}

.motif {
  min-height: 62vh;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
  background: #1c3b34;
}

.motif span,
.motif em {
  position: absolute;
  display: block;
}

.motif em {
  right: 8%;
  bottom: 8%;
  font-family: var(--serif);
  font-style: italic;
  font-size: 2.4rem;
  color: var(--paper);
}

.motif[data-theme="ferry"] { background: #1b3a4b; }
.motif[data-theme="ferry"] span:nth-child(1) {
  width: 46%;
  height: 46%;
  border: 1px solid #f0a202;
  border-radius: 50%;
  left: 12%;
  top: 16%;
}
.motif[data-theme="ferry"] span:nth-child(2) {
  width: 38%;
  height: 2px;
  background: #f3ead7;
  left: 18%;
  top: 58%;
}
.motif[data-theme="ferry"] span:nth-child(3) {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f0a202;
  left: 62%;
  top: 54%;
}

.motif[data-theme="kiln"] { background: #6e3b2e; }
.motif[data-theme="kiln"] span:nth-child(1) {
  width: 42%;
  height: 55%;
  border: 1.5px solid #f3ead7;
  border-radius: 40% 40% 12% 12%;
  left: 28%;
  bottom: 12%;
}
.motif[data-theme="kiln"] span:nth-child(2) {
  width: 18%;
  height: 18%;
  background: #e7b07a;
  border-radius: 50%;
  left: 18%;
  top: 18%;
}

.motif[data-theme="radio"] { background: #241c16; }
.motif[data-theme="radio"] span:nth-child(1) {
  inset: 14% 18%;
  border: 1px solid rgba(243, 234, 215, 0.7);
}
.motif[data-theme="radio"] span:nth-child(2) {
  height: 8px;
  width: 46%;
  left: 27%;
  top: 62%;
  background: #f0a202;
  border-radius: 99px;
}
.motif[data-theme="radio"] span:nth-child(3) {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f3ead7;
  left: 38%;
  top: 58.6%;
}

.motif[data-theme="water"] { background: #14343a; }
.motif[data-theme="water"] span:nth-child(1),
.motif[data-theme="water"] span:nth-child(2),
.motif[data-theme="water"] span:nth-child(3) {
  left: 10%;
  right: 10%;
  height: 1px;
  background: rgba(243, 234, 215, 0.75);
}
.motif[data-theme="water"] span:nth-child(1) { top: 38%; }
.motif[data-theme="water"] span:nth-child(2) { top: 52%; width: 70%; }
.motif[data-theme="water"] span:nth-child(3) { top: 66%; width: 46%; }

.motif[data-theme="bramble"] { background: #243324; }
.motif[data-theme="bramble"] span:nth-child(1) {
  width: 2px;
  height: 68%;
  background: #d7e2c4;
  left: 50%;
  top: 16%;
}
.motif[data-theme="bramble"] span:nth-child(2) {
  width: 34%;
  height: 2px;
  background: #d7e2c4;
  left: 32%;
  top: 40%;
  transform: rotate(-28deg);
}
.motif[data-theme="bramble"] span:nth-child(3) {
  width: 18px;
  height: 18px;
  border-radius: 50% 0 50% 50%;
  background: #e07a5f;
  right: 22%;
  top: 28%;
}

.motif[data-theme="chorus"] { background: #2a2438; }
.motif[data-theme="chorus"] span {
  width: 18%;
  height: 42%;
  border-radius: 99px 99px 12px 12px;
  background: #f3ead7;
  bottom: 16%;
}
.motif[data-theme="chorus"] span:nth-child(1) { left: 22%; height: 34%; opacity: 0.55; }
.motif[data-theme="chorus"] span:nth-child(2) { left: 41%; background: #f0a202; }
.motif[data-theme="chorus"] span:nth-child(3) { left: 60%; height: 28%; opacity: 0.8; }

.motif[data-theme="marlow"] { background: #f3ead7; color: #13241f; }
.motif[data-theme="marlow"] em { color: #13241f; }
.motif[data-theme="marlow"] span:nth-child(1) {
  left: 12%;
  top: 22%;
  font-family: var(--serif);
  font-size: clamp(4rem, 8vw, 7rem);
  letter-spacing: -0.05em;
  line-height: 0.8;
}
.motif[data-theme="marlow"] span:nth-child(1)::before {
  content: "Aa";
}

.motif[data-theme="glass"] { background: linear-gradient(160deg, #d7ebe4, #8fb8ae 55%, #1d3f3a); }
.motif[data-theme="glass"] em { color: #13241f; }
.motif[data-theme="glass"] span:nth-child(1) {
  width: 36%;
  height: 70%;
  left: 32%;
  top: 12%;
  border: 1.5px solid rgba(19, 36, 31, 0.55);
  border-bottom: 0;
  clip-path: polygon(50% 0, 100% 18%, 100% 100%, 0 100%, 0 18%);
  background: rgba(243, 234, 215, 0.28);
}

.motif[data-theme="ledger"] { background: #1e2430; }
.motif[data-theme="ledger"] span {
  left: 16%;
  right: 16%;
  height: 10px;
  border-radius: 99px;
  background: rgba(243, 234, 215, 0.85);
}
.motif[data-theme="ledger"] span:nth-child(1) { top: 28%; width: 48%; }
.motif[data-theme="ledger"] span:nth-child(2) { top: 42%; background: #f0a202; }
.motif[data-theme="ledger"] span:nth-child(3) { top: 56%; width: 62%; }

.work-foot {
  margin-top: auto;
  color: var(--ink-soft);
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
}

.work-foot p {
  margin: 0;
  max-width: 46ch;
}

dialog {
  border: 0;
  border-radius: 22px;
  padding: 1.5rem 1.5rem 1.2rem;
  max-width: 36rem;
  background: var(--paper);
  color: var(--ink);
  color-scheme: light;
}

dialog::backdrop {
  background: rgba(8, 14, 12, 0.62);
}

dialog h2 {
  margin: 0 0 0.6rem;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 560;
}

dialog p {
  margin: 0 0 0.8rem;
  line-height: 1.5;
}

dialog form {
  margin: 0.4rem 0 0;
}

.missing {
  min-height: 100vh;
}

.missing-main {
  position: relative;
  z-index: 2;
  padding: 22vh 8vw;
}

.missing a {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

@media (max-width: 800px) {
  .date {
    left: 1.25rem;
    top: 6.2rem;
  }

  .date strong {
    font-size: 4.6rem;
  }

  .readout {
    right: 1.25rem;
    top: 7rem;
    font-size: 1rem;
  }

  .manifesto {
    left: 1.25rem;
    right: 1.25rem;
    top: auto;
    bottom: 11.5rem;
    transform: none;
    text-align: left;
    font-size: 1.15rem;
  }

  .tools,
  .hint {
    left: 1.25rem;
    right: 1.25rem;
  }

  .tools {
    bottom: 7.2rem;
  }

  .hint {
    bottom: 4.4rem;
  }

  .credit {
    letter-spacing: 0.08em;
    font-size: 0.62rem;
  }

  .row,
  .case {
    grid-template-columns: 1fr;
  }

  .row-tags {
    text-align: left;
  }

  .motif {
    min-height: 32vh;
  }

  .work-bar,
  .work-foot,
  .work-list,
  .case {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .work-foot {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-height: 760px) and (min-width: 801px) {
  .date { top: 14vh; }
  .date strong { font-size: 5.6rem; }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .work {
    transition: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .work {
    transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.55s;
  }
}
