/* ============================================
   Pokepiaf Marketing Website — styles.css
   Colors extracted from ColorTheme.swift
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --green: #40A673;
  --green-bright: #1A7A47;
  --green-dark: #145C36;
  --green-light: #E8F5EE;
  --bg: #F5F7F2;
  --bg-alt: #EEF1EB;
  --surface: #FFFFFF;
  --text-primary: #1A261F;
  --text-secondary: #4D6154;
  --text-muted: #809487;
  --separator: #D1DBD4;
  --card-stroke: #C7D6CC;
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 1080px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Prevent mobile browser bottom bar from covering content */
  padding-bottom: env(safe-area-inset-bottom, 0);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-bright); text-decoration: none; transition: color .2s; }
a:hover { color: var(--green-dark); }

/* --- Utility --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* --- Header / Nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 247, 242, .85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--separator);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
}

.nav-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: .95rem;
  font-weight: 500;
  transition: color .2s;
}

.nav-links a:hover { color: var(--green-bright); }

.nav-divider {
  width: 1px;
  height: 16px;
  background: var(--separator);
  align-self: center;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

/* --- Hero --- */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  box-shadow: 0 8px 30px rgba(64, 166, 115, .18);
  margin: 0 auto 32px;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero h1 .accent { color: var(--green); }

.hero-subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 36px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--text-primary);
  color: #fff;
  padding: 14px 28px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  transition: transform .2s, box-shadow .2s;
}

.hero-cta:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 38, 31, .2);
}

.hero-cta svg { width: 24px; height: 24px; }

/* --- Section shared --- */
.section {
  padding: 80px 0;
}

.section-alt { background: var(--surface); }

.section-title {
  text-align: center;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-lead {
  text-align: center;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 48px;
  font-size: 1.05rem;
}

/* --- Features grid --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform .2s, box-shadow .2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(64, 166, 115, .1);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
  display: block;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

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

/* --- How It Works --- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  counter-reset: step;
}

.step {
  text-align: center;
  position: relative;
}

.step-number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step p {
  color: var(--text-secondary);
  font-size: .93rem;
}

/* --- Screenshots --- */
.screenshots-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 24px;
}

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

.screenshot-item {
  flex: 0 0 260px;
  scroll-snap-align: center;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  background: var(--bg-alt);
  position: relative;
}

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

.screenshot-caption {
  display: block;
  text-align: center;
  padding: 10px 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
}

/* --- Footer --- */
.site-footer {
  background: var(--text-primary);
  color: rgba(255,255,255,.7);
  padding: 48px 0 calc(32px + env(safe-area-inset-bottom, 0px));
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.footer-brand span {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

.footer-desc {
  font-size: .9rem;
  line-height: 1.6;
  max-width: 320px;
}

.footer-heading {
  color: #fff;
  font-weight: 600;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: rgba(255,255,255,.65);
  font-size: .9rem;
  transition: color .2s;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
  color: rgba(255,255,255,.45);
}

/* --- Support / Privacy pages --- */
.page-header {
  padding: 48px 0 32px;
  text-align: center;
  border-bottom: 1px solid var(--separator);
}

.page-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.page-header p { color: var(--text-secondary); }

.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 100px;
}

.page-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 40px 0 12px;
  color: var(--text-primary);
}

.page-content h2:first-child { margin-top: 0; }

.page-content p, .page-content li {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.page-content ul, .page-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.page-content a { text-decoration: underline; text-underline-offset: 2px; }

/* FAQ accordion */
.faq-item {
  border-bottom: 1px solid var(--separator);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 20px 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font);
}

.faq-question::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-muted);
  transition: transform .3s;
}

.faq-item.open .faq-question::after {
  content: "-";
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}

.faq-answer-inner {
  padding: 0 0 20px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  max-height: 400px;
}

/* Contact card */
.contact-card {
  background: var(--green-light);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin: 32px 0;
}

.contact-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.contact-card a {
  color: var(--green-bright);
  font-weight: 600;
}

/* --- Mobile nav --- */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-links {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: #F5F7F2 !important;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    align-items: center;
    -webkit-box-pack: center;
    justify-content: center;
    gap: 28px;
    z-index: 9999 !important;
    padding: 24px;
    visibility: hidden;
    pointer-events: none;
  }

  .nav-links.open {
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .nav-links a { font-size: 1.3rem; }
  .nav-divider { width: 40px; height: 1px; }

  .hero { padding: 48px 0 40px; }
  .hero-icon { width: 96px; height: 96px; border-radius: 22px; }

  .section { padding: 56px 0; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .screenshot-item { flex: 0 0 200px; }

  .site-footer { padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)); }
  .page-content { padding-bottom: 120px; }
}

@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
}
