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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }

@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px) rotate(3deg); }
}
@keyframes float-medium {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px) rotate(-2deg); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--hero-bg);
  color: white;
  overflow: hidden;
  padding: 2rem;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.hero-glow--top { top: -20%; left: -10%; width: 60vw; height: 60vw; max-width: 700px; max-height: 700px; animation: breathe 8s ease-in-out infinite; }
.hero-glow--bottom { bottom: -15%; right: -10%; width: 50vw; height: 50vw; max-width: 600px; max-height: 600px; animation: breathe 10s ease-in-out infinite 2s; }

.hero-float {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}
.hero-float--1 { top: 12%; right: 10%; width: 120px; height: 120px; animation: float-slow 8s ease-in-out infinite; }
.hero-float--2 { bottom: 18%; left: 8%; width: 80px; height: 80px; animation: float-medium 6s ease-in-out infinite 1s; }
.hero-float--3 { top: 55%; right: 25%; width: 50px; height: 50px; animation: float-slow 10s ease-in-out infinite 3s; border-color: rgba(255, 255, 255, 0.08); }

.hero-content { position: relative; z-index: 10; text-align: center; max-width: 48rem; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; }

.hero h1 {
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 1.25rem;
}
.hero h1 .light { font-weight: 300; }
.hero h1 .dot-accent { color: var(--color-accent-light); }

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.375rem);
  color: rgba(255, 255, 255, 0.75);
  max-width: 32rem;
  margin: 0 auto;
  line-height: 1.5;
}

.hero-actions { display: flex; gap: 0.75rem; justify-content: center; margin-top: 2.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.35); color: white; transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: white; color: var(--color-accent); border-color: white; }
.btn-primary:hover { background: #f2f2f7; border-color: #f2f2f7; color: var(--color-accent-hover); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); }

/* Nav (overlay on hero) */
.nav-hero {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
}
.wordmark { font-size: 1.25rem; color: white; text-decoration: none; letter-spacing: -0.02em; }
.wordmark strong { font-weight: 800; }
.tld { color: rgba(255, 255, 255, 0.5); }

.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { font-size: var(--text-sm); color: rgba(255, 255, 255, 0.7); transition: color 0.2s; }
.nav-links a:hover { color: white; text-decoration: none; }

#theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}
#theme-toggle:hover { background: rgba(255, 255, 255, 0.15); color: white; }
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* Content area below hero */
.content-wrapper {
  position: relative;
  background: var(--color-bg);
  transition: background-color 0.3s ease;
}
.content-wrapper::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 300px;
  background: linear-gradient(to bottom, var(--color-accent-subtle), transparent);
  pointer-events: none;
}
.content { position: relative; z-index: 10; max-width: var(--content-lg); margin: 0 auto; padding: 0 2rem; }

/* Sections */
section { position: relative; padding: 4rem 0 2rem; }
.section-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2rem; }
.section-header h2 { font-size: 1.25rem; font-weight: 700; color: var(--color-heading); letter-spacing: -0.02em; }
.section-count { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted); padding: 0.2rem 0.6rem; background: var(--color-accent-subtle); border-radius: var(--radius-full); }

/* Glass cards */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.card-grid .card-featured { grid-column: 1 / -1; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 2rem;
  background: var(--color-surface);
  backdrop-filter: var(--card-blur);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--card-shadow);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-accent-glow), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--color-accent-glow);
  text-decoration: none;
  color: var(--color-text);
}
.card:hover::before { opacity: 1; }

.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-name { font-family: var(--font-mono); font-size: var(--text-base); font-weight: 700; color: var(--color-heading); }
.card-badge {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border: 1px solid var(--color-accent-glow);
}
.card-desc { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.55; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 0.75rem; }
.card-tech { display: flex; gap: 0.4rem; }
.card-tech span { font-family: var(--font-mono); font-size: 0.625rem; padding: 0.15rem 0.5rem; border-radius: 4px; background: var(--color-border-subtle); color: var(--color-muted); }
.card-arrow { font-size: 1.125rem; color: var(--color-accent); opacity: 0; transform: translateX(-6px); transition: all 0.3s ease; }
.card:hover .card-arrow { opacity: 1; transform: translateX(0); }

/* Notes */
.note-list { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; }
.note-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  transition: all 0.25s ease;
  text-decoration: none;
  color: var(--color-text);
}
.note-item:hover { background: var(--color-surface); box-shadow: var(--card-shadow); text-decoration: none; color: var(--color-text); }
.note-date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
  white-space: nowrap;
  min-width: 5.5rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--color-accent-subtle);
  text-align: center;
  transition: all 0.25s ease;
}
.note-item:hover .note-date { background: var(--color-accent); color: white; }
.note-title { font-size: var(--text-sm); font-weight: 500; color: var(--color-heading); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  backdrop-filter: var(--card-blur);
  border: 1px solid var(--color-border);
  box-shadow: var(--card-shadow);
}
.empty-icon {
  display: block;
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--color-accent);
  margin-bottom: 1.25rem;
  opacity: 0.7;
}
.empty-state h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 0.75rem;
}
.empty-state p {
  font-size: var(--text-sm);
  color: var(--color-muted);
  max-width: 28rem;
  margin: 0 auto;
  line-height: 1.65;
}
.empty-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-accent-glow);
  transition: all 0.25s ease;
}
.empty-link:hover {
  background: var(--color-accent-subtle);
  color: var(--color-accent-hover);
  transform: translateY(-1px);
}

/* Sibling banner */
.sibling-banner {
  margin-top: 3rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-accent-subtle), transparent);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.sibling-text { font-size: var(--text-sm); color: var(--color-text); }
.sibling-text strong { color: var(--color-heading); }
.sibling-link {
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: white;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.sibling-link:hover { background: var(--color-accent-hover); color: white; text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 12px var(--color-accent-glow); }

/* Footer */
footer { margin-top: 4rem; padding: 2.5rem 0; border-top: 1px solid var(--color-border-subtle); text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; font-size: var(--text-sm); margin-bottom: 1rem; }
.footer-links a { color: var(--color-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--color-accent); }
.footer-copy { font-size: var(--text-xs); color: var(--color-muted); }

/* Responsive */
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
  .card-grid .card-featured { grid-column: auto; }
  .nav-links a:not(:last-child) { display: none; }
  .nav-hero { padding: 1rem 1.25rem; }
  .hero { padding: 1.5rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .sibling-banner { flex-direction: column; text-align: center; }
  .note-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .note-date { min-width: auto; }
}
