/* ============================================
   Home — Ziling Project Landing
   Dark glass morphism, ambient orbs, clean
   ============================================ */

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

:root {
  --font-heading: "Instrument Serif", serif;
  --font-body: "Barlow", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html,
body {
  background: #050507;
  color: #fff;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
}

.hidden-sm {
  display: none;
}
@media (min-width: 640px) {
  .hidden-sm {
    display: inline;
  }
}

/* ═══════════════════════════════════════════
   LIQUID GLASS (shared)
   ═══════════════════════════════════════════ */
.liquid-glass {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  background-blend-mode: luminosity;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
}
.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 255, 255, 0.1) 25%,
    rgba(255, 255, 255, 0) 50%,
    rgba(255, 255, 255, 0.1) 75%,
    rgba(255, 255, 255, 0.35) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.liquid-glass-strong {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  background-blend-mode: luminosity;
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12);
}
.liquid-glass-strong::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.4px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.2) 25%,
    rgba(255, 255, 255, 0) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    rgba(255, 255, 255, 0.5) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   PAGE LAYOUT
   ═══════════════════════════════════════════ */
.home {
  position: relative;
  min-height: 100vh;
}

/* Ambient orbs — CSS-only glass blobs */
.home-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}
.home-orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -200px;
  left: -100px;
  animation: orb-drift-1 20s ease-in-out infinite alternate;
}
.home-orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
  top: 50%;
  right: -150px;
  animation: orb-drift-2 25s ease-in-out infinite alternate;
}
.home-orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
  bottom: -100px;
  left: 30%;
  animation: orb-drift-3 22s ease-in-out infinite alternate;
}

@keyframes orb-drift-1 {
  to {
    transform: translate(80px, 60px);
  }
}
@keyframes orb-drift-2 {
  to {
    transform: translate(-60px, 80px);
  }
}
@keyframes orb-drift-3 {
  to {
    transform: translate(50px, -40px);
  }
}

/* Subtle grid lines */
.home-grid-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(
    ellipse 80% 60% at 50% 30%,
    black 20%,
    transparent 70%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 80% 60% at 50% 30%,
    black 20%,
    transparent 70%
  );
}

/* ═══════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 1100px;
}
@media (min-width: 1024px) {
  .nav {
    width: calc(100% - 64px);
  }
}

.nav-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-logo span {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.35rem;
  color: #fff;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 4px;
  border-radius: 99px;
  padding: 6px 24px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  font-weight: 500;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 14px;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-links a:hover {
  color: #fff;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: #000;
  border-radius: 99px;
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 8px 18px;
  white-space: nowrap;
  transition:
    opacity 0.2s,
    transform 0.2s;
  margin-left: auto;
}
.nav-cta:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.nav-burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-left: 4px;
}
.nav-burger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: #fff;
  border-radius: 2px;
}
@media (min-width: 768px) {
  .nav-burger {
    display: none;
  }
}

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */
.hero {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 140px 24px 64px;
  text-align: center;
}
@media (min-width: 768px) {
  .hero {
    padding: 180px 32px 96px;
  }
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 99px;
  padding: 8px 20px;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
}
.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
  }
}

.hero-title {
  font-family: var(--font-heading);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(2.75rem, 8vw, 6rem);
  line-height: 0.88;
  letter-spacing: -3px;
  color: #fff;
  max-width: 800px;
  margin-top: 28px;
}
.hero-title em {
  font-style: italic;
}
.hero-title .blur-word {
  display: inline-block;
  margin-right: 0.28em;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(50px);
  transition:
    filter 0.7s var(--ease),
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}
.hero-title .blur-word.revealed {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.hero-sub {
  font-weight: 300;
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  color: rgba(255, 255, 255, 0.6);
  max-width: 520px;
  margin-top: 24px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 99px;
  padding: 12px 24px;
  font-weight: 500;
  font-size: 0.9375rem;
  color: #fff;
  transition: transform 0.2s;
}
.btn-primary:hover {
  transform: scale(1.03);
}

.btn-liquid {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 99px;
  padding: 12px 24px;
  font-weight: 500;
  font-size: 0.9375rem;
  color: #fff;
  transition: transform 0.2s;
}
.btn-liquid:hover {
  transform: scale(1.03);
}

/* ── Hero Showcase Preview Card ── */
.hero-showcase {
  margin-top: 64px;
  opacity: 0;
}
@media (min-width: 768px) {
  .hero-showcase {
    margin-top: 96px;
  }
}

.showcase-glass {
  width: 800px;
  max-width: 560px;
  border-radius: 1.25rem;
  padding: 20px;
}
.showcase-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.showcase-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.showcase-bar span:nth-child(1) {
  background: rgba(255, 80, 80, 0.5);
}
.showcase-bar span:nth-child(2) {
  background: rgba(255, 200, 50, 0.5);
}
.showcase-bar span:nth-child(3) {
  background: rgba(80, 200, 120, 0.5);
}

.showcase-line {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.showcase-card {
  height: 60px;
  border-radius: 0.625rem;
}

/* ═══════════════════════════════════════════
   SECTION: BACKEND
   ═══════════════════════════════════════════ */
.backend {
  position: relative;
  z-index: 10;
  padding: 64px 24px;
}
@media (min-width: 768px) {
  .backend {
    padding: 96px 32px;
  }
}

.section-wrap {
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  display: block;
}
.section-title {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 0.9;
  letter-spacing: -2px;
  color: #fff;
}
.section-sub {
  font-weight: 300;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.5);
  max-width: 480px;
  margin-top: 16px;
  line-height: 1.5;
}

.backend-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .backend-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .backend-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .backend-main {
    grid-row: span 2;
  }
}

.backend-main {
  border-radius: 1.25rem;
  padding: 32px;
  display: flex;
  flex-direction: column;
}
.backend-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 20px;
}

.backend-title {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -1px;
  line-height: 1;
  color: #fff;
}
.backend-desc {
  font-weight: 300;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
  margin-top: 12px;
  flex: 1;
}
.backend-link {
  display: inline-block;
  font-weight: 500;
  font-size: 0.875rem;
  color: #fff;
  margin-top: 24px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.backend-link:hover {
  opacity: 1;
}

/* Smaller cards */
.backend-card {
  border-radius: 1.25rem;
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.backend-card svg {
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
}
.backend-card-title {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 1;
  color: #fff;
}
.backend-card-desc {
  font-weight: 300;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
  margin-top: 8px;
}

/* ─── Mobile nav open state ─── */
.nav-open .nav-links {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.nav-open .nav-links a {
  font-size: 1.5rem;
}
.nav-open .nav-burger {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 101;
}
.nav-open .nav-burger span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-open .nav-burger span:nth-child(2) {
  opacity: 0;
}
.nav-open .nav-burger span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ═══════════════════════════════════════════
   SECTION: TEMPLATE SHOWCASE
   ═══════════════════════════════════════════ */
.showcase {
  position: relative;
  z-index: 10;
  padding: 64px 24px 96px;
}
@media (min-width: 768px) {
  .showcase {
    padding: 96px 32px 128px;
  }
}

.showcase-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .showcase-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .showcase-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

.showcase-item {
  border-radius: 1.25rem;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease);
}
.showcase-item:hover {
  transform: translateY(-3px);
}

.showcase-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 18px;
}
.preview-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.5;
}
.preview-orb-1 {
  width: 60%;
  height: 60%;
  top: -10%;
  left: -10%;
}
.preview-orb-2 {
  width: 50%;
  height: 50%;
  bottom: -10%;
  right: -10%;
}
.preview-label {
  position: absolute;
  bottom: 10px;
  left: 12px;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  z-index: 2;
}

/* Preview variants */
.studio-preview {
  background: #080808;
}
.studio-preview .preview-orb-1 {
  background: #6366f1;
}
.studio-preview .preview-orb-2 {
  background: #a855f7;
}

.terra-preview {
  background: #0a0a08;
}
.terra-preview .preview-orb-1 {
  background: #059669;
}
.terra-preview .preview-orb-2 {
  background: #10b981;
}

.demo-preview {
  background: #08080a;
}
.demo-preview .preview-orb-1 {
  background: #6366f1;
}
.demo-preview .preview-orb-2 {
  background: #f59e0b;
}

.universe-preview {
  background: #06060a;
}
.universe-preview .preview-orb-1 {
  background: #0ea5e9;
}
.universe-preview .preview-orb-2 {
  background: #6366f1;
}

.showcase-name {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.5px;
  color: #fff;
}
.showcase-desc {
  font-weight: 300;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.4;
  margin-top: 6px;
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.footer {
  position: relative;
  z-index: 10;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 32px 24px;
}
@media (min-width: 768px) {
  .footer {
    padding: 40px 32px;
  }
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  font-size: 0.8125rem;
}
.footer-brand {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.25rem;
  color: #fff;
}
.footer-links {
  display: flex;
  gap: 20px;
  margin-left: auto;
}
.footer-links a {
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s;
}
.footer-links a:hover {
  color: #fff;
}
.footer-copy {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 300;
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
.anim-fade-up {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(30px);
  transition:
    filter 0.8s var(--ease),
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}
.anim-fade-up.revealed {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.anim-scale-in {
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 1s var(--ease),
    transform 1s var(--ease);
}
.anim-scale-in.revealed {
  opacity: 1;
  transform: scale(1);
}

.anim-card {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(20px);
  transition:
    filter 0.8s var(--ease),
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}
.anim-card.revealed {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* BlurText delay variant */
.blur-text-delay .blur-word {
  transition-delay: calc(var(--word-idx, 0) * 0.12s + 0.3s);
}
