/*
 * Styling for the umbrella site's own page types — the site header and nav,
 * venture tiles, forms and account pages.
 *
 * Layered on top of styles.css rather than replacing it: every colour, face and
 * measure below comes from the tokens already defined there, so the trading
 * pages and the umbrella pages cannot drift apart. Nothing here redefines a
 * custom property.
 */

/* --- skip link ---------------------------------------------------------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip:focus {
  left: 0;
}

/* --- site header -------------------------------------------------------- */
.site-head {
  border-bottom: 1px solid color-mix(in srgb, var(--stone) 25%, transparent);
  background: color-mix(in srgb, var(--marble) 92%, transparent);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}
.site-head-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.85rem var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
/* A small marker rather than a logo file — one less asset to load, and it
   inherits the accent so it stays correct in both themes. */
.brand-mark {
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid var(--patina);
  transform: rotate(45deg);
  flex: none;
}
.brand-name {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.6rem);
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover {
  color: var(--ink);
  border-bottom-color: color-mix(in srgb, var(--patina) 50%, transparent);
}
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--patina);
}
.nav-account {
  padding: 0.35rem 0.8rem !important;
  border: 1px solid color-mix(in srgb, var(--stone) 40%, transparent);
  border-radius: 2px;
}

/* --- reader controls: theme + text size ---------------------------------
   Same mechanism the umbrella masthead uses — data-theme/data-font on
   <html>, read before first paint and driven by mtg.js, now loaded here
   too — in THIS stylesheet's own patina palette rather than the umbrella's
   gold. Both shells read the same 'mtg-theme'/'mtg-font' localStorage keys,
   so a preference set on the dashboard carries over here, and vice versa:
   one visitor, one set of preferences, even across two stylesheets. */
:root[data-font="lg"] { font-size: 112.5%; }
:root[data-font="xl"] { font-size: 125%; }

.nav-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin-left: 0.35rem;
  background: none;
  border: 1px solid color-mix(in srgb, var(--stone) 40%, transparent);
  border-radius: 2px;
  color: var(--ink-soft);
  cursor: pointer;
  flex: none;
}
.nav-theme:hover { border-color: var(--patina); color: var(--patina); }
.nav-theme svg { width: 1rem; height: 1rem; }
.nav-theme .theme-label { display: none; }

.nav-font {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: 1px solid color-mix(in srgb, var(--stone) 40%, transparent);
  border-radius: 2px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.38rem 0.55rem;
  line-height: 1;
}
.nav-font:hover { border-color: var(--patina); color: var(--patina); }
.nav-font .a-sm { font-size: 0.72em; }
.nav-font .a-lg { font-size: 1.05em; }

/* --- page structure ----------------------------------------------------- */
.band-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gap);
}
.band-inner.narrow,
.form-narrow {
  max-width: var(--measure);
}
.form-narrow {
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gap);
}
.page-head {
  border-bottom: 1px solid color-mix(in srgb, var(--stone) 20%, transparent);
}
.page-head .band-inner {
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.page-head h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.5rem;
  text-wrap: balance;
}
.lede {
  color: var(--ink-soft);
  font-size: 1.1rem;
  max-width: var(--measure);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--stone);
  margin: 0 0 0.75rem;
}
.band-sub {
  color: var(--stone);
  margin: 0 0 2rem;
}
.prose p {
  max-width: var(--measure);
  line-height: 1.7;
}
.prose h2 {
  font-family: var(--display);
  margin-top: 2.5rem;
}
.note {
  font-size: 0.92rem;
  color: var(--stone);
  border-left: 2px solid color-mix(in srgb, var(--patina) 45%, transparent);
  padding-left: 1rem;
  max-width: var(--measure);
}

/* --- home hero ---------------------------------------------------------- */
.hero-home .hero-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 10vw, 7rem) var(--gap);
}
.hero-home h1 {
  font-family: var(--display);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* --- buttons ------------------------------------------------------------ */
.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border: 1px solid var(--patina);
  border-radius: 2px;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.btn:hover {
  background: color-mix(in srgb, var(--patina) 12%, transparent);
}
.btn-primary {
  background: var(--patina);
  border-color: var(--patina);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--patina-bright);
  border-color: var(--patina-bright);
}

/* --- venture tiles ------------------------------------------------------ */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1px;
  background: color-mix(in srgb, var(--stone) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--stone) 22%, transparent);
}
.tile {
  display: block;
  padding: 1.6rem;
  background: var(--marble);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s ease;
}
.tile:hover {
  background: var(--paper);
}
.tile-field {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--stone);
  margin-bottom: 0.6rem;
}
.tile-name {
  font-family: var(--display);
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
}
.tile-blurb {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 1rem;
  line-height: 1.55;
}
/* Stage is semantic: it tells someone whether a thing actually exists yet.
   Deliberately not colour-only — the word is always there too. */
.tile-stage {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--stone);
}
.tile-stage[data-stage="live"] {
  color: var(--patina);
}

/* --- ventures list ------------------------------------------------------ */
.ventures-list {
  display: grid;
  gap: 2.5rem;
}
.venture header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.venture h2 {
  font-family: var(--display);
  margin: 0.2rem 0;
  font-size: 1.6rem;
}
.venture h2 a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--patina) 45%, transparent);
}
.venture p {
  max-width: var(--measure);
  line-height: 1.7;
  color: var(--ink-soft);
}
.more {
  color: var(--patina);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  font-size: 0.95rem;
}

/* --- Maximus slots ------------------------------------------------------ */
.mx-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
}
.mx-slot {
  margin: 0;
}
/* An empty slot is shown as an empty slot. A missing brief is better visible
   than tidied away — this is the one place the site admits to being unfinished,
   and it should, until the images arrive. */
.mx-empty {
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--stone) 55%, transparent);
  color: var(--stone);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--paper) 60%, transparent);
}
.mx-slot figcaption {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: var(--stone);
}

/* --- inspiration shelves ------------------------------------------------ */
.shelves {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 2.5rem;
}
.shelf h2 {
  font-family: var(--display);
  font-size: 1.3rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--stone) 25%, transparent);
}
.shelf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.shelf-title {
  display: block;
  font-weight: 600;
}
.shelf-note {
  display: block;
  color: var(--stone);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* --- forms -------------------------------------------------------------- */
.field {
  margin-bottom: 1.4rem;
}
.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.field input,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--stone) 45%, transparent);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--patina);
  outline-offset: 1px;
  border-color: var(--patina);
}
.field-bad input,
.field-bad textarea {
  border-color: var(--risk);
}
.hint {
  font-size: 0.85rem;
  color: var(--stone);
  margin: 0.35rem 0 0;
}
/* Errors are never colour-only — the text says what is wrong, and the input
   carries aria-invalid, so this reads the same to someone who cannot see red. */
.err {
  font-size: 0.85rem;
  color: var(--risk);
  margin: 0.35rem 0 0;
}
.alert {
  padding: 0.85rem 1rem;
  border-radius: 2px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.alert-bad {
  border: 1px solid var(--risk);
  color: var(--risk);
  background: color-mix(in srgb, var(--risk) 8%, transparent);
}
.alert-ok {
  border: 1px solid var(--patina);
  color: var(--patina);
  background: color-mix(in srgb, var(--patina) 8%, transparent);
}
.form-alt {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--stone);
}
.form-narrow h2 {
  font-family: var(--display);
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid color-mix(in srgb, var(--stone) 22%, transparent);
}
.form-narrow h2:first-of-type {
  margin-top: 1rem;
}

/* --- footer ------------------------------------------------------------- */
.site-foot {
  border-top: 1px solid color-mix(in srgb, var(--stone) 25%, transparent);
  margin-top: 4rem;
}
.foot-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem var(--gap);
  display: grid;
  gap: 1rem;
}
.foot-note {
  max-width: var(--measure);
  font-size: 0.9rem;
  color: var(--stone);
  line-height: 1.6;
  margin: 0;
}
.foot-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.foot-nav a,
.foot-note a {
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.foot-copy {
  font-size: 0.85rem;
  color: var(--stone-light);
  margin: 0;
}

/* --- admin tables ------------------------------------------------------- */
/* Wide content scrolls inside its own container so the page body never
   scrolls sideways on a phone. */
.table-wrap {
  overflow-x: auto;
  border: 1px solid color-mix(in srgb, var(--stone) 25%, transparent);
}
table.data {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}
table.data th,
table.data td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--stone) 18%, transparent);
  white-space: nowrap;
}
table.data th {
  background: var(--paper);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--stone);
}
table.data td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* --- admin -------------------------------------------------------------- */
.admin-tabs {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.admin-tabs a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}
.admin-tabs a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--patina);
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px;
  background: color-mix(in srgb, var(--stone) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--stone) 22%, transparent);
  margin-bottom: 2rem;
}
.stat {
  background: var(--marble);
  padding: 1.2rem;
  display: grid;
  gap: 0.3rem;
}
/* Severity is carried by a stripe as well as a colour, so it survives being
   printed, screenshotted in greyscale, or read by someone colourblind. */
.stat-warn {
  border-left: 3px solid var(--risk);
}
.stat-n {
  font-family: var(--display);
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-l {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--stone);
}
.note-cell {
  white-space: normal !important;
  max-width: 22rem;
  color: var(--stone);
}
.row-out td {
  opacity: 0.55;
}
form.inline {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}
form.inline select {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.25rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--stone) 40%, transparent);
}
.btn-sm {
  padding: 0.25rem 0.7rem;
  font-size: 0.85rem;
}
.compose {
  max-width: var(--measure);
}
