/* ── Wrap — getwrapapp.com ─────────────────────────────────────
   Espresso + ink editorial system, mirrored from the iOS app's
   design tokens (WrapColor / WrapFont). Zero external requests. */

:root {
  --surface: #faf9f7;
  --elevated: #ffffff;
  --ink: #16140f;
  --ink-2: #6b675f;
  --hairline: #e6e4de;
  --accent: #4a2f23;
  --accent-ink: #f5efe9;
  --shadow: 0 24px 60px -24px rgba(22, 20, 15, 0.28);
  --serif: "New York", ui-serif, "Iowan Old Style", "Palatino", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Cascadia Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #121110;
    --elevated: #1e1c1a;
    --ink: #f2efe8;
    --ink-2: #a7a299;
    --hairline: #332f2b;
    --accent: #c9a18a;
    --accent-ink: #26160e;
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.65);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; }

/* Grain — barely-there paper texture */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap-col {
  width: min(1080px, calc(100% - 3rem));
  margin: 0 auto;
}

/* ── Type roles ── */
.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.display {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.06;
  text-wrap: balance;
}

.lede { color: var(--ink-2); font-size: 1.1rem; max-width: 34em; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark em { font-style: normal; color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav-links a { text-decoration: none; color: var(--ink-2); transition: color 0.2s; }
.nav-links a:hover { color: var(--ink); }
.nav-links .nav-cta {
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-links .nav-cta:hover { color: var(--accent-ink); transform: translateY(-1px); opacity: 0.92; }

@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ── Hero ── */
.hero {
  position: relative;
  padding: clamp(3.5rem, 9vh, 7rem) 0 clamp(3rem, 8vh, 6rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  margin: 1.1rem 0 1.4rem;
}
.hero h1 .accent { color: var(--accent); font-style: italic; }

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2.2rem;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--ink);
  color: var(--surface);
  text-decoration: none;
  border-radius: 14px;
  padding: 0.7rem 1.3rem;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s;
}
.store-badge:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge .badge-text { line-height: 1.2; }
.store-badge .badge-text small {
  display: block;
  font-size: 0.62rem;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
}
.store-badge .badge-text strong { font-size: 1.02rem; font-weight: 600; }

.hero-scroll-hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.hero-scroll-hint:hover { color: var(--accent); border-color: var(--accent); }

/* Staggered load-in */
.rise { opacity: 0; transform: translateY(18px); animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.18s; }
.rise-3 { animation-delay: 0.32s; }
.rise-4 { animation-delay: 0.46s; }
.rise-5 { animation-delay: 0.6s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ── Phone demo ── */
.phone-stage { position: relative; display: flex; justify-content: center; }
.phone-stage::before {
  content: "WRAP";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(7rem, 16vw, 12rem);
  color: transparent;
  -webkit-text-stroke: 1px var(--hairline);
  letter-spacing: 0.05em;
  z-index: 0;
  white-space: nowrap;
}

.phone {
  position: relative;
  z-index: 1;
  width: min(300px, 78vw);
  aspect-ratio: 9 / 18.5;
  background: var(--elevated);
  border: 1px solid var(--hairline);
  border-radius: 42px;
  box-shadow: var(--shadow);
  padding: 12px;
  transform: rotate(2.5deg);
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 32px;
  background: var(--surface);
  overflow: hidden;
  border: 1px solid var(--hairline);
}

.notch {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 34%; height: 16px;
  background: var(--ink);
  border-radius: 999px;
  opacity: 0.9;
  z-index: 5;
}

/* layer 1 — importing */
.demo-import {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.1rem;
  padding: 1.4rem;
  animation: importPhase 11s infinite;
}
@keyframes importPhase {
  0%, 4% { opacity: 0; transform: translateY(8px); }
  8%, 38% { opacity: 1; transform: none; }
  44%, 100% { opacity: 0; transform: translateY(-10px); }
}

.url-pill {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: var(--elevated);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-status { position: relative; height: 1.2rem; width: 100%; text-align: center; }
.demo-status span {
  position: absolute;
  inset: 0;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0;
}
.demo-status span:nth-child(1) { animation: statusCycle 11s infinite; }
.demo-status span:nth-child(2) { animation: statusCycle 11s 1.35s infinite; }
.demo-status span:nth-child(3) { animation: statusCycle 11s 2.7s infinite; }
@keyframes statusCycle {
  0%, 6% { opacity: 0; transform: translateY(4px); }
  9%, 16% { opacity: 1; transform: none; }
  19%, 100% { opacity: 0; transform: translateY(-4px); }
}

.progress-track {
  width: 70%;
  height: 2px;
  background: var(--hairline);
  border-radius: 2px;
  overflow: hidden;
}
.progress-track i {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  animation: progressFill 11s infinite;
}
@keyframes progressFill {
  0%, 8% { transform: scaleX(0); }
  38% { transform: scaleX(1); }
  100% { transform: scaleX(1); }
}

/* layer 2 — the recipe card */
.demo-recipe {
  position: absolute;
  inset: 0;
  padding: 2.4rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  animation: recipePhase 11s infinite;
}
@keyframes recipePhase {
  0%, 42% { opacity: 0; transform: translateY(22px); }
  50%, 94% { opacity: 1; transform: none; }
  99%, 100% { opacity: 0; transform: translateY(22px); }
}

.demo-recipe h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.15;
  padding-top: 0.4rem;
}
.demo-meta {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.demo-rule { border: 0; border-top: 1px solid var(--hairline); margin: 0.2rem 0; }
.demo-section {
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.demo-ing {
  display: flex;
  align-items: baseline;
  font-size: 0.72rem;
  color: var(--ink);
  gap: 0.4rem;
}
.demo-ing .leader {
  flex: 1;
  border-bottom: 1px dotted var(--hairline);
  transform: translateY(-3px);
}
.demo-ing .qty { font-family: var(--mono); font-size: 0.6rem; color: var(--ink-2); }
.demo-step { display: flex; gap: 0.55rem; font-size: 0.7rem; color: var(--ink-2); line-height: 1.45; }
.demo-step b { font-family: var(--mono); font-size: 0.6rem; color: var(--accent); font-weight: 400; padding-top: 2px; }

/* ── Marquee ── */
.marquee {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  overflow: hidden;
  padding: 0.85rem 0;
  background: var(--elevated);
}
.marquee-track {
  display: flex;
  gap: 2.5rem;
  width: max-content;
  animation: marquee 30s linear infinite;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.marquee-track b { color: var(--accent); font-weight: 400; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── Sections ── */
section.block { padding: clamp(4rem, 10vh, 7.5rem) 0; }

.section-head { margin-bottom: clamp(2.2rem, 5vh, 3.5rem); }
.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  margin-top: 0.9rem;
}
.section-head .lede { margin-top: 0.9rem; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.step {
  background: var(--surface);
  padding: 2.2rem 1.8rem 2.4rem;
  position: relative;
  transition: background 0.3s;
}
.step:hover { background: var(--elevated); }
.step .num {
  font-family: var(--serif);
  font-size: 3.4rem;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
  line-height: 1;
}
.step h3 { font-family: var(--serif); font-size: 1.35rem; margin: 1.1rem 0 0.5rem; }
.step p { color: var(--ink-2); font-size: 0.95rem; }

/* Tiers */
.tiers { display: grid; gap: 1.1rem; }
.tier {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.6rem;
  align-items: baseline;
  background: var(--elevated);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 1.7rem 2rem;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s;
}
.tier:hover { transform: translateX(10px); box-shadow: var(--shadow); }
.tier:nth-child(2) { margin-left: clamp(0rem, 4vw, 3rem); }
.tier:nth-child(3) { margin-left: clamp(0rem, 8vw, 6rem); }
@media (max-width: 640px) { .tier:nth-child(2), .tier:nth-child(3) { margin-left: 0; } }

.tier .tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.tier h3 { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 0.35rem; }
.tier p { color: var(--ink-2); font-size: 0.95rem; }

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
@media (max-width: 860px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

.feature {
  background: var(--elevated);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 1.8rem 1.6rem;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s, border-color 0.3s;
}
.feature:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--ink-2); }
.feature .idx {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  color: var(--accent);
}
.feature h3 { font-family: var(--serif); font-size: 1.22rem; margin: 0.8rem 0 0.45rem; }
.feature p { color: var(--ink-2); font-size: 0.92rem; }

/* Support band */
.support-band {
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 26px;
  padding: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
}
.support-band .kicker { color: var(--accent-ink); opacity: 0.7; }
.support-band h2 { font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0.9rem 0 0.7rem; }
.support-band p { opacity: 0.85; max-width: 36em; margin: 0 auto; }
.support-band .email {
  display: inline-block;
  margin-top: 1.8rem;
  font-family: var(--mono);
  font-size: clamp(0.9rem, 2.4vw, 1.15rem);
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent-ink) 40%, transparent);
  border-radius: 999px;
  padding: 0.85rem 1.7rem;
  transition: background 0.25s, transform 0.25s;
}
.support-band .email:hover {
  background: color-mix(in srgb, var(--accent-ink) 12%, transparent);
  transform: translateY(-2px);
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--hairline);
  padding: 2.6rem 0 3rem;
  margin-top: clamp(3rem, 8vh, 5rem);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 1.6rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.footer-links a { color: var(--ink-2); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--ink); }
.footer-note { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; color: var(--ink-2); }

/* ── Legal / prose pages ── */
.prose-page { padding: clamp(3rem, 8vh, 5rem) 0; }
.prose-page .prose { max-width: 46em; }
.prose h1 { font-family: var(--serif); font-size: clamp(2.1rem, 5vw, 3rem); margin: 0.9rem 0 0.4rem; letter-spacing: -0.015em; line-height: 1.1; }
.prose .updated { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.prose h2 { font-family: var(--serif); font-size: 1.45rem; margin: 2.4rem 0 0.7rem; }
.prose h3 { font-family: var(--serif); font-size: 1.12rem; margin: 1.6rem 0 0.4rem; }
.prose p, .prose li { color: var(--ink-2); font-size: 0.98rem; }
.prose p strong, .prose li strong { color: var(--ink); font-weight: 600; }
.prose ul { padding-left: 1.2rem; margin: 0.6rem 0 1rem; }
.prose li { margin: 0.4rem 0; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 2.2rem 0; }
.prose .callout {
  background: var(--elevated);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  margin: 1.2rem 0;
}

/* FAQ (support page) */
.faq details {
  border-bottom: 1px solid var(--hairline);
  padding: 1.1rem 0;
}
.faq summary {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--accent);
  transition: transform 0.25s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 0.7rem; }

/* ── Motion safety ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .reveal { opacity: 1; transform: none; animation: none; transition: none; }
  .marquee-track { animation: none; }
  .demo-import { animation: none; opacity: 0; }
  .demo-recipe { animation: none; opacity: 1; transform: none; }
  .demo-status span, .progress-track i { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
