@import url("https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Caveat:wght@400;500;600;700&family=DM+Sans:wght@400;500&display=swap");

:root {
  --wine: #74152c;
  --ink: #292627;
  --ai: #9b3159;
  --tech: #315e70;
  --python: #526544;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "DM Sans", Arial, sans-serif;
  padding: 12px 3.5%;
  height: 100svh;
}

.lace {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 23px;
  opacity: 0.6;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at center,
      transparent 45%,
      #ded8d5 48% 52%,
      transparent 55%),
    radial-gradient(ellipse at center,
      transparent 43%,
      #ded8d5 46% 50%,
      transparent 53%);
  background-size:
    18px 21px,
    12px 14px;
  background-position:
    0 0,
    5px 7px;
}

.left {
  left: 4px;
}

.right {
  right: 4px;
}

.paper {
  height: 100%;
  max-width: 1700px;
  margin: auto;
  display: grid;
  grid-template-rows: 78px 32px minmax(0, 1fr) 17px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.note {
  font:
    16px Caveat,
    cursive;
  color: var(--wine);
  display: block;
  margin-left: 6px;
  transform: rotate(-3deg);
  transform-origin: left;
}

h1 {
  font:
    600 58px/0.83 Caveat,
    cursive;
  color: var(--wine);
  margin: 0 0 10px;
  letter-spacing: -1.5px;
}

h1>span {
  font:
    italic 400 24px "Cormorant Garamond",
    serif;
  letter-spacing: 0;
  margin-left: 10px;
}

h1 i {
  font:
    32px "Cormorant Garamond",
    serif;
  color: #ae8d4d;
  display: inline-block;
  margin-left: 18px;
  transform: rotate(12deg);
}

.identity {
  text-align: right;
}

.identity>span {
  font:
    500 13px "Cormorant Garamond",
    serif;
  letter-spacing: 2.5px;
}

.identity p {
  font:
    19px Caveat,
    cursive;
  margin: 2px 0;
  color: var(--wine);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #c5b9b3;
  padding: 3px 0 5px;
}

select {
  font:
    11px "DM Sans",
    Arial,
    sans-serif;
  color: var(--wine);
  background: white;
  border: 0;
  padding: 3px 22px 3px 0;
  max-width: 270px;
  cursor: pointer;
}

.legend {
  display: flex;
  gap: 16px;
  font-size: 9px;
}

.ai {
  color: var(--ai);
}

.tech {
  color: var(--tech);
}

.python {
  color: var(--python);
}

.hint {
  font:
    16px Caveat,
    cursive;
  color: #756259;
}

#calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: 23px repeat(6, minmax(0, 1fr));
  border-top: 1px solid #8f8580;
  border-left: 1px solid #b9b0aa;
  min-height: 0;
}

.weekday {
  text-align: center;
  font:
    italic 500 13px "Cormorant Garamond",
    serif;
  border-right: 1px solid #b9b0aa;
  border-bottom: 1px solid #b9b0aa;
  padding: 3px;
}

.day {
  border-right: 1px solid #c5bcb6;
  border-bottom: 1px solid #c5bcb6;
  padding: 2px 5px;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.date {
  align-self: flex-end;
  font:
    500 clamp(11px, 1.2vw, 17px)/1.1 "Cormorant Garamond",
    serif;
  position: relative;
  padding: 0 3px;
  margin-bottom: 1px;
  flex-shrink: 0;
}

.circle:after {
  content: "";
  position: absolute;
  inset: -1px -4px;
  border: 1px solid #9a7746;
  border-radius: 50%;
  transform: rotate(-14deg);
}

.event {
  font:
    600 clamp(8px, 0.83vw, 13px)/1.07 Caveat,
    cursive;
  text-align: left;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: var(--ai);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  min-height: 0;
  flex: 0 1 auto;
  cursor: pointer;
}

.event[data-category="Tech"] {
  color: var(--tech);
}

.event[data-category="Python"] {
  color: var(--python);
}

.event:hover {
  background: #f7f0f2;
  text-decoration: underline;
}

.event .continuing {
  font-size: 0.8em;
  opacity: 0.65;
}

.filler {
  background: repeating-linear-gradient(135deg,
      transparent 0 12px,
      #8a777705 12px 13px);
}

.doodle {
  margin: auto;
  font:
    clamp(25px, 3vw, 45px) Caveat,
    cursive;
  color: #b3995d;
  transform: rotate(-10deg);
  pointer-events: none;
}

.heart {
  color: #a36f80;
}

.code {
  color: #6f858d;
}

.day-note {
  margin: auto;
  text-align: center;
  color: #ab9691;
  font:
    clamp(11px, 1.2vw, 18px) Caveat,
    cursive;
  transform: rotate(-5deg);
}

.status {
  font:
    9px/1.4 "DM Sans",
    Arial,
    sans-serif;
  margin: 3px 0 0;
  text-align: right;
  color: #96847b;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
}

dialog {
  width: min(520px, calc(100% - 28px));
  border: 1px solid #a69a91;
  background: white;
  padding: 38px;
  box-shadow: 0 20px 100px #26071333;
  color: var(--ink);
}

dialog::backdrop {
  background: #28111877;
  backdrop-filter: blur(3px);
}

#close-dialog {
  position: absolute;
  right: 12px;
  top: 6px;
  background: none;
  border: 0;
  font:
    30px "Cormorant Garamond",
    serif;
  color: var(--wine);
  padding: 4px 10px;
  cursor: pointer;
}

.detail-category {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--wine);
}

dialog h2 {
  font:
    500 38px/1.05 "Cormorant Garamond",
    serif;
  margin: 17px 0 22px;
}

.detail-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  border-block: 1px solid #d8ceca;
  padding: 13px 0;
  font-size: 12px;
  line-height: 1.7;
}

.description {
  font:
    21px/1.5 "Cormorant Garamond",
    serif;
  margin: 21px 0 25px;
}

.site-link {
  display: block;
  background: var(--wine);
  color: white;
  text-decoration: none;
  padding: 14px 20px;
  text-align: center;
  font-size: 12px;
}

.detail-note {
  font-size: 10px;
  color: #897d76;
  line-height: 1.6;
  margin-bottom: 0;
}

@media (max-width: 700px) {
  body {
    padding: 8px 16px;
  }

  .lace {
    width: 9px;
    background-size:
      10px 12px,
      7px 8px;
  }

  .left {
    left: 1px;
  }

  .right {
    right: 1px;
  }

  .paper {
    grid-template-rows: 68px 31px minmax(0, 1fr) 16px;
  }

  h1 {
    font-size: 43px;
  }

  h1>span {
    font-size: 19px;
    margin-left: 5px;
  }

  h1 i {
    font-size: 20px;
    margin-left: 7px;
  }

  .note {
    font-size: 13px;
  }

  .identity>span {
    font-size: 8px;
    letter-spacing: 1px;
  }

  .identity p {
    font-size: 14px;
  }

  .hint {
    display: none;
  }

  select {
    font-size: 9px;
    max-width: 210px;
  }

  .legend {
    font-size: 8px;
    gap: 7px;
  }

  .weekday {
    font-size: 11px;
  }

  .day {
    padding: 2px;
  }

  .event {
    font-size: clamp(7px, 1.5vw, 10px);
    line-height: 1.15;
  }

  .status {
    font-size: 8px;
  }

  dialog {
    padding: 30px 23px;
  }
}

@media (max-height: 650px) {
  .paper {
    grid-template-rows: 59px 28px minmax(0, 1fr) 14px;
  }

  h1 {
    font-size: 43px;
  }

  .note {
    font-size: 12px;
  }

  .event {
    font-size: 8px;
    line-height: 1;
  }

  .date {
    font-size: 11px;
  }

  .status {
    font-size: 8px;
  }

  .identity p {
    font-size: 16px;
  }
}

/* Compact all-day labels keep even the busiest date inside its cell. */
@media (min-width: 701px) {
  .event {
    font-size: clamp(7px, 0.65vw, 9.5px);
    line-height: 1.05;
  }

  .date {
    font-size: 13px;
  }
}

/* Content-aware lettering: each day uses the largest size that fits. */
h1 b {
  font-weight: inherit;
}

.day {
  padding: 3px 7px;
  overflow: visible;
  isolation: isolate;
}

.date {
  font-size: 15px;
  line-height: 1.1;
  margin-bottom: 3px;
}

.day-events {
  flex: 1;
  min-height: 0;
  min-width: 0;
  font-size: 20px;
  padding: 2px 3px 3px;
}

.day .event {
  font:
    600 1em/1.05 Caveat,
    cursive;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  display: block;
  flex: none;
  min-height: auto;
  margin: 0 0 1px;
  padding: 0;
  position: relative;
  z-index: 2;
  overflow-wrap: anywhere;
}

.event-label {
  position: relative;
}

.highlight {
  margin-top: 3px !important;
  margin-bottom: 6px !important;
}

.highlight .event-label {
  display: inline-block;
  padding: 1px 6px;
}

.highlight .event-label:after {
  content: "";
  position: absolute;
  inset: -3px -5px;
  border: 1.5px solid #9a7746;
  border-radius: 50%;
  transform: rotate(-4deg);
  pointer-events: none;
}

.pizza-heart {
  color: #9b3159;
  white-space: nowrap;
}

#calendar {
  grid-template-rows: 23px repeat(var(--weeks, 6), minmax(0, 1fr));
}

.cell-art {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%) rotate(-9deg);
  font:
    clamp(28px, 4vw, 59px) Caveat,
    cursive;
  pointer-events: none;
  z-index: 0;
  white-space: nowrap;
  opacity: 0.8;
}

.cell-art.with-events {
  left: auto;
  top: auto;
  right: 11px;
  bottom: 7px;
  transform: rotate(12deg);
  font-size: 26px;
  opacity: 0.5;
}

.gold {
  color: #b3995d;
}

.pink {
  color: #a36f80;
}

.blue {
  color: #6f858d;
}

.status {
  padding-top: 1px;
}

@media (max-width: 700px) {
  .day {
    padding: 2px 3px;
  }

  .date {
    font-size: 12px;
    margin-bottom: 2px;
  }

  .day-events {
    padding: 1px;
  }

  .highlight .event-label {
    padding: 0 2px;
  }

  .highlight .event-label:after {
    inset: -2px -1px;
    border-width: 1px;
  }

  .cell-art.with-events {
    font-size: 17px;
    right: 4px;
    bottom: 4px;
  }
}

/* All event labels share one size, chosen to fit the busiest day. */
.day-events {
  font-size: 18px;
}

.day .event {
  font-weight: 600;
  line-height: 1.12;
  margin-bottom: 2px;
}

.continuing {
  font-size: 1em !important;
  opacity: 1 !important;
}

.cell-art {
  font-family: Caveat, "Segoe UI Symbol", serif;
  font-size: clamp(26px, 3vw, 43px);
  opacity: 0.65;
}

.cell-art.with-events {
  font-size: 24px;
  opacity: 0.4;
}

/* Slightly larger uniform lettering with tighter spacing to stay inside each day. */
.day .event {
  line-height: 1.04;
  margin-bottom: 1px;
}

.day-events {
  font-size: 21px;
  padding-top: 1px;
  padding-bottom: 1px;
}

/* Center the calendar label independently of the month and signature. */
header {
  position: relative;
}

.note {
  position: absolute;
  top: 10px;
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  transform-origin: center;
  white-space: nowrap;
  font-size: 23px;
}

.month {
  padding-top: 12px;
}

@media (max-width: 700px) {
  .note {
    top: -2px;
    font-size: 18px;
  }

  .month {
    padding-top: 18px;
  }

  .identity {
    padding-top: 18px;
  }
}

/* A larger editorial serif masthead, with its own clear header space. */
.paper {
  grid-template-rows: 104px 32px minmax(0, 1fr) 17px;
}

.note {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(34px, 3.2vw, 48px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.6px;
  top: 0;
  color: var(--wine);
}

.month {
  align-self: flex-end;
  padding-top: 0;
  margin-bottom: 8px;
}

h1 {
  margin-bottom: 0;
  font-size: 52px;
}

.identity {
  align-self: flex-end;
  padding-top: 0;
  margin-bottom: 10px;
}

@media (max-width: 700px) {
  .paper {
    grid-template-rows: 99px 31px minmax(0, 1fr) 16px;
  }

  .note {
    font-size: 34px;
    top: 0;
    letter-spacing: -0.5px;
  }

  .month {
    padding-top: 0;
    margin-bottom: 8px;
  }

  h1 {
    font-size: 41px;
  }

  .identity {
    padding-top: 0;
    margin-bottom: 10px;
  }
}

@media (max-height: 650px) {
  .paper {
    grid-template-rows: 87px 28px minmax(0, 1fr) 14px;
  }

  .note {
    font-size: 32px;
  }

  h1 {
    font-size: 40px;
  }
}

/* Events wordmark and centred masthead. */
.site-brand {
  position: absolute;
  top: 4px;
  left: 0;
  color: var(--wine);
  text-decoration: none;
  font-family: "IM Fell English", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: .01em;
}

.note {
  font-family: "IM Fell English", Georgia, serif;
  font-weight: 400;
  font-style: normal;
  letter-spacing: .01em;
}

@media (max-width: 700px) {
  .site-brand {
    font-size: 18px;
  }
}