/* Watchtower.
   Palette values are sampled off award-winning EVENTS-genre sites
   (#0A172B #A0BDCF #2779A7 #49C5B6 #D14836 #ECD06F #AFD8FB) rather than
   invented. One family, two sizes: system display large, mono for metadata. */

:root {
  --ground:  #0A172B;
  --ink:     #F4F7FB;
  --haze:    #A0BDCF;
  --beam:    #ECD06F;
  --flare:   #D14836;
  --cool:    #49C5B6;
  --link:    #AFD8FB;
  --panel:   #0E2039;
  --edge:    color-mix(in oklab, var(--haze) 22%, transparent);
  --r:       14px;
  --gut:     clamp(1rem, 4vw, 3.5rem);

  --display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono:    ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --hebrew:  "Segoe UI", "Noto Sans Hebrew", "David", serif;

  /* Native controls, scrollbars and form fields follow the page rather than
     the UA default, which is light regardless of what the page is doing. */
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --ground: #FBFBF7;
    --ink:    #0A172B;
    --haze:   #4B6076;
    --beam:   #B8891A;
    --flare:  #C0392B;
    --cool:   #17786C;
    --link:   #1B5E86;
    --panel:  #FFFFFF;
    --edge:   color-mix(in oklab, #0A172B 16%, transparent);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.mono {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--haze);
}

.wrap { max-width: 1500px; margin-inline: auto; padding-inline: var(--gut); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--beam); color: #0A172B; padding: .7rem 1.1rem; font-family: var(--mono);
}
.skip:focus { left: .5rem; top: .5rem; }

/* ── The tower ─────────────────────────────────────────────────────────
   A grid of the newest thumbnails, dimmed, with a lit copy of the same grid
   masked to a circle that follows the pointer. On touch it drifts. */

.tower { position: relative; min-height: 100svh; display: grid; align-content: end; overflow: hidden; }

.wall {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 2px;
  opacity: .30;
  filter: grayscale(1) contrast(1.15);
}
@media (prefers-color-scheme: light) { .wall { opacity: .18; } }
.wall img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16/9; }

/* The lit copy of the same wall, revealed only inside the beam. */
.wall--lit {
  opacity: 1; filter: none;
  -webkit-mask-image: radial-gradient(circle 240px at var(--bx, 50%) var(--by, 42%), #000 0%, #000 32%, transparent 72%);
  mask-image: radial-gradient(circle 240px at var(--bx, 50%) var(--by, 42%), #000 0%, #000 32%, transparent 72%);
}

.tower::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle 300px at var(--bx, 50%) var(--by, 42%),
      color-mix(in oklab, var(--beam) 26%, transparent) 0%, transparent 68%),
    linear-gradient(to top, var(--ground) 4%, color-mix(in oklab, var(--ground) 72%, transparent) 46%, transparent 88%);
}

.tower__body { position: relative; z-index: 2; padding-block: 8vh 5vh; }

.eyebrow { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; margin: 0 0 1.6rem; }
.pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--beam);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--beam) 70%, transparent);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 11px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

h1 {
  margin: 0;
  font-size: clamp(3rem, 13.5vw, 12rem);
  line-height: .82;
  letter-spacing: -0.045em;
  font-weight: 800;
  text-wrap: balance;
}
h1 em { font-style: normal; color: var(--beam); }

/* WATCHTOWER is one unbreakable ten-character word, so on a narrow screen
   it stacks rather than shrinking to fit. */
@media (max-width: 560px) {
  h1 { font-size: clamp(3rem, 21vw, 6rem); line-height: .88; }
  h1 em { display: block; }
}

.deck {
  margin: 1.6rem 0 0;
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  line-height: 1.35;
  color: color-mix(in oklab, var(--ink) 82%, var(--haze));
  text-wrap: pretty;
}

.epigraph {
  margin: 2.4rem 0 0; padding-left: 1.1rem;
  border-left: 2px solid var(--beam);
  max-width: 34rem;
}
.epigraph b { display: block; font-family: var(--hebrew); font-size: 1.4rem; font-weight: 600; direction: rtl; }
.epigraph span { display: block; margin-top: .35rem; }

.tally { display: flex; flex-wrap: wrap; gap: 0 2.2rem; margin: 2.6rem 0 0; }
.tally div { display: grid; }
.tally b { font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }

/* ── Sections ─────────────────────────────────────────────────────── */

section { padding-block: clamp(4rem, 9vw, 8rem); }

.head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: baseline; justify-content: space-between; margin-bottom: 2.2rem; }
.head h2 {
  margin: 0; font-size: clamp(1.9rem, 5.2vw, 4.2rem);
  letter-spacing: -0.035em; font-weight: 800; line-height: .95;
}
.head p { margin: 0; max-width: 40ch; color: var(--haze); font-size: .95rem; }

/* Filters — the fastest way into 250-odd items. */
.controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.8rem; }
.chip {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .05em; text-transform: uppercase;
  padding: .5rem .85rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--edge); background: transparent; color: var(--haze);
  transition: color .18s, border-color .18s, background .18s;
}
.chip:hover { color: var(--ink); border-color: var(--haze); }
.chip[aria-pressed="true"] { background: var(--beam); border-color: var(--beam); color: #0A172B; }

.search {
  margin-inline-start: auto; min-width: 15rem; flex: 1 1 12rem; max-width: 22rem;
  font-family: var(--mono); font-size: .78rem;
  padding: .6rem .9rem; border-radius: 999px;
  border: 1px solid var(--edge); background: transparent; color: var(--ink);
}
.search::placeholder { color: var(--haze); }
.search:focus-visible, .chip:focus-visible { outline: 2px solid var(--beam); outline-offset: 2px; }

/* ── The grid ─────────────────────────────────────────────────────── */

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(1rem, 2vw, 1.7rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
}

.card { position: relative; }
.card a { text-decoration: none; display: grid; gap: .75rem; }

.shot {
  position: relative; overflow: hidden; border-radius: var(--r);
  aspect-ratio: 16/9; background: var(--panel);
  border: 1px solid var(--edge);
}
.shot img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), filter .35s;
}
.card a:hover .shot img, .card a:focus-visible .shot img { transform: scale(1.06); }

.shot::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--r);
  background: linear-gradient(to top, color-mix(in oklab, #0A172B 78%, transparent), transparent 52%);
  opacity: 0; transition: opacity .3s;
}
.card a:hover .shot::after, .card a:focus-visible .shot::after { opacity: 1; }

.play {
  position: absolute; inset: auto auto .7rem .7rem;
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem;
  border-radius: 50%; background: var(--beam); color: #0A172B;
  transform: translateY(120%) scale(.7); opacity: 0;
  transition: transform .32s cubic-bezier(.2,.8,.2,1), opacity .25s;
}
.card a:hover .play, .card a:focus-visible .play { transform: none; opacity: 1; }
.play svg { width: 1rem; height: 1rem; }

.scene {
  position: absolute; inset: .6rem .6rem auto auto;
  font-family: var(--mono); font-size: .6rem; letter-spacing: .06em; text-transform: uppercase;
  padding: .28rem .55rem; border-radius: 999px;
  background: color-mix(in oklab, #0A172B 82%, transparent);
  color: #AFD8FB; backdrop-filter: blur(6px);
  border: 1px solid color-mix(in oklab, #A0BDCF 26%, transparent);
}

.card h3 {
  margin: 0; font-size: 1.02rem; font-weight: 650; line-height: 1.3;
  letter-spacing: -0.012em; text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card a:hover h3 { color: var(--beam); }
.byline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.byline strong { font-size: .84rem; font-weight: 600; color: var(--ink); }

/* Reveal on scroll — native scroll-driven animation, no library. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .card, .disp {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 46%;
    }
    @keyframes rise { from { opacity: 0; transform: translateY(22px); } }
  }
}

.more { display: grid; place-items: center; padding-block: 3rem; }
.btn {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .85rem 1.6rem; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--haze); color: var(--ink);
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--beam); border-color: var(--beam); color: #0A172B; }
.btn--solid { background: var(--beam); border-color: var(--beam); color: #0A172B; }
.btn--solid:hover { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.btn:focus-visible { outline: 2px solid var(--beam); outline-offset: 3px; }
.empty { padding: 3rem 0; color: var(--haze); font-family: var(--mono); font-size: .8rem; }

/* ── News ─────────────────────────────────────────────────────────── */

.disps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.disp { border-top: 1px solid var(--edge); }
.disp:last-child { border-bottom: 1px solid var(--edge); }
.disp a {
  display: grid; grid-template-columns: 7.5rem 1fr auto; gap: 1.4rem; align-items: center;
  padding: 1.15rem 0; text-decoration: none;
  transition: padding-inline .25s, background .25s;
}
.disp a:hover, .disp a:focus-visible { background: color-mix(in oklab, var(--haze) 8%, transparent); padding-inline: 1rem; }
.disp img { width: 7.5rem; aspect-ratio: 3/2; object-fit: cover; border-radius: 8px; border: 1px solid var(--edge); }
.disp .noimg { width: 7.5rem; aspect-ratio: 3/2; border-radius: 8px; background: var(--panel); border: 1px solid var(--edge); }
.disp h3 { margin: 0 0 .3rem; font-size: 1.02rem; font-weight: 620; line-height: 1.3; }
.disp p { margin: 0; font-size: .86rem; color: var(--haze); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.disp a:hover h3 { color: var(--beam); }
@media (max-width: 620px) {
  .disp a { grid-template-columns: 4.5rem 1fr; }
  .disp img, .disp .noimg { width: 4.5rem; }
  .disp a > .mono:last-child { display: none; }
}

/* ── Suggest ──────────────────────────────────────────────────────── */

.nominate { background: var(--panel); border-radius: calc(var(--r) * 2); border: 1px solid var(--edge); padding: clamp(1.6rem, 4vw, 3.4rem); }
.nominate .head { margin-bottom: 1.4rem; }
form { display: grid; gap: 1rem; max-width: 44rem; }
.row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .row { grid-template-columns: 1fr; } }
label { display: grid; gap: .4rem; }
label > span { font-family: var(--mono); font-size: .66rem; letter-spacing: .05em; text-transform: uppercase; color: var(--haze); }
input, textarea, select {
  font: inherit; font-size: .95rem; color: var(--ink);
  background: color-mix(in oklab, var(--ground) 55%, transparent);
  border: 1px solid var(--edge); border-radius: 10px; padding: .7rem .85rem;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--beam); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; }
.say { font-family: var(--mono); font-size: .76rem; min-height: 1.4em; }
.say[data-ok="1"] { color: var(--cool); }
.say[data-ok="0"] { color: var(--flare); }

.wall-of-names { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2rem; }
.wall-of-names span {
  font-family: var(--mono); font-size: .7rem; padding: .35rem .7rem; border-radius: 999px;
  border: 1px dashed var(--edge); color: var(--haze);
}

/* ── Footer ───────────────────────────────────────────────────────── */

footer { border-top: 1px solid var(--edge); padding-block: clamp(3rem, 7vw, 6rem) 3rem; }
.foot-grid { display: grid; gap: 2.6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
footer h4 { margin: 0 0 .9rem; font-family: var(--mono); font-size: .66rem; letter-spacing: .07em; text-transform: uppercase; color: var(--haze); font-weight: 500; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
footer li a { text-decoration: none; font-size: .92rem; }
footer li a:hover { color: var(--beam); }
.colophon { margin-top: 3.4rem; padding-top: 1.6rem; border-top: 1px solid var(--edge); display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.colophon p { margin: 0; max-width: 62ch; font-size: .86rem; color: var(--haze); }
