/* ==========================================================================
   SyncDoc — Theme
   Hybrid: SyncDoc's dark terminal palette + BEOPs type + structure patterns
   ========================================================================== */

/* Brand fonts — from BEOPs system */
@font-face {
  font-family: 'Highland Gothic FLF';
  src: url('../fonts/HighlandGothicLightFLF.ttf') format('truetype');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Highland Gothic FLF';
  src: url('../fonts/HighlandGothicFLF.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Highland Gothic FLF';
  src: url('../fonts/HighlandGothicFLF-Bold.ttf') format('truetype');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Bebas Neue';
  src: url('../fonts/BebasNeue-Regular.ttf') format('truetype');
  font-weight: 400; font-style: normal; font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* ---------- SYNCDOC PALETTE — dark, terminal-inspired --------------- */
  /* Deep surfaces */
  --bg:          #07090F;   /* page — nearly black, cool */
  --bg-1:        #0B0E16;   /* canvas */
  --bg-2:        #10141E;   /* surface / card */
  --bg-3:        #161B28;   /* raised card */
  --bg-4:        #1D2434;   /* hover / pressed card */

  /* Lines */
  --line:        #1A2030;
  --line-strong: #262E42;
  --line-bright: #374257;

  /* Foreground */
  --fg:          #E8ECF3;   /* primary text */
  --fg-2:        #A7B0C2;   /* secondary */
  --fg-3:        #6B7489;   /* tertiary / captions */
  --fg-4:        #4A5168;   /* low-emphasis */

  /* SyncDoc accents — cyan primary, mint for sync/success, amber for drift */
  --sync-cyan:     #34D1E8;   /* primary action / cursor */
  --sync-cyan-dim: #0FA9C2;
  --sync-blue:     #5AA4FF;
  --sync-mint:     #5EE7B5;   /* in-sync / success */
  --sync-amber:    #FFB347;   /* drift / warning */
  --sync-coral:    #FF7A6B;   /* error / diff */
  --sync-violet:   #B596FF;   /* secondary accent */

  /* Signature ribbon — SyncDoc version: mint → cyan → violet */
  --ribbon: linear-gradient(90deg,
    var(--sync-mint) 0%,
    var(--sync-cyan) 50%,
    var(--sync-violet) 100%);

  /* Focus ring */
  --focus-ring: 0 0 0 3px rgba(52, 209, 232, 0.28);

  /* ---------- APP VARIABLE MAPPING ------------------------------------ */
  /* These align the website with the app frontend CSS variables        */
  --bg-primary:     var(--bg);
  --bg-secondary:   var(--bg-1);
  --bg-card:        rgba(16, 20, 30, 0.82);
  --bg-card-strong: rgba(22, 27, 40, 0.94);
  --bg-input:       var(--bg-2);
  --bg-elevated:    var(--bg-3);
  --border:         var(--line);
  --border-light:   var(--line-strong);
  --border-bright:  var(--line-bright);
  --hover-bg:       rgba(38, 46, 66, 0.42);
  --text-primary:   var(--fg);
  --text-secondary: var(--fg-2);
  --text-muted:     var(--fg-3);
  --text-dimmed:    var(--fg-4);
  --text-white:     #f3f7fb;
  --accent:         var(--sync-cyan);
  --accent-strong:  var(--sync-cyan);
  --accent-hover:   var(--action-hover);
  --accent-icon:    var(--sync-mint);
  --accent-bg:      rgba(52, 209, 232, 0.12);
  --success:        var(--sync-mint);
  --success-bg:     rgba(94, 231, 181, 0.12);
  --warning:        var(--sync-amber);
  --warning-bg:     rgba(255, 179, 71, 0.14);
  --danger:         var(--sync-coral);
  --danger-bg:      rgba(255, 122, 107, 0.14);
  --info:           var(--sync-blue);
  --info-bg:        rgba(90, 164, 255, 0.14);
  --sidebar-bg:     rgba(11, 14, 22, 0.88);
  --topbar-bg:      rgba(7, 9, 15, 0.72);
  --panel-shadow:   var(--shadow-lg);
  --panel-glow:     0 0 40px rgba(52, 209, 232, 0.09);
  --graph-grid:     rgba(167, 176, 194, 0.1);
  --graph-edge:     #3d495f;
  --graph-edge-active: var(--sync-cyan);
  --graph-node-shadow: 0 18px 34px rgba(0, 0, 0, 0.3);
  --brand-ribbon:   var(--ribbon);

  /* ---------- SEMANTIC ------------------------------------------------ */
  --action:       var(--sync-cyan);
  --action-hover: #6FE1F2;
  --action-press: #22B7CE;

  --success:      var(--sync-mint);
  --warning:      var(--sync-amber);
  --danger:       var(--sync-coral);

  /* ---------- SHADOWS ------------------------------------------------- */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4), 0 1px 1px rgba(0,0,0,0.3);
  --shadow-md: 0 6px 16px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg: 0 18px 40px rgba(0,0,0,0.5), 0 6px 12px rgba(0,0,0,0.3);
  --glow-cyan: 0 0 32px rgba(52, 209, 232, 0.18), 0 0 1px rgba(52, 209, 232, 0.4);

  /* ---------- RADII --------------------------------------------------- */
  --r-xs: 2px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-panel: 28px;
  --r-pill: 999px;

  /* ---------- TYPE ---------------------------------------------------- */
  --font-sans:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Highland Gothic FLF', Georgia, 'Times New Roman', serif;
  --font-label:   'Bebas Neue', 'Highland Gothic FLF', Impact, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Scale */
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-md:   18px;
  --text-lg:   22px;
  --text-xl:   28px;
  --text-2xl:  36px;
  --text-3xl:  48px;
  --text-4xl:  64px;
  --text-5xl:  88px;
  --text-6xl:  128px;

  /* ---------- MOTION -------------------------------------------------- */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 120ms;
  --dur:      180ms;
  --dur-slow: 260ms;
}

/* ==========================================================================
   BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
  min-height: 100vh;
}

/* Subtle grain + grid underlay — permanent texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 80%);
}

main, header, footer, section { position: relative; z-index: 1; }

h1, h2, h3, h4, h5, h6 { margin: 0; color: inherit; }

h1, .h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-3xl);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
h2, .h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-2xl);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
h3, .h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h4 { font-family: var(--font-sans); font-weight: 600; font-size: var(--text-lg); line-height: 1.3; }

p { margin: 0; }

a {
  color: var(--action);
  text-decoration: none;
  transition: color var(--dur) var(--ease-out);
}
a:hover { color: var(--action-hover); }

code, kbd, samp, pre, .mono {
  font-family: var(--font-mono);
  font-feature-settings: 'zero', 'ss01';
}

.eyebrow {
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-5xl);
  line-height: 1.0;
  letter-spacing: -0.03em;
}

.numeric { font-family: var(--font-sans); font-feature-settings: 'tnum', 'lnum'; }

::selection { background: rgba(52, 209, 232, 0.28); color: var(--fg); }

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: 960px; margin: 0 auto; padding: 0 32px; }

@media (max-width: 900px) {
  .wrap, .wrap-narrow { padding: 0 20px; }
}

.ribbon-rail {
  height: 2px;
  width: 100%;
  background: var(--ribbon);
  opacity: 0.8;
}

/* ==========================================================================
   COMPONENTS — shared
   ========================================================================== */

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 9, 15, 0.72);
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.015em;
  color: var(--fg);
  text-decoration: none;
}
.brand:hover { color: var(--fg); }
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(16, 20, 30, 0.82);
  border: 1px solid var(--line-strong);
  position: relative;
  overflow: hidden;
}
.brand-mark::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--ribbon);
  opacity: 0.9;
  mask: radial-gradient(circle at 30% 30%, transparent 6px, #000 6.5px, #000 11px, transparent 11.5px),
        radial-gradient(circle at 70% 70%, transparent 6px, #000 6.5px, #000 11px, transparent 11.5px);
  -webkit-mask: radial-gradient(circle at 30% 30%, transparent 6px, #000 6.5px, #000 11px, transparent 11.5px),
                radial-gradient(circle at 70% 70%, transparent 6px, #000 6.5px, #000 11px, transparent 11.5px);
  mask-composite: add;
  -webkit-mask-composite: source-over;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  margin-left: 16px;
}
.nav-link {
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--r-md);
  transition: color var(--dur), background var(--dur);
}
.nav-link:hover { color: var(--fg); background: rgba(16, 20, 30, 0.7); }
.nav-link[data-active="true"] {
  color: var(--fg);
  background: rgba(16, 20, 30, 0.7);
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-inner { padding: 12px 20px; }
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--dur) var(--ease-out);
  white-space: nowrap;
  line-height: 1;
}
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: var(--r-lg); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: var(--r-md); }

.btn-primary {
  background: var(--sync-cyan);
  color: #051216;
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px rgba(52, 209, 232, 0.4), 0 8px 24px rgba(52, 209, 232, 0.2);
}
.btn-primary:hover {
  background: var(--action-hover);
  color: #051216;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(52, 209, 232, 0.5), 0 12px 32px rgba(52, 209, 232, 0.28);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-ghost {
  background: rgba(16, 20, 30, 0.6);
  color: var(--fg);
  border-color: var(--line-strong);
  border-radius: var(--r-lg);
}
.btn-ghost:hover { background: rgba(22, 27, 40, 0.85); border-color: var(--line-bright); color: var(--fg); }

.btn-ghost-sm {
  background: rgba(16, 20, 30, 0.6);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--r-lg);
}
.btn-ghost-sm:hover { background: rgba(22, 27, 40, 0.85); border-color: var(--line-bright); color: var(--fg); }

/* PILLS / TAGS */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-weight: 500;
}
.pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sync-mint);
  box-shadow: 0 0 0 3px rgba(94, 231, 181, 0.15);
}
.pill-dot.amber { background: var(--sync-amber); box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.15); }
.pill-dot.cyan { background: var(--sync-cyan); box-shadow: 0 0 0 3px rgba(52, 209, 232, 0.15); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  text-transform: none;
  letter-spacing: 0;
}

/* CARDS */
.card {
  background: rgba(16, 20, 30, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  padding: 24px;
  position: relative;
}
.card-strong {
  background: rgba(22, 27, 40, 0.94);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-panel);
  padding: 28px;
  position: relative;
}
.panel {
  background: rgba(11, 14, 22, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  overflow: hidden;
}

/* SECTION HEADERS */
.sec {
  padding: 120px 0;
}
.sec-sm { padding: 80px 0; }
.sec-head { max-width: 720px; margin-bottom: 56px; }
.sec-head .eyebrow { display: block; margin-bottom: 14px; }
.sec-head h2 {
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.sec-head p {
  font-size: 18px;
  color: var(--fg-2);
  line-height: 1.55;
  max-width: 640px;
}

@media (max-width: 820px) {
  .sec { padding: 80px 0; }
  .sec-head h2 { font-size: 36px; }
  .sec-head { margin-bottom: 40px; }
}

/* FOOTER */
.footer {
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  padding: 64px 0 28px;
  color: var(--fg-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.footer h4 {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
  margin: 0 0 16px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer a {
  color: var(--fg-2);
  font-size: 14px;
  text-decoration: none;
  transition: color var(--dur);
}
.footer a:hover { color: var(--fg); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  font-size: 12px;
  color: var(--fg-3);
  font-family: var(--font-mono);
}

@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* CODE WINDOW (shared — used in hero + features) */
.win {
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  position: relative;
}
.win-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
}
.win-dots { display: inline-flex; gap: 6px; }
.win-dots span {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--line-strong);
}
.win-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-3);
  margin-left: 4px;
}
.win-tab {
  padding: 3px 9px;
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--fg-2);
  font-size: 11px;
  border: 1px solid var(--line);
}
.win-tab[data-active="true"] { color: var(--fg); background: var(--bg); border-color: var(--line-bright); }
.win-body {
  padding: 20px 22px;
  line-height: 1.65;
  color: var(--fg-2);
  overflow: auto;
}
.tok-k { color: var(--sync-violet); }        /* keyword */
.tok-s { color: var(--sync-mint); }          /* string */
.tok-n { color: var(--sync-amber); }         /* number */
.tok-c { color: var(--fg-4); font-style: italic; } /* comment */
.tok-f { color: var(--sync-cyan); }          /* fn / prop */
.tok-t { color: var(--sync-blue); }          /* type / attr */
.tok-p { color: var(--fg-3); }               /* punct */

/* HERO BG — ambient radial glow */
.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-glow::before, .hero-glow::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
}
.hero-glow::before {
  top: -220px; left: -180px;
  width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(52, 209, 232, 0.5), transparent 60%);
}
.hero-glow::after {
  bottom: -260px; right: -200px;
  width: 720px; height: 720px;
  background: radial-gradient(circle, rgba(181, 150, 255, 0.35), transparent 60%);
}

/* Utility */
.hstack { display: flex; align-items: center; gap: 12px; }
.vstack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--fg-2); }
.mono-caps {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}
