/* ==========================================================================
   CRUX Monographic History — cruxhistory.com
   Built to Crux Brand Guidelines v1.0 (June 2026).
   Six colours, no others. Two typefaces, no others.
   Square corners. No gradients. No shadows. Crimson as accent only.
   No web fonts: Georgia and the system sans are on every device, and
   loading a font from a third party would contradict the Privacy Notice.
   ========================================================================== */

:root {
  /* The approved six */
  --charcoal:   #111111;  /* primary text, wordmark, structural lines */
  --crimson:    #8B0000;  /* accent, crux node, active states */
  --linen:      #E8E0CF;  /* canvas background, all primary surfaces */
  --parchment:  #D0CFC5;  /* callout boxes, thesis panels, secondary surfaces */
  --grey:       #888888;  /* subheadings, captions, secondary labels */
  --ink:        #333333;  /* body text on light backgrounds */

  --serif: Georgia, 'Cormorant Garamond', 'Times New Roman', serif;
  --sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --measure: 36rem;
  --gutter:  clamp(1.5rem, 5vw, 4rem);
  --rule:    #D0CFC5;   /* Parchment, used for hairline separators */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
}

/* --------------------------------------------------------------- masthead */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--gutter);
  border-bottom: 1px solid var(--charcoal);
}

.masthead__mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.masthead__mark img {
  display: block;
  height: clamp(52px, 6vw, 68px);
  width: auto;
}

/* ------------------------------------------------------------- menu toggle */

.menu-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
  color: var(--charcoal);
  z-index: 50;
}

.menu-toggle span {
  position: absolute;
  left: 9px;
  width: 26px;
  height: 1px;
  background: currentColor;
  transition: transform 180ms ease, opacity 120ms ease;
}

.menu-toggle span:nth-child(1) { top: 15px; }
.menu-toggle span:nth-child(2) { top: 21.5px; }
.menu-toggle span:nth-child(3) { top: 28px; }

.menu-toggle[aria-expanded="true"] { color: var(--linen); }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { top: 21.5px; transform: rotate(-45deg); }

/* -------------------------------------------------------------- menu panel
   Secondary logo variation: black background, per the guidelines.
   Crimson is an accent here, never the surface.                            */

.menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 200ms ease, visibility 0s linear 200ms;
}

.menu[data-open="true"] {
  visibility: visible;
  opacity: 1;
  transition: opacity 200ms ease;
}

.menu__list { list-style: none; margin: 0; padding: 0 var(--gutter); }

.menu__list li { border-bottom: 1px solid var(--ink); }
.menu__list li:first-child { border-top: 1px solid var(--ink); }

.menu__list a {
  display: block;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--linen);
  text-decoration: none;
  padding: 1.5rem 0;
  min-width: 16rem;
  position: relative;
}

.menu__list a::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 50%;
  width: 4px;
  height: 4px;
  background: var(--crimson);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 140ms ease;
}

.menu__list a:hover::before,
.menu__list a:focus-visible::before { opacity: 1; }

/* -------------------------------------------------------------------- cover */

.cover {
  min-height: calc(100vh - 104px);
  min-height: calc(100svh - 104px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem var(--gutter) 5rem;
}

/* Wordmark: high-contrast serif at generous scale. The crimson dot marks
   the intersection of the X — the visual crux. */

.cover__logo {
  display: block;
  width: min(88vw, 46rem);
  height: auto;
  margin: 0 auto;
}

.cover__rule {
  width: 100%;
  max-width: 22rem;
  height: 1px;
  background: var(--charcoal);
  border: 0;
  margin: 3rem auto;
}

.cover__tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.125rem, 0.9rem + 1vw, 1.75rem);
  color: var(--crimson);
  margin: 0;
  letter-spacing: 0.01em;
}

/* -------------------------------------------------------------- store badges */

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 3.25rem;
}

.stores__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.65rem 1.35rem;
  border: 1px solid var(--charcoal);
  text-decoration: none;
  color: var(--charcoal);
  background: transparent;
  transition: background-color 150ms ease, color 150ms ease;
}

.stores__badge:hover,
.stores__badge:focus-visible { background: var(--charcoal); color: var(--linen); }

.stores__badge svg { width: 20px; height: 20px; flex: none; fill: currentColor; }

.stores__text { text-align: left; line-height: 1.2; font-family: var(--sans); }

.stores__pre {
  display: block;
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.7;
}

.stores__name {
  display: block;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stores__note {
  font-family: var(--sans);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--crimson);
  margin: 1.5rem 0 0;
}

.stores__badge--soon {
  position: relative;
  cursor: default;
}

.stores__badge--soon:hover,
.stores__badge--soon:focus-visible {
  background: transparent;
  color: var(--charcoal);
}

.stores__flag {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--crimson);
  color: var(--linen);
  font-family: var(--sans);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.35rem 0;
  pointer-events: none;
}

/* --------------------------------------------------------------- documents */

.document {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) var(--gutter) 5rem;
}

.document__eyebrow {
  font-family: var(--sans);
  font-size: 0.625rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--crimson);
  margin: 0 0 0.75rem;
}

.document__meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
  margin: -1.5rem 0 2.5rem;
}

.document h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--charcoal);
  margin: 0 0 2rem;
}

.document h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--charcoal);
  margin: 2.75rem 0 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.document h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
  margin: 2rem 0 0.5rem;
}

.document p { margin: 0 0 1.1rem; }
.document strong { font-weight: 700; color: var(--charcoal); }
.document em { font-style: italic; }

.document p,
.document li {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.document__meta,
.document figcaption {
  text-align: left;
  hyphens: manual;
}

.document a { color: var(--crimson); text-underline-offset: 0.2em; }

.document ul, .document ol { margin: 0 0 1.1rem; padding-left: 1.25rem; }
.document li { margin-bottom: 0.4rem; }

.document hr { display: none; }

.document blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--parchment);
  font-style: italic;
}

.document table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
}

.document th, .document td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.document th {
  font-family: var(--sans);
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--charcoal);
  border-bottom: 1px solid var(--charcoal);
}

/* ----------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--charcoal);
  padding: 2rem var(--gutter) 2.5rem;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey);
}

.footer a { color: var(--grey); text-decoration: none; border-bottom: 1px solid var(--rule); }
.footer a:hover, .footer a:focus-visible { color: var(--charcoal); border-bottom-color: var(--charcoal); }
.footer p { margin: 0.4rem 0; }

/* ------------------------------------------------------------ accessibility */

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

.menu[data-open="true"] a:focus-visible { outline-color: var(--linen); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--charcoal);
  color: var(--linen);
  padding: 0.75rem 1.25rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  z-index: 60;
}

.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------- the X-axis figure */

.figure {
  margin: 2.25rem 0 2.5rem;
  padding: 1.75rem;
  border: 1px solid var(--charcoal);
}

.figure__body {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.figure__key { flex: 1 1 auto; min-width: 0; }

.figure__row {
  padding: 1rem 1.25rem;
  text-align: center;
}

.figure__row--crux { background: var(--parchment); }

.figure__label {
  display: block;
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 0.35rem;
}

.figure__row--crux .figure__label { color: var(--crimson); }

.figure__note {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--ink);
}

.figure__x {
  flex: 0 0 auto;
  width: clamp(9rem, 26%, 13rem);
  height: auto;
  align-self: center;
}

.figure figcaption {
  font-family: var(--sans);
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--ink);
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--parchment);
}

.figure figcaption b {
  display: block;
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--crimson);
  margin-bottom: 0.4rem;
  font-weight: 700;
}

@media (max-width: 34rem) {
  .figure { padding: 1.25rem; }
  .figure__body { flex-direction: column-reverse; gap: 1.5rem; }
  .figure__x { width: 9rem; }
  .figure__key { width: 100%; }
}
