*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0d0f14;
  --surface: #13151c;
  --card: #1a1d28;
  --accent: #f4a24d;
  --accent2: #e07b7b;
  --accent3: #c96fd0;
  --text: #e8e2d5;
  --muted: #7a7a8c;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ===================== NAVBAR ===================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(13,15,20,0.55);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(244,162,77,0.12);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #f4a24d, #e07b7b, #c96fd0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .04em;
  transition: color .2s;
  cursor: pointer;
}
.nav-links a:hover { color: var(--accent); }
.nav-links .nav-cta {
  background: rgba(244,162,77,0.12);
  border: 1px solid rgba(244,162,77,0.45);
  color: var(--accent);
  padding: .45rem 1.1rem;
  border-radius: 40px;
}
/* 3-dots button + dropdown menu — only shown on phones (see the max-width: 767px block) */
.nav-dots {
  display: none;
  flex: 0 0 38px;
  width: 38px; height: 38px;
  margin-left: .6rem;
  padding: 0;
  border-radius: 50%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3.5px;
  background: rgba(244,162,77,0.1);
  border: 1px solid rgba(244,162,77,0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s;
}
.nav-dots span {
  display: block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.navbar.menu-open .nav-dots { background: rgba(244,162,77,0.24); }
.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: .8rem;
  width: min(260px, calc(100vw - 1.6rem));
  padding: .5rem;
  flex-direction: column;
  gap: .15rem;
  background: rgba(19,21,28,0.97);
  border: 1px solid rgba(244,162,77,0.25);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.5);
}
.nav-menu a {
  display: flex;
  align-items: center;
  padding: .85rem 1rem;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .02em;
  -webkit-tap-highlight-color: transparent;
}
.nav-menu a:hover,
.nav-menu a:active { background: rgba(244,162,77,0.14); color: var(--accent); }
@keyframes navMenuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===================== PET BOXES SECTION ===================== */
.pets-section {
  position: relative;
  z-index: 1;
  padding: 6rem 2rem 5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.pets-section .sec-head {
  text-align: center;
  margin-bottom: 2.4rem;
}
.pets-section .sec-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 900;
  background: linear-gradient(135deg, #f4a24d, #e07b7b, #c96fd0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .5rem;
}
.pets-section .sec-head p { color: var(--muted); font-size: .88rem; }

.pets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 260px));
  justify-content: center;
  gap: 1.4rem;
}

/* ===================== PET CARD ===================== */
.pet-box {
  background: rgba(19,21,28,0.78);
  border: 1px solid rgba(244,162,77,0.18);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(14px);
  box-shadow: 0 0 40px rgba(244,162,77,0.06), 0 2px 24px rgba(0,0,0,0.4);
  transition: transform .25s, box-shadow .25s;
  cursor: pointer;
}
.pet-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 60px rgba(244,162,77,0.18), 0 8px 30px rgba(0,0,0,0.45);
}
.pet-box .pet-photo {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
}
.pet-box .pet-info {
  padding: 1rem 1.1rem 1.2rem;
}
.pet-box .pet-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: .18rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.demo-tag {
  font-family: 'Inter', sans-serif;
  font-size: .52rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--accent2);
  background: rgba(224,123,123,0.14);
  border: 1px solid rgba(224,123,123,0.4);
  padding: .1rem .38rem;
  border-radius: 20px;
}
.pet-box .pet-breed {
  font-size: .74rem;
  color: var(--muted);
  letter-spacing: .03em;
  margin-bottom: .55rem;
}
.pet-box .pet-meta {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}
.pet-chip {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .05em;
  padding: .22rem .6rem;
  border-radius: 30px;
  background: rgba(244,162,77,0.08);
  border: 1px solid rgba(244,162,77,0.22);
  color: var(--accent);
}
.pet-chip.sex  { background: rgba(201,111,208,0.08); border-color: rgba(201,111,208,0.22); color: var(--accent3); }
.pet-chip.age  { background: rgba(100,160,255,0.08); border-color: rgba(100,160,255,0.22); color: #7eb8ff; }
.lock-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(244,162,77,0.1);
  border: 1px solid rgba(244,162,77,0.35);
  padding: .42rem 1rem;
  border-radius: 40px;
  width: 100%;
  justify-content: center;
  transition: background .2s;
}
.pet-box:hover .lock-btn {
  background: rgba(244,162,77,0.18);
}

.pets-empty {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  padding: 2.5rem 1rem;
  border: 1px dashed rgba(244,162,77,0.25);
  border-radius: 18px;
  grid-column: 1 / -1;
}

/* ===================== FOOTER ===================== */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  color: var(--muted);
  font-size: .78rem;
  border-top: 1px solid rgba(244,162,77,0.1);
}

.footer-links { margin-top: .5rem; }
.footer-links a { color: var(--muted); text-decoration: none; margin: 0 .35rem; transition: color .2s; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }

/* ===================== MODALS ===================== */
.pbm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.pbm-overlay.open { opacity: 1; pointer-events: all; }
.pbm {
  background: var(--card);
  border: 1px solid rgba(244,162,77,0.2);
  border-radius: 24px;
  padding: 2rem;
  max-width: 460px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 0 80px rgba(244,162,77,0.1);
  transform: translateY(24px);
  transition: transform .3s ease;
}
.pbm-overlay.open .pbm { transform: translateY(0); }
.pbm h3 {
  font-family: 'Playfair Display', serif;
  color: var(--accent);
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
  text-align: center;
}
.pbm input[type=password] {
  width: 100%;
  background: rgba(13,15,20,0.7);
  border: 1px solid rgba(244,162,77,0.25);
  border-radius: 12px;
  padding: .8rem 1rem;
  color: var(--text);
  font-size: .9rem;
  outline: none;
  margin-bottom: .8rem;
}
.pbm input[type=password]:focus { border-color: var(--accent); }
.pbm-err {
  color: var(--accent2);
  font-size: .78rem;
  text-align: center;
  margin-bottom: .6rem;
  min-height: 16px;
}
.pbm .pbm-btn-row { display: flex; gap: .7rem; margin-top: .4rem; }
.pbm button {
  flex: 1;
  padding: .75rem 1rem;
  border-radius: 60px;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
}
.pbm .pbm-unlock {
  background: linear-gradient(135deg, #f4a24d, #e07b7b);
  color: #0d0f14;
}
.pbm .pbm-cancel {
  background: rgba(244,162,77,0.08);
  border: 1.5px solid rgba(244,162,77,0.3);
  color: var(--accent);
}
/* ===================== RESPONSIVE — TABLET / iPAD (768px–1024px) ===================== */
@media (max-width: 1024px) {
  .pets-section { padding: 5.5rem 1.6rem 4rem; max-width: 900px; }
  .pets-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 240px)); gap: 1.1rem; }
  .pet-box .pet-photo { height: 135px; }
}

/* ===================== RESPONSIVE — LARGE PHONES / SMALL TABLETS (481px–767px) ===================== */
@media (max-width: 767px) {
  .navbar { padding: .7rem 1rem; }
  .nav-logo { font-size: 1.05rem; white-space: nowrap; }
  .nav-links .nav-cta { font-size: .78rem; padding: .48rem 1.05rem; }

  .pets-section { padding: 5rem 1.1rem 3.2rem; }
  .pets-section .sec-head { margin-bottom: 1.6rem; }
  .pets-section .sec-head p { padding: 0 .5rem; }

  .pets-grid { grid-template-columns: repeat(auto-fit, minmax(155px, 230px)); gap: .9rem; }
  .pet-box .pet-photo { height: 120px; }
  .pet-box .pet-info { padding: .8rem .9rem 1rem; }
  .pet-box .pet-name { font-size: 1rem; }

  .pbm { padding: 1.6rem; border-radius: 20px; }
  .pbm h3 { font-size: 1.2rem; }
}

/* ===================== RESPONSIVE — MOBILE (≤480px) ===================== */
@media (max-width: 480px) {
  .navbar { padding: .65rem .85rem; }
  .nav-logo { font-size: .95rem; gap: .3rem; }
  .nav-links .nav-cta { padding: .42rem .85rem; font-size: .74rem; }

  .pets-section { padding: 4.6rem .8rem 2.6rem; }
  .pets-section .sec-head h2 { font-size: 1.4rem; }
  .pets-section .sec-head p { font-size: .78rem; }

  .pets-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 220px)); gap: .7rem; }
  .pet-box { border-radius: 16px; }
  .pet-box .pet-photo { height: 110px; }
  .pet-box .pet-info { padding: .7rem .8rem .9rem; }
  .pet-box .pet-name { font-size: .92rem; }
  .pet-box .pet-breed { font-size: .68rem; }
  .pet-chip { font-size: .58rem; padding: .18rem .5rem; }
  .lock-btn { font-size: .6rem; padding: .38rem .8rem; }

  .footer { padding: 1.6rem .8rem 2rem; font-size: .7rem; }

  .pbm-overlay { padding: 1rem; }
  .pbm { padding: 1.4rem 1.2rem; }
}

/* ===================== RESPONSIVE — VERY SMALL PHONES (≤360px) ===================== */
@media (max-width: 360px) {
  .pets-grid { grid-template-columns: repeat(auto-fit, minmax(125px, 200px)); gap: .55rem; }
  .pet-box .pet-photo { height: 95px; }
}

/* ===================== MOBILE & TABLET REFINEMENTS ===================== */
/* iPad (768px–1024px): roomier bar with touch-sized links (full menu stays visible) */
@media (min-width: 768px) and (max-width: 1024px) {
  .navbar { padding: .9rem 1.6rem; }
  .nav-links { gap: 1.5rem; }
  .nav-links a { font-size: .9rem; }
  .nav-links .nav-cta { padding: .5rem 1.2rem; }
}

/* touch screens: no "stuck" hover lift after a tap */
@media (hover: none) {
  .pet-box:hover { transform: none; }
}

/* phones: Register + 3-dots menu in the bar, everything else inside the menu */
@media (max-width: 767px) {
  .nav-links li:not(.nav-register) { display: none; }
  .nav-links { margin-left: auto; gap: 0; }
  .nav-dots { display: flex; }
  .navbar.menu-open .nav-menu { display: flex; animation: navMenuIn .18s ease both; }

  .pbm input[type=password] { font-size: 16px; }  /* stops iOS zooming into the field */
  .pbm button { min-height: 44px; }
  .footer { padding-bottom: 4.5rem; }             /* keeps the last line clear of the Dark-mode button */
}
@media (max-width: 480px) {
  .nav-dots { flex-basis: 36px; width: 36px; height: 36px; margin-left: .5rem; }
}
@media (max-width: 360px) {
  .nav-logo { font-size: .85rem; }
  .nav-links .nav-cta { padding: .38rem .7rem; font-size: .7rem; }
  .nav-dots { margin-left: .4rem; }
}

/* ===================== LIGHT THEME (default) =====================
   Used when <html data-theme="light"> — theme.js sets this (light is the default)
   and its "Dark mode" button switches to dark, which is simply the original
   dark colours above. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f1e7;
  --surface: #ffffff;
  --card: #ffffff;
  --accent: #ad590b;
  --accent2: #b23e3e;
  --accent3: #8f3a9c;
  --text: #1b1a22;
  --muted: #5b5b6b;
}
html[data-theme="light"] .navbar { background: rgba(246,241,231,0.88); border-bottom-color: rgba(173,89,11,0.22); }
html[data-theme="light"] .nav-logo,
html[data-theme="light"] .pets-section .sec-head h2 { background-image: linear-gradient(135deg, #c96a0c, #b8404a, #8f3a9c); }
html[data-theme="light"] .nav-links .nav-cta { background: rgba(244,162,77,0.16); border-color: rgba(173,89,11,0.45); }
html[data-theme="light"] .pet-box {
  background: rgba(255,255,255,0.92); border-color: rgba(173,89,11,0.22);
  box-shadow: 0 2px 24px rgba(80,55,20,0.10);
}
html[data-theme="light"] .pet-box:hover { box-shadow: 0 8px 30px rgba(80,55,20,0.18); }
html[data-theme="light"] .pet-chip.age { background: rgba(31,95,180,0.08); border-color: rgba(31,95,180,0.3); color: #1f5fb4; }
html[data-theme="light"] .pets-empty { border-color: rgba(173,89,11,0.3); }
html[data-theme="light"] .footer { border-top-color: rgba(173,89,11,0.2); }
html[data-theme="light"] .pbm-overlay { background: rgba(30,22,10,0.5); }
html[data-theme="light"] .pbm { border-color: rgba(173,89,11,0.3); box-shadow: 0 20px 60px rgba(60,40,10,0.25); }
html[data-theme="light"] .pbm input[type=password] { background: #ffffff; border-color: rgba(0,0,0,0.25); }
html[data-theme="light"] .pbm .pbm-cancel { border-color: rgba(173,89,11,0.4); }
/* care-reminder bell on each pet card (its base style lives in home.html) */
html[data-theme="light"] .care-bell { background: #ffffff; border-color: rgba(173,89,11,0.5); box-shadow: 0 4px 12px rgba(80,55,20,0.18); }
html[data-theme="light"] .care-bell-badge { border-color: var(--bg); }
html[data-theme="light"] .nav-dots { background: rgba(244,162,77,0.16); border-color: rgba(173,89,11,0.45); }
html[data-theme="light"] .navbar.menu-open .nav-dots { background: rgba(244,162,77,0.3); }
html[data-theme="light"] .nav-menu { background: rgba(255,255,255,0.98); border-color: rgba(173,89,11,0.3); box-shadow: 0 14px 40px rgba(60,40,10,0.22); }