/* ═══════════════════════════════════════
   Porch Light Council
   A warm light in the dark.
   ═══════════════════════════════════════ */

:root {
  --bg: #080C1A;
  --surface: #0E1225;
  --border: #181D32;
  --text: #D0C8B4;
  --text-strong: #E8E2D4;
  --muted: #6E6E56;
  --accent: #C08830;
  --glow: #E0B850;
  --warmth: rgba(192, 136, 48, 0.06);
  --serif: Georgia, 'Times New Roman', Times, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius: 6px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

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

body {
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 600px 400px at 50% 0%, var(--warmth), transparent);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

a:hover {
  color: var(--glow);
}

strong {
  color: var(--text-strong);
  font-weight: 600;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

/* ── Layout ── */

.container {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* ── Header ── */

.site-header {
  padding: 28px 0 20px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: normal;
  color: var(--glow);
  letter-spacing: 0.03em;
  text-shadow: 0 0 40px rgba(192, 136, 48, 0.15);
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-location {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-top: 2px;
}

nav {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  flex-wrap: wrap;
}

nav a {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}

nav a:hover {
  color: var(--text);
  background: var(--warmth);
}

nav a.active {
  color: var(--glow);
}

/* ── Sections ── */

section {
  margin-bottom: 40px;
}

.label,
.section-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 14px;
}

/* ── Page titles ── */

.page-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: normal;
  color: var(--text-strong);
  margin-bottom: 6px;
}

.page-intro {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 36px;
}

/* ── Home: Meetup ── */

.meetup-date {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--text-strong);
  margin-bottom: 4px;
}

.meetup-detail {
  color: var(--text);
  font-size: 0.88rem;
}

.meetup-note {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 10px;
  font-style: italic;
}

/* ── Topic lists ── */

.topic-list {
  list-style: none;
  padding: 0;
}

.topic-list li {
  padding: 5px 0 5px 18px;
  position: relative;
  font-size: 0.9rem;
}

.topic-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

/* ── Takeaway / Blockquote ── */

.takeaway {
  font-family: var(--serif);
  font-style: italic;
  color: var(--glow);
  font-size: 1rem;
  margin-top: 20px;
  padding-left: 18px;
  border-left: 2px solid rgba(192, 136, 48, 0.25);
  line-height: 1.6;
}

blockquote {
  font-family: var(--serif);
  font-style: italic;
  color: var(--glow);
  font-size: 0.95rem;
  margin: 24px 0;
  padding-left: 18px;
  border-left: 2px solid rgba(192, 136, 48, 0.25);
  line-height: 1.6;
}

/* ── Reading ── */

.reading-title {
  font-family: var(--serif);
  color: var(--text-strong);
  font-size: 1rem;
  margin-bottom: 6px;
}

.reading-prompt {
  color: var(--muted);
  font-size: 0.88rem;
}

/* ── Forms ── */

.form-group {
  margin-bottom: 16px;
}

.passphrase-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 16px;
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.3s var(--ease);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

input[type="password"] {
  font-family: monospace;
  letter-spacing: 0.12em;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7) sepia(0.3);
}

select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236E6E56' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

.char-count {
  text-align: right;
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 4px;
}

.char-count.over {
  color: #B06060;
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  padding: 13px 24px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  min-height: 48px;
  transition: opacity 0.3s var(--ease), background 0.3s var(--ease);
  -webkit-appearance: none;
}

.btn:hover {
  background: var(--glow);
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn:disabled:hover {
  background: var(--accent);
}

.btn-small {
  width: auto;
  padding: 6px 14px;
  font-size: 0.7rem;
  min-height: 32px;
}

/* ── Filter pills ── */

.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-pill {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 0.68rem;
  font-family: var(--sans);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.filter-pill:hover {
  color: var(--text);
}

.filter-pill.active {
  color: var(--glow);
  border-color: var(--border);
}

/* ── Messages ── */

.message-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

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

.message-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.message-type {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.message-type.win { color: #7BAF7B; }
.message-type.struggle { color: #C08080; }
.message-type.ask { color: #8098B8; }
.message-type.offer { color: #B89868; }
.message-type.reading { color: #A088A8; }

.message-ts {
  font-size: 0.65rem;
  color: var(--muted);
}

.message-body {
  font-size: 0.9rem;
  line-height: 1.6;
}

.message-id {
  font-size: 0.58rem;
  color: var(--border);
  margin-top: 8px;
  font-family: monospace;
  word-break: break-all;
}

/* ── Compose ── */

.compose-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.compose-form {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── Covenant gate ── */

.covenant-gate {
  margin-bottom: 20px;
}

.covenant-check {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.covenant-check:last-child {
  border-bottom: none;
}

.covenant-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.covenant-check span {
  font-family: var(--serif);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}

.covenant-check input:checked + span {
  color: var(--glow);
}

/* ── Lantern receipt ── */

.lantern-receipt {
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-top: 20px;
  text-align: center;
  background: var(--surface);
}

.lantern-receipt h3 {
  font-family: var(--serif);
  color: var(--glow);
  font-size: 0.9rem;
  font-weight: normal;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.receipt-id {
  font-family: monospace;
  font-size: 0.68rem;
  color: var(--text);
  background: var(--bg);
  padding: 10px 12px;
  border-radius: var(--radius);
  margin: 10px 0;
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.receipt-detail {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 4px 0;
}

/* ── Ledger ── */

.ledger-entry {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.ledger-entry:last-child {
  border-bottom: none;
}

.ledger-date {
  font-family: var(--serif);
  color: var(--accent);
  font-size: 0.88rem;
  margin-bottom: 10px;
}

.ledger-topics {
  list-style: none;
  padding: 0;
}

.ledger-topics li {
  padding: 3px 0 3px 18px;
  position: relative;
  font-size: 0.88rem;
}

.ledger-topics li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.ledger-takeaway {
  font-family: var(--serif);
  font-style: italic;
  color: var(--glow);
  font-size: 0.9rem;
  margin-top: 14px;
}

.ledger-actions {
  list-style: none;
  padding: 0;
  margin-top: 10px;
}

.ledger-actions li {
  padding: 2px 0 2px 18px;
  position: relative;
  font-size: 0.82rem;
  color: var(--muted);
}

.ledger-actions li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
}

/* ── Covenant page ── */

.covenant-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 8px;
}

.covenant-columns h3 {
  font-family: var(--serif);
  font-weight: normal;
  color: var(--glow);
  font-size: 1rem;
  margin-bottom: 10px;
}

.covenant-columns ul {
  list-style: none;
  padding: 0;
}

.covenant-columns li {
  padding: 4px 0 4px 20px;
  position: relative;
  font-size: 0.9rem;
}

.covenant-columns li::before {
  content: '\2014';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.85rem;
}

.prose {
  margin-bottom: 8px;
}

.prose h3 {
  font-family: var(--serif);
  font-weight: normal;
  color: var(--text-strong);
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.prose p {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 10px;
}

.prose p.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.prose ul,
.prose ol {
  list-style: none;
  padding: 0;
  margin: 14px 0;
}

.prose li {
  padding: 5px 0 5px 18px;
  position: relative;
  font-size: 0.9rem;
  line-height: 1.6;
}

.prose ul li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.covenant-affirmations {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.covenant-affirmations li {
  font-family: var(--serif);
  font-style: italic;
  color: var(--glow);
  padding: 6px 0;
  font-size: 0.95rem;
}

.type-win { color: #7BAF7B; }
.type-struggle { color: #C08080; }
.type-ask { color: #8098B8; }
.type-offer { color: #B89868; }
.type-reading { color: #A088A8; }

/* ── Footer ── */

.site-footer {
  padding: 32px 0;
  margin-top: 48px;
  text-align: center;
}

.site-footer p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ── States ── */

.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-style: italic;
  font-size: 0.85rem;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
}

.hidden {
  display: none;
}

.pow-status {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}

.pow-status.working {
  color: var(--glow);
}

/* ── Desktop ── */

@media (min-width: 640px) {
  body {
    font-size: 16px;
  }

  .container {
    padding: 0 24px;
  }

  .site-header {
    padding: 40px 0 24px;
    margin-bottom: 40px;
  }

  .site-title {
    font-size: 1.5rem;
  }

  section {
    margin-bottom: 48px;
  }

  hr {
    margin: 44px 0;
  }

  .btn {
    width: auto;
    min-width: 200px;
  }

  .covenant-columns {
    grid-template-columns: 1fr 1fr;
  }
}
