/* ============ Base ============ */
:root {
  --accent: #d6001c;
  --accent-hover: #b30017;
  --ink: #111827;
  --text: #374151;
  --muted: #6b7280;
  --bg: #f8f9fb;
  --card: #ffffff;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
}

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

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

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

section[id] { scroll-margin-top: 80px; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.navbar {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.nav-brand:hover { color: var(--ink); }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover {
  background: #f1f3f6;
  color: var(--ink);
}

/* ============ Hero ============ */
.hero {
  text-align: center;
  padding: 88px 0 72px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

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

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.subtitle {
  max-width: 560px;
  margin: 0 auto 36px;
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.1rem);
}

/* ============ Form ============ */
.form {
  display: flex;
  align-items: stretch;
  gap: 8px;
  max-width: 660px;
  margin: 0 auto;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 0, 28, 0.12), var(--shadow-md);
}

.input-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px; /* prevents iOS zoom */
  color: var(--ink);
  padding: 13px 40px 13px 14px;
  text-overflow: ellipsis;
}
.input-wrapper input::placeholder { color: #9ca3af; }

.clear-btn {
  position: absolute;
  right: 6px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9ca3af;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.clear-btn:hover { background: #f1f3f6; color: var(--ink); }

.form button[type="submit"] {
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  padding: 0 28px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.form button[type="submit"]:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(214, 0, 28, 0.3);
}
.form button[type="submit"]:active { background: #960012; }

/* ============ Error / Result ============ */
.error {
  max-width: 660px;
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.92rem;
  font-weight: 500;
  text-align: left;
}

.result {
  max-width: 660px;
  margin: 24px auto 0;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.result img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto 14px;
}
.result .title {
  margin: 0 0 16px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  padding: 13px 32px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.download-btn:hover {
  background: #000;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.25);
}

#downloadStatus {
  min-height: 1.4em;
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ============ Content sections ============ */
main > section:not(.hero) {
  max-width: 820px;
  margin: 20px auto;
  padding: 36px 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
main > section:not(.hero):first-of-type { margin-top: 48px; }
main > section:not(.hero):hover {
  border-color: #d5d9e0;
  box-shadow: var(--shadow-md);
}

main > section:not(.hero) h2 {
  position: relative;
  margin: 0 0 16px;
  padding-bottom: 14px;
  font-size: clamp(1.25rem, 3.2vw, 1.5rem);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
main > section:not(.hero) h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

main > section:not(.hero) p {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 1rem;
}
main > section:not(.hero) p:last-child { margin-bottom: 0; }

main > section a {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(214, 0, 28, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s, color 0.15s;
}
main > section a:hover { text-decoration-color: var(--accent); }

/* "Why people use it" feature grid */
#why ul {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
#why li {
  padding: 18px 20px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
  transition: border-color 0.15s, background 0.15s;
}
#why li:hover {
  background: #fff;
  border-color: var(--accent);
}
#why li strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

/* ============ Footer ============ */
.site-footer {
  margin-top: 56px;
  padding: 36px 0;
  text-align: center;
  background: var(--ink);
  color: #d1d5db;
  font-size: 0.9rem;
}
.site-footer .container { max-width: 820px; }
.site-footer p { margin: 0 0 6px; }
.site-footer .footer-note { color: #9ca3af; font-size: 0.85rem; }
.site-footer a { color: #fff; }

/* ============ Responsive ============ */
@media (max-width: 768px) {
  .hero { padding: 64px 0 52px; }
  main > section:not(.hero) { margin: 16px; padding: 28px 24px; }
  main > section:not(.hero):first-of-type { margin-top: 32px; }
  #why ul { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .navbar { height: auto; padding: 12px 16px; flex-direction: column; gap: 4px; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  .nav-links a { padding: 6px 10px; font-size: 0.86rem; }

  .hero { padding: 44px 0 40px; }
  .container { padding: 0 16px; }

  .form {
    flex-direction: column;
    padding: 8px;
    gap: 8px;
  }
  .input-wrapper {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
  }
  .input-wrapper input { padding: 14px 40px 14px 14px; }
  .form button[type="submit"] {
    width: 100%;
    padding: 14px;
  }

  .result { padding: 14px; }
  .download-btn { width: 100%; padding: 14px; }

  main > section:not(.hero) { margin: 12px; padding: 24px 18px; border-radius: 10px; }
  main > section:not(.hero) p { font-size: 0.97rem; }
}

@media (hover: none) {
  main > section:not(.hero):hover { box-shadow: var(--shadow-sm); border-color: var(--border); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* ============ Guide page ============ */
.guide-hero { padding: 64px 0 52px; }

.guide-cta {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s, box-shadow 0.15s;
}
.guide-cta:hover {
  background: var(--accent-hover);
  color: #fff;
  box-shadow: 0 2px 8px rgba(214, 0, 28, 0.3);
}

/* Numbered steps */
/* ============ Step cards ============ */
.step-cards {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

/* Phone screenshots: 4 narrow cards. Computer screenshots: 2 wider cards. */
.phone-cards { grid-template-columns: repeat(4, 1fr); }
.desktop-cards { grid-template-columns: repeat(2, 1fr); }

.step-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.step-card:hover {
  border-color: #d5d9e0;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* Image on top */
.step-media {
  background: #f1f3f6;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.step-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.step-card:hover .step-media img { transform: scale(1.03); }

.phone-cards .step-media { aspect-ratio: 9 / 16; }
.desktop-cards .step-media { aspect-ratio: 16 / 10; }

/* Description below */
.step-body {
  flex: 1;
  padding: 16px 16px 20px;
}

.step-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fdecee;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.step-body h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
}

.step-body p {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--muted);
}

/* Tablet */
@media (max-width: 900px) {
  .phone-cards { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 560px) {
  .desktop-cards { grid-template-columns: 1fr; }

  /* phone cards stay 2 across so the page isn't endless; switch to 1 on very small screens */
  .phone-cards { gap: 12px; }
  .step-body { padding: 14px 14px 18px; }
  .step-body h3 { font-size: 0.98rem; }
  .step-body p { font-size: 0.9rem; }
}

@media (max-width: 380px) {
  .phone-cards { grid-template-columns: 1fr; }
  .phone-cards .step-media { aspect-ratio: 4 / 5; }
}

@media (hover: none) {
  .step-card:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }
  .step-card:hover .step-media img { transform: none; }
}