/* RitePDF site — clean, document-inspired */
:root {
  --bg: #faf9f6;
  --bg-card: #ffffff;
  --text: #1a1a1c;
  --text-muted: #5c5c64;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e8e6e1;
  --radius: 12px;
  --radius-lg: 20px;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --space: 1.25rem;
  --container: min(90vw, 720px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --bg-card: #1c1c1e;
    --text: #f2f2f4;
    --text-muted: #9898a0;
    --border: #2c2c30;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space);
  padding-right: var(--space);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 246, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(18, 18, 20, 0.85);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.125rem;
}

.logo-icon {
  color: var(--accent);
  font-size: 1.25rem;
}

img.logo-icon {
  display: block;
  height: 1.25rem;
  width: auto;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

@media (max-width: 640px) {
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: var(--space);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav a:last-child {
    border-bottom: none;
  }

  .menu-toggle {
    display: flex;
  }
}

/* Hero */
.hero {
  position: relative;
  padding: 4rem 0 5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(37, 99, 235, 0.06), transparent);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--text);
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 32ch;
  margin: 0 auto 2rem;
}

.hero-cta {
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.05s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-large {
  padding: 1rem 1.75rem;
  font-size: 1.0625rem;
}

.btn-icon {
  font-size: 1.25em;
}

.btn-icon img,
img.btn-icon {
  height: 1.25em;
  width: auto;
  vertical-align: -0.3em;
}

.btn-appstore {
  padding: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-appstore img {
  height: 2.5rem;
  width: auto;
  display: block;
}

.btn-appstore.btn-large img {
  height: 3rem;
}

.device-pill {
  display: inline-block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin: 0 0.25rem;
  border: 1px solid var(--border);
}

/* Screenshots */
.screenshots {
  padding: 0 0 4rem;
}

.screenshots-inner {
  max-width: min(92vw, 960px);
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 640px) {
  .screenshot-grid {
    grid-template-columns: 1fr;
  }
}

.screenshot-card {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  .screenshot-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  }
}

.screenshot-card img {
  display: block;
  width: 100%;
  height: auto;
}

.screenshot-card figcaption {
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  border-top: 1px solid var(--border);
}

/* Features */
.features {
  padding: 4rem 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  text-align: center;
  margin: 0 0 0.5rem;
}

.section-lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 42ch;
  margin: 0 auto 2.5rem;
}

.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.feature-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border-color: rgba(37, 99, 235, 0.2);
}

@media (prefers-color-scheme: dark) {
  .feature-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

.feature-icon {
  display: block;
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

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

.feature-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

/* Native */
.native {
  padding: 3rem 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.native-inner {
  text-align: center;
}

.native .section-title {
  margin-bottom: 0.75rem;
}

.native-text {
  color: var(--text-muted);
  max-width: 48ch;
  margin: 0 auto;
  font-size: 0.9375rem;
}

/* CTA */
.cta {
  padding: 4rem 0;
}

.cta-inner {
  text-align: center;
}

.cta-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.cta-lead {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.support-blurb {
  margin: 1.25rem 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.support-blurb a {
  color: var(--accent);
  text-decoration: none;
}

.support-blurb a:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
}

.footer-brand .logo-icon {
  color: var(--accent);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-copy {
  width: 100%;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-copy a {
  color: inherit;
  text-decoration: none;
}

.footer-copy a:hover {
  color: var(--accent);
}

@media (min-width: 520px) {
  .footer-copy {
    width: auto;
  }
}

/* Support & Privacy pages */
.page {
  padding: 3rem 0 4rem;
  min-height: 60vh;
}

.page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 1rem;
}

.page p {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.page a {
  color: var(--accent);
  text-decoration: none;
}

.page a:hover {
  text-decoration: underline;
}

.page ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

/* Apple Standard EULA embed (terms.html) */
.eula-embed-wrap {
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.eula-embed-wrap iframe {
  display: block;
  width: 100%;
  height: min(75vh, 900px);
  min-height: 420px;
  border: 0;
}
