/* Mobile-first landing page styles matching app theme with dark mode & accessibility */
:root{
  --app-primary: #f29049;
  --app-secondary: #88ae88;
  --bg: #faf4eb;
  --bg-alt: #ffffff;
  --text: #323232;
  --text-dim: rgba(50,50,50,0.75);
  --radius: 16px;
  --shadow: 0 2px 4px rgba(0,0,0,0.08), 0 6px 18px rgba(0,0,0,0.08);
  --max-width: 1100px;
  --header-height: 70px;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#1c1c1e;
    --bg-alt:#242426;
    --text:#ececec;
    --text-dim:rgba(236,236,236,0.7);
    --shadow: 0 2px 4px rgba(0,0,0,0.6), 0 6px 18px rgba(0,0,0,0.6);
  }
}
*{box-sizing:border-box;-webkit-font-smoothing:antialiased;}
html,body{height:100%;}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
}

/* Layout Utilities */
.container-wide {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(250, 244, 235, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background 0.3s ease;
}
@media (prefers-color-scheme: dark){
  .site-header { 
    background: rgba(28, 28, 30, 0.95);
    border-bottom: 1px solid rgba(255,255,255,0.05); 
  }
}
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.header-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--app-primary);
}
.header-nav {
  display: none;
  gap: 24px;
}
@media (min-width: 768px) {
  .header-nav {
    display: flex;
  }
}
.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.nav-link:hover {
  color: var(--app-primary);
}
.btn-download-small {
  background: var(--app-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}
.btn-download-small:hover {
  transform: scale(1.05);
}

/* Hero Section */
.hero {
  padding: 60px 0;
  overflow: hidden;
}
.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  text-align: center;
}
@media (min-width: 768px) {
  .hero-container {
    flex-direction: row;
    text-align: left;
    align-items: center;
  }
  .hero-content {
    flex: 1;
  }
  .hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
  }
}
.hero-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 10px;
  color: var(--text);
}
.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--app-primary);
  margin-bottom: 20px;
}
.hero-description {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
@media (min-width: 768px) {
  .hero-description { margin-left: 0; }
}

/* Features */
.feature {
  padding: 80px 0;
}
.feature-alt {
  background-color: var(--bg-alt);
}
.feature-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}
@media (min-width: 768px) {
  .feature-container {
    flex-direction: row;
    gap: 60px;
  }
  .feature-container.reverse-mobile {
    flex-direction: row-reverse;
  }
}

.feature-content {
  flex: 1;
}
.feature-image {
  flex: 1;
  display: flex;
  justify-content: center;
  width: 100%;
}
.feature-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.feature-text {
  font-size: 1.1rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Image Placeholders */
.image-placeholder {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 9/19.5; /* Mobile phone ratio */
  background-color: #ddd;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-weight: 600;
  text-align: center;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 4px solid var(--bg-alt);
}
@media (prefers-color-scheme: dark){
  .image-placeholder {
    background-color: #333;
    color: #aaa;
    border-color: #444;
  }
}

/* Responsive image utilities for real screenshots */
.hero-img,
.feature-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15));
}

@media (min-width: 768px) {
  .feature-img,
  .hero-img { 
    max-width: 340px; 
    margin: 0; /* Align left/right in flex containers */
  }
}

/* CTA Section */
.cta-section {
  padding: 100px 0;
  text-align: center;
  background: var(--bg);
}
.cta-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 20px;
}
.cta-text {
  font-size: 1.2rem;
  color: var(--text-dim);
  max-width: 700px;
  margin: 0 auto 30px;
}
.cta-tagline {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--app-primary);
  margin-bottom: 40px;
}

/* Store Badge */
.store-badge-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
@media (min-width: 768px) {
  .hero .store-badge-container {
    justify-content: flex-start;
  }
}
.store-badge img {
  display: block;
  transition: transform .18s ease;
}
.store-badge:hover img {
  transform: translateY(-2px);
}

/* QR Code */
.qr-code-container {
  display: none; /* Hidden by default, shown by JS on non-iOS desktop */
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-alt);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.qr-code-img {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  display: block;
}
.qr-code-text {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
}

/* Footer */
.site-footer {
  background: var(--bg-alt);
  padding: 40px 0;
  border-top: 1px solid rgba(0,0,0,0.05);
}
@media (prefers-color-scheme: dark){
  .site-footer { border-top: 1px solid rgba(255,255,255,0.05); }
}
.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
@media (min-width: 768px) {
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
  }
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
}
.footer-logo {
  width: 32px;
  height: 32px;
}
.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  margin: 0 10px;
  font-size: 0.9rem;
}
.footer-links a:hover {
  color: var(--app-primary);
}
.footer-copy {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* =========================================
   LEGACY STYLES (For Invite Page & Others)
   ========================================= */
.container {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 18px;
  /* Restore centering for legacy pages if they rely on body flex centering. 
     Note: Body flex centering was removed. Legacy pages might need adjustment.
     However, .container margin: 0 auto handles horizontal centering.
     Vertical centering was on body. If invite page needs vertical centering, 
     it might look different now (top aligned). 
     I will add a specific class for vertical centering if needed, but for now let's just restore the card styles.
  */
}

.card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 32px 26px 30px;
  box-shadow: var(--shadow);
  text-align: center;
}
@media (max-width: 560px) {
  .card { padding: 28px 20px 26px; border-radius: 20px; }
}

.logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 0 auto 20px;
  display: block;
}

.title {
  font-size: clamp(1.9rem, 6vw, 2.4rem);
  letter-spacing: -.5px;
  margin: 0 0 6px;
  font-weight: 700;
}

.tagline {
  margin: 0 0 24px;
  color: var(--text-dim);
  font-size: 1.05rem;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 0 0 18px;
  flex-wrap: wrap;
}
.actions.single {
  margin-top: 4px;
  margin-bottom: 10px;
}

.btn {
  display: inline-block;
  padding: 14px 20px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .25px;
  font-size: 0.95rem;
  min-width: 140px;
  text-align: center;
  position: relative;
  transition: background .22s ease, transform .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--app-primary); color: #fff; }
.btn.secondary { background: var(--app-secondary); color: #fff; }
.btn:focus-visible { outline: 3px solid #000; outline-offset: 2px; }
@media (prefers-color-scheme: dark) {
  .btn:focus-visible { outline: 3px solid #fff; }
}

.note {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 4px;
}

.footer {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 12px;
}

.brand {
  color: var(--app-primary);
}

/* iPhone narrow adjustments for legacy card */
@media (max-width: 420px) {
  .actions { flex-direction: column; gap: 10px; }
  .btn { width: 100%; padding: 16px 20px; font-size: 1rem; }
  .card { padding: 26px 18px 24px; }
}

/* =========================================
   QR CODE & iOS DETECTION
   ========================================= */

/* Default: hide both until JS determines device */
.ios-only,
.non-ios-only {
  display: none;
}

/* When JS adds is-ios class to html */
html.is-ios .ios-only {
  display: block;
}
html.is-ios .non-ios-only {
  display: none;
}

/* When JS adds not-ios class to html */
html.not-ios .non-ios-only {
  display: flex;
}
html.not-ios .ios-only {
  display: none;
}

/* QR Code styling */
.qr-code-container {
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.qr-code-img {
  border-radius: 12px;
  display: block;
}

.qr-code-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* CTA: keep QR grouped with store badge like hero on wider screens */
.cta-section .qr-code-container {
  margin: 0; /* avoid auto margins pushing items apart in the flex container */
}

@media (min-width: 768px) {
  .cta-section .store-badge-container {
    justify-content: center; /* center the badge + QR grouping in CTA */
  }
}

/* =========================================
   CONTENT PAGES (Privacy, Changelog, Support)
   ========================================= */

.page-content {
  padding: 40px 0 80px;
  min-height: calc(100vh - var(--header-height) - 200px);
}

.page-header {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--app-primary);
}

.page-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 10px;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin: 0;
}

.page-last-updated {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 10px;
}

/* Prose content styling */
.prose {
  max-width: 800px;
}

.prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

@media (prefers-color-scheme: dark) {
  .prose h2 {
    border-bottom-color: rgba(255,255,255,0.1);
  }
}

.prose h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 32px 0 12px;
}

.prose h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 8px;
}

.prose p {
  color: var(--text-dim);
  line-height: 1.7;
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  color: var(--text-dim);
  line-height: 1.7;
  margin: 0 0 16px;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 8px;
}

.prose a {
  color: var(--app-primary);
  text-decoration: none;
}

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

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

@media (prefers-color-scheme: dark) {
  .prose th,
  .prose td {
    border-bottom-color: rgba(255,255,255,0.1);
  }
}

.prose th {
  font-weight: 600;
  color: var(--text);
  background: var(--bg-alt);
}

.prose td {
  color: var(--text-dim);
}

/* Responsive tables */
@media (max-width: 600px) {
  .prose table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Changelog specific */
.changelog-entry {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

@media (prefers-color-scheme: dark) {
  .changelog-entry {
    border-bottom-color: rgba(255,255,255,0.08);
  }
}

.changelog-entry:last-child {
  border-bottom: none;
}

.changelog-version {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.changelog-version-number {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.changelog-date {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.changelog-entry ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.changelog-entry li {
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
  color: var(--text-dim);
  line-height: 1.6;
}

.changelog-entry li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  width: 6px;
  height: 6px;
  background: var(--app-primary);
  border-radius: 50%;
}

.changelog-feature {
  color: var(--text);
  font-weight: 600;
}

/* Support page specific */
.support-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.support-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.support-card-title svg {
  width: 24px;
  height: 24px;
  fill: var(--app-primary);
}

.support-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--app-primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.1rem;
}

.support-email:hover {
  text-decoration: underline;
}

/* FAQ section */
.faq-item {
  margin-bottom: 20px;
}

.faq-question {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.faq-answer {
  color: var(--text-dim);
  line-height: 1.6;
}

/* Recipe Preview Blur CTA */
.preview-blur-cta {
  position: relative;
}

.preview-blur-cta::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to bottom, transparent 0%, var(--bg-alt) 70%);
  pointer-events: none;
}

.blur-cta-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 30px 20px 20px;
  background: linear-gradient(to bottom, transparent, var(--bg-alt) 30%);
}

.blur-cta-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px;
}

.blur-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--app-primary);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blur-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(242,144,73,0.4);
}

.blur-cta-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

