* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-text-size-adjust: 100%;
}
.wrap {
  width: min(var(--width), 90%);
  margin-inline: auto;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.sr,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  position: absolute;
  z-index: 2;
  background: var(--surface);
  padding: 10px;
}
.mast {
  border-bottom: 1px solid var(--line);
}
.mast-inner,
footer,
.brand,
.mast nav,
.actions,
.section-heading,
.legend,
.legend span,
.holiday-title,
.aside-head,
.month header {
  display: flex;
  align-items: center;
}
.mast-inner,
footer,
.section-heading,
.holiday-title {
  justify-content: space-between;
}
.mast-inner {
  min-height: 74px;
}
.brand img {
  display: block;
  width: 156px;
  height: auto;
}
.mast nav {
  gap: 32px;
}
.mast nav a,
footer > a:last-child {
  font-size: 14px;
}
.hero {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: center;
  gap: 4%;
  padding: 36px 0 44px;
  border-bottom: 1px solid var(--rule);
}
.intro {
  padding: 6px 0;
}
.intro h1 {
  font: 700 clamp(46px, 4.5vw, 69px)/1.12 var(--serif);
  letter-spacing: 0.025em;
  margin: 0;
}
.intro h1 span {
  display: block;
  color: var(--brand);
  font: normal clamp(84px, 8.8vw, 136px)/0.95 var(--latin);
  letter-spacing: -0.055em;
  margin: 0 0 13px -0.045em;
}
.intro p {
  font-size: 16px;
  color: var(--muted);
  margin: 20px 0 28px;
  line-height: 1.8;
  text-wrap: pretty;
}
.actions {
  gap: 21px;
  flex-wrap: wrap;
}
.actions a {
  font-size: 15px;
  font-weight: 600;
}
.primary {
  padding: 12px 18px;
  color: var(--on-action);
  background: var(--brand);
  border-radius: 3px;
}
.primary:hover {
  background: var(--action-hover);
  color: var(--on-action);
  text-decoration: none;
}
.actions a span {
  font-size: 18px;
  margin-left: 6px;
}
.secondary {
  border-bottom: 1px solid var(--rule);
  padding: 8px 0;
}
.cover {
  width: 100%;
  height: clamp(320px, 28vw, 416px);
  object-fit: cover;
  display: block;
}
#calendar,
#source,
#holidays,
.month {
  scroll-margin-top: 16px;
}
#calendar {
  padding: 32px 0 40px;
}
h2,
h3,
p {
  margin: 0;
}
.section-heading h2,
.source h2 {
  font: 700 33px/1.3 var(--serif);
}
.calendar-tools,
.lunar-switch {
  display: flex;
  align-items: center;
}
.calendar-tools {
  gap: 20px;
  flex-wrap: wrap;
}
.lunar-switch {
  gap: 6px;
  min-height: 36px;
  font-size: 14px;
  cursor: pointer;
}
.lunar-switch input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}
.lunar-switch input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.legend {
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
}
.legend span {
  gap: 6px;
}
.legend b,
.work-line b {
  padding: 2px 5px;
  border-radius: 2px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
}
.rest,
.rest time {
  color: var(--rest-ink);
  background: var(--rest-bg);
}
.work,
.work time,
.work-line b {
  color: var(--work-ink);
  background: var(--work-bg);
}
.month-nav {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  margin: 18px 0 24px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.month-nav a {
  text-align: center;
  padding: 9px 0;
  border-right: 1px solid var(--line);
  font: 22px/1.1 var(--latin);
}
.month-nav a:last-child {
  border: 0;
}
.month-nav small {
  font: 12px var(--sans);
  margin-left: 3px;
}
.month-nav a:hover,
.month-nav a:focus-visible {
  background: var(--panel);
}
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(270px, 1fr);
  gap: 24px;
  align-items: start;
}
.months {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 304px), 1fr));
  gap: 20px;
}
.month {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px 16px 12px;
}
.month header {
  align-items: baseline;
  gap: 9px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
.month h3 {
  font: 700 26px/1.3 var(--serif);
}
.month header span {
  font: italic 16px var(--latin);
  color: var(--muted);
}
.month table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 2px 3px;
  text-align: center;
  margin: 6px 0 8px;
}
.month th {
  font: 400 12px/26px var(--sans);
  color: var(--muted);
}
.month td {
  padding: 0;
  border-radius: 2px;
  font: 19px/1 var(--latin);
  font-variant-numeric: lining-nums tabular-nums;
}
.month time {
  min-height: 52px;
  flex-direction: column;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 2px;
  scroll-margin-top: min(365px, 52vh);
}
.solar-day {
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
}
.lunar {
  font: 12px/1.4 var(--sans);
  color: var(--muted);
  white-space: nowrap;
}
.first-day {
  color: var(--brand);
  font-weight: 600;
}
.lunar-range {
  margin-left: auto;
  font: 12px/1.4 var(--sans);
  color: var(--muted);
  text-align: right;
}
.month header {
  flex-wrap: wrap;
}
#calendar:has(#show-lunar:not(:checked)) :is(.lunar, .lunar-range) {
  display: none;
}
#calendar:has(#show-lunar:not(:checked)) .month time {
  min-height: 35px;
}
.month time:target,
.month:target {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.weekend {
  color: var(--muted);
}
.month sup {
  font: 600 10px/1 var(--sans);
  align-self: flex-start;
  margin-left: 1px;
}
.month-back {
  margin-top: auto;
  align-self: flex-end;
  color: var(--muted);
  font-size: 12px;
  padding: 4px;
}
#holidays {
  background: var(--panel);
  padding: 23px 22px 14px;
}
.aside-head {
  gap: 10px;
}
.small-rule {
  width: 4px;
  height: 21px;
  background: var(--brand);
}
.aside-head h2 {
  font: 700 24px/1.25 var(--serif);
}
.holidays {
  list-style: none;
  padding: 0;
  margin: 9px 0 0;
}
.holidays li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.holiday-title h3 {
  font: 700 20px/1.3 var(--serif);
}
.holiday-title span,
.holidays small,
.weekday,
.source small,
.checked {
  color: var(--muted);
}
.holiday-title span,
.holidays small {
  font-size: 12px;
}
.holidays p,
.work-line {
  font-size: 14px;
  margin: 6px 0;
}
.weekday {
  font-size: 12px;
}
.holidays a {
  display: inline-block;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}
.work-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.work-line b {
  white-space: nowrap;
}
.work-line a {
  margin-right: 5px;
}
.source-jump {
  display: inline-block;
  margin: 15px 0 2px;
  color: var(--brand);
  font-size: 14px;
}
.source {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 24px;
  padding: 32px 0;
  border-block: 1px solid var(--line);
}
.source p {
  margin: 0 0 10px;
}
.source a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.source .lunar-source {
  margin-top: 14px;
}
.source .checked {
  margin: 12px 0 0;
  font-size: 13px;
}
footer {
  padding: 24px 0 32px;
}
footer .brand img {
  width: 114px;
}
@media (max-width: 1000px) {
  .wrap {
    width: 93%;
  }
  .calendar-layout {
    grid-template-columns: minmax(0, 2fr) minmax(235px, 1fr);
    gap: 14px;
  }
  .months {
    gap: 12px;
  }
  .month {
    padding: 15px 9px 9px;
  }
  .cover {
    height: 320px;
  }
  .hero {
    gap: 3%;
    grid-template-columns: 0.95fr 1.05fr;
  }
}
@media (max-width: 800px) {
  .calendar-layout {
    display: block;
  }
  #holidays {
    margin-top: 20px;
  }
  .holidays {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }
  .intro h1 {
    font-size: 44px;
  }
  .actions {
    gap: 12px;
  }
  .intro p {
    font-size: 15px;
  }
  .primary {
    padding: 10px 13px;
  }
}
@media (max-width: 640px) {
  .wrap {
    width: calc(100% - 32px);
  }
  .mast-inner {
    min-height: 60px;
  }
  .mast .brand img {
    width: 119px;
  }
  .mast nav {
    gap: 12px;
  }
  .mast nav a {
    font-size: 12px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 0 20px;
  }
  .intro {
    padding: 0;
  }
  .intro h1 {
    font-size: clamp(32px, 9vw, 47px);
    display: flex;
    align-items: baseline;
    gap: 12px;
  }
  .intro h1 span {
    font-size: clamp(58px, 16vw, 76px);
    margin: 0;
  }
  .intro p {
    margin: 9px 0 15px;
  }
  .cover {
    height: auto;
    aspect-ratio: 1.96;
    object-position: 50% 51%;
  }
  .actions {
    gap: 18px;
  }
  .actions a {
    font-size: 14px;
  }
  #calendar {
    padding: 24px 0;
  }
  .section-heading h2,
  .source h2 {
    font-size: 27px;
  }
  .section-heading {
    flex-wrap: wrap;
    gap: 4px 12px;
  }
  .calendar-tools {
    gap: 10px;
  }
  .legend {
    gap: 10px;
  }
  .month-nav {
    grid-template-columns: repeat(6, 1fr);
    margin: 12px 0 16px;
  }
  .month-nav a {
    padding: 10px 0;
  }
  .month-nav a:nth-child(-n + 6) {
    border-bottom: 1px solid var(--line);
  }
  .month-nav a:nth-child(6) {
    border-right: 0;
  }
  .months,
  .source {
    grid-template-columns: 1fr;
  }
  .month {
    padding: 17px 14px 10px;
  }

  .holidays {
    display: block;
  }
  .source {
    gap: 16px;
    padding: 24px 0;
  }
  .source p {
    font-size: 15px;
  }
}
@media (max-width: 350px) {
  .month {
    padding-inline: 8px;
  }
  .mast nav {
    gap: 7px;
  }
  .mast nav a {
    font-size: 11px;
  }
  .mast .brand img {
    width: 108px;
  }
}
