:root {
  --bg: #fbf7f2;
  --surface: #ffffff;
  --text: #1f1a24;
  --muted: #6b6372;
  --border: #e8e0d8;
  --accent: #c2410c;
  --accent-text: #ffffff;
  --accent-soft: #fde7da;
  --shadow: 0 1px 2px rgba(31, 26, 36, 0.06), 0 4px 12px rgba(31, 26, 36, 0.05);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16131a;
    --surface: #211d27;
    --text: #f3eef6;
    --muted: #a69daf;
    --border: #353040;
    --accent: #fb923c;
    --accent-text: #1b120c;
    --accent-soft: #3a2619;
    --shadow: none;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: var(--accent);
}

/* Layout ------------------------------------------------------------ */

.site-header,
main,
.site-footer {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.site-header {
  padding-top: 32px;
  padding-bottom: 8px;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 8px auto 0;
  max-width: 32ch;
  color: var(--muted);
}

.section {
  margin-top: 32px;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Buttons ----------------------------------------------------------- */

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  display: block;
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: 2px solid var(--accent);
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
}

/* Calendar embed ---------------------------------------------------- */

.calendar-frame {
  position: relative;
  height: 560px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #ffffff; /* Google's embed is always light */
  box-shadow: var(--shadow);
}

.calendar-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Quarter cards ----------------------------------------------------- */

.cards {
  display: grid;
  gap: 12px;
}

.card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-date {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.card-name {
  margin: 10px 0 2px;
  font-size: 1.1rem;
  line-height: 1.3;
}

.card-city {
  margin: 0;
  color: var(--muted);
}

.card-note {
  margin: 10px 0 0;
  font-size: 0.95rem;
}

/* Year list --------------------------------------------------------- */

.date-list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.date-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 12px;
  padding: 12px 16px;
}

.date-list li + li {
  border-top: 1px solid var(--border);
}

.date-list .list-date {
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.date-list .list-city {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty {
  margin: 0;
  padding: 16px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.date-list .empty {
  border: 0;
  display: block;
}

/* Footer ------------------------------------------------------------ */

.site-footer {
  margin-top: 40px;
  padding-top: 20px;
  padding-bottom: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

/* Larger screens ---------------------------------------------------- */

@media (min-width: 640px) {
  .site-header {
    padding-top: 48px;
  }

  h1 {
    font-size: 2.25rem;
  }

  .tagline {
    max-width: none;
  }

  .actions {
    flex-direction: row;
    justify-content: center;
  }

  .calendar-frame {
    height: 0;
    padding-bottom: 75%; /* 4:3 month grid */
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .calendar-frame {
    padding-bottom: 0;
    height: 680px;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}
