/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #0a0a0b;
  color: #e4e4e7;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.serif { font-family: 'Instrument Serif', 'Times New Roman', serif; font-weight: 400; }
.italic { font-style: italic; }
.muted { color: #71717a; }

/* ---------- Background ---------- */
.bg-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 80%);
  z-index: -2;
  pointer-events: none;
}
.bg-glow {
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  z-index: -1;
  pointer-events: none;
  animation: float 18s ease-in-out infinite;
}
.glow-1 { top: -200px; left: -150px; background: #334155; }
.glow-2 { top: 40%; right: -200px; background: #1e293b; animation-delay: -6s; }
.glow-3 { bottom: -250px; left: 30%; background: #1e293b; animation-delay: -12s; }

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

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 40px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10,10,11,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background .3s ease, border-color .3s ease;
}
.nav.scrolled {
  background: rgba(10,10,11,0.85);
  border-bottom-color: rgba(255,255,255,0.1);
}
.nav-logo {
  display: inline-flex;
  align-items: center;
}
.nav-logo img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}
.nav-links {
  display: flex; gap: 32px;
  list-style: none; margin: 0; padding: 0;
  font-size: 14px; color: #a1a1aa;
  justify-content: center;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}
.nav-links a { transition: color .2s ease; }
@media (hover: hover) {
  .nav-links a:hover { color: #fff; }
}
.nav-github {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  font-size: 13px;
  transition: all .2s ease;
}
@media (hover: hover) {
  .nav-github:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.25); }
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
}
.lang-btn {
  padding: 5px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #71717a;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
  line-height: 1;
}
.lang-btn.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
@media (hover: hover) {
  .lang-btn:hover:not(.active) { color: #fff; }
}

@media (max-width: 760px) {
  .nav { display: flex; padding: 14px 20px; justify-content: space-between; }
  .nav-links { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 120px 24px 80px;
  position: relative;
  text-align: center;
}
.hero-inner { max-width: 900px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  font-size: 12px; letter-spacing: 0.5px;
  color: #a1a1aa;
  margin-bottom: 28px;
  background: rgba(255,255,255,0.03);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74,222,128,0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.7); }
  70% { box-shadow: 0 0 0 10px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
.hero-title {
  font-size: clamp(44px, 7vw, 88px);
  line-height: 1.05;
  margin: 0 0 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}
.hero-sub {
  font-size: clamp(16px, 1.6vw, 20px);
  color: #a1a1aa;
  max-width: 640px;
  margin: 0 auto 40px;
}
.hero-sub em { font-style: italic; color: #fff; font-weight: 500; }
.hero-cta {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
}
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  transition: all .25s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: #fff; color: #0a0a0b;
}
@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255,255,255,0.15); }
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 4px 12px rgba(255,255,255,0.1); }
.btn-ghost {
  border-color: rgba(255,255,255,0.15);
  color: #fff;
}
@media (hover: hover) {
  .btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.3); }
}
.btn-ghost:active { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.4); }

.scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: #52525b;
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(180deg, transparent, #52525b, transparent);
  animation: scrollAnim 2.4s ease-in-out infinite;
}
@keyframes scrollAnim {
  0% { transform: translateY(-10px); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(10px); opacity: 0; }
}

/* ---------- Sections ---------- */
.section {
  padding: 80px 40px;
  position: relative;
}
.section-alt {
  background:
    linear-gradient(180deg, transparent, rgba(255,255,255,0.015) 50%, transparent);
}
.section-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.section-inner.reverse .content { order: 2; }
.section-inner.reverse .media { order: 1; }

.tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 1px;
  margin-bottom: 14px;
  padding: 3px 9px;
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 6px;
  background: rgba(148,163,184,0.05);
}
.content h2 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  font-weight: 600;
  background: linear-gradient(180deg, #fafafa, #a1a1aa);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.content p {
  color: #a1a1aa;
  font-size: 15.5px;
  max-width: 520px;
  margin: 0 0 12px;
}
.content p strong { color: #fff; font-weight: 600; }
.inline-link {
  color: #e4e4e7;
  border-bottom: 1px solid rgba(228,228,231,0.3);
  transition: color .2s ease, border-color .2s ease;
}
@media (hover: hover) {
  .inline-link:hover { color: #fff; border-bottom-color: #fff; }
}
.inline-link:active { color: #fff; border-bottom-color: #fff; }

.bullets {
  list-style: none; padding: 0; margin: 14px 0 0;
}
.bullets li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 6px;
  color: #d4d4d8;
  font-size: 14.5px;
  line-height: 1.5;
}
.bullets li::before {
  content: '';
  position: absolute; left: 0; top: 11px;
  width: 12px; height: 1px;
  background: #71717a;
}

.chips {
  list-style: none; padding: 0; margin: 14px 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.chips li {
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255,255,255,0.03);
  color: #d4d4d8;
  transition: all .2s ease;
}
/* ---------- Media frame ---------- */
.media-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(ellipse at top left, rgba(148,163,184,0.08), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(100,116,139,0.06), transparent 60%),
    #111113;
  box-shadow:
    0 30px 80px -20px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.04) inset;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .5s ease;
}
.media-frame img {
  width: 100%; height: 100%; object-fit: cover;
}
.placeholder-text {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 24px;
  color: #52525b;
}
.media-frame.placeholder .placeholder-text { display: flex; }
.media-frame.placeholder::after {
  content: '';
  position: absolute; inset: 20px;
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 12px;
  pointer-events: none;
}

/* ---------- Footer ---------- */
.footer {
  padding: 80px 40px 40px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.01);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 40px;
  padding-bottom: 40px;
}
.footer-logo { font-size: 32px; margin-bottom: 8px; }
.footer-links { display: flex; gap: 24px; font-size: 14px; }
@media (hover: hover) {
  .footer-links a:hover { color: #e4e4e7; }
}
.footer-links a:active { color: #e4e4e7; }
.footer-bottom {
  max-width: 1200px; margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 13px;
}

/* ---------- Reveal animations ---------- */
:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hero reveal */
.hero-inner.reveal > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease-out-expo), transform .9s var(--ease-out-expo);
}
.hero-inner.reveal.in > * { opacity: 1; transform: translateY(0); }
.hero-inner.reveal.in > *:nth-child(1) { transition-delay: .05s; }
.hero-inner.reveal.in > *:nth-child(2) { transition-delay: .15s; }
.hero-inner.reveal.in > *:nth-child(3) { transition-delay: .28s; }
.hero-inner.reveal.in > *:nth-child(4) { transition-delay: .42s; }

/* Section content: slide from the opposite side of the media */
.section-inner .content.reveal {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 1s var(--ease-out-expo), transform 1s var(--ease-out-expo);
}
.section-inner.reverse .content.reveal {
  transform: translateX(40px);
}
.section-inner .content.reveal.in {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger children of content */
.section-inner .content.reveal > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s var(--ease-out-expo), transform .8s var(--ease-out-expo);
}
.section-inner .content.reveal.in > * { opacity: 1; transform: translateY(0); }
.section-inner .content.reveal.in > *:nth-child(1) { transition-delay: .15s; }
.section-inner .content.reveal.in > *:nth-child(2) { transition-delay: .25s; }
.section-inner .content.reveal.in > *:nth-child(3) { transition-delay: .35s; }
.section-inner .content.reveal.in > *:nth-child(4) { transition-delay: .45s; }
.section-inner .content.reveal.in > *:nth-child(5) { transition-delay: .55s; }

/* Bullet list stagger */
.bullets li, .chips li {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .6s var(--ease-out-expo), transform .6s var(--ease-out-expo), border-color .2s ease, color .2s ease;
}
.content.reveal.in .bullets li,
.content.reveal.in .chips li {
  opacity: 1;
  transform: translateY(0);
}
.content.reveal.in .bullets li:nth-child(1),
.content.reveal.in .chips li:nth-child(1)   { transition-delay: .55s; }
.content.reveal.in .bullets li:nth-child(2),
.content.reveal.in .chips li:nth-child(2)   { transition-delay: .65s; }
.content.reveal.in .bullets li:nth-child(3),
.content.reveal.in .chips li:nth-child(3)   { transition-delay: .75s; }
.content.reveal.in .bullets li:nth-child(4),
.content.reveal.in .chips li:nth-child(4)   { transition-delay: .85s; }

/* Media: scale + clip reveal */
.media.reveal .media-frame {
  opacity: 0;
  transform: scale(0.94) translateY(30px);
  clip-path: inset(8% 8% 8% 8% round 20px);
  transition:
    opacity 1.1s var(--ease-out-expo),
    transform 1.1s var(--ease-out-expo),
    clip-path 1.2s var(--ease-out-expo);
}
.media.reveal.in .media-frame {
  opacity: 1;
  transform: scale(1) translateY(0);
  clip-path: inset(0% 0% 0% 0% round 20px);
}

/* Subtle shimmer sweep across media on reveal */
.media-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
  transform: translateX(-100%);
  pointer-events: none;
  z-index: 2;
}
.media.reveal.in .media-frame::before {
  animation: shimmer 1.4s var(--ease-out-expo) .4s forwards;
}
@keyframes shimmer {
  to { transform: translateX(100%); }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal *, .media-frame, .media-frame::before {
    transition: opacity .3s ease !important;
    transform: none !important;
    clip-path: none !important;
    animation: none !important;
  }
}

/* ---------- Touch-friendly hover ---------- */
@media (hover: hover) {
  .chips li:hover {
    border-color: rgba(148,163,184,0.5);
    color: #fff;
    transform: translateY(-2px);
  }
  .media-frame:hover {
    transform: translateY(-6px);
    box-shadow:
      0 40px 100px -20px rgba(0,0,0,0.5),
      0 0 0 1px rgba(255,255,255,0.08) inset;
  }
}
@media (hover: none) {
  .chips li:active { border-color: rgba(148,163,184,0.5); color: #fff; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .section { padding: 64px 28px; }
  .section-inner { grid-template-columns: 1fr; gap: 36px; }
  .section-inner .content,
  .section-inner.reverse .content { order: 1; }
  .section-inner .media,
  .section-inner.reverse .media { order: 2; }
  .content p { max-width: none; }
  .media-frame { aspect-ratio: 16 / 10; border-radius: 16px; }
}

@media (max-width: 640px) {
  /* Nav */
  .nav { padding: 12px 16px; }
  .nav-logo img { width: 26px; height: 26px; }
  .nav-github { padding: 6px 12px; font-size: 12px; gap: 6px; }
  .nav-github svg { width: 16px; height: 16px; }
  .lang-switch { padding: 2px; }
  .lang-btn { padding: 4px 10px; font-size: 11px; }

  /* Hero */
  .hero { padding: 100px 20px 64px; min-height: auto; }
  .hero-title { font-size: clamp(32px, 9vw, 44px); margin-bottom: 16px; }
  .hero-sub { font-size: 15px; max-width: none; margin-bottom: 28px; }
  .eyebrow { margin-bottom: 20px; font-size: 11px; }
  .btn { padding: 11px 20px; font-size: 13px; }
  .scroll-hint { display: none; }

  /* Sections */
  .section { padding: 52px 20px; }
  .section-inner { gap: 28px; }
  .content h2 { font-size: clamp(22px, 5.5vw, 28px); }
  .content p { font-size: 14.5px; line-height: 1.6; }
  .tag { font-size: 10px; margin-bottom: 10px; }

  /* Bullets & Chips */
  .bullets li { font-size: 13.5px; padding-left: 20px; }
  .bullets li::before { width: 10px; top: 10px; }
  .chips { gap: 5px; margin: 10px 0; }
  .chips li { padding: 5px 11px; font-size: 12px; }

  /* Media */
  .media-frame { aspect-ratio: 16 / 10; border-radius: 14px; }
  .media-frame.placeholder::after { inset: 14px; border-radius: 8px; }

  /* Footer */
  .footer { padding: 56px 20px 28px; }
  .footer-inner { flex-direction: column; align-items: center; text-align: center; gap: 24px; padding-bottom: 28px; }
  .footer-logo { font-size: 26px; }
  .footer-bottom { text-align: center; }
}

@media (max-width: 480px) {
  .hero { padding: 92px 16px 52px; }
  .hero-title { font-size: clamp(28px, 10vw, 36px); letter-spacing: -0.01em; }
  .hero-sub { font-size: 14px; }
  .hero-cta { gap: 10px; }
  .btn { padding: 10px 18px; font-size: 12.5px; gap: 8px; }

  .section { padding: 44px 16px; }
  .section-inner { gap: 24px; }
  .content h2 { font-size: clamp(20px, 6vw, 24px); }
  .content p { font-size: 14px; }

  .media-frame { aspect-ratio: 16 / 10; border-radius: 12px; }

  /* Simpler reveal animations */
  .section-inner .content.reveal { transform: translateY(24px); }
  .section-inner.reverse .content.reveal { transform: translateY(24px); }
  .section-inner .content.reveal.in { transform: translateY(0); }
}
