/* ============================================================
   Pupcoach marketing site
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Be Vietnam Pro";
  src: url("/assets/fonts/BeVietnamPro-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Be Vietnam Pro";
  src: url("/assets/fonts/BeVietnamPro-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
/* Fraunces (OFL) — italic 500, used only for the hero hook accent. */
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/Fraunces-Italic.woff2") format("woff2");
  font-weight: 500; font-style: italic; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Section backgrounds */
  --sage: #E9E9C7;
  --white: #FFFFFF;
  --panel: #F9F9F7;
  --cream: #FEF2E8;

  /* Brand / accents */
  --ember: #EF7438;            /* buttons / fills (locked exact) */
  --ember-dark: #E2620F;
  --ember-text: #B5440C;       /* AA-compliant ember for small eyebrow text */
  --ember-glow: rgba(240, 115, 56, 0.40);
  --ink: #1F1A15;
  --ink-70: rgba(31, 26, 21, 0.72);
  --ink-55: rgba(31, 26, 21, 0.62);

  /* Layout */
  --maxw: 1280px;
  --gutter: clamp(20px, 2.8vw, 32px);
  --radius-pill: 999px;
  --wave-h: clamp(42px, 7.6vw, 112px);

  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.12; font-weight: 600; letter-spacing: -0.01em; }
ul, ol { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; border-radius: 4px; }

/* ---------- Helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font-size: clamp(13px, 1.05vw, 14px);
  font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ember-text); margin-bottom: 14px;
}
.eyebrow--center { text-align: center; }
/* Per-row feature eyebrows read as subtitles under the section eyebrows above. */
.feature__text .eyebrow {
  font-size: clamp(11px, 0.85vw, 12px);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(30px, 4.1vw, 46px);
  letter-spacing: -0.02em;
  text-align: center;
  max-width: 16ch;
  margin-inline: auto;
}
.section-title--left { text-align: left; margin-inline: 0; max-width: 18ch; }

.section-head { padding-block: clamp(8px, 1.6vw, 12px) clamp(28px, 4vw, 48px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; font-weight: 600;
  border-radius: var(--radius-pill); white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn--pill { background: var(--ember); color: #fff; padding: 12px 22px; font-size: 15px; box-shadow: 0 8px 20px var(--ember-glow); }
.btn--primary { background: var(--ember); color: #fff; box-shadow: 0 10px 28px var(--ember-glow); }
.btn--lg { padding: 17px 36px; font-size: 17px; }
.btn--primary:hover, .btn--pill:hover { background: var(--ember-dark); transform: translateY(-1px); box-shadow: 0 14px 32px var(--ember-glow); }
.btn--primary:active, .btn--pill:active { transform: translateY(0); }

/* ---------- "Get the app" pill (Apple glyph + label; placeholder link — leads nowhere for now) ---------- */
.btn--app { gap: 0.5em; }
.btn--app .btn__apple { height: 1.05em; width: auto; flex: none; }

/* ---------- Curved dividers ---------- */
.wave { display: block; width: 100%; height: var(--wave-h); }

/* ============================================================
   MASTHEAD (nav + hero) — sage
   ============================================================ */
/* position + z-index so the hero button's shadow paints above the following wave (not cropped by it). */
.masthead { background: var(--sage); position: relative; z-index: 1; }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
.nav__logo { display: inline-flex; align-items: center; gap: 2px; }
.nav__mark { width: auto; height: 52px; }
.nav__word { font-size: 25px; font-weight: 600; letter-spacing: -0.02em; }

.nav__menu { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); }
.nav__links { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); }
.nav__links a { font-size: 16px; font-weight: 500; color: var(--ink); opacity: .82; }
.nav__links a:hover { opacity: 1; }

.nav__toggle { display: none; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; align-items: center; justify-content: center; }
.nav__bars, .nav__bars::before, .nav__bars::after {
  content: ""; display: block; width: 24px; height: 2.5px; border-radius: 2px; background: var(--ink); transition: transform .2s ease, opacity .2s ease;
}
.nav__bars { position: relative; }
.nav__bars::before { position: absolute; top: -7px; }
.nav__bars::after { position: absolute; top: 7px; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: center;
  gap: clamp(16px, 2vw, 28px);
  padding-block: clamp(28px, 4vw, 56px) clamp(8px, 2vw, 24px);
}
.hero__copy { max-width: 700px; }
/* Fluid size with a fixed base + gentle slope (was 3.6vw, which shrank too fast to a too-small 32px floor). */
.hero__title { font-size: clamp(36px, 28px + 1.7vw, 50px); line-height: 1.16; margin-bottom: 22px; }
/* Accent the swapped words in "Don't train a dog, train your dog." — Fraunces italic 500 in --ember (bright).
   Self-hosted true 500 cut (OFL); Georgia/serif as graceful fallback if the webfont fails. */
.hero__title .hero__accent { font-family: "Fraunces", Georgia, "Times New Roman", serif; font-style: italic; font-weight: 500; font-size: 1.05em; color: var(--ember); }
.hero__body { font-size: clamp(16px, 1.25vw, 18px); color: var(--ink-70); max-width: 30em; margin-bottom: 30px; }
.hero__rating { display: flex; align-items: center; gap: 10px; margin-top: 26px; font-weight: 500; }
.stars { color: var(--ember); letter-spacing: 2px; font-size: 17px; }
.hero__rating-score { font-size: 15px; }
.hero__trust { font-size: 14px; color: var(--ink-55); margin-top: 6px; }

.hero__art { justify-self: end; position: relative; }
.hero__stack {
  position: relative;
  width: 100%; max-width: 720px;
  margin-right: -16px;
  margin-bottom: calc(-1 * var(--wave-h));
  z-index: 2;
}
.hero__stack img { width: 100%; }
/* Phone layer establishes the layout box and gets the content-aware shadow
   (drop-shadow follows the alpha channel of the phone-only PNG). */
.hero__phone {
  filter:
    drop-shadow(0 12px 18px rgba(31, 26, 21, 0.18))
    drop-shadow(0 4px 6px rgba(31, 26, 21, 0.10));
}
/* Dog + owner layer overlays the phone — no shadow on them. */
.hero__fig {
  position: absolute; inset: 0;
  pointer-events: none;
}

/* ============================================================
   HOW IT WORKS — white
   ============================================================ */
.how { padding-block: clamp(40px, 5vw, 72px) clamp(28px, 3.5vw, 48px); }
/* align-items: stretch (default) makes every card fill its grid row's height, so
   cards sharing a row are equal-height (extra height = empty space below the text).
   Per row: 4-up = one row, 2-up = two rows, 1-up (mobile) = natural single-card rows. */
.how__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(18px, 1.8vw, 26px); align-items: stretch; }
.how__card {
  border-radius: 28px;
  overflow: hidden;
  padding-bottom: 28px;
}
/* Pastel backgrounds sampled from each card's image so the bg flows seamlessly into the
   image's own pre-rendered rounded card at the top. */
.how__card:nth-child(1) { background: #D9DFCB; } /* sage */
.how__card:nth-child(2) { background: #F9D7C8; } /* peach */
.how__card:nth-child(3) { background: #DEEDEB; } /* pale teal */
.how__card:nth-child(4) { background: #FEECC2; } /* cream */
.how__card img { width: 100%; }
.how__card h3 { font-size: 19px; margin: 16px 0 8px; padding-inline: 22px; }
.how__card p { font-size: 15px; color: var(--ink-70); line-height: 1.55; padding-inline: 22px; }

/* ============================================================
   FEATURES — panel
   ============================================================ */
.features { background: var(--panel); }
.features .container { padding-block: clamp(32px, 4vw, 56px) clamp(40px, 5vw, 80px); }

.feature {
  display: grid; grid-template-columns: 1fr 1fr; align-items: start;
  gap: clamp(24px, 5vw, 90px);
  padding-block: clamp(20px, 2.6vw, 38px);
}
.feature--reverse .feature__text { order: 2; }
.feature--reverse .feature__art { order: 1; }
.feature__text {
  max-width: 30em;
  position: relative; z-index: 2;   /* keep text on top of any image extension */
}
.feature__text h3 { font-size: clamp(22px, 2.5vw, 30px); margin-bottom: 16px; }
.feature__text p { font-size: clamp(15px, 1.2vw, 17px); color: var(--ink-70); }

/* Each .feature__art column reserves a box anchored to the first feature image's
   aspect (1027×800). The card+image are absolutely positioned inside, so a taller
   image — like the AI Trainer one — extends below its row instead of stretching the
   row, and the row-to-row rhythm stays constant regardless of image height. */
.feature__art {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1027 / 800;
}
/* Colored rounded card fills the rhythm-anchor box — uniform height across all rows.
   The image inside has its natural height; anything taller than the card just spills
   past the bottom of the card BG (the rounded rect doesn't grow with it). */
.feature__card {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  /* no overflow: hidden — the image is allowed to extend past the card */
}
.feature__card img { width: 100%; }
.feature:nth-of-type(1) .feature__card { background: #FBD8C7; } /* peach */
.feature:nth-of-type(2) .feature__card { background: #D6DDCA; } /* sage */
.feature:nth-of-type(3) .feature__card { background: #DDEDEA; } /* pale teal */
.feature:nth-of-type(4) .feature__card { background: #FDEBC2; } /* cream */
/* Centre-anchored: each column's content hugs the central gutter, so every row shares the
   same centre gap and the text/image align on their inner (gutter-facing) edges; the extra
   space falls to the outer margins. */
.feature:not(.feature--reverse) .feature__text { justify-self: end; }
.feature:not(.feature--reverse) .feature__art  { justify-self: start; }
.feature--reverse .feature__text { justify-self: start; }
.feature--reverse .feature__art  { justify-self: end; }

/* ============================================================
   FAQ — white
   ============================================================ */
.faq {
  display: grid; grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(24px, 4vw, 72px);
  padding-block: clamp(48px, 6vw, 90px);
  align-items: start;
}
.faq__intro { position: sticky; top: 24px; }
.faq__art { margin-top: clamp(24px, 4vw, 56px); width: 100%; max-width: 460px; }

.faq__list { display: flex; flex-direction: column; gap: 14px; }
.faq__list details {
  background: var(--panel); border-radius: 16px; padding: 4px 24px;
  border: 1px solid rgba(31,26,21,0.05);
}
.faq__list summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  list-style: none; cursor: pointer; padding: 20px 0;
  font-weight: 600; font-size: clamp(16px, 1.3vw, 18px);
}
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::after {
  content: "+"; font-size: 26px; font-weight: 500; color: var(--ink-55);
  line-height: 1; transition: transform .2s ease;
}
.faq__list details[open] summary::after { content: "−"; }
.faq__answer { padding: 0 0 22px; }
.faq__answer p { color: var(--ink-70); font-size: 16px; max-width: 54ch; }

/* ============================================================
   FINAL CTA — cream -> autumn scene, fading into the ember footer
   ============================================================ */
.cta { position: relative; isolation: isolate; background: var(--cream); overflow: hidden; }
.cta__scene { width: 100%; }
/* Fade the bottom of the scene into the footer's ember so there's no hard seam.
   Starts from a transparent ember (not the `transparent` keyword, which would
   muddy the blend through transparent-black) and lands on solid --ember. */
.cta::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: clamp(80px, 11vw, 170px);
  background: linear-gradient(to bottom, rgba(239, 116, 56, 0), var(--ember));
  pointer-events: none;
}
.cta__content { text-align: center; }
.cta__content .section-title { max-width: 14ch; }
.cta__body { font-size: clamp(16px, 1.25vw, 18px); color: var(--ink-70); max-width: 36ch; margin: 18px auto 30px; }
.cta__sub { font-size: 14px; color: var(--ink-55); margin-top: 18px; }

/* desktop/tablet: overlay text on the scene's open sky + central gap */
@media (min-width: 761px) {
  .cta__content { position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2; width: 100%; padding-top: clamp(34px, 5vw, 92px); }
}
/* small screens: text in flow above the scene */
@media (max-width: 760px) {
  .cta__content { padding-block: clamp(40px, 8vw, 60px) clamp(18px, 5vw, 30px); }
}

/* ============================================================
   FOOTER — solid ember band the CTA scene fades into
   ============================================================ */
.footer { background: var(--ember); padding-block: clamp(22px, 3vw, 36px); }
.footer__bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer__copy { font-size: 13px; color: rgba(31,26,21,0.78); }
.footer__copy a { color: inherit; }
.footer__copy a:hover { color: var(--ink); text-decoration: underline; }
.footer__links { display: flex; gap: clamp(18px, 2vw, 32px); }
.footer__links a { font-size: 13px; color: rgba(31,26,21,0.86); }
.footer__links a:hover { color: var(--ink); text-decoration: underline; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; text-align: center; gap: 8px; }
  .hero__copy { max-width: 640px; margin-inline: auto; }
  .hero__body { margin-inline: auto; }
  .hero__rating { justify-content: center; }
  .hero__art { justify-self: center; margin-top: 12px; }
  .hero__stack { max-width: min(440px, 84vw); margin-right: 0; }

  .how__grid { grid-template-columns: repeat(2, 1fr); gap: 26px 22px; }

  .feature { grid-template-columns: 1fr; gap: 22px; text-align: center; }
  .feature__text { max-width: 40em; margin-inline: auto; justify-self: center; }
  /* In the single-column layout, text always goes first and the image second,
     regardless of the desktop "reverse" modifier. Force the stacking order. */
  .feature__text,
  .feature--reverse .feature__text { order: 1; }
  .feature__art,
  .feature--reverse .feature__art,
  .feature:not(.feature--reverse) .feature__art { order: 2; justify-self: center; }
  .feature__art img { margin-inline: auto; }

  .faq { grid-template-columns: 1fr; }
  .faq__intro { position: static; text-align: center; }
  .section-title--left { text-align: center; margin-inline: auto; }
  .faq__art { margin-inline: auto; }
}

@media (max-width: 760px) {
  /* Collapse nav into hamburger menu */
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 8px;
    background: var(--sage); padding: 12px var(--gutter) 22px;
    box-shadow: 0 18px 30px rgba(31,26,21,0.10);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    z-index: 40;
  }
  .nav { position: relative; }
  .masthead { position: relative; }
  .nav.is-open .nav__menu { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav__links { flex-direction: column; align-items: flex-start; gap: 4px; }
  .nav__links a { display: block; padding: 10px 4px; font-size: 17px; opacity: 1; }
  .nav__cta { width: 100%; margin-top: 8px; padding-block: 14px; font-size: 16px; }
  .nav.is-open .nav__bars { background: transparent; }
  .nav.is-open .nav__bars::before { transform: translateY(7px) rotate(45deg); }
  .nav.is-open .nav__bars::after { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 540px) {
  .how__grid { grid-template-columns: 1fr; max-width: 360px; margin-inline: auto; }
  .how__card { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
