/* Living Worlds Lab — the web surface, in the Lab's family as
   recursivecreative.systems sets it, with a light theme beside the dark.
   Origin of these rules: Recursive Creative Systems — the web surface.
   The family is Lisgen's: one sans set light and large in sentence case, a
   mono for labels and the record, a 12-column grid, hairlines and quiet
   bordered panels, no shadows, one inverted panel where the answer is. The
   ground is black throughout. Two marks with meaning, from the plug-ins:
   brass is what you asked for or decided; jade is what left or was checked.
   Neither is ever a hover tint or a border on something merely present. */

:root {
  --bg: #000;
  --panel: #0b0b0b;
  --panel-2: #141414;
  --fg: #ededed;
  --fg-2: #8f8f8f;
  --fg-3: #6b6b6b;
  --rule: #222;
  --rule-lit: #3a3a3a;
  --control: #5c5c5c;
  --mada: #D9A441;   /* asked for, decided */
  --sada: #7FB3A6;   /* left, checked */
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-display: clamp(2.75rem, 7.2vw, 6.5rem);
  --f-h2: clamp(1.875rem, 3.6vw, 3rem);
  --f-h4: clamp(1.125rem, 1.5vw, 1.375rem);
  --f-body-lg: clamp(1.125rem, 1.4vw, 1.375rem);
  --f-caption: .8125rem;
  --f-number: .75rem;
  --gutter: 12px;
  --radius: 4px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --max: 1440px;
  --top: rgba(0, 0, 0, .86);
  --solid-hover: #fff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 1rem/1.55 var(--sans); }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; max-width: 62ch; color: var(--fg-2); }
::selection { background: var(--fg); color: var(--bg); }

/* type roles */
.display { font: 400 var(--f-display)/.98 var(--sans); letter-spacing: -.035em; margin: 0; max-width: 16ch; color: var(--fg); text-wrap: balance; }
.title { font: 400 var(--f-h2)/1.05 var(--sans); letter-spacing: -.025em; margin: 0 0 1rem; max-width: 20ch; color: var(--fg); text-wrap: balance; }
.heading { font: 400 var(--f-h4)/1.25 var(--sans); letter-spacing: -.01em; margin: 0 0 .75rem; color: var(--fg); }
.lead { font: 400 var(--f-body-lg)/1.45 var(--sans); letter-spacing: -.005em; max-width: 34em; margin: 0 0 1.25rem; color: var(--fg); }
.label { font: 400 var(--f-number)/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-2); }
.record { font: 400 var(--f-caption)/1.6 var(--mono); }
.muted { color: var(--fg-3); }
.sha .record { overflow-wrap: anywhere; }

/* grounds: one black. The paper ground is a panel step, not a second theme. */
.on-ink, .on-paper { background: var(--bg); color: var(--fg); }

/* grid */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 clamp(16px, 2.2vw, 32px); }
.cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); column-gap: clamp(24px, 4.5vw, 72px); }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; }
.c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.cols > *, .pair > * { min-width: 0; }   /* a pre or table scrolls inside its column, never widens the page */

/* chrome */
.top { position: sticky; top: 0; z-index: 10; background: var(--top); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.wordmark { font: 500 .9375rem/1 var(--sans); letter-spacing: -.01em; color: var(--fg); }
.top nav { margin-left: auto; display: flex; gap: 22px; align-items: center; }
.top nav a { font: 400 var(--f-caption)/1 var(--sans); color: var(--fg-2); padding-bottom: 2px; border-bottom: 1px solid var(--rule-lit); transition: color .3s var(--ease), border-color .3s var(--ease); }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--fg); border-color: var(--fg); }
.top nav a.sign { color: var(--bg); background: var(--fg); border: 0; padding: 7px 12px; border-radius: var(--radius); }
.top nav a.sign:hover { background: var(--solid-hover); }
@media (max-width: 900px) { .top nav a:not(.sign):not(.keep) { display: none; } }
.wordmark, .top nav a { white-space: nowrap; }
/* Phones and tablets: the name and one Menu button; the pages open in a
   full-screen sheet. */
.menu-btn { display: none; margin-left: auto; align-items: center; gap: 10px; background: none; border: 0; padding: 8px 0; color: var(--fg); cursor: pointer;
  font: 400 var(--f-number)/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.menu-btn .bars { position: relative; width: 18px; height: 7px; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; transition: transform .3s var(--ease), height .3s var(--ease); }
.menu-btn[aria-expanded="true"] .bars { height: 0; border-bottom: 0; transform: none; }
.menu { position: fixed; inset: 56px 0 0 0; z-index: 9; background: var(--bg); border-top: 1px solid var(--rule); padding: 2rem clamp(16px, 2.2vw, 32px) 3rem; overflow-y: auto; display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem; }
.menu[hidden] { display: none; }
.menu-links { display: flex; flex-direction: column; }
.menu-links a { font: 400 clamp(1.75rem, 7vw, 2.5rem)/1.1 var(--sans); letter-spacing: -.02em; color: var(--fg); padding: .9rem 0; border-bottom: 1px solid var(--rule); }
.menu-links a[aria-current="page"] { color: var(--fg-2); }
.menu-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 900px) { .top nav { display: none; } .menu-btn { display: inline-flex; } }
@media (min-width: 901px) { .menu { display: none !important; } }
body.menu-open { overflow: hidden; }

/* sections: a hairline, then the number and label in the mono */
section { padding: clamp(4.5rem, 9vw, 10rem) 0; }
section.tight { padding-top: clamp(2rem, 4vw, 4rem); }
.rule { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.sect-label { display: flex; gap: 18px; align-items: baseline; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.sect-label .n { font: 400 var(--f-number)/1 var(--mono); color: var(--fg-3); }
.sect-label .t { font: 400 var(--f-number)/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-2); }

/* the hero */
.hero { padding: clamp(5rem, 11vw, 10rem) 0 clamp(4rem, 8vw, 7rem); }
.hero .lead { margin-top: 2rem; max-width: 30em; color: var(--fg-2); }
.hero .avail { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 12px 12px; align-items: center; }
.hero .avail .state { margin-right: 16px; }
.state { display: inline-flex; align-items: center; gap: 8px; font: 400 var(--f-number)/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-2); }
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--control); }
.state.now::before { background: var(--sada); }
.state.now { color: var(--fg); }

/* buttons: small, square-shouldered, sentence case */
.btn { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--rule-lit); border-radius: var(--radius); font: 500 var(--f-caption)/1 var(--sans); color: var(--fg); transition: border-color .3s var(--ease), background .3s var(--ease); }
.btn:hover { border-color: var(--fg); }
.btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.primary:hover { background: var(--solid-hover); border-color: var(--solid-hover); }
.link { color: var(--fg); border-bottom: 1px solid var(--rule-lit); padding-bottom: 1px; transition: border-color .3s var(--ease); }
.link:hover { border-color: currentColor; }

/* the record of a session: a panel on the ink, the marks in their dark shades */
.session { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.5rem 1.75rem; }
.session .line { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; padding: .4rem 0; font: 400 var(--f-caption)/1.6 var(--mono); color: var(--fg); }
.session .who { color: var(--fg-3); text-transform: uppercase; letter-spacing: .04em; }
.session .line.you .who { color: var(--mada); }
.session .line.step { color: var(--fg-2); }
.session .line.check .who { color: var(--sada); }
.session .line.check { color: var(--fg); }
.session .num { color: var(--fg); }
.session .line.say { margin-top: .6rem; padding-top: 1rem; border-top: 1px solid var(--rule); font: 400 .9375rem/1.55 var(--sans); letter-spacing: -.005em; color: var(--fg); }
.session .line.say .who { font: 400 var(--f-caption)/1.6 var(--mono); padding-top: .1rem; }
.arrive { opacity: 0; transform: translateY(6px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.arrive.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .arrive { opacity: 1; transform: none; transition: none; } }

/* ledger lists: rows and hairlines */
.ledger { border-top: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); padding: 1.35rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.row .name { grid-column: span 3; font: 400 var(--f-h4)/1.2 var(--sans); letter-spacing: -.01em; color: var(--fg); }
.row .what { grid-column: span 7; margin: 0; max-width: 60ch; }
.row .st { grid-column: span 2; justify-self: end; }
@media (max-width: 800px) { .row { grid-template-columns: 1fr; gap: .4rem; } .row > * { grid-column: auto; } .row .st { justify-self: start; } }

/* pairs: bordered panels of equal weight, as Lisgen's cards */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gutter); }
.pair { row-gap: clamp(2.5rem, 4vw, 3.5rem); column-gap: clamp(24px, 4.5vw, 72px); }
.pair > div { border-top: 1px solid var(--rule-lit); padding: 1.25rem 0 0; }
.pair .q { font: 400 var(--f-number)/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-2); margin-bottom: 1.5rem; }
.pair .heading { margin-bottom: 1rem; }
.pair p:not(.heading) { font-size: .9375rem; }
@media (max-width: 800px) { .pair { grid-template-columns: 1fr; } .cols > * { grid-column: span 12; } }

/* the identity document: the machine's own words, quoted */
.doc { font: 400 var(--f-caption)/1.7 var(--mono); background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 0; white-space: pre; overflow-x: auto; color: var(--fg); }
.doc .k { color: var(--fg-3); } .doc .m { color: var(--mada); } .doc .s { color: var(--sada); }

/* comparison as a ledger, not a scorecard */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 1rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font: 400 var(--f-number)/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-2); }
td { padding-right: var(--gutter); color: var(--fg); }
td.yes { color: var(--sada); }
td.not { color: var(--fg-3); }
.tablewrap { overflow-x: auto; }

/* closing */
.close { text-align: center; }
.close .display { margin: 0 auto; }
.close .avail { justify-content: center; }
.close .lead { color: var(--fg-2); }

footer { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: baseline; }
footer a, footer span { font: 400 var(--f-number)/1.6 var(--mono); color: var(--fg-2); letter-spacing: .02em; }
footer a:hover { color: var(--fg); }
footer .right { margin-left: auto; }

a:focus-visible, button:focus-visible { outline: 2px solid var(--sada); outline-offset: 3px; }

[hidden] { display: none !important; }

/* the light theme: the same page on paper, chosen by the switch */
:root[data-theme="light"] {
  --bg: #fafaf8; --panel: #f2f2ef; --panel-2: #e9e9e5;
  --fg: #111; --fg-2: #5e5e5b; --fg-3: #85857f;
  --rule: #dededa; --rule-lit: #c3c3be; --control: #a3a39e;
  --mada: #9a6a12; --sada: #2f6f60;
  --top: rgba(250, 250, 248, .88); --solid-hover: #000;
  color-scheme: light;
}
.theme { font: 400 var(--f-number)/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-2); background: none; border: 1px solid var(--rule-lit); border-radius: var(--radius); padding: 7px 9px; cursor: pointer; }
.theme:hover { color: var(--fg); border-color: var(--fg); }
.mark { display: inline-flex; gap: 6px; align-items: center; margin-right: 10px; }
.mark i { display: block; border-radius: 50%; }
.mark i:first-child { width: 11px; height: 11px; background: var(--mada); }
.mark i:last-child { width: 7px; height: 7px; background: var(--sada); }
.row .name a { border-bottom: 1px solid var(--rule-lit); transition: border-color .3s var(--ease); }
.row .name a:hover { border-color: currentColor; }
.row .st a { font: 400 var(--f-number)/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-2); }
.row .st a:hover { color: var(--fg); }
