:root {
  color-scheme: light;
  --paper: #f8f6f1;
  --ink: #302825;
  --muted: #6d5c54;
  --line: #ded4c9;
  --rose: #782f46;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 system-ui, sans-serif;
}

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--rose); outline-offset: 4px; }

.shell { width: min(70rem, calc(100% - 3rem)); margin-inline: auto; }

.topbar {
  border-bottom: 1px solid var(--line);
  background: #fffcf7;
}

.topbar .shell,
.topbar nav,
.characters__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar a {
  display: inline-flex;
  min-height: 3.5rem;
  align-items: center;
  text-decoration: none;
}

.wordmark { font-family: var(--serif); font-weight: 700; }
.topbar nav { color: var(--muted); font-size: .9rem; font-weight: 600; }
.topbar nav a { padding-inline: .35rem; }
.topbar nav a:hover { color: var(--rose); }

main { padding-block: clamp(1.75rem, 4.5vw, 3.75rem) 3.5rem; }

h1, h2, h3 { margin: 0; font-family: var(--serif); line-height: 1.2; }

h1 {
  font-size: clamp(1.8rem, 4.8vw, 3.35rem);
  letter-spacing: .04em;
  text-wrap: balance;
}

h1 span { display: inline-block; max-width: 100%; }

.intro {
  max-width: 42rem;
  margin: .85rem 0 clamp(1.35rem, 3.1vw, 2.2rem);
  color: var(--muted);
  line-height: 1.75;
}

.intro a { color: var(--rose); text-underline-offset: .2em; }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #f4ebe4;
}

.feature__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1.25rem, 5.2vw, 3.75rem);
}

.feature__copy:only-child { grid-column: 1 / -1; }

.feature__label {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 .85rem;
  color: var(--rose);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .18em;
}

.feature__label::before { width: 1.15rem; height: 1px; background: #a5755a; content: ""; }
.feature__title { font-size: clamp(1.7rem, 3.7vw, 3.2rem); overflow-wrap: anywhere; }
.feature time { display: block; margin-top: .75rem; color: var(--muted); font-size: .875rem; }

.feature__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 1.1rem;
  margin-top: 1.55rem;
}

.read, .all-comics, .characters__heading a {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-height: 2.75rem;
  font-size: .9rem;
  font-weight: 700;
}

.read {
  padding-inline: 1rem;
  border-radius: .4rem;
  background: var(--rose);
  color: white;
  text-decoration: none;
}

.read:hover { background: #5f2537; }
.all-comics, .characters__heading a { color: var(--rose); text-underline-offset: .28em; }

.feature__cover {
  display: grid;
  place-items: center;
  height: clamp(21rem, 38vw, 28rem);
  background: #eadbd3;
}

.feature__cover:focus-visible { outline-offset: -4px; }

.feature__cover img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.characters { margin-top: clamp(2rem, 5.5vw, 4rem); }
.characters__heading { border-bottom: 1px solid var(--line); padding-bottom: .65rem; }
.characters__heading h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

.roster {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .85rem;
  margin: 1.15rem 0 0;
  padding: 0;
  list-style: none;
}

.role {
  display: grid;
  justify-items: center;
  gap: .2rem;
  height: 100%;
  padding: .9rem .25rem .75rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: #fffdf8;
  text-align: center;
  text-decoration: none;
}

.role:hover { border-color: #ae7d8c; color: var(--rose); }

.portrait {
  position: relative;
  width: min(5.2rem, 90%);
  aspect-ratio: 1;
  margin-bottom: .35rem;
  overflow: hidden;
  border-radius: 50%;
  background: var(--portrait-color, #ede3db);
}

.portrait img {
  position: absolute;
  top: var(--portrait-top, 8%);
  left: 50%;
  width: 218%;
  height: auto;
  transform: translateX(-50%);
}

.role--viola { --portrait-color: #f2e1e5; }
.role--violin { --portrait-color: #e5eaf4; }
.role--clara { --portrait-color: #f2e9d5; }
.role--celo { --portrait-color: #e3ebe5; --portrait-top: 20%; }
.role--rikka { --portrait-color: #f2e7df; --portrait-top: 16%; }
.role--concertmaster { --portrait-color: #e6e8ed; }

.instrument { color: var(--muted); font-size: .78rem; }

@media (max-width: 43rem) {
  .shell { width: calc(100% - 2rem); }
  .feature { grid-template-columns: minmax(0, 1fr); }
  .feature__cover { height: auto; aspect-ratio: 4 / 3; }
  .feature__actions { margin-top: .85rem; }
  .roster { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
}
