/* ============================================================
   AlloySync Core — Sync Command design system
   Operated by Netpo, LLC · alloysynccore.com
   ============================================================ */

:root {
  /* Core surfaces */
  --graphite: #0B1118;
  --navy: #101A2A;
  --ink: #151E2B;
  --ink-2: #19243414;
  --panel: #18222F;
  --panel-2: #1C2838;
  --steel: #2A3748;
  --steel-soft: #223043;

  /* Text */
  --silver: #D8E0EA;
  --slate: #8FA1B5;
  --slate-dim: #6C7E93;

  /* Signal */
  --blue: #2F7BFF;
  --blue-700: #1E5BD6;
  --cyan: #23D7F5;
  --green: #45D483;
  --amber: #F5B84B;
  --red: #EF5E5E;

  /* Light content pages */
  --light: #F4F7FA;
  --light-card: #FFFFFF;
  --light-border: #E2E8F0;
  --ink-text: #16202C;
  --ink-text-2: #41526A;

  --radius: 12px;
  --radius-sm: 10px;
  --radius-lg: 14px;

  --maxw: 1200px;
  --gutter: 24px;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --shadow-panel: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px -24px rgba(0,0,0,.8);
  --glow-blue: 0 0 0 1px rgba(47,123,255,.4), 0 0 22px -6px rgba(47,123,255,.55);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--graphite);
  color: var(--silver);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.light {
  background: var(--light);
  color: var(--ink-text);
}

h1, h2, h3, h4 { line-height: 1.12; margin: 0; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 var(--gutter); }

.mono { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
.light .eyebrow { color: var(--blue-700); }

.section { padding: clamp(64px, 9vw, 116px) 0; }
.section-tight { padding: clamp(40px, 6vw, 72px) 0; }
.lead { color: var(--slate); font-size: 1.12rem; max-width: 62ch; }
.light .lead { color: var(--ink-text-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-weight: 600; font-size: .95rem;
  padding: 12px 22px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 22px -12px rgba(47,123,255,.9); }
.btn-primary:hover { background: var(--blue-700); box-shadow: 0 10px 26px -10px rgba(47,123,255,.95); }
.btn-ghost { background: rgba(255,255,255,.03); color: var(--silver); border-color: var(--steel); }
.btn-ghost:hover { border-color: #3a4c63; background: rgba(255,255,255,.06); }
.light .btn-ghost { background: #fff; color: var(--ink-text); border-color: var(--light-border); }
.light .btn-ghost:hover { border-color: #c6d2e0; }
.btn-cyan { background: var(--cyan); color: #04222a; }
.btn-cyan:hover { background: #4ce0f8; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: .82rem; border-radius: 8px; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px;
}
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:active { transform: none; }

.textlink {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--cyan); font-weight: 500; font-size: .92rem;
}
.textlink:hover { color: #5ee3fb; }
.textlink::after { content: "→"; transition: transform .15s ease; }
.textlink:hover::after { transform: translateX(3px); }
.light .textlink { color: var(--blue-700); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 11px; color: var(--silver); }
.light .logo { color: var(--ink-text); }
.logo svg { width: 30px; height: 30px; flex: none; }
.logo .word { font-weight: 600; font-size: 1.18rem; letter-spacing: -0.03em; }
.logo .word b { font-weight: 600; }
.logo .word span { color: var(--blue); }
.light .logo .word span { color: var(--blue-700); }

/* ---------- Announcement bar ---------- */
.annbar {
  background: var(--navy);
  border-bottom: 1px solid var(--steel-soft);
  font-family: var(--mono);
  font-size: .76rem; letter-spacing: .02em;
  color: var(--slate);
  text-align: center;
  padding: 8px 16px;
}
.annbar .dot { display:inline-block; width:7px;height:7px;border-radius:50%;background:var(--green);margin-right:8px;box-shadow:0 0 8px var(--green);vertical-align:middle; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 80;
  background: rgba(11,17,24,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--steel-soft);
}
.light .site-header { background: rgba(255,255,255,.86); border-bottom: 1px solid var(--light-border); }
.header-row { display: flex; align-items: center; gap: 28px; height: 66px; }
.header-nav { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.header-nav a {
  font-size: .9rem; font-weight: 500; color: var(--slate);
  padding: 8px 12px; border-radius: 8px; transition: color .15s, background .15s;
}
.header-nav a:hover { color: var(--silver); background: rgba(255,255,255,.04); }
.light .header-nav a { color: var(--ink-text-2); }
.light .header-nav a:hover { color: var(--ink-text); background: #eef2f7; }
.header-nav a.active { color: var(--cyan); }
.light .header-nav a.active { color: var(--blue-700); }
.header-cta { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header-cta .open-cmd { font-size: .86rem; color: var(--slate); }
.header-cta .open-cmd:hover { color: var(--cyan); }
.menu-toggle { display: none; background: none; border: 1px solid var(--steel); border-radius: 8px; width: 40px; height: 40px; color: var(--silver); cursor: pointer; }
.light .menu-toggle { color: var(--ink-text); border-color: var(--light-border); }

.mobile-menu { display: none; }
@media (max-width: 940px) {
  .header-nav, .header-cta .desktop-only { display: none; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .header-cta { margin-left: auto; gap: 8px; }
  .mobile-menu { display: block; border-bottom: 1px solid var(--steel-soft); background: var(--graphite); padding: 12px var(--gutter) 20px; }
  .mobile-menu.hidden { display: none; }
  .mobile-menu a { display: block; padding: 12px 6px; color: var(--silver); font-weight: 500; border-bottom: 1px solid var(--steel-soft); }
  .light .mobile-menu { background: var(--light); }
  .light .mobile-menu a { color: var(--ink-text); border-color: var(--light-border); }
  .mobile-menu .mm-cta { display: flex; gap: 10px; margin-top: 16px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); border-top: 1px solid var(--steel-soft); color: var(--slate); padding: 64px 0 36px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; }
.footer-brand p { color: var(--slate); font-size: .92rem; margin-top: 16px; max-width: 34ch; }
.footer-col h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--slate-dim); font-family: var(--mono); margin-bottom: 16px; font-weight: 500; }
.footer-col a { display: block; padding: 5px 0; color: var(--silver); font-size: .9rem; }
.footer-col a:hover { color: var(--cyan); }
.footer-contact { font-size: .88rem; line-height: 1.9; }
.footer-contact .mono { color: var(--silver); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--steel-soft); font-size: .82rem; color: var(--slate-dim); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Generic panels / cards ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--ink));
  border: 1px solid var(--steel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}
.card {
  background: var(--ink);
  border: 1px solid var(--steel-soft);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .15s, transform .15s, background .15s;
}
.card:hover { border-color: #34465c; }
.light .card { background: #fff; border-color: var(--light-border); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--steel);
  color: var(--slate); white-space: nowrap;
}
.badge.ok { color: var(--green); border-color: rgba(69,212,131,.35); background: rgba(69,212,131,.08); }
.badge.warn { color: var(--amber); border-color: rgba(245,184,75,.35); background: rgba(245,184,75,.08); }
.badge.err { color: var(--red); border-color: rgba(239,94,94,.35); background: rgba(239,94,94,.08); }
.badge.info { color: var(--cyan); border-color: rgba(35,215,245,.3); background: rgba(35,215,245,.07); }
.badge.blue { color: #7fb0ff; border-color: rgba(47,123,255,.35); background: rgba(47,123,255,.1); }

.dot-status { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-status.ok { background: var(--green); box-shadow: 0 0 7px var(--green); }
.dot-status.warn { background: var(--amber); box-shadow: 0 0 7px var(--amber); }
.dot-status.err { background: var(--red); box-shadow: 0 0 7px var(--red); }
.dot-status.blue { background: var(--blue); box-shadow: 0 0 7px var(--blue); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: .82rem; font-weight: 500; color: var(--slate); }
.light .field label { color: var(--ink-text-2); }
.field .req { color: var(--red); }
input, select, textarea {
  font-family: var(--sans); font-size: .95rem;
  background: var(--graphite); color: var(--silver);
  border: 1px solid var(--steel); border-radius: 9px;
  padding: 11px 13px; width: 100%;
}
.light input, .light select, .light textarea { background: #fff; color: var(--ink-text); border-color: var(--light-border); }
input::placeholder, textarea::placeholder { color: var(--slate-dim); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238FA1B5' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.field-error { color: var(--red); font-size: .78rem; display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); }
.field.invalid .field-error { display: block; }

/* ---------- Hairline grid bg ---------- */
.grid-bg {
  background-image: linear-gradient(var(--steel-soft) 1px, transparent 1px), linear-gradient(90deg, var(--steel-soft) 1px, transparent 1px);
  background-size: 46px 46px;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
}

/* ---------- Toast ---------- */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--panel-2); border: 1px solid var(--steel);
  border-left: 3px solid var(--blue);
  border-radius: 10px; padding: 13px 16px; min-width: 260px; max-width: 360px;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.8);
  animation: toastin .25s ease;
  color: var(--silver); font-size: .88rem;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast strong { display: block; font-size: .82rem; margin-bottom: 1px; }
@keyframes toastin { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------- Utility ---------- */
.grid { display: grid; gap: 20px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 940px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }
.muted { color: var(--slate); }
.center { text-align: center; }
.icon { width: 22px; height: 22px; stroke: var(--cyan); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.flex { display: flex; }
.between { justify-content: space-between; }
.aic { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-40 { margin-top: 40px; }
.wrap-flex { flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
