/* ================================================================
   THE STREET — a public place for opinion
   A dusk street: frontages glow with warm light as the street holds
   them up; the pile rests in shadow. Resonance is felt, never counted.
   ================================================================ */

:root {
  --night-1: #0a0e1c;
  --night-2: #121a33;
  --night-3: #1a2444;
  --paper:   #161d33;
  --paper-2: #1c2542;
  --ink:     #eef1fb;
  --muted:   #9aa5c6;
  --faint:   #6b76a0;
  --line:    rgba(255,255,255,0.08);
  --line-2:  rgba(255,255,255,0.13);
  --amber:   #ffb455;
  --amber-2: #ffce8a;
  --gold:    #ffd77a;
  --lift:    #ffbf66;         /* the colour of being held up */
  --cool:    #7fb0ff;
  --radius:  16px;
  --shadow:  0 14px 40px rgba(0,0,0,0.45);
  --maxw:    920px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(90,120,220,0.14), transparent 60%),
    radial-gradient(900px 500px at 85% 8%, rgba(255,180,90,0.07), transparent 55%),
    linear-gradient(180deg, var(--night-2) 0%, var(--night-1) 60%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* a faint row of rooftops along the very top */
.skyline {
  position: fixed; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--amber), transparent 30%, transparent 70%, var(--cool));
  opacity: 0.5; z-index: 60;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--amber-2); }

/* ── nav ─────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(10,14,28,0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  font-weight: 800; font-size: 1.15rem; letter-spacing: 0.2px;
  color: var(--ink); display: flex; align-items: center; gap: 8px;
}
.nav-brand .lamp { color: var(--amber); text-shadow: 0 0 14px var(--amber); }
.nav-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-links a { padding: 7px 13px; border-radius: 999px; font-size: 0.92rem; font-weight: 600; }
.nav-mint  { color: var(--night-1) !important; background: linear-gradient(180deg, var(--amber-2), var(--amber)); box-shadow: 0 6px 18px rgba(255,180,85,0.25); }
.nav-mint:hover { filter: brightness(1.05); }
.nav-user  { color: var(--ink); border: 1px solid var(--line-2); }
.nav-login { color: var(--night-1) !important; background: var(--ink); }
.nav-logout, .nav-user:hover { color: var(--muted); }

/* ── layout ──────────────────────────────────────────────────── */
.main { max-width: var(--maxw); margin: 0 auto; padding: 30px 20px 10px; }
.footer { max-width: var(--maxw); margin: 40px auto 0; padding: 30px 20px 60px; border-top: 1px solid var(--line); }
.creed { color: var(--muted); font-size: 0.98rem; max-width: 640px; }
.creed em { color: var(--gold); font-style: normal; }
.footer-sub { color: var(--faint); font-size: 0.82rem; margin-top: 12px; }

.hero { padding: 26px 0 10px; }
.hero h1 { font-size: 2.2rem; line-height: 1.1; margin: 0 0 10px; letter-spacing: -0.5px; }
.hero .sub { color: var(--muted); font-size: 1.08rem; max-width: 620px; }
.hero .glow-word { color: var(--amber); text-shadow: 0 0 22px rgba(255,180,85,0.5); }

.section { margin: 34px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.section-title { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 2px; color: var(--faint); margin: 0; font-weight: 700; }
.section-note { color: var(--faint); font-size: 0.82rem; }

.flash {
  margin: 18px 0; padding: 12px 16px; border-radius: 12px;
  background: rgba(255,180,85,0.10); border: 1px solid rgba(255,180,85,0.30);
  color: var(--amber-2); font-size: 0.95rem;
}

/* ── moments (doorways) ──────────────────────────────────────── */
.doorways { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.doorway {
  position: relative; display: block; padding: 18px 18px 16px;
  border-radius: var(--radius); background: var(--paper);
  border: 1px solid var(--line); overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.doorway:hover { transform: translateY(-2px); border-color: var(--line-2); }
/* the light spilling from the doorway — intensity = how alive the moment is */
.doorway::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--amber-2), var(--amber));
  opacity: calc(var(--g) / 100);
  box-shadow: 0 0 18px rgba(255,180,85,0.6);
}
.doorway .to { font-size: 0.78rem; color: var(--amber); font-weight: 700; letter-spacing: 0.3px; }
.doorway .title { color: var(--ink); font-weight: 700; font-size: 1.06rem; margin: 6px 0 8px; line-height: 1.3; }
.doorway .meta { color: var(--faint); font-size: 0.78rem; }

/* ── frontages (walls) ───────────────────────────────────────── */
.frontages { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.frontage-card {
  position: relative; padding: 20px 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
  border: 1px solid var(--line); overflow: hidden;
}
/* the warm window-light of a wall the street is standing at */
.frontage-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120px 90px at 78% 22%, rgba(255,185,95,0.55), transparent 70%);
  opacity: calc(var(--g) / 100); pointer-events: none;
}
.frontage-card .handle { position: relative; color: var(--muted); font-size: 0.8rem; }
.frontage-card .name { position: relative; font-weight: 800; font-size: 1.2rem; color: var(--ink); margin-top: 4px; }
.frontage-card .stand { position: relative; margin-top: 10px; font-size: 0.8rem; color: var(--amber); }

/* ── the take box ────────────────────────────────────────────── */
.takebox {
  margin: 22px 0; padding: 20px; border-radius: var(--radius);
  background: var(--paper); border: 1px solid var(--line-2);
}
.takebox h3 { margin: 0 0 4px; font-size: 1.05rem; }
.takebox .addr { color: var(--faint); font-size: 0.85rem; margin-bottom: 12px; }
.takebox .addr b { color: var(--amber); font-weight: 700; }
textarea, input[type=text], input[type=email], input[type=datetime-local] {
  width: 100%; background: var(--night-1); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px;
  font-family: inherit; font-size: 1rem; line-height: 1.55; resize: vertical;
}
textarea:focus, input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,180,85,0.15); }
label { display: block; font-size: 0.82rem; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
.hint { color: var(--faint); font-size: 0.8rem; margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: none; border-radius: 999px; padding: 11px 22px; font-size: 0.98rem;
  font-weight: 700; font-family: inherit;
  color: var(--night-1); background: linear-gradient(180deg, var(--amber-2), var(--amber));
  box-shadow: 0 8px 22px rgba(255,180,85,0.28);
}
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); box-shadow: none; }
.btn-row { margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── takes ───────────────────────────────────────────────────── */
.wall { display: flex; flex-direction: column; gap: 14px; }
.take {
  position: relative; padding: 18px 18px 16px 22px; border-radius: 14px;
  background: var(--paper); border: 1px solid var(--line); overflow: hidden;
}
/* the light a take carries = how much of the street holds it up.
   Driven by the band class, not a number — spoken is a whisper of light,
   a wave is the whole window ablaze. */
.take::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--lift); opacity: 0.12;
  box-shadow: 0 0 16px rgba(255,190,100,0.7);
}
.take.band-held::before     { opacity: 0.50; }
.take.band-standing::before { opacity: 0.72; }
.take.band-resonant::before { opacity: 0.92; }
.take.band-wave::before     { opacity: 1.00; }
.take.facade { background: linear-gradient(100deg, rgba(255,185,95,0.06), var(--paper) 40%); border-color: rgba(255,185,95,0.18); }
.take .byline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.take .who { font-weight: 700; color: var(--ink); }
.take .band { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1.2px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.band-held    { color: #ffdca6 !important; border-color: rgba(255,190,100,0.35) !important; }
.band-standing{ color: #ffca82 !important; border-color: rgba(255,190,100,0.5) !important; }
.band-resonant{ color: var(--amber) !important; border-color: rgba(255,180,85,0.7) !important; text-shadow: 0 0 12px rgba(255,180,85,0.5); }
.band-wave    { color: #fff !important; background: linear-gradient(90deg, var(--amber), var(--amber-2)); border-color: transparent !important; color: var(--night-1) !important; text-shadow: none; }
.take .body { color: var(--ink); font-size: 1.05rem; line-height: 1.55; white-space: pre-wrap; }
.take .foot { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.take .stamp { color: var(--faint); font-size: 0.78rem; }
.take .stamp a { color: var(--faint); text-decoration: underline; text-underline-offset: 2px; }
.take .mine-tag { color: var(--faint); font-size: 0.8rem; font-style: italic; }

/* who holds you up — thin threads of other people's light */
.threads { margin-top: 10px; font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.threads .lbl { color: var(--faint); }
.threads .face { color: var(--amber-2); font-weight: 600; }
.threads .more { color: var(--faint); font-style: italic; }

.hold-form { display: inline; }
.hold-btn {
  cursor: pointer; border: 1px solid rgba(255,190,100,0.4); background: rgba(255,185,95,0.08);
  color: var(--amber-2); border-radius: 999px; padding: 7px 15px; font-size: 0.86rem; font-weight: 700; font-family: inherit;
}
.hold-btn:hover { background: rgba(255,185,95,0.18); }
.held-tag { color: var(--amber); font-size: 0.84rem; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }

/* ── Earned Orbit (Layer 3) — the gate, rendered as mercy ─────── */
/* The mercy panel: shown to a voice that hasn't reached the street yet.
   Never a punishment screen — a kindness, "another orbit is all you need". */
.mercy {
  display: flex; gap: 16px; align-items: flex-start; margin: 22px 0;
  padding: 18px 20px; border-radius: var(--radius);
  border: 1px solid rgba(127,176,255,0.22);
  background: linear-gradient(100deg, rgba(127,176,255,0.07), var(--paper) 55%);
}
.mercy.clear { border-color: rgba(255,185,95,0.28); background: linear-gradient(100deg, rgba(255,185,95,0.08), var(--paper) 55%); }
.mercy-icon { font-size: 1.5rem; color: var(--cool); line-height: 1.2; }
.mercy.clear .mercy-icon { color: var(--amber); text-shadow: 0 0 16px rgba(255,180,85,0.6); }
.mercy-body h4 { margin: 0 0 5px; color: var(--ink); font-size: 1.02rem; }
.mercy-body p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.55; }

/* a held take waiting on its orbit: glows (it's held) but sits in the pile,
   marked as local-for-now rather than surfaced on the public wall. */
.take.waiting { background: linear-gradient(100deg, rgba(127,176,255,0.05), var(--paper) 45%); border-color: rgba(127,176,255,0.16); opacity: 0.92; }
.waiting-tag { font-size: 0.72rem; color: var(--cool); border: 1px dashed rgba(127,176,255,0.4); border-radius: 999px; padding: 2px 9px; letter-spacing: 0.4px; }

/* the vouch / graft valve — an established voice lending standing */
.vouch-btn {
  cursor: pointer; border: 1px solid rgba(255,215,122,0.5); background: rgba(255,215,122,0.10);
  color: var(--gold); border-radius: 999px; padding: 7px 15px; font-size: 0.86rem; font-weight: 700; font-family: inherit;
}
.vouch-btn:hover { background: rgba(255,215,122,0.2); }
.vouch-form { display: inline; }

/* the voice-page orbit banner */
.orbit-band {
  margin: 0 0 22px; padding: 12px 18px; border-radius: 12px;
  border: 1px solid rgba(127,176,255,0.2); background: rgba(127,176,255,0.06);
  color: var(--muted); font-size: 0.92rem; line-height: 1.5;
}
.orbit-band.clear { border-color: rgba(255,185,95,0.28); background: rgba(255,185,95,0.07); color: var(--amber-2); }
.orbit-icon { font-weight: 700; margin-right: 4px; }

/* ── Threads of light (Sprint 3) — the physics, drawn ────────── */
/* You can see who holds you up: a lattice-site diamond wired to its
   holders. Starburst = load-bearing; a ring = anchored to nothing. */
.constellation {
  margin: 12px 0 6px;
  border-radius: 12px;
  background:
    radial-gradient(120% 80% at 78% 50%, rgba(255,185,95,0.05), transparent 60%),
    rgba(10,14,28,0.35);
  border: 1px solid var(--line);
  overflow: hidden;
}
.constellation .threads-svg { display: block; width: 100%; height: auto; max-height: 260px; }
.constellation.dim { opacity: 0.72; }

/* The diamond lattice — the standing-wave surface (Kris's 07/22 sketch).
   A medium mud can't travel through: transparent, coherent, hardest thing
   there is. Coherent takes phase-align at the lattice sites and stand. */
.facade-lattice { position: relative; }
.facade-lattice::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: var(--radius);
  opacity: 0.5;
  background-image:
    repeating-linear-gradient( 45deg, rgba(127,176,255,0.06) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-45deg, rgba(127,176,255,0.06) 0 1px, transparent 1px 22px);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), transparent 78%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), transparent 78%);
}
.facade-lattice > * { position: relative; z-index: 1; }
.facade-lattice .facade-lattice-cap {
  font-size: 0.74rem; color: var(--faint); letter-spacing: 0.3px;
  margin: -2px 0 12px; font-style: italic;
}

/* the pile — everything said, resting in shadow, diggable */
.pile-toggle { cursor: pointer; color: var(--faint); font-size: 0.85rem; background: none; border: none; padding: 8px 0; font-family: inherit; }
.pile-toggle:hover { color: var(--muted); }
details.pile { margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 8px; }
details.pile summary { cursor: pointer; color: var(--faint); font-size: 0.82rem; list-style: none; padding: 10px 0; text-transform: uppercase; letter-spacing: 1.5px; }
details.pile summary::-webkit-details-marker { display: none; }
details.pile[open] summary { color: var(--muted); }
.take.dim { opacity: 0.78; background: rgba(255,255,255,0.02); }

/* ── how it works ────────────────────────────────────────────── */
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.how-card { padding: 18px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.how-card .k { color: var(--amber); font-size: 0.78rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.how-card h4 { margin: 8px 0 6px; font-size: 1.02rem; }
.how-card p { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* ── empty ───────────────────────────────────────────────────── */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); font-weight: 700; }
.empty .big-lamp { font-size: 2.4rem; color: var(--amber); text-shadow: 0 0 30px var(--amber); }
.empty-aside { margin-top: 18px; font-size: 0.82rem; font-style: italic; opacity: 0.6; }

/* ── moment / frontage header ────────────────────────────────── */
.head {
  position: relative; padding: 24px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, var(--paper-2), var(--paper)); border: 1px solid var(--line);
  margin-bottom: 6px;
}
.head::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(220px 140px at 85% 15%, rgba(255,185,95,0.5), transparent 70%);
  opacity: calc(var(--g,55) / 100);
}
.head .kicker { position: relative; color: var(--amber); font-weight: 700; font-size: 0.85rem; }
.head h1 { position: relative; margin: 8px 0; font-size: 1.7rem; line-height: 1.2; }
.head .detail { position: relative; color: var(--muted); }
.head .stampline { position: relative; color: var(--faint); font-size: 0.82rem; margin-top: 12px; }
.head .stampline a { color: var(--faint); text-decoration: underline; }
.backlink { color: var(--faint); font-size: 0.85rem; display: inline-block; margin-bottom: 14px; }

.crumbs { margin-top: 10px; }

@media (max-width: 560px) {
  .hero h1 { font-size: 1.7rem; }
  .nav-inner { padding: 12px 14px; }
  .main { padding: 20px 14px; }
}

/* ── THE LIGHTBOX — a box of light over the street ───────────── */
.nav-lightbox { color: var(--muted); }
.nav-lightbox:hover { color: var(--amber-2); }

.lb-wrap { max-width: 860px; margin: 0 auto; }
.lb-head h1 { font-size: 1.9rem; margin-bottom: 6px; }
.lb-head .sub { color: var(--muted); max-width: 640px; }

.lb-stage { margin-top: 18px; }
.lightbox-svg {
  display: block; width: 100%; max-width: 820px; margin: 0 auto;
  border-radius: 18px; box-shadow: 0 18px 60px rgba(0,0,0,0.45);
}
.lightbox-svg a { cursor: pointer; }
.lightbox-svg a:hover text { fill-opacity: 1; }

.lb-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; max-width: 820px; margin: 12px auto 0;
}
.lb-back { color: var(--amber-2); font-size: 0.9rem; }
.lb-back.dim { color: var(--faint); font-style: italic; }
.lb-scopes { display: flex; gap: 6px; }
.lb-scope {
  font-size: 0.82rem; color: var(--faint); padding: 5px 12px;
  border: 1px solid var(--line); border-radius: 999px;
}
.lb-scope.on { color: var(--amber-2); border-color: rgba(255,206,138,0.45); }

.lb-card {
  max-width: 820px; margin: 18px auto 0; padding: 20px 22px;
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.lb-card .k { color: var(--amber); font-weight: 700; font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; }
.lb-card .k .band { color: var(--amber-2); }
.lb-card h2 { margin: 8px 0 4px; font-size: 1.25rem; line-height: 1.35; }
.lb-card .body { color: var(--ink); opacity: 0.9; white-space: pre-wrap; }
.lb-card .ctx { color: var(--faint); font-size: 0.86rem; margin-top: 8px; }
.lb-street { display: inline-block; margin-top: 10px; color: var(--amber-2); font-size: 0.9rem; }

@media (max-width: 560px) {
  .lb-bar { flex-direction: column; align-items: flex-start; }
}
