/* Level-Field — original styling preserved; header upgraded to blecher pattern */

/* ---------- Fonts ---------- */

@font-face {
  font-family: 'Ethnocentric';
  src: url('/assets/Ethnocentric-Regular.otf') format('opentype');
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

/* ---------- Reset ---------- */

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

html { overflow-x: hidden; }
body { overflow-x: hidden; max-width: 100%; }

/* ---------- Theme variables (cool palette) ---------- */

:root, [data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-elev: #141414;
  --bg-card: #1a1a1a;
  --ink: #e8e8e8;
  --ink-mute: #aaaaaa;
  --ink-faint: #888888;
  --ink-ghost: #555555;
  --rule: #1a1a1a;
  --rule-strong: #2a2a2a;
  --header-bg: rgba(10, 10, 10, 0.85);
  --modal-bg: #141414;
  --modal-overlay: rgba(0, 0, 0, 0.85);
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --bg-elev: #ffffff;
  --bg-card: #fafafa;
  --ink: #0a0a0a;
  --ink-mute: #4a4a4a;
  --ink-faint: #777777;
  --ink-ghost: #aaaaaa;
  --rule: #ececec;
  --rule-strong: #dadada;
  --header-bg: rgba(245, 245, 245, 0.85);
  --modal-bg: #ffffff;
  --modal-overlay: rgba(0, 0, 0, 0.4);
}

/* ---------- Base ---------- */

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.18s ease, color 0.18s ease;
}

.mono, .brand, .wordmark, .menu-nav a, .powered, .service-name, .tab, .toggle,
button[type="submit"], .site-footer a, .section-label, .caption, .file-drop p,
.page-meta, .page th, textarea::placeholder, input::placeholder {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

a { color: var(--ink); }

::selection { background: var(--ink); color: var(--bg); }

img, svg { max-width: 100%; }

/* ---------- Theme icon visibility (CSS-driven; reliable for SVG) ---------- */

[data-theme="dark"] .theme-icon-dark,
[data-theme="light"] .theme-icon-light {
  display: none;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px clamp(14px, 3vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 14px);
  text-decoration: none;
  min-width: 0;
  flex-shrink: 1;
}

.lion {
  height: clamp(32px, 5.5vw, 56px);
  width: clamp(46px, 8vw, 80px);
  display: inline-block;
  flex-shrink: 0;
  background-color: var(--ink);
  -webkit-mask-image: url('/assets/lion-light.png');
  mask-image: url('/assets/lion-light.png');
  -webkit-mask-position: 0;
  mask-position: 0;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition: background-color 0.18s ease;
}

.wordmark {
  display: inline-block;
  font-family: 'Ethnocentric', 'Orbitron', sans-serif !important;
  font-style: italic;
  font-size: clamp(18px, 3.2vw, 36px);
  letter-spacing: 0.06em;
  color: var(--ink);
  text-transform: uppercase;
  line-height: 1;
  transform: scaleX(0.78) scaleY(0.96);
  transform-origin: left center;
  font-weight: 400;
  -webkit-text-stroke-width: 1.4px;
  -webkit-text-stroke-color: var(--bg);
  paint-order: fill stroke;
  white-space: nowrap;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  font-family: inherit;
}

.icon-btn:hover {
  background: var(--bg-elev);
  color: var(--ink);
  border-color: var(--ink-mute);
}

/* ---------- Menu panel ---------- */

.menu-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.menu-overlay.open { opacity: 1; pointer-events: auto; }

.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(360px, 88vw);
  background: var(--modal-bg);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 1px solid var(--rule);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.menu-panel.open { transform: translateX(0); }

.menu-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 32px;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-nav a {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  text-decoration: none;
  padding: 14px 16px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.menu-nav a:hover { background: var(--bg-elev); color: var(--ink); }
.menu-nav a.external::after { content: '  ↗'; opacity: 0.6; }

/* ---------- Main ---------- */

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(56px, 10vw, 96px) 0 clamp(40px, 8vw, 64px);
  border-bottom: 1px solid var(--rule);
}

.hero h1 {
  font-size: clamp(19px, 2.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.35;
  margin-bottom: 28px;
  color: var(--ink);
  white-space: nowrap;
}

.powered {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: var(--ink-mute);
  text-decoration: none;
  background: var(--bg-elev);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.powered::after { content: '↗'; font-size: 11px; letter-spacing: 0; opacity: 0.7; }
.powered:hover { color: var(--ink); border-color: var(--ink-mute); }
.powered:hover::after { opacity: 1; }

/* ---------- Services ---------- */

.services { padding: clamp(32px, 6vw, 56px) 0 clamp(24px, 5vw, 40px); }

.service {
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}

.service:last-child { border-bottom: 1px solid var(--rule); }

.service-name {
  display: block;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 10px;
}

.service-name em {
  font-style: normal;
  color: var(--ink-mute);
  font-weight: 400;
  letter-spacing: 0.12em;
  margin-left: 8px;
  font-size: 11px;
}

.service p { color: var(--ink); font-size: 16px; }

/* ---------- Payment Model ---------- */

.payment-model {
  padding: 16px 0 32px;
  border-top: 1px solid var(--rule);
}

.payment-model .section-label { margin-bottom: 14px; }
.payment-model p { color: var(--ink); font-size: 15.5px; line-height: 1.7; }

/* ---------- Footnote / Lede ---------- */

.footnote {
  padding: 24px 0 48px;
  font-size: 14px;
  color: var(--ink-mute);
  line-height: 1.7;
  font-style: italic;
  border-top: 1px solid var(--rule);
}

.lede {
  padding: 40px 0 32px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  border-top: 1px solid var(--rule);
}

/* ---------- Form ---------- */

.form-section {
  border-top: 1px solid var(--rule);
  padding: clamp(40px, 7vw, 64px) 0 clamp(64px, 10vw, 96px);
}

.section-block { margin-bottom: 40px; }

.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 14px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--rule-strong);
}

.tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--ink-mute);
  padding: 18px 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.tab:hover { color: var(--ink); }

.toggles {
  display: flex;
  gap: 8px;
  padding: 16px 0 0;
  flex-wrap: wrap;
}

.toggle {
  background: var(--bg-elev);
  border: 1px solid var(--rule-strong);
  color: var(--ink-mute);
  padding: 9px 18px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.toggle.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.toggle:hover:not(.active) { color: var(--ink); border-color: var(--ink-mute); }

.captions {
  padding: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.caption {
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  line-height: 1.55;
}

.caption strong { color: var(--ink-mute); font-weight: 600; }

.form-body { margin-top: 32px; }

textarea, input[type="text"], input[type="email"] {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  padding: 16px;
  font-family: inherit;
  font-size: 15px;
  border-radius: 0;
  outline: none;
  transition: border-color 0.15s;
}

textarea {
  min-height: 220px;
  margin-bottom: 12px;
  resize: vertical;
  line-height: 1.55;
}

textarea:focus, input:focus { border-color: var(--ink-mute); }

textarea::placeholder, input::placeholder {
  color: var(--ink-ghost);
  font-size: 14px;
}

input::placeholder { font-size: 13px; letter-spacing: 0.05em; }

.file-drop {
  display: block;
  border: 1px dashed var(--rule-strong);
  padding: 32px 20px;
  text-align: center;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
}

.file-drop:hover { border-color: var(--ink-mute); }
.file-drop.dragover { border-color: var(--ink); border-style: solid; }

.file-drop p {
  color: var(--ink-mute);
  font-size: 13px;
  letter-spacing: 0.03em;
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-list { margin-top: 12px; font-size: 12px; color: var(--ink-mute); text-align: left; }
.file-list div { padding: 4px 0; word-break: break-all; }

.field-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.field-row.layperson { grid-template-columns: 1fr; }

button[type="submit"] {
  display: block;
  width: 100%;
  background: var(--ink);
  color: var(--bg);
  border: none;
  padding: 20px;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  cursor: pointer;
  margin-bottom: 20px;
  transition: opacity 0.15s;
}

button[type="submit"]:hover { opacity: 0.85; }

.conflict-note {
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  font-style: italic;
}

.disclaimer {
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.65;
  border-left: 2px solid var(--rule-strong);
  padding-left: 16px;
}

.success-message {
  padding: 36px 28px;
  border: 1px solid var(--rule-strong);
  background: var(--bg-elev);
  text-align: center;
}

.success-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 14px;
}

.success-message p {
  color: var(--ink-mute);
  font-size: 14.5px;
  line-height: 1.65;
  margin-bottom: 8px;
}

.success-id {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.12em;
  margin-top: 18px;
  text-transform: uppercase;
}

.form-error {
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid #b35a4a;
  background: rgba(179, 90, 74, 0.08);
  color: #f0c8be;
  font-size: 13px;
  line-height: 1.55;
}

[data-theme="light"] .form-error {
  border-color: #c25541;
  background: rgba(194, 85, 65, 0.06);
  color: #a93b27;
}

/* ---------- Static pages (UPL / TOS / Privacy) ---------- */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 64px) clamp(16px, 4vw, 48px) clamp(64px, 10vw, 96px);
}

.page-meta {
  font-size: 12px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}

.page h1 {
  font-size: clamp(24px, 4.5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 24px;
  word-wrap: break-word;
}

.page h2 {
  font-size: clamp(16px, 2.2vw, 18px);
  font-weight: 600;
  margin-top: clamp(40px, 6vw, 56px);
  margin-bottom: 20px;
  line-height: 1.35;
}

.page h3 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 14px;
  color: var(--ink);
}

.page p, .page li {
  font-size: 15.5px;
  line-height: 1.7;
  margin-bottom: 16px;
  color: var(--ink);
  word-wrap: break-word;
}

.page ul { padding-left: 20px; margin-bottom: 24px; }

.page blockquote {
  border-left: 2px solid var(--rule-strong);
  padding: 8px 0 8px 24px;
  margin: 24px 0;
  font-size: 15px;
  color: var(--ink);
  font-style: italic;
}

.page table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14.5px;
  table-layout: fixed;
}

.page th, .page td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  word-wrap: break-word;
}

.page th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  background: var(--bg-elev);
}

.page a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
  word-wrap: break-word;
  transition: text-decoration-color 0.15s;
}

.page a:hover { text-decoration-color: var(--ink); }

.page strong { font-weight: 600; }
.page em { font-style: italic; color: var(--ink-mute); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 32px clamp(16px, 4vw, 48px);
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--ink-faint);
  text-decoration: none;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: color 0.15s;
}

.site-footer a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */

/* Tablet — between 700 and 1024 */
@media (max-width: 1024px) {
  .header-inner { padding: 12px 20px; }
}

/* Phone landscape / small tablet — under 700 */
@media (max-width: 700px) {
  .header-inner { padding: 10px 14px; gap: 8px; }
  .icon-btn { width: 34px; height: 34px; }
  .wordmark { font-size: clamp(15px, 4.5vw, 22px); }
  .lion { height: clamp(28px, 5vw, 40px); width: clamp(40px, 7vw, 56px); }

  .hero { padding: 48px 0 36px; }
  .hero h1 { white-space: normal; font-size: clamp(18px, 5vw, 24px); line-height: 1.4; }
  .powered { font-size: 10px; padding: 7px 13px; letter-spacing: 0.14em; }

  .lede { font-size: 16px; padding: 32px 0 24px; }
  .service { padding: 20px 0; }
  .service p { font-size: 15px; }
  .payment-model p, .page p, .page li { font-size: 15px; }

  .tab { padding: 14px 8px; font-size: 11px; letter-spacing: 0.12em; }
  .toggle { padding: 8px 14px; font-size: 10.5px; letter-spacing: 0.12em; }
  .field-row { grid-template-columns: 1fr !important; }
  textarea { min-height: 180px; }
  .file-drop { padding: 24px 16px; }
  button[type="submit"] { padding: 16px; font-size: 12px; letter-spacing: 0.16em; }

  .page table { font-size: 13px; }
  .page th, .page td { padding: 10px 12px; }
  .page blockquote { padding-left: 16px; font-size: 14.5px; }

  .site-footer { padding: 24px 16px; gap: 14px; }
  .site-footer a { font-size: 11px; letter-spacing: 0.12em; }
}

/* Phone portrait — under 480 */
@media (max-width: 480px) {
  main, .page { padding-left: 14px; padding-right: 14px; }
  .header-inner { padding: 10px 12px; }
  .lion { height: 26px; width: 38px; }
  .wordmark { font-size: 14px; }
  .icon-btn { width: 32px; height: 32px; }

  .hero { padding: 36px 0 28px; }
  .hero h1 { font-size: clamp(16px, 5.5vw, 22px); }

  .powered { font-size: 9.5px; padding: 6px 12px; }

  .lede { padding: 24px 0 20px; }
  .footnote { padding: 20px 0 32px; }

  .form-section { padding: 40px 0 64px; }
  .section-label { font-size: 10px; letter-spacing: 0.18em; }
  .toggles { gap: 6px; }
  .caption { font-size: 11.5px; }

  .menu-panel { width: 92vw; padding: 20px; }
  .menu-nav a { font-size: 12px; padding: 12px 14px; }
}

/* Very small phones — under 360 */
@media (max-width: 360px) {
  .header-inner { gap: 4px; }
  .header-controls { gap: 2px; }
  .icon-btn { width: 30px; height: 30px; }
  .lion { height: 24px; width: 34px; }
  .wordmark { font-size: 13px; }
}
