/**
 * SentinelForge Command — company product visual identity.
 * Palette: forge steel, ember, and bone, with the reviewed wolf mark as anchor.
 */

:root {
  color-scheme: dark;
  --bg: #0a0c0f;
  --bg-elevated: #12161c;
  --panel: #161b22;
  --panel-2: #1c232d;
  --line: #2a3340;
  --line-strong: #3d4a5c;
  --text: #f2ebe3;
  --muted: #a39a8f;
  --ember: #c45c26;
  --ember-bright: #e87a3a;
  --steel: #8fa3b8;
  --bone: #f2ebe3;
  --success: #6f9f7a;
  --warn: #d4a017;
  --danger: #c44b4b;
  --focus: #e87a3a;
  --radius: 6px;
  --font-display: Georgia, "Times New Roman", serif;
  --font-body: "Segoe UI", Inter, Arial, sans-serif;
  --max: 1120px;
  font-family: var(--font-body);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 1rem;
}

a {
  color: var(--ember-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--bone); }
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ember);
  color: #0a0c0f;
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Compact, organized top bar. */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 15, 0.94);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--bone);
  text-decoration: none;
  flex-shrink: 0;
}
.brand img {
  width: 40px;
  height: 40px;
  display: block;
  border-radius: 8px;
}
.brand-mark-text { line-height: 1.1; }
.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--bone);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}

#site-nav {
  display: flex;
  align-items: center;
  gap: 4px 6px;
  flex: 1;
  justify-content: flex-end;
  flex-wrap: wrap;
}
#site-nav a {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: var(--radius);
  white-space: nowrap;
}
#site-nav a:hover { color: var(--bone); background: rgba(255,255,255,0.04); }
#site-nav a[aria-current="page"] {
  color: var(--bone);
  box-shadow: inset 0 -2px 0 var(--ember);
}
#site-nav a.cta,
.btn.primary {
  background: var(--ember);
  color: #0a0c0f;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 650;
  text-decoration: none;
  border: 1px solid transparent;
}
#site-nav a.cta:hover,
.btn.primary:hover {
  background: var(--ember-bright);
  color: #0a0c0f;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 8px;
  margin-right: 4px;
  border-right: 1px solid var(--line);
}
.nav-group:last-of-type { border-right: 0; margin-right: 0; padding-right: 0; }

/* Brand hero with the reviewed wolf asset. */
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  gap: 24px 40px;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 28px 56px;
  min-height: min(78vh, 680px);
}
.hero-copy .eyebrow {
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
  margin: 0 0 12px;
}
.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  font-weight: 700;
  margin: 0 0 0.35em;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--bone);
}
.hero-copy .lede {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 34rem;
  margin: 0 0 24px;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; }
.btn {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 11px 18px;
  color: var(--bone);
  background: transparent;
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}
.btn:hover { border-color: var(--steel); color: var(--bone); }
.note, .muted, .status {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 40rem;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
}
.hero-visual img {
  width: min(100%, 420px);
  height: auto;
  display: block;
  filter: drop-shadow(0 24px 48px rgba(0,0,0,0.45));
}
.hero-visual .caption {
  margin-top: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
  text-align: center;
}

/* Content */
.content {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 28px 80px;
}
.content-tight { max-width: 760px; }
.section-head {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0 0 8px;
  font-weight: 700;
}
.section-lede {
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 36rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 48px;
}
.grid article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px 18px;
}
.grid article h2,
.panel h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 10px;
  font-weight: 700;
}
.grid article p { margin: 0 0 10px; color: var(--muted); }
.status {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--warn);
  background: rgba(212, 160, 23, 0.08);
}

.panel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}
.steps li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
}
.steps strong {
  display: block;
  color: var(--bone);
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.steps span { color: var(--muted); font-size: 0.9rem; }

.page-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 28px 8px;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin: 0 0 12px;
  font-weight: 700;
  line-height: 1.1;
}
.page-hero .lede {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 40rem;
  margin: 0;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 0 0 24px;
}
.pillars div {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

.connect-list { margin: 12px 0 0; padding-left: 1.2rem; color: var(--muted); }
.connect-list li { margin: 0 0 8px; }

.form-grid { display: grid; gap: 14px; max-width: 32rem; }
.form-grid label { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 600; }
.form-grid input,
.form-grid select,
.form-grid textarea {
  font: inherit;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
}
.form-msg { margin-top: 12px; font-size: 0.92rem; }
.form-msg.ok { color: var(--success); }
.form-msg.err { color: var(--danger); }
.form-note { margin-top: 16px; }
.form-grid button { justify-self: start; font: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.65; }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.checklist li:last-child { border-bottom: 0; }
.checklist strong { color: var(--bone); display: block; margin-bottom: 4px; }

footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px 40px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--bg-elevated);
}
footer .wolf-mini {
  width: 32px;
  height: 32px;
  margin: 0 auto 12px;
  border-radius: 6px;
}
footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  margin: 0 0 12px;
}
footer .footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
}
footer .footer-links a:hover { color: var(--bone); }

/* Ask Fenrir - always visible floating support */
.fenrir-support-root {
  position: fixed !important;
  left: 20px !important;
  bottom: 72px !important;
  right: auto !important;
  z-index: 2147483000 !important;
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
}
.fenrir-support-root > * { pointer-events: auto; }

.fenrir-support-toggle {
  border: 0;
  border-radius: 999px;
  background: var(--ember-bright);
  color: #0a0c0f;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 18px 14px 14px;
  cursor: pointer;
  box-shadow: 0 10px 32px rgba(232, 122, 58, 0.45), 0 0 0 1px rgba(255,255,255,0.08);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
}
.fenrir-support-toggle img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0a0c0f;
}
.fenrir-support-toggle:hover { filter: brightness(1.06); }

.fenrir-support-panel {
  display: none;
  width: min(380px, calc(100vw - 28px));
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.55);
}
.fenrir-support-panel.is-open {
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 540px);
}
.fenrir-support-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated);
}
.fenrir-support-head strong { display: block; color: var(--bone); font-size: 1rem; }
.fenrir-support-head span { color: var(--muted); font-size: 0.78rem; }
.fenrir-support-status {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--warn);
}
.fenrir-support-status.ready {
  color: var(--success);
  border-color: rgba(111,159,122,0.45);
}
.fenrir-support-log {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: var(--bg);
  min-height: 180px;
}
.fenrir-support-msg {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 95%;
}
.fenrir-support-msg.bot { background: var(--panel-2); color: var(--bone); }
.fenrir-support-msg.user {
  background: rgba(232,122,58,0.18);
  color: var(--bone);
  justify-self: end;
}
.fenrir-support-cite {
  display: block;
  margin-top: 6px;
  color: var(--steel);
  font-size: 0.72rem;
}
.fenrir-support-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}
.fenrir-support-form input {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px;
  font: inherit;
}
.fenrir-support-form button {
  border: 0;
  background: var(--ember-bright);
  color: #0a0c0f;
  font-weight: 700;
  border-radius: var(--radius);
  padding: 0 14px;
  cursor: pointer;
}
.fenrir-support-actions {
  display: flex;
  gap: 8px;
  padding: 0 10px 10px;
  flex-wrap: wrap;
}
.fenrir-support-actions a {
  font-size: 0.78rem;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--bone);
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  #site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    order: 3;
    padding-bottom: 8px;
  }
  #site-nav.is-open { display: flex; }
  .nav-group {
    flex-direction: column;
    align-items: stretch;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    margin: 0;
    padding: 8px 0;
  }
  .top { flex-wrap: wrap; }
  .hero-split {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 28px;
  }
  .hero-visual { order: -1; min-height: 220px; }
  .hero-visual img { width: min(72vw, 300px); }
  .grid, .steps { grid-template-columns: 1fr; }
   .fenrir-support-root { left: 12px; bottom: 12px; right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
