/* 固定首页：牛皮纸旅行手帐；主导航是右下角四分之一只电话拨号盘。 */
html[data-page="home"] {
  --scrap-ink: #1d1913;
  --scrap-muted: #685f50;
  --scrap-paper: #eee2ca;
  --scrap-paper-light: #f8f0df;
  --scrap-rule: rgba(29, 25, 19, 0.66);
}

html[data-page="home"],
html[data-page="home"] body {
  height: 100%;
  overflow: hidden;
}

html[data-page="home"] body {
  color: var(--scrap-ink);
  background-color: #ddcdae;
  background-image: url("/web/assets/workbecoming_kraft_paper.png");
  background-position: center top;
  background-size: 100% auto;
  background-repeat: repeat-y;
  background-attachment: fixed;
}

html[data-page="home"] #application {
  height: 100dvh;
  overflow: hidden;
}

html[data-page="home"] #weather-layer,
html[data-page="home"] .topbar {
  display: none;
}

html[data-page="home"] main {
  height: 100dvh;
  max-width: none;
  padding: 0;
  overflow: hidden;
  color: var(--scrap-ink);
  background: transparent;
}

.scrapbook-home {
  width: min(100%, 840px);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-rows: minmax(190px, 30%) 92px minmax(0, 1fr);
  overflow: hidden;
  font-family: "Kaiti SC", STKaiti, KaiTi, "Songti SC", STSong, serif;
}

.scrapbook-hero {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(310px, 1.3fr);
  align-items: stretch;
  border-bottom: 1px solid rgba(29, 25, 19, 0.2);
}

.calendar-poster {
  padding: 24px 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  border-right: 1px solid rgba(29, 25, 19, 0.18);
  font-family: "Bodoni 72 Smallcaps", "Bodoni 72", Didot, Baskerville, Georgia, serif;
  text-transform: uppercase;
}

.poster-year {
  display: block;
  font-size: clamp(3.2rem, 8vh, 5.2rem);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.07em;
}

.poster-month {
  margin: auto 0;
  font-family: "Kaiti SC", STKaiti, KaiTi, "Songti SC", STSong, serif;
  font-size: clamp(1.45rem, 4vh, 2.2rem);
  font-weight: 500;
  letter-spacing: 0.13em;
}

.poster-day {
  align-self: center;
  font-size: clamp(2.8rem, 7vh, 4.4rem);
  font-weight: 750;
  line-height: 0.9;
}

.weather-note {
  position: relative;
  min-width: 0;
  padding: 28px 42px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.weather-frame {
  position: absolute;
  inset: 8px 10px;
  z-index: -1;
  width: calc(100% - 20px);
  height: calc(100% - 16px);
  object-fit: fill;
  opacity: 0.55;
  mix-blend-mode: multiply;
  filter: contrast(0.82);
}

.weather-copy {
  width: min(100%, 360px);
  padding: 16px 22px 12px;
  font-family: "Songti SC", STSong, "Noto Serif CJK SC", serif;
}

.weather-copy p {
  margin: 0 0 5px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.96rem;
}

.weather-copy strong {
  font-family: "Kaiti SC", STKaiti, KaiTi, serif;
  font-weight: 700;
}

.ink-rule {
  display: block;
  height: 2px;
  margin: 10px 0 8px;
  background: var(--scrap-ink);
  transform: rotate(-0.3deg);
}

.weather-curve-placeholder {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--scrap-muted);
  font-size: 0.74rem;
}

.weather-curve-placeholder svg {
  width: 100%;
  height: 28px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-dasharray: 4 4;
}

.daily-tally {
  margin-top: 7px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 0.84rem;
}

.daily-tally span {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.scrapbook-home .filmstrip {
  position: relative;
  width: 100vw;
  max-width: none;
  margin: 0 calc(50% - 50vw);
  padding: 18px max(12px, calc((100vw - 820px) / 2));
  gap: 7px;
  border: 0;
  border-radius: 0;
  background: #17140f;
  box-shadow: 0 2px 0 rgba(29, 25, 19, 0.28);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.scrapbook-home .filmstrip::before,
.scrapbook-home .filmstrip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  height: 8px;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    var(--scrap-paper) 0 8px,
    transparent 8px 15px
  );
}

.scrapbook-home .filmstrip::before {
  top: 4px;
}

.scrapbook-home .filmstrip::after {
  bottom: 4px;
}

.scrapbook-home .film-frame {
  flex: 0 0 78px;
  min-height: 72px;
  padding: 5px 4px;
  gap: 0;
  border: 1px solid rgba(238, 226, 202, 0.28);
  border-radius: 0;
  scroll-snap-align: center;
  color: rgba(238, 226, 202, 0.58);
  background: #221e18;
  font-family: "Bodoni 72", Baskerville, "Songti SC", STSong, serif;
}

.scrapbook-home .film-frame:hover {
  color: var(--scrap-ink);
  background: var(--scrap-paper);
}

.scrapbook-home .film-frame[aria-pressed="true"] {
  color: var(--scrap-ink);
  background: var(--scrap-paper-light);
  box-shadow: inset 0 0 0 2px var(--scrap-ink);
  transform: rotate(-1deg) scale(1.03);
}

.scrapbook-home .film-frame span,
.scrapbook-home .film-frame small {
  font-size: 0.66rem;
}

.scrapbook-home .film-frame strong {
  font: 700 1.2rem/1.2 "Bodoni 72", Baskerville, Georgia, serif;
}

.scrapbook-collage {
  position: relative;
  min-height: 0;
  margin: 0;
  padding: 6px 20px 8px;
  overflow: hidden;
}

.scrap-card {
  position: absolute;
  z-index: 2;
  display: block;
  color: var(--scrap-ink);
  text-decoration: none;
  mix-blend-mode: multiply;
}

.scrap-card-paper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.scrap-card-copy {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 0;
}

.paper-list-heading {
  width: 100%;
  padding-bottom: 5px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(29, 25, 19, 0.26);
}

.paper-list-heading h2 {
  margin: 0;
  font-family: "Kaiti SC", STKaiti, KaiTi, "Songti SC", STSong, serif;
  font-size: clamp(1rem, 3.8vw, 1.45rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.055em;
}

.paper-list-heading small {
  flex: none;
  color: var(--scrap-muted);
  font: 0.62rem/1 Baskerville, "Songti SC", STSong, serif;
}

.paper-list {
  width: 100%;
  min-height: 0;
  margin-top: 3px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(29, 25, 19, 0.35) transparent;
}

.paper-list:focus-visible {
  outline: 1px dashed rgba(29, 25, 19, 0.56);
  outline-offset: 2px;
}

.paper-list-row {
  padding: 5px 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
  border-bottom: 1px dotted rgba(29, 25, 19, 0.22);
}

.paper-list-row:last-child {
  border-bottom: 0;
}

.paper-list-row time {
  padding-top: 1px;
  color: var(--scrap-muted);
  font: 0.62rem/1.25 Baskerville, Georgia, serif;
}

.paper-list-row h3,
.paper-list-row p,
.paper-list-empty {
  margin: 0;
}

.paper-list-row h3 {
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
}

.paper-list-row p {
  margin-top: 2px;
  display: -webkit-box;
  overflow: hidden;
  color: var(--scrap-muted);
  font-size: 0.62rem;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.paper-list-state {
  font-size: 0.72rem;
}

.paper-list-empty {
  padding: 12px 0;
  color: var(--scrap-muted);
  font-size: 0.72rem;
  text-align: center;
}

.schedule-scrap {
  top: 0;
  left: 1%;
  width: 57%;
  height: 61%;
  transform: rotate(-4.5deg);
}

.schedule-scrap .scrap-card-copy {
  inset: 25% 14% 13% 16%;
}

.reminder-scrap {
  left: 7%;
  bottom: 0;
  width: 77%;
  height: 43%;
  transform: rotate(3.5deg);
}

.reminder-scrap .scrap-card-copy {
  inset: 22% 13% 17%;
}

.pressed-flower {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: -1%;
  width: 44%;
  height: 64%;
  object-fit: contain;
  opacity: 0.82;
  mix-blend-mode: multiply;
  transform: rotate(-7deg);
  pointer-events: none;
}

.archive-index {
  width: min(calc(100% - 54px), 650px);
  margin: 0 auto 72px;
  padding: 14px 8px 15px;
  border-top: 1px solid var(--scrap-rule);
  border-bottom: 1px solid var(--scrap-rule);
  transform: rotate(-0.35deg);
}

.archive-caption {
  display: block;
  margin-bottom: 9px;
  font: 600 0.61rem/1.2 Baskerville, Georgia, serif;
  letter-spacing: 0.28em;
  text-align: center;
}

.archive-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 0;
}

.archive-link {
  position: relative;
  min-height: 34px;
  padding: 5px 13px;
  border: 0;
  border-radius: 0;
  color: var(--scrap-ink);
  background: transparent;
  box-shadow: none;
  font-family: "Kaiti SC", STKaiti, KaiTi, serif;
  text-decoration: none;
}

.archive-link + .archive-link::before {
  content: "·";
  position: absolute;
  left: -2px;
  color: var(--scrap-muted);
}

.archive-link:hover {
  color: var(--scrap-ink);
  background: rgba(29, 25, 19, 0.07);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.archive-link strong {
  font-size: 0.88rem;
  font-weight: 500;
}

.archive-count {
  min-width: 16px;
  height: 16px;
  margin-left: 4px;
  padding: 0 4px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #f9efdc;
  background: #842f28;
  font: 700 0.58rem/1 Baskerville, serif;
}

/* Compact global telephone navigation: only its upper-left quarter is exposed. */
.main-nav.rotary-dock {
  --dial-ink: #25221d;
  --dial-cream: #eee0c2;
  position: fixed !important;
  top: auto !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  z-index: 80;
  width: 124px !important;
  max-width: none !important;
  height: calc(124px + env(safe-area-inset-bottom));
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none;
}

.rotary-phone-dial {
  --dial-rotation: 0deg;
  position: absolute;
  top: 14px;
  left: 14px;
  width: 194px;
  aspect-ratio: 1;
  border: 4px solid var(--dial-ink);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #25221d 0 26%, transparent 26.5%),
    radial-gradient(circle at 50% 50%, transparent 0 48%, rgba(37, 34, 29, 0.2) 48.5% 49%, transparent 49.5%),
    repeating-conic-gradient(from -78deg, rgba(37, 34, 29, 0.12) 0 1deg, transparent 1deg 13deg),
    radial-gradient(circle at 42% 33%, #f8edda, #d7c49e 64%, #a48c67 100%);
  box-shadow:
    0 -7px 18px rgba(50, 39, 24, 0.24),
    inset 0 0 0 8px rgba(255, 251, 239, 0.44),
    inset 0 0 0 13px rgba(37, 34, 29, 0.18),
    inset 0 0 28px rgba(54, 40, 23, 0.22);
  transform: none;
  touch-action: none;
  user-select: none;
  pointer-events: auto;
  cursor: grab;
}

.rotary-phone-dial:active {
  cursor: grabbing;
}

.rotary-phone-dial::before,
.rotary-phone-dial::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.rotary-phone-dial::before {
  inset: 12px;
  border: 2px solid rgba(37, 34, 29, 0.82);
  box-shadow: inset 0 0 0 8px rgba(248, 237, 218, 0.48);
}

.rotary-phone-dial::after {
  inset: 52px;
  border: 3px double rgba(238, 224, 194, 0.74);
  background: radial-gradient(circle at 45% 35%, #403a30, #171512 72%);
}

.rotary-number-ring {
  position: absolute;
  inset: 22px;
  border: 1px dashed rgba(37, 34, 29, 0.42);
  border-radius: 50%;
  transform: rotate(var(--dial-rotation));
  transition: none;
}

.rotary-phone-dial.is-settling .rotary-number-ring,
.rotary-phone-dial.is-settling .rotary-choice,
.rotary-phone-dial.is-settling .rotary-label {
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.25, 1);
}

.main-nav.rotary-dock .rotary-choice {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 4;
  width: 44px !important;
  height: 44px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  overflow: visible;
  border: 2px solid rgba(20, 18, 15, 0.96) !important;
  border-radius: 50% !important;
  color: var(--dial-ink) !important;
  background: #24211c !important;
  box-shadow:
    inset 0 0 0 5px #6c5f4c,
    0 2px 5px rgba(22, 18, 13, 0.32) !important;
  text-decoration: none !important;
  transform: translate(-50%, -50%) !important;
  transform-origin: center !important;
  pointer-events: auto;
}

.main-nav.rotary-dock .rotary-choice[data-page="assistant"] {
  top: 9% !important;
  left: 49% !important;
}

.main-nav.rotary-dock .rotary-choice[data-page="home"] {
  top: 20% !important;
  left: 32% !important;
}

.main-nav.rotary-dock .rotary-choice[data-page="settings"] {
  top: 36% !important;
  left: 17% !important;
}

.main-nav.rotary-dock .rotary-choice::before,
.main-nav.rotary-dock .rotary-choice::after,
.main-nav.rotary-dock .rotary-choice > .nav-cat,
.main-nav.rotary-dock .rotary-choice > .ui-icon {
  display: none !important;
}

.rotary-label {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(37, 34, 29, 0.55);
  border-radius: 50%;
  color: var(--dial-ink);
  background: radial-gradient(circle at 42% 32%, #fff8e8, #e6d4af 84%);
  box-shadow: inset 0 0 7px rgba(65, 49, 29, 0.18);
  font-family: "Kaiti SC", STKaiti, KaiTi, serif;
  transform: none;
}

.rotary-label i {
  font: italic 0.44rem/1 Baskerville, Georgia, serif;
}

.rotary-label strong {
  margin-top: 1px;
  font-size: 0.54rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.main-nav.rotary-dock .rotary-choice[aria-current="page"] .rotary-label {
  color: #f9efda;
  background: #5b4936;
  box-shadow:
    inset 0 0 0 2px #d8bc86,
    inset 0 0 9px rgba(0, 0, 0, 0.28);
}

.main-nav.rotary-dock .rotary-choice:focus-visible .rotary-label {
  outline: 3px solid #9b3c30;
  outline-offset: 3px;
}

.rotary-hub {
  position: absolute;
  inset: 31%;
  z-index: 3;
  display: grid;
  place-items: center;
  align-content: center;
  border: 2px solid #cbb484;
  border-radius: 50%;
  color: #ead9b8;
  background: radial-gradient(circle at 40% 30%, #51493d, #1f1c18 72%);
  box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.2);
  font-family: Baskerville, Georgia, serif;
  letter-spacing: 0.13em;
  pointer-events: none;
}

.rotary-hub b {
  font-size: 0.78rem;
}

.rotary-hub small {
  margin-top: 2px;
  font-size: 0.44rem;
}

.rotary-pointer {
  position: absolute;
  top: 0;
  right: 4px;
  left: auto;
  z-index: 6;
  width: 20px;
  height: 24px;
  border: 2px solid #342d23;
  border-radius: 3px 3px 10px 10px;
  background: linear-gradient(90deg, #9c845f, #ebd5aa 45%, #806a4d);
  box-shadow: 0 2px 4px rgba(37, 30, 21, 0.3);
  transform: rotate(18deg);
  pointer-events: none;
}

.rotary-instruction {
  display: none;
}

.rotary-dock + main {
  padding-bottom: 58px !important;
}

html[data-page="home"] .rotary-dock + main {
  padding-bottom: 0 !important;
}

@media (max-width: 760px) {
  .scrapbook-home {
    width: 100%;
  }

  .scrapbook-hero {
    min-height: 0;
    grid-template-columns: 34% 66%;
  }

  .calendar-poster {
    padding: 22px 9px 18px 12px;
  }

  .poster-year {
    font-size: clamp(3.25rem, 17vw, 4.2rem);
  }

  .poster-month {
    font-size: clamp(1.55rem, 8vw, 2rem);
  }

  .poster-day {
    font-size: clamp(3.2rem, 16vw, 4rem);
  }

  .weather-note {
    padding: 18px 18px 16px 34px;
  }

  .weather-frame {
    inset: 10px 2px;
    width: calc(100% - 4px);
    height: calc(100% - 20px);
    opacity: 0.48;
  }

  .weather-copy {
    padding: 15px 8px 8px;
  }

  .weather-copy p {
    font-size: 0.78rem;
  }

  .weather-curve-placeholder {
    display: block;
    font-size: 0.67rem;
  }

  .weather-curve-placeholder svg {
    display: block;
    height: 22px;
  }

  .daily-tally {
    display: block;
    font-size: 0.73rem;
  }

  .daily-tally span + span {
    margin-top: 2px;
  }

  .scrapbook-home .filmstrip {
    margin-bottom: 0;
  }

  .scrapbook-collage {
    min-height: 0;
    padding: 6px 7px;
  }

  .schedule-scrap {
    top: 2px;
    left: -1%;
    width: 62%;
  }

  .reminder-scrap {
    left: 4%;
    bottom: 1px;
    width: 82%;
  }

  .pressed-flower {
    top: 4px;
    right: -9%;
    width: 50%;
  }

  .main-nav.rotary-dock {
    width: 120px !important;
    height: calc(120px + env(safe-area-inset-bottom));
  }

  .rotary-phone-dial {
    top: 11px;
    left: 11px;
    width: 188px;
  }

  .main-nav.rotary-dock .rotary-choice {
    width: 44px !important;
    height: 44px !important;
    transform: translate(-50%, -50%) !important;
  }

  .rotary-label {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 370px) {
  .scrapbook-hero {
    grid-template-columns: 36% 64%;
  }

  .weather-note {
    padding-right: 12px;
    padding-left: 12px;
  }

  .weather-copy p,
  .daily-tally {
    font-size: 0.69rem;
  }

  .main-nav.rotary-dock .rotary-choice {
    transform: translate(-50%, -50%) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rotary-phone-dial.is-settling .rotary-number-ring,
  .rotary-phone-dial.is-settling .rotary-choice,
  .rotary-phone-dial.is-settling .rotary-label,
  .scrap-card {
    transition: none;
  }
}
