/* =========================================================
   The Bombay Cats — main stylesheet (the "Catalog" design)
   ---------------------------------------------------------
   Used by the homepage and the cat pages. The care guides
   use care/care.css, which shares the same colours and font.

   Change a colour or the font in section 1 and the whole
   site follows.

   1. Colours and fonts
   2. Page basics
   3. Header and footer
   4. Banner
   5. The sentence filter and counts
   6. Cat grid
   7. Sections (found a cat, list a cat)
   8. Forms and buttons
   9. Pop-ups, messages, toast
   10. Phones
   ========================================================= */

/* 1. Colours and fonts ------------------------------------ */
:root {
  --ground: #FAFAF7;   /* page background */
  --ink: #1A1A1A;      /* text */
  --muted: #5F5F5A;    /* secondary text (passes contrast on the ground) */
  --faint: #8A8A85;    /* the grey words in the sentence filter (large text only) */
  --line: #D8D6CF;     /* hairlines */
  --tile: #EEECE6;     /* behind photos */
  --accent: #A4521A;   /* small highlights: "New", errors */
  --slate: #2F3A56;    /* banner frame */
  --indigo: #4B4F9E;   /* the 'book cover' blue: highlights and button hovers */
  --butter: #F3EDB5;   /* the pale yellow that goes with it */
  --ok-bg: #E8F0E6;
  --error-bg: #F8E7E1;
  --font: 'Inter Tight', system-ui, sans-serif;
  --wrap: 1360px;
}

/* 2. Page basics ------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: inherit; }
a:hover { color: var(--accent); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 40px; }
.muted { color: var(--muted); }
.caps { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--slate); outline-offset: 2px; }

/* 3. Header and footer ------------------------------------- */
.site-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 0 22px; }
.brand { font-weight: 600; font-size: 15px; letter-spacing: 0.08em; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; font-size: 13px; letter-spacing: 0.06em; }
.site-nav a, .site-nav button { text-decoration: none; background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-transform: uppercase; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.site-nav a.nav-care { background: var(--indigo); color: var(--butter); padding: 7px 12px; }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; background: none; padding: 10px; cursor: pointer; }
.site-foot { border-top: 1px solid var(--line); margin-top: 88px; padding: 24px 0 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-foot a { color: var(--muted); }
.disclaimer { font-size: 12px; color: var(--muted); padding: 0 0 32px; margin: 0; }
.site-foot a.foot-care { color: var(--ink); font-weight: 600; }

/* 4. Banner ------------------------------------------------ */
/* (the framed dithered picture under the header) */
.hero-banner { margin: 0; border: 1.5px solid var(--slate); line-height: 0; overflow: hidden; }
.hero-banner img { width: 100%; height: auto; max-height: 340px; object-fit: cover; object-position: 40% 50%; image-rendering: pixelated; display: block; }

/* 5. The sentence filter and counts ------------------------ */
.finder { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 64px 0 36px; }
.finder h1 { margin: 0; font-weight: 400; font-size: 64px; line-height: 1.05; letter-spacing: -0.025em; }
.pick { position: relative; display: inline-block; }
.pick select { appearance: none; -webkit-appearance: none; font: inherit; color: var(--faint); background: transparent; border: 0; padding: 0 0.55em 0 0; cursor: pointer; letter-spacing: inherit; max-width: 100%; }
.pick::after { content: ""; position: absolute; right: 0; top: 50%; width: 0.22em; height: 0.22em; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: translateY(-75%) rotate(45deg); pointer-events: none; }
.pick select:hover { color: var(--ink); }
.counts { margin: 0; font-size: 14px; color: var(--muted); text-align: right; }

/* 6. Cat grid ---------------------------------------------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 28px; }
.cat-item { display: flex; flex-direction: column; gap: 10px; text-decoration: none; min-width: 0; }
.cat-photo { position: relative; background: var(--tile); aspect-ratio: 4 / 5; overflow: hidden; }
.cat-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.cat-item:hover .cat-photo img { transform: scale(1.03); }
.cat-photo .no-photo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.cat-photo .no-photo img { width: 46%; height: auto; opacity: .85; image-rendering: pixelated; }
.cat-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; overflow-wrap: anywhere; }
.cat-line .name { font-weight: 500; }
.cat-line.sub { font-size: 13px; color: var(--muted); margin-top: -8px; }
.flag { color: var(--accent); font-weight: 600; white-space: nowrap; }
.mine { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); }
.link-btn { font: inherit; font-size: 13px; background: none; border: 0; padding: 6px 0; text-decoration: underline; cursor: pointer; color: var(--ink); }
.grid-empty { grid-column: 1 / -1; padding: 40px 0; }
.grid-empty h3 { margin: 0 0 6px; font-weight: 500; font-size: 22px; }
.adopted-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px 20px; }
.adopted-grid .cat-photo { aspect-ratio: 1 / 1; filter: grayscale(0.2); }

/* 7. Sections ----------------------------------------------- */
.band { border-top: 1px solid var(--line); margin-top: 88px; padding-top: 28px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.band > h2 { margin: 0; font-weight: 500; font-size: 15px; }
.band .wide { grid-column: span 3; }
.band .lead { margin: 0; font-size: 34px; line-height: 1.2; letter-spacing: -0.015em; }
.guide-link { text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.guide-link .t { font-size: 22px; letter-spacing: -0.01em; }
.guide-link .d { font-size: 14px; color: var(--muted); }
.section-label { margin: 0 0 24px; font-weight: 500; font-size: 15px; }

/* Found a cat: the quiz sits in the middle, in indigo */
.found { border-top: 1px solid var(--line); margin-top: 88px; padding-top: 28px; }
.found-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr); align-items: stretch; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.found-row .guide-link { padding: 32px 28px; justify-content: center; }
.found-row .guide-link:hover .t { color: var(--accent); }
.quiz { position: relative; overflow: hidden; isolation: isolate; background: var(--indigo); color: var(--butter); gap: 10px !important; padding: 44px 36px !important; }
.quiz:hover, .quiz:focus-visible { color: var(--butter); }
.found-row .quiz:hover .t { color: var(--butter); }
.quiz .k { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.quiz .t { font-size: 32px; line-height: 1.12; letter-spacing: -0.02em; }
.quiz .d { color: var(--butter); opacity: .85; font-size: 15px; }
.quiz .go { margin-top: 8px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 5px; }
.found-more { margin: 14px 0 0; text-align: right; font-size: 14px; }

/* List a cat: the three steps */
.band .lead { margin: 0 0 28px; }
.how { list-style: none; padding: 0; margin: 0 0 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.how li { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--ink); padding-top: 14px; }
.how .n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.how strong { font-weight: 500; font-size: 20px; }
.how span:last-child { font-size: 14px; color: var(--muted); }

/* Found homes: a strip that keeps moving */
.homes { border-top: 1px solid var(--line); margin-top: 88px; padding-top: 28px; }
.homes-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 24px; margin-bottom: 24px; }
.homes-head .section-label { margin: 0; }
.homes-count { margin: 0; font-size: 34px; line-height: 1.2; letter-spacing: -0.015em; }
.homes-count span { color: var(--indigo); }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: flex; width: max-content; animation: slide var(--speed, 40s) linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-set { display: flex; gap: 20px; padding-right: 20px; }
.home-card { width: 200px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.home-card .cat-photo { aspect-ratio: 1 / 1; }
.home-card .name { font-weight: 500; margin-top: 6px; }
.home-card .muted { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.home-card { text-decoration: none; color: inherit; }
a.home-card:hover .name { color: var(--indigo); }
.home-card .tail-line { font-size: 13px; color: var(--indigo); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee { overflow-x: auto; } .marquee-track { animation: none; } }

/* 8. Forms and buttons --------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 12px 22px; font: inherit; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; border: 1px solid var(--ink); background: var(--ground); color: var(--ink); cursor: pointer; border-radius: 0; }
/* Hover: the button turns indigo and thin butter-yellow lines sweep in and drift,
   like the striped portrait on the Poor Charlie's Almanack cover */
.btn, .site-nav a.nav-care { position: relative; overflow: hidden; isolation: isolate; transition: color .2s ease, background-color .2s ease, border-color .2s ease; }
.btn::before, .site-nav a.nav-care::before, .quiz::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--butter) 0 1.5px, transparent 1.5px 6px);
  opacity: 0; transform: translateX(-101%); transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .2s ease;
}
.btn:hover, .btn:focus-visible, .site-nav a.nav-care:hover, .site-nav a.nav-care:focus-visible { background: var(--indigo); border-color: var(--indigo); color: var(--butter); }
.btn:hover::before, .btn:focus-visible::before, .site-nav a.nav-care:hover::before, .quiz:hover::before, .quiz:focus-visible::before { opacity: .38; transform: translateX(0); animation: drift 1.4s linear .5s infinite; }
@keyframes drift { to { background-position: 12px 0; } }
.btn.solid { background: var(--ink); color: var(--ground); }
.btn.solid:hover, .btn.solid:focus-visible { background: var(--indigo); border-color: var(--indigo); color: var(--butter); }
.btn-google::before { display: none; }
.btn-google:hover, .btn-google:focus-visible { background: var(--tile); color: var(--ink); border-color: var(--ink); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.form { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 13px; font-weight: 500; }
.field input, .field textarea, .field select { font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 0; padding: 12px 14px; width: 100%; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--ink); }
.checks { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 15px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.checks input { width: 18px; height: 18px; accent-color: var(--ink); }
.more { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
.more summary { cursor: pointer; font-size: 14px; font-weight: 500; }
.more[open] summary { margin-bottom: 16px; }
.photo-drop { border: 1px dashed var(--muted); background: #fff; padding: 28px; text-align: center; cursor: pointer; }
.photo-drop:hover, .photo-drop.has-file { border-style: solid; border-color: var(--ink); }
.photo-drop-text { font-weight: 500; }
.photo-drop-hint { font-size: 13px; color: var(--muted); }
.photo-preview { max-height: 280px; width: auto; object-fit: contain; align-self: flex-start; }
/* Sign-in card: a little stitched patch. The dashed line inside the edge
   is the "stitching"; the cat is img/stitch-cat-indigo.svg */
.signin-box { --stitch: var(--indigo); position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px; max-width: 760px; padding: 30px 36px; background: var(--tile); outline: 1.5px dashed var(--stitch); outline-offset: -9px; }
.signin-cat { width: 52px; height: 70px; background: var(--signin-cat, url("/img/stitch-cat-indigo.svg")) center / contain no-repeat; }
.signin-text { display: flex; flex-direction: column; gap: 4px; }
.signin-text strong { font-weight: 400; font-size: 24px; line-height: 1.15; letter-spacing: -0.015em; color: var(--stitch); }
.signin-text p, .signin-box p { margin: 0; font-size: 14px; color: var(--muted); }
@media (max-width: 600px) {
  .signin-box { grid-template-columns: auto minmax(0, 1fr); padding: 26px 24px; gap: 16px 18px; }
  .signin-box .btn { grid-column: 1 / -1; width: 100%; }
}
.ts-box:empty { display: none; }

/* 9. Pop-ups, messages, toast -------------------------------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(26, 26, 26, 0.35); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-overlay.show { display: flex; }
.modal { position: relative; background: var(--ground); width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 32px 28px 28px; border: 1px solid var(--ink); display: flex; flex-direction: column; gap: 14px; }
.modal h3 { margin: 0; font-weight: 500; font-size: 26px; letter-spacing: -0.015em; }
.modal p { margin: 0; color: var(--muted); font-size: 14px; }
.modal-close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink); }
.or { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-google { gap: 10px; text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 500; }
.auth-legal, .auth-toggle { font-size: 13px; color: var(--muted); text-align: center; margin: 0; }
.auth-toggle a { color: var(--ink); font-weight: 500; }
.banner, .banner-msg { padding: 12px 14px; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.banner-error { background: var(--error-bg); color: #7A2A0E; }
.banner-success { background: var(--ok-bg); color: #24421F; }
.contact-cat-preview { display: flex; gap: 12px; align-items: center; }
.contact-cat-thumb { width: 56px; height: 56px; object-fit: cover; background: var(--tile); flex: none; }
.contact-cat-info { display: flex; flex-direction: column; font-size: 14px; }
.contact-cat-info span { color: var(--muted); font-size: 13px; }
.contact-as { font-size: 13px; color: var(--muted); }
.report-link { font: inherit; font-size: 13px; color: var(--muted); background: none; border: 0; padding: 8px 0; text-decoration: underline; cursor: pointer; text-align: left; }
.report-options { display: flex; flex-direction: column; gap: 4px; }
.report-option { display: flex; gap: 10px; align-items: center; min-height: 40px; font-size: 15px; cursor: pointer; }
.report-option input { accent-color: var(--ink); width: 18px; height: 18px; }
.share-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; visibility: hidden; background: var(--ink); color: var(--ground); padding: 12px 18px; font-size: 14px; transition: transform .25s ease, opacity .25s ease, visibility .25s; z-index: 60; }
.share-toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* 10. Phones -------------------------------------------------- */
@media (max-width: 1020px) {
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .adopted-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .band { grid-template-columns: 1fr; }
  .band .wide { grid-column: auto; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .site-top { padding: 10px 0; }
  .menu-btn { display: inline-flex; }
  .site-nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: 0; border-top: 1px solid var(--line); }
  .site-nav.open { display: flex; }
  .site-nav a, .site-nav button { padding: 14px 0; width: 100%; text-align: left; border-bottom: 1px solid var(--line); }
  .hero-banner { height: 150px; }
  .hero-banner img { height: 100%; max-height: none; object-fit: cover; object-position: 40% 50%; }
  .finder { padding: 32px 0 24px; }
  .finder h1 { line-height: 1.1; }
  .counts { text-align: left; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
  .cat-line { flex-direction: column; gap: 0; }
  .cat-line.sub { margin-top: -6px; }
  .adopted-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; }
  .band { margin-top: 56px; gap: 16px; }
  .band .lead { font-size: 24px; }
  .finder h1 { font-size: 40px; }
  .finder h1 br { display: none; }
  .found-row { grid-template-columns: 1fr; border-bottom: 0; }
  .found-row .guide-link { padding: 22px 0; border-bottom: 1px solid var(--line); }
  .found-row .quiz { order: -1; padding: 28px 22px !important; border-bottom: 0; }
  .found-more { text-align: left; }
  .how { grid-template-columns: 1fr; }
  .homes-count { font-size: 24px; }
  .home-card { width: 150px; }
  .site-nav a.nav-care { padding: 14px 12px; }
  .form-row { grid-template-columns: 1fr; }
  .site-foot { margin-top: 56px; flex-direction: column; }
}

/* The quiz card's cross-stitch frame, in butter on indigo
   (the same stitches as the inner pages, recoloured: img/stitch-*-cream.svg) */
.quiz { padding: 56px 52px !important; }
.quiz .st { position: absolute; pointer-events: none; z-index: -1; }
.quiz .c { width: 52px; height: 52px; background: url("/img/stitch-corner-cream.svg") center / contain no-repeat; transition: transform .4s ease; }
.quiz .tl { left: 10px; top: 10px; }
.quiz .tr { right: 10px; top: 10px; transform: scaleX(-1); }
.quiz .bl { left: 10px; bottom: 10px; transform: scaleY(-1); }
.quiz .br { right: 10px; bottom: 10px; transform: scale(-1, -1); }
.quiz:hover .tl { transform: translate(-3px, -3px); }
.quiz:hover .tr { transform: scaleX(-1) translate(-3px, -3px); }
.quiz:hover .bl { transform: scaleY(-1) translate(-3px, -3px); }
.quiz:hover .br { transform: scale(-1, -1) translate(-3px, -3px); }
.quiz .e { left: 72px; right: 72px; height: 18px; background: url("/img/stitch-edge-cream.svg") space center / auto 18px; }
.quiz .top { top: 10px; } .quiz .bottom { bottom: 10px; transform: scaleY(-1); }
.quiz .v { top: 72px; bottom: 72px; width: 18px; background: url("/img/stitch-edge-v-cream.svg") space center / 18px auto; }
.quiz .left { left: 10px; } .quiz .right { right: 10px; transform: scaleX(-1); }
@media (max-width: 860px) { .found-row .quiz { padding: 54px 46px !important; } .quiz .c { width: 40px; height: 40px; } .quiz .e { left: 56px; right: 56px; } .quiz .v { top: 56px; bottom: 56px; } }
.signin-box .btn.solid { background: var(--stitch); border-color: var(--stitch); }
.signin-box .btn.solid:hover, .signin-box .btn.solid:focus-visible { background: var(--ink); border-color: var(--ink); }
