/* ============================================================
   Home Studio AI — Design System
   Built with shadcn/ui tokens.
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ---------- shadcn/ui CSS Variables ---------- */
:root {
  --background: 0 0% 100%;
  --foreground: 0 0% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 3.9%;
  --primary: 0 0% 9%;
  --primary-foreground: 0 0% 98%;
  --secondary: 0 0% 96.1%;
  --secondary-foreground: 0 0% 9%;
  --muted: 0 0% 96.1%;
  --muted-foreground: 0 0% 45.1%;
  --accent: 0 0% 96.1%;
  --accent-foreground: 0 0% 9%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 0 0% 89.8%;
  --input: 0 0% 89.8%;
  --ring: 0 0% 3.9%;
  --radius: 0.5rem;

  /* Brand purple — used for CTA buttons only */
  --brand: 252 100% 65%;
  --brand-light: 252 100% 75%;
  --brand-foreground: 0 0% 100%;

  /* Dark surface tokens (hero, CTA, footer) */
  --dark: 0 0% 3.9%;
  --dark-card: 0 0% 7%;
  --dark-border: 0 0% 14.9%;
  --dark-foreground: 0 0% 98%;
  --dark-muted-foreground: 0 0% 63.9%;
}

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

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  line-height: 1.5;
  font-size: 0.875rem;
}

img {
  max-width: 100%;
  display: block;
}

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

ul {
  list-style: none;
}

/* ---------- Utility ---------- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  font-size: 1.875rem;
  font-weight: 700;
  text-align: center;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.section-subtitle {
  text-align: center;
  color: hsl(var(--muted-foreground));
  max-width: 540px;
  margin: 0 auto 2.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Buttons (shadcn/ui) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  /* h-10 */
  padding: 0 1.25rem;
  /* px-5 */
  border-radius: calc(var(--radius) - 2px);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.9;
}

/* Default = black bg (shadcn default variant) */
.btn-default {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* Primary = brand purple CTA */
.btn-primary {
  background: hsl(var(--brand));
  color: hsl(var(--brand-foreground));
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 4px 14px hsla(var(--brand) / 0.35);
}

/* Secondary = muted gray */
.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
  background: hsl(0 0% 91%);
}

/* Outline */
.btn-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--input));
}

.btn-outline:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: hsl(var(--muted-foreground));
}

.btn-ghost:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-icon {
  width: 16px;
  height: 16px;
}

/* ---------- HEADER ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Transparent state: white text for dark hero */
.site-header .header-brand {
  color: #fafafa;
  transition: color 0.3s ease;
}

.site-header .nav-links a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease;
}

.site-header .nav-links a:hover {
  color: #ffffff;
}

.site-header .hamburger span {
  background: #fafafa;
  transition: background 0.3s ease, transform 0.25s ease, opacity 0.25s ease;
}

/* Solid state: white bg after scrolling past hero */
.site-header.header-solid {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: hsl(0 0% 89.8%);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.site-header.header-solid .header-brand {
  color: hsl(0 0% 3.9%);
}

.site-header.header-solid .nav-links a {
  color: hsl(0 0% 45.1%);
}

.site-header.header-solid .nav-links a:hover {
  color: hsl(0 0% 3.9%);
}

.site-header.header-solid .hamburger span {
  background: hsl(0 0% 3.9%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.header-brand img {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  font-weight: 500;
  font-size: 0.875rem;
}

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 4rem;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    padding: 1rem 1.5rem;
    gap: 0.75rem;
    border-bottom: 1px solid hsl(0 0% 89.8%);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  }

  /* Force dark text in mobile menu */
  .nav-links a {
    color: hsl(0 0% 45.1%) !important;
  }

  .nav-links a:hover {
    color: hsl(0 0% 3.9%) !important;
  }

  .nav-links.open {
    display: flex;
  }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: hsl(var(--dark));
  overflow: hidden;
  padding: 6rem 1.5rem 4rem;
}

/* subtle grid */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* subtle brand glow */
.hero::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, hsla(var(--brand) / 0.1), transparent 70%);
  top: 10%;
  right: -5%;
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text {
  color: hsl(var(--dark-foreground));
}

.hero-text h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

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

.hero-text p {
  font-size: 1rem;
  color: hsl(var(--dark-muted-foreground));
  margin-bottom: 1.5rem;
  line-height: 1.6;
  max-width: 460px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Dark bg button overrides */
.hero-cta .btn-secondary {
  background: hsl(var(--dark-foreground));
  color: hsl(var(--dark));
}

.hero-cta .btn-secondary:hover {
  background: hsl(0 0% 85%);
}

.hero-cta .btn-outline {
  border-color: hsl(var(--dark-border));
  color: hsl(var(--dark-foreground));
}

.hero-cta .btn-outline:hover {
  background: hsl(var(--dark-card));
}

.hero-image {
  display: flex;
  justify-content: center;
}

.hero-image img,
.hero-image video {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--dark-border));
}

@media (max-width: 768px) {
  .hero {
    padding: 5.5rem 1.5rem 2.5rem;
    min-height: auto;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-image {
    order: -1;
  }

  .hero-image img,
  .hero-image video {
    max-width: 90%;
  }
}

/* ---------- FEATURES ---------- */
.features {
  padding: 4rem 1.5rem;
  background: hsl(var(--background));
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.feature-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.feature-card:hover {
  border-color: hsl(0 0% 82%);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--muted));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
}

.feature-card h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: hsl(var(--foreground));
  letter-spacing: -0.01em;
}

.feature-card p {
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  line-height: 1.6;
}

/* ---------- HOW IT WORKS ---------- */
.how-it-works {
  padding: 4rem 1.5rem;
  background: hsl(var(--muted));
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.step {
  text-align: center;
  padding: 1.5rem 1.25rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0 auto 0.75rem;
}

.step h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: hsl(var(--foreground));
}

.step p {
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  line-height: 1.6;
}

/* ---------- SHOWCASE ---------- */
.showcase {
  padding: 4rem 1.5rem;
  background: hsl(var(--background));
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.showcase-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  transition: border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  opacity: 0.55;
}

.showcase-card.showcase-active {
  opacity: 1;
  border-color: hsl(var(--brand));
  box-shadow: 0 0 0 1px hsl(var(--brand)), 0 4px 12px hsla(var(--brand) / 0.15);
}

.showcase-card:hover {
  opacity: 1;
}

.showcase-card img,
.showcase-card video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.showcase-card figcaption {
  padding: 0.75rem 1rem;
  background: hsl(var(--card));
  font-weight: 500;
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
  text-align: center;
}

/* ---------- CTA SECTION ---------- */
.cta-section {
  padding: 4rem 1.5rem;
  text-align: center;
  background: hsl(var(--dark));
  color: hsl(var(--dark-foreground));
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, hsla(var(--brand) / 0.08), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.cta-section h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
  position: relative;
}

.cta-section p {
  color: hsl(var(--dark-muted-foreground));
  max-width: 480px;
  margin: 0 auto 1.5rem;
  font-size: 1rem;
  position: relative;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
}

.cta-buttons .btn-secondary {
  background: hsl(var(--dark-foreground));
  color: hsl(var(--dark));
}

.cta-buttons .btn-secondary:hover {
  background: hsl(0 0% 85%);
}

.cta-buttons .btn-outline {
  border-color: hsl(var(--dark-border));
  color: hsl(var(--dark-foreground));
}

.cta-buttons .btn-outline:hover {
  background: hsl(var(--dark-card));
}

/* ---------- FOOTER ---------- */
.site-footer {
  padding: 2rem 1.5rem;
  background: hsl(var(--dark));
  color: hsl(var(--dark-foreground));
  border-top: 1px solid hsl(var(--dark-border));
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}

.footer-brand img {
  width: 28px;
  height: 28px;
  border-radius: calc(var(--radius) - 2px);
}

.footer-tagline {
  color: hsl(var(--dark-muted-foreground));
  font-size: 0.8125rem;
  max-width: 300px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.8125rem;
  color: hsl(var(--dark-muted-foreground));
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: hsl(var(--dark-foreground));
}

.footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--dark-border));
  text-align: center;
  font-size: 0.75rem;
  color: hsl(var(--dark-muted-foreground));
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: center;
  }
}

/* ---------- LEGAL PAGES ---------- */
.legal-page {
  padding: 6rem 1.5rem 3rem;
}

.legal-page h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.25rem;
  letter-spacing: -0.025em;
}

.legal-page .last-updated {
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
}

.legal-page h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.legal-page p,
.legal-page li {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.legal-page ul {
  padding-left: 1.5rem;
  list-style: disc;
}

.legal-page a {
  color: hsl(var(--brand));
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-page a:hover {
  color: hsl(var(--brand-light));
}