/* ============================================================
   THE PETSTOP — site styles
   Consumes design tokens from tokens.css (synced from the
   Claude Design project "The Petstop Design System").
   Logo sizes, colors, type and geometry come ONLY from tokens.
   ============================================================ */

/* ---- Self-hosted fonts (approved: no runtime third-party requests) ---- */
@font-face {
  font-family: 'Lexend Mega';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/lexend-mega-700-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 100 900; /* variable font — one file covers 400/600/700 */
  font-display: swap;
  src: url('../assets/fonts/public-sans-var-latin.woff2') format('woff2');
}

/* ---- Background patterns (brand paw/bone/fish/kennel tile) ---- */
:root {
  --pattern-blue: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><g fill='none' stroke='%231617C9' stroke-width='2.4' opacity='.09'><ellipse cx='30' cy='38' rx='9' ry='7'/><circle cx='19' cy='26' r='3.6'/><circle cx='30' cy='22' r='3.6'/><circle cx='41' cy='26' r='3.6'/><g transform='translate(110 34) rotate(-24)'><rect x='-14' y='-3.4' width='28' height='6.8' rx='3.4'/><circle cx='-14' cy='-4.8' r='4.9'/><circle cx='-14' cy='4.8' r='4.9'/><circle cx='14' cy='-4.8' r='4.9'/><circle cx='14' cy='4.8' r='4.9'/></g><g transform='translate(46 115)'><ellipse cx='0' cy='0' rx='14' ry='8'/><path d='M12 0 L24 -8.5 L24 8.5 Z'/><circle cx='-6.5' cy='-1.6' r='1.3'/></g><g transform='translate(120 118)'><path d='M-14 13 V-3 L0 -15 L14 -3 V13 Z'/><rect x='-4.5' y='2' width='9' height='11' rx='2.2'/></g></g></svg>");
  --pattern-white: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><g fill='none' stroke='%23FFFFFF' stroke-width='2.4' opacity='.12'><ellipse cx='30' cy='38' rx='9' ry='7'/><circle cx='19' cy='26' r='3.6'/><circle cx='30' cy='22' r='3.6'/><circle cx='41' cy='26' r='3.6'/><g transform='translate(110 34) rotate(-24)'><rect x='-14' y='-3.4' width='28' height='6.8' rx='3.4'/><circle cx='-14' cy='-4.8' r='4.9'/><circle cx='-14' cy='4.8' r='4.9'/><circle cx='14' cy='-4.8' r='4.9'/><circle cx='14' cy='4.8' r='4.9'/></g><g transform='translate(46 115)'><ellipse cx='0' cy='0' rx='14' ry='8'/><path d='M12 0 L24 -8.5 L24 8.5 Z'/><circle cx='-6.5' cy='-1.6' r='1.3'/></g><g transform='translate(120 118)'><path d='M-14 13 V-3 L0 -15 L14 -3 V13 Z'/><rect x='-4.5' y='2' width='9' height='11' rx='2.2'/></g></g></svg>");
}

/* ---- Base ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-ink);
  background: var(--color-cream) var(--pattern-blue);
  touch-action: manipulation;
}
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
}
img { max-width: 100%; }
a { color: var(--color-blue); }
:focus-visible { outline: 3px dashed var(--color-blue); outline-offset: 3px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--color-chartreuse); color: var(--color-ink);
  font-weight: 700; padding: 12px 18px; border: var(--border-w) solid var(--color-ink);
  border-radius: var(--radius-chip);
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---- Header ---- */
.site-header {
  background: var(--color-cream);
  border-bottom: var(--border-w) solid var(--color-ink);
  position: sticky; top: 0; z-index: 50;
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); max-width: 1120px; margin: 0 auto; padding: 0 20px;
}
.logo { display: inline-flex; }
.logo img { height: var(--logo-header-h); display: block; width: auto; }
.nav { display: flex; gap: var(--space-2); }
.nav a {
  color: var(--color-ink); text-decoration: none; font-weight: 700; font-size: 14px;
  padding: 9px 14px; border: var(--border-w-thin) solid transparent; border-radius: var(--radius-chip);
  cursor: pointer;
}
.nav a[aria-current="page"] {
  background: var(--color-chartreuse); border-color: var(--color-ink);
  box-shadow: var(--shadow-badge);
}
.nav a:hover { border-color: var(--color-ink); }
.nav-toggle {
  display: none; background: var(--color-chartreuse); border: var(--border-w-thin) solid var(--color-ink);
  border-radius: var(--radius-chip); box-shadow: var(--shadow-badge);
  width: 46px; height: 44px; cursor: pointer; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { display: block; width: 20px; height: 2.5px; background: var(--color-ink); border-radius: 2px; }

/* ---- Hero ---- */
.hero { text-align: center; padding: var(--space-8) 20px var(--space-8); }
.hero .sticker {
  width: var(--hero-sticker-d); height: var(--hero-sticker-d);
  margin: 0 auto var(--space-5);
  background: var(--color-chartreuse);
  border: var(--sticker-border-w) solid var(--color-ink); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(var(--sticker-rotate));
  box-shadow: var(--hero-sticker-shadow);
}
.hero .sticker img { height: var(--hero-dog-h); width: auto; }
.hero h1 { font-size: var(--text-hero); max-width: 820px; margin: 0 auto; }
.hero h1 em {
  font-style: normal; color: var(--color-blue); background: var(--color-chartreuse);
  padding: 2px 12px; border: var(--border-w) solid var(--color-ink); border-radius: var(--radius-btn);
  display: inline-block; transform: rotate(-1.5deg); box-shadow: 4px 4px 0 var(--color-blue);
}
.hero p { max-width: 520px; margin: 18px auto var(--space-6); font-size: 18px; color: var(--color-muted); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--btn-h); padding: 0 var(--btn-pad-x);
  border-radius: var(--radius-btn); font-family: var(--font-body);
  font-weight: 700; font-size: 16px; text-decoration: none;
  border: var(--border-w) solid var(--color-ink);
  transition: transform var(--dur-press), box-shadow var(--dur-press);
  cursor: pointer;
}
.btn-cta { background: var(--color-chartreuse); color: var(--color-ink); box-shadow: var(--shadow-btn); }
.btn-cta:hover { transform: translate(var(--press-shift), var(--press-shift)); box-shadow: var(--shadow-btn-hover); }
.btn-cta:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--color-blue); }
.btn-ghost { background: #fff; color: var(--color-ink); box-shadow: var(--shadow-muted); }
.btn-ghost:hover { transform: translate(var(--press-shift), var(--press-shift)); box-shadow: 3px 3px 0 var(--color-shadow-muted); }
.on-blue .btn-cta { box-shadow: 5px 5px 0 #0b0c69; }
.hero .btn { margin: 6px; }

/* ---- Sections ---- */
.section { padding: var(--space-7) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: var(--space-5); }
.section-head h2 { font-size: var(--text-h2); }
.section-head a { color: var(--color-blue); font-weight: 700; text-decoration: none; border-bottom: 3px solid var(--color-chartreuse); }

/* ---- Category jump chips ---- */
.cat-chips {
  display: flex; gap: 10px; flex-wrap: wrap; padding: var(--space-4) 0;
}
.cat-chips a {
  font-size: 13.5px; font-weight: 700; color: var(--color-ink); text-decoration: none;
  background: #fff; border: var(--border-w-thin) solid var(--color-ink);
  border-radius: var(--radius-pill); padding: 10px 16px; box-shadow: 3px 3px 0 var(--color-shadow-muted);
}
.cat-chips a:hover { background: var(--color-chartreuse); box-shadow: var(--shadow-badge); }

/* ---- Product grid & cards ---- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card {
  background: #fff; border: var(--border-w) solid var(--color-ink);
  border-radius: var(--radius-card); position: relative;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-press), box-shadow var(--dur-press);
}
.card:hover { transform: translate(var(--press-shift), var(--press-shift)); box-shadow: var(--shadow-card-hover); }
.card .photo {
  aspect-ratio: 4 / 3;
  background: var(--color-photo-bg) var(--pattern-blue);
  display: flex; align-items: center; justify-content: center;
  border-bottom: var(--border-w) solid var(--color-ink);
  border-radius: 12px 12px 0 0; overflow: hidden;
}
.card .photo img.wm { height: var(--card-watermark-h); width: auto; opacity: .55; }
.card .photo img.real { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 18px 20px 22px; }
.card h3 { font-size: var(--text-card-title); margin-bottom: 6px; overflow-wrap: anywhere; }
.card .desc {
  color: var(--color-muted); font-size: var(--text-small); margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card .price { font-weight: 700; font-size: var(--text-price); color: var(--color-blue); font-variant-numeric: tabular-nums; }
.card .variants { font-size: 13px; color: var(--color-muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.badge {
  position: absolute; top: -13px; right: 14px; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-badge); font-weight: 700; padding: 5px 12px;
  border-radius: var(--radius-pill); border: var(--border-w-thin) solid var(--color-ink);
  transform: rotate(var(--badge-rotate)); background: #fff;
}
.badge.in { background: var(--color-chartreuse); box-shadow: var(--shadow-badge); }
.badge.order { box-shadow: 3px 3px 0 var(--color-shadow-muted); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-blue); }
.badge .clock { width: 11px; height: 11px; border: 2px solid var(--color-ink); border-radius: 50%; position: relative; }
.badge .clock::after { content: ''; position: absolute; left: 45%; top: 10%; width: 2px; height: 4px; background: var(--color-ink); }
.ask {
  display: inline-block; margin-top: 14px; font-weight: 700; font-size: 14px;
  color: var(--color-blue); text-decoration: none; border-bottom: 3px solid var(--color-chartreuse);
  padding: 4px 0; cursor: pointer;
}

/* ---- Category sections ---- */
.category { padding-top: var(--space-6); }
.category h2 { font-size: var(--text-h2); margin-bottom: var(--space-5); scroll-margin-top: calc(var(--header-h) + 16px); }

/* ---- Message block (errors / empty states) ---- */
.msg-block {
  background: #fff; border: var(--border-w) solid var(--color-ink); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); padding: var(--space-6); text-align: center; max-width: 560px; margin: var(--space-6) auto;
}
.msg-block h2 { font-size: 20px; margin-bottom: 10px; }
.msg-block p { color: var(--color-muted); margin-bottom: 18px; }

/* ---- CTA band ---- */
.band {
  background: var(--color-blue) var(--pattern-white); color: #fff; text-align: center;
  padding: var(--space-7) 24px; border-radius: var(--radius-card);
  border: var(--border-w) solid var(--color-ink); box-shadow: var(--shadow-band);
}
.band h2 { font-size: var(--text-h2); margin-bottom: 12px; color: #fff; }
.band p { color: var(--color-on-blue-soft); max-width: 480px; margin: 0 auto var(--space-5); }

/* ---- Blog ---- */
.post-list { display: grid; gap: 26px; max-width: 720px; }
.post-card {
  background: #fff; border: var(--border-w) solid var(--color-ink); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); padding: 22px 24px; display: block; text-decoration: none; color: var(--color-ink);
  transition: transform var(--dur-press), box-shadow var(--dur-press);
}
.post-card:hover { transform: translate(var(--press-shift), var(--press-shift)); box-shadow: var(--shadow-card-hover); }
.post-card .top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.chip {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  background: var(--color-chartreuse); border: var(--border-w-thin) solid var(--color-ink);
  border-radius: var(--radius-pill); padding: 3px 10px; transform: rotate(-2deg);
}
.post-card .date { font-size: 13px; color: var(--color-muted); }
.post-card h3 { font-size: 17px; margin-bottom: 8px; line-height: 1.3; }
.post-card .excerpt { color: var(--color-muted); font-size: var(--text-small); }
.post-card .more { display: inline-block; margin-top: 12px; font-weight: 700; font-size: 14px; color: var(--color-blue); border-bottom: 3px solid var(--color-chartreuse); }

.post-body { max-width: 65ch; margin: 0 auto; font-size: 17px; line-height: 1.7; }
.post-body h1 { font-size: clamp(24px, 3.6vw, 34px); margin-bottom: var(--space-5); }
.post-body h2 { font-size: 20px; margin: var(--space-6) 0 var(--space-4); }
.post-body h3 { font-size: 17px; margin: var(--space-5) 0 var(--space-3); }
.post-body p { margin-bottom: var(--space-4); }
.post-body ul, .post-body ol { margin: 0 0 var(--space-4) 24px; }
.post-body li { margin-bottom: var(--space-2); }
.post-body a { font-weight: 700; text-decoration-thickness: 3px; text-decoration-color: var(--color-chartreuse); }
.post-meta { display: flex; align-items: center; gap: 12px; max-width: 65ch; margin: 0 auto var(--space-5); }
.back-link { display: inline-block; font-weight: 700; text-decoration: none; color: var(--color-blue); border-bottom: 3px solid var(--color-chartreuse); margin-bottom: var(--space-5); }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.contact-card {
  background: #fff; border: var(--border-w) solid var(--color-ink); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); padding: var(--space-5);
}
.contact-card h2 { font-size: 20px; margin-bottom: 12px; }
.contact-card p { color: var(--color-muted); font-size: var(--text-small); margin-bottom: 16px; }
.contact-links { display: flex; flex-direction: column; gap: 12px; }
.contact-links a {
  display: inline-flex; align-items: center; justify-content: center; height: var(--btn-h);
  border: var(--border-w) solid var(--color-ink); border-radius: var(--radius-btn);
  font-weight: 700; text-decoration: none; color: var(--color-ink); background: var(--color-cream);
  box-shadow: 3px 3px 0 var(--color-blue);
}
.contact-links a:hover { background: var(--color-chartreuse); }

/* ---- Form ---- */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field .req { color: var(--color-error); }
.field .opt { font-weight: 400; font-size: 12.5px; color: var(--color-muted); }
.field input, .field textarea {
  width: 100%; font-family: var(--font-body); font-size: 16px; color: var(--color-ink);
  background: var(--color-cream); border: var(--border-w-thin) solid var(--color-ink);
  border-radius: var(--radius-chip); padding: 0 14px; height: var(--input-h);
}
.field textarea { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; }
.field.error input, .field.error textarea { border-color: var(--color-error); background: #FFF6F3; }
.err-msg { display: none; align-items: center; gap: 6px; color: #B3502F; font-size: 13px; font-weight: 600; margin-top: 6px; }
.field.error .err-msg { display: flex; }
.err-msg::before {
  content: '!'; display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%; background: var(--color-error);
  color: #fff; font-weight: 800; font-size: 11px; flex: none;
}
.form-hint { font-size: 12.5px; color: var(--color-muted); margin-top: 10px; }

/* ---- About ---- */
.prose { max-width: 65ch; font-size: 17px; line-height: 1.7; }
.prose h2 { font-size: 20px; margin: var(--space-6) 0 var(--space-4); }
.prose p { margin-bottom: var(--space-4); }
.prose ul { margin: 0 0 var(--space-4) 24px; }
.prose li { margin-bottom: var(--space-2); }

/* ---- Footer ---- */
.site-footer { background: #fff; border-top: var(--border-w) solid var(--color-ink); text-align: center; padding: var(--space-7) 20px; margin-top: var(--space-8); }
.site-footer img { height: var(--logo-footer-h); width: auto; margin-bottom: var(--space-4); }
.socials { display: flex; gap: 14px; justify-content: center; margin-bottom: var(--space-4); flex-wrap: wrap; }
.socials a {
  color: var(--color-ink); font-weight: 700; text-decoration: none;
  border: var(--border-w-thin) solid var(--color-ink); border-radius: var(--radius-chip);
  padding: 11px 20px; background: var(--color-cream); box-shadow: 3px 3px 0 var(--color-blue);
}
.socials a:hover { background: var(--color-chartreuse); }
.fineprint { font-size: 13px; color: var(--color-muted); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--color-cream);
    border-bottom: var(--border-w) solid var(--color-ink); padding: 8px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 13px 14px; font-size: 15px; }
  .nav-toggle { display: inline-flex; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; gap: 4px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
