/* ============================================================
   Fireflight · Nebula Tech Venture — Constellation Network site
   Plain CSS, no framework. Design tokens mirror DagScan
   (https://www.dagscan.io) so both sites read as one brand.
   Dark by default; light theme via <html data-theme="light">.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg: #070b14;
  --bg-band: #0a1120;
  --card: #0d1526;
  --muted-bg: #101a2e;
  --secondary: #16213a;
  --border: #1b2740;
  --text: #e6ebf4;
  --heading: #f4f7fc;
  --muted: #8695ae;

  --primary: #ff9933;
  --primary-hover: #ffad5c;
  --primary-fg: #1f1000;
  --primary-soft: rgba(255, 153, 51, 0.12);
  --link: #ffad5c;
  --success: #34d399;

  --glow-1: rgba(245, 129, 32, 0.09);
  --glow-2: rgba(129, 140, 248, 0.06);
  --fire: linear-gradient(100deg, #ffca05 0%, #f58120 50%, #ed1c24 100%);

  --code-bg: #050811;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  --radius: 0.7rem;
  --radius-lg: 1rem;
  --maxw: 1180px;
  --nav-h: 68px;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-band: #eef2f8;
  --card: #ffffff;
  --muted-bg: #eef2f8;
  --secondary: #eef2f8;
  --border: #e2e8f0;
  --text: #1e293b;
  --heading: #0b1220;
  --muted: #55627a;

  --primary: #c2410c;
  --primary-hover: #9a3412;
  --primary-fg: #ffffff;
  --primary-soft: #fff1e6;
  --link: #c2410c;
  --success: #047857;

  --glow-1: rgba(245, 129, 32, 0.07);
  --glow-2: rgba(99, 102, 241, 0.05);

  --code-bg: #0f172a;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);

  color-scheme: light;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

a { color: var(--link); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  color: var(--heading);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
strong { color: var(--heading); font-weight: 600; }

img { max-width: 100%; height: auto; }

code, pre { font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace; }
:not(pre) > code {
  background: var(--muted-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }

.section { padding: 4rem 0; }
.section--tight { padding: 2.5rem 0; }
.section--band { background: var(--bg-band); border-block: 1px solid var(--border); }

.section-head { margin-bottom: 2rem; max-width: 68ch; }
.section-head p { color: var(--muted); }

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.lead { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }

/* ============================================================
   Navbar
   ============================================================ */
#site-header { min-height: var(--nav-h); }

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--heading);
  white-space: nowrap;
}
.brand:hover { color: var(--heading); text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.brand__name span {
  background: var(--fire);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand__sub { font-size: 0.68rem; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; margin-top: 2px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.94rem;
}
.nav-links a:hover { color: var(--heading); background: var(--secondary); text-decoration: none; }
.nav-links a.active { color: var(--heading); background: var(--secondary); }
.nav-links .ext { font-size: 0.7em; opacity: 0.7; }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}
.icon-btn:hover { background: var(--secondary); }
.theme-toggle .fa-moon { display: none; }
:root[data-theme="light"] .theme-toggle .fa-sun { display: none; }
:root[data-theme="light"] .theme-toggle .fa-moon { display: inline; }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem 1.25rem;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.7rem 0.85rem; }
  .nav-actions .btn span { display: none; }
}
@media (max-width: 400px) {
  .brand__sub { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: 1.5rem 0 0; }
.hero__card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(700px 320px at 12% -10%, var(--glow-1), transparent 65%),
    radial-gradient(600px 300px at 95% 110%, var(--glow-2), transparent 60%),
    var(--card);
  padding: 3rem 1.25rem;
  text-align: center;
}
@media (min-width: 640px) { .hero__card { padding: 4.5rem 2.5rem; } }
.hero__logo { height: 84px; width: auto; margin: 0 auto 1.25rem; display: block; }
.hero h1 { margin-bottom: 0.75rem; }
.hero .lead { margin: 0 auto; }
.hero .btn-row { justify-content: center; margin-top: 2rem; }

.text-fire {
  background: var(--fire);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* interior page heading */
.page-head { padding: 3rem 0 0.5rem; }
.page-head .lead { margin-bottom: 0; }
.page-head .btn-row { margin-top: 1.5rem; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--heading); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.3;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: var(--primary-fg); }
.btn--primary:hover { background: var(--primary-hover); color: var(--primary-fg); }
.btn--ghost { background: transparent; color: var(--heading); border-color: var(--border); }
.btn--ghost:hover { background: var(--secondary); color: var(--heading); }
.btn--sm { padding: 0.45rem 0.85rem; font-size: 0.88rem; }
.btn .fa-arrow-up-right-from-square { font-size: 0.75em; opacity: 0.8; }
.btn[disabled] { opacity: 0.6; cursor: wait; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ============================================================
   Cards & grids
   ============================================================ */
.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}
.card h3 { margin-bottom: 0.45rem; }
.card p:last-child { margin-bottom: 0; }
.card .muted { font-size: 0.95rem; }

a.card { display: block; color: inherit; transition: border-color 0.15s ease, transform 0.15s ease; }
a.card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); transform: translateY(-2px); }
a.card:hover h3 { color: var(--primary); }
.card__more { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.9rem; font-size: 0.9rem; font-weight: 600; color: var(--link); }

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* stat / fact tiles (DagScan style) */
.tile { padding: 1.15rem 1.25rem; }
.tile__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tile__value { font-size: 1.6rem; font-weight: 700; color: var(--heading); letter-spacing: -0.02em; margin: 0.35rem 0 0.15rem; }
.tile__hint { font-size: 0.86rem; color: var(--muted); }

/* split layout */
.split { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }

/* numbered steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; counter-reset: step; }
.steps > li { position: relative; padding-left: 3rem; counter-increment: step; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* check list */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.checks li { display: flex; gap: 0.7rem; align-items: baseline; }
.checks i { color: var(--primary); flex: none; }

/* notice */
.notice {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  color: var(--text);
}
.notice > i { color: var(--primary); font-size: 1.05rem; margin-top: 0.25rem; }
.notice p:last-child { margin-bottom: 0; }

/* CTA band */
.cta {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 240px at 0% 0%, var(--glow-1), transparent 70%),
    var(--card);
  padding: 2rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.cta h2 { margin-bottom: 0.35rem; }
.cta p { margin: 0; color: var(--muted); max-width: 60ch; }
.cta .btn-row { margin-top: 0; }

/* embedded status page */
.embed {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
}
.embed iframe { display: block; width: 100%; height: 1100px; border: 0; }

/* copyable value */
.copy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--muted-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.5rem 0.5rem 0.85rem;
}
.copy code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 0.9rem; color: var(--heading); }

/* ============================================================
   Knowledge base articles
   ============================================================ */
.kb-card { display: flex !important; gap: 1.1rem; align-items: flex-start; }
.kb-card .card__icon { flex: none; margin-bottom: 0; }

.article { max-width: 780px; }
.article h2 { margin-top: 2.5rem; }
.article h3 { margin-top: 2rem; }
.article ol, .article ul { padding-left: 1.3rem; }
.article li { margin-bottom: 0.9rem; }
.article li > ul, .article li > ol { margin-top: 0.6rem; }
.article li > ul li { margin-bottom: 0.35rem; }
.article li::marker { color: var(--primary); font-weight: 600; }

.article figure { margin: 1rem 0 1.25rem; }
.article figure a { display: block; }
.article figure img {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  max-height: 520px;
  width: auto;
  cursor: zoom-in;
}

.code {
  position: relative;
  margin: 0.6rem 0 1rem;
}
.code pre {
  margin: 0;
  background: var(--code-bg);
  color: #e6ebf4;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 3.25rem 0.85rem 1rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.55;
}
.code .copy-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 32px;
  height: 32px;
  color: #8695ae;
  background: var(--code-bg);
  border-radius: 8px;
}
.code .copy-btn:hover { background: #16213a; color: #e6ebf4; }

.code-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin: 1rem 0 0; }

details.collapse {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  margin: 1rem 0 1.5rem;
}
details.collapse > summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--heading);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
details.collapse > summary::-webkit-details-marker { display: none; }
details.collapse > summary::before {
  content: "\f054";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.75rem;
  color: var(--primary);
  transition: transform 0.15s ease;
}
details.collapse[open] > summary::before { transform: rotate(90deg); }
details.collapse > .collapse__body { padding: 0 1.25rem 1.25rem; }

.article-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 6, 12, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--radius); }

/* ============================================================
   Contact
   ============================================================ */
.contact-list { display: grid; gap: 0.6rem; }
.contact-line {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted-bg);
  color: var(--text);
}
.contact-line:hover { text-decoration: none; border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); color: var(--heading); }
.contact-line i { color: var(--primary); width: 1.25rem; text-align: center; font-size: 1.1rem; }
.contact-line .handle { margin-left: auto; color: var(--muted); font-size: 0.9rem; }


/* ============================================================
   Footer
   ============================================================ */
.footer { border-top: 1px solid var(--border); padding: 3rem 0 2rem; margin-top: 2.5rem; }
.footer__grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .footer__grid { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); } }
.footer__brand p { color: var(--muted); font-size: 0.92rem; margin-top: 0.9rem; max-width: 40ch; }
.footer h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.9rem;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; font-size: 0.93rem; }
.footer ul a { color: var(--text); }
.footer ul a:hover { color: var(--primary); }
.footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.socials { display: flex; gap: 0.5rem; margin-top: 1rem; }
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text);
}
.social-link:hover { color: var(--primary-fg); background: var(--primary); border-color: transparent; text-decoration: none; }

/* ---------- Utilities ---------- */
.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.small { font-size: 0.88rem; }
