/* The shell: what every page has, however deep. The tabs, the line under
   them, the way on at the bottom, and the map behind the "+". Loaded with
   rooms.css on the doors and rooms, and with site.css on the deep pages,
   so its tokens are prefixed to stay out of that one's way. */

@font-face { font-family: "Figtree"; src: url(/fonts/figtree.woff2) format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
  --v-ink: #0D0D0C;
  --v-red: #DE1B33;
  --v-paper: #FFFFFF;
  --v-grey: #ECECEA;
  --v-type: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --v-ease: cubic-bezier(.2, .7, .2, 1);
}

.tone-ink { --bg: var(--v-ink); --fg: #F4F1EC; --soft: rgba(244, 241, 236, .62); --line: rgba(244, 241, 236, .16); --accent: var(--v-red); }
.tone-red { --bg: var(--v-red); --fg: #FFFFFF; --soft: rgba(255, 255, 255, .78); --line: rgba(255, 255, 255, .28); --accent: var(--v-ink); }
.tone-cream { --bg: #F6F0E4; --fg: var(--v-ink); --soft: rgba(13, 13, 12, .62); --line: rgba(13, 13, 12, .12); --accent: var(--v-red); }
.tone-paper { --bg: var(--v-paper); --fg: var(--v-ink); --soft: rgba(13, 13, 12, .6); --line: rgba(13, 13, 12, .12); --accent: var(--v-red); }
.tone-grey { --bg: var(--v-grey); --fg: var(--v-ink); --soft: rgba(13, 13, 12, .62); --line: rgba(13, 13, 12, .13); --accent: var(--v-red); }

/* Coming through the What door, its room arrives red and settles to cream.
   Registered so the colors inherit as they animate. */
@property --bg { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --fg { syntax: "<color>"; inherits: true; initial-value: black; }
@property --soft { syntax: "<color>"; inherits: true; initial-value: black; }
@property --line { syntax: "<color>"; inherits: true; initial-value: transparent; }
.from-doors .settle.tone-cream { animation: settle 1.1s .45s var(--v-ease) backwards; }
@keyframes settle {
  from { --bg: var(--v-red); --fg: #FFFFFF; --soft: rgba(255, 255, 255, .78); --line: rgba(255, 255, 255, .28); }
}

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 20; }
.tabs { display: flex; align-items: stretch; height: 56px; background: var(--v-ink); font-family: var(--v-type); }
.tabs-home { display: grid; place-content: center; width: 64px; flex: none; }
.tabs-mail { display: grid; place-content: center; width: 60px; flex: none; color: rgba(244, 241, 236, .72); transition: color .15s; }
.tabs-mail:hover, .tabs-mail[aria-current] { color: #F4F1EC; }
.tabs-mail:focus-visible { outline: 2px solid var(--v-red); outline-offset: -6px; }
.tab { flex: 1; min-width: 0; display: flex; align-items: center; gap: .55em; padding: 0 clamp(12px, 2vw, 24px); background: var(--bg); color: var(--fg); text-decoration: none; font: 600 clamp(1rem, 1.6vw, 1.3rem)/1 var(--v-type); letter-spacing: -.01em; white-space: nowrap; transition: flex-grow .45s var(--v-ease); }
.tab:hover { flex-grow: 1.3; }
.tab[aria-current] { flex-grow: 2.4; font-weight: 760; }

/* The line under the tabs: everything behind the door you're in. */
.sub { display: flex; gap: clamp(16px, 2.2vw, 30px); align-items: center; height: 40px; padding: 0 clamp(16px, 4vw, 48px) 0 calc(64px + clamp(12px, 2vw, 24px)); overflow-x: auto; scrollbar-width: none; background: var(--bg); color: var(--fg); box-shadow: inset 0 -1px 0 var(--line); font: 520 .92rem/1 var(--v-type); white-space: nowrap; }
.sub::-webkit-scrollbar { display: none; }
.sub a { color: var(--soft); text-decoration: none; padding: 6px 0; }
.sub a:hover { color: var(--fg); }
.sub a[aria-current] { color: var(--fg); font-weight: 680; box-shadow: inset 0 -2px 0 currentColor; }

.tabs .ai-switch { --w-muted: rgba(244, 241, 236, .6); --w-fg: #F4F1EC; --w-line: rgba(244, 241, 236, .2); flex: none; margin: 0; padding: 0 clamp(12px, 1.6vw, 20px); border-radius: 0; font-family: var(--v-type); }

@media (max-width: 760px) {
  .tab { padding: 0 10px; font-size: .98rem; }
  .sub { padding-left: 16px; }
  .tabs .ai-switch-label { display: none; }
  .tabs-home { width: 48px; }
  .tabs-mail { width: 44px; }
}

/* ── The way on: the bottom of every deep page ────────────────────────── */
.onward { background: var(--bg); color: var(--fg); --faint: var(--soft); font-family: var(--v-type); border-top: 1px solid var(--line); }
.onward-inner { max-width: 1320px; margin: 0 auto; padding: clamp(48px, 7vw, 96px) clamp(16px, 4vw, 48px) 28px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 26px clamp(24px, 4vw, 64px); align-items: start; }
.onward a { color: inherit; text-decoration: none; }
.onward-up { font: 720 clamp(1.8rem, 4vw, 3.4rem)/1 var(--v-type); letter-spacing: -.035em; }
.onward-up span { display: inline-block; transition: transform .3s var(--v-ease); }
.onward-up:hover span { transform: translateX(-8px); }
.onward-near { grid-column: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 26px; font: 560 clamp(1.05rem, 1.5vw, 1.25rem)/1.3 var(--v-type); }
.onward-near a { color: var(--soft); }
.onward-near a:hover { color: var(--fg); }
.onward .onward-next { grid-column: 2; grid-row: 1 / span 2; display: grid; gap: 8px; min-width: min(320px, 100%); padding: 22px 26px 24px; border-radius: 14px; background: var(--bg); color: var(--fg); box-shadow: 0 0 0 1px var(--line), 0 24px 50px -30px rgba(0, 0, 0, .5); font: 760 clamp(2.2rem, 4vw, 3.4rem)/.9 var(--v-type); letter-spacing: -.045em; transition: transform .25s var(--v-ease); }
.onward-next:hover { transform: translateY(-3px); }
.onward-sub { font: 500 1.05rem/1.2 var(--v-type); letter-spacing: -.01em; color: var(--soft); }
.onward-next > span:last-child { font-size: 1.4rem; letter-spacing: 0; }
.onward-base { grid-column: 1 / -1; margin-top: clamp(28px, 4vw, 56px); padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; color: var(--soft); font-size: .9rem; }
@media (max-width: 760px) {
  .onward-inner { grid-template-columns: 1fr; }
  .onward-next { grid-column: 1; grid-row: auto; }
}

/* ── Deep pages: the full site's pages, set in this site's type ──────── */
/* Light pages trade the full site's bone for the app's white and grey.
   There's one theme, light; the green server pages keep their colors. */
html.deep { --f-text: var(--v-type); scroll-padding-top: 112px; }
html.deep[data-tone="light"] { --bg: var(--v-paper); --surface: #F4F4F2; }
.deep .page-top { padding-top: clamp(56px, 8vw, 112px); }

/* ── The "+": a map of everything, by door ─────────────────────────────── */
.plus { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--soft); order: 2; margin-left: auto; transition: transform .3s var(--v-ease), background .2s; }
.plus::before, .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 1.5px; background: var(--fg); transform: translate(-50%, -50%); }
.plus::after { transform: translate(-50%, -50%) rotate(90deg); transition: opacity .2s; }

.all-btn { position: fixed; z-index: 40; right: clamp(14px, 2vw, 24px); bottom: clamp(14px, 2vw, 24px); width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; display: grid; place-content: center; cursor: pointer; background: var(--v-ink); box-shadow: 0 0 0 1px rgba(244, 241, 236, .25); opacity: .55; transition: opacity .2s; }
.all-btn:hover, .all-btn[aria-expanded="true"] { opacity: 1; }
.all-btn .plus { margin: 0; --soft: transparent; --fg: #F4F1EC; width: 22px; height: 22px; }
.all-btn[aria-expanded="true"] .plus { transform: rotate(45deg); }
.all { position: fixed; z-index: 39; right: clamp(14px, 2vw, 24px); bottom: calc(clamp(14px, 2vw, 24px) + 52px); width: min(340px, calc(100vw - 28px)); max-height: calc(100svh - 110px); overflow-y: auto; padding: 10px; border-radius: 14px; background: var(--v-ink); color: #F4F1EC; font-family: var(--v-type); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); animation: all-open .25s var(--v-ease); }
@keyframes all-open { from { opacity: 0; transform: translateY(-4px); } }
.all ul { list-style: none; margin: 0; padding: 0; }
.all a { color: inherit; text-decoration: none; }
.all-door + .all-door { margin-top: 6px; }
.all-word { display: block; padding: 9px 12px; border-radius: 8px; background: var(--bg); color: var(--fg); box-shadow: inset 0 0 0 1px rgba(244, 241, 236, .14); font: 720 1.05rem/1 var(--v-type); letter-spacing: -.01em; }
.all-door ul { padding: 4px 12px 2px; }
.all-door li a { display: block; padding: 6px 0; color: rgba(244, 241, 236, .82); }
.all-door li a:hover { color: #fff; text-decoration: underline; text-underline-offset: .2em; }

@media (prefers-reduced-motion: reduce) {
  .tab, .onward-up span, .onward-next, .all { transition: none; animation: none; }
}
