:root {
  --bg: #f4efec;
  --fg: #1a1a1a;
  --muted: #6b6560;
  --border: #d9d3ce;
  --btn: #111111;
  --card: #ffffff;
  --err: #b3261e;
  --stroke: #7fa596;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

/* Layout */
/* Header: sticky. Transparent at the top of the page, frosted with a hairline once scrolled; logo shrinks a little. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 14px 16px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, padding .25s ease;
}
.site-header.scrolled {
  background: rgba(244, 239, 236, .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
  padding: 10px 16px;
}
.site-header .logo { transition: height .25s ease; }
.site-header.scrolled .logo { height: 32px; }
@media (min-width: 640px) {
  .site-header { padding: 24px 32px; }
  .site-header.scrolled { padding: 12px 32px; }
  .site-header.scrolled .logo { height: 34px; }
}
@media (prefers-reduced-motion: reduce) { .site-header, .site-header .logo { transition: none; } }

.wordmark { display: inline-flex; align-items: center; gap: 10px; }
.logo { height: 44px; width: auto; display: block; }
@media (max-width: 640px) { .logo { height: 36px; } }
.wordmark {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding: 48px 0 56px;
}
main.center { align-items: center; padding-top: 32px; padding-bottom: 64px; }
/* Landing: column hugs the left edge under the wordmark, like instinct.com */
main.landing-main { align-items: flex-start; padding-top: 40px; }
main.landing-main .wrap { margin: 0; max-width: 600px; }
@media (min-width: 640px) {
  main.landing-main { padding-top: 72px; }
  main.landing-main .wrap { padding: 0 32px; }
}
/* Desktop: center a wider column and scale the type up so nine paragraphs do not read as a thin strip. */
@media (min-width: 900px) {
  main.landing-main { padding-top: 48px; }
  main.landing-main .wrap { margin: 0 auto; max-width: 720px; }
  .landing p { font-size: 19px; line-height: 1.55; margin-bottom: 22px; }
  .landing p.lead { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1.12; letter-spacing: -0.01em; margin-bottom: 28px; }
  .landing .cta { margin-top: 28px; }
  .cta-label { font-size: 20px; }
}

.wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px;
  text-align: left;
}

/* Type */
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.sub { margin: 0 0 28px; color: var(--muted); }

.landing p { margin: 0 0 20px; }
.landing p.lead { font-weight: 700; }

/* CTA: hand-drawn ink underline that draws itself on load (two passes), redraws on hover or tap */
.cta {
  position: relative;
  display: inline-block;
  margin-top: 20px;
  padding: 2px 6px 14px 0;
  color: var(--fg);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.cta-label {
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.cta-stroke {
  position: absolute;
  z-index: 0;
  left: -4%;
  bottom: -4px;
  width: 108%;
  height: 26px;
  overflow: visible;
  pointer-events: none;
}
.cta-stroke path {
  fill: none;
  stroke: #7fa596;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  filter: url(#ink);
  animation: cta-draw 1.1s cubic-bezier(.65, 0, .3, 1) .4s forwards;
}
.cta-stroke .s2 { stroke: #5f8a79; stroke-width: 5; opacity: .55; animation-delay: .8s; animation-duration: .9s; }
@keyframes cta-draw { to { stroke-dashoffset: 0; } }
.cta:hover .cta-stroke path, .cta:active .cta-stroke path { animation: cta-draw .7s cubic-bezier(.65, 0, .3, 1) forwards; }
.cta:hover .cta-stroke .s2, .cta:active .cta-stroke .s2 { animation-delay: .25s; }
.cta:active { transform: scale(.985); }
.cta:focus-visible { outline: 2px solid var(--btn); outline-offset: 4px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .cta-stroke path { animation: none; stroke-dashoffset: 0; } }

/* Sticky CTA: shows only while the inline CTA is off screen, so the action is always one tap away */
.sticky-cta {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: rgba(244, 239, 236, .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
  -webkit-tap-highlight-color: transparent;
}
.sticky-cta[hidden] { display: flex; }
.sticky-cta.show { transform: translateY(0); }
.sticky-cta-label { position: relative; z-index: 1; }
.sticky-cta-stroke { position: absolute; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); width: 150px; height: 12px; margin-left: -95px; pointer-events: none; }
.sticky-cta-stroke path { fill: none; stroke: #7fa596; stroke-width: 10; stroke-linecap: round; opacity: .9; }
.sticky-cta-arrow { transition: transform .2s; }
.sticky-cta:active .sticky-cta-arrow { transform: translateX(4px); }
body.landing { padding-bottom: 0; }
body.landing.sticky-on { padding-bottom: 72px; }

/* Forms */
.field {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font: inherit;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field::placeholder { color: #9a938d; }
.field:focus { border-color: var(--btn); box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08); }

.phone-row {
  display: flex;
  align-items: stretch;
  height: 52px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.phone-row:focus-within { border-color: var(--btn); box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08); }
.phone-row select {
  flex: 0 0 auto;
  width: 92px;
  padding: 0 28px 0 14px;
  font: inherit;
  color: var(--fg);
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b6560' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 12px 0 0 12px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  cursor: pointer;
}
.phone-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 16px;
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-radius: 0 12px 12px 0;
  outline: none;
}
.phone-row input::placeholder { color: #9a938d; }

.error {
  min-height: 22px;
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--err);
}
.error:empty { min-height: 0; margin: 0; }
.notice { color: var(--muted); }

.consent {
  margin: 14px 0 20px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.consent a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: var(--btn);
  border: 0;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.05s ease;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--btn); outline-offset: 3px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { flex: 0 0 auto; }

.link-btn {
  display: inline;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--fg);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-btn:disabled { color: var(--muted); opacity: 0.6; text-decoration: none; cursor: default; }
.link-btn:focus-visible { outline: 2px solid var(--btn); outline-offset: 2px; border-radius: 2px; }

/* OTP boxes */
.otp { display: flex; gap: 8px; }
.otp-box {
  flex: 1 1 0;
  min-width: 0;
  max-width: 64px;
  height: 60px;
  padding: 0;
  text-align: center;
  font: inherit;
  font-size: 24px;
  font-weight: 500;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  caret-color: var(--fg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.otp-box:focus { border-color: var(--btn); box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08); }
.otp-box:disabled { opacity: 0.6; }

.helper { margin: 20px 0 0; font-size: 14px; color: var(--muted); }
.helper .link-btn { color: var(--fg); }
.helper .link-btn:disabled { color: var(--muted); }

/* Profile */
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.email-row { margin-bottom: 20px; }
.profile-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
}
.profile-foot .link-btn { color: var(--muted); }

/* QR step */
.qr-card {
  display: inline-block;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(26, 26, 26, 0.04);
  line-height: 0;
}
.qr-card svg { display: block; width: 220px; height: 220px; }
.scan { margin: 16px 0 12px; font-size: 14px; color: var(--muted); }
.number-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  height: 52px;
  padding: 0 8px 0 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
}
.pill-right { display: flex; align-items: center; gap: 4px; }
.copied { font-size: 13px; font-weight: 500; color: var(--muted); min-width: 0; }
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.copy-btn:hover { background: #f1ece9; }
.copy-btn:focus-visible { outline: 2px solid var(--btn); outline-offset: 1px; }
.mobile-only { display: none; }
.mobile-only.btn { margin-top: 20px; }
@media (max-width: 640px), (pointer: coarse) {
  .mobile-only.btn { display: flex; }
}
.fine { margin: 24px 0 0; font-size: 14px; color: var(--muted); }

/* Fallback page */
.plain p { margin: 0 0 16px; }

/* Footer: hairline divider, centered stack (links, then copyright) */
.site-footer {
  margin-top: 24px;
  padding: 28px 16px 36px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}
.site-footer .inner { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.footer-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.footer-links .dot { color: var(--border); }
.footer-copy { font-size: 12px; }
.site-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border); }
.site-footer a:hover { color: var(--fg); text-decoration-color: currentColor; }

@media (max-width: 380px) {
  h1 { font-size: 34px; }
  .otp { gap: 6px; }
}
