:root {
  --ink: #191716;
  --paper: #fffaf0;
  --sun: #ffcf24;
  --pink: #ff4f9a;
  --teal: #00b8a9;
  --green: #69d86f;
  --blue: #3185fc;
  --orange: #ff8a1d;
  --line: rgba(25, 23, 22, 0.14);
  --muted: rgba(25, 23, 22, 0.68);
  --shadow: 0 18px 48px rgba(25, 23, 22, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(255, 207, 36, 0.22), transparent 32%),
    linear-gradient(225deg, rgba(0, 184, 169, 0.2), transparent 34%),
    var(--paper);
  color: var(--ink);
  font-family: ui-rounded, "Nunito", "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.with-bottom-nav {
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  background: rgba(255, 250, 240, 0.88);
  border-bottom: 2px solid rgba(25, 23, 22, 0.08);
  backdrop-filter: blur(14px);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
  font-weight: 950;
  font-size: 18px;
}

.brand-mark img {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  object-fit: cover;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.top-actions form {
  margin: 0;
}

.speaking-chip,
.button,
.icon-btn,
.bottom-nav a,
.reaction-row button,
.inline-comment button {
  min-height: 44px;
}

.speaking-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 52vw;
  padding: 6px 10px;
  overflow: hidden;
  color: var(--ink);
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--sun);
  text-decoration: none;
  font-size: 12px;
}

.speaking-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.speaking-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 13px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  box-shadow: 5px 5px 0 var(--ink);
  text-decoration: none;
  font-weight: 950;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.button.secondary {
  background: var(--sun);
  color: var(--ink);
}

.button.ghost {
  background: #fff;
  color: var(--ink);
}

.button.small {
  min-height: 40px;
  padding: 10px 13px;
  font-size: 13px;
}

.button.full {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.icon-btn svg,
.bottom-nav svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flash {
  position: fixed;
  top: 74px;
  left: 12px;
  right: 12px;
  z-index: 30;
  max-width: 760px;
  margin: 0 auto;
  padding: 13px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 6px 6px 0 var(--ink);
  font-weight: 850;
}

.flash-success {
  background: #dfffe1;
}

.flash-warning {
  background: #fff0a8;
}

.hero {
  position: relative;
  display: grid;
  min-height: calc(100svh - 64px);
  overflow: hidden;
  background: linear-gradient(145deg, #ffcf24 0%, #ffef83 45%, #70e1d0 100%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 720px;
  padding: 34px 18px 22px;
}

.hero-logo {
  width: 72px;
  height: 72px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(4px 5px 0 rgba(25, 23, 22, 0.18));
}

.kicker {
  margin: 0 0 8px;
  color: #551a8b;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 52px;
  line-height: 0.95;
  font-weight: 1000;
}

h2 {
  font-size: 28px;
  line-height: 1.02;
}

.hero-line {
  max-width: 420px;
  margin-bottom: 10px;
  font-size: 26px;
  line-height: 1.02;
  font-weight: 950;
}

.hero-sub {
  max-width: 430px;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 750;
}

.hero-actions,
.center-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-art {
  align-self: end;
  padding: 0 12px 10px;
}

.hero-art img {
  width: min(680px, 100%);
  aspect-ratio: 4 / 3;
  margin-left: auto;
  border: 4px solid var(--ink);
  border-radius: 24px;
  object-fit: cover;
  filter: drop-shadow(0 20px 28px rgba(25, 23, 22, 0.18));
  animation: floaty 4.8s ease-in-out infinite;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.feature-band {
  display: grid;
  gap: 22px;
  padding: 48px 18px;
}

.feature-band.loud {
  background: var(--ink);
  color: #fff;
}

.feature-band h2 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: 34px;
}

.feature-band p:last-child {
  max-width: 620px;
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.45;
}

.feature-stack {
  display: grid;
  gap: 4px;
  padding: 0;
  background: var(--ink);
}

.feature-row {
  display: grid;
  gap: 22px;
  align-items: center;
  padding: 42px 18px;
  background: var(--paper);
}

.feature-row:nth-child(2) {
  background: #ecfff6;
}

.feature-row:nth-child(3) {
  background: #fff3f8;
}

.feature-row:nth-child(4) {
  background: #eef4ff;
}

.feature-row img {
  width: min(340px, 88vw);
  aspect-ratio: 4 / 3;
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 8px 8px 0 var(--ink);
  object-fit: cover;
  justify-self: center;
}

.feature-row p,
.qr-band p,
.business-hero p,
.guidelines-page li {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.qr-band,
.business-hero,
.guidelines-page,
.profile-hero {
  display: grid;
  gap: 24px;
  align-items: center;
  padding: 42px 18px;
}

.qr-band {
  background: var(--teal);
}

.qr-band span {
  padding: 2px 6px;
  background: #fff;
  border-radius: 6px;
}

.qr-band img,
.business-hero img,
.guidelines-page img {
  width: min(300px, 78vw);
  aspect-ratio: 4 / 3;
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 8px 8px 0 var(--ink);
  object-fit: cover;
  justify-self: center;
}

.featured-pets,
.app-page,
.narrow-page {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 28px 14px;
}

.section-head,
.app-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.app-head h1,
.section-head h2 {
  margin-bottom: 0;
}

.app-page h1,
.narrow-page h1,
.auth-shell h1 {
  font-size: 38px;
  line-height: 1.02;
}

.pet-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 22px 0;
}

.pet-preview {
  min-width: 0;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 5px 5px 0 var(--ink);
  text-align: center;
  text-decoration: none;
}

.pet-preview img {
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
  border-radius: 50%;
  object-fit: cover;
}

.pet-preview strong,
.pet-preview span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-shell {
  display: grid;
  gap: 20px;
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 28px 14px;
}

.auth-art {
  min-height: 210px;
  display: grid;
  place-items: center;
  background: var(--sun);
  border-bottom: 4px solid var(--ink);
}

.auth-art img {
  width: min(360px, 86vw);
  aspect-ratio: 4 / 3;
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 8px 8px 0 var(--ink);
  object-fit: cover;
}

.form-panel {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 20px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.form-panel.wide {
  width: min(740px, 100%);
}

.form-panel label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  font-weight: 900;
}

.form-panel .button.full {
  margin-top: 8px;
  margin-bottom: 20px;
}

.auth-link {
  margin: 0;
  line-height: 1.45;
  text-align: center;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fffdf6;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 118px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 4px rgba(0, 184, 169, 0.25);
}

.form-intro,
.field-hint,
.auth-link,
.post-meta,
.map-fallback,
.place-address,
.place-links,
.profile-facts,
.status {
  color: var(--muted);
}

.form-errors {
  margin-bottom: 14px;
  padding: 12px;
  border: 2px solid #cf1d5b;
  border-radius: var(--radius);
  background: #ffe3ef;
  font-weight: 850;
}

.form-errors p {
  margin: 0;
}

.form-errors p + p {
  margin-top: 6px;
}

.form-grid {
  display: grid;
  gap: 0 14px;
}

.image-preview,
.avatar-preview {
  width: 100%;
  max-height: 360px;
  margin: -2px 0 16px;
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
  object-fit: cover;
  background: #f7f7f7;
}

.avatar-preview {
  width: 112px;
  height: 112px;
  border-radius: 50%;
}

.feed-list,
.places-list,
.pet-list,
.settings-list {
  display: grid;
  gap: 18px;
}

.post-card,
.place-card,
.pet-row,
.settings-list section,
.mod-row {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 5px 5px 0 var(--ink);
}

.post-card {
  overflow: hidden;
}

.pet-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  text-decoration: none;
}

.pet-byline img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.pet-byline span {
  min-width: 0;
}

.pet-byline strong,
.pet-byline small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #f1f1f1;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.caption {
  margin: 13px 13px 6px;
  font-size: 16px;
  line-height: 1.42;
  font-weight: 750;
}

.post-meta {
  margin: 0 13px 10px;
  font-size: 13px;
}

.reaction-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding: 0 12px 12px;
}

.reaction-row form {
  margin: 0;
}

.reaction-row button {
  width: 100%;
  padding: 8px 6px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff4b8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
}

.reaction-row button.reacted {
  background: var(--green);
}

.reaction-row button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.reaction-row b {
  display: inline-block;
  min-width: 16px;
  margin-left: 3px;
}

.comments {
  display: grid;
  gap: 9px;
  padding: 0 12px 12px;
}

.comment {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  font-size: 14px;
  line-height: 1.35;
}

.comment a {
  font-weight: 950;
}

.comment form {
  margin-left: auto;
}

.inline-comment {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.inline-comment input {
  min-width: 0;
}

.inline-comment button {
  flex: 0 0 auto;
  padding: 0 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

.report-box {
  margin: 0 12px 12px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 14px;
}

.report-box summary {
  cursor: pointer;
  font-weight: 900;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 900;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button.danger,
.danger {
  color: #cf1d5b;
}

.pet-switcher,
.speaking-banner,
.map-fallback {
  margin-bottom: 16px;
}

.pet-switcher {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
}

.pet-switcher label {
  font-weight: 950;
}

.speaking-banner {
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #dfffe1;
  font-weight: 800;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 32px 18px;
  text-align: center;
}

.empty-state img {
  width: min(240px, 70vw);
}

.empty-state.small img {
  width: 120px;
}

.pet-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.pet-row.selected {
  background: #dfffe1;
}

.pet-row img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  object-fit: cover;
}

.pet-row h2 {
  margin-bottom: 4px;
  font-size: 20px;
}

.pet-row p {
  margin-bottom: 6px;
}

.pet-row-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-row span,
.profile-facts span,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff4b8;
  font-size: 12px;
  font-weight: 900;
}

.profile-hero {
  background: linear-gradient(135deg, #ffcf24, #ff8a1d);
}

.profile-avatar {
  width: min(270px, 72vw);
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 9px 9px 0 var(--ink);
  object-fit: cover;
  justify-self: center;
  background: #fff;
}

.profile-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.handle {
  font-weight: 950;
  color: #551a8b;
}

.qr-stub,
.success-box,
.dev-link {
  margin: 16px 0;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
}

.qr-stub span,
.dev-link a {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 6px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
}

.place-card {
  padding: 16px;
}

.place-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: #551a8b;
  font-size: 13px;
  font-weight: 950;
}

.place-card h2 {
  margin-bottom: 8px;
}

.place-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 12px;
}

.reaction-row.compact {
  padding: 0 0 12px;
}

.business-hero {
  background: #eef4ff;
}

.guidelines-page {
  width: min(980px, 100%);
  margin: 0 auto;
}

.guideline-list {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.guideline-list li {
  padding: 14px;
  border-left: 8px solid var(--pink);
  background: #fff;
}

.narrow-page {
  display: grid;
  justify-items: start;
  max-width: 640px;
}

.page-mascot {
  width: 170px;
  aspect-ratio: 4 / 3;
  border: 3px solid var(--ink);
  border-radius: 18px;
  object-fit: cover;
  justify-self: center;
}

.settings-list section,
.mod-row {
  padding: 16px;
}

.status.good {
  background: #dfffe1;
}

.status.warn {
  background: #fff0a8;
}

.moderation-grid {
  display: grid;
  gap: 18px;
}

.mod-row + .mod-row {
  margin-top: 12px;
}

.bottom-nav {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px;
  border: 2px solid var(--ink);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 40px rgba(25, 23, 22, 0.22);
  backdrop-filter: blur(14px);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 0;
  padding: 6px 2px;
  border-radius: 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 950;
}

.bottom-nav a.active {
  background: var(--sun);
  color: var(--ink);
}

.bottom-nav .post-tab {
  background: var(--pink);
  color: #fff;
}

.bottom-nav .post-tab.active {
  background: var(--ink);
  color: #fff;
}

@media (min-width: 720px) {
  .hero {
    grid-template-columns: minmax(360px, 0.9fr) minmax(360px, 1.1fr);
    min-height: calc(100svh - 64px);
  }

  .hero-copy {
    padding: 54px 46px;
  }

  .hero-art {
    align-self: center;
    padding: 34px 34px 20px 0;
  }

  h1 {
    font-size: 70px;
  }

  .app-page h1,
  .narrow-page h1,
  .auth-shell h1 {
    font-size: 46px;
  }

  .feature-band,
  .qr-band,
  .business-hero,
  .guidelines-page,
  .profile-hero {
    grid-template-columns: 1fr 0.8fr;
    padding: 70px 56px;
  }

  .feature-row {
    grid-template-columns: 0.8fr 1fr;
    padding: 70px 56px;
  }

  .feature-row.reverse {
    grid-template-columns: 1fr 0.8fr;
  }

  .feature-row.reverse img {
    order: 2;
  }

  .auth-shell {
    grid-template-columns: 0.9fr 1fr;
    align-items: stretch;
    padding: 52px 24px;
  }

  .auth-art {
    border: 4px solid var(--ink);
    border-radius: var(--radius);
  }

  .form-grid.two {
    grid-template-columns: 1fr 1fr;
  }

  .pet-row {
    grid-template-columns: 84px 1fr auto;
  }

  .pet-row-actions {
    grid-column: auto;
  }

  .feed-list {
    width: min(620px, 100%);
    margin: 0 auto;
  }

  .places-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .moderation-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 719px) {
  .app-head,
  .section-head {
    display: grid;
    align-items: start;
  }
}

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