/* eco-ui.css -- the Home door's look, for every other page. Linked LAST.

   One sheet instead of nineteen pasted copies: Josh, 5 Oct, "we want the hard
   work we did on the home page on every page". The source of truth is the
   #intro door in index.html: dark ground with a gold and violet bloom, EB
   Garamond for the voice, wide-tracked Jost small caps for labels, glass
   cards held by a one-pixel gold hairline, and the gold-to-violet wordmark.

   It restyles by the element and class names the pages already share
   (header, .kicker, h1, h2, .card, .note, button, nav, #back), so a page
   needs one <link> and no markup change. Each rule is prefixed `html body`
   to out-rank a page's own <style> without !important.

   THE FRAME. wordmark.css draws the gold perimeter at inset:env(safe-area-*),
   which on a phone with no status bar left a ~47 px black band above the line
   and let text run out past the bottom of it (Josh's screenshots, 5 Oct).
   Here the frame is full-bleed, the page's own scroller sits inside it, and
   the safe-area insets pad the CONTENT instead. */

:root {
  --gold: #e9c46a; --gold-hi: #ffe9b5; --royal: #a78bfa; --royal-deep: #6d28d9;
  --eco-ink: rgba(255,255,255,.88); --eco-dim: rgba(255,255,255,.68);
  --eco-warm: #ffe6c2;
  --eco-glass: rgba(12,16,14,.62);
  --eco-hair: rgba(233,196,106,.34);
  --eco-hair-hi: rgba(233,196,106,.7);
  --eco-top: env(safe-area-inset-top, 0px);
  --eco-bot: env(safe-area-inset-bottom, 0px);
  --eco-serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --eco-ui: "Jost", "Avenir Next", "Helvetica Neue", -apple-system, sans-serif;
}

/* ---- the ground ---- */
html:root {
  background-color: #060908;
  background:
    radial-gradient(ellipse 80% 50% at 50% -8%, rgba(233,196,106,.10), transparent 70%),
    radial-gradient(ellipse 70% 45% at 100% 105%, rgba(109,40,217,.16), transparent 70%),
    radial-gradient(ellipse at 50% 45%, rgba(6,9,8,.82) 0%, rgba(6,9,8,.93) 58%, rgba(4,6,6,.97) 100%),
    #060908;
  background-attachment: fixed;
}
/* Transparent body so a page's #bleed photo (z-index -1) still shows. */
html body {
  background: transparent;
  color: var(--eco-ink);
  font-family: var(--eco-serif);
}
html body ::selection { background: rgba(233,196,106,.32); color: #fff; }

/* ---- the frame: full-bleed, always at the very top of the screen ---- */
html body::after {
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 14px;
}
@media (max-width: 600px) {
  html body::after { border-radius: 40px; }
  /* Content is padded inside the frame, not the frame inside the content. */
  html body { padding-bottom: calc(80px + var(--eco-bot)); }
  html body .wrap { padding-left: max(22px, env(safe-area-inset-left)); padding-right: max(22px, env(safe-area-inset-right)); }
}

/* ---- slim top chrome: the way back is a hairline label, never a button ---- */
html body #back, html body a.back {
  position: fixed; z-index: 400;
  top: max(8px, calc(var(--eco-top) / 2 - 11px));
  left: max(16px, env(safe-area-inset-left));
  right: auto; bottom: auto;
  display: inline-flex; align-items: center; height: 22px; width: auto; min-height: 0;
  margin: 0; padding: 0 2px; border: 0; border-radius: 0; background: none; box-shadow: none;
  font: 500 9px/1 var(--eco-ui); letter-spacing: .28em; text-transform: uppercase;
  color: var(--eco-dim); text-decoration: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
html body #back::before, html body a.back::before { content: ''; position: absolute; inset: -11px -14px; }
html body #back:hover, html body a.back:hover, html body #back:focus-visible { color: var(--eco-warm); }
/* On desktop there is room for the frame's breathing space. */
@media (min-width: 601px) {
  html body #back, html body a.back { top: 18px; left: 26px; font-size: 10px; }
}

/* ---- the wordmark and the kicker line ---- */
html body .kicker {
  font-family: var(--eco-ui); font-size: 9px; font-weight: 500;
  letter-spacing: .34em; text-transform: uppercase; color: var(--eco-dim);
}
html body .kicker a { color: var(--eco-dim); }
html body .kicker a[href$="#map"] { display: none; }
html body .kicker a:hover { color: var(--eco-warm); }
html body .kicker a.wordmark { color: var(--gold); }

/* ---- headings: Garamond title, Jost small-cap section labels ---- */
html body h1 { font-family: var(--eco-serif); font-weight: 400; letter-spacing: .01em; color: #fff; }
html body h1 em { font-style: normal; color: var(--gold); }
html body header { border-bottom-color: var(--eco-hair); position: relative; }
html body header::after {
  content: ''; position: absolute; left: 0; bottom: -1px; width: 72px; height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--royal));
}
html body h2 {
  font-size: 11px; line-height: 1.5; padding-bottom: 13px;
  font-family: var(--eco-ui); font-weight: 500; letter-spacing: .34em; text-transform: uppercase;
  color: var(--gold); border-bottom: 1px solid var(--eco-hair);
}
html body h3 { font-family: var(--eco-serif); font-weight: 400; color: #fff; }

/* ---- glass cards held by a gold hairline ---- */
html body .card, html body .who, html body .panel, html body .box {
  background: var(--eco-glass); border: 1px solid var(--eco-hair); border-radius: 2px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
html body .card b, html body .who em { font-family: var(--eco-ui); color: var(--eco-warm); }
html body .note { border-left: 2px solid var(--gold); }
html body .note b { font-family: var(--eco-ui); color: var(--gold); }
html body .note.warn { border-left-color: #e5654a; }
html body .note.warn b { color: #e5654a; }

/* ---- the section nav that sticks under the header ---- */
html body nav { border-bottom-color: var(--eco-hair); }
html body nav a { font-family: var(--eco-ui); letter-spacing: .26em; }
html body nav a:hover { color: var(--eco-warm); }

/* ---- buttons: the Home door's, with a gold hairline ---- */
html body button, html body .go {
  font-family: var(--eco-ui); font-weight: 500; letter-spacing: .26em; text-transform: uppercase;
  border: 1px solid var(--eco-hair-hi); border-radius: 2px;
  background: linear-gradient(180deg, rgba(233,196,106,.16), rgba(233,196,106,.05));
  color: var(--gold-hi); transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
html body button:hover:not(:disabled), html body .go:hover {
  background: linear-gradient(180deg, rgba(233,196,106,.28), rgba(233,196,106,.1));
  color: #fff; border-color: var(--gold);
}
html body button.quiet, html body .go.quiet {
  border-color: rgba(255,255,255,.2); background: rgba(12,16,14,.6); color: var(--eco-dim);
}
html body button.quiet:hover:not(:disabled), html body .go.quiet:hover { color: var(--eco-warm); border-color: var(--eco-hair-hi); }
html body button:focus-visible, html body .go:focus-visible, html body a:focus-visible,
html body input:focus-visible, html body textarea:focus-visible, html body select:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}

/* ---- fields ---- */
html body input, html body textarea, html body select {
  background: rgba(12,16,14,.62); border: 1px solid rgba(255,255,255,.18); border-radius: 2px;
  color: #fff; font-family: var(--eco-serif);
}
html body input:focus, html body textarea:focus, html body select:focus { border-color: var(--gold); }
html body label { font-family: var(--eco-ui); letter-spacing: .26em; }

/* ---- messages ---- */
html body .msg.ok, html body .ok { border-color: rgba(233,196,106,.5); background: rgba(233,196,106,.1); color: var(--gold-hi); }

/* ---- links in running text ---- */
html body p a, html body li a, html body .foot a { color: var(--gold-hi); text-decoration-color: rgba(233,196,106,.45); text-underline-offset: 3px; }
html body p a:hover, html body li a:hover, html body .foot a:hover { color: #fff; }

/* ---- a quiet footer line every page can use ---- */
.eco-foot {
  margin: 56px 0 0; padding-top: 22px; border-top: 1px solid var(--eco-hair);
  font: 500 9px/1.9 var(--eco-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--eco-dim);
}
.eco-foot a { color: var(--eco-dim); text-decoration: none; margin-right: 18px; }
.eco-foot a:hover { color: var(--eco-warm); }

@media (prefers-reduced-motion: reduce) { html body button, html body .go { transition: none; } }
@media (forced-colors: active) {
  html body header::after { display: none; }
  html body .card, html body .who { border-color: CanvasText; }
}
