:root {
  color-scheme: light;
  --paper: #f3ead3;
  --desk: #e3d4b4;
  --ink: #37301f;
  --soft-ink: #6e6046;
  --olive: #5e6b3b;
  --brick: #9c4a2e;
  --gold: #b7902f;
  --blue: #5b7791;
  --line: rgba(55, 48, 31, .14);
  --evening: 0;
  --font-hand: "Segoe Print", "Bradley Hand ITC", "Comic Sans MS", cursive;
  --font-voice: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-ui: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    url("/assets/bg-ornament.svg") right bottom / min(760px, 100vw) auto no-repeat,
    radial-gradient(120% 90% at 50% 18%, #efe1c6 0%, var(--desk) 46%, #cdbb97 100%);
  font-family: var(--font-ui);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 5vw, 56px);
}

.brand {
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
  text-transform: lowercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--soft-ink);
  font: 600 13px/1.2 var(--font-ui);
}

nav a {
  position: relative;
  min-height: 34px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 238, .34);
  text-decoration: none;
}

nav a::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--olive), var(--brick) 20%);
  opacity: .34;
  transform: scaleX(.32);
  transition: transform .18s ease;
}

nav a:hover::after {
  transform: scaleX(1);
}

.page {
  width: min(980px, calc(100% - 28px));
  margin: 12px auto 52px;
}

.today-root,
.day-page {
  display: grid;
  justify-items: center;
}

.sheet {
  position: relative;
  z-index: 0;
  width: min(100%, 452px);
  min-height: 0;
  padding: 38px 26px 26px;
  overflow: visible;
  color: var(--ink);
  background:
    linear-gradient(174deg, color-mix(in srgb, var(--paper), #fff 5%), var(--paper) 60%),
    repeating-linear-gradient(90deg, rgba(90, 74, 48, .025) 0 1px, transparent 1px 7px);
  border-radius: 16px 12px 18px 10px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .6) inset,
    0 18px 34px -18px rgba(55, 48, 31, .52),
    0 4px 12px -7px rgba(55, 48, 31, .38);
}

.sheet::before,
.sheet::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 16px;
  width: 94%;
  height: calc(100% - 8px);
  translate: -50% 0;
  border-radius: 16px 12px 18px 10px;
  background: color-mix(in srgb, var(--paper), #000 8%);
  z-index: -2;
}

.sheet::after {
  top: 9px;
  width: 97%;
  background: color-mix(in srgb, var(--paper), #000 4%);
  z-index: -1;
}

.sheet-content {
  position: relative;
  z-index: 2;
}

.binding {
  position: absolute;
  top: -13px;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: 20px;
  height: 26px;
}

.binding span {
  width: 15px;
  height: 22px;
  border: 1px solid rgba(120, 105, 70, .5);
  border-radius: 50%;
  background: linear-gradient(180deg, #d8cba9, #b7a983);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 1px 0 rgba(255, 255, 255, .5) inset;
}

.perf {
  position: absolute;
  z-index: 1;
  top: 20px;
  left: 14px;
  right: 14px;
  border-top: 2px dotted rgba(120, 105, 70, .45);
}

.ghostnum {
  position: absolute;
  z-index: 0;
  top: -16px;
  right: 7px;
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 190px;
  line-height: 1;
  opacity: .05;
  pointer-events: none;
}

.sheet-date {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.sheet-date span {
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

.sheet-date small {
  color: var(--soft-ink);
  font: 600 11px/1.2 var(--font-ui);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sheet-date small:empty {
  display: none;
}

.symbol {
  width: 34px;
  height: 34px;
  margin: 18px auto 8px;
  color: var(--olive);
  opacity: .78;
}

.symbol svg {
  display: block;
  width: 100%;
  height: 100%;
}

.category {
  display: table;
  margin: 0 auto 18px;
  padding: 5px 13px;
  border-radius: 999px;
  color: #efece0;
  background: var(--olive);
  font: 600 12px/1.2 var(--font-ui);
  letter-spacing: .02em;
}

blockquote {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: var(--font-voice);
  font-size: clamp(24px, 6.6vw, 30px);
  font-weight: 700;
  line-height: 1.38;
  text-align: left;
  text-wrap: balance;
}

.author {
  margin: 0 0 12px;
  color: var(--soft-ink);
  font: 600 13px/1.4 var(--font-ui);
}

.reflection {
  margin: 0;
  color: var(--soft-ink);
  font-family: var(--font-voice);
  font-size: 17px;
  font-style: italic;
  line-height: 1.5;
}

.note {
  margin-top: 22px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px 11px 13px 12px;
  background: color-mix(in srgb, var(--paper), var(--olive) 7%);
}

.note h2 {
  margin: 0 0 6px;
  color: var(--olive);
  font: 700 11px/1.2 var(--font-ui);
  letter-spacing: .15em;
  text-transform: uppercase;
}

.note p {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-voice);
  font-size: 17px;
  line-height: 1.45;
}

.note.muted {
  background: color-mix(in srgb, var(--paper), var(--blue) 5%);
}

.calendar-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 0;
  color: var(--soft-ink);
  font-family: var(--font-voice);
  font-size: 16px;
  font-style: italic;
  line-height: 1.5;
}

.calendar-note::before,
.calendar-note::after {
  content: "";
  height: 1px;
  flex: 1 1 28px;
  background: var(--line);
}

.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px auto 0;
}

button,
.button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 44px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  color: #f4ecd8;
  background: var(--brick);
  box-shadow: 0 8px 18px -10px rgba(156, 74, 46, .8);
  cursor: pointer;
  font: 600 15px/1.2 var(--font-ui);
  text-decoration: none;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

button::before,
.button::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, .32), transparent 42%, rgba(183, 144, 47, .24));
  opacity: .72;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px rgba(156, 74, 46, .9), 0 0 0 5px rgba(183, 144, 47, .14);
}

.done-button,
.secondary,
.share-button {
  border: 1.5px solid var(--olive);
  color: var(--olive);
  background: rgba(255, 250, 238, .28);
}

.done-button {
  padding-inline: 24px 46px;
  font-family: var(--font-hand);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.done-button::after {
  content: "";
  position: absolute;
  right: 16px;
  top: calc(50% - 9px);
  width: 18px;
  height: 18px;
  border: 2px solid color-mix(in srgb, var(--olive), transparent 62%);
  border-top-color: var(--olive);
  border-radius: 50%;
  opacity: .74;
}

.done-button:hover::after {
  animation: spinLine 1.2s linear infinite;
}

.done-button.is-done::after {
  border-color: rgba(241, 234, 214, .42);
  border-top-color: #f1ead6;
  animation: spinLine .7s ease-out 1;
}

button.is-done {
  color: #f1ead6;
  background: var(--olive);
}

.clock {
  position: relative;
  width: 174px;
  margin: 32px auto 0;
  text-align: center;
}

.clock::before {
  content: "";
  position: absolute;
  inset: -20px 56px auto;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(183, 144, 47, calc(.30 + var(--evening) * .30)) 0%, rgba(183, 144, 47, 0) 68%);
  animation: breathe 5.5s ease-in-out infinite;
}

.clock-face {
  position: relative;
  width: 82px;
  aspect-ratio: 1;
  margin: 0 auto 8px;
  border: 1.5px solid #b7a983;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 10px 24px -16px rgba(55, 48, 31, .55);
}

.clock-face::before {
  content: "";
  position: absolute;
  z-index: 4;
  width: 6px;
  height: 6px;
  left: calc(50% - 3px);
  top: calc(50% - 3px);
  border-radius: 50%;
  background: var(--ink);
}

.clock-face i {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 50%;
  transform-origin: 50% 100%;
  background: var(--ink);
}

.hour {
  width: 3px;
  height: 22px;
  border-radius: 4px;
}

.minute {
  width: 2px;
  height: 30px;
  border-radius: 4px;
}

.second {
  width: 1px;
  height: 34px;
  background: var(--brick);
}

.mark {
  position: absolute;
  color: rgba(55, 48, 31, .68);
  font: 700 10px/1 var(--font-voice);
}

.m12 { left: 50%; top: 8px; transform: translateX(-50%); }
.m3 { right: 8px; top: 50%; transform: translateY(-50%); }
.m6 { left: 50%; bottom: 8px; transform: translateX(-50%); }
.m9 { left: 8px; top: 50%; transform: translateY(-50%); }

#local-time {
  position: relative;
  z-index: 2;
  margin: 0;
  color: var(--soft-ink);
  font: 700 14px/1.4 var(--font-ui);
}

.archive h1,
.text-page h1 {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: clamp(42px, 8vw, 74px);
  line-height: 1;
}

.lead,
.text-page p {
  max-width: 720px;
  color: var(--soft-ink);
  font-family: var(--font-voice);
  font-size: 20px;
  line-height: 1.65;
}

.month-group {
  margin-top: 34px;
}

.month-group h2 {
  margin: 0 0 12px;
  color: var(--olive);
  font-family: var(--font-hand);
  font-size: 36px;
  line-height: 1;
}

.month-group ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  padding: 0;
  list-style: none;
}

.month-group a {
  display: block;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px 10px 15px 9px;
  background: rgba(243, 234, 211, .72);
  text-decoration: none;
  box-shadow: 0 10px 24px -22px rgba(55, 48, 31, .4);
}

.month-group span {
  display: block;
  margin-bottom: 8px;
  color: var(--soft-ink);
  font: 600 13px/1.2 var(--font-ui);
}

.month-group strong {
  font-family: var(--font-voice);
  line-height: 1.35;
}

.footer {
  padding: 28px 16px 38px;
  color: var(--soft-ink);
  text-align: center;
}

.footer p {
  margin: 6px 0;
}

.sister {
  font-family: var(--font-voice);
  font-style: italic;
}

.sister a {
  color: var(--olive);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.theme-warm { --paper: #f4e0bb; --olive: #64733e; --brick: #9a4e2f; --gold: #b7902f; }
.theme-paper { --paper: #f3ead3; --olive: #5e6b3b; --brick: #9c4a2e; --gold: #b7902f; }
.theme-olive { --paper: #eef0d9; --olive: #596b3f; --brick: #92563d; --gold: #a98b36; }
.theme-ink { --paper: #ece7dc; --olive: #526553; --brick: #854d35; --gold: #a98a32; }
.theme-dawn { --paper: #f3dfd0; --olive: #61724b; --brick: #9b553d; --gold: #bc8e33; }
.theme-stone { --paper: #eeece4; --olive: #5e6656; --brick: #8e5838; --gold: #a88b41; }
.theme-sky { --paper: #e8f0ef; --olive: #526e63; --brick: #95603e; --gold: #aa8b35; }
.theme-clay { --paper: #f0dfcf; --olive: #65764e; --brick: #8f5038; --gold: #b08732; }
.theme-linen { --paper: #f5efdf; --olive: #6b7040; --brick: #93573b; --gold: #b29235; }
.theme-graphite { --paper: #e8e4db; --olive: #575f4c; --brick: #81513a; --gold: #9f873a; }

@keyframes breathe {
  0%, 100% { opacity: .72; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes spinLine {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 8px;
  }

  .page {
    width: min(100% - 22px, 452px);
    margin-top: 8px;
  }

  .sheet {
    padding: 36px 20px 22px;
  }

  .binding {
    gap: 15px;
  }

  .ghostnum {
    font-size: 154px;
  }

  blockquote {
    font-size: clamp(23px, 7.2vw, 28px);
  }

  .actions {
    position: sticky;
    bottom: 8px;
    z-index: 8;
    padding: 8px;
    border-radius: 999px;
    background: rgba(227, 212, 180, .74);
    backdrop-filter: blur(10px);
  }
}
