@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --ink: #1a1a1a;
  --muted: #595959;
  --rule: #d9d9d9;
  --blue: #2340ff;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.6;
}

a { color: var(--ink); }
a:hover { color: var(--blue); }

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand img { display: block; }
.brand span {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.header-link { font-size: 16px; }

section { display: flex; flex-direction: column; gap: 16px; }

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h2 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.3; }
p { margin: 0; }

.label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

form { display: flex; flex-direction: column; gap: 8px; }
form label { font-size: 15px; font-weight: 600; }
.field-row { display: flex; gap: 8px; flex-wrap: wrap; }
.field-row input { flex: 1 1 240px; width: auto; }
[hidden] { display: none !important; }
input[type="email"],
input[type="text"],
input[type="url"],
input[type="date"],
input[type="time"] {
  flex: none;
  min-width: 0;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--ink);
  border-radius: 0;
  font: inherit;
  font-size: 17px;
  background: #fff;
  color: var(--ink);
}
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
button {
  height: 48px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: default; }
.hint { font-size: 15px; color: var(--muted); }
.status { font-size: 16px; font-weight: 600; }
.status:empty { display: none; }
.status.error { color: #b00020; }

/* Honeypot: hidden from people, visible to naive bots */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.list { border-top: 1px solid var(--ink); }
.list p { padding: 14px 0; border-bottom: 1px solid var(--rule); }

.site-footer {
  border-top: 1px solid var(--ink);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 15px;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }

.prose { display: flex; flex-direction: column; gap: 16px; }
.prose h2 { margin-top: 16px; }
.prose ul { margin: 0; padding-left: 22px; }

/* ---- Accounts ---- */
.page.narrow { max-width: 520px; gap: 32px; }
.muted { color: #3d3d3d; }
button.block { width: 100%; margin-top: 8px; }
.code-input {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 28px !important;
  letter-spacing: 0.4em;
  text-align: center;
}
.header-nav { display: flex; gap: 20px; font-size: 16px; }

.link-button {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}
.link-button.danger { color: #b00020; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.on.dark { background: var(--ink); border-color: var(--ink); }
.chips.small { gap: 8px; }
.chips.small .chip { height: 36px; padding: 0 14px; font-size: 14px; border-color: #c4c4c4; }
.chips.small .chip.on { border-color: var(--blue); }
.chips.small .chip.on.dark { border-color: var(--ink); }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--rule); }
.tab {
  height: auto;
  padding: 10px 0;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
}
.tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }

.event-list { border-top: 1px solid var(--ink); display: flex; flex-direction: column; }
.event { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: flex-start; }
.event-time { flex: 0 0 72px; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 15px; padding-top: 2px; }
.event-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.event-title { font-weight: 600; }
.event-where { font-size: 15px; color: var(--muted); }
.event-tags { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; color: var(--blue); }
.empty { padding: 16px 0; color: var(--muted); }
.day-label { margin: 18px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.event-about { font-size: 15px; color: var(--ink); }
.event-about.is-auto { color: var(--muted); font-style: italic; }
.event-links { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; margin-top: 2px; }
.event-links a { color: var(--blue, #2340ff); }
.perk-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0; }
.food-badge { align-self: flex-start; background: var(--lime, #e4ff3a); color: #0f1020; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; margin: 2px 0; }
.check-row { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 6px 0; }
.check-row input { width: 20px; height: 20px; flex: none; margin: 0; }
.routine-label { margin: 22px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--rule); opacity: .7; }

.settings-block { border-top: 1px solid var(--rule); padding-top: 18px; gap: 12px; align-items: flex-start; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; }
.switch {
  flex: 0 0 auto;
  width: 52px;
  height: 30px;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: #8c8c8c;
  display: flex;
  justify-content: flex-start;
}
.switch span { width: 24px; height: 24px; border-radius: 50%; background: #fff; display: block; }
.switch[aria-checked="true"] { background: var(--blue); justify-content: flex-end; }
.segmented { display: flex; gap: 8px; width: 100%; }
.segmented button {
  flex: 1 1 0;
  height: 44px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  border: 1px solid #c4c4c4;
  font-size: 15px;
  font-weight: 500;
}
.segmented button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.admin-form { gap: 10px; }
.admin-form label, .field-label { font-size: 15px; font-weight: 600; margin-top: 6px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.two-col > div { display: flex; flex-direction: column; gap: 6px; }
.event .link-button { font-size: 14px; }

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 22px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  align-self: flex-start;
}
.cta:hover { color: #fff; background: #333; }
.cta.secondary-cta { background: #fff; color: var(--ink); border: 1px solid var(--ink); }
.cta.secondary-cta:hover { background: #f2f2f2; color: var(--ink); }

/* Admin review */
.day-nav { display: flex; align-items: center; gap: 16px; }
.day-nav input { flex: 0 1 200px; }
.event-actions { display: flex; gap: 16px; margin-top: 6px; }
.event.is-hidden { opacity: 0.45; }
.import-row { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
button.secondary { background: #fff; color: var(--ink); align-self: flex-start; }
.featured-mark { color: var(--blue); }
.footer-links { display: flex; gap: 16px; }
.topic-groups { display: flex; flex-direction: column; gap: 10px; }
.group-label { margin: 8px 0 0; }

/* Story maker */
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.story-grid img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); }
.pick-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.pick-row input { width: 22px; height: 22px; margin-top: 3px; flex: none; }
.pick-row label { font-weight: 400; font-size: 16px; margin: 0; }
.digest-box { border: 1px solid var(--ink); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.digest-box .event-actions { gap: 8px; flex-wrap: wrap; }
.digest-box button { height: 44px; }
