*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #09090B;
  --card: #18181B;
  --border: #27272A;
  --violet: #8B5CF6;
  --fuchsia: #C026D3;
  --emerald: #22D3A5;
  --red: #EF4444;
  --amber: #F59E0B;
  --muted: #71717A;
  --fg: #F4F4F5;
  --mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  --sans: 'DM Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--violet); }

/* NAV STYLING */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 60px;
  background: rgba(9,9,11,0.72);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--mono); font-size: 1.1rem; font-weight: 700; color: var(--fg);
  cursor: pointer; display: flex; align-items: center; gap: 0.5rem;
}
.nav-logo span { color: var(--violet); }
.nav-logo-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald); animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 0%,100%{ opacity:1; transform:scale(1);} 50%{ opacity:.6; transform:scale(0.85);} }

.nav-links { display: flex; align-items: center; gap: 0.25rem; list-style: none; }
.nav-links a {
  font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
  text-decoration: none; padding: 0.35rem 0.7rem; border-radius: 4px; transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--fg); background: rgba(255,255,255,0.05); }
.nav-links a.active { color: var(--violet); }

.nav-cta {
  font-family: var(--mono); font-size: 0.78rem; font-weight: 600; color: var(--violet);
  border: 1px solid var(--violet); padding: 0.4rem 1rem; border-radius: 4px; text-decoration: none;
}
.nav-cta:hover { background: rgba(139,92,246,0.12); box-shadow: 0 0 16px rgba(139,92,246,0.3); }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; border: none; background: none; }
.hamburger span { display: block; width: 22px; height: 1.5px; background: var(--fg); transition: all 0.3s; }
.hamburger.open span:nth-child(1){ transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2){ opacity: 0; }
.hamburger.open span:nth-child(3){ transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  display: none; position: fixed; top: 60px; left: 0; right: 0;
  background: rgba(9,9,11,0.97); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); z-index: 99; padding: 1rem 2rem 1.5rem; flex-direction: column; gap: 0.25rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); text-decoration: none; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }

/* CORE UTILITIES & RESPONSIVE LAYOUT GRIDS */
.container { max-width: 1140px; margin: 0 auto; padding: 0 2rem; }
.container-sm { max-width: 740px; margin: 0 auto; padding: 0 2rem; }
main { padding-top: 60px; min-height: 100vh; }

.tag {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 500; color: var(--violet);
  background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.25);
  padding: 0.2rem 0.55rem; border-radius: 3px; text-transform: uppercase; display: inline-block;
}
.tag.emerald { color: var(--emerald); background: rgba(34,211,165,0.08); border-color: rgba(34,211,165,0.2); }
.tag.red { color: var(--red); background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); }
.tag.amber { color: var(--amber); background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2); }

h1, h2, h3 { font-family: var(--mono); line-height: 1.15; letter-spacing: -0.03em; }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 700; color: var(--fg); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.6rem); font-weight: 600; }
p { color: var(--muted); font-weight: 300; }

.btn {
  font-family: var(--mono); font-size: 0.82rem; font-weight: 600; padding: 0.65rem 1.4rem;
  border-radius: 5px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem;
  transition: all 0.22s ease; border: 1px solid transparent;
}
.btn-primary { background: var(--violet); color: #fff; border-color: var(--violet); }
.btn-primary:hover { background: #7c3aed; box-shadow: 0 0 24px rgba(139,92,246,0.45); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-outline:hover { border-color: var(--violet); color: var(--violet); background: rgba(139,92,246,0.05); }

section { padding: 6rem 0; }
section + section { border-top: 1px solid var(--border); }
.section-header { margin-bottom: 3.5rem; }
.section-header h2 { margin-top: 0.75rem; }
.section-header p { margin-top: 0.75rem; max-width: 520px; }

/* HOME ARCHITECTURE HERO STYLES */
.hero { min-height: calc(100vh - 60px); display: flex; align-items: center; position: relative; overflow: hidden; padding: 4rem 0; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.hero-tagline { font-family: var(--mono); font-size: 0.72rem; color: var(--emerald); letter-spacing: 0.15em; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }
.hero-tagline::before { content: ''; display: block; width: 20px; height: 1px; background: var(--emerald); }
.hero-sub { font-size: 1.02rem; color: var(--muted); max-width: 440px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* INTERACTIVE DEVICE ENGINE */
.phone-container { display: flex; justify-content: center; align-items: center; position: relative; }
.phone-glow { position: absolute; width: 260px; height: 520px; background: radial-gradient(ellipse at center, rgba(192,38,211,0.25) 0%, transparent 68%); border-radius: 50%; filter: blur(36px); }
.phone { position: relative; width: 260px; height: 540px; background: #0d0d0f; border-radius: 38px; border: 1.5px solid rgba(192,38,211,0.45); box-shadow: 0 0 50px rgba(192,38,211,0.22); overflow: hidden; padding: 12px 9px 9px; display: flex; flex-direction: column; }
.phone-pill { width: 72px; height: 7px; background: #000; border-radius: 4px; margin: 0 auto 8px; flex-shrink: 0; }
.phone-screen { flex: 1; background: var(--bg); border-radius: 26px; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border); position: relative; }
.phone-dot-grid { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, rgba(63,63,65,0.7) 1px, transparent 1px); background-size: 14px 14px; }

.app-topbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 11px 7px; background: rgba(9,9,11,0.92); border-bottom: 1px solid var(--border); position: relative; z-index: 2; }
.app-topbar-left { display:flex; align-items:center; gap:8px; }
.app-topbar-title { display:flex; flex-direction:column; gap:1px; }
.app-topbar-name { font-family: var(--mono); font-size: 0.6rem; font-weight: 700; color: var(--fg); }
.app-topbar-sub { font-family: var(--mono); font-size: 0.38rem; color: var(--muted); }
.app-monitoring-badge { display: flex; align-items: center; gap: 5px; background: rgba(34,211,165,0.18); border: 0.5px solid var(--emerald); border-radius: 6px; padding: 3px 8px; font-family: var(--mono); font-size: 0.38rem; color: var(--emerald); font-weight: 600; }
.app-monitoring-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 5px var(--emerald); }

.app-hero-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; position: relative; z-index: 1; gap: 6px; }
.app-hero-label { font-family: var(--mono); font-size: 0.38rem; color: var(--muted); letter-spacing: 0.18em; }
.app-hero-heading { font-family: var(--mono); font-weight: 800; font-size: 1.55rem; text-align: center; color: var(--fg); }
.app-hero-heading .status-word { color: #4ade80; }
.app-hero-sub { font-family: var(--sans); font-size: 0.45rem; color: var(--muted); text-align: center; max-width: 170px; }
.app-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 8px; }
.app-stat-val { font-family: var(--mono); font-weight: 700; font-size: 1.4rem; color: var(--violet); }
.app-stat-label { font-family: var(--mono); font-size: 0.36rem; color: var(--muted); }

.app-status-row { margin: 0 8px 8px; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 9px 11px; display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 2; }
.app-status-row-left { display:flex; align-items:center; gap:9px; }
.app-eye-box { width: 34px; height: 34px; border-radius: 10px; background: rgba(139,92,246,0.1); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; border: 1px solid rgba(139,92,246,0.2); }
.app-status-text { display:flex; flex-direction:column; gap:1px; }
.app-status-main { font-family: var(--mono); font-size: 0.52rem; font-weight: 700; color: var(--fg); }
.app-status-since { font-family: var(--mono); font-size: 0.38rem; color: var(--muted); }
.app-toggle { width: 32px; height: 18px; border-radius: 9px; background: var(--violet); position: relative; }
.app-toggle::after { content: ''; position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; }

.app-bottom-nav { border-top: 1px solid var(--border); background: var(--bg); display: flex; align-items: center; padding: 6px 0 5px; position: relative; z-index: 2; border-radius: 0 0 24px 24px; }
.app-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.app-nav-icon { width: 28px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 12px; font-size: 0.72rem; }
.app-nav-item.selected .app-nav-icon { background: rgba(139,92,246,0.15); color: var(--violet); }
.app-nav-label { font-family: var(--mono); font-size: 0.35rem; color: var(--muted); }
.app-nav-item.selected .app-nav-label { color: var(--violet); }

/* MISC DATA CONTAINERS */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-top: -1px; }
.stat-item { padding: 1.5rem; border-right: 1px solid var(--border); text-align: center; }
.stat-item:last-child { border-right: none; }
.stat-val { font-family: var(--mono); font-size: 1.8rem; font-weight: 700; color: var(--violet); display: block; }
.stat-label { font-family: var(--mono); font-size: 0.65rem; color: var(--muted); }

.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--border); }
.feature-card { background: var(--card); padding: 2.25rem; }
.feature-icon { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 1.25rem; background: rgba(139,92,246,0.05); }
.feature-title { font-family: var(--mono); font-size: 0.95rem; font-weight: 600; margin-bottom: 0.6rem; color: var(--fg); }
.feature-desc { font-size: 0.88rem; color: var(--muted); }

.arch-callout { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 2.5rem; display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
.arch-code { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); line-height: 1.8; white-space: pre; }
.arch-code .c-violet { color: var(--violet); }
.arch-code .c-emerald { color: var(--emerald); }
.arch-code .c-amber { color: var(--amber); }
.arch-code .c-red { color: var(--red); }
.arch-code .c-muted { color: #3f3f46; }

.cta-section { text-align: center; padding: 6rem 0; position: relative; }
.cta-section p { margin: 0 auto 2rem; max-width: 400px; }
.cta-section .btn-row { display:flex; gap:0.75rem; justify-content:center; flex-wrap:wrap; }

/* ABOUT SUBSTRUCTURES */
.about-hero { padding: 5rem 0 3rem; border-bottom: 1px solid var(--border); }
.about-body { font-size:1.02rem; color:var(--muted); line-height:1.8; max-width:640px; }
.philosophy-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:1.5rem; margin-top:4rem; }
.phil-card { border-left: 2px solid var(--violet); padding: 1.5rem; background: rgba(139,92,246,0.02); }
.phil-num { font-family:var(--mono); font-size:0.65rem; color:var(--violet); }
.phil-title { font-family:var(--mono); font-size:0.9rem; color:var(--fg); }
.phil-desc { font-size:0.85rem; color:var(--muted); }

/* BLOG STYLES */
.blog-hero { padding: 5rem 0 3rem; border-bottom: 1px solid var(--border); }
.blog-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:1.5rem; margin-top:3rem; }
.blog-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.blog-card-img { height: 160px; background: #111113; border-bottom: 1px solid var(--border); display:flex; align-items:center; justify-content:center; position:relative; }
.blog-card-img .img-pattern { position:absolute; inset:0; background-image: repeating-linear-gradient(0deg,transparent,transparent 19px,rgba(39,39,42,0.5) 19px, rgba(39,39,42,0.5) 20px); opacity:0.5; }
.blog-card-img .img-icon { font-size:2rem; }
.blog-card-body { padding:1.5rem; flex:1; display:flex; flex-direction:column; }
.blog-card-meta { margin-bottom: 0.9rem; }
.blog-card-title { font-family:var(--mono); font-size:0.9rem; font-weight:500; color:var(--fg); }
.blog-card-excerpt { font-size:0.83rem; color:var(--muted); }

/* CONTACT AND PRIVACY SCHEMAS */
.contact-hero { padding:5rem 0 3rem; border-bottom:1px solid var(--border); }
.contact-layout { display:grid; grid-template-columns:1fr 1.5fr; gap:4rem; margin-top:4rem; }
.contact-detail { padding:1rem 0; border-bottom:1px solid var(--border); }
.contact-detail-label { font-family:var(--mono); font-size:0.62rem; color:var(--muted); }
.contact-detail-val { font-family:var(--mono); font-size:0.82rem; color:var(--fg); text-decoration:none; }
.contact-form { display:flex; flex-direction:column; gap:1.25rem; }
.form-group { display:flex; flex-direction:column; gap:0.4rem; }
.form-label { font-family:var(--mono); font-size:0.68rem; color:var(--muted); }
.form-input, .form-textarea { background:var(--bg); border:1px solid var(--border); border-radius:5px; padding:0.7rem 1rem; color:var(--fg); font-family:var(--mono); font-size:0.82rem; outline:none; width:100%; }
.form-textarea { height:140px; resize:none; }
.form-success { display:none; background:rgba(34,211,165,0.08); border:1px solid rgba(34,211,165,0.2); border-radius:5px; padding:1rem; font-family:var(--mono); font-size:0.8rem; color:var(--emerald); text-align:center; }
.form-success.show { display:block; }

.privacy-hero { padding:5rem 0 3rem; border-bottom:1px solid var(--border); }
.privacy-content { max-width: 680px; margin-top: 3rem; }
.privacy-callout { background:rgba(34,211,165,0.05); border:1px solid rgba(34,211,165,0.15); border-radius:5px; padding:1rem 1.25rem; margin:1.25rem 0; font-family:var(--mono); font-size:0.78rem; color:var(--emerald); }

/* SYSTEM ANIMATION SETS */
.fade-in { opacity: 0; transform: translateY(16px); animation: fadeUp 0.6s ease forwards; }
@keyframes fadeUp { to{ opacity:1; transform:translateY(0); } }

/* MEDIA RESPONSIVE QUERY LAYERS */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns:1fr; gap:3rem; }
  .features-grid { grid-template-columns:1fr; }
  .stats-row { grid-template-columns:repeat(2,1fr); }
  .philosophy-grid { grid-template-columns:1fr; }
  .blog-grid { grid-template-columns:1fr; }
  .contact-layout { grid-template-columns:1fr; }
  .arch-callout { grid-template-columns:1fr; }
}
@media (max-width: 640px) {
  .nav-links, .nav-cta { display:none; }
  .hamburger { display:flex; }
  h1 { font-size:2rem; }
  h2 { font-size:1.5rem; }
  section { padding:4rem 0; }
  .stats-row { grid-template-columns:1fr 1fr; }
}