/* ============================================================
   PhotoAI.cloud — Main Stylesheet
   Aesthetic: Dark precision lab · Surgical minimalism
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Design Tokens --- */
:root {
  --bg:          #0a0b0f;
  --surface:     #111219;
  --elevated:    #1a1c26;
  --primary:     #00d4ff;
  --primary-dim: #0096b3;
  --secondary:   #ff6b35;
  --text:        #f0f4ff;
  --muted:       #6b7394;
  --border:      #2a2d3e;
  --success:     #00e5a0;
  --error:       #ff4757;

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  2rem;
  --text-4xl:  2.75rem;
  --text-5xl:  3.75rem;

  --radius:    12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.12);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);

  --transition-fast: 150ms ease;
  --transition-base: 220ms ease;
  --transition-spring: 400ms cubic-bezier(0.16,1,0.3,1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: opacity var(--transition-fast); }
a:hover { opacity: 0.8; }
button { cursor: pointer; font-family: var(--font-body); border: none; outline: none; }

/* --- Layout Helpers --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 96px 0; }
.section--sm { padding: 64px 0; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10,11,15,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(42,45,62,0.6);
  transition: background var(--transition-base);
}
.navbar__logo { display: flex; align-items: center; }
.navbar__logo img { height: 36px; width: auto; }
.navbar__links {
  display: flex; align-items: center; gap: 32px;
  list-style: none;
}
.navbar__links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  transition: color var(--transition-fast);
}
.navbar__links a:hover { color: var(--text); opacity: 1; }

.lang-switcher {
  display: flex; align-items: center; gap: 4px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.lang-btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  transition: all var(--transition-fast);
  text-transform: uppercase;
}
.lang-btn.active,
.lang-btn:hover {
  background: var(--primary);
  color: var(--bg);
}
.navbar__hamburger { display: none; background: none; padding: 6px; color: var(--text); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  position: relative;
  overflow: hidden;
}

/* Background mesh */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 70% 50%, rgba(0,212,255,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 15% 80%, rgba(255,107,53,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(42,45,62,0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42,45,62,0.3) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  width: 100%;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.2);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}
.hero__badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, var(--text-5xl));
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero__title-accent { color: var(--primary); }

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 480px;
}

/* ============================================================
   DROPZONE
   ============================================================ */
.dropzone {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 32px;
  text-align: center;
  transition: all var(--transition-spring);
  cursor: pointer;
  position: relative;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(0,212,255,0.04);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}
.dropzone__icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  color: var(--primary);
  opacity: 0.8;
}
.dropzone__text {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.dropzone__sub {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: 16px;
}
.dropzone__browse {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--transition-fast);
}
.dropzone__browse:hover { text-decoration-color: var(--primary); }
.dropzone__formats {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 12px;
  letter-spacing: 0.04em;
}
#file-input { display: none; }

/* Processing state */
.processing-state { text-align: center; padding: 32px 0; }
.spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-state__label {
  font-size: var(--text-base);
  color: var(--muted);
}

/* Result state */
.result-state { display: flex; flex-direction: column; gap: 16px; }
.compare-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--elevated);
  user-select: none;
}
.compare-wrapper img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}
.compare-wrapper__after { clip-path: inset(0 50% 0 0); }
.compare-divider {
  position: absolute; top: 0; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 2px; background: var(--primary);
  cursor: ew-resize;
  z-index: 2;
}
.compare-divider::after {
  content: '◀ ▶';
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--primary);
  color: var(--bg);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 100px;
  white-space: nowrap;
}
.compare-label {
  position: absolute;
  top: 10px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(10,11,15,0.7);
  backdrop-filter: blur(4px);
}
.compare-label--before { left: 10px; }
.compare-label--after { right: 10px; }

.result-actions { display: flex; gap: 12px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius);
  transition: all var(--transition-base);
  white-space: nowrap;
}
.btn--primary {
  background: var(--primary);
  color: var(--bg);
}
.btn--primary:hover {
  background: #26dbff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,212,255,0.25);
  opacity: 1;
}
.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}
.btn--ghost:hover {
  border-color: var(--text);
  color: var(--text);
  opacity: 1;
}
.btn--full { width: 100%; }
.btn--lg { padding: 16px 32px; font-size: var(--text-base); border-radius: var(--radius-lg); }

/* ============================================================
   FEATURES
   ============================================================ */
.features { background: var(--surface); }
.section-header { text-align: center; margin-bottom: 64px; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, var(--text-4xl));
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.section-subtitle {
  font-size: var(--text-lg);
  color: var(--muted);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition-spring);
}
.feature-card:hover {
  border-color: rgba(0,212,255,0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}
.feature-card__icon {
  width: 44px; height: 44px;
  background: rgba(0,212,255,0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--primary);
}
.feature-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-card__desc { font-size: var(--text-sm); color: var(--muted); line-height: 1.65; }

/* ============================================================
   TUTORIAL
   ============================================================ */
.tutorial { background: var(--bg); }
.tutorial-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  position: relative;
}
.tutorial-steps::before {
  content: '';
  position: absolute;
  top: 28px; left: 14%;
  width: 72%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), var(--border), transparent);
}
.tutorial-step { text-align: center; position: relative; }
.tutorial-step__num {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--elevated);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--primary);
  margin: 0 auto 20px;
  position: relative;
  z-index: 1;
  background: var(--surface);
}
.tutorial-step__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 8px;
}
.tutorial-step__desc { font-size: var(--text-sm); color: var(--muted); line-height: 1.65; }

/* ============================================================
   FAQ
   ============================================================ */
.faq { background: var(--surface); }
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-base);
}
.faq-item.open { border-color: rgba(0,212,255,0.25); }
.faq-item__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  text-align: left;
  transition: color var(--transition-fast);
}
.faq-item__q:hover { color: var(--primary); }
.faq-item__chevron {
  flex-shrink: 0;
  width: 20px; height: 20px;
  color: var(--muted);
  transition: transform var(--transition-spring);
}
.faq-item.open .faq-item__chevron { transform: rotate(180deg); }
.faq-item__a {
  display: none;
  padding: 0 24px 20px;
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.7;
}
.faq-item.open .faq-item__a { display: block; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}
.footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 32px;
}
.footer__brand img { height: 32px; margin-bottom: 12px; }
.footer__tagline { font-size: var(--text-sm); color: var(--muted); max-width: 280px; }
.footer__links { display: flex; flex-direction: column; gap: 10px; }
.footer__links-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.footer__links a { font-size: var(--text-sm); color: var(--muted); }
.footer__links a:hover { color: var(--text); opacity: 1; }
.footer__bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer__copy, .footer__disclaimer {
  font-size: var(--text-xs);
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ============================================================
   LEGAL PAGES
   ============================================================ */
.legal-page { padding: 120px 0 80px; }
.legal-page h1 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  margin-bottom: 8px;
}
.legal-page .meta {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: 48px;
}
.legal-page h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 40px 0 12px;
  color: var(--text);
}
.legal-page p {
  font-size: var(--text-base);
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 16px;
  max-width: 760px;
}
.legal-page a { color: var(--primary); }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 40px;
}

/* ============================================================
   MOBILE NAV MENU
   ============================================================ */
.mobile-menu {
  display: none;
  position: fixed;
  top: 68px; left: 0; right: 0;
  background: rgba(17,18,25,0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 24px;
  z-index: 99;
  flex-direction: column;
  gap: 20px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--text);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .navbar__links { display: none; }
  .navbar__hamburger { display: flex; align-items: center; }
  .hero__content { grid-template-columns: 1fr; gap: 48px; }
  .hero__subtitle { max-width: 100%; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .tutorial-steps { grid-template-columns: repeat(2, 1fr); }
  .tutorial-steps::before { display: none; }
}

@media (max-width: 600px) {
  .hero { padding-top: 68px; text-align: center; }
  .hero__badge { margin-left: auto; margin-right: auto; }
  .hero__subtitle { font-size: var(--text-base); }
  .features-grid { grid-template-columns: 1fr; }
  .tutorial-steps { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
  .section { padding: 64px 0; }
  .result-actions { flex-direction: column; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
