:root {
  --bg-deep: #000000;
  --bg-panel: #050505;
  --bg-hover: #0a0a0a;
  --line-faint: rgba(255, 255, 255, 0.08);
  --line-solid: rgba(255, 255, 255, 0.15);
  --line-active: rgba(255, 255, 255, 0.4);
  
  --text-main: #ffffff;
  --text-muted: #888888;
  --text-faint: #555555;
  --accent: #ffffff;
  
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Menlo", "Consolas", monospace;
  
  --shell-width: 1400px;
  --topbar-height: 80px;
  --radius: 4px;
  
  color-scheme: dark;
}

* { box-sizing: border-box; }

body, html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Static base grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-faint) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center bottom;
  mask-image: radial-gradient(circle at center 20%, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
  -webkit-mask-image: radial-gradient(circle at center 20%, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
  z-index: 0;
}

/* Flowing light effect along the grid */
@keyframes gridFlow {
  0% { background-position: 0 0; }
  100% { background-position: 64px 64px; }
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-active) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-active) 1px, transparent 1px);
  background-size: 64px 64px;
  animation: gridFlow 5s linear infinite;
  mask-image: radial-gradient(circle at center 30%, rgba(0,0,0,0.2) 0%, transparent 40%);
  -webkit-mask-image: radial-gradient(circle at center 30%, rgba(0,0,0,0.2) 0%, transparent 40%);
  z-index: 0;
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

/* Base Layout */
.site-shell {
  position: relative;
  z-index: 1;
  width: min(100%, var(--shell-width));
  margin: 0 auto;
  padding: 0 32px 64px;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--line-faint);
  margin-bottom: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

@keyframes textShine {
  to {
    background-position: 200% center;
  }
}

.brand span {
  background: linear-gradient(
    110deg,
    #a8c7fa 0%,
    #d3e3fc 30%,
    #ffffff 50%,
    #d3e3fc 70%,
    #a8c7fa 100%
  );
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: textShine 5s linear infinite;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.topbar-actions a:hover {
  color: var(--text-main);
}

/* Monospace Tags / Eyebrows */
.mono-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  display: block;
  margin-bottom: 16px;
}

/* Hero Section */
.hero {
  max-width: 960px;
  margin-bottom: 96px;
}

h1.display {
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 32px 0;
}

.lede {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 0 48px 0;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--text-main);
  color: var(--bg-deep);
  border: 1px solid var(--text-main);
}

.btn-primary:hover {
  background: transparent;
  color: var(--text-main);
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--line-solid);
}

.btn-secondary:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

/* Bento Grid System for Features */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 96px;
}

/* Flip Card Container */
.bento-card {
  perspective: 1500px;
  background: transparent;
  cursor: pointer;
  min-height: 280px;
  border-radius: var(--radius);
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.bento-card:hover .flip-inner {
  transform: rotateY(180deg);
}

/* Front & Back Faces */
.flip-front, .flip-back {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line-faint);
  background: var(--bg-panel);
}

.flip-front {
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.flip-back {
  transform: rotateY(180deg);
  background: #020202;
  border-color: var(--line-active);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bento-card:hover .flip-front {
  border-color: var(--line-active);
}

/* Spanning classes */
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

@media (max-width: 1024px) {
  .span-4, .span-6, .span-8 { grid-column: span 6; }
}

@media (max-width: 768px) {
  .span-4, .span-6, .span-8, .span-12 { grid-column: span 12; }
}

.card-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 16px 0;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.card-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.card-icon {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: auto;
  padding-bottom: 24px;
}

/* Back face images / screenshots */
.card-image-wrapper {
  width: 100%;
  height: 100%;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.card-image-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.multi-phone {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
.multi-phone img {
  height: 100%;
  max-height: 380px;
  border-radius: 6px;
  border: 1px solid var(--line-solid);
}

/* Technical Specs / Installation Section */
.tech-section {
  border-top: 1px solid var(--line-faint);
  padding-top: 64px;
  margin-bottom: 96px;
}

.install-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.install-box {
  border: 1px solid var(--line-faint);
  background: var(--bg-panel);
  padding: 24px;
  border-radius: var(--radius);
}

.install-box h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: 0 0 16px 0;
  color: var(--text-muted);
  text-transform: uppercase;
}

.code-block {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-main);
  background: var(--bg-deep);
  border: 1px solid var(--line-faint);
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre;
  margin-bottom: 16px;
}

.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.copy-btn:hover {
  color: var(--text-main);
}

/* Footer / Docs */
.footer-nav {
  display: flex;
  gap: 32px;
  border-top: 1px solid var(--line-faint);
  padding-top: 32px;
  font-size: 0.9rem;
}

.footer-nav a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--text-main);
}

.text-highlight {
  color: var(--text-main);
}

@media (max-width: 768px) {
  .site-shell { padding: 0 20px 40px; }
  .hero { margin-bottom: 64px; }
  .footer-nav { flex-direction: column; gap: 16px; }
}

/* Lightbox styles */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
}

.card-image-wrapper img {
  cursor: zoom-in;
}
