/* ===================================
   Teachback AI - Marketing Page
   Mobile-first responsive design
   =================================== */

/* --- Reset & Base --- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img, picture, video, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

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

button {
  cursor: pointer;
  font: inherit;
}

/* --- Design Tokens --- */

:root {
  --color-primary: #007AFF;
  --color-primary-dark: #0056CC;
  --color-text: #1a1a1a;
  --color-text-secondary: #666;
  --color-bg: #ffffff;
  --color-bg-secondary: #f5f5f7;
  --color-border: #e5e5e5;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 5rem;

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-xl: 2rem;
}

/* --- Utilities --- */

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Navigation --- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem var(--space-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
}

.nav-icon {
  flex-shrink: 0;
  border-radius: 8px;
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--color-text);
  color: var(--color-bg);
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  border-radius: var(--radius-xl);
}

.btn-primary:hover {
  background: #333;
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8125rem;
}

.btn-download {
  background: var(--color-text);
  color: var(--color-bg);
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-md);
  gap: 0.625rem;
}

.btn-download:hover {
  background: #333;
}

.btn-download svg {
  flex-shrink: 0;
}

.btn-download div {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.btn-download-label {
  font-size: 0.625rem;
  font-weight: 400;
}

.btn-download-store {
  font-size: 1.125rem;
  font-weight: 600;
}

/* --- Hero Section --- */

.hero {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-lg);
}

.hero-icon {
  margin: 0 auto var(--space-md);
  border-radius: 18px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 700px;
  margin: 0 auto var(--space-sm);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto var(--space-md);
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* --- Screenshots Section --- */

.screenshots {
  padding: var(--space-lg) 0 var(--space-xl);
}

.screenshots-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0 var(--space-sm);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.screenshots-row::before,
.screenshots-row::after {
  content: "";
  flex: 0 0 var(--space-xs);
}

.screenshots-row::-webkit-scrollbar {
  display: none;
}

.phone-frame {
  flex: 0 0 200px;
  scroll-snap-align: center;
}

.phone-frame img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

/* --- Trusted By Section --- */

.trusted {
  padding: var(--space-lg) 0;
  text-align: center;
}

.trusted-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.trusted-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.uni-logo {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.uni-logo:hover {
  opacity: 1;
}

/* --- Features Section --- */

.features {
  padding: var(--space-xl) 0;
  background: var(--color-bg-secondary);
}

.features h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.feature-card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
}

.feature-icon {
  margin-bottom: var(--space-sm);
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

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

/* --- CTA Section --- */

.cta {
  text-align: center;
  padding: var(--space-xl) 0;
}

.cta h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.cta p {
  color: var(--color-text-secondary);
  font-size: clamp(1rem, 2vw, 1.125rem);
  margin-bottom: var(--space-md);
}

/* --- Footer --- */

.footer {
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-lg) 0 var(--space-md);
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: var(--space-xs);
}

.footer-links {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.footer-links a {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #fff;
}

.footer-copy {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
}

/* --- Legal Pages --- */

.legal {
  padding: var(--space-xl) 0;
}

.legal h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.legal-meta {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

.legal h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.legal h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.legal p {
  color: var(--color-text);
  line-height: 1.7;
  margin-bottom: var(--space-sm);
}

.legal ul, .legal ol {
  padding-left: 1.5rem;
  margin-bottom: var(--space-sm);
}

.legal li {
  color: var(--color-text);
  line-height: 1.7;
  margin-bottom: var(--space-xs);
}

.legal a {
  color: var(--color-primary);
  text-decoration: underline;
}

.legal a:hover {
  color: var(--color-primary-dark);
}

/* --- Focus Styles --- */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* --- Reduced Motion --- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===================================
   Tablet (768px+)
   =================================== */

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }

  .nav-container {
    padding: 0.75rem var(--space-md);
  }

  .hero {
    padding: var(--space-xl) 0 var(--space-lg);
  }

  .phone-frame {
    flex: 0 0 220px;
  }

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

  .footer-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .footer-brand {
    margin-bottom: 0;
  }

  .footer-links {
    margin-bottom: 0;
    order: 2;
  }

  .footer-copy {
    width: 100%;
    margin-top: var(--space-md);
    order: 3;
  }
}

/* ===================================
   Desktop (1024px+)
   =================================== */

@media (min-width: 1024px) {
  .hero {
    padding: 6rem 0 var(--space-xl);
  }

  .screenshots-row {
    justify-content: center;
    overflow-x: visible;
    padding: 0 var(--space-md);
  }

  .screenshots-row::before,
  .screenshots-row::after {
    display: none;
  }

  .phone-frame {
    flex: 0 0 200px;
  }

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

  .feature-card {
    padding: var(--space-md) var(--space-sm);
  }
}

/* --- Touch Targets --- */

@media (hover: none) and (pointer: coarse) {
  .btn, .footer-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
