:root {
  --bg-cream: #ffffff;
  --bg-dark:  #1a0e0a;
  --accent:   #6d2a1a;
  --ink:      #1a1a1a;
  --ink-soft: #6b6b6b;
  --paper:    #ffffff;
  --line:     rgba(0, 0, 0, 0.12);
  --line-soft:rgba(0, 0, 0, 0.07);
  --hover:    rgba(0, 0, 0, 0.045);
  --secondary:#f1ece6;
  --danger:   #b3261e;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Satoshi', 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-cream);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- TOP NAV (logo + back arrow) ---------- */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;   /* logo centered at the top */
  padding: 1.25rem 2rem;
  background: var(--bg-cream);
  border-bottom: 1px solid var(--line-soft);
  z-index: 100;
}
.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 38px; width: auto; display: block; }
.nav-back {
  position: absolute;        /* back arrow pinned top-left */
  top: 1.25rem;
  left: 2rem;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-back:hover { opacity: 1; transform: translateX(-3px); }
.nav-back svg { width: 24px; height: 24px; display: block; }

/* ---------- PAGE HEADER ---------- */
.contact-header {
  padding: 6.5rem 2rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.contact-title {
  margin: 0;
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}
.contact-eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.contact-sub {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  max-width: 44ch;
}

/* ---------- CALENDAR SHELL ---------- */
.calendar-wrap {
  width: min(1180px, 94vw);
  margin: 1.75rem auto 4rem;
}
.cal { display: flex; flex-direction: column; gap: 1rem; }

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.85rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-outline { border-color: var(--line); background: var(--paper); }
.btn-outline:hover { background: var(--hover); }
.btn-ghost:hover { background: var(--hover); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #5a2215; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm { height: 32px; font-size: 0.78rem; padding: 0 0.7rem; }
.btn.is-active { background: var(--secondary); }
.btn-danger { color: var(--danger); border-color: rgba(179,38,30,0.4); background: var(--paper); }
.btn-danger:hover { background: rgba(179,38,30,0.08); }

/* ---- header row ---- */
.cal-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cal-head-left { display: flex; flex-direction: column; gap: 0.75rem; }
.cal-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: capitalize;
}
.cal-nav { display: flex; align-items: center; gap: 0.5rem; }
.cal-head-right { display: flex; flex-direction: column; gap: 0.6rem; }
.cal-views {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.cal-view-select { display: none; }

@media (min-width: 720px) {
  .cal-head { flex-direction: row; align-items: center; justify-content: space-between; }
  .cal-head-left { flex-direction: row; align-items: center; gap: 1rem; }
  .cal-head-right { flex-direction: row; align-items: center; }
}

/* ---- filters ---- */
.cal-filters { display: flex; flex-direction: column; gap: 0.6rem; }
.cal-search { position: relative; }
.cal-search .ic-search {
  position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ink-soft); pointer-events: none;
}
.inp, .txt, .sel {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 0.8rem;
  height: 38px;
}
.inp:focus, .txt:focus, .sel:focus { outline: none; border-color: var(--accent); }
.cal-search .inp { padding-left: 2.1rem; padding-right: 2.1rem; }
.cal-search .clear {
  position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px;
}
.txt { height: auto; padding: 0.55rem 0.8rem; resize: vertical; min-height: 72px; line-height: 1.4; }
.sel { appearance: none; cursor: pointer; }

.cal-filter-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* dropdown filters via <details> */
.dd { position: relative; }
.dd > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 32px;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 0.78rem;
  cursor: pointer;
  user-select: none;
}
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary:hover { background: var(--hover); }
.dd > summary svg { width: 15px; height: 15px; }
.dd-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  padding: 0.4rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,0.35);
}
.dd-menu .dd-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.35rem 0.5rem;
}
.dd-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
}
.dd-item:hover { background: var(--hover); }
.dd-item input { accent-color: var(--accent); width: 15px; height: 15px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--secondary);
  font-size: 0.66rem;
  font-weight: 600;
}

/* active filter chips */
.cal-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.cal-chips .lbl { font-size: 0.78rem; color: var(--ink-soft); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--secondary);
  font-size: 0.72rem;
}
.chip .dot { width: 8px; height: 8px; border-radius: 999px; }
.chip button { background: none; border: 0; cursor: pointer; color: var(--ink-soft); display: inline-flex; padding: 0; }
.chip button:hover { color: var(--ink); }
.chip svg, .clear-x svg { width: 13px; height: 13px; }

/* ---------- LEGEND / GOOGLE AGENDA STATUS ---------- */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin: 0.1rem 0 0.2rem;
  font-size: 0.78rem;
}
.cal-legend:empty { display: none; }
.legend-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.legend-note { color: var(--ink-soft); }
.legend-note strong { color: var(--ink); font-weight: 600; }
.legend-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: legend-pulse 2s infinite;
}
.legend-status.is-live { color: var(--ink); }
.legend-status.is-loading { color: var(--ink-soft); }
.legend-status.is-error { color: var(--danger); }
.legend-status.is-demo { color: var(--ink-soft); font-style: italic; }
@keyframes legend-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@media (prefers-reduced-motion: reduce) { .legend-dot { animation: none; } }

/* read-only event details (Google Agenda) */
.dlg-title .dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; margin-right: 0.45rem; vertical-align: middle; }
.ro-row { display: flex; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line-soft); }
.ro-row:last-of-type { border-bottom: 0; }
.ro-key { flex: 0 0 84px; color: var(--ink-soft); font-size: 0.8rem; }
.ro-val { color: var(--ink); font-size: 0.9rem; }

/* ---------- VIEWS ---------- */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

/* Month */
.month-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
}
.month-dow > div {
  padding: 0.5rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  border-right: 1px solid var(--line-soft);
}
.month-dow > div:last-child { border-right: 0; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.day-cell {
  min-height: 92px;
  padding: 0.4rem;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.15s ease;
}
.day-cell:nth-child(7n) { border-right: 0; }
.day-cell.is-out { background: rgba(0,0,0,0.02); }
.day-cell.drop-on { background: rgba(109,42,26,0.08); }
.day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 999px;
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}
.day-num.is-today { background: var(--accent); color: #fff; font-weight: 700; }
.day-events { display: flex; flex-direction: column; gap: 3px; }
.more { font-size: 0.66rem; color: var(--ink-soft); padding-left: 2px; }

/* event chips */
.evt {
  font-size: 0.7rem;
  font-weight: 500;
  color: #fff;
  border-radius: 5px;
  padding: 2px 6px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.evt:hover { transform: translateY(-1px) scale(1.01); box-shadow: 0 6px 16px -6px rgba(0,0,0,0.5); }
.evt--bar { padding: 4px 7px; border-radius: 6px; }
.evt--detailed { padding: 0.6rem 0.75rem; border-radius: 8px; white-space: normal; }
.evt--detailed .evt-time { font-size: 0.7rem; opacity: 0.85; margin-top: 0.2rem; display: flex; align-items: center; gap: 0.3rem; }
.evt--detailed svg { width: 13px; height: 13px; }

/* Week + Day (time grids) */
.timegrid { max-height: 70vh; overflow: auto; }
.week-grid { display: grid; grid-template-columns: 56px repeat(7, 1fr); }
.week-head { display: grid; grid-template-columns: 56px repeat(7, 1fr); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.week-head > div { padding: 0.4rem; text-align: center; font-size: 0.72rem; border-right: 1px solid var(--line-soft); }
.week-head > div:last-child { border-right: 0; }
.week-head .wd-sub { font-size: 0.62rem; color: var(--ink-soft); }
.tcell {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 2px;
  min-height: 48px;
}
.tcell.timecol { font-size: 0.62rem; color: var(--ink-soft); padding: 4px; text-align: right; }
.week-grid .tcell:nth-child(8n) { border-right: 0; }
.tcell.drop-on { background: rgba(109,42,26,0.08); }
.tcell .day-events { gap: 2px; }

/* Day view */
.day-row { display: grid; grid-template-columns: 72px 1fr; border-bottom: 1px solid var(--line-soft); }
.day-row:last-child { border-bottom: 0; }
.day-hour { padding: 0.6rem; font-size: 0.72rem; color: var(--ink-soft); border-right: 1px solid var(--line-soft); }
.day-slot { min-height: 64px; padding: 0.4rem; display: flex; flex-direction: column; gap: 0.4rem; }
.day-slot.drop-on { background: rgba(109,42,26,0.08); }

/* timed events laid over the hour grid (top / height = start / duration) */
.tg-body { position: relative; }
.tcell { height: 48px; min-height: 0; box-sizing: border-box; }
.day-row { height: 64px; box-sizing: border-box; }
.day-row:last-child { border-bottom: 1px solid var(--line-soft); }
.day-slot { min-height: 0; }
.tg-layer { position: absolute; top: 0; bottom: 0; right: 0; pointer-events: none; }
.tg-layer--day { left: 72px; }
.tg-layer--week { left: 56px; display: grid; grid-template-columns: repeat(7, 1fr); }
.tg-col { position: relative; height: 100%; }
.evt--timed {
  position: absolute;
  box-sizing: border-box;
  pointer-events: auto;
  overflow: hidden;
  min-height: 18px;
  border: 1px solid rgba(255,255,255,0.18);
}
.evt--timed .evt-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evt--timed:hover { transform: none; filter: brightness(1.08); }
.evt--compact { padding: 3px 5px; border-radius: 6px; font-size: 0.66rem; }
.evt--compact .evt-time { font-size: 0.6rem; }
.week-allday { display: grid; grid-template-columns: 56px repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.week-allday .tcell { height: auto; min-height: 32px; }
.day-row--allday { height: auto; min-height: 44px; }
.day-row--allday .day-slot { padding: 0.4rem; }

/* List view */
.list { padding: 0.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.list-group-title { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); padding: 0.4rem 0.5rem; position: sticky; top: 0; background: var(--paper); }
.list-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.list-item:hover { background: var(--hover); border-color: var(--line-soft); }
.list-bar { width: 4px; align-self: stretch; border-radius: 999px; flex-shrink: 0; }
.list-main { flex: 1; min-width: 0; }
.list-main h4 { margin: 0 0 0.15rem; font-size: 0.92rem; }
.list-meta { font-size: 0.74rem; color: var(--ink-soft); display: flex; gap: 0.6rem; flex-wrap: wrap; }
.list-tags { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.tag-pill { font-size: 0.66rem; padding: 0.1rem 0.45rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); }

.empty { padding: 3rem 1rem; text-align: center; color: var(--ink-soft); font-size: 0.9rem; }

/* ---------- DIALOG ---------- */
.dlg {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(12, 8, 6, 0.5);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.dlg.open { opacity: 1; visibility: visible; }
.dlg-card {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.4);
}
.dlg-head { margin-bottom: 1.1rem; }
.dlg-title { margin: 0 0 0.25rem; font-size: 1.15rem; font-weight: 700; }
.dlg-desc { margin: 0; font-size: 0.82rem; color: var(--ink-soft); }
.dlg-body { display: flex; flex-direction: column; gap: 0.9rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field > label { font-size: 0.78rem; font-weight: 600; }
.dlg-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  font-size: 0.74rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tag:hover { transform: scale(1.05); }
.tag.is-on { background: var(--accent); color: #fff; border-color: var(--accent); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.3rem; flex-wrap: wrap; }
.dlg-note { font-size: 0.72rem; color: var(--ink-soft); margin: 0.2rem 0 0; }
.req { color: var(--danger); }

/* ---------- FOOTER ---------- */
.page-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 2.75rem 1.5rem;
  background: var(--bg-cream);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.footer-social { display: flex; gap: 1.6rem; }
.footer-social a { display: inline-flex; color: var(--ink); opacity: 0.55; transition: opacity 0.25s ease, transform 0.25s ease; }
.footer-social a:hover { opacity: 1; transform: translateY(-2px); }
.footer-social svg { width: 20px; height: 20px; display: block; }
.footer-copy { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 760px) {
  /* logo centered, back arrow top-left (matches the gallery pages) */
  .top-nav {
    left: 0; right: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.9rem 1.25rem;
  }
  .nav-logo img { height: 32px; }
  .nav-back { position: absolute; top: 0.9rem; left: 1.25rem; }

  .contact-header { padding: 5rem 1.25rem 0.25rem; }

  .cal-views { display: none; }
  .cal-view-select { display: block; }

  .cal-filter-row { flex-wrap: wrap; }

  .day-cell { min-height: 64px; padding: 0.25rem; }
  .evt { font-size: 0.6rem; }
  .day-num { width: 20px; height: 20px; font-size: 0.7rem; }
  .timegrid { max-height: 65vh; }
  .dlg-card { padding: 1.15rem; }
}
