/* HadayaLab Sovereign OS v15.3 - Dark Hairline Design System */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  --bg-black: #000000;
  --bg-card: #0a0a0a;
  --bg-card-hover: #121212;
  --border-hairline: #262626;
  --border-subtle: #1c1c1c;
  --border-focus: #404040;
  --text-primary: #ededed;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-emerald: #10b981;
  --accent-emerald-bg: rgba(16, 185, 129, 0.1);
  --accent-crimson: #ef4444;
  --accent-crimson-bg: rgba(239, 68, 68, 0.1);
  --accent-blue: #3b82f6;
  --accent-blue-bg: rgba(59, 130, 246, 0.1);
  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.1);
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', 'SFMono-Regular', Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg-black);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-black);
}

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

/* Hairline Grid & Crosshair Accents */
.hairline-grid {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  position: relative;
}

.hairline-border {
  border: 1px solid var(--border-hairline);
}

.hairline-border-t { border-top: 1px solid var(--border-hairline); }
.hairline-border-b { border-bottom: 1px solid var(--border-hairline); }
.hairline-border-l { border-left: 1px solid var(--border-hairline); }
.hairline-border-r { border-right: 1px solid var(--border-hairline); }

.crosshair-container {
  position: relative;
}

.crosshair {
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
}

.crosshair::before, .crosshair::after {
  content: '';
  position: absolute;
  background: #52525b;
}

.crosshair::before { top: 4px; left: 0; width: 9px; height: 1px; }
.crosshair::after { top: 0; left: 4px; width: 1px; height: 9px; }

.crosshair-tl { top: -5px; left: -5px; }
.crosshair-tr { top: -5px; right: -5px; }
.crosshair-bl { bottom: -5px; left: -5px; }
.crosshair-br { bottom: -5px; right: -5px; }

/* Announcement Bar */
.announcement-bar {
  background: #09090b;
  border-bottom: 1px solid var(--border-hairline);
  padding: 8px 16px;
  font-size: 13px;
  text-align: center;
  color: var(--text-secondary);
}

.announcement-bar a {
  color: var(--accent-blue);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.announcement-bar a:hover {
  text-decoration: underline;
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-hairline);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo, .brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  margin-right: 32px;
  flex-shrink: 0;
  white-space: nowrap;
}

.logo-symbol {
  width: 24px;
  height: 24px;
  border: 1px solid var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-badge-pill {
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 1200px) {
  .header-badge-pill .badge-text-full { display: none !important; }
  .header-badge-pill .badge-text-compact { display: inline !important; }
}

@media (max-width: 960px) {
  .header-inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 16px;
  }
  .header-inner::-webkit-scrollbar {
    display: none;
  }
}

/* Badges & Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.pill-mono {
  font-family: var(--font-mono);
}

.pill-emerald {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.pill-crimson {
  background: var(--accent-crimson-bg);
  color: var(--accent-crimson);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.pill-blue {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.pill-gray {
  background: #18181b;
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
}

/* Wallet Trigger Button */
.wallet-badge-btn {
  background: #121212;
  border: 1px solid var(--border-hairline);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font-mono);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.wallet-badge-btn:hover {
  background: #1c1c1c;
  border-color: var(--border-focus);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-primary {
  background: var(--text-primary);
  color: #000;
  border: 1px solid var(--text-primary);
}

.btn-primary:hover {
  background: #ffffff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.2);
}

.btn-secondary {
  background: #0a0a0a;
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
}

.btn-secondary:hover {
  background: #171717;
  border-color: var(--border-focus);
}

.btn-emerald {
  background: var(--accent-emerald);
  color: #000;
  font-weight: 600;
  border: 1px solid var(--accent-emerald);
}

.btn-emerald:hover {
  background: #059669;
}

/* Layout Containers */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 40px;
}

/* Cards & Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  padding: 24px;
  border-radius: 8px;
  position: relative;
  transition: all 0.2s ease;
}

.card:hover {
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

/* Article Layout */
.article-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
}

.article-content {
  min-width: 0;
}

.article-header {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-hairline);
  padding-bottom: 24px;
}

.article-title {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 16px 0 12px;
}

.article-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.author-link {
  color: var(--text-primary);
  font-weight: 500;
}

.article-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
}

.article-body h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-hairline);
}

.article-body h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 12px;
}

.article-body p {
  margin-bottom: 20px;
  color: #d4d4d8;
}

.article-body ul, .article-body ol {
  margin: 0 0 20px 24px;
  color: #d4d4d8;
}

.article-body li {
  margin-bottom: 8px;
}

.code-block {
  background: #0d0d0d;
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  margin: 20px 0;
  overflow: hidden;
}

.code-header {
  background: #141414;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  justify-content: space-between;
}

.code-block pre {
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: #ededed;
}

/* Callout Box */
.callout {
  border-left: 3px solid var(--accent-blue);
  background: rgba(59, 130, 246, 0.05);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 6px 6px 0;
  font-size: 15px;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--accent-blue);
}

/* 5-Register Storefront Widget */
.storefront-widget {
  background: #080808;
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  margin: 48px 0;
  overflow: hidden;
}

.storefront-header {
  background: #111111;
  border-bottom: 1px solid var(--border-hairline);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.storefront-body {
  padding: 24px;
}

.register-card {
  background: #0d0d0d;
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
}

.register-card.active {
  border-color: var(--border-focus);
}

.register-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* Explainer Container */
.explainer-frame-wrapper {
  background: #000000;
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  margin: 32px 0;
  overflow: hidden;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.explainer-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000000;
}

/* Right Sticky Rail */
.sticky-rail {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.rail-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  padding: 20px;
}

.rail-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: #0a0a0a;
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  width: 100%;
  max-width: 540px;
  padding: 32px;
  position: relative;
}

/* Site Footer */
.site-footer {
  background: #050505;
  border-top: 1px solid var(--border-hairline);
  padding: 64px 0 32px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 48px;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  max-width: 340px;
  margin-top: 12px;
}

.footer-col h4 {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  max-width: 1320px;
  margin: 48px auto 0;
  padding: 24px 24px 0;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .article-container {
    grid-template-columns: 1fr;
  }
  .sticky-rail {
    position: static;
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .section-title {
    font-size: 28px;
  }
  .article-title {
    font-size: 28px;
  }
}
