/* ==========================================================
   Koda Takes One Paw Forward — site styles

   To change a colour across the whole site, edit it once in
   the ":root" block below. Contrast ratios (WCAG AA needs 4.5:1
   for text) are noted next to each text colour.
   ========================================================== */

:root {
  /* ---- Brand colours ---- */
  --bg:          #F5E6C8;  /* page background (light golden amber) */
  --ink:         #1C1B19;  /* headings — Koda's black fur — 14:1 on background */
  --text:        #4E4A46;  /* body text — warm charcoal — 7.1:1 on background */
  --btn:         #9B3A4A;  /* buttons — cream text on it is 5.5:1 */
  --btn-hover:   #722F37;  /* button hover */
  --nav-bg:      #1C1B19;  /* navigation bar & footer — Koda's black fur */
  --nav-text:    #F5E6C8;  /* navigation text & icons — 14:1 on nav */
  --gold:        #C4851A;  /* highlights & paw prints (decoration only, never text) */

  /* ---- Soft tints used for cards and placeholders ---- */
  --card:        #FBF3E3;
  --tint:        #EEDCB8;
  --line:        rgba(28, 27, 25, .16);
  --white:       #ffffff;

  /* ---- Fonts ---- */
  --serif: "Playfair Display", Georgia, serif;
  --sans:  "Lato", "Helvetica Neue", Arial, sans-serif;

  /* ---- Layout ---- */
  --max:  1160px;
  --read: 680px;
  --ease: cubic-bezier(.22, 1, .36, 1);

  /* ---- Still sketched arrow cursors (used on touch screens / reduced motion; gold, cream over clickable things) ---- */
  --cursor-paw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='24' viewBox='0 0 20 24'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.35' numOctaves='2' seed='3'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='1.1'/%3E%3C/filter%3E%3Cpath filter='url(%23s)' d='M2 2 L2.4 18.6 L6.6 14.6 L9.7 21.3 L12.8 19.9 L9.7 13.4 L15.6 13.1 Z' fill='%23C4851A' stroke='%231C1B19' stroke-width='1.35' stroke-linejoin='round'/%3E%3C/svg%3E") 2 2, auto;
  --cursor-paw-link: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='24' viewBox='0 0 20 24'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.35' numOctaves='2' seed='3'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='1.1'/%3E%3C/filter%3E%3Cpath filter='url(%23s)' d='M2 2 L2.4 18.6 L6.6 14.6 L9.7 21.3 L12.8 19.9 L9.7 13.4 L15.6 13.1 Z' fill='%23F5E6C8' stroke='%231C1B19' stroke-width='1.35' stroke-linejoin='round'/%3E%3C/svg%3E") 2 2, pointer;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  scroll-padding-top: 96px; /* keeps headings clear of the sticky nav */
}

body {
  position: relative;
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

@media (pointer: fine) {
  body { cursor: var(--cursor-paw); }
  a, button, label, summary, input[type="checkbox"] { cursor: var(--cursor-paw-link); }
  input[type="email"] { cursor: text; }
}

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
}

p { margin: 0 0 1.2em; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--btn); }
::selection { background: var(--btn); color: var(--nav-text); }

/* Clear focus ring for keyboard users */
:focus-visible {
  outline: 3px solid var(--btn);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: 32px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--btn);
  color: var(--nav-text);
  font-weight: 700;
}
.skip-link:focus { top: 12px; color: var(--nav-text); }

/* ---------- Image placeholders ----------
   Any image inside .ph that hasn't been added yet shows a labelled box. */
.ph {
  position: relative;
  overflow: hidden;
  background: var(--tint);
}
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph.missing img { visibility: hidden; }
.ph.missing::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--text);
  font: italic 400 18px/1.4 var(--serif);
  text-align: center;
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(28, 27, 25, .045) 14px 28px),
    var(--tint);
}

/* ---------- Paw-print scroll trail ---------- */
/* Sits above the page content (so prints stay visible over photos like the
   Meet Koda banner) but below the nav bar; it never blocks clicks. */
.paw-trail {
  position: absolute;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
}
.paw-print {
  position: absolute;
  width: 40px;
  height: 40px;
  fill: var(--gold);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--r)) scale(var(--s, 1), 1);
  animation: pawFade 3.6s ease-in-out forwards;
}
@keyframes pawFade {
  0%   { opacity: 0; }
  20%  { opacity: var(--o, .65); }
  55%  { opacity: var(--o, .65); }
  100% { opacity: 0; }
}

/* ---------- Animated sketched arrow cursor (drawn by js/main.js, section 6) ---------- */
html.has-sketch-cursor,
html.has-sketch-cursor * { cursor: none !important; }
html.has-sketch-cursor input[type="email"],
html.has-sketch-cursor input[type="text"],
html.has-sketch-cursor textarea { cursor: text !important; }

.sketch-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  pointer-events: none;
  will-change: transform;
}
.sketch-cursor svg {
  display: block;
  overflow: visible;
  transform-origin: 2px 2px;   /* lean and squish around the arrow's tip */
  transition: scale .15s ease-out, opacity .15s;
}
.sketch-cursor .sketch-fill { fill: var(--gold); opacity: .9; }
.sketch-cursor .sketch-lines {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sketch-cursor.is-link svg { scale: 1.15; }
.sketch-cursor.is-link .sketch-fill { fill: var(--nav-text); opacity: .95; }  /* cream: shows on burgundy buttons and the amber page */
.sketch-cursor.is-down svg { scale: .85; }
.sketch-cursor.is-hidden svg { opacity: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  border: 0;
  border-radius: 999px;
  background: var(--btn);
  color: var(--nav-text);
  font: 700 16px/1.2 var(--sans);
  letter-spacing: .03em;
  text-decoration: none;
  box-shadow: 0 10px 24px -14px rgba(114, 47, 55, .9);
  transition: background .35s ease, transform .35s var(--ease), box-shadow .35s ease;
}
.btn:hover {
  background: var(--btn-hover);
  color: var(--nav-text);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -14px rgba(114, 47, 55, 1);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .65; transform: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-small { padding: 12px 22px; font-size: 15px; }

/* ---------- Navigation bar ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--nav-bg);
  color: var(--nav-text);
  box-shadow: 0 6px 20px -12px rgba(28, 27, 25, .6);
}
/* Layout: site name on the left · Home | Meet Koda on the right · Instagram icon at the far right */
.site-nav .wrap {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  min-height: 72px;
}
.site-name {
  color: var(--nav-text);
  font: 500 19px/1.2 var(--serif);
  text-decoration: none;
}
.site-name:hover { color: var(--nav-text); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  letter-spacing: .04em;
}
.nav-links .divider { color: rgba(245, 230, 200, .4); }
.nav-links a {
  position: relative;
  display: block;
  padding: 8px 12px;
  color: var(--nav-text);
  text-decoration: none;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-ig {
  justify-self: end;
  margin-left: 6px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--nav-text);
  transition: background .25s, transform .35s var(--ease);
}
.nav-ig:hover { color: var(--nav-text); background: rgba(245, 230, 200, .12); transform: rotate(-8deg); }
.nav-ig svg { width: 22px; height: 22px; }

/* ---------- Ornament (small painted paw between sections) ---------- */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  max-width: 300px;
  margin: 0 auto;
}
.ornament::before,
.ornament::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ornament svg { width: 26px; height: 26px; fill: var(--gold); }

/* ---------- Section headings ---------- */
.section-title { font-size: clamp(32px, 4vw, 50px); text-align: center; }
.section-sub {
  max-width: 540px;
  margin: 14px auto 40px;
  font-size: 19px;
  text-align: center;
}

/* ==========================================================
   HOME
   ========================================================== */

/* ---------- Hero: small Koda, big title, then a two-column signup ---------- */
.hero { padding-block: 0 104px; }
.hero > .wrap { padding-top: 40px; }   /* backdrop extends above Koda so the blend works while he moves */
/* ---------- Animated Koda batting his ball ----------
   Three stacked layers (body, ball, toes). A "darken" blend turns the
   illustration's cream paper into the exact page colour, so there's no square edge.
   Layer positions are percentages of the picture (printed by tools/make-koda-layers.mjs). */
.koda-stage {
  position: relative;
  width: min(86vw, 460px);
  aspect-ratio: 1;
  margin: 0 auto;
  isolation: isolate;
  mix-blend-mode: darken;
}
.hero > .wrap { background: var(--bg); }   /* gives the blend the page colour to work with */
.koda-layer { position: absolute; display: block; max-width: none; }
.koda-body { inset: 0; width: 100%; height: 100%; }
.koda-ball { left: 40.25%; top: 71.8%; width: 26.9%; height: 23.65%; }
.koda-toes { left: 40.25%; top: 71.8%; width: 26.9%; height: 3.2%; }
.koda-ball-shadow {
  position: absolute;
  left: 43%;
  top: 92.5%;
  width: 21%;
  height: 3.2%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .28), transparent);
}

/* One 7-second loop: rest → Koda lifts his paw and leans in → the ball rolls out,
   spinning → it rolls back under his paw → rest */
@media (prefers-reduced-motion: no-preference) {
  .koda-body, .koda-toes { transform-origin: 50% 92%; animation: kodaPounce 7s var(--ease) infinite; }
  .koda-ball { transform-origin: 50% 50%; animation: ballRoll 7s cubic-bezier(.3, .7, .3, 1) infinite; }
  .koda-ball-shadow { animation: shadowRoll 7s cubic-bezier(.3, .7, .3, 1) infinite; }
}
@keyframes kodaPounce {
  0%, 30%  { transform: none; }
  38%      { transform: translateY(-1.4%) rotate(-1.2deg); }   /* lifts the paw */
  46%      { transform: translateY(.5%) rotate(.6deg); }       /* bats! */
  56%      { transform: translateY(-.3%) rotate(-.3deg); }
  64%, 100%{ transform: none; }
}
@keyframes ballRoll {
  0%, 40%  { transform: none; }
  54%      { transform: translateX(20%) rotate(78deg); }       /* rolls away */
  62%      { transform: translateX(16%) rotate(62deg); }       /* wobbles to a stop */
  76%      { transform: translateX(-2%) rotate(-6deg); }       /* rolls back */
  84%, 100%{ transform: none; }
}
@keyframes shadowRoll {
  0%, 40%  { transform: none; }
  54%      { transform: translateX(26%); }
  62%      { transform: translateX(21%); }
  76%      { transform: translateX(-3%); }
  84%, 100%{ transform: none; }
}

.signup-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px 80px;
  max-width: 1080px;
  margin: 48px auto 0;   /* space below the small Koda image */
}
.signup-words h2 {
  margin-bottom: 36px;
  font-size: clamp(32px, 3.6vw, 52px);
  font-weight: 400;
  line-height: 1.12;
}
.signup-words p { margin: 0; color: var(--ink); font: 400 clamp(20px, 1.8vw, 26px)/1.4 var(--serif); }

/* Email field and button side by side; note centred underneath */
.signup-inline .field-row { display: flex; gap: 14px; align-items: stretch; }
.signup-form.signup-inline input[type="email"] {
  flex: 1;
  min-width: 0;
  border-radius: 4px;
  padding: 18px 22px;
}
.signup-form.signup-inline .btn { flex: none; border-radius: 14px; padding: 18px 30px; font-size: 17px; }
.signup-side .form-note { margin-top: 10px; }

/* Form order (top to bottom): email, checkboxes, button */
.signup-form input[type="email"] {
  width: 100%;
  padding: 15px 22px;
  border: 1.5px solid rgba(28, 27, 25, .35);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: 400 17px var(--sans);
  transition: border-color .2s;
}
.signup-form input[type="email"]::placeholder { color: #7d7064; }
.signup-form input[type="email"]:focus { border-color: var(--btn); }
.signup-form input[aria-invalid="true"] { border-color: var(--btn); }

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.5;
}
.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--btn);
}

.check .consent-link {           /* quiet Privacy Policy link in the consent line */
  margin-left: 6px;
  color: var(--text);               /* 6.4:1, still readable */
  font-size: 13px;
  text-decoration-color: rgba(78, 74, 70, .35);
  text-decoration-thickness: 1px;
}
.check .consent-link:hover { color: var(--ink); text-decoration-color: currentColor; }
/* Beta-reader option: no box — the words themselves glow softly in gold, with twinkling sparkles */
.check-beta {
  position: relative;
  color: var(--ink);
  font-weight: 700;
}
.check-beta span { position: relative; text-shadow: 0 0 0 rgba(196, 133, 26, 0); transition: text-shadow .3s; }
.check-beta:has(input:checked) span { text-shadow: 0 0 10px rgba(196, 133, 26, .65); }
.twinkle {
  position: absolute;
  width: 11px;
  height: 11px;
  background: var(--gold);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  pointer-events: none;
}
.twinkle.t1 { top: -9px; right: -14px; }
.twinkle.t2 { top: 8px; right: -24px; width: 8px; height: 8px; }
.twinkle.t3 { top: -6px; left: 38%; width: 7px; height: 7px; }
@media (prefers-reduced-motion: no-preference) {
  .check-beta span { animation: betaGlow 3.2s ease-in-out infinite; }
  .check-beta:has(input:checked) span { animation: none; }
  .twinkle { animation: twinkle 2.4s ease-in-out infinite; }
  .twinkle.t2 { animation-delay: .8s; }
  .twinkle.t3 { animation-delay: 1.6s; }
}
@keyframes betaGlow {
  0%, 100% { text-shadow: 0 0 0 rgba(196, 133, 26, 0); }
  50%      { text-shadow: 0 0 10px rgba(196, 133, 26, .6); }
}
@keyframes twinkle {
  0%, 100% { opacity: .15; transform: scale(.5) rotate(0deg); }
  50%      { opacity: 1;   transform: scale(1.1) rotate(45deg); }
}

.check .required { font-size: 14px; font-style: italic; }
.btn-submit { display: flex; width: 100%; margin-top: 22px; }

.form-status {
  min-height: 1.6em;
  margin: 14px 0 0;
  font-size: 16px;
}
.form-status.ok { color: var(--ink); font-weight: 700; }
.form-status.err { color: var(--btn-hover); font-weight: 700; }
.form-note { margin: 4px 0 0; font-size: 15px; font-style: italic; text-align: center; }

/* Thank-you message that replaces the form after a successful signup */
.signup-success {
  padding: 28px 30px;
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  background: var(--card);
  text-align: left;
  animation: successIn .7s var(--ease) both;
}
.signup-success:focus { outline: none; }
.signup-success p { margin: 0; font-size: 17px; }
.signup-success .signup-success-title {
  margin-bottom: 8px;
  color: var(--ink);
  font: 500 clamp(26px, 2.6vw, 32px)/1.2 var(--serif);
}
@keyframes successIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* Honeypot: hidden from people, filled in by spam bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Meet Koda banner ---------- */
.banner {
  position: relative;
  display: block;
  min-height: clamp(460px, 44vw, 640px);
  overflow: hidden;
  color: var(--nav-text);
  text-decoration: none;
  isolation: isolate;
}
.banner .ph { position: absolute; inset: 0; z-index: -2; }
.banner .ph img {
  object-position: 50% 12%;
  transition: transform 1.2s var(--ease);
}
.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(165deg, rgba(28, 27, 25, .85) 0%, rgba(28, 27, 25, .5) 32%, rgba(28, 27, 25, 0) 58%);
}
.banner .wrap {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  min-height: clamp(460px, 44vw, 640px);
  padding-block: 48px;
}
.banner-text {
  max-width: 400px;
  margin: 0 0 24px;
  color: var(--nav-text);
  font: 500 clamp(28px, 3vw, 40px)/1.15 var(--serif);
  text-shadow: 0 2px 16px rgba(28, 27, 25, .5);
}
.banner:hover { color: var(--nav-text); }
.banner:hover .ph img { transform: scale(1.04); }
/* The "Our Story" button reacts only when the cursor is on the button itself (its own .btn:hover);
   keyboard users still see it highlighted when the banner link is focused. */
.banner:focus-visible .btn { background: var(--btn-hover); }

/* ---------- Instagram ---------- */
.instagram { padding-block: 40px 112px; text-align: center; }
.instagram .section-sub {               /* now the section's heading line: same font as the other headings */
  margin-top: 0;
  max-width: 720px;
  color: var(--ink);
  font: 400 clamp(24px, 2.6vw, 34px)/1.3 var(--serif);
}
.feed { max-width: 960px; margin: 0 auto; }
.feed-consent {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px;
  border: 1.5px dashed rgba(28, 27, 25, .3);
  border-radius: 20px;
  font-size: 16px;
}
.feed-consent p { margin-bottom: 16px; }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  box-shadow: none;
}
.btn-outline:hover { background: var(--ink); color: var(--nav-text); box-shadow: none; }
.instagram > .btn { margin-top: 44px; }

/* ==========================================================
   ABOUT — big photo hero, Koda's story, puppy filmstrip,
   and the author's photo laid on a sheet of paper
   ========================================================== */

/* Soft paper grain, used on the paper cards and the signup band */
:root {
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .17  0 0 0 0 .12  0 0 0 0 .08  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Hero ---------- */
.about-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(calc(100svh - 72px), 900px);
  overflow: hidden;
  color: var(--nav-text);
  background: var(--nav-bg);
  isolation: isolate;
}
.about-hero-bg { position: absolute; inset: 0; z-index: -2; }
.about-hero-bg img { object-position: 70% 20%; animation: slowZoom 18s ease-out both; }
@keyframes slowZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
/* Black wash so the cream headline is always easy to read */
.about-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(28, 27, 25, .92) 0%, rgba(28, 27, 25, .7) 40%, rgba(28, 27, 25, .15) 75%),
    linear-gradient(0deg, rgba(28, 27, 25, .7) 0%, rgba(28, 27, 25, 0) 45%);
}
.about-hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 32px;
  padding-block: 120px 72px;
}
.eyebrow {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .85;
}
.about-hero-title {
  margin: 0;
  color: var(--nav-text);
  font-size: clamp(46px, 7.4vw, 104px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.01em;
}
.about-hero-title .accent {
  display: block;
  max-width: 15em;
  margin-top: .45em;
  color: var(--gold);           /* 5.5:1 on the black wash */
  font-size: .4em;
  font-style: italic;
  line-height: 1.25;
}

/* ---------- Chapters (About Koda, About the Author) ---------- */
.chapter { padding-block: 72px 88px; }
.chapter-title {
  margin-bottom: 56px;
  font-size: clamp(44px, 6vw, 80px);
  font-weight: 400;
  text-align: center;
}
.chapter-text { max-width: var(--read); margin: 0 auto; }
.chapter-text h3 {
  margin-bottom: 28px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 400;
  line-height: 1.25;
}
.author-note {
  max-width: var(--read);
  margin: 56px auto 0;
  font-style: italic;
}
/* A hand-drawn brush stroke, centred above the note (instead of a straight rule) */
.author-note::before {
  content: "";
  display: block;
  width: 180px;
  height: 14px;
  margin: 0 auto 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 14'%3E%3Cpath d='M3 8 C 18 4, 30 10, 46 7 S 74 3, 90 7 S 118 10, 137 5' fill='none' stroke='%23C4851A' stroke-width='2.6' stroke-linecap='round'/%3E%3Cpath d='M8 9.5 C 26 7, 40 11, 58 8.5 S 92 6, 112 9' fill='none' stroke='%23C4851A' stroke-width='1.1' stroke-linecap='round' opacity='.55'/%3E%3C/svg%3E") no-repeat center / contain;
}
/* ---------- About the Author: a letter ----------
   The letter looks like a real sheet of paper: warm off-white with fibres and grain,
   softly aged edges, a faint fold across the middle and slightly uneven (deckled)
   edges. A black and white polaroid is taped over its top-left corner and sways
   gently; the text flows around it. */
.letter {
  max-width: 820px;
  margin: 0 auto;
  padding: 64px 0 0 48px;              /* room for the polaroid poking out of the top-left corner */
  /* the shadow follows the paper's uneven edges */
  filter: drop-shadow(0 22px 26px rgba(28, 27, 25, .2)) drop-shadow(0 2px 3px rgba(28, 27, 25, .1));
}
.letter-paper {
  position: relative;
  padding: 72px 76px 56px;
  transform: rotate(-.5deg);
}
/* The sheet itself sits on a layer behind the text, so its uneven edges don't
   clip the polaroid that pokes out past the corner. */
.letter-paper::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    /* a faint fold across the middle */
    linear-gradient(180deg, transparent 49.7%, rgba(28, 27, 25, .045) 50%, rgba(255, 255, 255, .55) 50.25%, transparent 50.8%),
    /* softly aged, slightly darker edges */
    radial-gradient(120% 90% at 50% 45%, transparent 62%, rgba(150, 110, 60, .13) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.5' numOctaves='2' seed='8'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .36  0 0 0 0 .25  0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E"),
    var(--paper-grain),
    #FBF4E6;
  /* slightly uneven, hand-cut edges */
  clip-path: polygon(0.4% 0.6%, 18% 0, 37% 0.5%, 55% 0.1%, 74% 0.6%, 99.5% 0, 100% 22%, 99.6% 46%, 100% 71%, 99.5% 99.4%,
                     78% 100%, 57% 99.5%, 34% 100%, 13% 99.4%, 0 100%, 0.5% 76%, 0 51%, 0.4% 27%);
}
.letter-paper p { position: relative; text-align: justify; hyphens: auto; }   /* an even, balanced block of text */
.letter-paper .letter-sign { text-align: right; }
.letter-paper > p + p { margin-top: 1.1em; }

/* Top of the letter: polaroid on the corner, title beside it at the same height */
.letter-head {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 44px;
  margin: -124px 0 22px -124px;        /* pulls the polaroid out over the corner */
}
.letter-title {
  margin: 0;
  padding-top: 60px;                   /* sits level with the photo, below the paper's top edge */
  font-size: clamp(24px, 2.7vw, 38px);
  font-weight: 400;
  line-height: 1.05;
  white-space: nowrap;                 /* always on one line */
}
.letter-sign {
  clear: both;
  margin: 28px 0 0;
  color: var(--ink);
  font: 600 40px/1 "Caveat", "Segoe Script", cursive;
  text-align: right;
}

/* The polaroid: a thick white frame with a deep bottom, like a real polaroid */
.letter-photo {
  position: relative;
  width: 360px;
  margin: 0;
  padding: 16px 16px 58px;
  background: #fff;
  box-shadow: 0 22px 40px -18px rgba(28, 27, 25, .55), 0 1px 2px rgba(28, 27, 25, .12);
  transform: rotate(-4deg);
  transform-origin: 50% 0;             /* swings from the sticker */
  overflow: visible;
}
.letter-photo img { width: 100%; aspect-ratio: 1024 / 739; height: auto; object-fit: cover; }
.letter-photo::before {                /* a cute paw-print sticker holding it on */
  content: "";
  position: absolute;
  z-index: 1;
  top: -16px;
  left: 50%;
  width: 116px;
  height: 34px;
  border-radius: 3px;
  /* paw prints scattered as if a puppy trotted across it */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='116' height='34' viewBox='0 0 116 34'%3E%3Cdefs%3E%3Csymbol id='p' viewBox='-4 -4 72 72'%3E%3Cpath d='M32 30c-8 0-15 7-17 14-2 7 3 12 9 11 4-1 6-3 8-3s4 2 8 3c6 1 11-4 9-11-2-7-9-14-17-14z'/%3E%3Cellipse cx='13.5' cy='29' rx='5.6' ry='7.4' transform='rotate(-28 13.5 29)'/%3E%3Cellipse cx='24' cy='16.5' rx='5.9' ry='8' transform='rotate(-10 24 16.5)'/%3E%3Cellipse cx='40.5' cy='16' rx='6' ry='8.2' transform='rotate(8 40.5 16)'/%3E%3Cellipse cx='51' cy='28.5' rx='5.5' ry='7.3' transform='rotate(26 51 28.5)'/%3E%3C/symbol%3E%3C/defs%3E%3Cg fill='%23C4851A'%3E%3Cuse href='%23p' width='13.3' height='13.3' x='-5.1' y='12.6' opacity='0.36' transform='rotate(60 1.6 19.2)'/%3E%3Cuse href='%23p' width='12.5' height='12.5' x='11.2' y='0.2' opacity='0.33' transform='rotate(58 17.5 6.5)'/%3E%3Cuse href='%23p' width='12.1' height='12.1' x='24.4' y='15.4' opacity='0.25' transform='rotate(113 30.5 21.4)'/%3E%3Cuse href='%23p' width='14.7' height='14.7' x='40.3' y='5.5' opacity='0.32' transform='rotate(95 47.7 12.9)'/%3E%3Cuse href='%23p' width='14.3' height='14.3' x='60.9' y='17.2' opacity='0.26' transform='rotate(75 68.0 24.3)'/%3E%3Cuse href='%23p' width='14.1' height='14.1' x='69.7' y='2.2' opacity='0.37' transform='rotate(68 76.7 9.3)'/%3E%3Cuse href='%23p' width='12.7' height='12.7' x='88.8' y='15.5' opacity='0.24' transform='rotate(59 95.2 21.9)'/%3E%3Cuse href='%23p' width='12.1' height='12.1' x='101.2' y='4.7' opacity='0.37' transform='rotate(77 107.3 10.8)'/%3E%3Cuse href='%23p' width='14.0' height='14.0' x='112.7' y='20.2' opacity='0.28' transform='rotate(104 119.7 27.2)'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat, rgba(250, 238, 214, .92);
  box-shadow: 0 1px 3px rgba(28, 27, 25, .14), inset 0 0 0 1px rgba(196, 133, 26, .18);
  transform: translateX(-50%) rotate(3deg);
}
/* A gentle sway, as if lightly taped on */
@media (prefers-reduced-motion: no-preference) {
  .letter-photo { animation: polaroidSway 7s ease-in-out infinite; }
}
@keyframes polaroidSway {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50%      { transform: rotate(-2.2deg) translateY(-5px); }
}

/* Tablets: a slightly smaller polaroid, still on the corner */
@media (max-width: 1000px) {
  .letter { padding: 48px 0 0 20px; }
  .letter-paper { padding: 56px 44px 44px; }
  .letter-head { gap: 28px; margin: -96px 0 18px -60px; }
  .letter-photo { width: min(46vw, 300px); padding: 12px 12px 44px; }
  .letter-title { padding-top: 44px; }
}

.chapter-koda { padding-block: 88px 24px; }

/* ---------- Puppy photo filmstrip ----------
   One row of photos gliding slowly to the left, looping forever
   (js/main.js, section 8, repeats the row). Hover or the button pauses it. */
.puppy-strip {
  position: relative;
  overflow: hidden;
  padding-block: 40px 104px;
  /* soft fade at both ends */
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.strip-track {
  display: flex;
  width: max-content;      /* spacing comes from each photo's right margin, so the loop is seamless */
}
.strip-photo {
  flex: none;
  height: clamp(220px, 30vw, 340px);
  margin: 0;
  overflow: hidden;
  margin-right: 24px;
  border-radius: 6px;
  box-shadow: 0 24px 50px -34px rgba(28, 27, 25, .6);
}
.strip-photo:nth-child(5n+2), .strip-photo:nth-child(5n+4) { margin-top: 28px; }  /* gentle up-and-down rhythm */
.strip-photo img { width: auto; height: 100%; max-width: none; object-fit: cover; }
.strip-photo:nth-child(5n+2) img { aspect-ratio: 4 / 5; object-position: 52% 40%; }  /* the close-up, portrait */

.strip-moving .strip-track { animation: stripGlide 60s linear infinite; }
.strip-moving:hover .strip-track { animation-play-state: paused; }
@keyframes stripGlide { to { transform: translateX(-50%); } }

/* Without movement (reduced motion, or no script) the row can be swiped/scrolled */
.puppy-strip:not(.strip-moving) { overflow-x: auto; mask-image: none; }


/* ==========================================================
   LEGAL PAGES (privacy, cookies) & 404
   ========================================================== */
.legal { max-width: var(--read); margin: 0 auto; padding-block: 64px 96px; }
.legal h1 { margin-bottom: 8px; font-size: clamp(36px, 4.4vw, 52px); }
.legal .updated { margin-bottom: 40px; font-size: 15px; font-style: italic; }
.legal h2 { margin: 40px 0 12px; font-size: 26px; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: .5em; }
.legal table { width: 100%; border-collapse: collapse; margin: 8px 0 24px; font-size: 16px; }
.legal th, .legal td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal th { color: var(--ink); }

.not-found { padding-block: 120px; text-align: center; }
.not-found h1 { font-size: clamp(40px, 5vw, 64px); margin-bottom: 16px; }

/* ==========================================================
   FOOTER
   ========================================================== */
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--nav-bg);
  color: var(--nav-text);
  font-size: 15px;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 32px;
}
.site-footer p { margin: 0; }
.site-footer a,
.site-footer .link-btn {
  color: var(--nav-text);
  text-decoration-color: var(--gold);
}
.site-footer a:hover,
.site-footer .link-btn:hover { color: #ffffff; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================
   COOKIE BANNER
   ========================================================== */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 26px;
  border-radius: 20px;
  background: var(--nav-bg);
  color: var(--nav-text);
  box-shadow: 0 24px 50px -20px rgba(28, 27, 25, .7);
  font-size: 15px;
  line-height: 1.6;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { flex: 1 1 320px; margin: 0; }
.cookie-banner a { color: var(--nav-text); }
.cookie-actions { display: flex; gap: 10px; }
.cookie-banner .btn-outline { color: var(--nav-text); border-color: var(--nav-text); }
.cookie-banner .btn-outline:hover { background: var(--nav-text); color: var(--ink); }

/* ==========================================================
   EDITORIAL TOUCHES (inspired by pear.no): rising headlines
   ========================================================== */

/* Headlines that rise in, line by line (js/main.js, section 7) */
.rise-line { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.rise-inner {
  display: block;
  transform: translateY(105%);
  transition: transform 1.1s var(--ease);
  transition-delay: calc(var(--i, 0) * .12s);
}
.risen .rise-inner { transform: none; }

/* ---------- Gentle reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 820px) {
  /* Nav stays on ONE row: name left · Home | Meet Koda · Instagram icon at the end */
  .site-name { font-size: 17px; }
  .signup-split { grid-template-columns: 1fr; }
}

/* Small phones: make the one-row nav more compact. The site name may wrap
   onto two short lines so the links and icon always fit beside it. */
@media (max-width: 480px) {
  .site-nav .wrap { gap: 2px; min-height: 64px; padding-block: 8px; }
  .site-name { font-size: 15px; line-height: 1.25; }
  .nav-links { gap: 0; font-size: 14px; letter-spacing: .02em; }
  .nav-links a { padding: 8px 7px; }
  .nav-links a::after { left: 7px; right: 7px; }
  .nav-ig { width: 38px; height: 38px; margin-left: 0; }
  .nav-ig svg { width: 20px; height: 20px; }
}

@media (max-width: 640px) {
  body { font-size: 17px; }
  .wrap { padding-inline: 16px; }
  .hero { padding-block: 0 64px; }
  .hero > .wrap { padding-top: 28px; }
  .signup-inline .field-row { flex-direction: column; }
  .signup-form .btn { width: 100%; }
  .banner, .banner .wrap { min-height: 420px; }
  .banner::before { background: linear-gradient(0deg, rgba(28, 27, 25, .88) 0%, rgba(28, 27, 25, .5) 60%, rgba(28, 27, 25, .2) 100%); }
  .banner .wrap { justify-content: flex-end; }
  .instagram { padding-block: 28px 80px; }
  .instagram > .btn { width: 100%; }
  .about-hero { min-height: 82svh; }
  .about-hero-inner { padding-block: 96px 56px; }
  .chapter { padding-block: 48px 64px; }
  .chapter-koda { padding-block: 56px 8px; }
  .letter { padding: 48px 0 0; }
  .letter-paper { padding: 0 22px 32px; transform: none; }
  .letter-head { grid-template-columns: 1fr; justify-items: center; gap: 16px; margin: -40px 0 18px; text-align: center; }
  .letter-photo { width: 86%; padding: 10px 10px 36px; }
  .letter-photo::before { width: 84px; height: 26px; }
  .letter-title { padding-top: 0; font-size: 28px; }
  .puppy-strip { padding-block: 24px 80px; }
  .strip-photo { margin-right: 14px; }
  .chapter-title { margin-bottom: 36px; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
  .cookie-banner { left: 10px; right: 10px; bottom: 10px; padding: 18px; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }
}

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