:root {
  --bg: #faf7f2;
  --ink: #1a2942;
  --ink-soft: #4a5872;
  --accent: #c8704a;
  --accent-soft: #e8b89f;
  --gold: #b08847;
  --card: #ffffff;
  --card-shadow: 0 2px 10px rgba(26, 41, 66, 0.08);
  --card-shadow-hover: 0 6px 20px rgba(26, 41, 66, 0.14);
  --radius: 14px;
  --max-width: 960px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Header */
.site-header {
  text-align: center;
  padding: 2.5rem 1.25rem 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.site-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2.4rem, 9vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.subtitle {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.05rem, 4vw, 1.4rem);
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.dates {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* Carousel */
.carousel {
  position: relative;
  max-width: var(--max-width);
  margin: 1rem auto 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: #2a2a2a;
  aspect-ratio: 4 / 3;
}

@media (min-width: 700px) {
  .carousel {
    aspect-ratio: 16 / 9;
  }
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
  background-size: cover;
  background-position: center;
  background-color: #2a2a2a;
}

.carousel-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.carousel-caption {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  color: #fff;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  z-index: 1;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.carousel-btn:hover,
.carousel-btn:active {
  background: #fff;
}

.carousel-prev { left: 0.75rem; }
.carousel-next { right: 0.75rem; }

@media (max-width: 480px) {
  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }
}

.carousel-dots {
  position: absolute;
  bottom: 0.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 1;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.carousel-dot.active {
  background: #fff;
  transform: scale(1.25);
}

/* Calendar */
.calendar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.calendar h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
}

.day-card {
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 3px solid var(--accent-soft);
  -webkit-tap-highlight-color: transparent;
}

.day-card:hover,
.day-card:active {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-left-color: var(--accent);
}

.day-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.day-card-dow {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.day-card-date {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.day-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  line-height: 1.15;
}

.day-card-summary {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.day-card-location {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
}

/* Day page */
.day-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  -webkit-tap-highlight-color: transparent;
}

.back-link:hover { text-decoration: underline; }

.day-header {
  text-align: center;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(26, 41, 66, 0.1);
}

.day-header .eyebrow {
  margin-bottom: 0.35rem;
}

.day-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.day-header .date-full {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.location-tag {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: var(--accent-soft);
  color: var(--ink);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.agenda {
  margin-top: 1.5rem;
}

.agenda-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(26, 41, 66, 0.07);
}

.agenda-item:last-child { border-bottom: none; }

.agenda-time {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  padding-top: 0.15rem;
}

.agenda-body h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.agenda-body p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

@media (max-width: 500px) {
  .agenda-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

.info-block {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.25rem 0;
  box-shadow: var(--card-shadow);
}

.info-block h4 {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.info-block p, .info-block li {
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.5;
}

.info-block ul {
  list-style: none;
  padding: 0;
}

.info-block li + li { margin-top: 0.3rem; }

.info-block strong {
  color: var(--ink);
  font-weight: 600;
}

.day-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(26, 41, 66, 0.1);
}

.day-nav a {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--card);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.85rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.day-nav a:hover { transform: translateY(-1px); box-shadow: var(--card-shadow-hover); }
.day-nav a.next { text-align: right; }
.day-nav a small {
  display: block;
  color: var(--gold);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.day-nav a.placeholder {
  visibility: hidden;
}

/* ============================================================
   Chat section (bottom of each page)
   ============================================================ */
.chat-section {
  max-width: var(--max-width);
  margin: 1rem auto 3rem;
  padding: 0 1.25rem;
}

.day-page + .chat-section,
.chat-section.day-scoped {
  max-width: 720px;
}

.chat-section-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.chat-section-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.chat-section-header p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 520px;
  margin: 0 auto;
}

.chat-section-header em {
  font-style: italic;
  color: var(--accent);
}

.chat-messages {
  min-height: 80px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.chat-messages:empty {
  display: none;
}

.chat-bubble {
  max-width: 80%;
  padding: 0.7rem 0.95rem;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.chat-bubble-user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-bubble-assistant {
  background: #fff;
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: var(--card-shadow);
}

.chat-bubble-thinking {
  font-style: italic;
  color: var(--ink-soft);
}

.chat-bubble-error {
  background: #fee;
  color: #a33;
}

.chat-input-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  background: #fff;
  border: 1px solid rgba(26, 41, 66, 0.12);
  border-radius: 14px;
  padding: 0.5rem;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(200, 112, 74, 0.15);
}

.chat-input {
  flex: 1;
  padding: 0.55rem 0.7rem;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  resize: none;
  outline: none;
  line-height: 1.45;
  max-height: 140px;
  background: transparent;
  color: var(--ink);
}

.chat-input:disabled { opacity: 0.5; }

.chat-send {
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.chat-send:hover { background: #b85e3a; }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 500px) {
  .chat-section { padding: 0 1rem; }
  .chat-bubble { max-width: 88%; font-size: 0.92rem; }
  .chat-send { padding: 0.55rem 0.85rem; }
}
