/* ---------- Landing: the ASCII title and the prophecy stele (landing.js) ---------- */

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

/* The header is only a slot now: ARACHNE is laid in ASCII brick courses and
   drawn into the scene's canvas at this box, caught in the web behind Arachne */
.landing-head { padding-top: 0; }
.title-slot {
  height: clamp(120px, 19vh, 200px);
  margin-top: max(8px, env(safe-area-inset-top, 0px));
}

/* The stele. landing.js draws the slab in the scene's cells around
   .stele-body (it reaches --slab-l/t/r/b cells past it, plus silk and a
   3-cell falloff) and sets --cell-w/--cell-h to the scene's cell size.
   .stele-body is the panel: an empty, dark field of cells with the words on
   it. Its ground is painted here too, so the text never waits on a frame. */
.stele {
  --cw: var(--cell-w, 5.4px);
  --ch: var(--cell-h, 9px);
  --slab-l: 7;
  --slab-t: 3;
  --slab-r: 6;
  --slab-b: 5;
  margin:
    calc(var(--ch) * (var(--slab-t) + 9))
    calc(var(--cw) * (var(--slab-r) + 2))
    calc(var(--ch) * (var(--slab-b) + 6))
    calc(var(--cw) * (var(--slab-l) + 2));
}
.stele-body {
  background: var(--bg, #0b0e18);
  padding: calc(var(--ch) * 2) calc(var(--cw) * 4) calc(var(--ch) * 1.5);
}
.stele-text {
  margin: 0;
  font-family: var(--font-prose, "Literata", Georgia, serif);
  font-size: clamp(17px, 0.95rem + 0.25vw, 19px);
  line-height: 1.65;
  color: var(--text-body, #efe6d4);
  text-wrap: pretty;
}
.stele-name {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold, #e3ae5f);
}
.stele-hint {
  margin: calc(var(--ch) * 2) 0 0;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--text-muted, #b9c2d0);
}
.hint-touch { display: none; }
@media (hover: none) {
  .hint-pointer { display: none; }
  .hint-touch { display: inline; }
}

/* Wide screens: the title spans the top of the web; the stele and the panel
   below it share the left column, Arachne the stage on the right */
@media (min-width: 1100px) {
  .layout {
    grid-template-areas: "header header" "intro stage" "panel stage";
  }
  .title-slot {
    height: clamp(150px, 22vh, 220px);
  }
  .stele { margin-top: calc(var(--ch) * 10); }
}

@media (max-width: 600px) {
  .stele { --slab-l: 4; --slab-r: 4; --slab-t: 3; --slab-b: 4; }
  .stele-body { padding: calc(var(--ch) * 2) calc(var(--cw) * 3) calc(var(--ch) * 1.5); }
}

/* Once an audit is under way the landing gives the page over to it */
body:has(#status-view:not([hidden])) .title-slot,
body:has(#status-view:not([hidden])) .stele { display: none; }

/* ---------- The way down (landing.js) ----------
   A cue under the hint: two chevrons bob either side of the words, on the
   stele's dark panel. Where the stele's foot is below the fold (phones, short
   screens) landing.js moves it to the head of the inscription instead, low in
   the first screen where the thumb is (.is-pinned). It fades once the page is
   scrolled or the email field is in view. */
.descend {
  display: block;
  margin: calc(var(--ch, 9px) * 1) auto 0;
  padding: 6px 10px;
  border: 0;
  background: none;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0.06em;
  white-space: pre;
  color: var(--gold, #e3ae5f);
  cursor: pointer;
  transition: opacity 0.35s ease, visibility 0s linear 0s;
}
.descend .d-chev { display: inline-block; animation: descend-bob 1.6s ease-in-out infinite; }
.descend:hover .d-row,
.descend:focus-visible .d-row { text-decoration: underline; text-underline-offset: 4px; }
.descend:focus-visible { outline: 1px dashed var(--gold, #e3ae5f); outline-offset: 2px; }
.descend.is-away {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
@keyframes descend-bob {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .descend .d-chev { animation: none; }
}

/* at the head of the inscription, above the words */
.descend.is-pinned { margin: calc(var(--ch, 9px) * -1) auto calc(var(--ch, 9px) * 1); }
