/* ==========================================================================
   Invictus Systems LLC — visual identity: "Unconquered by design"
   Forged graphite + bone + a single brass/laurel signal.
   Display: Archivo · Body: Plus Jakarta Sans · Data/labels: JetBrains Mono
   Signature: brass drafting registration ticks + mono index labels.
   Plain CSS (no @apply) so it works alongside the Tailwind Play CDN.
   ========================================================================== */

:root {
  --ink: #0a0b0e;          /* base background */
  --graphite: #121419;     /* surface */
  --graphite-2: #181b22;   /* elevated surface */
  --bone: #ecebe6;         /* primary text (warm off-white) */
  --ash: #9a9ca4;          /* muted text */
  --ash-dim: #6b6e77;      /* faint text (large only) */
  --hair: rgba(236, 235, 230, 0.10);
  --hair-2: rgba(236, 235, 230, 0.17);
  --signal: #c9a24b;       /* brass / laurel — the single accent */
  --signal-bright: #e4c57e;
  --signal-deep: #9c7b2e;
  --signal-wash: rgba(201, 162, 75, 0.10);
  --ok: #79c79b;
  --err: #e58a80;
  --ring: #d8b35e;
  --display: "Archivo", system-ui, -apple-system, sans-serif;
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--ink);
  color: var(--bone);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.022em;
  line-height: 1.08;
  color: var(--bone);
}

[id] { scroll-margin-top: 6rem; }
::selection { background: rgba(201, 162, 75, 0.28); color: #fff; }

@media (pointer: fine) {
  ::-webkit-scrollbar { width: 11px; height: 11px; }
  ::-webkit-scrollbar-track { background: var(--ink); }
  ::-webkit-scrollbar-thumb { background: #2a2d35; border-radius: 999px; border: 3px solid var(--ink); }
  ::-webkit-scrollbar-thumb:hover { background: #3a3e48; }
}

/* --------------------------------------------------------------------------
   Atmosphere — restrained. A single low lamp glow, a fine technical grid,
   a whisper of grain. No rainbow blobs.
   -------------------------------------------------------------------------- */
.bg-canvas { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(236,235,230,0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(236,235,230,0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, #000 30%, transparent 78%);
          mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, #000 30%, transparent 78%);
}

/* Repurpose existing .blob markup as one disciplined lamp glow. */
.blob { position: absolute; border-radius: 50%; filter: blur(120px); will-change: opacity; }
.blob--1 { top: -22%; left: 50%; transform: translateX(-50%); width: 70vw; height: 42vw; max-width: 1100px; max-height: 620px;
  background: radial-gradient(ellipse at center, rgba(201,162,75,0.16), transparent 68%); opacity: 1; }
.blob--2 { bottom: -30%; right: -10%; width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  background: radial-gradient(circle at center, rgba(120,140,180,0.07), transparent 70%); opacity: 1; }
.blob--3 { display: none; }

.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Structural devices — mono eyebrow (kicker) + drafting ticks (signature)
   -------------------------------------------------------------------------- */
.kicker {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-family: "JetBrains Mono", monospace; font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--ash);
}
.kicker::before { content: ""; width: 26px; height: 1px; background: var(--signal); flex: none; }
.kicker .idx { color: var(--signal); }

/* Brass registration ticks at the four corners — the signature frame. */
.framed { position: relative; }
.framed::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; --t: 15px; --c: var(--signal);
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--t) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 1px var(--t) no-repeat,
    linear-gradient(var(--c), var(--c)) top right / var(--t) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 1px var(--t) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / var(--t) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 1px var(--t) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--t) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 1px var(--t) no-repeat;
  opacity: 0.72;
}

/* Legacy pill (legal pages) restyled to match. */
.pill {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: "JetBrains Mono", monospace; font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; padding: 0.4rem 0.85rem; border-radius: 4px;
  background: var(--signal-wash); border: 1px solid rgba(201,162,75,0.3); color: var(--signal-bright);
}

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */
.glass, .surface {
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid var(--hair);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}

/* Hairline highlight on the top edge — now brass-tinted, subtler. */
.edge-top { position: relative; }
.edge-top::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,162,75,0.45), transparent);
}

.card-hover { transition: transform .3s cubic-bezier(.2,.7,.2,1), border-color .3s ease, background-color .3s ease; }
.card-hover:hover { transform: translateY(-3px); border-color: rgba(201,162,75,0.35); background: rgba(255,255,255,0.035); }

/* Accent word in headlines — flat brass, no rainbow gradient. */
.text-gradient, .text-accent { color: var(--signal); }

/* --------------------------------------------------------------------------
   Buttons — explicit colors (no inherited-color bugs)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  font-weight: 700; font-size: 0.95rem; border-radius: 7px; line-height: 1; white-space: nowrap;
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }

.btn-primary { color: var(--ink); background: var(--signal); box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset; }
.btn-primary:hover { background: var(--signal-bright); transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgba(201,162,75,0.6); }

/* .btn-ghost kept for existing markup = secondary/outline. */
.btn-ghost, .btn-secondary {
  color: var(--bone); background: transparent; border: 1px solid var(--hair-2);
}
.btn-ghost:hover, .btn-secondary:hover {
  border-color: rgba(201,162,75,0.55); color: var(--signal-bright); background: var(--signal-wash); transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field {
  width: 100%; background: rgba(255,255,255,0.025); border: 1px solid var(--hair-2);
  color: var(--bone); border-radius: 7px; padding: 0.8rem 1rem; font-size: 1rem; line-height: 1.4;
  font-family: inherit; transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.field::placeholder { color: var(--ash-dim); }
.field:hover { border-color: rgba(236,235,230,0.26); }
.field:focus { outline: none; border-color: var(--signal); background: rgba(255,255,255,0.04);
  box-shadow: 0 0 0 3px rgba(201,162,75,0.18); }
select.field { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239a9ca4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.75rem; }
select.field option { background: var(--graphite); color: var(--bone); }
.field-label {
  display: block; font-family: "JetBrains Mono", monospace; font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ash); margin-bottom: 0.5rem;
}
.field-error { color: var(--err); font-size: 0.8125rem; margin-top: 0.4rem; display: none; }
.field.invalid { border-color: var(--err); box-shadow: 0 0 0 3px rgba(229,138,128,0.16); }
.field.invalid + .field-error { display: block; }

.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Inline success confirmation (replaces the form on submit). */
.success-card { text-align: center; padding: 2.5rem 1.5rem; animation: rise .5s cubic-bezier(.16,1,.3,1) both; }
.success-badge {
  margin: 0 auto; display: grid; place-items: center; height: 64px; width: 64px; border-radius: 999px;
  color: var(--signal); border: 1px solid rgba(201,162,75,0.4); background: var(--signal-wash);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 160%);
  z-index: 100; max-width: calc(100vw - 2rem); display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1.1rem; border-radius: 8px; font-weight: 500; font-size: .95rem;
  transition: transform .45s cubic-bezier(.16,1,.3,1), opacity .45s ease; opacity: 0; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast--ok { background: rgba(121,199,155,0.12); border: 1px solid rgba(121,199,155,0.4); color: #bdebcf; }
.toast--err { background: rgba(229,138,128,0.12); border: 1px solid rgba(229,138,128,0.42); color: #f4c9c3; }

/* --------------------------------------------------------------------------
   Scroll reveal + accordion
   -------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }

.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.acc-item[open] .acc-body { grid-template-rows: 1fr; }
.acc-body > div { overflow: hidden; }
.acc-item[open] .acc-chevron { transform: rotate(180deg); }
.acc-chevron { transition: transform .3s ease; }

/* Commitment strip (was a marquee — now a static, disciplined row). */
.marquee, .marquee-wrap { display: block; width: auto; animation: none; }

/* --------------------------------------------------------------------------
   Prose for legal pages
   -------------------------------------------------------------------------- */
.prose-legal { color: var(--ash); line-height: 1.78; }
.prose-legal h2 { color: var(--bone); font-size: 1.4rem; font-weight: 800; margin: 2.6rem 0 .9rem; scroll-margin-top: 7rem; }
.prose-legal h3 { color: var(--bone); font-size: 1.08rem; font-weight: 700; margin: 1.6rem 0 .5rem; }
.prose-legal p { margin: 0 0 1rem; }
.prose-legal ul { margin: 0 0 1.1rem; padding-left: 1.25rem; list-style: disc; }
.prose-legal ul li { margin: .4rem 0; }
.prose-legal a { color: var(--signal-bright); text-decoration: underline; text-underline-offset: 3px; }
.prose-legal a:hover { color: var(--signal); }
.prose-legal strong { color: var(--bone); }
.prose-legal .lead { font-size: 1.05rem; color: var(--bone); }

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .success-card { animation: none !important; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

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