:root {
  --ink: #20201d;
  --paper: #f4efe6;
  --paper-deep: #e9e0d2;
  --orange: #fa5b2a;
  --green: #244f42;
  --muted: #777168;
  --line: rgba(32, 32, 29, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Manrope, sans-serif;
}
button, a { -webkit-tap-highlight-color: transparent; }

.grain {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

.site-header, main, footer { width: min(1320px, calc(100% - 48px)); margin-inline: auto; }
.site-header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font: 500 12px/1 DM Mono, monospace;
  letter-spacing: .08em;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: var(--paper); background: var(--ink); border-radius: 50%; font: 600 15px/1 Manrope, sans-serif; }
.timezone { color: var(--muted); }

.hero { position: relative; padding: 62px 0 52px; border-bottom: 1px solid var(--line); }
.hero::after { content: "✦"; position: absolute; right: 3%; top: 44px; color: var(--orange); font-size: clamp(54px, 7vw, 100px); line-height: 1; transform: rotate(12deg); }
.eyebrow, .calendar-kicker { margin: 0 0 18px; color: var(--orange); font: 500 11px/1 DM Mono, monospace; letter-spacing: .12em; }
h1 { max-width: 860px; margin: 0; font-size: clamp(52px, 7vw, 96px); line-height: .86; letter-spacing: -.07em; }
h1 em { color: var(--green); font-family: Georgia, serif; font-weight: 400; }
.hero-copy { max-width: 600px; margin: 28px 0 34px; color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); line-height: 1.55; }
.hero-stats { display: flex; gap: clamp(32px, 7vw, 86px); }
.hero-stats div { display: flex; flex-direction: column; gap: 5px; }
.hero-stats strong { font-size: 26px; letter-spacing: -.04em; }
.hero-stats span { color: var(--muted); font: 400 10px/1.2 DM Mono, monospace; text-transform: uppercase; letter-spacing: .08em; }

.controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.tabs, .toggle-group { display: flex; align-items: center; gap: 8px; }
.tab, .future-toggle, .text-toggle, .month-controls button { border: 0; font: 600 12px/1 Manrope, sans-serif; cursor: pointer; transition: .18s ease; }
.tab { padding: 10px 17px; border-radius: 100px; color: var(--muted); background: transparent; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--paper); background: var(--ink); }
.future-toggle { display: flex; align-items: center; gap: 9px; color: var(--muted); background: transparent; }
.future-toggle > span { width: 30px; height: 18px; padding: 3px; border-radius: 10px; background: #bbb3a8; transition: .2s ease; }
.future-toggle > span::after { content: ""; display: block; width: 12px; height: 12px; border-radius: 50%; background: white; transition: .2s ease; }
.future-toggle.active > span { background: var(--green); }
.future-toggle.active > span::after { transform: translateX(12px); }
.text-toggle { padding: 9px 12px; color: var(--muted); background: transparent; border-radius: 4px; }
.text-toggle span { display: inline-grid; min-width: 18px; height: 18px; margin-left: 4px; place-items: center; border-radius: 9px; color: var(--paper); background: #aaa298; font: 500 9px/1 DM Mono, monospace; }
.text-toggle.active { color: var(--ink); background: var(--paper-deep); }

.calendar-section { padding: 44px 0 96px; }
.calendar-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.calendar-kicker { margin-bottom: 10px; }
.calendar-heading h2 { margin: 0; font-size: clamp(34px, 4.5vw, 58px); line-height: 1; letter-spacing: -.055em; }
.month-controls { display: flex; gap: 7px; }
.month-controls button { min-width: 42px; height: 42px; padding: 0 14px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 50%; }
.month-controls button:first-child { border-radius: 100px; }
.month-controls button:hover { color: var(--paper); background: var(--ink); }

.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.calendar-board { min-width: 0; border-right: 1px solid var(--ink); }
.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekday-row { height: 40px; align-items: center; border-bottom: 1px solid var(--line); }
.weekday-row span { padding-left: 10px; color: var(--muted); font: 500 9px/1 DM Mono, monospace; letter-spacing: .09em; text-transform: uppercase; }
.calendar-grid { background: var(--line); gap: 1px; }
.calendar-day {
  position: relative;
  min-width: 0;
  min-height: 116px;
  padding: 9px;
  overflow: hidden;
  color: inherit;
  background: var(--paper);
  border: 0;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease;
}
.calendar-day:hover { background: #fffaf1; }
.calendar-day.outside-month { color: #aaa39a; background: #eee7dc; }
.calendar-day.selected { outline: 2px solid var(--orange); outline-offset: -2px; z-index: 1; }
.calendar-date-number { display: grid; width: 25px; height: 25px; margin-bottom: 7px; place-items: center; border-radius: 50%; font: 600 12px/1 DM Mono, monospace; }
.calendar-day.today .calendar-date-number { color: white; background: var(--orange); }
.calendar-items { display: flex; flex-direction: column; gap: 4px; }
.calendar-item { display: block; padding: 5px 6px; overflow: hidden; border-radius: 3px; font: 600 9px/1.2 Manrope, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.calendar-item.confirmed { color: #f8f1e7; background: var(--green); }
.calendar-item.proposal { color: #8d3218; background: #ffd3c5; }
.calendar-item.tentative { color: #72560b; background: #f2dfa1; }
.calendar-item.range { min-height: 21px; margin-right: -9px; margin-left: -9px; border-radius: 0; }
.calendar-item.range-start { margin-left: 0; border-radius: 3px 0 0 3px; }
.calendar-item.range-end { margin-right: 0; border-radius: 0 3px 3px 0; }
.calendar-item.range-start.range-end { margin-inline: 0; border-radius: 3px; }
.calendar-more { padding-left: 5px; color: var(--muted); font: 500 9px/1.2 DM Mono, monospace; }

.day-panel { min-width: 0; background: rgba(255,255,255,.2); }
.day-panel-header { padding: 24px 22px; border-bottom: 1px solid var(--line); }
.day-panel-header p { margin: 0 0 6px; color: var(--orange); font: 500 10px/1 DM Mono, monospace; letter-spacing: .1em; }
.day-panel-header h3 { margin: 0; font-size: 29px; line-height: 1.05; letter-spacing: -.045em; }
.day-panel-header > span { display: block; margin-top: 9px; color: var(--muted); font: 400 10px/1 DM Mono, monospace; }
.selected-event-card { padding: 22px; border-bottom: 1px solid var(--line); }
.selected-event-card.is-declined { opacity: .54; }
.card-topline { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.status-pill { display: inline-flex; align-items: center; padding: 5px 7px; border-radius: 3px; font: 500 9px/1 DM Mono, monospace; letter-spacing: .07em; text-transform: uppercase; }
.status-pill.confirmed { color: #f5eadb; background: var(--green); }
.status-pill.proposal { color: #8d3218; background: #ffd3c5; }
.status-pill.tentative { color: #72560b; background: #f2dfa1; }
.status-pill.declined { color: #5f5a52; background: #d8d0c5; }
.city { color: var(--muted); font: 500 9px/1 DM Mono, monospace; text-transform: uppercase; letter-spacing: .08em; }
.selected-event-card h4 { margin: 0; font-size: 19px; line-height: 1.18; letter-spacing: -.025em; }
.when { margin: 10px 0 0; color: var(--orange); font: 500 10px/1.45 DM Mono, monospace; }
.details { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; }
.source-link { color: var(--ink); font-size: 11px; font-weight: 700; text-underline-offset: 4px; }
.source-link span { color: var(--orange); }
.decline-button { padding: 7px 9px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 4px; font: 600 10px/1 Manrope, sans-serif; cursor: pointer; }
.decline-button:hover { color: var(--paper); background: var(--ink); }
.empty-state { padding: 66px 20px; text-align: center; color: var(--muted); }
.empty-state span { font-size: 40px; }
.empty-state p { margin: 8px 0 0; font-size: 12px; }

footer { display: flex; justify-content: space-between; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font: 400 11px/1.4 DM Mono, monospace; }
footer p { margin: 0; }
footer a { color: inherit; text-underline-offset: 3px; }

@media (max-width: 980px) {
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-board { border-right: 0; border-bottom: 1px solid var(--ink); }
  .selected-events { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .selected-event-card:nth-child(odd) { border-right: 1px solid var(--line); }
}

@media (max-width: 700px) {
  .site-header, main, footer { width: min(100% - 28px, 1320px); }
  .site-header { height: 66px; }
  .timezone { display: none; }
  .hero { padding: 48px 0 42px; }
  .hero::after { top: 28px; right: 0; font-size: 42px; }
  h1 { font-size: clamp(50px, 16vw, 72px); }
  .hero-copy { margin: 24px 0 28px; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .hero-stats strong { font-size: 22px; }
  .controls { align-items: flex-start; flex-direction: column; }
  .tabs { width: 100%; overflow-x: auto; }
  .tab { padding-inline: 13px; white-space: nowrap; }
  .toggle-group { width: 100%; justify-content: space-between; }
  .calendar-section { padding: 34px 0 70px; }
  .calendar-heading { align-items: flex-start; gap: 20px; }
  .calendar-heading h2 { font-size: 34px; }
  .month-controls button { min-width: 38px; height: 38px; padding: 0 11px; }
  .weekday-row span { padding: 0; text-align: center; font-size: 8px; }
  .calendar-day { min-height: 72px; padding: 5px; }
  .calendar-date-number { width: 22px; height: 22px; margin-bottom: 4px; font-size: 10px; }
  .calendar-item:not(.range) { width: 8px; height: 8px; padding: 0; border-radius: 50%; color: transparent !important; font-size: 0; }
  .calendar-item.range { width: auto; min-height: 6px; height: 6px; padding: 0; margin-right: -5px; margin-left: -5px; color: transparent !important; font-size: 0; }
  .calendar-item.range-start { margin-left: 0; border-radius: 3px 0 0 3px; }
  .calendar-item.range-end { margin-right: 0; border-radius: 0 3px 3px 0; }
  .calendar-items { flex-flow: row wrap; gap: 3px; }
  .calendar-item.range { flex-basis: calc(100% + 10px); }
  .calendar-item.range-start, .calendar-item.range-end { flex-basis: calc(100% + 5px); }
  .calendar-item.range-start.range-end { flex-basis: 100%; margin-inline: 0; border-radius: 3px; }
  .calendar-more { padding: 0; font-size: 8px; }
  .selected-events { grid-template-columns: 1fr; }
  .selected-event-card:nth-child(odd) { border-right: 0; }
  footer { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
