/* ============================================================
   GPTImage2 Official Website — Premium Dark Design System
   ============================================================ */

/* --- 0. CSS Custom Properties (Design Tokens) --- */
:root {
  color-scheme: dark;

  /* Core Palette */
  --bg-deep:        #09090B;
  --bg-primary:     #0C0C0F;
  --bg-elevated:    #141418;
  --bg-card:        rgba(20, 20, 26, 0.65);
  --bg-card-hover:  rgba(30, 30, 40, 0.75);

  /* Glass */
  --glass-bg:       rgba(255, 255, 255, 0.04);
  --glass-border:   rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.14);

  /* Brand Gradient */
  --accent:         #8B5CF6;
  --accent-light:   #A78BFA;
  --accent-glow:    rgba(139, 92, 246, 0.35);
  --gradient-brand:  linear-gradient(135deg, #8B5CF6 0%, #6D28D9 50%, #4C1D95 100%);
  --gradient-text:   linear-gradient(135deg, #C4B5FD 0%, #8B5CF6 50%, #6D28D9 100%);
  --gradient-hero:   radial-gradient(ellipse 80% 60% at 50% -10%, rgba(139,92,246,0.18) 0%, transparent 70%);

  /* Text */
  --text-primary:    rgba(255, 255, 255, 0.92);
  --text-secondary:  rgba(255, 255, 255, 0.60);
  --text-muted:      rgba(255, 255, 255, 0.38);
  --text-on-accent:  #FFFFFF;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --container-max: 1120px;
  --header-h: 72px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.2s var(--ease-out);
  --transition-med:  0.35s var(--ease-out);
  --transition-slow: 0.6s var(--ease-out);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* Selection */
::selection {
  background: var(--accent);
  color: white;
}

/* --- 2. Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 1rem;
}

.section-label::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* --- 3. Typography --- */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.4rem, 2rem + 3vw, 4rem); }
h2 {
  font-size: clamp(1.8rem, 1.4rem + 2vw, 2.8rem);
  text-align: center;
  margin-bottom: 1rem;
}
h3 { font-size: 1.25rem; }

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- 4. Glass Card --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color var(--transition-fast),
              transform var(--transition-med),
              box-shadow var(--transition-med),
              background var(--transition-fast);
}

.card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(139,92,246,0.08);
  background: var(--bg-card-hover);
}

/* --- 5. Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  background: var(--gradient-brand);
  color: var(--text-on-accent);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--transition-fast),
              box-shadow var(--transition-fast),
              filter var(--transition-fast);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
  filter: brightness(1.1);
}
.btn-primary:hover::after { opacity: 1; }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  background: var(--glass-bg);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast),
              border-color var(--transition-fast),
              transform var(--transition-fast);
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
}

/* --- 6. Navigation / Header --- */
header {
  height: var(--header-h);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 1px solid transparent;
  background: rgba(9, 9, 11, 0.6);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  transition: border-color var(--transition-fast),
              background var(--transition-fast);
}

header.scrolled {
  border-bottom-color: var(--glass-border);
  background: rgba(9, 9, 11, 0.88);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--gradient-brand);
  box-shadow: 0 2px 10px var(--accent-glow);
  transition: box-shadow var(--transition-fast);
}

.logo:hover .logo-icon {
  box-shadow: 0 4px 16px rgba(139,92,246,0.5);
}

.logo sup {
  font-size: 0.55em;
  color: var(--accent-light);
}

/* Nav */
nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

nav a:hover { color: var(--text-primary); }

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gradient-brand);
  color: white;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.btn-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px var(--accent-glow);
  color: white;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
}

/* --- 7. Hero Section --- */
.hero-section {
  position: relative;
  padding-top: calc(var(--header-h) + 6rem);
  padding-bottom: 6rem;
  overflow: hidden;
}

/* Animated Background Orbs */
.hero-section::before,
.hero-section::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  animation: float-orb 14s ease-in-out infinite alternate;
}

.hero-section::before {
  width: 600px;
  height: 600px;
  background: rgba(139, 92, 246, 0.12);
  top: -200px;
  left: -100px;
}

.hero-section::after {
  width: 500px;
  height: 500px;
  background: rgba(109, 40, 217, 0.08);
  bottom: -150px;
  right: -120px;
  animation-delay: -7s;
}

@keyframes float-orb {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.1); }
}

.hero-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 800px;
}

.hero-title {
  text-wrap: balance;
}

.hero-description {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 680px;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-image-wrapper {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(255,255,255,0.04);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.hero-image-wrapper:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5),
              0 0 80px rgba(139, 92, 246, 0.08);
}

.hero-image-wrapper img {
  width: 100%;
  display: block;
}

/* Hero Stats */
.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
  justify-content: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- 8. Features Section --- */
.features-section {
  padding: 7rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header p {
  max-width: 560px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: opacity var(--transition-med);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.15);
  color: var(--accent-light);
  font-size: 1.3rem;
  transition: background var(--transition-fast),
              border-color var(--transition-fast),
              transform var(--transition-fast);
}

.feature-card:hover .feature-icon-box {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.3);
  transform: scale(1.05);
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

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

/* --- 9. Screenshot Showcase --- */
.showcase-section {
  padding: 7rem 0;
  position: relative;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.showcase-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  transition: transform var(--transition-med),
              box-shadow var(--transition-med),
              border-color var(--transition-fast);
  position: relative;
}

.showcase-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
  border-color: var(--glass-border-hover);
}

.showcase-item img {
  width: 100%;
  display: block;
}

.showcase-item .showcase-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}

/* --- 10. Download / CTA Section --- */
.download-section {
  padding: 7rem 0;
  position: relative;
}

.download-banner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 680px;
  margin: 0 auto;
  padding: 4rem 3rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(24px);
  position: relative;
  overflow: hidden;
}

/* Gradient shimmer on banner */
.download-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(139,92,246,0.06), transparent 30%);
  animation: rotate-shimmer 12s linear infinite;
  pointer-events: none;
}

@keyframes rotate-shimmer {
  100% { transform: rotate(360deg); }
}

.download-banner h2 {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
}

.download-banner p {
  font-size: 1.05rem;
  position: relative;
  z-index: 1;
}

.download-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

/* --- 11. Footer --- */
footer {
  border-top: 1px solid var(--glass-border);
  padding: 3rem 0;
  background: var(--bg-deep);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-brand .logo {
  font-size: 1.15rem;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 280px;
}

.footer-links-group {
  display: flex;
  gap: 4rem;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}

.footer-col a {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  transition: color var(--transition-fast);
}

.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

.footer-bottom-links a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-bottom-links a:hover { color: var(--text-primary); }

/* --- 12. Legal Pages --- */
.legal-page {
  padding-top: calc(var(--header-h) + 4rem);
  padding-bottom: 6rem;
  min-height: 100vh;
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.legal-content h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  text-align: left;
}

.update-date {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.legal-content section {
  margin-bottom: 2.5rem;
}

.legal-content h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  text-align: left;
  color: var(--text-primary);
}

.legal-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  text-align: left;
  color: var(--text-primary);
}

.legal-content p {
  line-height: 1.8;
  margin-bottom: 1rem;
}

.legal-content ul, .legal-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-content li {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 0.4rem;
  font-size: 1.02rem;
}

.legal-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.legal-toc {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  margin-bottom: 3rem;
}

.legal-toc h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.legal-toc ol {
  padding-left: 1.25rem;
}

.legal-toc li {
  margin-bottom: 0.3rem;
}

.legal-toc a {
  color: var(--accent-light);
  transition: color var(--transition-fast);
}

.legal-toc a:hover {
  color: var(--accent);
}

/* --- 13. Scroll Animations --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.stagger-children .animate-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.stagger-children .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .animate-on-scroll:nth-child(3) { transition-delay: 0.15s; }
.stagger-children .animate-on-scroll:nth-child(4) { transition-delay: 0.2s; }
.stagger-children .animate-on-scroll:nth-child(5) { transition-delay: 0.25s; }
.stagger-children .animate-on-scroll:nth-child(6) { transition-delay: 0.3s; }

/* --- 14. Responsive --- */
@media (max-width: 968px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-text { align-items: center; }
  .hero-description { max-width: 100%; }
  .hero-cta { justify-content: center; }
  .hero-stats { justify-content: center; }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .showcase-grid {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }

  .footer-content { flex-direction: column; gap: 2.5rem; }
  .footer-links-group { gap: 2.5rem; }
}

@media (max-width: 768px) {
  nav { display: none; }
  .mobile-toggle { display: block; }

  /* Mobile Nav Panel */
  nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0;
    width: 100%;
    background: rgba(9,9,11,0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    gap: 1rem;
    animation: slide-down 0.3s var(--ease-out);
  }

  @keyframes slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .download-banner {
    padding: 2.5rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-section { padding-top: calc(var(--header-h) + 3rem); padding-bottom: 3rem; }
  .features-section, .showcase-section, .download-section { padding: 4rem 0; }
  .hero-stats { flex-wrap: wrap; gap: 1.5rem; }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .footer-links-group {
    flex-direction: column;
    gap: 1.5rem;
  }
}
