/*
  Klypt site v2 — shared stylesheet
  Brand: docs/brand/03_COLORS.md + 04_TYPOGRAPHY.md + 06_SPACING.md
  Voice: calm vault keeper (KLYPT_BRAND_GUIDE.md §1.3)
  Authored by Klypt CMO Review 2026-05-25.
*/

/* ----- TOKENS ----- */
:root {
  --cream: #FBF9F6;
  --cream-soft: #F5F1EA;
  --deep: #3D4A47;
  --deep-soft: #4A5754;
  --stone: #6B6258;
  --stone-soft: #8B8278;
  --terracotta: #D4785C;
  --terracotta-dark: #B5614A;
  --terracotta-soft: #F2D6C9;
  --sage: #9CAF88;
  --sage-soft: #D8E0CD;
  --moss: #6E8B5A;
  --border: #E8E2D8;
  --card: #FFFFFF;
  --amber: #C97B3A;

  --r-card: 16px;
  --r-pill: 999px;
  --r-button: 8px;
  --r-icon: 12px;

  --shadow-soft: 0 1px 2px rgba(61, 74, 71, 0.04);
  --shadow-card: 0 4px 16px rgba(61, 74, 71, 0.08);
  --shadow-lift: 0 8px 24px rgba(61, 74, 71, 0.12);
  --shadow-accent: 0 8px 24px rgba(212, 120, 92, 0.18);

  --t-fast: 180ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-med: 320ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 520ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- RESET ----- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--cream);
  color: var(--deep);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--terracotta); font-weight: 600; text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--terracotta-dark); text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ----- HEADER ----- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 249, 246, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--deep);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
  transition: transform var(--t-fast);
}
.brand:hover { text-decoration: none; transform: translateY(-1px); }
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  transition: transform var(--t-med);
}
.brand:hover img { transform: rotate(-4deg); }
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav-links a {
  color: var(--stone);
  font-weight: 500;
  font-size: 15px;
  position: relative;
}
.nav-links a:hover { color: var(--deep); text-decoration: none; }
.nav-links a.current { color: var(--deep); }
.nav-links a.current::after {
  content: "";
  position: absolute;
  bottom: -18px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--terracotta);
}
.nav-cta {
  background: var(--terracotta);
  color: var(--cream) !important;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 14px;
  transition: background var(--t-fast), transform var(--t-fast);
}
.nav-cta:hover { background: var(--terracotta-dark); text-decoration: none; transform: translateY(-1px); }
.nav-cta.disabled {
  background: var(--stone-soft);
  pointer-events: none;
  opacity: 0.85;
}
@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ----- SECTIONS ----- */
section {
  padding: 80px 24px;
  border-top: 1px solid var(--border);
}
section:first-of-type { border-top: none; }
.container {
  max-width: 1100px;
  margin: 0 auto;
}
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--terracotta);
  margin: 0 0 12px;
}
h1, h2, h3 {
  color: var(--deep);
  letter-spacing: -0.5px;
}
h1 { font-size: 56px; line-height: 1.08; letter-spacing: -1.5px; font-weight: 700; margin: 0 0 20px; }
h2 { font-size: 36px; line-height: 1.2; letter-spacing: -0.8px; font-weight: 700; margin: 0 0 16px; }
h3 { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.section-lede { font-size: 18px; color: var(--stone); max-width: 640px; margin: 0 0 48px; }
@media (max-width: 600px) {
  section { padding: 56px 20px; }
  h1 { font-size: 38px; }
  h2 { font-size: 28px; }
  .section-lede { font-size: 16px; margin-bottom: 32px; }
}

/* ----- HERO ----- */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 88px 24px 64px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
  border-top: none !important;
}
.hero-text h1 { margin-top: 16px; }
.hero-text .lede {
  font-size: 20px;
  line-height: 1.55;
  color: var(--stone);
  max-width: 560px;
  margin: 0 0 32px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r-button);
  font-weight: 600;
  font-size: 16px;
  border: none;
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn-primary {
  background: var(--terracotta);
  color: var(--cream);
}
.btn-primary:hover {
  background: var(--terracotta-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}
.btn-secondary {
  background: transparent;
  color: var(--deep);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--cream-soft);
  text-decoration: none;
  border-color: var(--stone-soft);
}
.badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--sage-soft);
  color: var(--deep);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-terracotta {
  background: var(--terracotta-soft);
  color: var(--terracotta-dark);
}

/* ----- PHONE SHOWCASE (animated home) ----- */
.phone-showcase {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  aspect-ratio: 9 / 19.5;
}
.phone-frame {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--deep);
  border-radius: 36px;
  padding: 10px;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: var(--cream);
}
.phone-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: phoneCycle 16s infinite;
}
.phone-screen img:nth-child(1) { animation-delay: 0s; }
.phone-screen img:nth-child(2) { animation-delay: 4s; }
.phone-screen img:nth-child(3) { animation-delay: 8s; }
.phone-screen img:nth-child(4) { animation-delay: 12s; }
@keyframes phoneCycle {
  0%, 22% { opacity: 1; }
  25%, 100% { opacity: 0; }
}
.phone-showcase:hover .phone-screen img {
  animation-play-state: paused;
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 56px 20px 32px; }
  .phone-showcase { max-width: 260px; }
}

/* ----- FEATURE CARDS ----- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 28px;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: var(--terracotta-soft);
}
.feature .icon-circle {
  width: 44px;
  height: 44px;
  border-radius: var(--r-icon);
  background: var(--sage-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  font-size: 22px;
}
.feature p { margin: 0; color: var(--stone); font-size: 15px; }

/* Deep feature row — alternating image + text */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}
.feature-row:last-child { border-bottom: none; }
.feature-row.reverse { direction: rtl; }
.feature-row.reverse > * { direction: ltr; }
.feature-row .feature-image {
  background: var(--cream-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
}
.feature-row .feature-image img {
  max-width: 220px;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}
.feature-row .feature-text h3 {
  font-size: 26px;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.feature-row .feature-text p {
  font-size: 16px;
  color: var(--stone);
  margin: 0;
}
.feature-row .feature-text .micro {
  font-size: 13px;
  color: var(--stone-soft);
  margin-top: 14px;
  letter-spacing: 0.3px;
}
@media (max-width: 720px) {
  .feature-row { grid-template-columns: 1fr; gap: 24px; padding: 40px 0; }
  .feature-row.reverse { direction: ltr; }
}

/* ----- PRIVACY BAND ----- */
.privacy-band {
  background: var(--deep);
  color: var(--cream);
}
.privacy-band .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.privacy-band h2 { color: var(--cream); }
.privacy-band .section-lede { color: rgba(251, 249, 246, 0.78); }
.privacy-band .eyebrow { color: var(--sage); }
.privacy-band ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.privacy-band li {
  padding: 14px 0;
  border-top: 1px solid rgba(251, 249, 246, 0.12);
  font-size: 16px;
  color: rgba(251, 249, 246, 0.92);
}
.privacy-band li:last-child {
  border-bottom: 1px solid rgba(251, 249, 246, 0.12);
}
.privacy-band li strong {
  color: var(--cream);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}
.privacy-band a { color: var(--sage); }
.privacy-band a:hover { color: var(--cream); }
@media (max-width: 760px) {
  .privacy-band .container { grid-template-columns: 1fr; gap: 24px; }
}

/* ----- SCREENSHOTS GRID ----- */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.shot {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px 16px 14px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform var(--t-med), box-shadow var(--t-med);
}
.shot:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.shot img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.shot .caption {
  font-size: 13px;
  color: var(--stone);
  margin-top: 10px;
  font-weight: 500;
}
.shot .placeholder {
  aspect-ratio: 9 / 19.5;
  background: var(--cream-soft);
  border-radius: 12px;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stone-soft);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 16px;
}

/* ----- PRICING ----- */
.pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.price-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 32px;
  transition: transform var(--t-med), box-shadow var(--t-med);
}
.price-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.price-card.highlight {
  border-color: var(--terracotta);
  box-shadow: 0 1px 0 var(--terracotta);
}
.price-card.future {
  background: linear-gradient(180deg, var(--cream-soft) 0%, var(--card) 100%);
  border-style: dashed;
  border-color: var(--sage);
}
.price-tier {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 8px;
}
.price-tier.future-tier { color: var(--moss); }
.price-amount {
  font-size: 42px;
  font-weight: 700;
  color: var(--deep);
  letter-spacing: -1px;
  line-height: 1;
}
.price-amount small {
  font-size: 15px;
  color: var(--stone);
  font-weight: 500;
  letter-spacing: 0;
}
.price-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 14px 0 8px;
}
.price-card p { color: var(--stone); font-size: 15px; margin: 0 0 16px; }
.price-card ul { list-style: none; padding: 0; margin: 0; }
.price-card li {
  padding: 8px 0;
  color: var(--deep);
  font-size: 15px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.price-card li::before {
  content: "·";
  color: var(--sage);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
}
@media (max-width: 720px) {
  .pricing { grid-template-columns: 1fr; }
}

/* ----- FAQ ----- */
.faq {
  max-width: 780px;
  margin: 0 auto;
}
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.faq summary {
  font-weight: 600;
  font-size: 17px;
  color: var(--deep);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color var(--t-fast);
}
.faq summary:hover { color: var(--terracotta); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 22px;
  color: var(--terracotta);
  margin-left: 16px;
  font-weight: 400;
  transition: transform var(--t-med);
}
.faq details[open] summary::after { content: "–"; }
.faq details p {
  color: var(--stone);
  font-size: 15px;
  margin: 12px 0 0;
  line-height: 1.65;
}

/* ----- EARLY ACCESS FORM (/cloud) ----- */
.early-access-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  max-width: 540px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
}
.early-access-form .form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.early-access-form input[type="email"] {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-button);
  font-size: 16px;
  font-family: inherit;
  background: var(--cream);
  color: var(--deep);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.early-access-form input[type="email"]:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px var(--terracotta-soft);
}
.early-access-form .form-submit {
  padding: 14px 24px;
  background: var(--terracotta);
  color: var(--cream);
  border: none;
  border-radius: var(--r-button);
  font-size: 16px;
  font-weight: 600;
  transition: background var(--t-fast), transform var(--t-fast);
}
.early-access-form .form-submit:hover {
  background: var(--terracotta-dark);
  transform: translateY(-1px);
}
.early-access-form .form-submit:disabled {
  background: var(--stone-soft);
  cursor: not-allowed;
  transform: none;
}
.early-access-form .micro {
  font-size: 13px;
  color: var(--stone);
  margin: 14px 0 0;
  text-align: center;
}
.early-access-form .form-message {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--r-button);
  font-size: 14px;
  display: none;
}
.early-access-form .form-message.success {
  background: var(--sage-soft);
  color: var(--moss);
  border: 1px solid var(--sage);
  display: block;
}
.early-access-form .form-message.error {
  background: rgba(201, 123, 58, 0.1);
  color: var(--amber);
  border: 1px solid var(--amber);
  display: block;
}
@media (max-width: 540px) {
  .early-access-form .form-row { flex-direction: column; }
  .early-access-form { padding: 24px; }
}

/* ----- INDIE STUDIO STATS STRIP ----- */
.studio-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.studio-stat .number {
  font-size: 42px;
  font-weight: 700;
  color: var(--terracotta);
  letter-spacing: -1px;
  display: block;
  line-height: 1;
}
.studio-stat .label {
  font-size: 13px;
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: 8px;
  display: block;
}
@media (max-width: 720px) {
  .studio-stats { grid-template-columns: repeat(2, 1fr); gap: 20px; padding: 24px; }
  .studio-stat .number { font-size: 32px; }
}

/* ----- PIPELINE STRIP ----- */
.pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.pipeline-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 24px;
  text-align: center;
  transition: transform var(--t-med), border-color var(--t-med);
}
.pipeline-card.current {
  border-color: var(--terracotta);
  background: var(--terracotta-soft);
}
.pipeline-card.shipped {
  border-color: var(--sage);
}
.pipeline-card .order {
  font-size: 12px;
  color: var(--stone-soft);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}
.pipeline-card .name {
  font-size: 20px;
  font-weight: 700;
  color: var(--deep);
  display: block;
  margin-bottom: 4px;
}
.pipeline-card .what {
  font-size: 13px;
  color: var(--stone);
  display: block;
}
.pipeline-card .status {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--cream-soft);
  color: var(--stone);
}
.pipeline-card.current .status { background: var(--terracotta); color: var(--cream); }
.pipeline-card.shipped .status { background: var(--sage); color: var(--cream); }
@media (max-width: 720px) {
  .pipeline { grid-template-columns: repeat(2, 1fr); }
}

/* ----- FOOTER ----- */
footer {
  padding: 48px 24px;
  border-top: 1px solid var(--border);
  background: var(--cream);
  color: var(--stone);
  font-size: 14px;
}
footer .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
footer .links a {
  color: var(--stone);
  font-weight: 500;
  display: inline-block;
  margin-right: 18px;
}
footer .links a:hover { color: var(--deep); text-decoration: none; }
footer .made { font-size: 13px; margin-top: 8px; line-height: 1.5; }
footer .brand img { width: 28px; height: 28px; }
@media (max-width: 600px) {
  footer .container { grid-template-columns: 1fr; }
  footer .links { text-align: left !important; }
  footer .links a { display: inline-block; margin-bottom: 6px; }
}

/* ----- SCROLL-FADE-IN ANIMATION ----- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1), transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
  .phone-screen img { animation: none !important; opacity: 1 !important; }
  .phone-screen img:not(:first-child) { display: none; }
  html { scroll-behavior: auto; }
}

/* ----- UTILITY ----- */
.text-center { text-align: center; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; }
.mb-md { margin-bottom: 16px; }
.muted { color: var(--stone); }
.tiny { font-size: 12px; }

/* ----- COMING SOON HERO (cloud page specific) ----- */
.coming-soon-hero {
  text-align: center;
  padding: 88px 24px 64px;
  max-width: 720px;
  margin: 0 auto;
}
.coming-soon-hero h1 {
  font-size: 48px;
  margin-bottom: 24px;
}
.coming-soon-hero .lede {
  font-size: 20px;
  color: var(--stone);
  line-height: 1.55;
  margin: 0 auto 40px;
  max-width: 580px;
}
@media (max-width: 600px) {
  .coming-soon-hero { padding: 48px 20px; }
  .coming-soon-hero h1 { font-size: 34px; }
  .coming-soon-hero .lede { font-size: 17px; }
}
