:root {
  --bg: #0a0b0d;
  --bg-glow: #14181f;
  --ink: #f2f0ea;
  --muted: #8b9099;
  --rule: rgba(242, 240, 234, 0.14);
  --accent: #d4ff4f;
  --accent-wash: rgba(212, 255, 79, 0.05);
  --accent-wash-strong: rgba(212, 255, 79, 0.06);
  --tile: #f7f5f0;
  --tile-ink: #141414;
  --panel-bg: rgba(10, 11, 13, 0.9);
  --panel-border: rgba(242, 240, 234, 0.22);
  --panel-inset: rgba(255, 255, 255, 0.04);
  --panel-lift: none;
  --nav-hover-border: rgba(242, 240, 234, 0.35);
  --scrollbar: rgba(242, 240, 234, 0.2);
  --modernist-sans: Avenir, "Avenir Next", "Helvetica Neue", sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: var(--modernist-sans);
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

html[data-theme="light"] {
  --bg: #f4f2ec;
  --bg-glow: #ffffff;
  --ink: #141414;
  --muted: #6a6e76;
  --rule: rgba(20, 20, 20, 0.12);
  --accent: #e56b2e;
  --accent-wash: rgba(229, 107, 46, 0.08);
  --accent-wash-strong: rgba(229, 107, 46, 0.12);
  --panel-bg: rgba(255, 255, 255, 0.9);
  --panel-border: rgba(20, 20, 20, 0.1);
  --panel-inset: rgba(0, 0, 0, 0.03);
  --panel-lift:
    0 10px 36px -18px rgba(20, 20, 20, 0.22),
    0 2px 10px rgba(20, 20, 20, 0.06);
  --nav-hover-border: rgba(20, 20, 20, 0.28);
  --scrollbar: rgba(20, 20, 20, 0.22);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse 90% 60% at 50% 35%, var(--bg-glow), transparent 70%),
    radial-gradient(ellipse 70% 50% at 80% 90%, var(--accent-wash), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.brand-stack {
  position: fixed;
  top: 28px;
  left: 36px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
  isolation: isolate;
  transform: translateZ(0);
  max-width: min(520px, calc(100vw - 72px));
  max-height: calc(100vh - 120px);
  min-height: 0;
  animation: rise 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: 0.04s;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.brand-mark {
  position: relative;
  text-align: left;
  pointer-events: none;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 18px 22px 20px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: var(--panel-bg);
  box-shadow: inset 0 0 0 1px var(--panel-inset), var(--panel-lift);
}

.brand-mark-body {
  min-height: 0;
  width: fit-content;
  max-width: 100%;
  flex: 1 1 auto;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}

.brand-mark .eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.brand-mark .lockup {
  display: flex;
  align-items: center;
  gap: 0.12em;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1;
}

.brand-mark .logo-ico {
  width: 0.92em;
  height: 0.92em;
  flex: 0 0 0.92em;
  position: relative;
  overflow: hidden;
}

.brand-mark .logo-ico canvas { display: block; width: 100%; height: 100%; }

.brand-mark .wordmark {
  font-family: Avenir, "Avenir Next", "Helvetica Neue", sans-serif;
  font-weight: 300;
  font-size: 1em;
  line-height: 1;
  letter-spacing: 0.16em;
  color: var(--ink);
  display: block;
  padding-right: 0.08em;
}

.brand-mark .sub {
  margin-top: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.35;
  color: var(--muted);
  max-width: 28ch;
}

.brand-mark .rule {
  width: 48px;
  height: 1px;
  margin: 16px 0 0;
  background: var(--rule);
}

.brand-mark .index {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-mark .index span { color: var(--accent); }

.section-nav {
  pointer-events: auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-top: 14px;
  flex-shrink: 0;
  position: relative;
  align-self: stretch;
  box-sizing: border-box;
}

.section-nav-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.section-nav a,
.section-nav button {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 5px 9px;
  border-radius: 3px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}

.section-nav a:hover,
.section-nav button:hover {
  color: var(--accent);
  border-color: var(--nav-hover-border);
}

.section-nav a.active,
.section-nav button.active,
.section-nav a[aria-checked="true"],
.section-nav button[aria-checked="true"] {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.section-nav a.section-nav-contact,
.section-nav button.section-nav-contact,
.section-nav a.section-nav-contact:hover,
.section-nav button.section-nav-contact:hover,
.section-nav a.section-nav-contact.active,
.section-nav button.section-nav-contact.active,
.section-nav a.section-nav-contact[aria-checked="true"],
.section-nav button.section-nav-contact[aria-checked="true"],
.section-nav a.section-nav-contact[aria-checked="false"],
.section-nav button.section-nav-contact[aria-checked="false"] {
  position: static;
  border-radius: 3px;
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  margin-left: auto;
  flex: 0 0 auto;
  align-self: center;
  filter: none;
}

.section-nav a.section-nav-contact:hover,
.section-nav button.section-nav-contact:hover {
  filter: brightness(1.06);
}
