:root {
  --bg-color: #000000;
  --card-bg: #0d0d0d;
  --card-bg-elevated: #121216;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(255, 255, 255, 0.18);
  --input-bg: #141418;
  --text-main: #f5f5f5;
  --text-soft: #d4d4d8;
  --text-muted: #888888;
  --text-dim: #555555;
  --accent: #38bdf8;
  --emerald: #34d399;
  --rose: #fb7185;
  --amber: #fbbf24;
  --dock-bg: rgba(20, 20, 20, 0.78);
  --dock-border: rgba(255, 255, 255, 0.12);
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: #27272a;
  color: #ffffff;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  background: #000000;
  color-scheme: dark;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; text-decoration: none; }

/* ==========================================================================
   AMBIENT GLOW & ANIMATED PCB BACKGROUND LAYER (Referencessss)
   ========================================================================== */
.ambient-glow {
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: min(820px, 100vw);
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.035) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.pcb-background-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  contain: strict;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.pcb-grid-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.35;
  contain: strict;
}
.pcb-svg-traces {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  shape-rendering: geometricPrecision;
}
.pcb-trace {
  stroke: rgba(255, 255, 255, 0.035);
  stroke-width: 1;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pcb-trace.accent { stroke: rgba(56, 189, 248, 0.055); }
.pcb-pad { fill: rgba(255, 255, 255, 0.04); stroke: rgba(255, 255, 255, 0.09); stroke-width: 0.75; }
.pcb-via { fill: #000; stroke: rgba(255, 255, 255, 0.1); stroke-width: 0.75; }
.pcb-chip { fill: rgba(255, 255, 255, 0.01); stroke: rgba(255, 255, 255, 0.05); stroke-width: 0.8; stroke-dasharray: 4 2; }
.pulse-line { fill: none; stroke-linecap: round; stroke-linejoin: round; will-change: stroke-dashoffset; }
.pulse-cyan {
  stroke: #38bdf8; stroke-width: 1.5; stroke-dasharray: 40 450;
  filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.8));
  animation: circuitFlow1 9s linear infinite;
}
.pulse-emerald {
  stroke: #34d399; stroke-width: 1.4; stroke-dasharray: 35 400;
  filter: drop-shadow(0 0 3px rgba(52, 211, 153, 0.8));
  animation: circuitFlow2 11s linear infinite;
}
.pulse-purple {
  stroke: #a78bfa; stroke-width: 1.4; stroke-dasharray: 40 430;
  filter: drop-shadow(0 0 3px rgba(167, 139, 250, 0.8));
  animation: circuitFlow3 13s linear infinite;
}
@keyframes circuitFlow1 { 0% { stroke-dashoffset: 490; } 100% { stroke-dashoffset: -490; } }
@keyframes circuitFlow2 { 0% { stroke-dashoffset: 435; } 100% { stroke-dashoffset: -435; } }
@keyframes circuitFlow3 { 0% { stroke-dashoffset: 470; } 100% { stroke-dashoffset: -470; } }
.node-pulse-1 { animation: nodeBlinkLight 3.5s infinite ease-in-out; }
.node-pulse-2 { animation: nodeBlinkLight 4.8s infinite ease-in-out 1.2s; }
.node-pulse-3 { animation: nodeBlinkLight 3.1s infinite ease-in-out 0.6s; }
@keyframes nodeBlinkLight { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.85; } }
@media (prefers-reduced-motion: reduce) {
  .pulse-line, .node-pulse-1, .node-pulse-2, .node-pulse-3 { animation: none !important; }
}

/* ==========================================================================
   TOP-RIGHT FLOATING UTILITY BAR (Viewer + Language)
   ========================================================================== */
.top-float-utils {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 8px;
}
.util-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 9999px;
  background: var(--dock-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--dock-border);
  color: #f5f5f5;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.util-pill-btn i { color: var(--accent); font-size: 12px; }
.util-pill-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Override i18n pill styling cleanly for Obsidian */
.top-float-utils .lang-select-wrap {
  background: var(--dock-bg) !important;
  border: 1px solid var(--dock-border) !important;
  color: #f5f5f5 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
  height: 34px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.top-float-utils .lang-select-box { color: #f5f5f5 !important; }
.top-float-utils .lang-select-box option { background: #121216; color: #f5f5f5; }
.top-float-utils .lang-globe-icon { fill: var(--accent) !important; }

/* ==========================================================================
   FLOATING LEFT DOCK NAVIGATION (DESKTOP) / BOTTOM DOCK (MOBILE)
   ========================================================================== */
.dock-container {
  position: fixed;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--dock-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--dock-border);
  border-radius: 9999px;
  padding: 10px 8px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.65);
}
.dock-item {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}
.dock-item svg { width: 20px; height: 20px; transition: transform 0.2s ease; fill: currentColor; }
.dock-item i { font-size: 16.5px; line-height: 1; transition: transform 0.2s ease; }
.dock-item svg path, .dock-item svg g { fill: currentColor; }
.dock-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.08);
}
.dock-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}
.dock-tooltip {
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: rgba(18, 18, 18, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.dock-item:hover .dock-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* Floating Action Button (Bottom Right Desktop) */
.btn-action {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(24, 24, 27, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 9999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
  transition: all 0.25s ease;
}
.btn-action i { color: var(--accent); font-size: 12px; }
.btn-action:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  transform: translateY(-2px);
}
.btn-action:hover i { color: #000000; }

/* ==========================================================================
   CENTERED SINGLE-COLUMN EDITORIAL WRAPPER
   ========================================================================== */
.main-wrapper {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 84px 24px 96px 96px;
}
.main-wrapper.wide-wrapper {
  max-width: 880px;
}
body.no-dock .main-wrapper,
body.no-dock .main-wrapper.wide-wrapper {
  padding-left: 24px;
}

.brand-img.is-off,
.brand-logo-img.is-off { display: none !important; }

/* Editorial Page Header Block */
.page-hero-head {
  margin-bottom: 28px;
}
.brand-row-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}
.brand-logo-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.brand-logo-img {
  max-height: 52px;
  max-width: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
  display: block;
}
.brand-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--accent);
  font-size: 20px;
  position: relative;
}
.brand-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 11px;
  height: 11px;
  background-color: #10b981;
  border: 2px solid #000000;
  border-radius: 50%;
}
.page-kicker-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d4d4d8;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.kicker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  flex-shrink: 0;
}
.kicker-dot.cyan {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 10px;
}
.page-lede {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 600px;
}

/* Obsidian Card Surface & Form Controls */
.obsidian-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 28px;
  transition: border-color 0.25s ease;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 7px;
}
.field label .req { color: var(--rose); }
.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field input::placeholder,
.field textarea::placeholder { color: #52525b; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(56, 189, 248, 0.55);
  background: #18181d;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}
.field textarea { min-height: 82px; resize: vertical; }
.field .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.45;
}

/* Shared Buttons */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}
.btn.primary i { color: #000000; }
.btn.primary:hover:not(:disabled) {
  background: #e4e4e7;
  transform: translateY(-1px);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.btn.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

/* ==========================================================================
   COMPACT EDITORIAL FOOTER
   ========================================================================== */
.site-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--card-border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
.footer-brand-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 8px;
}
.footer-brand-line i { color: var(--accent); }
.footer-col-bio p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.footer-socials { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-social-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d4d4d8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
}
.footer-social-btn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}
.footer-col-links h4 {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
  margin-bottom: 12px;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.footer-links a:hover { color: #ffffff; }
.footer-bottom {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}
.footer-bottom strong { color: var(--text-muted); }

/* ==========================================================================
   RESPONSIVE DOCK & LAYOUT RULES
   ========================================================================== */
@media (max-width: 900px) {
  .dock-container {
    left: 50%;
    top: auto;
    bottom: 18px;
    transform: translateX(-50%);
    flex-direction: row;
    padding: 7px 10px;
    gap: 4px;
  }
  .dock-item { width: 40px; height: 40px; }
  .dock-tooltip { display: none; }
  .btn-action { display: none; }
  .main-wrapper,
  .main-wrapper.wide-wrapper {
    padding: 74px 18px 115px;
  }
}

@media (max-width: 680px) {
  .top-float-utils { top: 14px; right: 14px; }
  .obsidian-card { padding: 20px 18px; border-radius: 16px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
