/* ==========================================================================
   RTST.ai - Home ("Creative Studio") dark theme
   Self-contained, hand-written stylesheet. No build step / no Tailwind.
   ========================================================================== */

/* ----- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
ul { list-style: none; }

/* ----- Design tokens ----------------------------------------------------- */
:root {
  --bg:            #0a0a0f;
  --bg-2:          #0d0d16;
  --surface:       rgba(255, 255, 255, .035);
  --surface-2:     rgba(255, 255, 255, .06);
  --border:        rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);

  --text:    #f4f4f8;
  --muted:   #a4a4ba;
  --muted-2: #74748c;

  --purple: #a855f7;
  --pink:   #ec4899;
  --violet: #7c5cff;
  --indigo: #6366f1;

  --grad:      linear-gradient(100deg, #a855f7 0%, #d946ef 50%, #ec4899 100%);
  --grad-soft: linear-gradient(135deg, rgba(168,87,247,.18), rgba(236,72,153,.10));

  --radius:    18px;
  --radius-sm: 12px;
  --radius-lg: 28px;

  --shadow:      0 24px 60px -20px rgba(0, 0, 0, .65);
  --glow:        0 10px 40px -8px rgba(168, 87, 247, .55);
  --glow-pink:   0 10px 40px -8px rgba(236, 72, 153, .45);

  --maxw: 1200px;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ----- Base -------------------------------------------------------------- */
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient background glows */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-fx::before,
.bg-fx::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .5;
}
.bg-fx::before {
  width: 620px; height: 620px;
  top: -180px; left: -120px;
  background: radial-gradient(circle, rgba(168,87,247,.55), transparent 70%);
}
.bg-fx::after {
  width: 680px; height: 680px;
  top: 320px; right: -200px;
  background: radial-gradient(circle, rgba(236,72,153,.40), transparent 70%);
}
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, #000 40%, transparent 100%);
}

/* ----- Layout helpers ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
  position: relative;
  z-index: 1;
}
.section { padding-block: clamp(64px, 9vw, 120px); position: relative; z-index: 1; }
.text-grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(236,72,153,.9);
}
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.08;
  margin-top: 18px;
}
.section-head p { color: var(--muted); font-size: 1.05rem; margin-top: 14px; }

/* ----- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 600;
  font-size: .95rem;
  padding: 13px 24px;
  border-radius: 999px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 50px -8px rgba(217,70,239,.7); }
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }
.btn-sm { padding: 10px 18px; font-size: .88rem; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(10, 10, 15, .72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}
.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 70px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand img { width: 30px; height: 30px; filter: drop-shadow(0 0 10px rgba(168,87,247,.6)); }
.brand .dotai { color: var(--purple); }
.nav-links { display: flex; align-items: center; gap: 6px; margin-inline: auto; }
.nav-links a {
  font-size: .92rem;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 10px;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-login { font-size: .92rem; color: var(--muted); padding: 8px 12px; transition: color .2s; }
.nav-login:hover { color: var(--text); }
.nav-toggle { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); align-items: center; justify-content: center; }
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
body.nav-open .nav-toggle .icon-open { display: none; }
body.nav-open .nav-toggle .icon-close { display: block; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(40px, 6vw, 80px); overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  opacity: .12;
  background: center/cover no-repeat;
  mask-image: linear-gradient(#000, transparent 78%);
  -webkit-mask-image: linear-gradient(#000, transparent 78%);
}
.hero-inner { position: relative; z-index: 1; text-align: center; max-width: 880px; margin-inline: auto; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  margin: 26px 0 0;
}
.hero p.lede {
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  max-width: 620px;
  margin: 22px auto 0;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.hero-trust {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 22px; font-size: .9rem; color: var(--muted-2);
}
.hero-trust .pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted);
}
.hero-trust .pill b { color: var(--text); font-weight: 600; }

/* Floating thumbnail collage */
.hero-collage {
  position: relative; z-index: 1;
  margin-top: clamp(44px, 6vw, 72px);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  max-width: 1080px;
  margin-inline: auto;
}
.hero-collage figure {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.hero-collage img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3/4; }
.hero-collage figure:nth-child(odd) { transform: translateY(-18px); }
.hero-collage figure:nth-child(1) { animation: float 7s ease-in-out infinite; }
.hero-collage figure:nth-child(3) { animation: float 8s ease-in-out infinite .6s; }
.hero-collage figure:nth-child(5) { animation: float 7.5s ease-in-out infinite 1.2s; }
@keyframes float { 0%,100% { translate: 0 0; } 50% { translate: 0 -12px; } }

/* ==========================================================================
   Quick actions
   ========================================================================== */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.quick-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform .3s var(--ease), border-color .3s, background .3s;
  position: relative;
  overflow: hidden;
}
.quick-card::after {
  content: ""; position: absolute; inset: 0;
  background: var(--grad-soft); opacity: 0;
  transition: opacity .3s;
}
.quick-card:hover { transform: translateY(-5px); border-color: var(--border-strong); }
.quick-card:hover::after { opacity: 1; }
.quick-card > * { position: relative; z-index: 1; }
.q-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  color: var(--pink);
}
.q-icon svg { width: 24px; height: 24px; }
.quick-card h3 { font-size: 1.05rem; font-weight: 600; }
.quick-card p { font-size: .9rem; color: var(--muted); }
.quick-card .go { margin-top: auto; font-size: .85rem; font-weight: 600; color: var(--purple); display: inline-flex; align-items: center; gap: 6px; }

/* ==========================================================================
   Showcase
   ========================================================================== */
.showcase { display: grid; grid-template-columns: 360px 1fr; gap: 32px; align-items: center; }
.showcase.flip { grid-template-columns: 1fr 360px; }
.showcase.flip .showcase-panel { order: 2; }
.showcase-panel {
  padding: 34px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(168,87,247,.14), rgba(236,72,153,.05));
  position: relative;
  overflow: hidden;
}
.showcase-panel .tag {
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--pink);
}
.showcase-panel h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 700; letter-spacing: -.02em; line-height: 1.1;
  margin: 14px 0 12px;
}
.showcase-panel p { color: var(--muted); margin-bottom: 24px; }
.showcase-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.showcase-gallery figure {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform .35s var(--ease), box-shadow .35s;
}
.showcase-gallery figure:hover { transform: translateY(-4px) scale(1.02); box-shadow: var(--glow); }
.showcase-gallery img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.showcase-gallery figure.tall { grid-row: span 2; }
.showcase-gallery figure.tall img { aspect-ratio: 1/2.1; }

/* ==========================================================================
   Apps grid
   ========================================================================== */
.apps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.app-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  transition: transform .35s var(--ease), border-color .35s;
}
.app-card img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; transition: transform .5s var(--ease); }
.app-card::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(8,8,12,.95) 8%, rgba(8,8,12,.35) 55%, rgba(8,8,12,.1) 100%); }
.app-card:hover { transform: translateY(-5px); border-color: var(--border-strong); }
.app-card:hover img.bg { transform: scale(1.07); }
.app-body { position: relative; z-index: 2; padding: 20px; }
.app-body h3 { font-size: 1.15rem; font-weight: 600; }
.app-body p { font-size: .86rem; color: var(--muted); margin: 6px 0 12px; }
.app-body .try { font-size: .85rem; font-weight: 600; color: #fff; display: inline-flex; align-items: center; gap: 6px; }
.app-body .try svg { width: 15px; height: 15px; }

/* ==========================================================================
   Templates marquee
   ========================================================================== */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: flex; gap: 16px; width: max-content; animation: scroll-x 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee figure { width: 220px; flex: 0 0 auto; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); position: relative; }
.marquee img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.marquee figcaption { position: absolute; left: 12px; bottom: 10px; z-index: 2; font-size: .82rem; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.marquee figure::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,8,12,.8), transparent 50%); }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ==========================================================================
   Features
   ========================================================================== */
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature {
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform .3s var(--ease), border-color .3s;
}
.feature:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.feature .f-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--border); color: var(--purple); margin-bottom: 16px; }
.feature .f-icon svg { width: 23px; height: 23px; }
.feature h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.feature p { font-size: .92rem; color: var(--muted); }

/* ==========================================================================
   Pricing / Final CTA
   ========================================================================== */
.cta-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(150deg, rgba(168,87,247,.22), rgba(236,72,153,.12));
  padding: clamp(40px, 6vw, 72px);
  text-align: center;
}
.cta-panel::before {
  content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  top: -180px; left: 50%; translate: -50% 0;
  background: radial-gradient(circle, rgba(236,72,153,.5), transparent 70%);
  filter: blur(80px); z-index: 0;
}
.cta-panel > * { position: relative; z-index: 1; }
.price-tag { display: inline-flex; align-items: baseline; gap: 6px; margin: 18px 0 6px; }
.price-tag .amt { font-family: var(--font-display); font-size: clamp(2.6rem, 6vw, 3.8rem); font-weight: 700; letter-spacing: -.03em; }
.price-tag .per { color: var(--muted); font-size: 1.05rem; }
.cta-panel h2 { font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -.02em; }
.cta-panel .free-note { color: var(--text); font-size: 1.05rem; margin-bottom: 4px; }
.cta-panel .fine { color: var(--muted); font-size: .9rem; max-width: 520px; margin: 6px auto 26px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { border-top: 1px solid var(--border); margin-top: clamp(40px, 6vw, 80px); position: relative; z-index: 1; background: var(--bg-2); }
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-block: 56px; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p.tagline { color: var(--muted); font-size: .92rem; max-width: 280px; margin-bottom: 18px; }
.socials { display: flex; gap: 10px; flex-wrap: wrap; }
.socials a {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); transition: color .2s, border-color .2s, transform .2s, background .2s;
}
.socials a:hover { color: #fff; border-color: var(--border-strong); transform: translateY(-2px); background: var(--surface-2); }
.socials svg { width: 18px; height: 18px; }
.footer-col h4 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 16px; }
.footer-col a { display: block; color: var(--muted); font-size: .92rem; padding: 5px 0; transition: color .2s; }
.footer-col a:hover { color: var(--text); }
.footer-company { color: var(--muted); font-size: .85rem; line-height: 1.7; }
.footer-company b { color: var(--text); display: block; margin-bottom: 4px; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between;
  padding-block: 22px;
  border-top: 1px solid var(--border);
}
.footer-bottom .legal { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-bottom .legal a { color: var(--muted); font-size: .88rem; transition: color .2s; }
.footer-bottom .legal a:hover { color: var(--text); }
.footer-bottom .copy { color: var(--muted-2); font-size: .85rem; }

/* ==========================================================================
   Scroll reveal
   ========================================================================== */
/* Hidden only when JS is available (progressive enhancement) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .quick-grid, .apps-grid, .features-grid { grid-template-columns: repeat(2, 1fr); }
  .showcase, .showcase.flip { grid-template-columns: 1fr; }
  .showcase.flip .showcase-panel { order: 0; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    inset: 70px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px 22px 24px;
    margin: 0;
    background: rgba(10,10,15,.96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
  }
  body.nav-open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
  .nav-toggle { display: flex; }
  .nav-login { display: none; }
  .nav-links { z-index: 49; }

  .hero-collage { grid-template-columns: repeat(3, 1fr); }
  .hero-collage figure:nth-child(n+4) { display: none; }
  .quick-grid, .apps-grid, .features-grid { grid-template-columns: 1fr; }
  .showcase-gallery figure.tall { grid-row: auto; }
  .showcase-gallery figure.tall img { aspect-ratio: 1/1; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
