:root {
  color-scheme: light;
  --ink: #251d14;
  --muted: #756858;
  --paper: #fbf6e9;
  --surface: #fffdf7;
  --line: #dfc98e;
  --blue: #075346;
  --blue-dark: #043d35;
  --blue-soft: #e5f0ea;
  --coral: #ad1c16;
  --gold: #d59c2f;
  --gold-soft: #f5e7bd;
  --shadow: 0 16px 44px rgba(55, 38, 13, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  border-top: 4px solid var(--gold);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(213, 156, 47, 0.42);
  outline-offset: 3px;
}

.site-header {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--blue-dark);
  font-family: "Cormorant Garamond", serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.015em;
  text-decoration: none;
}

.brand-logo {
  width: 48px;
  height: 48px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 4px 7px rgba(84, 48, 4, 0.16));
}

.brand-name {
  display: block;
  line-height: 1.05;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.ask-button {
  min-width: 205px;
  white-space: nowrap;
}

.button-primary {
  border: 1px solid #0a6b5a;
  background: var(--blue);
  color: #fff9e7;
  box-shadow: 0 8px 20px rgba(7, 83, 70, 0.2);
  transition: background 160ms ease, transform 160ms ease;
}

.button-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

[data-tally-link][aria-disabled="true"] {
  opacity: 0.66;
  cursor: default;
}

main {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
}

.board {
  padding: 30px 0 84px;
}

.board-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.board-toolbar h1 {
  margin: 7px 0 6px;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.05;
  color: var(--blue-dark);
  max-width: 680px;
  font-size: clamp(38px, 6vw, 56px);
  letter-spacing: -0.035em;
}

.session-name,
.session-details {
  display: block;
}

.session-details {
  margin-top: 10px;
  color: var(--coral);
  font-family: "DM Sans", sans-serif;
  font-size: clamp(15px, 2.3vw, 19px);
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1.35;
  white-space: normal;
}

.live-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(173, 28, 22, 0.12);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.event-card {
  position: relative;
  margin-bottom: 36px;
  padding: clamp(22px, 4vw, 34px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 14px 38px rgba(55, 38, 13, 0.08);
}

.event-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--gold);
}

.event-card-copy {
  max-width: 720px;
}

.event-card h2 {
  max-width: 680px;
  margin-bottom: 12px;
  color: var(--blue-dark);
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.event-card h2 strong {
  color: inherit;
}

.event-card-copy > p {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.event-card-copy > p strong {
  color: var(--ink);
}

.event-facts {
  margin: 24px 0;
  display: grid;
  grid-template-columns: 0.8fr 0.9fr 1.6fr;
  gap: 8px;
}

.event-facts div {
  padding: 13px 15px;
  border: 1px solid #eadbb2;
  border-radius: 12px;
  background: #fbf5e4;
}

.event-facts div + div {
  border-left: 1px solid #eadbb2;
}

.event-facts dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-facts dd {
  margin: 0;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 700;
}

.feed-add-question {
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 17px;
  border: 1px solid #0a6b5a;
  border-radius: 12px;
  background: var(--blue);
  color: #fff9e7;
  box-shadow: 0 6px 16px rgba(7, 83, 70, 0.17);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.feed-add-question:hover {
  background: var(--blue-dark);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(7, 83, 70, 0.22);
  transform: translateY(-1px);
}

.feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.feed-heading {
  max-width: 590px;
}

.feed-heading .live-label {
  margin-bottom: 9px;
}

.feed-toolbar h2 {
  margin: 0;
  color: var(--blue-dark);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(25px, 3.5vw, 34px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.sort-control {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.7);
}

.sort-button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.sort-button.active {
  background: var(--gold-soft);
  color: var(--blue-dark);
  box-shadow: 0 2px 8px rgba(94, 66, 13, 0.1);
}

.question-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  list-style: none;
}

.question-card {
  position: relative;
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 22px;
  align-items: start;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(62, 42, 9, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.question-card.from-app {
  border-color: var(--gold);
  background: #fffaf0;
  box-shadow: 0 8px 24px rgba(154, 101, 10, 0.1);
}

.source-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  padding: 4px 8px;
  border: 1px solid #e3c36e;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #75500d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.source-badge[hidden] {
  display: none;
}

.question-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.vote-button {
  width: 58px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f1dc;
  color: var(--blue-dark);
  font: inherit;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.vote-button:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--coral);
}

.vote-button.voted {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--coral);
}

.vote-button:disabled {
  cursor: default;
}

.vote-arrow {
  font-size: 23px;
  line-height: 1;
}

.vote-number {
  font-family: "DM Sans", sans-serif;
  font-size: 17px;
  font-weight: 800;
}

.question-text {
  margin-bottom: 16px;
  font-family: "DM Sans", sans-serif;
  font-size: clamp(17px, 2.5vw, 20px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.018em;
}

.question-text.clamped {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.question-toggle {
  margin: -7px 0 15px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--coral);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.question-toggle:hover {
  color: var(--blue-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.question-toggle[hidden] {
  display: none;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.author-avatar {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-soft);
  color: #7c2b20;
  font-size: 11px;
  font-weight: 800;
}

.status {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.52);
}

.status[hidden] {
  display: none;
}

.loader {
  width: 24px;
  height: 24px;
  margin-bottom: 12px;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 620px) {
  .site-header,
  main {
    width: min(100% - 28px, 920px);
  }

  .site-header {
    min-height: 74px;
  }

  .ask-button {
    min-width: 190px;
    padding: 0 16px;
    font-size: 14px;
  }

  .board-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .board {
    padding-top: 24px;
  }

  .event-facts {
    margin: 14px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .event-card {
    padding: 16px;
    border-radius: 16px;
  }

  .event-card h2 {
    margin-bottom: 7px;
    font-family: "DM Sans", sans-serif;
    font-size: 17px;
    line-height: 1.35;
    letter-spacing: -0.015em;
  }

  .event-card-copy > p {
    font-size: 13px;
    line-height: 1.48;
  }

  .event-facts div,
  .event-facts div + div {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 9px;
    border: 1px solid #eadbb2;
    border-radius: 9px;
  }

  .event-facts dt {
    margin: 0;
    font-size: 9px;
  }

  .event-facts dd {
    font-size: 10px;
    white-space: nowrap;
  }

  .feed-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .feed-toolbar {
    gap: 16px;
  }

  .feed-heading {
    width: 100%;
  }

  .feed-toolbar h2 {
    font-size: 24px;
    line-height: 1.12;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .feed-add-question {
    min-height: 38px;
    padding: 0 12px;
    font-size: 12px;
  }

  .sort-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .question-card {
    grid-template-columns: 52px 1fr;
    gap: 15px;
    padding: 20px 16px;
  }

  .vote-button {
    width: 50px;
    min-height: 68px;
  }

  .question-meta {
    flex-wrap: wrap;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
