/* =============================
   RESET & BASE
   ============================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --white: #ffffff;
  --black: #0f172a;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --primary: #0891b2;
  --primary-dark: #0e7490;
  --primary-light: #ecfeff;
  --accent: #4f46e5;
  --success: #16a34a;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.1);
  --shadow-xl: 0 20px 50px rgba(0,0,0,.12);
  --transition: .25s cubic-bezier(.4, 0, .2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================
   NAV
   ============================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226,232,240,.6);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__logo {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #06b6d4, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav__links {
  display: flex;
  gap: 28px;
}

.nav__links a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-500);
  transition: color var(--transition);
}

.nav__links a:hover {
  color: var(--gray-800);
}

/* =============================
   HERO
   ============================= */
.hero {
  position: relative;
  padding: 140px 0 80px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 70% 20%, rgba(6,182,212,.08), transparent),
    radial-gradient(ellipse 500px 300px at 20% 60%, rgba(79,70,229,.06), transparent),
    radial-gradient(ellipse 800px 500px at 50% 100%, rgba(6,182,212,.04), transparent);
  pointer-events: none;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
}

.hero__badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: .8rem;
  font-weight: 600;
  border-radius: 20px;
  margin-bottom: 20px;
}

.hero__title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: 20px;
  color: var(--gray-900);
}

.gradient-text {
  background: linear-gradient(135deg, #06b6d4, var(--accent), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--gray-500);
  max-width: 480px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero__stats {
  display: flex;
  gap: 36px;
}

.hero__stat {
  display: flex;
  flex-direction: column;
}

.hero__stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
}

.hero__stat-label {
  font-size: .8rem;
  color: var(--gray-400);
  font-weight: 500;
}

/* Hero phone mockup */
.hero__phone {
  width: 300px;
  height: 440px;
  background: var(--gray-900);
  border-radius: 32px;
  padding: 10px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,.1);
  margin: 0 auto;
}

.hero__phone-screen {
  background: var(--white);
  border-radius: 24px;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hero__phone-header {
  display: flex;
  gap: 6px;
  padding: 14px 16px 0;
}

.hero__phone-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-200);
}

.hero__phone-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero__mock-image svg {
  width: 100%;
  border-radius: 8px;
}

.hero__mock-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero__mock-lines span {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
}

.hero__mock-lines span:nth-child(1) { width: 80%; }
.hero__mock-lines span:nth-child(2) { width: 65%; }
.hero__mock-lines span:nth-child(3) { width: 90%; }
.hero__mock-lines span:nth-child(4) { width: 50%; }

.hero__mock-result {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding: 12px;
  background: var(--primary-light);
  border-radius: 8px;
}

.hero__mock-result span {
  height: 6px;
  border-radius: 3px;
  background: var(--primary);
  opacity: .3;
}

.hero__mock-result span:nth-child(1) { width: 100%; }
.hero__mock-result span:nth-child(2) { width: 85%; }
.hero__mock-result span:nth-child(3) { width: 70%; }

/* =============================
   SECTION HEADER
   ============================= */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 8px;
  letter-spacing: -.02em;
}

.section-header p {
  color: var(--gray-500);
  font-size: 1.05rem;
}

/* =============================
   FEATURES
   ============================= */
.features {
  padding: 80px 0;
  background: var(--white);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--gray-100);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-900);
}

.feature-card p {
  font-size: .9rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* =============================
   HOW IT WORKS
   ============================= */
.how {
  padding: 80px 0;
  background: var(--gray-50);
}

.how__steps {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.how__step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.how__step-number {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 14px;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
}

.how__step-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.how__step-content p {
  font-size: .9rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* =============================
   APP SECTION
   ============================= */
.app-section {
  padding: 80px 0;
  background: var(--white);
}

.app-card {
  max-width: 640px;
  margin: 0 auto;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 32px;
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-area.has-image {
  padding: 0;
  cursor: default;
  border-color: transparent;
}

.upload-area__icon {
  margin-bottom: 12px;
  opacity: .6;
}

.upload-area__text {
  font-size: .95rem;
  color: var(--gray-600);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}

.btn-link:hover {
  text-decoration: underline;
}

.upload-area__hint {
  font-size: .8rem;
  color: var(--gray-400);
  margin-top: 6px;
}

.upload-area__preview {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.upload-area__preview img {
  max-height: 320px;
  object-fit: contain;
  margin: 0 auto;
  background: var(--gray-100);
}

/* Controls */
.app-controls {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.app-controls__group {
  flex: 1;
  min-width: 180px;
}

.app-controls__group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.app-controls__select-wrap {
  position: relative;
}

.app-controls__select-wrap select {
  width: 100%;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xs);
  font-size: .9rem;
  font-family: inherit;
  background: var(--white);
  color: var(--gray-800);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.app-controls__select-wrap select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6,182,212,.15);
}

.app-controls__chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--gray-400);
}

.app-controls__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 10px;
  min-width: 32px;
}

/* Progress */
.app-progress {
  margin-top: 20px;
  background: var(--white);
  border-radius: var(--radius-xs);
  padding: 16px 20px;
  border: 1px solid var(--gray-200);
}

.app-progress__step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  color: var(--gray-400);
  font-size: .9rem;
}

.app-progress__step.active {
  color: var(--primary);
  font-weight: 600;
}

.app-progress__step.active .app-progress__icon {
  animation: spin .8s linear infinite;
  stroke: var(--primary);
}

.app-progress__step.done {
  color: var(--success);
}

.app-progress__step.done .app-progress__icon {
  stroke: var(--success);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Results */
.app-results {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.app-result {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xs);
  padding: 16px 20px;
}

.app-result--translated {
  border-left: 3px solid var(--primary);
  background: var(--primary-light);
}

.app-result__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.app-result__label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.app-result__actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.app-result__lang {
  font-size: .75rem;
  color: var(--gray-400);
  margin-left: auto;
}

.app-result__text {
  font-size: .95rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--gray-800);
}

.app-result__badge {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.app-result__badge span {
  font-size: .7rem;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 500;
}

/* Error */
.app-error {
  margin-top: 16px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-xs);
  padding: 12px 16px;
}

.app-error p {
  color: var(--danger);
  font-size: .88rem;
}

/* =============================
   BUTTONS
   ============================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  border-radius: var(--radius-xs);
}

.btn--primary {
  background: var(--primary);
  color: var(--white);
  padding: 10px 28px;
  font-size: .95rem;
}

.btn--primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(6,182,212,.35);
}

.btn--primary:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  color: var(--gray-600);
  padding: 10px 28px;
  font-size: .95rem;
  border: 1px solid var(--gray-200);
}

.btn--ghost:hover {
  border-color: var(--gray-300);
  background: var(--gray-100);
}

.btn--lg {
  padding: 12px 36px;
  font-size: 1rem;
}

.btn-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.45);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.btn-icon:hover {
  background: rgba(0,0,0,.65);
}

.btn-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  transition: all var(--transition);
}

.btn-icon-sm:hover {
  border-color: var(--gray-300);
  color: var(--gray-600);
  background: var(--gray-100);
}

.btn-icon-sm:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.btn-improve {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: transparent;
  cursor: pointer;
  color: var(--primary);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-improve:hover {
  border-color: var(--primary);
  background: rgba(8, 145, 178, 0.06);
}

.btn-improve:disabled {
  cursor: not-allowed;
  opacity: .5;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

.hidden {
  display: none !important;
}

/* =============================
   CTA
   ============================= */
.cta {
  padding: 80px 0;
  text-align: center;
  background: linear-gradient(135deg, #0891b2, var(--accent));
  color: var(--white);
}

.cta h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.cta p {
  font-size: 1.05rem;
  opacity: .85;
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.cta .btn--primary {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.cta .btn--primary:hover {
  background: var(--gray-100);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* =============================
   FOOTER
   ============================= */
.footer {
  padding: 32px 0;
  background: var(--gray-900);
  color: var(--gray-400);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer__copy {
  font-size: .85rem;
}

.footer__tech {
  font-size: .8rem;
  line-height: 1.8;
}

.footer__tech a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer__tech a:hover {
  color: var(--gray-300);
}

/* Language grid for sub-pages */
.langs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.lang-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  text-decoration: none;
  color: var(--gray-700);
  font-size: .9rem;
  font-weight: 500;
}

.lang-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.lang-card__flag {
  font-size: 1.2rem;
  line-height: 1;
}

.lang-card__name {
  line-height: 1.3;
}

/* =============================
   TOAST
   ============================= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: var(--white);
  padding: 10px 24px;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 500;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* =============================
   RESPONSIVE
   ============================= */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero__subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__stats {
    justify-content: center;
  }

  .hero__phone {
    width: 240px;
    height: 360px;
  }

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

@media (max-width: 640px) {
  .hero__title {
    font-size: 2rem;
  }

  .hero__phone {
    width: 200px;
    height: 300px;
  }

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

  .nav__links {
    display: none;
  }

  .section-header h2 {
    font-size: 1.6rem;
  }

  .app-card {
    padding: 20px;
  }

  .app-controls {
    flex-direction: column;
  }

  .app-controls__group {
    min-width: unset;
  }

  .app-controls__arrow {
    padding-bottom: 0;
    transform: rotate(90deg);
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

