/* ================================================================
   Kindwall landing page — styles
   ----------------------------------------------------------------
   Structure:
     1. Design tokens (:root variables)  — swap these for new themes
     2. Base / reset
     3. Layout helpers
     4. Buttons
     5. Header
     6. Hero + signature card animation
     7. Sections (problem, how, moat, embed, final CTA)
     8. Note-cards, chips, avatars
     9. Footer
    10. Responsive (mobile-first overrides live inline; desktop in @media)
    11. prefers-reduced-motion
   ================================================================ */

/* ---------------------------------------------------------------- */
/* 1. Design tokens                                                 */
/* ---------------------------------------------------------------- */
:root {
  /* Colors — the only place hues are defined. Alternate themes can be
     added later by re-declaring these variables (e.g. [data-theme="x"]). */
  --color-bg: #faf7f2;          /* warm cream */
  --color-ink: #2b2622;         /* warm near-black */
  --color-ink-soft: #6b615a;    /* muted body text */
  --color-accent: #e8a33d;      /* honey amber */
  --color-accent-ink: #4a3208;  /* text on accent */
  --color-accent-soft: #f6e6c9; /* accent tint */
  --color-surface: #ffffff;     /* card surfaces */
  --color-line: #ece5db;        /* hairline borders */
  --color-verified: #2f6f4f;    /* verified checkmark green */

  /* Typography */
  --font-ui: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-note: "Caveat", "Comic Sans MS", cursive;

  /* Shadows */
  --shadow-card: 0 8px 24px rgba(43, 38, 34, 0.08);
  --shadow-card-lift: 0 18px 40px rgba(43, 38, 34, 0.16);
  --shadow-btn: 0 6px 16px rgba(232, 163, 61, 0.35);

  /* Spacing / sizing */
  --radius: 16px;
  --radius-sm: 10px;
  --measure: 65ch;              /* max readable text width */
  --container: 1120px;

  /* Motion */
  --ease-overshoot: cubic-bezier(0.2, 0.9, 0.3, 1.3);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------------------- */
/* 2. Base / reset                                                  */
/* ---------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-ui);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 800;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- */
/* 3. Layout helpers                                                */
/* ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

/* --- Legal / placeholder pages (Privacy) --- */
.legal {
  padding-block: clamp(3rem, 8vw, 6rem);
}
.legal__inner {
  max-width: 65ch;
}
.legal h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1.25rem;
}
.legal h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}
.legal__lead {
  font-size: 1.1rem;
}
.legal p {
  color: var(--color-ink-soft);
  line-height: 1.7;
}
.legal a {
  color: var(--color-accent-ink, var(--color-ink));
  text-decoration: underline;
  text-underline-offset: 2px;
}

.section__heading {
  font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.75rem);
  max-width: 20ch;
}

.section__heading--center {
  text-align: center;
  margin-inline: auto;
}

.section__body {
  margin-top: 1.1rem;
  max-width: var(--measure);
  color: var(--color-ink-soft);
  font-size: 1.125rem;
}

/* ---------------------------------------------------------------- */
/* 4. Buttons                                                       */
/* ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font: inherit;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.15rem;
  white-space: nowrap;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out),
    background-color 0.15s var(--ease-out);
}

.btn--accent {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  box-shadow: var(--shadow-btn);
}

.btn--accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(232, 163, 61, 0.45);
}

.btn--accent:active {
  transform: translateY(0);
}

.btn--ghost {
  background: transparent;
  color: var(--color-ink);
  border: 1px solid var(--color-line);
  padding: 0.5rem 0.9rem;
}

.btn--ghost:hover {
  border-color: var(--color-accent);
}

/* One-time attention pulse on the CTA after cards land (JS toggles class) */
.btn--pulse {
  animation: cta-pulse 0.6s var(--ease-out);
}

@keyframes cta-pulse {
  0% { transform: scale(1); box-shadow: var(--shadow-btn); }
  45% { transform: scale(1.06); box-shadow: 0 12px 28px rgba(232, 163, 61, 0.55); }
  100% { transform: scale(1); box-shadow: var(--shadow-btn); }
}

/* ---------------------------------------------------------------- */
/* 5. Header                                                        */
/* ---------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid transparent;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 8px;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-size: 1.15rem;
}

.brand__name {
  font-size: 1.15rem;
}

/* ---------------------------------------------------------------- */
/* 6. Hero                                                          */
/* ---------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 8vw, 6rem);
  overflow: hidden;
}

.hero__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3rem);
  align-items: center;
}

.hero__headline {
  font-size: clamp(2.25rem, 1.3rem + 5vw, 4.5rem); /* ~36px → ~72px */
}

.hero__subhead {
  margin-top: 1.25rem;
  max-width: 46ch;
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  color: var(--color-ink-soft);
}

/* --- Claim / waitlist form --- */
.claim {
  margin-top: 1.75rem;
  max-width: 34rem;
}

.claim--center {
  margin-inline: auto;
  text-align: center;
}

.claim__url {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.4rem 0.4rem 0.9rem;
  box-shadow: var(--shadow-card);
}

.claim__prefix {
  align-self: center;
  color: var(--color-ink-soft);
  font-weight: 600;
  white-space: nowrap;
}

.claim__username {
  flex: 1 1 8rem;
  min-width: 6rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--color-ink);
  padding: 0.5rem 0.25rem;
}

.claim__username:focus {
  outline: none;
}

.claim__email {
  margin-top: 0.6rem;
  width: 100%;
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--color-ink);
  padding: 0.7rem 0.9rem;
}

.claim__email::placeholder,
.claim__username::placeholder {
  color: #b3aaa0;
}

.claim__submit {
  flex: 0 0 auto;
}

.claim__micro {
  margin-top: 0.7rem;
  font-size: 0.9rem;
  color: var(--color-ink-soft);
}

.claim__status {
  margin-top: 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--color-accent-soft);
  color: var(--color-accent-ink);
  border: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent);
}

.claim__status--error {
  background: #fbe9e7;
  color: #8a2b1a;
  border-color: #f0c3ba;
}

/* Honeypot: pushed off-screen rather than display:none (some bots skip
   display:none fields but will still fill a visually-hidden one). Humans
   never see or tab to it; a non-empty value flags the request as a bot. */
.claim__hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* --- Signature animation stage --- */
.hero__stage {
  position: relative;
  min-height: 22rem;
}

/* Cards are absolutely positioned within the stage on desktop, laid out
   in a loose grid by JS. On mobile they stack (see @media). */
.stage-card {
  position: absolute;
  width: min(17rem, 78vw);
}

/* Pre-animation hidden state; JS adds .is-landed to animate into place. */
.stage-card {
  opacity: 0;
  transition: transform 0.7s var(--ease-overshoot), opacity 0.5s var(--ease-out);
  will-change: transform, opacity;
}

.stage-card.is-landed {
  opacity: 1;
}

/* ---------------------------------------------------------------- */
/* 7. Sections                                                      */
/* ---------------------------------------------------------------- */

/* --- Problem --- */
.problem__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

.snippets {
  position: relative;
  display: grid;
  gap: 0.9rem;
  padding-block: 1rem;
}

.snippet {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  box-shadow: 0 4px 14px rgba(43, 38, 34, 0.05);
  opacity: 0.72;
  max-width: 22rem;
}

.snippet p {
  margin-top: 0.25rem;
  color: var(--color-ink);
}

.snippet__tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-ink-soft);
}

.snippet--slack { transform: rotate(-2.5deg); }
.snippet--dm { transform: rotate(1.8deg); margin-left: auto; }
.snippet--email { transform: rotate(-1deg); }

/* --- How it works --- */
.steps {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  counter-reset: step;
}

.step {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.step__num {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-ink);
  font-weight: 800;
  margin-bottom: 0.9rem;
}

.step__title {
  font-size: 1.2rem;
  font-weight: 700;
}

.step__body {
  margin-top: 0.4rem;
  color: var(--color-ink-soft);
}

/* --- Moat --- */
.moat__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

.moat__figure {
  margin: 0;
  position: relative;
}

.note-card--hero-annotated {
  transform: rotate(-1.5deg);
  max-width: 26rem;
  margin-inline: auto;
}

.annotations {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.annotation {
  position: relative;
  padding-left: 1.4rem;
  font-family: var(--font-note);
  font-size: 1.15rem;
  color: var(--color-ink-soft);
}

.annotation::before {
  content: "↳";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-family: var(--font-ui);
}

/* --- Embed --- */
.embed__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

.personas {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.persona {
  color: var(--color-ink-soft);
}

.persona strong {
  color: var(--color-ink);
}

.codeblock {
  background: #2b2622;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.codeblock__bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.05);
}

.codeblock__bar span {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.codeblock__pre {
  margin: 0;
  padding: 1.25rem 1.25rem 1.5rem;
  overflow-x: auto;
}

.codeblock__pre code {
  font-family: "SF Mono", "Fira Code", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  color: #f4efe8;
  white-space: pre;
}

/* --- Final CTA --- */
.final-cta {
  background: var(--color-accent-soft);
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}

.final-cta__inner {
  display: grid;
  justify-items: center;
  gap: 1.5rem;
}

/* ---------------------------------------------------------------- */
/* 8. Note-cards, chips, avatars                                    */
/* ---------------------------------------------------------------- */
.note-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.25rem 1.35rem 1.4rem;
  border: 1px solid var(--color-line);
}

/* Interactive lift on hover; JS eases rotation to 0 via --rot variable. */
.stage-card .note-card {
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.stage-card:hover .note-card,
.stage-card:focus-within .note-card {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-lift);
}

.note-card__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.avatar {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-ink);
  font-weight: 700;
  font-size: 0.85rem;
}

.note-card__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  margin-right: auto;
}

.note-card__name {
  font-weight: 700;
  font-size: 0.95rem;
}

.note-card__role {
  font-size: 0.8rem;
  color: var(--color-ink-soft);
}

.note-card__text {
  font-family: var(--font-note);
  font-size: 1.35rem;
  line-height: 1.35;
  color: var(--color-ink);
}

/* Verified chip — deliberately NOT LinkedIn's official mark. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-verified) 10%, white);
  border: 1px solid color-mix(in srgb, var(--color-verified) 25%, transparent);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-verified);
}

.chip__in {
  display: grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 5px;
  background: var(--color-verified);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
}

.chip__check {
  font-size: 0.75rem;
}

/* Chip pops in shortly after its card lands (JS toggles). */
.chip {
  transition: transform 0.2s var(--ease-overshoot), opacity 0.2s var(--ease-out);
}

.stage-card .chip {
  transform: scale(0);
  opacity: 0;
}

.stage-card.chip-in .chip {
  transform: scale(1);
  opacity: 1;
}

/* ---------------------------------------------------------------- */
/* 9. Footer                                                        */
/* ---------------------------------------------------------------- */
.site-footer {
  padding-block: 2.5rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--color-ink-soft);
  font-size: 0.9rem;
}

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

.site-footer__brand {
  font-weight: 700;
  color: var(--color-ink);
}

/* ---------------------------------------------------------------- */
/* 10. Responsive — desktop enhancements                            */
/* ---------------------------------------------------------------- */
@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1.05fr 1fr;
  }

  .problem__grid,
  .moat__grid,
  .embed__grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Put visuals second on some rows for editorial rhythm */
  .moat__figure {
    order: 2;
  }

  .note-card--hero-annotated {
    max-width: 30rem;
  }
}

/* ---------------------------------------------------------------- */
/* 11. Reduced motion — degrade all animation to simple fades       */
/* ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
  }

  .stage-card {
    transition: opacity 0.4s ease !important;
    transform: none !important;
  }

  .btn--pulse {
    animation: none !important;
  }
}
