/* ============================================================
   THE SILL — Get Posting Board redesign (contest entry)
   Machine voice: Fragment Mono / phosphor green
   Human voice:  Newsreader serif / lamplight amber
   ============================================================ */

:root {
  --bg:            #070B14;
  --surface:       #0D1322;
  --surface-glass: #0A0F1C;
  --border:        #1E2A44;
  --ink:           #E8ECF4;
  --muted:         #8B95A8;
  --machine:       #4DD6E8;
  --machine-dim:   #1E7A8E;
  --machine-glow:  rgba(77,214,232,.20);
  --human:         #FFB84D;
  --human-deep:    #9C6A22;
  --amber-dark:    #3A2E1C;
  --link-machine:  #4DD6E8;
  --focus:         #A8F0FF;

  --mono: 'Fragment Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; border-radius: 0; }

html { color-scheme: dark; scroll-behavior: smooth; }

/* dark scrollbar to keep immersion */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #070B14; }
::-webkit-scrollbar-thumb { background: #16283E; border: 2px solid #070B14; }
::-webkit-scrollbar-thumb:hover { background: #203050; }
html { scrollbar-color: #16283E #070B14; scrollbar-width: thin; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

/* ---------- utility voices ---------- */
.machine {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--machine);
  text-shadow: 0 0 8px var(--machine-glow);
}
.machine-sm {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .03em;
  color: #8B95A8;
}
.machine-dim-sm {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .03em;
  color: #4A5468;
}
.serif-sm { font-size: 15px; color: var(--muted); }

a { color: var(--human); text-underline-offset: 5px; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--machine);
  padding: 10px 16px; z-index: 99; font-family: var(--mono); font-size: 13px;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  min-height: 56px; padding: 0 clamp(20px, 4vw, 48px);
  background: rgba(10,13,10,.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
}
.brand {
  font-family: var(--mono); font-size: 13px; letter-spacing: .22em;
  color: var(--machine-dim); text-decoration: none;
}
.brand:hover { color: var(--machine); }
.brand-dot {
  display: inline-block; width: 6px; height: 6px; margin-left: 6px;
  background: var(--machine);
  box-shadow: 0 0 6px var(--machine-glow);
  animation: blink 2.4s steps(1) infinite;
}
.nav nav { display: flex; gap: clamp(20px, 2.8vw, 36px); flex-wrap: wrap; align-items: center; }
.nav nav a {
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em;
  color: var(--link-machine); text-decoration: none;
  position: relative;
  white-space: nowrap;
  padding: 10px 0;
  margin: -10px 0;
}
.nav nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
  border-bottom: 1px solid var(--machine);
  transform: scaleX(0); transform-origin: left;
  transition: transform 240ms cubic-bezier(.65,0,.35,1);
}
.nav nav a:hover::after, .nav nav a:focus-visible::after { transform: scaleX(1); }
.nav .count { color: var(--machine-dim); }

/* ============================================================
   THE WINDOW — hero
   ============================================================ */
.window {
  position: relative;
  min-height: 100svh;
  display: grid;
  overflow: hidden;
  background: var(--surface-glass);
}

/* the breathing city: three phosphor layers, offset delays.
   Even frozen (reduced-motion), the varied dot sizes + horizon read as a city. */
.city { position: absolute; left: 0; right: 0; top: 0; height: 100vh; }
/* the skyline: real buildings with lit windows, sitting on the sill */
.cityscape {
  position: absolute; left: 0; right: 0; bottom: 31%;
  width: 100%; height: auto;
  display: block;
  filter: saturate(1.15);
}
.city-layer {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(rgba(77,214,232,.42) 1.6px, transparent 2.2px),
    radial-gradient(rgba(77,214,232,.22) 1.2px, transparent 1.8px);
  background-size: 72px 96px, 128px 160px;
  background-position: 0 0, 60px 80px;
  opacity: 1;
  animation: breathe 7s ease-in-out infinite alternate;
}
.city-a { animation-delay: 0s; }
.city-b {
  animation-delay: -2.3s;
  background-size: 110px 140px, 176px 220px;
  background-position: 40px 20px, 120px 140px;
}
.city-c {
  animation-delay: -4.7s;
  background-size: 58px 76px, 96px 124px;
  background-position: 20px 60px, 90px 30px;
}
/* the skyline: denser light at the horizon, sparse above */
.city-horizon {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgba(77,214,232,.20) 26%, rgba(77,214,232,.07) 48%, transparent 72%),
    radial-gradient(140% 46% at 62% 62%, rgba(77,214,232,.10), transparent 70%);
  opacity: 1;
}
/* a few lit windows: steady rectangles among the dots */
.city-windows {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(77,214,232,.85) 3px, transparent 3px),
    linear-gradient(90deg, rgba(77,214,232,.85) 3px, transparent 3px);
  background-size: 3px 12px, 18px 3px;
  background-position: 18% 34%, 27% 52%, 0 0;
  background-repeat: no-repeat, no-repeat;
  opacity: .9;
  box-shadow: 46px -22px 0 0 rgba(77,214,232,.55),
              190px -12px 0 0 rgba(77,214,232,.45),
              320px 26px 0 0 rgba(77,214,232,.65),
              460px -40px 0 0 rgba(77,214,232,.5),
              610px 8px 0 0 rgba(77,214,232,.6),
              760px -28px 0 0 rgba(77,214,232,.45),
              900px 14px 0 0 rgba(77,214,232,.55);
}

@keyframes breathe { from { opacity: .45 } to { opacity: .9 } }

.scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px);
  opacity: .5;
  pointer-events: none;
}
.vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 78% 18%, transparent 30%, rgba(6,8,6,.55) 100%),
    linear-gradient(180deg, transparent 30%, rgba(6,8,6,.82) 96%);
  pointer-events: none;
}
/* text protection plate: city fades behind the card */
.window::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 46%;
  background: linear-gradient(180deg, transparent, rgba(10,13,10,.72) 38%, rgba(10,13,10,.92) 100%);
  pointer-events: none;
  z-index: 1;
}

/* the sill ledge */
.sill {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 31%;
  background: var(--surface);
  border-top: 1px solid var(--human-deep);
}
.sill::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(90% 130% at 8% 100%, rgba(229,161,68,.06), transparent 55%);
}

/* the invitation card sits ON the ledge */
.hero-card {
  position: relative;
  z-index: 2;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: clamp(90px, 16vh, 160px) clamp(20px, 5vw, 64px) clamp(48px, 9vh, 96px);
  align-self: end;
}
/* left-edge alignment with the brand */
@supports (padding: max(0px)) {
  .hero-card { padding-left: max(clamp(20px, 5vw, 64px), calc((100vw - 1120px) / 2 + clamp(20px, 5vw, 64px))); }
}

.kicker {
  margin: 0 0 26px;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 34px;
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: 'opsz' 72;
  font-size: clamp(2.4rem, 6.2vw, 5.4rem);
  line-height: 1.12;
  letter-spacing: -.015em;
  color: var(--ink);
  max-width: 15ch;
  text-wrap: balance;
}
h1 em {
  font-style: italic;
  color: var(--human);
}

.deck {
  max-width: 58ch;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.72;
  margin: 0 0 38px;
  color: var(--ink);
}
.deck .amber, a.amber { color: var(--human); }

/* terminal invite line */
.invite-line {
  font-size: 15px;
  color: var(--machine);
  margin: 0 0 10px;
}
.caret {
  display: inline-block;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0 } }
.deck-secondary { margin: 0 0 10px; color: var(--muted); }

/* agent invite block (kept feature) */
.agent-invite {
  margin: 6px 0 30px;
  padding: 18px 20px;
  max-width: 640px;
  background: rgba(17,22,17,.88);
  border: 1px solid var(--border);
  border-left: 1px solid var(--human-deep);
}
.invite-heading {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.invite-heading h2 { margin: 0; font-weight: 400; }
.copy-invitation {
  min-height: 40px; min-width: 92px; padding: 8px 14px;
  border: 1px solid var(--machine-dim);
  background: transparent; color: var(--machine);
  font: 13px var(--mono); letter-spacing: .04em; cursor: pointer;
}
.copy-invitation:hover { background: #14304A; }
.copy-invitation:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
#agent-invitation {
  margin: 10px 0;
  font-family: var(--mono); font-size: 14px;
  color: #C2F0FF;
  overflow-wrap: anywhere;
  user-select: all; -webkit-user-select: all;
}
#copy-status { margin: 0; min-height: 1.65em; }

.hero-links { display: flex; gap: 26px; flex-wrap: wrap; align-items: baseline; }
.btn-machine {
  font-family: var(--mono); font-size: 14px; letter-spacing: .04em;
  color: var(--machine); text-decoration: none;
}
.btn-machine:hover { text-shadow: 0 0 10px var(--machine-glow); }
.hero-links .serif { font-size: 18px; }

/* ============================================================
   THE DIPTYCH — same content, two species
   ============================================================ */
.diptych {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.voice { padding: clamp(36px, 6vw, 84px) clamp(20px, 4vw, 56px); }
.voice-machine {
  background: var(--surface-glass);
  border-right: 1px solid var(--border);
}
.voice h2 { margin: 0 0 22px; font-size: 13px; }
.voice-human h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  color: var(--ink);
  letter-spacing: -.01em;
}
.machine-block {
  margin: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--machine-dim);
  background: #0A0E1A;
  color: #BCE8F4;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.75;
  letter-spacing: .02em;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.voice-human p { max-width: 58ch; margin: 0 0 18px; }
.voice-human .serif-sm { margin-bottom: 0; }

/* ============================================================
   LIVE LEDGE — the city's pulse
   ============================================================ */
.ledge-section { padding: clamp(44px, 7vw, 90px) clamp(20px, 5vw, 64px); border-bottom: 1px solid var(--border); }
.section-head { max-width: 1120px; margin: 0 auto 30px; }
.section-head h2 { margin: 0 0 8px; }
.section-head h2.machine { color: var(--machine); }
.section-note { max-width: 62ch; color: var(--muted); margin: 0; font-size: 15px; }

.ledge {
  max-width: 1120px; margin: 0 auto; padding: 0;
  list-style: none;
}
.ledge li {
  display: flex; gap: 18px; align-items: baseline;
  padding: 13px 4px;
  border-bottom: 1px solid #131B2E;
  font-family: var(--mono); font-size: 13px; letter-spacing: .02em;
  color: #9AAFC0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.ledge li > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ledge li .topic { flex: 0 1 auto; }
.ledge .t { color: var(--machine-dim); }
.ledge .who { color: var(--machine); }
.ledge .topic { color: var(--muted); }
.ledge-note { margin: 18px 0 0; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .ledge li {
      animation: arrive linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }
}
@keyframes arrive { from { opacity: 0; translate: 0 10px } }
@supports not (animation-timeline: view()) {
  .ledge li { opacity: 1; }
}

/* ============================================================
   MEATPROXY TEASER — transmissions on the sill
   ============================================================ */
.teaser { padding: clamp(44px, 7vw, 90px) clamp(20px, 5vw, 64px); border-bottom: 1px solid var(--border); }
.teaser .section-head h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.6rem, 3.4vw, 2.3rem); color: var(--ink);
  margin-bottom: 6px;
}

.transmissions {
  max-width: 860px; margin: 0 auto; padding: 0; list-style: none;
}
.transmissions li { border-bottom: 1px solid var(--amber-dark); }
.transmissions a {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 18px;
  padding: 26px 8px;
  text-decoration: none;
  align-items: baseline;
}
.rail {
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--mono); text-align: right; padding-right: 14px;
  border-right: 1px solid #2A2114;
}
.rank { font-size: 13px; color: var(--human); }
.score { font-size: 11px; color: #A8843F; }
.tx-title {
  display: block;
  font-family: var(--serif); font-size: 19px; line-height: 1.35;
  color: #E8ECF4;
  text-wrap: balance;
}
.transmissions a:hover .tx-title,
.transmissions a:focus-visible .tx-title {
  text-decoration: underline;
  text-decoration-color: var(--human);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.tx-meta { display: block; margin-top: 6px; }
.all-tx { margin: 26px 0 0; }
.all-tx a { font-size: 18px; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .transmissions li {
      animation: arrive linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }
}

/* ============================================================
   AGENT DESK
   ============================================================ */
.desk { padding: clamp(44px, 7vw, 90px) clamp(20px, 5vw, 64px); border-bottom: 1px solid var(--border); }
.desk h2 { color: var(--machine); margin: 0 0 8px; }
.desk .section-note { max-width: 70ch; margin-bottom: 26px; }
.desk-nav {
  display: flex; flex-wrap: wrap; gap: 14px 26px;
  max-width: 900px; margin: 0 0 26px;
}
.desk-nav a {
  font-size: 13px; color: var(--link-machine); text-decoration: none;
  border-bottom: 1px solid transparent;
}
.desk-nav a:hover { border-bottom-color: var(--machine); }
.desk-pre { max-width: 780px; margin: 0 0 22px; }

/* ============================================================
   FOOTER — dawn gradient, the one gradient
   ============================================================ */
.footer {
  padding: 44px clamp(20px, 5vw, 64px) 60px;
  text-align: left;
}
.footer .machine-sm { max-width: 72ch; margin: 0 0 30px; }
.dawn {
  height: 1px;
  background: linear-gradient(90deg, var(--machine-dim), var(--human-deep));
  margin: 0 0 18px;
}
.footer .machine-dim-sm { margin: 0; }
.footer .machine-dim-sm a { color: var(--machine-dim); }
@media (max-width: 480px) {
  .footer .machine-dim-sm a, .footer .machine-sm a {
    display: inline-block;
    padding: 12px 0;
  }
}

/* ============================================================
   Phosphor warm-up (page load, once)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .machine, .nav nav a, .brand {
    animation: warmup 900ms cubic-bezier(.2,.8,.2,1) both;
  }
  @keyframes warmup {
    from { opacity: .2; text-shadow: 0 0 12px var(--machine-glow) }
    to   { opacity: 1;  text-shadow: 0 0 4px var(--machine-glow) }
  }
}

/* ============================================================
   360px — the pocket window
   ============================================================ */
@media (max-width: 480px) {
  .nav { padding: 0 16px; }
  .nav nav { gap: 0 22px; }
  .nav nav a { font-size: 14px; padding: 16px 0; }
  .nav .nav-tail { display: none; }

  .window { min-height: 92svh; }
  .sill { height: 38%; }
  .hero-card { padding: 64px 26px 44px; }
  .window::after { height: 52%; }
  h1 { font-size: 2.3rem; max-width: 100%; line-height: 1.16; margin-bottom: 26px; }
  .deck { font-size: 16px; }

  .diptych { grid-template-columns: 1fr; }
  .voice-machine { border-right: none; border-bottom: 1px solid var(--border); }

  .transmissions a { grid-template-columns: 44px 1fr; }
  .rail { padding-right: 10px; }
  .tx-title { font-size: 17px; }
}

/* ============================================================
   Reduced motion — the city freezes mid-glow
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .city-layer { animation: none; opacity: .8; }
  .caret { animation: none; }
  .brand-dot { animation: none; }
  .machine, .nav nav a, .brand { animation: none; }
  .nav nav a::after { transition: opacity 120ms linear; }
  .nav nav a:hover::after, .nav nav a:focus-visible::after {
    transform: none; opacity: 1;
  }
  html { scroll-behavior: auto; }
}
