/*
  Lemuny site.css — component layer, built on tokens.css.
  No framework, no build step. Tokens consumed as CSS custom properties only.
*/

/* ============================================================
   FONTS — self-hosted (identity-spec §7: no third-party font CDN)
   ============================================================ */
@font-face {
  font-family: "General Sans";
  src: url("/assets/fonts/GeneralSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("/assets/fonts/GeneralSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("/assets/fonts/GeneralSans-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--ink-950);
  background-image: radial-gradient(circle, rgba(var(--dot-rgb), var(--dot-grid-opacity)) 1px, transparent 1px);
  background-size: var(--dot-grid-size) var(--dot-grid-size);
  color: var(--text-body);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4, p { margin: 0; }

/* Visible focus — a11y law, not preference */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: var(--ink-on-gold);
  padding: 12px 20px;
  z-index: 1000;
  border-radius: 0 0 10px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}
.skip-link:focus {
  left: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 32px);
}

.shell--narrow {
  max-width: 760px;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--label-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-label);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow .dot { color: var(--gold); font-size: 8px; line-height: 1; }

.display-xl {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--display-xl);
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--gold);
  margin: 0;
}
.display-lg {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--display-lg);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--text-headline);
  margin: 0;
}
.display-md {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--display-md);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-headline);
  margin: 0;
}
.body-lg {
  font-size: var(--body-lg);
  line-height: 1.55;
  color: var(--text-body);
}
.body-md {
  font-size: var(--body-md);
  line-height: 1.55;
  color: var(--text-body);
}

/* ============================================================
   NAV — floating glass pill (identity-spec §4.1)
   ============================================================ */
.site-nav-wrap {
  position: sticky;
  top: clamp(12px, 2.4vw, 20px);
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  margin-bottom: clamp(24px, 5vw, 48px);
}

.site-nav {
  width: 100%;
  max-width: 920px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(21, 26, 48, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 8px 10px 8px 16px;
  background-image: radial-gradient(circle, rgba(var(--dot-rgb), 0.05) 1px, transparent 1px);
  background-size: 16px 16px;
}

.site-nav .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  color: var(--text-headline);
  white-space: nowrap;
}
.site-nav .brand img { width: 24px; height: 24px; object-fit: contain; }

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.site-nav__links a {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--text-body);
  white-space: nowrap;
  padding: 6px 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-nav__links a:hover,
.site-nav__links a[aria-current="page"] {
  color: var(--text-headline);
}

.site-nav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  color: var(--text-headline);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }

.site-nav__panel {
  display: none;
}

@media (max-width: 780px) {
  .site-nav__links { display: none; }
  .nav-toggle { display: flex; }
  .site-nav-wrap { flex-direction: column; align-items: center; }
  .site-nav__panel {
    width: 100%;
    max-width: 920px;
    margin-top: 8px;
    background: rgba(21, 26, 48, 0.92);
    backdrop-filter: blur(20px);
    border: 1px solid var(--hairline);
    border-radius: 18px;
    padding: 10px;
    flex-direction: column;
    gap: 2px;
  }
  .site-nav__panel.is-open { display: flex; }
  /* No-JS fallback: the toggle button can't do anything without site.js,
     so show the link panel statically and hide the now-inert toggle.
     html.js removes .no-js on load (site.js); this rule only applies
     when that never happens. */
  html.no-js .site-nav__panel { display: flex; }
  html.no-js .nav-toggle { display: none; }
  .site-nav__panel a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 15px;
    color: var(--text-body);
  }
  .site-nav__panel a:hover,
  .site-nav__panel a[aria-current="page"] { color: var(--text-headline); background: var(--ink-700); }
  .site-nav__panel .btn { margin-top: 6px; }
}

/* ============================================================
   BUTTONS (identity-spec §4.2)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14.5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s var(--motion-ease), border-color 0.18s var(--motion-ease), box-shadow 0.18s var(--motion-ease), color 0.18s var(--motion-ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: var(--ink-on-gold);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--gold-bright);
  box-shadow: 0 0 0 8px var(--glow-gold);
}

.btn-secondary {
  background: var(--ink-800);
  border-color: var(--hairline);
  color: var(--text-headline);
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: rgba(var(--gold-rgb), 0.4);
}

.btn-sm { min-height: 44px; padding: 7px 18px; font-size: 13.5px; }

/* Long CTA labels (with an inline URL) must wrap, not overflow or get
   clipped by an ancestor's overflow:hidden, on narrow phones. */
@media (max-width: 560px) {
  .btn {
    white-space: normal;
    text-align: center;
  }
}

/* ============================================================
   CARDS / PANELS (identity-spec §4.3)
   ============================================================ */
.card {
  background: var(--ink-800);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: clamp(20px, 3vw, 28px);
}

/* Reserved for the single "something's happening here" card per viewport. */
.card--emphasis {
  position: relative;
  border-color: var(--gold);
  background: linear-gradient(165deg, rgba(var(--gold-rgb), 0.12) 0%, var(--ink-800) 55%);
  box-shadow: 0 0 0 1px rgba(var(--gold-rgb), 0.15), 0 0 48px rgba(var(--gold-rgb), 0.16);
}

.card__badge {
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--gold);
  color: var(--ink-on-gold);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--ink-900) 0%, var(--ink-950) 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  padding: clamp(28px, 5vw, 52px);
  overflow: hidden;
}

.panel--glow::before {
  content: "";
  position: absolute;
  top: -160px;
  left: 50%;
  width: 640px;
  height: 640px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--glow-cool), transparent 72%);
  pointer-events: none;
  animation: breathe var(--motion-breathe) ease-in-out infinite;
}
.panel__inner { position: relative; z-index: 1; }

/* ============================================================
   MOTION (identity-spec §5) — small vocabulary, on purpose.
   Breathing: slow scale/opacity oscillation, 3-4s.
   Reduced-motion variants are mandatory throughout.
   ============================================================ */
@keyframes breathe {
  0%, 100% { opacity: 0.75; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .panel--glow::before { animation: none; opacity: 0.88; }
  html { scroll-behavior: auto; }
}

/*
  Reveal is an enhancement only, never a hiding mechanism. Content stays
  fully readable (opacity: 1) with or without JS, in crawlers, in
  screenshot tools, and if IntersectionObserver never fires for any
  reason — only a small settle-in transform is deferred.
*/
.reveal {
  opacity: 1;
  transform: translateY(10px);
  transition: transform 0.6s var(--motion-ease);
}
.reveal.is-visible {
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { transform: none; transition: none; }
}

/* ============================================================
   MARK GLOW (single restrained use — the mark itself)
   ============================================================ */
.mark-wrap {
  position: relative;
  display: inline-flex;
}
.mark-wrap::before {
  content: "";
  position: absolute;
  inset: -22px;
  background: radial-gradient(closest-side, var(--glow-gold), transparent 70%);
  pointer-events: none;
}
.mark-wrap img { position: relative; display: block; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: clamp(48px, 8vw, 96px) 0;
}
.section--tight { padding: clamp(32px, 5vw, 56px) 0; }
.section__head { max-width: 640px; margin-bottom: clamp(24px, 4vw, 40px); }
.section__body { max-width: 68ch; }

.hero-section {
  padding-top: clamp(24px, 4vw, 40px);
  padding-bottom: clamp(40px, 6vw, 72px);
}

/* ============================================================
   ROSTER LIST (static, a11y list-view — NOT live state)
   ============================================================ */
.roster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.roster__item {
  background: var(--ink-800);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 20px;
}
.roster__pod {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--text-headline);
  margin-bottom: 8px;
}
.roster__desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-body);
}
.roster__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-label);
  margin-bottom: 12px;
}
.roster__status .dot-static {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-label);
  display: inline-block;
}

/* ============================================================
   BUILD LOG teaser / entries
   ============================================================ */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.log-entry {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--hairline);
}
.log-list .log-entry:first-child { border-top: none; }
.log-entry time {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-label);
  padding-top: 2px;
}
.log-entry p {
  font-size: 14px;
  color: var(--text-body);
}
@media (max-width: 560px) {
  .log-entry { grid-template-columns: 1fr; gap: 6px; }
}

/* ============================================================
   TABLE — comparison pages, gold-capsule column treatment
   ============================================================ */
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: var(--ink-800);
}
table.grid {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
}
table.grid th,
table.grid td {
  text-align: left;
  vertical-align: top;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-body);
}
table.grid th {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-label);
}
table.grid td.row-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-headline);
  width: 22%;
}
table.grid tr:last-child td { border-bottom: none; }
table.grid th.lemuny,
table.grid td.lemuny {
  background: rgba(var(--gold-rgb), 0.08);
  color: var(--text-headline);
}
table.grid th.lemuny {
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
  border-top: 1px solid rgba(var(--gold-rgb), 0.5);
  border-left: 1px solid rgba(var(--gold-rgb), 0.5);
  border-right: 1px solid rgba(var(--gold-rgb), 0.5);
  border-radius: 10px 10px 0 0;
}
table.grid td.lemuny {
  border-left: 1px solid rgba(var(--gold-rgb), 0.5);
  border-right: 1px solid rgba(var(--gold-rgb), 0.5);
}
table.grid tr:last-child td.lemuny {
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.5);
  border-radius: 0 0 10px 10px;
}

/* ============================================================
   CLOSER PANEL
   ============================================================ */
.closer {
  position: relative;
  background: var(--ink-900);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  padding: clamp(28px, 5vw, 44px);
  overflow: hidden;
}
.closer p {
  position: relative;
  z-index: 1;
  max-width: 68ch;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: clamp(28px, 5vw, 44px) 0 clamp(40px, 6vw, 56px);
  margin-top: clamp(48px, 8vw, 88px);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-label);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.site-footer__brand img { width: 20px; height: 20px; }
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.site-footer__links a {
  font-size: 13.5px;
  color: var(--text-body);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-footer__links a:hover { color: var(--text-headline); }

/* ============================================================
   FORMS (contact page)
   ============================================================ */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.form-field label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-label);
}
.form-field input,
.form-field select,
.form-field textarea {
  background: var(--ink-800);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  color: var(--text-headline);
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 12px 14px;
  min-height: 44px;
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: var(--gold);
}

/* ============================================================
   MISC utility
   ============================================================ */
.stack { display: flex; flex-direction: column; gap: 14px; }
.cluster { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.mt-lg { margin-top: clamp(24px, 4vw, 40px); }
.text-label-static {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-label);
}
