/* ==========================================================================
   Wormi | wormi.app
   Warm, bookish, a little playful. Mobile-first.
   ========================================================================== */

:root {
  --paper: #faf5ec;
  --paper-deep: #f3ecdd;
  --card: #fffdf8;
  --ink: #2e2a24;
  --ink-soft: #5f574b;
  --ink-faint: #8a8072;
  --worm: #5f9e5c;
  --worm-deep: #468044;
  --accent: #c96f4a;
  --accent-deep: #b25a37;
  --line: #e5dcc9;
  --shadow: 0 2px 6px rgba(60, 48, 30, 0.06), 0 12px 32px rgba(60, 48, 30, 0.08);
  --radius: 16px;
  --max: 62rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); margin: 0 0 0.6em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 2.2em 0 0.6em; }
h3 { font-size: 1.2rem; margin: 1.8em 0 0.5em; }

p { margin: 0 0 1em; }

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

img, svg { max-width: 100%; height: auto; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.35rem;
  text-decoration: none;
  color: var(--ink);
}

.brand img { width: 34px; height: 34px; flex: none; border-radius: 8px; }

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-nav a:hover { color: var(--accent-deep); }

@media (max-width: 480px) {
  .site-nav { gap: 0.9rem; font-size: 0.9rem; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: 4rem 0 3.5rem;
  text-align: center;
  background:
    radial-gradient(60rem 30rem at 50% -10rem, var(--paper-deep), transparent);
}

.hero .app-icon { width: 88px; height: 88px; margin-bottom: 1.25rem; }

.hero-screenshot {
  margin: 3rem auto 0;
  width: min(300px, 78vw);
}

.hero-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 42px;
  box-shadow: var(--shadow);
}

.hero .tagline {
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 auto 2rem;
}

.badge-appstore {
  display: inline-block;
  transition: transform 0.15s ease;
}

.badge-appstore:hover { transform: translateY(-2px); }

.badge-appstore img { height: 54px; width: auto; }

.hero-note {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

/* Phone mockup (legacy class kept for compatibility) */

.phone {
  margin: 3rem auto 0;
  width: min(300px, 78vw);
}

.phone img,
.phone svg { display: block; width: 100%; height: auto; }

.phone img {
  border-radius: 42px;
  box-shadow: var(--shadow);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section { padding: 3.5rem 0; }

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

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--worm-deep);
  margin-bottom: 0.4rem;
}

.section h2 { margin-top: 0; }

.section-lede {
  color: var(--ink-soft);
  max-width: 38rem;
  margin-bottom: 2rem;
}

/* How it works */

.steps {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  counter-reset: step;
  padding: 0;
  margin: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--worm);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.steps h3 { margin: 0 0 0.35rem; }
.steps p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* Features */

.features {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  padding: 0;
  margin: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}

.features li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
}

.features h3 { margin: 0 0 0.3rem; font-size: 1.1rem; }
.features p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }

/* --------------------------------------------------------------------------
   Pricing
   -------------------------------------------------------------------------- */

.plans {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  align-items: stretch;
}

@media (min-width: 720px) {
  .plans { grid-template-columns: repeat(2, 1fr); }
}

.plan {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.plan.featured { border: 2px solid var(--worm); position: relative; }

.plan-flag {
  position: absolute;
  top: -0.8rem;
  left: 1.5rem;
  background: var(--worm);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

.plan h3 { margin: 0 0 0.15rem; font-size: 1.45rem; }

.plan .price {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.plan .price strong { color: var(--ink); font-size: 1.35rem; }

.plan .save {
  display: inline-block;
  background: var(--paper-deep);
  color: var(--worm-deep);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.plan ul {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  flex: 1;
}

.plan ul li {
  padding: 0.4rem 0 0.4rem 1.7rem;
  position: relative;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.plan ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--worm) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="none" stroke="white" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" d="M3.5 8.5l3 3 6-6"/></svg>') center / 70% no-repeat;
}

.plan .trust {
  font-size: 0.88rem;
  color: var(--ink-faint);
  margin: 0;
}

.pricing-note {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--ink-faint);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Story
   -------------------------------------------------------------------------- */

.story {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto;
}

.story blockquote {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.25rem, 3.5vw, 1.6rem);
  font-style: italic;
  color: var(--ink);
  margin: 0 0 1.5rem;
}

.story .coming {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* --------------------------------------------------------------------------
   Prose pages (privacy, terms, support, delete-account)
   -------------------------------------------------------------------------- */

.prose {
  max-width: 44rem;
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.prose .updated {
  color: var(--ink-faint);
  font-size: 0.9rem;
  margin-top: -0.5rem;
  margin-bottom: 2rem;
}

.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.4rem; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  margin: 1.25rem 0 1.75rem;
}

.prose th, .prose td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.prose th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.prose .callout {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  margin: 1.5rem 0;
}

.prose .callout p:last-child { margin-bottom: 0; }

@media (max-width: 560px) {
  .prose table { display: block; overflow-x: auto; }
}

/* FAQ */

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 1rem 1.25rem;
  list-style: none;
  position: relative;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--worm-deep);
  font-size: 1.3rem;
  font-weight: 400;
}

.faq details[open] summary::after { content: "–"; }

.faq details > div {
  padding: 0 1.25rem 1.1rem;
  color: var(--ink-soft);
}

.faq details > div p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
  padding: 2.5rem 0 2.75rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.site-footer .footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
}

.footer-links a { color: var(--ink-soft); }

.site-footer .badge-appstore img { height: 44px; }

.footer-legal {
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.footer-legal p { margin: 0.25rem 0; }
