
:root {
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Light theme */
  --bg-deep: #fbfbfc;
  --bg-surface: #ffffff;
  --bg-elevated: #f4f5f8;
  --bg-hover: #eef0f6;

  --text-primary: #0e0f12;
  --text-secondary: #4a5160;
  --text-muted: #6a7180;

  --border: rgba(14,15,18,0.10);
  --border-hover: rgba(14,15,18,0.18);

  --accent: #2d5bff;
  --accent-glow: rgba(45,91,255,0.14);
  --accent-bright: #1f4cff;

  --gold: #b7791f;
  --gold-muted: rgba(183,121,31,0.10);

  --success: #16a34a;
  --live-pulse: #16a34a;

  --container: 1080px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(14,15,18,0.08);
  --shadow-md: 0 14px 46px rgba(14,15,18,0.14);
  --shadow-glow: 0 0 60px var(--accent-glow);

  --topbar-bg: rgba(251,251,252,0.35);
  --topbar-bg-scrolled: rgba(251,251,252,0.85);
  --grain-opacity: 0.02;
}

[data-theme="dark"] {
  --bg-deep: #08090c;
  --bg-surface: #0f1114;
  --bg-elevated: #16181d;
  --bg-hover: #1c1f26;

  --text-primary: #f4f4f5;
  --text-secondary: #8b8d98;
  --text-muted: #5c5e69;

  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);

  --accent: #3b82f6;
  --accent-glow: rgba(59,130,246,0.15);
  --accent-bright: #60a5fa;

  --gold: #f59e0b;
  --gold-muted: rgba(245,158,11,0.10);

  --success: #22c55e;
  --live-pulse: #22c55e;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.30);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.40);

  --topbar-bg: rgba(8,9,12,0.35);
  --topbar-bg-scrolled: rgba(8,9,12,0.85);
  --grain-opacity: 0.03;
}


/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-deep);
  line-height: 1.5;
  font-size: 16px;
}

/* Subtle grain texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: var(--grain-opacity);
  pointer-events: none;
  z-index: 9999;
}

a { 
  color: inherit; 
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--accent-bright); }

h1, h2, h3, h4 { 
  margin: 0; 
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 { 
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

h2 { 
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 { 
  font-size: 1.125rem;
  font-weight: 600;
}

p { margin: 0; }

/* Container */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   NAVIGATION
   ============================================ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  background: var(--topbar-bg);
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.topbar.scrolled {
  background: var(--topbar-bg-scrolled);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  color: white;
  box-shadow: var(--shadow-glow);
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navlinks a {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.navlinks a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.navlinks a[aria-current="page"] {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-toggle {
  display: none;
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
}

.theme-toggle{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.theme-toggle:hover{
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.theme-toggle svg{
  width: 16px;
  height: 16px;
  opacity: 0.85;
}


/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn.primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
}

.btn.ghost:hover {
  background: var(--bg-hover);
}

.btn-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}

/* Gradient orb background */
.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  animation: float 20s ease-in-out infinite;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245,158,11,0.05) 0%, transparent 70%);
  pointer-events: none;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.05); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease both;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--success);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero h1 {
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 540px;
  margin-bottom: 32px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  animation: fadeInUp 0.6s ease 0.4s both;
}

.proof-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.proof-value {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.proof-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  padding: 80px 0;
  position: relative;
}

.section-header {
  margin-bottom: 48px;
}

.section-header h2 {
  margin-bottom: 12px;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  max-width: 560px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card.featured {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border-color: var(--border-hover);
}

.card-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-label.live {
  color: var(--success);
}

.card-label.live::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.card h3 {
  margin-bottom: 8px;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--accent-bright);
  transition: gap 0.2s ease;
}

.card-link:hover {
  gap: 10px;
}

.card-link::after {
  content: '→';
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

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

/* ============================================
   PROJECTS SECTION
   ============================================ */
.project-card {
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--gold) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover::before {
  opacity: 1;
}

/* ============================================
   EXPERIMENTS (Build page)
   ============================================ */
.experiment {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.experiment:last-child {
  border-bottom: none;
}

.experiment-info h3 {
  margin-bottom: 4px;
}

.experiment-desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.experiment-status {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.experiment-status.shipped {
  background: rgba(34,197,94,0.1);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.2);
}

.experiment-status.sunset {
  background: var(--gold-muted);
  color: var(--gold);
  border: 1px solid rgba(245,158,11,0.2);
}

/* ============================================
   RESOURCES PAGE
   ============================================ */
.resource-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.resource-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.resource-info {
  flex: 1;
}

.resource-info h3 {
  margin-bottom: 4px;
}

.resource-info p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ============================================
   CONNECT PAGE
   ============================================ */
.link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.link-card:hover {
  background: var(--bg-elevated);
}

.link-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.link-card:hover .link-icon {
  background: var(--accent);
  color: white;
}

.link-info {
  flex: 1;
}

.link-info h3 {
  margin-bottom: 2px;
}

.link-info p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.link-arrow {
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.link-card:hover .link-arrow {
  color: var(--accent-bright);
  transform: translateX(4px);
}

/* Verification block */
.verification {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.verification-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

.verification h3 {
  color: var(--gold);
  margin-bottom: 4px;
}

.verification p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ============================================
   NEWSLETTER PAGE
   ============================================ */
.newsletter-hero {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 120px 24px 60px;
}

.newsletter-hero h1 {
  margin-bottom: 16px;
}

.newsletter-hero .hero-sub {
  margin: 0 auto 32px;
}

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

.benefit {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: left;
}

.benefit-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-bright);
  flex-shrink: 0;
}

.benefit h4 {
  font-weight: 600;
  margin-bottom: 4px;
}

.benefit p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.language-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 24px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-brand {
  max-width: 280px;
}

.footer-brand .brand {
  margin-bottom: 12px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 48px;
}

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.footer-col a {
  display: block;
  padding: 6px 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* ============================================
   CTA BLOCK
   ============================================ */
.cta-block {
  text-align: center;
  padding: 64px 32px;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.cta-block::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.cta-block h2 {
  margin-bottom: 12px;
  position: relative;
}

.cta-block p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  position: relative;
}

.cta-block .btn {
  position: relative;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-links { gap: 32px; }
}

@media (max-width: 768px) {
  .navlinks { display: none; }
  .mobile-toggle { display: flex; }
  
  .navlinks.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
  }
  
  .nav { position: relative; }
  
  .hero { padding: 100px 0 60px; min-height: auto; }
  .hero-proof { gap: 24px; }
  
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  
  .section { padding: 60px 0; }
  
  .footer-content { flex-direction: column; }
  .footer-links { flex-direction: column; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .hero-proof { flex-direction: column; gap: 16px; }
  .nav-cta .btn.ghost { display: none; }
  .theme-toggle span { display: none; }
  .theme-toggle { padding: 10px; }
}
/* Home hero extras */
.microcopy{
  margin-top: 8px;
  margin-bottom: 28px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.credibility{
  margin-top: 8px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  max-width: 640px;
}
.social-proof{
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Brand logo inside the existing brand mark */
.brand-mark {
  overflow: hidden;
}
.brand-mark-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Credibility bubble should hug the text */
.credibility {
  display: inline-block;
  width: fit-content;
  max-width: 760px;
}

/* Project card thumbnail 1:1 */
.project-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  margin: 10px 0 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
}

.project-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.01);
}

.project-card:hover .project-thumb img {
  transform: scale(1.04);
}
