:root {
  --ink-950: #1e2222;
  --ink-700: #424a49;
  --ink-500: #5b6563;
  --paper-0: #f7f1e6;
  --paper-1: #efe4cf;
  --paper-2: #e3d1b2;
  --card: #fff9ee;
  --line: #baa788;
  --sage-700: #1e5a4b;
  --sage-800: #154136;
  --amber-600: #c3772a;
  --rust-600: #b34d2f;
  --indigo-700: #2f446f;
  --focus: #0a6e5a;
  --shadow-soft: 0 10px 22px rgba(26, 24, 17, 0.12);
  --shadow-strong: 0 18px 34px rgba(18, 25, 22, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink-950);
  background:
    radial-gradient(circle at 18% 14%, rgba(194, 119, 42, 0.15) 0%, transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(47, 68, 111, 0.14) 0%, transparent 28%),
    linear-gradient(180deg, var(--paper-0) 0%, var(--paper-1) 100%);
  min-height: 100vh;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(132, 97, 54, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 97, 54, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, #000 35%, transparent 95%);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1260px, 100% - 2rem);
  margin: 0 auto;
  padding: 1.8rem 0 3rem;
}

.masthead {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  margin-bottom: 1.1rem;
}

.masthead-copy {
  position: relative;
  background: linear-gradient(165deg, #fffdf8 0%, #f8f1e5 72%, #f3e5ce 100%);
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: 1.35rem 1.45rem 1.18rem;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.masthead-copy::before {
  content: "COMMUNITY BOARD";
  position: absolute;
  top: 0.78rem;
  right: -2.1rem;
  background: linear-gradient(180deg, var(--rust-600), #8f3a24);
  color: #fff8ea;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  padding: 0.26rem 2.4rem;
  transform: rotate(18deg);
}

.masthead-copy::after {
  content: "";
  position: absolute;
  top: -0.58rem;
  left: 1.1rem;
  width: 96px;
  height: 19px;
  border-radius: 5px;
  background: rgba(232, 212, 171, 0.72);
  border: 1px solid rgba(165, 127, 80, 0.45);
}

.eyebrow {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--sage-700);
  font-weight: 600;
}

h1 {
  margin: 0.45rem 0 0.62rem;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(2rem, 4.8vw, 3.35rem);
  line-height: 1.01;
  letter-spacing: 0.01em;
}

.hero-sub {
  margin: 0 0 0.64rem;
  max-width: 66ch;
  color: var(--ink-700);
  line-height: 1.4;
  font-size: 0.98rem;
}

.meta {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.92rem;
  font-family: "IBM Plex Mono", monospace;
}

.masthead-tags {
  margin-top: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.masthead-tags span {
  border-radius: 999px;
  border: 1px solid rgba(46, 71, 115, 0.4);
  background: rgba(47, 68, 111, 0.08);
  color: var(--indigo-700);
  padding: 0.16rem 0.56rem;
  font-size: 0.73rem;
  font-weight: 700;
}

.spotlight {
  position: relative;
  color: #f5fff9;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 1.08rem 1.16rem;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.18), transparent 46%),
    linear-gradient(145deg, #1f5f4f 0%, #1c4e46 50%, #17373f 100%);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
}

.spotlight::before {
  content: "";
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: #ffcc7a;
  box-shadow: 0 0 0 4px rgba(255, 204, 122, 0.17);
}

.spotlight-label {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
  opacity: 0.96;
}

.spotlight-title {
  margin: 0.5rem 0 0.42rem;
  font-family: "Newsreader", Georgia, serif;
  line-height: 1.14;
  letter-spacing: 0.01em;
}

.spotlight-meta {
  margin: 0.25rem 0;
  font-size: 0.92rem;
  line-height: 1.35;
}

.spotlight-meta a {
  color: #f4e09a;
  font-weight: 700;
  text-underline-offset: 2px;
}

.spotlight-pills {
  margin: 0.36rem 0;
  min-height: 1.56rem;
}

.spotlight-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(244, 224, 154, 0.55);
  border-radius: 999px;
  padding: 0.16rem 0.56rem;
  background: rgba(244, 224, 154, 0.12);
  color: #fff5ca;
  font-size: 0.78rem;
  font-weight: 700;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr);
  gap: 1rem;
}

.calendar-panel,
.day-panel {
  position: relative;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(170deg, #fffdf7 0%, #f6ecd9 100%);
  box-shadow: var(--shadow-soft);
}

.calendar-panel {
  padding: 1rem;
  overflow: hidden;
}

.calendar-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to bottom, rgba(132, 97, 54, 0.09) 1px, transparent 1px);
  background-size: 100% 32px;
  opacity: 0.45;
}

.calendar-toolbar,
.weekday-strip,
.month-grid {
  position: relative;
  z-index: 1;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.72rem;
}

.month-head {
  text-align: center;
}

.month-head h2 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.3rem, 2.8vw, 1.72rem);
  letter-spacing: 0.01em;
}

.month-head p {
  margin: 0.1rem 0 0;
  color: var(--ink-700);
  font-size: 0.88rem;
  font-family: "IBM Plex Mono", monospace;
}

.month-nav {
  border: 2px solid #93795a;
  border-radius: 999px;
  background: linear-gradient(180deg, #fef7e7 0%, #eedac1 100%);
  color: #5b4226;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  cursor: pointer;
  padding: 0.42rem 0.8rem;
  min-width: 4.1rem;
  transition: transform 130ms ease, box-shadow 130ms ease, border-color 130ms ease;
}

.month-nav:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(85, 58, 24, 0.18);
  border-color: #7a6247;
}

.month-nav:disabled {
  opacity: 0.45;
  cursor: default;
}

.month-nav:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.weekday-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.44rem;
  margin-bottom: 0.45rem;
}

.weekday {
  border-radius: 10px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  color: var(--indigo-700);
  font-weight: 600;
  background: rgba(47, 68, 111, 0.08);
  padding: 0.22rem 0;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.44rem;
}

.day-cell {
  position: relative;
  border: 2px solid #d0bfa5;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf8 0%, #f6ebd8 100%);
  min-height: 108px;
  padding: 0.42rem 0.4rem;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: start;
  cursor: pointer;
  text-align: left;
  transition: border-color 130ms ease, transform 130ms ease, box-shadow 130ms ease;
}

.day-cell:hover {
  border-color: #a48766;
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(72, 53, 28, 0.14);
}

.day-cell:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.day-cell.is-outside {
  background: linear-gradient(180deg, #efe7d8 0%, #e4d8c4 100%);
  border-color: #d1c2a7;
  color: #8a887f;
}

.day-cell.is-today {
  border-color: var(--amber-600);
  box-shadow: inset 0 0 0 1px rgba(195, 119, 42, 0.45);
}

.day-cell.is-selected {
  border-color: var(--rust-600);
  box-shadow: inset 0 0 0 1px var(--rust-600);
}

.day-cell.has-events {
  border-color: hsl(var(--event-tone, 156) 44% 38% / 0.62);
  background:
    radial-gradient(circle at 84% 18%, hsl(var(--event-tone, 156) 75% 93%) 0%, transparent 48%),
    linear-gradient(180deg, #fffdf8 0%, hsl(var(--event-tone, 156) 65% 95%) 100%);
}

.day-num {
  font-weight: 700;
  font-size: 0.92rem;
}

.day-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 1.36rem;
  height: 1.36rem;
  border-radius: 999px;
  background: hsl(var(--event-tone, 156) 55% 32%);
  color: #f2fff9;
  border: 1px solid hsl(var(--event-tone, 156) 52% 25% / 0.65);
  font-size: 0.72rem;
  font-weight: 700;
  margin: 0.22rem 0 0.26rem;
}

.day-cell:not(.has-events) .day-dot {
  visibility: hidden;
}

.day-title {
  color: var(--ink-700);
  font-size: 0.7rem;
  font-family: "IBM Plex Mono", monospace;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.day-panel {
  padding: 1rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.day-panel-head h3 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.32rem;
  letter-spacing: 0.01em;
}

.day-panel-head p {
  margin: 0.24rem 0 0.68rem;
  color: var(--ink-700);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
}

.day-events {
  display: grid;
  gap: 0.64rem;
  max-height: 680px;
  overflow: auto;
  padding-right: 0.16rem;
}

.day-events::-webkit-scrollbar {
  width: 9px;
}

.day-events::-webkit-scrollbar-thumb {
  background: #c8b694;
  border-radius: 999px;
}

.event-card {
  border: 1px solid hsl(var(--event-tone, 156) 40% 45% / 0.45);
  border-left: 6px solid hsl(var(--event-tone, 156) 58% 30%);
  border-radius: 14px;
  padding: 0.72rem 0.78rem;
  background:
    radial-gradient(circle at 88% 4%, hsl(var(--event-tone, 156) 82% 94%) 0%, transparent 45%),
    linear-gradient(180deg, #fffdf7 0%, #f6f1e7 100%);
}

.event-head {
  display: flex;
  gap: 0.62rem;
  align-items: flex-start;
  justify-content: space-between;
}

.event-head h4 {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.26;
}

.event-head p {
  margin: 0;
  border-radius: 999px;
  border: 1px solid rgba(31, 90, 75, 0.28);
  background: rgba(31, 90, 75, 0.1);
  color: var(--sage-800);
  font-size: 0.75rem;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

.event-line {
  margin: 0.52rem 0;
  color: var(--ink-700);
  font-size: 0.9rem;
  line-height: 1.35;
}

.event-desc {
  margin: 0.5rem 0;
  color: #314645;
  font-size: 0.9rem;
  line-height: 1.38;
}

.event-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
  margin: 0.38rem 0 0.46rem;
}

.event-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid hsl(var(--event-tone, 156) 38% 42% / 0.52);
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  background: hsl(var(--event-tone, 156) 76% 94% / 0.8);
  color: hsl(var(--event-tone, 156) 47% 26%);
  font-size: 0.72rem;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
}

.event-link {
  color: var(--sage-700);
  font-weight: 700;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.event-link:hover {
  color: var(--sage-800);
}

.empty-day {
  border: 1px dashed #a78f70;
  border-radius: 14px;
  padding: 0.82rem;
  background: linear-gradient(180deg, #faf2e3 0%, #f2e6d0 100%);
}

.empty-day h4 {
  margin: 0 0 0.26rem;
  font-size: 0.95rem;
}

.empty-day p {
  margin: 0;
  color: var(--ink-700);
  font-size: 0.88rem;
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .masthead-copy,
  .spotlight,
  .calendar-panel,
  .day-panel {
    animation: panel-rise 420ms ease both;
  }

  .spotlight {
    animation-delay: 40ms;
  }

  .calendar-panel {
    animation-delay: 75ms;
  }

  .day-panel {
    animation-delay: 115ms;
  }

  .event-card {
    animation: card-rise 300ms ease both;
  }

  .event-card:nth-child(2) {
    animation-delay: 45ms;
  }

  .event-card:nth-child(3) {
    animation-delay: 80ms;
  }
}

@media (max-width: 1090px) {
  .masthead {
    grid-template-columns: 1fr;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .day-events {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(1260px, 100% - 1rem);
    padding-top: 0.95rem;
  }

  .masthead-copy,
  .spotlight,
  .calendar-panel,
  .day-panel {
    border-radius: 16px;
  }

  .masthead-copy {
    padding: 1.1rem 1rem;
  }

  .masthead-copy::before {
    right: -2.28rem;
    top: 0.66rem;
    font-size: 0.6rem;
  }

  .hero-sub {
    font-size: 0.93rem;
  }

  .calendar-panel,
  .day-panel {
    padding: 0.76rem;
  }

  .month-nav {
    min-width: 3.28rem;
    padding: 0.3rem 0.54rem;
    font-size: 0.72rem;
  }

  .month-grid {
    gap: 0.34rem;
  }

  .day-cell {
    min-height: 86px;
    border-radius: 11px;
    padding: 0.33rem;
  }

  .day-title {
    font-size: 0.65rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .event-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .event-head p {
    white-space: normal;
  }

  .masthead-tags span {
    font-size: 0.68rem;
  }
}
