/* Dih Inu. One look: the banner's chocolate ground and cream bubble letters, and the pink of the cartoon dog's ear
   for anything you can press. Buttons and panels are flat and square-cut. */
@font-face { font-family: "DynaPuff"; src: url("/fonts/dynapuff.woff2") format("woff2"); font-weight: 400 700; font-display: block; }
@font-face { font-family: "Figtree"; src: url("/fonts/figtree.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  color-scheme: dark;
  --choc: #2b170d;
  --choc-2: #3a2114;
  --line: #5c3b25;
  --cream: #fff1c4;
  --text: #efe0bc;
  --muted: #c9ae86;
  --fur: #d9a566;
  --fur-deep: #9c5a22;
  --pink: #f08a84;
  --pink-hi: #f8a8a2;
  --display: "DynaPuff", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gut: clamp(1rem, 4vw, 3rem);
  --nav: 60px;
  --r: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--choc);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 0.9  0 0 0 0 0.75  0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--text);
  font: 400 1.0625rem/1.5 var(--body);
  overflow-x: clip;
}
img { max-width: 100%; height: auto; }
a { color: var(--cream); }
b { color: var(--cream); font-weight: 700; }
::selection { background: var(--pink); color: var(--choc); }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; border-radius: var(--r); }
[hidden] { display: none !important; }

h1, h2, .slogan, .brand span { font-family: var(--display); font-weight: 700; color: var(--cream); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(3.1rem, 7.4vw, 6.75rem); line-height: 1; text-shadow: 0 0.055em 0 var(--fur-deep); padding-bottom: 0.08em; }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); line-height: 1.05; text-shadow: 0 0.05em 0 var(--fur-deep); padding-bottom: 0.06em; }
p { margin: 0; }

.wrap { width: min(100% - var(--gut) * 2, 75rem); margin-inline: auto; }
section { scroll-margin-top: var(--nav); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.7rem 1.35rem;
  border: 1px solid transparent; border-radius: var(--r);
  font: 700 1rem/1.1 var(--body); text-decoration: none; cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, transform 0.08s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 2.5rem; padding: 0.5rem 0.95rem; font-size: 0.9375rem; }
.btn-primary { background: var(--pink); color: var(--choc); }
.btn-primary:hover { background: var(--pink-hi); }
.btn-plate { background: var(--choc-2); color: var(--cream); border-color: var(--line); }
.btn-plate:hover { border-color: var(--fur); }
.btn[aria-disabled="true"] { background: var(--choc-2); color: var(--muted); border-color: var(--line); cursor: default; }
.btn[aria-disabled="true"]:active { transform: none; }
.icon-btn { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; color: var(--cream); border: 1px solid var(--line); border-radius: var(--r); background: var(--choc-2); }
.icon-btn:hover { border-color: var(--fur); }

.chip { display: inline-block; padding: 0.2rem 0.5rem; border-radius: var(--r); background: var(--fur); color: var(--choc); font: 700 0.8125rem/1.2 var(--body); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: var(--nav);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-inline: max(var(--gut), env(safe-area-inset-left, 0px)) max(var(--gut), env(safe-area-inset-right, 0px));
  background: var(--choc); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand img { border-radius: var(--r); display: block; }
.brand span { font-size: 1.4rem; line-height: 1; white-space: nowrap; }
.nav .btn { white-space: nowrap; }
.nav-links { display: flex; gap: clamp(1rem, 3vw, 2.25rem); }
.nav-links a { color: var(--text); text-decoration: none; font-weight: 600; padding: 0.5rem 0; }
.nav-links a:hover { color: var(--cream); text-decoration: underline; text-underline-offset: 0.3em; text-decoration-thickness: 2px; text-decoration-color: var(--pink); }
.nav-act { display: flex; align-items: center; gap: 0.5rem; }

/* ---------- hero ---------- */
.hero { position: relative; }
.stage {
  position: relative; min-height: 100svh;
  width: min(100%, 82rem); margin-inline: auto;
  padding: calc(var(--nav) + 1.5rem) var(--gut) 0;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); column-gap: 2rem; align-items: center;
}
.hero-copy { padding-bottom: 3rem; display: grid; gap: 1.15rem; justify-items: start; }
.lede { font-size: clamp(1.125rem, 1.6vw, 1.375rem); max-width: 30ch; }
.soon, .cue { color: var(--muted); font-size: 0.9375rem; }
.cue { display: none; }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.ca { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; max-width: 100%; }
.ca code, .foot-ca code { font: 500 0.875rem/1.3 var(--mono); color: var(--cream); overflow-wrap: anywhere; }
.ca-short { display: none; }

.dog-static { display: block; align-self: end; justify-self: center; width: min(100%, 21rem); margin-bottom: 1rem; }
.dog, .vet { display: none; }

/* The growing dog. The rig is laid out in the artwork's own pixels (798 wide) and scaled as one piece. --e is how
   many of those pixels he has grown; the script sets it and --s. Sizes match what scripts/art.mjs prints. */
html.grow .hero { height: calc(100svh + 140vh); }
html.grow .stage { position: sticky; top: 0; height: 100svh; min-height: 0; overflow: clip; }
html.grow .dog-static { display: none; }
html.grow .cue { display: block; }
html.grow .dog { display: block; position: absolute; right: var(--gut); width: 45%; top: calc(var(--nav) + 14px); bottom: clamp(10px, 2.6vh, 28px); pointer-events: none; }
.dog-rig { position: absolute; left: 50%; bottom: 0; width: 798px; height: 2720px; margin-left: -399px; transform-origin: 50% 100%; transform: scale(var(--s, 0.4)); --e: 0; }
.dog-rig img { position: absolute; left: 0; max-width: none; display: block; }
.dog-shadow { position: absolute; left: 4%; right: 4%; bottom: -18px; height: 70px; border-radius: 50%; background: #1b0d06; }
.dog-base { bottom: 0; width: 798px; height: 525px; }
/* 1380 = the strip's 1400 rows less the 20 that sit under the head: its 14 faded rows and 6 more, so no line of
   background shows where the fade begins. The strip is tucked 2 px under the base for the same reason. */
.dog-strip { bottom: 523px; width: 798px; height: 1400px; clip-path: inset(calc(1380px - var(--e) * 1px) 0 0 0); }
.dog-head { bottom: 525px; width: 798px; height: 798px; transform: translateY(calc(var(--e) * -1px)); will-change: transform; }
.tag {
  position: absolute; left: 50%; top: 100%; white-space: nowrap;
  padding: 0.25rem 0.55rem; border-radius: var(--r); background: var(--cream); color: var(--choc);
  font: 700 0.8125rem/1.2 var(--body); font-variant-numeric: tabular-nums; will-change: transform;
}
html.grow .vet {
  display: block; position: absolute; left: var(--gut); bottom: 2.25rem; max-width: 24rem;
  padding: 0.7rem 0.95rem; border-radius: var(--r); background: var(--pink); color: var(--choc);
  font: 700 1.0625rem/1.3 var(--body); text-wrap: balance;
  opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s;
}
html.grow .hero.is-long .vet { opacity: 1; transform: none; }

/* ---------- the dogs ---------- */
.dogs, .buy, .faq, .finale { padding-block: clamp(4rem, 9vw, 7rem); }
.dogs { border-top: 1px solid var(--line); }
.sec-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.sec-head p { margin-top: 0.5rem; color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 0.65rem; font-weight: 700; color: var(--cream); cursor: pointer; user-select: none; min-height: 2.75rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { position: relative; width: 3rem; height: 1.75rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--choc-2); transition: background-color 0.12s; }
.knob { position: absolute; top: 3px; left: 3px; width: 1.25rem; height: calc(100% - 6px); border-radius: 2px; background: var(--cream); transition: transform 0.14s, background-color 0.12s; }
.switch input:checked + .track { background: var(--pink); border-color: var(--pink); }
.switch input:checked + .track .knob { transform: translateX(1.25rem); background: var(--choc); }
.switch input:focus-visible + .track { outline: 3px solid var(--pink); outline-offset: 3px; }

.wall { columns: 3; column-gap: clamp(0.75rem, 2vw, 1.5rem); }
.card { break-inside: avoid; margin: 0 0 clamp(1.25rem, 2.4vw, 2rem); }
.pic { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: var(--r); overflow: hidden; background: var(--choc-2); cursor: zoom-in; }
.pic img { display: block; width: 100%; height: auto; }
.pic:hover { outline: 3px solid var(--pink); outline-offset: 0; }
.px { position: absolute; inset: 0; width: 100% !important; height: 100% !important; image-rendering: pixelated; clip-path: inset(var(--t, 20%) var(--r, 20%) var(--b, 20%) var(--l, 20%)); opacity: 0; pointer-events: none; }
body.sfw .px { opacity: 1; }
.card figcaption { margin-top: 0.55rem; font-weight: 600; color: var(--cream); }

/* ---------- buy ---------- */
.buy { border-top: 1px solid var(--line); }
.buy-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.steps { list-style: none; counter-reset: step; margin: 1.75rem 0 2rem; padding: 0; display: grid; gap: 0.9rem; }
.steps li { counter-increment: step; display: flex; align-items: baseline; gap: 0.9rem; font-size: clamp(1.125rem, 1.7vw, 1.375rem); color: var(--cream); }
.steps li::before { content: counter(step); flex: none; width: 1.6em; font: 700 1.3em/1 var(--display); color: var(--pink); }
.ca-box { padding: clamp(1.1rem, 2.4vw, 1.75rem); border: 1px solid var(--line); border-radius: var(--r); background: var(--choc-2); display: grid; gap: 0.85rem; }
.ca-label { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--cream); }
.ca-box [data-ca-card] { display: grid; gap: 0.85rem; justify-items: start; }
.ca-full { font: 500 1rem/1.4 var(--mono); color: var(--cream); overflow-wrap: anywhere; }
.ca-note { color: var(--muted); font-size: 0.9375rem; }

/* ---------- questions ---------- */
.faq { border-top: 1px solid var(--line); }
.qa { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem) clamp(2rem, 5vw, 4.5rem); margin: clamp(1.5rem, 3vw, 2.5rem) 0 0; }
.qa dt { font: 600 1.3125rem/1.2 var(--display); color: var(--cream); }
.qa dd { margin: 0.4rem 0 0; max-width: 46ch; }

/* ---------- finale and footer ---------- */
.finale { border-top: 1px solid var(--line); text-align: center; }
.banner { display: block; width: 100%; border-radius: var(--r); }
.slogan { margin-top: clamp(2rem, 5vw, 3.5rem); font-size: clamp(3rem, 10vw, 7.5rem); line-height: 1; text-shadow: 0 0.055em 0 var(--fur-deep); padding-bottom: 0.08em; }
.cta-center { justify-content: center; margin-top: clamp(1.5rem, 3vw, 2.25rem); }

.foot { border-top: 1px solid var(--line); padding-block: 2rem calc(2rem + env(safe-area-inset-bottom, 0px)); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.foot-ca { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.legal { margin-top: 1.25rem; color: var(--muted); font-size: 0.875rem; max-width: 70ch; }

/* ---------- photo viewer ---------- */
.lb { border: 1px solid var(--line); border-radius: var(--r); padding: 0; background: var(--choc-2); color: var(--text); max-width: min(94vw, 46rem); max-height: 94svh; }
.lb::backdrop { background: rgba(20, 10, 5, 0.86); }
.lb-pic { position: relative; display: block; line-height: 0; background: var(--choc); text-align: center; }
.lb-pic > img:first-child { max-width: 100%; max-height: 68svh; width: auto; height: auto; }
.lb-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem; padding: 0.9rem 1rem; }
.lb-bar p { font-weight: 700; color: var(--cream); font-size: 1.125rem; }
.lb-act { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.toast { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); z-index: 40; transform: translate(-50%, 1rem); padding: 0.6rem 1rem; border-radius: var(--r); background: var(--cream); color: var(--choc); font-weight: 700; opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- narrower screens ---------- */
@media (max-width: 899px) {
  .stage { grid-template-columns: minmax(0, 1fr); align-items: start; row-gap: 1.5rem; padding-top: calc(var(--nav) + 1.1rem); }
  /* Everything the words need on one phone screen, so the dog under them is still a good size. */
  h1 { font-size: min(12vw, 4.5rem); }
  .hero-copy { padding-bottom: 0; gap: 0.8rem; }
  html.grow .cue { display: none; }
  .hero .ca-long { display: none; }
  .hero .ca-short { display: inline; font-size: 1rem; }
  .hero .cta { flex-wrap: nowrap; width: 100%; }
  .hero .cta .btn { flex: 0 1 auto; padding-inline: 1rem; white-space: nowrap; }
  .dog-static { width: min(62%, 16rem); }
  html.grow .dog { left: var(--gut); right: var(--gut); width: auto; top: calc(var(--nav) + 4.5rem); }
  html.grow .hero-copy { opacity: calc(1 - var(--fade, 0)); transform: translateY(calc(var(--fade, 0) * -1.5rem)); will-change: opacity, transform; }
  html.grow .vet { left: var(--gut); right: var(--gut); bottom: auto; top: calc(var(--nav) + 0.6rem); max-width: none; text-align: center; font-size: 0.9375rem; padding: 0.55rem 0.75rem; }
  .buy-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .nav-links { display: none; }
  .wall { columns: 2; }
  .qa { grid-template-columns: minmax(0, 1fr); }
  .card figcaption { font-size: 0.9375rem; line-height: 1.3; }
}
@media (max-width: 359px) {
  /* The smallest phones: the icon stands in for the name so the X and Buy buttons keep one line each. */
  .nav .brand span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
