/* =========================================================================
   PrimoPay landing — design tokens per brand book v1.0.
   Do not improvise these values.
   ========================================================================= */

:root {
  /* Paper / cream surface scale */
  --paper:        #F5EEDF;
  --cream:        #EFE6D3;
  --bone:         #E7DCC4;
  --card:         #FBF6EA;

  /* Ink scale */
  --ink:          #1A1410;
  --ink-soft:     #3D332B;
  --ink-mute:     #8A7A68;

  /* Accent scale */
  --clay:         #B04A2E;
  --clay-deep:    #82331E;
  --brass:        #C5995A;
  --brass-deep:   #9E7637;
  --moss:         #5A6D45;

  /* Typography */
  --f-display: "Fraunces", ui-serif, Georgia, serif;
  --f-body:    "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, Menlo, monospace;

  /* Layout */
  --line:      rgba(26, 20, 16, 0.12);
  --line-soft: rgba(26, 20, 16, 0.06);
  --gutter:    clamp(20px, 5vw, 64px);
}

/* =========================================================================
   Reset + base
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

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

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

h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}
a:hover { border-bottom-color: currentColor; }

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

/* =========================================================================
   Wordmark — Fraunces "Primo" + italic clay-deep "Pay"
   ========================================================================= */

.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 400;
  font-variation-settings: "opsz" 36, "SOFT" 30, "WONK" 0;
  letter-spacing: -0.01em;
  color: var(--ink);
  border-bottom: none;
}
.wordmark:hover { border-bottom: none; }
.wordmark__primo { font-weight: 400; }
.wordmark__pay {
  font-style: italic;
  font-weight: 500;
  color: var(--clay-deep);
}
.wordmark--small { font-size: 24px; }
.wordmark--inverted .wordmark__primo { color: var(--paper); }
.wordmark--inverted .wordmark__pay   { color: var(--brass); }

/* =========================================================================
   Site header
   ========================================================================= */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px var(--gutter);
}

.site-nav {
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--ink-soft);
}
.site-nav a { padding: 4px 2px; }
.nav-sep {
  color: var(--ink-mute);
  margin: 0 6px;
}

/* =========================================================================
   Eyebrow — JetBrains Mono, brass-deep, uppercase, letter-spaced
   ========================================================================= */

.eyebrow {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--brass-deep);
  margin: 0 0 24px;
}
.eyebrow--inverted { color: var(--brass); margin-top: 32px; margin-bottom: 0; }

/* =========================================================================
   Hero — full-bleed paper, centred mark + headline + form
   ========================================================================= */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(40px, 8vw, 96px) var(--gutter) clamp(64px, 10vw, 128px);
  max-width: 880px;
  margin: 0 auto;
}

.hero__mark {
  margin-bottom: clamp(24px, 4vw, 48px);
  width: 200px;
  height: 200px;
}

.hero__headline {
  font-family: var(--f-display);
  /* opsz 144, weight 360, SOFT 50, WONK 1 — brand book Chapter 7 display */
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
  font-weight: 360;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 24px;
  max-width: 18ch;
}
.hero__headline em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 80, "WONK" 1;
  color: var(--clay-deep);
}

.hero__subhead {
  font-family: var(--f-body);
  font-weight: 400;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 40px;
}

/* =========================================================================
   Waitlist form — visual only, captures nothing
   ========================================================================= */

.waitlist {
  width: 100%;
  max-width: 480px;
}
.waitlist__label {
  /* Visually hidden — input has its own placeholder + aria-label */
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); overflow: hidden;
}
.waitlist__row {
  display: flex;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.waitlist__row:focus-within {
  border-color: var(--brass);
  box-shadow: 0 0 0 4px rgba(197, 153, 90, 0.15);
}
.waitlist__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: var(--f-body);
  font-size: 16px;
  color: var(--ink);
  padding: 10px 16px;
}
.waitlist__input:focus { outline: none; }
.waitlist__input::placeholder { color: var(--ink-mute); }

.waitlist__button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: var(--clay-deep);
  color: var(--paper);
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 15px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease;
}
.waitlist__button:hover { background: var(--clay); }
.waitlist__button:active { transform: translateY(1px); }

.waitlist__ack {
  margin-top: 16px;
  font-family: var(--f-body);
  font-size: 15px;
  color: var(--moss);
}

/* =========================================================================
   Divider between hero and features
   ========================================================================= */

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0 var(--gutter);
}

/* =========================================================================
   Features — fintech utility aesthetic on lighter --card surface
   ========================================================================= */

.features {
  background: var(--card);
  padding: clamp(56px, 8vw, 96px) var(--gutter);
}

.features__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 40px);
  max-width: 1080px;
  margin: 0 auto;
}

.feature {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 28px;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.feature:hover {
  transform: translateY(-2px);
  border-color: var(--clay);
  box-shadow: 0 8px 24px rgba(26, 20, 16, 0.06);
}

.feature__icon {
  color: var(--ink);
  margin-bottom: 20px;
}

.feature__title {
  font-family: var(--f-display);
  font-variation-settings: "opsz" 36, "SOFT" 40, "WONK" 0;
  font-weight: 500;
  font-size: 24px;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 8px;
}

.feature__body {
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* =========================================================================
   Footer — inverted: ink background with paper text
   ========================================================================= */

.site-footer {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: clamp(56px, 8vw, 96px) var(--gutter);
}
.site-footer .wordmark { margin-bottom: 16px; }

.footer__copy {
  font-family: var(--f-body);
  font-size: 14px;
  color: rgba(245, 238, 223, 0.72);
  margin: 0 0 12px;
}

.footer__nav {
  font-family: var(--f-body);
  font-size: 14px;
  color: rgba(245, 238, 223, 0.72);
}
.footer__nav a { padding: 4px 2px; }
.site-footer .nav-sep { color: rgba(245, 238, 223, 0.4); }

/* =========================================================================
   Folded P — animation per brand book Chapter 7.
   2.4s total motion sequence:
     0.00s → 1.44s    silhouette outline draws, then fills (60% of timeline)
     0.80s            first fold creases in
     1.10s            second fold creases in
     1.60s            destination dot scales in from origin
   ========================================================================= */

.folded-p__silhouette {
  fill: var(--ink);
  animation: draw 1.44s cubic-bezier(0.5, 0, 0.2, 1) 0s forwards;
}

.folded-p__fold {
  stroke: var(--brass);
  transform-origin: 28px center;
  transform-box: fill-box;
  opacity: 0;
}
.folded-p__fold--1 { animation: fold-in 0.45s cubic-bezier(0.4, 0, 0.2, 1) 0.80s forwards; }
.folded-p__fold--2 { animation: fold-in 0.45s cubic-bezier(0.4, 0, 0.2, 1) 1.10s forwards; }

.folded-p__dot {
  fill: var(--clay-deep);
  transform-origin: 98px 92px;
  transform-box: view-box;
  opacity: 0;
  transform: translate(-70px, -70px) scale(0);
  animation: dot-in 0.70s cubic-bezier(0.34, 1.56, 0.64, 1) 1.60s forwards;
}

/* Outline draws in brass, then fill swaps in. Brand book Chapter 7 motion. */
@keyframes draw {
  from {
    fill: transparent;
    stroke: var(--brass);
    stroke-width: 1;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
  }
  60% {
    fill: transparent;
    stroke: var(--brass);
    stroke-width: 1;
    stroke-dasharray: 600;
    stroke-dashoffset: 0;
  }
  to {
    fill: var(--ink);
    stroke: transparent;
    stroke-dasharray: 600;
    stroke-dashoffset: 0;
  }
}

@keyframes fold-in {
  from { opacity: 0; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}

@keyframes dot-in {
  from { opacity: 0; transform: translate(-70px, -70px) scale(0); }
  to   { opacity: 1; transform: translate(0, 0)         scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .folded-p__silhouette,
  .folded-p__fold,
  .folded-p__dot {
    animation: none;
    fill: var(--ink);
    stroke: transparent;
    opacity: 1;
    transform: none;
  }
  .folded-p__fold { stroke: var(--brass); }
  .folded-p__dot  { fill: var(--clay-deep); }
}

/* =========================================================================
   Responsive — mobile-first, breakpoint at 680px
   ========================================================================= */

@media (max-width: 680px) {
  .site-header {
    flex-direction: column;
    gap: 12px;
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .hero__mark { width: 140px; height: 140px; }
  .hero__mark svg { width: 140px; height: 140px; }

  .hero__headline { font-size: clamp(34px, 9vw, 48px); }

  .waitlist__row {
    flex-direction: column;
    border-radius: 16px;
    padding: 8px;
  }
  .waitlist__button { width: 100%; }

  .features__list { grid-template-columns: 1fr; }
}
