/* ═══════════════════════════════════════════════════════════════════════════
   ClipMinder Website — styles.css
   Design: clean, modern macOS product landing page
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
ul { list-style: none; }
a { text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* Prevent any child from causing horizontal overflow */
html, body { overflow-x: hidden; max-width: 100%; }

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  --bg:            #f5f7fa;
  --surface:       #ffffff;
  --surface-2:     #f0f3f7;
  --text:          #0f172a;
  --text-2:        #475569;
  --text-3:        #94a3b8;
  --border:        #e2e8f0;
  --border-2:      #cbd5e1;
  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --accent-subtle: #eff6ff;
  --accent-light:  #bfdbfe;
  --green:         #16a34a;
  --green-subtle:  #f0fdf4;
  --radius-sm:     6px;
  --radius:        12px;
  --radius-lg:     20px;
  --radius-xl:     28px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow:        0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:     0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --max-w:         1100px;
  --nav-h:         64px;
  font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #0d1117;
    --surface:       #161b22;
    --surface-2:     #1c2230;
    --text:          #f0f6fc;
    --text-2:        #9aafca;
    --text-3:        #5d7496;
    --border:        #262f3d;
    --border-2:      #30404f;
    --accent:        #58a6ff;
    --accent-hover:  #79b8ff;
    --accent-subtle: #0d1f3c;
    --accent-light:  #1c3a6e;
    --green:         #3fb950;
    --green-subtle:  #0a2619;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
    --shadow:        0 4px 16px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.2);
    --shadow-lg:     0 12px 40px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.3);
  }
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
.inner     { width: min(var(--max-w), 100% - 48px); margin-inline: auto; }
.sr-only   { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* Prevent long words / URLs from overflowing */
p, h1, h2, h3, li, a { overflow-wrap: break-word; word-break: break-word; }

/* ── Brand / Logo ─────────────────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.02em;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
.brand-icon.small {
  width: 26px; height: 26px; font-size: 14px; border-radius: 7px;
}
.brand-name { line-height: 1; }

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  /* Prevent navbar contents from causing horizontal overflow */
  overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  .navbar { background: rgba(13,17,23,.88); }
}
.navbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  width: min(var(--max-w), 100% - 32px);
  margin-inline: auto;
  min-width: 0; /* Prevent flex children from overflowing */
}
.nav-links {
  display: flex;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0; /* Don't let it shrink below content */
}
.nav-links a {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Language Selector ────────────────────────────────────────────────────── */
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='%2394a3b8'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat right 8px center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13px;
  padding: 5px 26px 5px 8px;
  cursor: pointer;
  width: 90px;        /* Fixed width, enough for most labels */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.lang-select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── App Store Button ─────────────────────────────────────────────────────── */
.btn-appstore {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--text);
  color: var(--surface);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: background .18s, transform .15s, box-shadow .18s;
  letter-spacing: -.01em;
  max-width: 100%;
  white-space: normal;
  text-align: left;
  /* Prevent the button from overflowing on narrow screens */
  width: fit-content;
  word-break: break-word;
  overflow-wrap: break-word;
}
.btn-appstore:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
@media (prefers-color-scheme: dark) {
  .btn-appstore { background: #f1f5f9; color: #0f172a; }
  .btn-appstore:hover { background: #e2e8f0; }
}
.appstore-icon { width: 22px; height: 22px; flex-shrink: 0; }

/* ── Section Badge ────────────────────────────────────────────────────────── */
.section-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}
.section-badge.accent { color: var(--accent); }

/* ── Section Shared Layout ────────────────────────────────────────────────── */
.section-wrap {
  padding-block: 80px;
}
.section-inner {
  width: min(var(--max-w), 100% - 48px);
  margin-inline: auto;
}
.section-inner.two-col {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 32px;
  align-items: start;
}
.section-headline {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 16px;
}
.section-center-headline {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--text);
  text-align: center;
  margin-bottom: 48px;
}
.section-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 600px;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-block: 80px 60px;
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  width: min(var(--max-w), 100% - 48px);
  margin-inline: auto;
}
.hero-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.hero-headline {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-2);
  margin-bottom: 32px;
  max-width: 480px;
}
.hero-ctas { margin-bottom: 16px; }
.hero-trial {
  font-size: 13px;
  color: var(--text-3);
}

/* Hero screenshot */
.hero-screenshot { display: flex; justify-content: center; align-items: center; }
.screenshot-frame {
  position: relative;
  width: 100%;
  max-width: 460px;
}
.ss-main {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.ss-overlay {
  position: absolute;
  bottom: -24px;
  right: -28px;
  width: 52%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

/* ── Problem & Solution sections ──────────────────────────────────────────── */
.problem-section { background: var(--surface); border-bottom: 1px solid var(--border); }
.solution-section { background: var(--accent-subtle); border-bottom: 1px solid var(--accent-light); }
@media (prefers-color-scheme: dark) {
  .solution-section { background: var(--accent-subtle); border-color: var(--accent-light); }
}

/* ── Features Grid ────────────────────────────────────────────────────────── */
.features-section { background: var(--bg); }
.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: box-shadow .18s, transform .18s;
}
.feat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.feat-icon {
  font-size: 28px;
  margin-bottom: 14px;
  line-height: 1;
}
.feat-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: 8px;
}
.feat-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-2);
}

/* ── Screenshots Gallery ──────────────────────────────────────────────────── */
.screenshots-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ss-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.ss-gallery-item {
  margin: 0;
}
.ss-gallery-item img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, transform .18s;
}
.ss-gallery-item img:hover { box-shadow: var(--shadow); transform: scale(1.02); }

/* ── Privacy Section ──────────────────────────────────────────────────────── */
.privacy-section {
  background: var(--green-subtle);
  border-top: 1px solid #bbf7d0;
  border-bottom: 1px solid #bbf7d0;
}
@media (prefers-color-scheme: dark) {
  .privacy-section {
    border-color: #14532d;
  }
}
.privacy-inner {
  display: flex;
  gap: 48px;
  align-items: center;
}
.privacy-icon-wrap { flex-shrink: 0; }
.privacy-svg { width: 80px; height: 80px; }
.privacy-text { flex: 1; }
.privacy-badge-pill {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  margin-top: 16px;
}

/* ── Pricing Section ──────────────────────────────────────────────────────── */
.pricing-section { background: var(--surface); border-bottom: 1px solid var(--border); }
.pricing-inner { max-width: 560px; }
.pricing-bullets {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0 32px;
}
.pricing-bullets li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-2);
}
.pricing-bullets li::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat center / 11px;
  flex-shrink: 0;
}

/* ── FAQ Section ──────────────────────────────────────────────────────────── */
.faq-section { background: var(--bg); }
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 720px;
  margin-inline: auto;
  border-top: 1px solid var(--border);
}
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 20px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}
.faq-q:hover { color: var(--accent); }
.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-3);
  transition: transform .2s;
}
.faq-q[aria-expanded="true"] .faq-chevron { transform: rotate(180deg); }
.faq-a {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-2);
  padding-bottom: 20px;
}

/* ── Site Footer ──────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-block: 48px;
}
.footer-inner {
  width: min(var(--max-w), 100% - 48px);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
}
.footer-nav a {
  color: var(--text-2);
  font-size: 14px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color .15s;
}
.footer-nav a:hover { color: var(--accent); }
.footer-appstore-link {
  color: var(--accent) !important;
  font-weight: 600;
}
.footer-copy {
  font-size: 13px;
  color: var(--text-3);
}

/* ── Sub-page shared styles ───────────────────────────────────────────────── */
.page-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-block: 60px 48px;
}
.page-hero-inner {
  width: min(var(--max-w), 100% - 48px);
  margin-inline: auto;
}
.page-hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}
.page-hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.page-hero p {
  font-size: 17px;
  color: var(--text-2);
  max-width: 560px;
}
.page-content {
  width: min(var(--max-w), 100% - 48px);
  margin-inline: auto;
  padding-block: 56px;
}
.prose { max-width: 680px; }
.prose h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-top: 40px;
  margin-bottom: 12px;
}
.prose h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 8px;
}
.prose p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-2);
  margin-bottom: 16px;
}
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }
.lang-section { margin-bottom: 48px; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-screenshot { order: -1; }
  .screenshot-frame { max-width: 340px; }
  .ss-overlay { display: none; }

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

  .section-inner.two-col {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .privacy-inner { flex-direction: column; gap: 24px; }
}

@media (max-width: 600px) {
  :root { --nav-h: 56px; }

  .section-wrap { padding-block: 48px; }
  .hero { padding-block: 40px 32px; }
  .hero-headline { font-size: 28px; }
  .hero-sub { font-size: 16px; }
  .btn-appstore { font-size: 14px; padding: 11px 16px; gap: 8px; }
  .appstore-icon { width: 18px; height: 18px; }
  .screenshot-frame { max-width: 260px; }

  .feat-grid { grid-template-columns: 1fr; }
  .ss-gallery { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* All containers use consistent padding on mobile */
  .navbar-inner,
  .section-inner,
  .hero-inner,
  .footer-inner,
  .page-hero-inner,
  .page-content { width: 100%; padding-inline: 16px; }

  /* Don't let prose overflow on mobile */
  .prose { max-width: 100%; }

  /* Nav: hide text links on very small screens to save space */
  .nav-links a { padding: 6px 8px; font-size: 13px; }

  .lang-select { width: 80px; font-size: 12px; padding: 4px 22px 4px 6px; }

  /* Pricing inner max-width reset */
  .pricing-inner { max-width: 100%; }
}

@media (max-width: 430px) {
  /* Fine-tune for iPhone standard widths (390px, 414px, 430px) */
  .hero-headline { font-size: 26px; }
  .hero-eyebrow { font-size: 11px; }

  /* Hide nav text links, keep only lang selector to save space */
  .nav-links { display: none; }
  .navbar-inner { gap: 8px; }

  .ss-gallery { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr; }

  .section-wrap { padding-block: 40px; }
  .section-inner.two-col { gap: 6px; }
}

@media (max-width: 390px) {
  /* Absolute minimum — 390px iPhone SE/14 Pro width */
  .hero-headline { font-size: 24px; }
  .btn-appstore { font-size: 13px; padding: 10px 14px; }
}
