/* ==========================================================================
   Kinpost — kinpostapp.com landing page
   Palette + shape tokens mirror the iOS app's DesignSystem (KinpostPalette.swift)
   ========================================================================== */

:root {
  /* App palette (verbatim from KinpostPalette.swift) */
  --page: #F2F0ED;            /* warmBackground */
  --card: #FFF9E6;             /* cardSurface */
  --olive: #A3AA90;           /* mutedOlive */
  --slate: #9DB2BF;           /* softSlate */
  --olive-deep: #7E8A68;      /* deepOlive */
  --olive-press: #67724F;     /* deepOlive, darkened for AA text contrast */
  --ink: #23211C;
  --ink-soft: #6B6560;        /* inkSecondary */
  --charcoal: #1A1A1A;        /* settingsBackground */
  --charcoal-card: #262626;   /* settingsCard */
  --charcoal-line: rgba(255, 255, 255, 0.08); /* settingsCardBorder */

  /* Derived */
  --chip-olive-ink: #525A45;
  --chip-slate-ink: #44606F;
  --on-dark-soft: rgba(255, 255, 255, 0.62);
  --on-dark-faint: rgba(255, 255, 255, 0.5);

  /* App shape tokens (KinpostRadius / KinpostSpacing) */
  --r-small: 10px;
  --r-medium: 16px;
  --r-large: 24px;

  /* Shadows (soft, warm — shadows over borders) */
  --shadow-border:
    0 0 0 1px rgba(35, 33, 28, 0.06),
    0 1px 2px -1px rgba(35, 33, 28, 0.05),
    0 2px 6px 0 rgba(35, 33, 28, 0.04);
  --shadow-lift:
    0 0 0 1px rgba(35, 33, 28, 0.05),
    0 2px 4px -1px rgba(35, 33, 28, 0.06),
    0 10px 28px -4px rgba(35, 33, 28, 0.12);
  --shadow-stamp:
    0 1px 2px rgba(35, 33, 28, 0.07),
    0 12px 32px -6px rgba(35, 33, 28, 0.18),
    0 24px 56px -12px rgba(35, 33, 28, 0.14);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --stage-scale: 1;
}

/* ---------- Base ---------- */

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Paper grain — barely-there film over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.032;
  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' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 { text-wrap: balance; margin: 0; }
p { text-wrap: pretty; margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

img, svg { display: block; }

::selection { background: rgba(163, 170, 144, 0.38); }

:focus-visible {
  outline: 2px solid var(--olive-deep);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 200;
  background: var(--ink);
  color: var(--page);
  padding: 10px 18px;
  border-radius: var(--r-small);
  font-weight: 700;
}
.skip-link:focus { left: 12px; }

section { scroll-margin-top: 84px; }

.section-inner {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 20px;
}
.section-inner-narrow { max-width: 780px; }

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.section-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--olive-deep);
  box-shadow: 0 0 0 3px rgba(126, 138, 104, 0.22);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 480;
  font-size: clamp(1.9rem, 4.4vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.section-title em, .story-quote em, .closing-title em, .hero-title em {
  font-style: italic;
  color: var(--olive-deep);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: scale 150ms ease-out, box-shadow 200ms ease-out, background-color 200ms ease-out;
}
.btn:active { scale: 0.97; }

.btn-primary {
  background: var(--olive-press);
  color: #FFFFFF;
  border-radius: var(--r-small);
  box-shadow: 0 1px 2px rgba(35, 33, 28, 0.18), 0 6px 16px -6px rgba(103, 114, 79, 0.55);
}
.btn-primary:hover {
  background: #5B6647;
  box-shadow: 0 2px 3px rgba(35, 33, 28, 0.16), 0 10px 22px -6px rgba(103, 114, 79, 0.6);
}
.btn-hero { height: 52px; padding-inline: 30px; font-size: 16px; }

/* ---------- Nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(242, 240, 237, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 0 1px rgba(35, 33, 28, 0.05), 0 1px 2px rgba(35, 33, 28, 0.04);
}

.nav-inner {
  max-width: 1080px;
  margin-inline: auto;
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
  padding: 4px;
  border-radius: var(--r-small);
}
.brand-mark { width: 34px; height: 34px; box-shadow: var(--shadow-border); border-radius: 10px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 21px;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  gap: 26px;
}
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 2px;
  border-radius: 6px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 calc(100% - 2px);
  transition: background-size 200ms ease-out;
}
.nav-links a:hover { background-size: 100% 1.5px; }

.btn-nav { height: 44px; padding-inline: 22px; font-size: 15px; }

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

.hero {
  position: relative;
  overflow: clip;
  background:
    radial-gradient(56% 42% at 88% 6%, rgba(157, 178, 191, 0.16), transparent 70%),
    radial-gradient(48% 40% at 8% 2%, rgba(255, 249, 230, 0.95), transparent 60%),
    var(--page);
}

.hero-inner {
  max-width: 1080px;
  margin-inline: auto;
  padding: 56px 20px 72px;
  display: grid;
  gap: 28px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--olive-deep);
  box-shadow: 0 0 0 3px rgba(126, 138, 104, 0.22);
}

.hero-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 520;
  font-size: clamp(2.5rem, 8vw, 4.05rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  max-width: 13ch;
  margin-bottom: 22px;
}

.hero-sub {
  font-size: clamp(1.05rem, 2.4vw, 1.19rem);
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 30px;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 8px 20px 8px 16px;
  background: var(--ink);
  color: #FFFDF7;
  border-radius: var(--r-small);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(35, 33, 28, 0.2), 0 8px 20px -8px rgba(35, 33, 28, 0.4);
  transition: scale 150ms ease-out, box-shadow 200ms ease-out;
}
.store-badge:active { scale: 0.97; }
.store-badge:hover { box-shadow: 0 2px 3px rgba(35, 33, 28, 0.2), 0 12px 26px -8px rgba(35, 33, 28, 0.45); }
.badge-icon { width: 22px; height: 22px; }
.badge-text { display: flex; flex-direction: column; line-height: 1.15; }
.badge-eyebrow { font-size: 10.5px; font-weight: 500; letter-spacing: 0.04em; opacity: 0.78; }
.badge-name { font-size: 16.5px; font-weight: 700; }

.hero-note {
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-note::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--slate);
}

/* --- Hero visual: postmark --- */

.hero-visual {
  display: flex;
  justify-content: center;
  height: calc(470px * var(--stage-scale));
}

.hero-stage {
  position: relative;
  width: min(500px, 100%);
  height: 470px;
  transform: scale(var(--stage-scale));
  transform-origin: top center;
}

.postmark {
  position: absolute;
  left: 50%;
  top: 44%;
  translate: -50% -50%;
  width: min(400px, 92%);
  height: auto;
  aspect-ratio: 1;
  color: var(--olive);
  opacity: 0.5;
  animation: postmark-spin 100s linear infinite;
}
@keyframes postmark-spin { to { rotate: 360deg; } }
.postmark text {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.34em;
  fill: currentColor;
}
.postmark-k {
  font-family: var(--font-display) !important;
  font-size: 58px !important;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0 !important;
}

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

.story { padding: 88px 0 96px; }

.story-quote {
  font-family: var(--font-display);
  font-weight: 480;
  font-size: clamp(1.85rem, 5.4vw, 3.1rem);
  line-height: 1.14;
  letter-spacing: -0.012em;
  max-width: 21ch;
  margin-bottom: 42px;
}

.story-body {
  display: grid;
  gap: 28px;
}
.story-col p { font-size: 1.06rem; color: var(--ink-soft); }
.story-col p:first-child { color: var(--ink); }
.story-promise strong {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 550;
  font-size: 1.14em;
  color: var(--ink);
}

/* Perforation divider */
.perforation {
  height: 2px;
  max-width: 1080px;
  margin: 0 auto;
  background-image: repeating-linear-gradient(90deg, rgba(163, 170, 144, 0.55) 0 10px, transparent 10px 22px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

/* ---------- How it works ---------- */

.how { padding: 92px 0 96px; }

.steps {
  display: grid;
  gap: 20px;
  margin-top: 40px;
}

.step-card {
  background: var(--card);
  border-radius: var(--r-medium);
  padding: 26px 26px 28px;
  box-shadow: var(--shadow-border);
  transition: translate 220ms ease-out, box-shadow 220ms ease-out;
}
.step-card:hover {
  translate: 0 -5px;
  box-shadow: var(--shadow-lift);
}

.step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.step-num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 19px;
  color: var(--olive-deep);
  letter-spacing: 0.02em;
}
.step-icon { width: 44px; height: 44px; color: var(--slate); }

.step-title {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.55rem;
  margin-bottom: 10px;
}
.step-copy { color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- FAQ ---------- */

.faq { padding: 92px 0 100px; }

.faq-list {
  display: grid;
  gap: 14px;
  margin-top: 40px;
}

.faq-item {
  background: #FFFFFF;
  border-radius: var(--r-medium);
  box-shadow: var(--shadow-border);
  overflow: hidden;
}

.faq-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  min-height: 56px;
  padding: 18px 22px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  transition: background-color 180ms ease-out;
}
.faq-trigger:hover { background: rgba(255, 249, 230, 0.65); }
.faq-trigger:focus-visible { outline-offset: -3px; }

.faq-plus {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(163, 170, 144, 0.18);
}
.faq-plus-v, .faq-plus-h {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--olive-press);
  translate: -50% -50%;
  transition: scale 260ms cubic-bezier(0.2, 0, 0, 1), rotate 260ms cubic-bezier(0.2, 0, 0, 1);
}
.faq-plus-v { rotate: 90deg; }
.faq-item.open .faq-plus-v { scale: 0 1; }
.faq-item.open .faq-plus { background: var(--olive-press); }
.faq-item.open .faq-plus-h { background: #FFFFFF; }
.faq-item.open .faq-plus-v { background: #FFFFFF; }

.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms cubic-bezier(0.2, 0, 0, 1);
}
.faq-item.open .faq-panel { grid-template-rows: 1fr; }
.faq-panel-inner { overflow: hidden; }
.faq-panel-inner p {
  padding: 2px 22px 22px;
  color: var(--ink-soft);
  font-size: 0.99rem;
}
.faq-panel-inner strong { color: var(--ink); }

/* ---------- Closing CTA ---------- */

.closing {
  padding: 96px 0 110px;
  text-align: center;
  background:
    radial-gradient(46% 60% at 50% 100%, rgba(255, 249, 230, 0.9), transparent 70%),
    var(--page);
}
.closing-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 26px;
  box-shadow: var(--shadow-lift);
  border-radius: 16px;
  rotate: -6deg;
}
.closing-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.95rem, 5vw, 3rem);
  line-height: 1.12;
  max-width: 20ch;
  margin: 0 auto 14px;
}
.closing-sub {
  color: var(--ink-soft);
  font-size: 1.08rem;
  margin-bottom: 34px;
}

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

.site-footer {
  background: var(--charcoal);
  color: #FFFFFF;
  padding: 56px 0 36px;
}

.footer-inner {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 20px;
  display: grid;
  gap: 30px;
}

.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-name {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.7rem;
}
.footer-tag { color: var(--on-dark-soft); font-size: 0.97rem; max-width: 40ch; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 26px;
  align-content: start;
}
.footer-links a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 2px;
  border-radius: 6px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 calc(100% - 2px);
  transition: background-size 200ms ease-out, color 200ms ease-out;
}
.footer-links a:hover { background-size: 100% 1.5px; color: #FFFFFF; }

.footer-legal {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--charcoal-line);
  flex-direction: column;
  gap: 4px;
  align-items: start;
}
.footer-legal p { margin: 0; font-size: 13px; color: var(--on-dark-faint); }
.footer-made { font-family: var(--font-display); font-style: italic; font-size: 13.5px; }

/* ---------- Desktop ---------- */

@media (min-width: 760px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
    gap: 40px;
    padding-top: 72px;
    padding-bottom: 96px;
  }
  .hero-cta { align-items: flex-start; }
  .hero-note { margin-top: 24px; }

  .story-body { grid-template-columns: 1fr 1fr; gap: 44px; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .footer-inner { grid-template-columns: 1fr auto; align-items: start; }
  .footer-legal { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; }
}

/* ---------- Small phones ---------- */

@media (max-width: 759px) {
  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 22px;
    padding-bottom: 6px;
  }
  :root { --stage-scale: 0.7; }
}

@media (max-width: 460px) {
  :root { --stage-scale: 0.62; }
  .hero-cta { align-items: stretch; }
  .btn-hero { width: 100%; }
  .store-badges { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .store-badge { justify-content: center; padding-inline: 10px; min-height: 48px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .postmark { animation: none; }
  .step-card, .btn, .store-badge { transition: none; }
}
/* ---------- Pricing ---------- */

.pricing { padding: 92px 0 96px; }

.pricing-sub {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 52ch;
}

.plan-grid {
  display: grid;
  gap: 20px;
  margin-top: 42px;
}

.plan-card {
  border-radius: var(--r-large);
  padding: 30px 28px 28px;
  box-shadow: var(--shadow-border);
}

.plan-free {
  background: var(--card);
  outline: 1px dashed rgba(163, 170, 144, 0.55);
  outline-offset: -10px;
}

.plan-plus {
  background: var(--charcoal);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 14px 34px -14px rgba(26, 26, 26, 0.5);
}

.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.plan-name {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.35rem;
  margin: 0;
}
.plan-plus .plan-name { color: #FFFFFF; }

.plan-price {
  font-family: var(--font-display);
  font-weight: 540;
  font-size: clamp(2.4rem, 6vw, 3.1rem);
  line-height: 1;
  margin: 0 0 8px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.plan-plus .plan-price { color: #FFF9E6; }

.plan-per {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-left: 7px;
}
.plan-plus .plan-per { color: var(--on-dark-soft); }

.plan-allowance {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--olive-press);
  margin: 0 0 22px;
}
.plan-plus .plan-allowance { color: var(--olive); }

.plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.plan-features li {
  position: relative;
  padding-left: 26px;
  color: var(--ink-soft);
  font-size: 0.96rem;
}
.plan-features li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--olive);
  box-shadow: 0 0 0 2.5px rgba(163, 170, 144, 0.22);
}
.plan-plus .plan-features li { color: var(--on-dark-soft); }

.plan-when {
  margin: 24px 0 0;
  padding-top: 15px;
  border-top: 1px dashed rgba(163, 170, 144, 0.5);
  font-size: 13.5px;
  color: var(--ink-soft);
}
.plan-plus .plan-when {
  border-top-color: rgba(255, 255, 255, 0.14);
  color: var(--on-dark-faint);
}

.pricing-note {
  margin-top: 28px;
  font-size: 13.5px;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- Legal pages ---------- */

.legal { padding: 56px 0 96px; }

.legal-lead {
  font-size: 1.02rem;
  color: var(--ink);
  max-width: 56ch;
  margin-bottom: 30px;
}

.legal-updated {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 38px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--card);
  padding: 7px 15px;
  border-radius: 999px;
  box-shadow: var(--shadow-border);
}
.legal-updated::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--olive-deep);
}

.legal-body h3 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.32rem;
  margin: 42px 0 12px;
  scroll-margin-top: 96px;
}
.legal-body h3:first-child { margin-top: 0; }

.legal-body p {
  color: var(--ink-soft);
  font-size: 0.99rem;
  margin: 0 0 12px;
}

.legal-body ul {
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}
.legal-body li {
  position: relative;
  padding-left: 24px;
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.legal-body li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--olive);
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 44px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 200ms ease-out;
}
.legal-back:hover { color: var(--ink); }
