/* ============================================================
   HYMUX - hymux.org
   Editorial. Warm paper in light, warm charcoal in dark.
   Serif display, hairline rules, asymmetric columns.
   ============================================================ */

/* Light is the default, so it is the base here and dark is the override.
   The OS preference is deliberately not consulted: the site opens light for
   everyone, and only the visitor's own toggle changes that. */
:root {
  /* brand, sampled from the master logo */
  --brand:      #0a6fd8;
  --brand-soft: #0a72cc;
  --wire-out:   #0a86d8;
  --error:      #b3352a;
  --semibd:     #22c55e;
  --accurify:   #3b82f6;

  /* light: warm paper, not clinical white */
  --bg:      #faf8f4;
  --bg-2:    #f2efe8;
  --surface: #ffffff;
  --rule:    #e6e1d7;
  --border:  #ddd7cb;
  --fg:      #1a1a1c;
  --fg-2:    #45423c;
  --muted:   #6f6b64;
  --slot:    #c2beb4;

  --sans: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', sans-serif;
  --display: 'Instrument Serif', Georgia, 'Times New Roman', serif;

  --wrap: 1200px;
  --gutter: 32px;
  --rail: 120px;
}

:root[data-theme='dark'] {
  --brand:      #0a84fc;
  --brand-soft: #4ad4fe;
  --wire-out:   #4ad4fe;
  --error:      #f08b82;

  /* dark: warm charcoal, deliberately not near-black */
  --bg:      #1c1d20;
  --bg-2:    #222327;
  --surface: #26272c;
  --rule:    #33343a;
  --border:  #3f4046;
  --fg:      #f4f2ee;
  --fg-2:    #cbc8c2;
  --muted:   #9c9992;
  --slot:    #56534e;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The UA rule for [hidden] is only `display: none`, so any element that sets a
   display of its own silently outranks it - .form is display:grid and stayed on
   screen underneath the thank-you panel. */
[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -.015em;
  margin: 0;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 100;
  background: var(--fg);
  color: var(--bg);
  padding: 10px 18px;
  font-weight: 500;
}
.skip:focus { left: 24px; }

/* small caps utility used for every label on the page */
.eyebrow,
.entry-status,
.section-note-key,
.entry-spec dt,
.contact-meta dt,
.truth th,
.colophon-col h4,
.field label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* ---------- masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.masthead.stuck { border-bottom-color: var(--rule); }

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2em;
}
.brand-logo { height: 28px; width: auto; flex: none; display: block; }
.brand-logo.on-dark { display: none; }
:root[data-theme='dark'] .brand-logo.on-dark { display: block; }
:root[data-theme='dark'] .brand-logo.on-light { display: none; }
.brand-word { padding-top: 1px; }

.masthead-nav {
  display: flex;
  gap: 32px;
  margin-left: auto;
  font-size: 14.5px;
  color: var(--muted);
}
.masthead-nav a {
  position: relative;
  padding-block: 4px;
  transition: color .2s ease;
}
.masthead-nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.masthead-nav a:hover { color: var(--fg); }
.masthead-nav a:hover::after { transform: scaleX(1); }

.masthead-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.icon-btn:hover { color: var(--fg); border-color: var(--border); }
.icon-btn svg { width: 17px; height: 17px; }

/* light shows the moon (switch to dark), dark shows the sun */
.i-sun { display: none; }
.i-moon { display: block; }
:root[data-theme='dark'] .i-sun { display: block; }
:root[data-theme='dark'] .i-moon { display: none; }

.menu-btn { display: none; }

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 4px var(--gutter) 18px;
  border-top: 1px solid var(--rule);
}
.mobile-menu a {
  padding: 13px 0;
  color: var(--fg-2);
  border-bottom: 1px solid var(--rule);
}
.mobile-menu a:last-child { border-bottom: 0; }

/* ---------- hero ---------- */
.hero { padding: clamp(56px, 9vw, 128px) 0 clamp(48px, 7vw, 96px); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin-bottom: 32px;
}
.eyebrow-sep { opacity: .45; }
.pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--semibd);
}

h1 {
  font-size: clamp(52px, 8.4vw, 108px);
  line-height: .94;
  letter-spacing: -.025em;
  margin-bottom: 34px;
}
.h1-turn {
  display: block;
  font-style: italic;
  padding-left: .38em;
  color: var(--fg-2);
}

.standfirst {
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.62;
  color: var(--fg-2);
  max-width: 48ch;
  margin-bottom: 48px;
}

.figures {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(32px, 5vw, 64px);
  margin: 0;
  padding-top: 30px;
  border-top: 1px solid var(--rule);
}
.figures dt {
  font-family: var(--display);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -.02em;
}
.figure-sup { font-size: .5em; vertical-align: super; color: var(--muted); }
.figures dd {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* hero plate */
.plate { margin: 0; }
.plate-frame {
  display: grid;
  place-items: center;
  padding: clamp(28px, 4vw, 52px);
  background: var(--bg-2);
  border: 1px solid var(--rule);
}
.plate-logo { height: clamp(150px, 20vw, 232px); width: auto; }
.plate-logo.on-dark { display: none; }
:root[data-theme='dark'] .plate-logo.on-dark { display: block; }
:root[data-theme='dark'] .plate-logo.on-light { display: none; }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 8vw, 116px) 0; }
.section-tint { background: var(--bg-2); }

.section-head {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  margin-bottom: clamp(40px, 5vw, 72px);
}
.section-index {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  color: var(--muted);
}
.section-title h2 {
  font-size: clamp(32px, 4.4vw, 58px);
  letter-spacing: -.02em;
}
.section-note {
  margin-top: 20px;
  color: var(--muted);
  max-width: 46ch;
  font-size: 16px;
}

/* ---------- product entries ---------- */
.entry {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(36px, 4vw, 56px) 0;
  border-top: 1px solid var(--rule);
}
.entry:last-child { border-bottom: 1px solid var(--rule); }

.entry-rail { display: flex; flex-direction: column; gap: 14px; }
.entry-num {
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  color: var(--muted);
}
.entry-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.entry-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent, var(--muted));
  flex: none;
}
.entry-open .entry-status::before { background: none; box-shadow: inset 0 0 0 1px var(--slot); }

.entry-name {
  font-size: clamp(32px, 3.6vw, 46px);
  letter-spacing: -.02em;
}
.entry-tagline {
  font-family: var(--display);
  font-style: italic;
  font-size: 19px;
  color: var(--accent, var(--muted));
  margin-top: 6px;
}
.entry-open .entry-tagline { color: var(--muted); }

.entry-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  margin: 26px 0 30px;
}
.entry-copy { color: var(--fg-2); font-size: 16.5px; }

.entry-spec { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.entry-spec > div { display: grid; gap: 3px; }
.entry-spec dt { color: var(--muted); }
.entry-spec dd { margin: 0; font-size: 15px; color: var(--fg-2); }

.entry-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
  transition: border-color .2s ease, color .2s ease;
}
.entry-link:hover { color: var(--brand); border-bottom-color: var(--brand); }
.entry-link .arrow { transition: transform .25s ease; }
.entry-link:hover .arrow { transform: translateX(4px); }

/* ---------- tenets ---------- */
/* four tenets, so two columns - auto-fit would strand the fourth alone */
.tenets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(40px, 6vw, 88px);
}
.tenet {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 20px;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
}
.tenet-num {
  font-family: var(--display);
  font-style: italic;
  font-size: 22px;
  color: var(--muted);
  line-height: 1.5;
}
.tenet h3 { font-size: 25px; margin-bottom: 12px; }
.tenet p { color: var(--muted); font-size: 15.5px; }

/* ---------- origin ---------- */
.origin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
}
.origin-copy p { color: var(--fg-2); margin-bottom: 20px; }
.drop::first-letter {
  float: left;
  font-family: var(--display);
  font-size: 4.4em;
  line-height: .78;
  padding: .04em .1em 0 0;
  color: var(--fg);
}

.truth {
  width: 100%;
  border-collapse: collapse;
  margin-top: 36px;
  font-size: 15px;
}
.truth caption {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding-bottom: 12px;
}
.truth th, .truth td {
  text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.truth thead th { color: var(--muted); border-bottom-color: var(--border); }
.truth td:first-child { color: var(--muted); width: 40%; }
.truth .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 10px;
}
.truth .is-open td { color: var(--slot); }

.origin-figure { margin: 0; }
.mux { width: 100%; height: auto; }
.wire-label { font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: .04em; }
.muted-label { fill: var(--slot); }
.out-label { fill: var(--wire-out); }
.body-label {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2em;
  fill: #fff;
}

.p { opacity: 0; }
@keyframes travel-in  { 0% { transform: translateX(0); opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { transform: translateX(182px); opacity: 0; } }
@keyframes travel-out { 0% { transform: translateX(0); opacity: 0; } 10% { opacity: 1; } 85% { opacity: .9; } 100% { transform: translateX(138px); opacity: 0; } }
.p1    { animation: travel-in 3.4s cubic-bezier(.45,0,.55,1) infinite; }
.p2    { animation: travel-in 3.4s cubic-bezier(.45,0,.55,1) 1.7s infinite; }
.p-out { animation: travel-out 3.4s cubic-bezier(.45,0,.55,1) .9s infinite; }

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
}
.contact-aside { grid-column: 1 / -1; }

.contact-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin: 0 0 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}
.contact-meta > div { display: grid; gap: 6px; }
.contact-meta dt { color: var(--muted); }
.contact-meta dd { margin: 0; font-size: 15.5px; color: var(--fg-2); }

.form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 40px;
  max-width: 860px;
}
.field { display: grid; gap: 10px; align-content: start; }
.field-wide { grid-column: 1 / -1; }

.field label { color: var(--muted); }
.field input,
.field textarea {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  width: 100%;
  transition: border-color .2s ease;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--brand);
}

/* validation is handled in JS so messages can sit under their own field
   instead of in the browser's default bubble */
.field-error {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--error);
}
.field-error:empty { display: none; }

.field.is-invalid input,
.field.is-invalid textarea { border-bottom-color: var(--error); }
.field.is-invalid label { color: var(--error); }

.turnstile-slot { min-height: 65px; }
.turnstile-slot:empty::before {
  content: 'Loading verification...';
  font-size: 13.5px;
  color: var(--muted);
}

/* what replaces the form once a message is sent.
   Same grid placement as .form - without it this lands in the narrow rail
   column and the copy wraps a few words at a time. */
.sent {
  grid-column: 1 / -1;
  max-width: 860px;
  border-top: 1px solid var(--rule);
  padding-top: 30px;
}
.sent:focus { outline: none; }
.sent-key {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.sent-key::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--semibd);
}
.sent-title {
  font-family: var(--display);
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin-bottom: 14px;
}
.sent-note {
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 26px;
}
.sent-again {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 0 3px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.sent-again:hover { color: var(--fg); border-bottom-color: var(--fg); }

/* honeypot - hidden from people, reachable by bots */
.honeypot {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.form-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.btn {
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: .02em;
  padding: 14px 30px;
  background: var(--fg);
  color: var(--bg);
  border: 1px solid var(--fg);
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease;
}
.btn:hover { opacity: .84; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: default; }

.form-status { font-size: 14.5px; color: var(--muted); }
.form-status.is-ok { color: var(--semibd); }
.form-status.is-bad { color: #e2564d; }

/* ---------- colophon ---------- */
.colophon { border-top: 1px solid var(--rule); padding-top: 56px; }
.colophon-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
}
.colophon-brand .brand { margin-bottom: 16px; }
.colophon-line { color: var(--muted); font-size: 15px; }
.colophon-col { display: flex; flex-direction: column; gap: 12px; }
.colophon-col h4 { margin: 0 0 4px; color: var(--fg); }
.colophon-col a { color: var(--muted); font-size: 15px; transition: color .2s ease; }
.colophon-col a:hover { color: var(--fg); }

.colophon-base {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: 24px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
}
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; }
  .plate { max-width: 420px; }
  .origin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --rail: 64px; --gutter: 24px; }
  .entry-cols { grid-template-columns: 1fr; }
  .tenets { grid-template-columns: 1fr; }
  .colophon-inner { grid-template-columns: 1fr 1fr; }
  .form { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .masthead-nav { display: none; }
  /* The auto margin that pushes the controls right lives on .masthead-nav,
     which is hidden here - without this they bunch up against the wordmark. */
  .masthead-actions { margin-left: auto; }
  .menu-btn { display: grid; }
  .mobile-menu:not([hidden]) { display: flex; }

  :root { --rail: 0px; }
  .section-head,
  .entry,
  .contact-grid { grid-template-columns: 1fr; gap: 18px; }
  .entry-rail { flex-direction: row; align-items: baseline; gap: 16px; }
  .tenet { grid-template-columns: 28px 1fr; gap: 14px; }
  .figures dt { font-size: 36px; }
  .drop::first-letter { font-size: 3.6em; }
}

@media (max-width: 460px) {
  body { font-size: 16px; }
  .colophon-inner { grid-template-columns: 1fr; gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal, .js .reveal.in { opacity: 1; transform: none; }
  .p { opacity: 1; }
}
