@import url('./fonts.css');

/* ------------------------------------------------------------ */
/* Tokens                                                        */
/*                                                               */
/* Lifted from the Piper app (src/renderer/src/tokens.css) so the */
/* site and the product read as the same thing. One light/dark    */
/* pair, light-dark() picks the side.                             */
/* ------------------------------------------------------------ */
:root {
  color-scheme: light dark;

  --paper: light-dark(#fbf8f1, #131614);
  --bone: light-dark(#f4f0e6, #191d1a);
  --bone-2: light-dark(#ece5d6, #222824);
  --surface: light-dark(#fffdf8, #1b201d);
  --ink: light-dark(#1a1712, #e9eae4);
  --ink-2: light-dark(#453e34, #c2c6bc);
  --muted: light-dark(#877e6d, #8a9089);
  --faint: light-dark(#a9a091, #71776f);
  --rule: light-dark(#ded5c3, #2c332e);
  --rule-soft: light-dark(#eae3d4, #232926);

  --accent: light-dark(#a03a22, #b4552e);
  --accent-hover: light-dark(#8d3019, #c66235);
  --accent-tint: light-dark(#f2e3da, #302b25);
  --on-accent: light-dark(#fdf6f0, #fbf3ec);

  --mark-from: light-dark(#a03a22, #b4552e);
  --mark-to: light-dark(#c86a3b, #d98555);

  --ok: light-dark(#3f5d4a, #8fb98a);
  --danger: light-dark(#8c2f1d, #dd8c74);

  --shadow: light-dark(26 23 18, 0 0 0);

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --text: 'Instrument Sans', system-ui, sans-serif;

  --r-sm: 9px;
  --r-md: 14px;
  --r-lg: 18px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;

  --page: 1120px;
  --measure: 60ch;
}

/* Dark lifts the canvas with a sage glow, the way the app's Dusk theme does.
   Saturated fill over a wide area is what makes a dark surface feel hot, so the
   glow stays a whisper and the accent is spent only on the primary action. */
@media (prefers-color-scheme: dark) {
  :root {
    --ambient:
      radial-gradient(1100px 500px at 50% -8%, rgb(143 185 138 / 0.05) 0%, transparent 60%),
      radial-gradient(1100px 500px at 50% 108%, rgb(143 185 138 / 0.05) 0%, transparent 60%);
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  background-image: var(--ambient, none);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.62;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--s-5);
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
  transition: color 0.14s ease;
}
a:hover { color: var(--accent-hover); }

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

.skip {
  position: absolute;
  left: -9999px;
  top: var(--s-3);
  z-index: 20;
  padding: var(--s-2) var(--s-4);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  text-decoration: none;
}
.skip:focus { left: var(--s-5); }

/* ------------------------------------------------------------ */
/* Header                                                        */
/* ------------------------------------------------------------ */
.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-block: var(--s-4);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand img { width: 30px; height: 21px; display: block; }
.brand span {
  font-family: var(--display);
  font-weight: 550;
  font-size: 19px;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.head-note {
  color: var(--muted);
  font-size: 14px;
}

/* ------------------------------------------------------------ */
/* Buttons, after the app's .btn--primary                        */
/* ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  padding: 13px var(--s-5);
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
.btn:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled {
  background: var(--bone-2);
  border-color: var(--rule);
  color: var(--faint);
  cursor: default;
}

/* ------------------------------------------------------------ */
/* Hero                                                          */
/* ------------------------------------------------------------ */
.hero { padding-block: clamp(var(--s-7), 8vw, 96px) clamp(var(--s-7), 7vw, 84px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(var(--s-5), 4vw, 56px);
  align-items: center;
}

h1 {
  font-family: var(--display);
  font-weight: 550;
  font-size: clamp(42px, 6vw, 70px);
  line-height: 1.02;
  letter-spacing: -0.032em;
  margin: 0 0 var(--s-5);
  text-wrap: balance;
}

.lede {
  font-size: clamp(18px, 1.8vw, 20.5px);
  line-height: 1.58;
  color: var(--ink-2);
  max-width: var(--measure);
  margin: 0 0 var(--s-6);
}

.hero-art {
  display: grid;
  place-items: center;
  min-height: 300px;
}
.hero-art canvas { display: block; }

/* ------------------------------------------------------------ */
/* Signup                                                        */
/* ------------------------------------------------------------ */
.signup { max-width: 480px; }
.field-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.field-row[hidden] { display: none; }

.signup input[type='email'] {
  flex: 1 1 230px;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 13px var(--s-4);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  transition: border-color 0.14s ease;
}
.signup input[type='email']::placeholder { color: var(--faint); }
.signup input[type='email']:hover { border-color: var(--muted); }
.signup input[type='email']:focus-visible { border-color: var(--accent); }

/* A honeypot for bots, off-screen rather than display:none so a scripted filler
   still finds it. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note {
  margin: var(--s-3) 0 0;
  font-size: 14px;
  color: var(--muted);
}
.form-msg {
  margin: var(--s-3) 0 0;
  font-size: 15px;
  min-height: 1.4em;
  color: var(--muted);
}
.form-msg[data-state='ok'] { color: var(--ok); font-weight: 600; }
.form-msg[data-state='error'] { color: var(--danger); }
/* Turnstile runs in invisible mode, so the slot draws nothing and must not
   reserve space. Switch the widget back to managed in Cloudflare and this needs
   a top margin again. */
.turnstile-slot { line-height: 0; }
.turnstile-slot[hidden] { display: none; }

/* ------------------------------------------------------------ */
/* Trust strip                                                   */
/* ------------------------------------------------------------ */
.strip {
  border-block: 1px solid var(--rule-soft);
  background: var(--bone);
  padding-block: var(--s-6);
}
.strip .wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-5);
  flex-wrap: wrap;
}
.strip p {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(18px, 2vw, 23px);
  letter-spacing: -0.018em;
  color: var(--ink-2);
  text-align: center;
  text-wrap: balance;
}
/* The wave bird needs a box to measure against, since the canvas sizes itself
   from its parent. */
.strip-bird { flex: none; width: 58px; display: block; }
.strip canvas { display: block; }

/* ------------------------------------------------------------ */
/* Sections                                                      */
/* ------------------------------------------------------------ */
section { padding-block: clamp(var(--s-7), 7.5vw, 92px); }

.section-head { max-width: var(--measure); margin-bottom: var(--s-7); }
h2 {
  font-family: var(--display);
  font-weight: 550;
  font-size: clamp(27px, 3.3vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.026em;
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}
.section-head p {
  margin: 0;
  color: var(--ink-2);
  font-size: 18px;
}

/* Cards, after the app's .card */
/* Two by two. Four pillars across an auto-fit grid strand the fourth card on a
   row of its own at most desktop widths. */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: var(--s-5);
}
@media (min-width: 760px) {
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.pillar {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--s-6);
  box-shadow: 0 14px 34px -26px rgb(var(--shadow) / 0.28);
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.pillar:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 18px 40px -26px rgb(var(--shadow) / 0.34);
}
.pillar .tick {
  display: block;
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--mark-from), var(--mark-to));
  margin-bottom: var(--s-4);
}
.pillar h3 {
  font-family: var(--display);
  font-weight: 550;
  font-size: 20px;
  letter-spacing: -0.016em;
  margin: 0 0 10px;
}
.pillar p { margin: 0; color: var(--ink-2); font-size: 16px; }

/* Deliverables, after the app's .chips */
.deliver {
  background: var(--bone);
  border-block: 1px solid var(--rule-soft);
}
.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chips li {
  padding: 9px var(--s-4);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 15px;
  color: var(--accent);
}

/* Control */
.control-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-6);
}
.control-grid h3 {
  font-family: var(--display);
  font-weight: 550;
  font-size: 18px;
  letter-spacing: -0.014em;
  margin: 0 0 var(--s-2);
}
.control-grid p { margin: 0; color: var(--ink-2); font-size: 16px; }

/* Closing call to action */
.close-cta { text-align: center; }
.close-cta .signup { margin-inline: auto; }
.close-cta .field-row { justify-content: center; }
.close-cta h2 { margin-bottom: var(--s-5); }
.close-cta .form-msg { text-align: center; }

/* ------------------------------------------------------------ */
/* Footer                                                        */
/* ------------------------------------------------------------ */
.site-foot {
  border-top: 1px solid var(--rule-soft);
  padding-block: var(--s-6);
  color: var(--muted);
  font-size: 14px;
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: center;
  justify-content: space-between;
}
.site-foot nav { display: flex; gap: var(--s-5); flex-wrap: wrap; }

@media (max-width: 520px) {
  .field-row { flex-direction: column; }
  .signup input[type='email'] { flex: 1 1 auto; }
  .btn { width: 100%; }
}

@media (max-width: 880px) {
  .hero { padding-block: var(--s-6) var(--s-7); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; min-height: 0; }
  .site-head { position: static; }
}

/* ------------------------------------------------------------ */
/* Legal pages                                                   */
/* ------------------------------------------------------------ */
.prose {
  max-width: var(--measure);
  padding-block: var(--s-7) var(--s-8);
}
.prose h1 {
  font-size: clamp(31px, 4.4vw, 44px);
  margin-bottom: var(--s-5);
}
.prose h2 {
  font-size: 21px;
  margin-top: var(--s-7);
  margin-bottom: var(--s-3);
}
.prose p,
.prose li { color: var(--ink-2); font-size: 16.5px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: var(--s-2); }
.prose .updated { color: var(--muted); font-size: 15px; }
