/* The frame of the quiet pages without script, and of the 404: the landing's own cave, the plain text on one clay tablet.
   With script the pages are a talk (page.js, page-stage.css, docs/PAGES_PLAN.md v4) and most of this is off. Loaded after
   site.css (which still carries the shared tokens --night, --paper, --clay-hi, --greek, --serif, and
   .top/.mark/.langs/.foot-min/.skiplink/.todo, used here unchanged). */
/* html.pre-talk: until page.js has built the talk (or chosen the cave), nothing shows, so the cave text never flashes
   before the painting; <noscript> lifts it, and the 4 s reveal covers a script that never ran */
html.pre-talk { background: #0b0605; }
html.pre-talk body { visibility: hidden; animation: pre-talk-show 0s 4s forwards; }
@keyframes pre-talk-show { to { visibility: visible; } }
/* the wait is never flat black: a small lamp-flame ember breathes at the centre (html's own pseudo-element, so
   body's visibility:hidden above does not hide it) until page.js builds the talk and lifts .pre-talk - no
   spinner, no text, no counter */
html.pre-talk::before { content: ""; position: fixed; z-index: 1; inset: 0; margin: auto; width: 48px; height: 48px;
  border-radius: 50%; background: radial-gradient(circle, #e9a36d 0%, #cd7f4b 45%, rgba(205, 127, 75, 0) 72%);
  animation: pre-talk-ember 2.6s ease-in-out infinite; }
@keyframes pre-talk-ember { 0%, 100% { opacity: .5; transform: scale(.9); } 50% { opacity: .92; transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { html.pre-talk::before { animation: none; opacity: .8; } }
body.frame-page { --pt: 31svh; --pb: 17svh; --ph: min(50svh, 30vw); position: relative; color: #1d0f08; background: #0b0605; }
body.frame-page::before, body.frame-page::after, main.frame::before { content: ""; position: fixed; inset: 0; pointer-events: none; }
body.frame-page::before { z-index: -2;
  -webkit-mask: url("/assets/cave/face.png") center / 100% 100% no-repeat; mask: url("/assets/cave/face.png") center / 100% 100% no-repeat;
  background:
    linear-gradient(90deg, rgba(22, 8, 3, .62), rgba(22, 8, 3, .18) 16%, rgba(22, 8, 3, 0) 30%, rgba(22, 8, 3, 0) 70%, rgba(22, 8, 3, .18) 84%, rgba(22, 8, 3, .62)),
    linear-gradient(rgba(22, 8, 3, .55), rgba(22, 8, 3, 0) 30%),
    repeating-linear-gradient(90deg, rgba(60, 22, 8, 0) 0 23px, rgba(60, 22, 8, .1) 23px 24px, rgba(60, 22, 8, 0) 24px 61px, rgba(60, 22, 8, .07) 61px 62px),
    radial-gradient(52% 60% at 50% 72%, #d88c55, #b4693a 55%, #6e2e14); }
body.frame-page::after { z-index: -1; background: url("/assets/cave/l.webp") center / 100% 100% no-repeat; }
@media (min-width: 1600px) { body.frame-page::after { background-image: url("/assets/cave/d.webp"); } }
main.frame::before { z-index: -1; will-change: opacity;
  background: radial-gradient(46% 52% at 50% 92%, rgba(255, 196, 120, .4), rgba(255, 170, 90, .12) 55%, rgba(255, 170, 90, 0) 75%),
    radial-gradient(50% 44% at 50% 100%, rgba(255, 150, 70, .3), rgba(255, 130, 60, 0) 70%);
  animation: wall-flame 5.3s ease-in-out infinite alternate; }
@keyframes wall-flame { 0% { opacity: .6; } 18% { opacity: .9; } 31% { opacity: .7; } 57% { opacity: 1; } 74% { opacity: .75; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { main.frame::before { animation: none; opacity: .85; } }
main.frame { position: relative; z-index: 1; }
/* the header stands over the rock, as on the landing */
.frame-page .top { position: absolute; z-index: 3; top: 0; left: 0; right: 0; max-width: none; padding-left: 26px; padding-right: 26px; }
.foot-min { position: relative; z-index: 2; }

/* ---- the two men, painted in black-figure (clay lines, added red) and standing on the parapet either side of the pinax,
   as on the landing but with their faces drawn ---- */
.gutter { position: fixed; z-index: 0; bottom: calc(var(--pt) - .8svh); width: calc(50vw - 21rem - 7vw); height: var(--ph);
  pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
.gutter.on { opacity: 1; }
.gutter.left { left: 6vw; } .gutter.right { right: 6vw; }
.gutter .pose { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.gutter .pose.on { opacity: 1; }
.gutter svg { display: block; height: 100%; width: 100%; }   /* no filter: a blurred drop-shadow on two full-height SVGs is too slow on phones */
.gutter.left svg { transform: perspective(1400px) rotateY(10deg); transform-origin: 50% 100%; }
.gutter.right svg { transform: perspective(1400px) rotateY(-10deg); transform-origin: 50% 100%; }
.gutter .glaze { fill: #170c07; } .gutter .c { fill: #e7b07a; } .gutter .red { fill: #8e2a16; }
@media (prefers-reduced-motion: reduce) { .gutter, .gutter .pose { transition: none; } }

/* ---- the clay tablet of a page without script and of the 404 (cave.css .man figcaption: the gradient, the miltos double
   border, the cord and the peg) ---- */
.frame-page .tablet { position: relative; box-sizing: border-box; width: min(40rem, 100%); padding: 26px 34px 24px; color: #1d0f08;
  background: linear-gradient(170deg, #f4e6cb, #e9d3ae 60%, #dfc398); border-radius: 3px;
  box-shadow: inset 0 0 0 1.5px #a8402a, inset 0 0 0 4px #f1e2c6, inset 0 0 0 5px rgba(168, 64, 42, .55), 0 14px 28px rgba(20, 7, 2, .55), 0 0 0 1px rgba(40, 14, 5, .35); }
.frame-page .tablet::before { content: ""; position: absolute; left: 50%; top: -15px; width: 90px; height: 16px; transform: translateX(-50%);
  background: linear-gradient(to top right, transparent calc(50% - 1px), #6b3a1c 50%, transparent calc(50% + 1px)) left / 50% 100% no-repeat,
    linear-gradient(to top left, transparent calc(50% - 1px), #6b3a1c 50%, transparent calc(50% + 1px)) right / 50% 100% no-repeat; }
.frame-page .tablet::after { content: ""; position: absolute; left: 50%; top: -19px; width: 7px; height: 7px; margin-left: -3.5px;
  border-radius: 50%; background: radial-gradient(circle at 35% 35%, #d9a25a, #4a2410 70%); }
/* ---- the title block ---- */
.frame-head { text-align: center; }
.frame-head h1 { margin: 0 0 8px; font: 400 var(--fs-2xl) / 1.1 var(--greek); color: #1d0f08; text-wrap: balance; }
.frame-head .greet { margin: 0 0 10px; font: 400 var(--fs-xl) / 1.3 var(--greek); color: #862c18; }
.frame-head .lead, .frame-head > p { margin: 0 auto 12px; max-width: var(--measure); font: italic 400 var(--fs-lg) / var(--lh-read) var(--serif); color: #1d0f08; text-wrap: pretty; }
.frame-head .updated { margin: 0 0 12px; font: italic 400 var(--fs-md) var(--serif); color: #f0dcbc; }
.section-nav { display: flex; flex-wrap: wrap; justify-content: center; margin: 0 auto; padding: 0; max-width: 42rem;
  font: 500 1rem / 1.7 var(--serif); color: #862c18; }
.section-nav a { color: #862c18; text-decoration: none; padding: 2px 0; }   /* 6:1 on the plaster */
.section-nav a:hover, .section-nav a:focus-visible { color: #1d0f08; text-decoration: underline; text-underline-offset: 3px; }
.section-nav a + a::before { content: "·"; margin: 0 .55em; color: #a8402a; }   /* one line of names with interpuncts, not a bar */
.frame-cols { position: relative; z-index: 1; }

.frame-enter { display: flex; justify-content: center; margin: 0; }

/* ---- the text on the clay (a page without script, where .frame-body is itself one tablet) ---- */
.frame-body { max-width: 40rem; margin: 0 auto; }
.frame-page .frame-body { box-sizing: border-box; padding: 34px 34px 20px; background: #efdfc1; border-radius: 3px; box-shadow: inset 0 0 0 1.5px #a8402a; }
.frame-body p, .frame-body li, .frame-dl dd, .frame-dl dt, .frame-page details p, .frame-page details li, .frame-page details dd {
  font: 500 1.14rem / 1.58 var(--serif); color: #1d0f08; }   /* site.css details p is --soft: unreadable on the clay */
.frame-body p { margin: 0 0 1em; }
.frame-body ul { padding-left: 1.3em; }
.frame-body li { margin: 0 0 .7em; }
.frame-body > .lead { font-style: italic; }
.frame-body > h2 { margin: 42px 0 14px; font: 400 var(--fs-xl) / 1.3 var(--greek); color: #862c18; scroll-margin-top: 24px; text-wrap: balance; }
.frame-body > h2::after { content: ""; display: block; width: 46px; height: 0; margin: 10px 0 0; border-top: 2px solid #c0823a; }

/* ---- the two terracotta tokens (contrast ratios checked for AA 4.5:1 text / 3:1 focus, docs/PAGES_PLAN.md "the shared frame") ---- */
.frame-body a, .in-short a { color: #862c18; text-decoration: underline; text-underline-offset: 3px; } /* 6:1 on the plaster */
.frame-body a:hover, .frame-body a:focus-visible, .in-short a:hover { color: #1d0f08; }
.frame-page a:focus-visible, .frame-page button:focus-visible, .frame-page summary:focus-visible { outline: 2px solid #1d0f08; outline-offset: 3px; }
.tablet a { color: #862c18; text-decoration: underline; text-underline-offset: 2px; } /* #862c18 on plaster: 6.0:1. #e09a66 on plaster is only 1.6:1 -- never used here. */
.frame-body .todo { color: #862c18; background: rgba(134, 44, 24, .08); }

/* ---- the page's own tablet (object + "In short"), and choregia's three ways ---- */
.frame-page .tablet { margin: 18px auto 42px; max-width: 34rem; }
.tablet-art { display: block; margin: 0 auto 14px; }
/* the cave tablet's own heading (cave.css .man b / .man b::after), not an uppercase tracked eyebrow */
.in-short-label { margin: 0; font: 400 var(--fs-md) var(--greek); color: #862c18; }
.in-short-note { margin: 12px 0 8px; font-style: italic; font-size: var(--fs-xs); color: #4a2a18; }   /* ~8:1 on the plaster */
.in-short-list { margin: 0; padding-left: 1.3em; color: #1d0f08; font-size: var(--fs-md); line-height: var(--lh-read); }
.frame-body .in-short-list li { margin: 0 0 .45em; font: 400 var(--fs-md) / var(--lh-read) var(--serif); color: #1d0f08; }
.in-short a { color: #862c18; }   /* 6.0:1 on the plaster; #e09a66 would be 1.6:1 */
.frame-body .in-short a:hover, .frame-body .in-short a:focus-visible { color: #5e1d0e; }
.tablet .greet { margin: 6px 0 0; font: 400 1.6rem / 1.3 var(--greek); color: #862c18; text-align: center; }

/* ---- the table / dl pair: one real <table> for desktop, one real <dl> set for phones -- a visually-hidden-but-
   present clip (not display:none) on whichever is off, so the few #row anchors (e.g. #waitlist from index.html's
   consent checkbox) still land near the right place at any width instead of scrolling to nothing ---- */
.frame-table-wrap { margin: 18px auto 40px; }
.frame-table-wrap table { width: 100%; border-collapse: collapse; }
.frame-table-wrap th, .frame-table-wrap td { text-align: left; padding: 12px 14px; border-bottom: 1px solid rgba(29, 15, 8, .2); vertical-align: top; font-size: var(--fs-md); line-height: var(--lh-read); color: #1d0f08; }
.frame-table-wrap th { font: 400 var(--fs-xs) var(--serif); color: #862c18; background: rgba(134, 44, 24, .07); }
.frame-table-wrap tr:last-child td { border-bottom: 0; }
.frame-dl { margin: 18px 0 40px; }
.frame-dl .row { padding: 16px 0; border-bottom: 1px solid rgba(29, 15, 8, .2); }
.frame-dl .row:last-child { border-bottom: 0; }
.frame-dl dl { margin: 0; display: grid; gap: 8px; }
.frame-dl dt, .frame-page details dt { font: 500 italic 1.05rem var(--serif); color: #862c18; margin: 0; } /* sentence case, not a label stack */
.frame-dl dd { margin: 0 0 4px; }
@media (max-width: 820px) {
  .frame-table-wrap { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (min-width: 821px) {
  .frame-dl { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---- the way in: cave.css .enter.btn reused exactly (the gradient, the glow, hover/focus), in flow instead of
   pinned over the cave floor ---- */
.btn.enter { position: relative; white-space: nowrap; min-height: var(--ctl-h); padding: 0 clamp(20px, 12px + min(1.4vw, 2.2vh), 40px); border-radius: var(--r-pill);
  border: 1px solid rgba(34, 12, 4, .7); color: #1a0a04; font: 400 var(--fs-sm) var(--greek);
  text-decoration: none; display: inline-flex; align-items: center;
  background: linear-gradient(#e29a62, #c26f3c 55%, #a1532a);
  box-shadow: inset 0 1px 0 rgba(255, 228, 190, .55), inset 0 -2px 4px rgba(60, 20, 6, .35), 0 0 26px rgba(255, 140, 60, .32), 0 6px 14px rgba(0, 0, 0, .45); }
.btn.enter:hover, .btn.enter:focus-visible { background: linear-gradient(#efae76, #d17d47 55%, #ab5c30);
  box-shadow: inset 0 1px 0 rgba(255, 228, 190, .6), 0 0 34px rgba(255, 150, 70, .5), 0 6px 14px rgba(0, 0, 0, .45); }
.btn.enter::after { content: ""; position: absolute; inset: -10px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 34px 6px rgba(240, 150, 70, .45); opacity: 0; animation: page-glowin 4.6s ease-in-out infinite; }
@keyframes page-glowin { 50% { opacity: 1; } }
.btn.enter:focus-visible { outline: 2px solid #f3e4cd; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .btn.enter::after { animation: none; } }

/* ---- the landing's own footer, just resized (site.css .foot-min is already centred/wrapping) ---- */
.frame-page .foot-min { font-size: 1.05rem; padding: 48px 20px max(26px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(8, 3, 1, 0), rgba(8, 3, 1, .78) 46px, rgba(8, 3, 1, .9)); }   /* the floor under the links: --soft on it ≥ 6:1 */
.frame-page .foot-min nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; }
.frame-page .foot-min a { color: #d9c2a3; }

/* ---- the 404: Manes at the cave mouth on the clay, his line, the way back; one screen ---- */
.lost-frame { box-sizing: border-box; min-height: calc(100vh - 110px); min-height: calc(100svh - 110px); display: flex; flex-direction: column; justify-content: center; padding: 84px 22px calc(var(--pt) + 2svh); }
.frame-page .lost-frame .frame-body { padding: 0; background: none; box-shadow: none; }
.lost-frame h1 { color: #f3e2c4; text-shadow: 0 2px 10px rgba(12, 5, 2, .8); }
.lost-frame .tablet { margin: 0 auto; }
.lost-tablet .greet { margin: 6px 0 12px; font: 400 clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem) / 1.3 var(--greek); color: #6e2414; text-wrap: balance; }
.frame-body .lost-tr { margin: 0 0 30px; font: italic 500 1.25rem / 1.55 var(--serif); color: #1d0f08; }
.lost-tr span { display: block; margin-top: 4px; }
.frame-body .lost-home { color: #f3e2c4; text-underline-offset: 3px; font-size: var(--fs-md); }
.lost-frame .frame-enter { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 24px; color: #f3e2c4; }

/* ---- phones (cave.css's own breakpoint, the rock baked for it): the tablet fills the width, the men small on the
   parapet below it ---- */
@media (max-width: 1100px) {
  .gutter { width: 30vw; height: 20svh; }
  .gutter.left { left: 3vw; } .gutter.right { right: 3vw; }
}
@media (max-width: 700px), (max-aspect-ratio: 4/5) {
  body.frame-page { --pb: 20svh; }
  body.frame-page::after { background-image: url("/assets/cave/m.webp"); }
  .gutter { height: 17svh; bottom: calc(var(--pt) - 1.2svh); }
    .frame-page .tablet { padding: 20px 20px 16px; }
  .frame-page .top { padding-left: 18px; padding-right: 18px; }
  .section-nav { font-size: .95rem; line-height: 1.55; }
  .lost-frame { padding-left: 14px; padding-right: 14px; }
}
