/* HurryPets. A red enamel pet ID tag on a tennis-ball green ground. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ball: #D9E85E;
  --ball-2: #CBDC4A;
  --navy: #1B2140;
  --navy-2: #283161;
  --ink: #1B2140;
  --muted: #3E4530;
  --line: rgba(27, 33, 64, 0.22);
  --red: #D8323C;
  --red-dark: #A8222B;
  --brass: #C9A55A;
  --brass-dark: #8F7232;
  --white: #FFFFFF;
  --on-navy: #F1F4E4;
  --on-navy-muted: #C9D0A8;
  --error: #8E1620;

  --display: "Bricolage Grotesque", "Arial Rounded MT Bold", system-ui, sans-serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ball);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, dl, dd, figure { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 800; font-optical-sizing: auto; text-wrap: balance; }
a { color: inherit; }

.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: clamp(20px, 5vw, 48px); }

.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; top: 12px; left: 12px; z-index: 10; padding: 10px 14px; background: var(--navy); color: var(--on-navy); border-radius: 8px; transform: translateY(-160%); }
.skip:focus { transform: none; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }

/* ---------- bar ---------- */
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1; letter-spacing: -0.02em; text-decoration: none; }
.bar-go { font-size: 1rem; font-weight: 600; text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* ---------- hero ---------- */
.hero-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  padding-block: clamp(8px, 3vh, 40px) clamp(56px, 9vh, 104px);
}

.hero h1 {
  font-size: clamp(2.5rem, 1.3rem + 3.8vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 10.5em;
}
.lede { margin-top: 24px; max-width: 30rem; font-size: 1.25rem; line-height: 1.5; }
.hero .join { margin-top: 34px; max-width: 32rem; }

/* the tag */
.tagbox { justify-self: center; width: clamp(280px, 34vw, 440px); }
.tag {
  display: block; width: 100%; height: auto; overflow: visible;
  /* the collar fades out at both ends instead of stopping */
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 11%, #000 89%, transparent 100%) no-repeat;
  mask: linear-gradient(90deg, transparent 0, #000 11%, #000 89%, transparent 100%) no-repeat;
}
.collar { fill: var(--navy); }
.stitch { fill: none; stroke: rgba(241, 244, 228, 0.45); stroke-width: 1.6; stroke-dasharray: 6 6; }
.dring { fill: none; stroke: var(--brass); stroke-width: 7; stroke-linecap: round; }
.split { fill: none; stroke: #9BA0A8; stroke-width: 5; }
.split-in { fill: none; stroke: #C7CBD1; stroke-width: 1.5; }
.rim { fill: var(--brass); stroke: var(--brass-dark); stroke-width: 2; }
.enamel { fill: var(--red); }
.shine { fill: none; stroke: rgba(255, 255, 255, 0.28); stroke-width: 10; stroke-dasharray: 120 620; stroke-dashoffset: -40; stroke-linecap: round; }
.hole { fill: var(--ball); stroke: var(--brass-dark); stroke-width: 2; }
.t-name { font-family: var(--display); font-weight: 800; font-size: 46px; letter-spacing: -1px; fill: var(--white); }
.t-rule { stroke: rgba(255, 255, 255, 0.6); stroke-width: 2; stroke-linecap: round; }
.t-dom { font-family: var(--sans); font-weight: 600; font-size: 20px; letter-spacing: 0.5px; fill: rgba(255, 255, 255, 0.92); }

.swing { transform-origin: 180px 96px; transform-box: view-box; }

/* One motion: the tag swings in and settles, once. */
.js .swing { animation: swing 1.8s cubic-bezier(.3, .2, .3, 1) 0.2s both; }
@keyframes swing {
  0% { transform: rotate(-26deg); }
  22% { transform: rotate(16deg); }
  42% { transform: rotate(-9deg); }
  60% { transform: rotate(5deg); }
  76% { transform: rotate(-2deg); }
  90% { transform: rotate(0.8deg); }
  100% { transform: rotate(0deg); }
}

/* ---------- form ---------- */
.row { display: flex; gap: 8px; }
.field {
  flex: 1 1 auto; min-width: 0; height: 56px; padding: 0 20px;
  font: inherit; font-size: 1.0625rem; color: var(--ink);
  background: var(--white); border: 2px solid var(--navy); border-radius: 999px;
}
.field::placeholder { color: #5F6455; }
.field:focus-visible { outline-offset: 2px; }
.field[aria-invalid="true"] { border-color: var(--error); }
.btn {
  flex: none; height: 56px; padding: 0 26px;
  font: inherit; font-size: 1.0625rem; font-weight: 700;
  color: var(--white); background: var(--red-dark); border: 0; border-radius: 999px; cursor: pointer;
}
.btn:hover { background: #941C24; }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: progress; opacity: 0.75; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.fine { margin-top: 12px; padding-inline: 4px; font-size: 0.9375rem; color: var(--muted); }
.oops { margin-top: 10px; padding-inline: 4px; font-size: 0.9375rem; font-weight: 700; color: var(--error); }
.oops:empty { display: none; }
.nojs { display: none; margin-top: 8px; font-size: 0.9375rem; font-weight: 700; color: var(--error); }
html:not(.js) .nojs { display: block; }
.done-line { display: flex; align-items: center; gap: 10px; font-size: 1.125rem; }
.done-line b { font-weight: 700; }
.tick { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--navy); stroke-width: 1.8; }
.tick path { stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.again { padding: 0; font: inherit; color: inherit; background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.when-joined { display: none; }
.is-joined .when-open { display: none; }
.is-joined .when-joined { display: inline; }

/* ---------- facts and questions ---------- */
.band { padding-block: clamp(72px, 11vw, 136px); }
#facts { background: var(--ball-2); }
.band h2 { font-size: clamp(1.875rem, 1.3rem + 1.8vw, 2.75rem); line-height: 1.05; letter-spacing: -0.025em; }

.cols { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 40rem); justify-content: space-between; gap: 40px; }

.facts { border-top: 2px solid var(--navy); }
.fact { display: grid; grid-template-columns: 9rem 1fr; gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.fact dt { font-weight: 600; color: var(--muted); }
.fact dd { font-weight: 600; }

.qs { border-top: 2px solid var(--navy); }
.q { border-bottom: 1px solid var(--line); }
.q summary { position: relative; padding: 20px 44px 20px 0; font-weight: 700; cursor: pointer; list-style: none; }
.q summary::-webkit-details-marker { display: none; }
.q summary::before, .q summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 16px; height: 2.5px; border-radius: 2px; background: var(--navy); transition: transform 0.2s ease; }
.q summary::after { transform: rotate(90deg); }
.q[open] summary::after { transform: rotate(0deg); }
.q p { padding-bottom: 22px; max-width: 36rem; }

/* ---------- close: the collar colour ---------- */
.close { padding-block: clamp(80px, 12vw, 144px); background: var(--navy); color: var(--on-navy); }
.close h2 { color: var(--on-navy); font-size: clamp(1.875rem, 1.3rem + 1.8vw, 2.75rem); line-height: 1.05; letter-spacing: -0.025em; max-width: 18em; }
.close .lede { color: var(--on-navy-muted); margin-top: 16px; }
.close .join { margin-top: 36px; max-width: 32rem; }
.close .field { color: var(--on-navy); background: var(--navy-2); border-color: #6B7399; }
.close .field::placeholder { color: #B4BAD3; }
.close .field:focus-visible { border-color: var(--on-navy); }
.close .btn { color: var(--navy); background: var(--ball); }
.close .btn:hover { background: #E6F27A; }
.close .fine { color: var(--on-navy-muted); }
.close .oops, .close .nojs { color: #FFB3B8; }
.close .tick { stroke: var(--on-navy); }
.close :focus-visible { outline-color: var(--ball); }

.foot { background: var(--navy); color: var(--on-navy-muted); font-size: 0.9375rem; }
.foot-in { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 32px; padding-block: 28px 36px; border-top: 1px solid rgba(241, 244, 228, 0.16); }
.foot .brand-name { font-family: var(--display); font-weight: 800; font-size: 1.125rem; color: var(--on-navy); }
.foot a { text-underline-offset: 3px; }
.foot :focus-visible { outline-color: var(--ball); }

/* ---------- smaller screens: the tag first, smaller ---------- */
@media (max-width: 860px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 0; }
  .tagbox { order: -1; width: min(62vw, 250px); }
  .hero .join { margin-top: 28px; }
  .cols { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 460px) {
  .row { flex-direction: column; }
  .btn { width: 100%; }
  .hero h1 { font-size: 2.375rem; }
  .lede { margin-top: 16px; font-size: 1.125rem; }
  .fact { grid-template-columns: 7.5rem 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .swing { animation: none; }
  .q summary::before, .q summary::after { transition: none; }
  .btn:active { transform: none; }
}
