/* ---------- Font ---------- */
@font-face { font-family: "Duckert Sans"; src: url("/fonts/DuckertSans-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Duckert Sans"; src: url("/fonts/DuckertSans-LightItalic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Duckert Sans"; src: url("/fonts/DuckertSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Duckert Sans"; src: url("/fonts/DuckertSans-RegularItalic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Duckert Sans"; src: url("/fonts/DuckertSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Duckert Sans"; src: url("/fonts/DuckertSans-BoldItalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --white: #ffffff;
  --green: #60ed2e;
  --black: #000000;
  --ink: #111111;          /* body text — softer than pure black */
  --muted: #6b6b6b;
  --surface: #f6f7f5;      /* off-white panels so white isn't flat */

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 32px;
  --radius-pill: 999px;

  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 88px;

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-blur: blur(18px) saturate(180%);
  --shadow-float: 0 8px 30px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Duckert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { border-radius: var(--radius); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: var(--radius-sm); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  /* No background — only the pill is frosted */
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }

.logo { justify-self: start; display: inline-flex; border-radius: var(--radius-sm); }
.logo img { height: 26px; width: auto; border-radius: 0; }

/* Floating pill — transparent at the very top. The glass fades in gradually
   with scroll position: --glass goes 0 → 1 over the first ~160px (set in main.js). */
.site-header { --glass: 0; }
.nav-pill {
  justify-self: center;
  display: flex;
  gap: 4px;
  padding: 6px;
  margin: 0;
  list-style: none;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, calc(0.55 * var(--glass)));
  -webkit-backdrop-filter: blur(calc(18px * var(--glass))) saturate(calc(100% + 80% * var(--glass)));
  backdrop-filter: blur(calc(18px * var(--glass))) saturate(calc(100% + 80% * var(--glass)));
  border: 1px solid rgba(0, 0, 0, calc(0.06 * var(--glass)));
  box-shadow:
    0 8px 30px rgba(0, 0, 0, calc(0.06 * var(--glass))),
    0 1px 2px rgba(0, 0, 0, calc(0.04 * var(--glass)));
}

/* Hide on scroll down, glide back on scroll up — long, soft ease-out */
.logo, .nav-pill {
  transition:
    transform 0.8s var(--ease-soft),
    opacity 0.6s var(--ease-soft);
  will-change: transform, opacity;
}
.site-header.is-hidden .logo,
.site-header.is-hidden .nav-pill { transform: translateY(-120%); opacity: 0; pointer-events: none; }

.nav-pill a {
  display: block;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  color: var(--ink);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-pill a:hover { background: rgba(0, 0, 0, 0.05); }
.nav-pill a[aria-current="page"] { background: var(--green); color: var(--black); font-weight: 700; }

/* Mobile: logo stays top-left, the pill floats at the bottom (thumb reach).
   It sits over content, so it keeps its glass even at the top. */
@media (max-width: 720px) {
  :root { --header-h: 68px; }
  .site-header { grid-template-columns: 1fr; }
  .logo img { height: 22px; }
  .site-header { --glass: 1 !important; }
  .site-header .nav-pill {
    position: fixed;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100vw - 32px);
  }
  .site-header.is-hidden .nav-pill { transform: translate(-50%, 160%); }
  .nav-pill a { padding: 10px 14px; font-size: 14px; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header .nav-pill { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 255, 255, calc(0.96 * var(--glass))); }
}
@media (prefers-reduced-motion: reduce) {
  .logo, .nav-pill { transition-duration: 0.01s; }
}

/* ---------- Layout ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
main { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
section { scroll-margin-top: calc(var(--header-h) + 16px); }
.section { padding: 96px 0; }
h1, h2, h3 { color: var(--black); letter-spacing: -0.02em; margin: 0; }
h2 { font-size: clamp(32px, 4.5vw, 52px); line-height: 1.05; font-weight: 700; margin-bottom: 16px; }
h3 { font-size: 22px; line-height: 1.2; font-weight: 700; margin-bottom: 8px; }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 52ch; margin: 0; }
.dot { color: var(--green); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: var(--radius-pill);
  font: inherit; font-size: 16px; font-weight: 700; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: var(--black); }
.btn-primary:hover { background: #55db25; }
.btn-ghost { background: transparent; color: var(--ink); border-color: rgba(0, 0, 0, 0.12); }
.btn-ghost:hover { background: rgba(0, 0, 0, 0.04); }

/* ---------- Hero ---------- */
.hero { padding: calc(var(--header-h) + 96px) 0 72px; position: relative; }
.hero h1 { font-size: clamp(44px, 8vw, 96px); line-height: 1; font-weight: 700; max-width: 14ch; margin-bottom: 24px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
body { overflow-x: hidden; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 72px; }
.fact { background: var(--surface); border-radius: var(--radius); padding: 22px 24px; }
.fact strong { display: block; font-size: 18px; color: var(--black); }
.fact span { color: var(--muted); font-size: 15px; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 48px; }
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 32px; }
.card p { color: var(--muted); margin: 0; }
.card .num { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--white); font-weight: 700; font-size: 15px; margin-bottom: 28px; }

/* ---------- Pricing ---------- */
.price-card { background: var(--surface); border-radius: var(--radius-lg); padding: 32px; display: flex; flex-direction: column; }
.price-card.featured { background: var(--green); }
.price-card.featured p, .price-card.featured li { color: var(--black); }
.price-card .price { font-size: 32px; font-weight: 700; color: var(--black); margin: 12px 0 20px; letter-spacing: -0.02em; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; }
.price-card li { display: flex; gap: 10px; color: var(--ink); font-size: 16px; }
.price-card li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 10px; border-radius: 50%; background: var(--black); }
.price-card .btn { margin-top: auto; align-self: flex-start; }
.price-card.featured .btn-primary { background: var(--white); }
.note { margin-top: 20px; font-size: 15px; color: var(--muted); }

/* ---------- Contact ---------- */
.contact { background: var(--surface); border-radius: var(--radius-lg); padding: clamp(32px, 6vw, 72px); margin: 48px 0 96px; }
.contact .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- Footer ---------- */
.site-footer { max-width: 1200px; margin: 0 auto; padding: 32px var(--gutter) 48px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: var(--muted); font-size: 14px; border-top: 1px solid rgba(0, 0, 0, 0.06); }

@media (max-width: 720px) {
  .section { padding: 72px 0; }
  .hero { padding-top: calc(var(--header-h) + 48px); }
  .site-footer { padding-bottom: 110px; } /* room for the bottom nav pill */
}
.price-card .price small { font-size: 16px; font-weight: 400; color: var(--muted); }
.price-card.featured .price small { color: var(--black); }

/* ---------- Pricing extras ---------- */
.price-card .desc { color: var(--muted); margin: 0 0 20px; font-size: 16px; }
.price-card.featured .desc { color: var(--black); }
.price-card .price { margin: 8px 0 6px; }
.badge { display: inline-block; align-self: flex-start; margin-bottom: 16px; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--black); color: var(--white); font-size: 13px; font-weight: 700; }
.pricing-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 32px; }
.text-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.text-link:hover { text-decoration-color: var(--black); }

/* ---------- Subpages ---------- */
.page-hero { padding: calc(var(--header-h) + 80px) 0 24px; }
.page-hero h1 { font-size: clamp(40px, 6.5vw, 76px); line-height: 1.02; font-weight: 700; max-width: 16ch; margin-bottom: 20px; }
.included { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 40px; }
.faq { display: grid; gap: 12px; margin-top: 40px; max-width: 820px; }
.faq details { background: var(--surface); border-radius: var(--radius); padding: 20px 24px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--black); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 22px; line-height: 1; transition: transform 0.2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin: 12px 0 0; }
.card ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; }
.card li { display: flex; gap: 10px; font-size: 16px; }
.card li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 10px; border-radius: 50%; background: var(--green); }

/* ---------- Page transitions ----------
   Cross-document View Transitions: content crossfades with a slight lift,
   while the logo and menu stay in place. Unsupported browsers get the fallback below. */
@view-transition { navigation: auto; }
.logo { view-transition-name: logo; }
.nav-pill { view-transition-name: nav; }

::view-transition-old(root) { animation: vt-out 0.3s var(--ease-soft) both; }
::view-transition-new(root) { animation: vt-in 0.65s var(--ease-soft) 0.08s both; }
::view-transition-group(logo),
::view-transition-group(nav) { animation-duration: 0.6s; animation-timing-function: var(--ease-soft); }

@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

/* Fallback (e.g. Firefox): gentle fade-in of the content on load */
@supports not (view-transition-name: none) {
  main, .site-footer { animation: vt-in 0.65s var(--ease-soft) both; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  main, .site-footer { animation: none !important; }
}

/* ---------- Contact form ---------- */
.contact-form { margin-top: 40px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 8px; font-size: 15px; font-weight: 700; color: var(--black); }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field-wide { grid-column: 1 / -1; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-weight: 400; font-size: 16px; color: var(--ink);
  background: var(--white); border: 1px solid rgba(0, 0, 0, 0.08); border-radius: var(--radius-sm);
  padding: 14px 16px; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { resize: vertical; min-height: 140px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 44px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(96, 237, 46, 0.25); }
.field [aria-invalid="true"] { border-color: #d93025; }
.field-error { color: #d93025; font-weight: 400; font-size: 14px; min-height: 0; }
.field-error:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 24px; }
.form-actions .btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.form-status { margin: 0; font-size: 15px; color: var(--muted); }
.form-status[data-kind="error"] { color: #d93025; }
.form-done { background: var(--white); border-radius: var(--radius); padding: 32px; animation: vt-in 0.6s var(--ease-soft) both; }
.form-done p { color: var(--muted); margin: 0; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

/* =========================================================
   Motion & curls
   ========================================================= */
:root { --curl-w: 14px; }

/* Hand-drawn green strokes. pathLength="1" lets us draw them with a 0→1 dash. */
.hero-curl path, .page-curl path, .curl-divider path, .squiggle path {
  fill: none; stroke: var(--green); stroke-linecap: round; stroke-linejoin: round;
}
.page-curl path, .curl-divider path, .squiggle path { stroke-dasharray: 1; stroke-dashoffset: 0; }

/* ---- Hero ---- */
.hero { isolation: isolate; }
.hero-curl {
  position: absolute; z-index: -1; pointer-events: none;
  right: calc(-1 * var(--gutter) - 4vw); top: calc(var(--header-h) - 10px);
  width: min(620px, 62vw); height: auto; overflow: visible;
}
/* The title's full stop is a drawn circle, so the jumping dot (home.js) can match it exactly */
.hero-title .dot {
  display: inline-block; position: relative; vertical-align: baseline;
  width: 0.19em; height: 0.19em; margin-left: 0.06em;
  border-radius: 50%; background: var(--green);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hero-curl path { stroke-width: 10; vector-effect: non-scaling-stroke; } /* same as the page curls */
/* The green dot that jumps out of the title and draws the curl (home.js) */
.hero-pen {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none;
  border-radius: 50%; background: var(--green); will-change: transform;
}
.hero-title { display: flex; flex-wrap: wrap; column-gap: 0.25em; }
.hero-title .w { display: inline-block; position: relative; }
.squiggle { position: absolute; left: -2%; bottom: -0.12em; width: 104%; height: 0.28em; overflow: visible; }
.squiggle path { stroke-width: 7; vector-effect: non-scaling-stroke; }

/* ---- Marquee band ---- */
.marquee {
  margin: 24px calc(-1 * var(--gutter)) 0; padding: 22px 0; overflow: hidden;
  border-block: 1px solid rgba(0, 0, 0, 0.06);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; align-items: center; gap: 36px; width: max-content; animation: marquee 32s linear infinite; }
.marquee span { font-size: clamp(28px, 4.5vw, 56px); font-weight: 700; letter-spacing: -0.02em; color: var(--black); white-space: nowrap; }
.marquee span:nth-of-type(even) { font-weight: 300; font-style: italic; }
.marquee i { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--green); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 18px)); } }

/* ---- Curl divider (drawn by scrolling) ---- */
.curl-divider { display: block; width: calc(100% + 2 * var(--gutter)); height: clamp(120px, 16vw, 220px); margin: 0 calc(-1 * var(--gutter)); overflow: visible; }
.curl-divider path { stroke-width: 12; vector-effect: non-scaling-stroke; }

/* ---- Subpage curl ---- */
.page-hero { position: relative; isolation: isolate; }
.page-curl { position: absolute; z-index: -1; right: calc(-1 * var(--gutter)); top: calc(var(--header-h) + 10px); width: min(320px, 40vw); height: auto; overflow: visible; pointer-events: none; }
.page-curl path { stroke-width: 18; }

/* ---- Hover life ---- */
.card, .price-card, .fact { transition: transform 0.5s var(--ease-soft), box-shadow 0.5s var(--ease-soft); }
.card:hover, .price-card:hover { transform: translateY(-6px) rotate(-0.4deg); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.07); }
.fact:hover { transform: translateY(-3px); }
.card .num { transition: background-color 0.4s var(--ease-soft), transform 0.6s var(--ease-soft); }
.card:hover .num { background: var(--green); transform: rotate(-10deg) scale(1.08); }

/* ---- On-load animations (all browsers) ---- */
@media (prefers-reduced-motion: no-preference) {
  .hero-title .w { animation: word-in 0.9s var(--ease-soft) both; animation-delay: calc(0.1s + var(--i) * 0.09s); }
  .hero .lead { animation: word-in 0.9s var(--ease-soft) 0.5s both; }
  .hero .actions { animation: word-in 0.9s var(--ease-soft) 0.62s both; }
  .hero .facts { animation: word-in 1s var(--ease-soft) 0.75s both; }
  .squiggle path { stroke-dashoffset: 1; animation: draw 0.9s var(--ease-soft) 0.75s forwards; }
  .page-curl path { stroke-dashoffset: 1; animation: draw 2.2s cubic-bezier(0.65, 0, 0.35, 1) 0.2s forwards; }
  .page-hero > :not(svg) { animation: word-in 0.9s var(--ease-soft) both; }
  .page-hero > h1 { animation-delay: 0.08s; }
  .page-hero > .lead { animation-delay: 0.18s; }
  .dot { display: inline-block; }
  .hero-title .dot { animation: dot-in 0.6s var(--ease-soft) 0.75s both; } /* grows in, never past its size */
}
@keyframes word-in { from { opacity: 0; transform: translateY(0.45em); filter: blur(6px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dot-in { from { transform: scale(0); } }
@keyframes dot-pop { 0% { transform: scale(0); } 60% { transform: scale(1.5); } 100% { transform: scale(1); } }

/* ---- Scroll-driven animations (Chrome, Edge, Safari 26+). Decorative: no fallback. ---- */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    /* Reveal section content as it scrolls in */
    .section > h2, .section > .lead, .section > .note, .section > .pricing-cta,
    .contact > *, .faq > details, .included > *, .cards > * {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 28%;
    }
    /* Stagger cards by starting each one a little later */
    .cards > :nth-child(2), .included > :nth-child(2) { animation-range: entry 8% cover 34%; }
    .cards > :nth-child(3), .included > :nth-child(3) { animation-range: entry 16% cover 40%; }
    .included > :nth-child(4) { animation-range: entry 24% cover 46%; }

    /* Divider curl draws itself as you scroll past */
    .curl-divider path {
      stroke-dashoffset: 1;
      animation: draw linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 65%;
    }


    /* Marquee leans with scroll on top of its own loop */
    .marquee { animation: lean linear both; animation-timeline: view(); animation-range: cover; }

    /* Green dots in headings pop when they arrive */
    .section > h2 .dot, .contact h2 .dot { animation: dot-pop linear both; animation-timeline: view(); animation-range: entry 40% cover 35%; }
  }
}
@keyframes reveal { from { opacity: 0; translate: 0 48px; scale: 0.98; } }
@keyframes lean { from { transform: translateX(6%); } to { transform: translateX(-6%); } }

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

@media (max-width: 720px) {
  .hero-curl { width: 92vw; right: -30vw; top: calc(var(--header-h) + 140px); opacity: 0.55; }
  .page-curl { width: 48vw; opacity: 0.6; }
  .marquee { padding: 16px 0; }
}

/* ---- Page-long curl in the right margin of subpages (generated by curl.js) ---- */
body { position: relative; }
.curl-long {
  position: absolute; z-index: 0; pointer-events: none;
  top: 0; left: 0; width: 100%; max-width: none;
}
.curl-long path {
  fill: none; stroke: var(--green); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round;
  transition: opacity 0.2s linear; /* no lag: the tip must stay at the middle of the screen */
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) { .curl-long path { transition: none; } }
