/* Design tokens */
:root {
  --font-body: 'Inter', system-ui, sans-serif; --font-head: 'Fraunces', Georgia, serif;
  --head-weight: 600; --head-tracking: -0.01em;
  --red: #d80909; --red-dark: #b30707;
  --bg: #fff; --text: #1d2420; --heading: #121815; --muted: #5b6660;
  --accent: #2f6b4f; --accent-dark: #24543e; --on-accent: #fff;
  --soft: #f3f6f4; --card-bg: #fff; --line: #e2e8e4; --line-strong: #c9d2cd;
  --topbar-bg: #2f6b4f; --topbar-text: #fff;
  --header-bg: rgba(255,255,255,.96); --hero-bg: #fff;
  --footer-bg: #121815; --footer-text: #b9c2bd; --footer-hover: #fff;
  --radius: 12px; --radius-sm: 8px; --radius-btn: 8px;
}

/* Tierarztpraxis Malchin */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('../fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('../fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 600; font-display: swap; src: url('../fonts/fraunces-600.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 700; font-display: swap; src: url('../fonts/fraunces-700.woff2') format('woff2'); }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight); line-height: 1.2; margin: 0 0 .5em; color: var(--heading); letter-spacing: var(--head-tracking, 0); }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Top bar */
.topbar { background: var(--topbar-bg); color: var(--topbar-text); font-size: .875rem; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
.topbar a { color: inherit; font-weight: 600; text-decoration: none; }

/* Header */
.header { background: var(--header-bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 116px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--heading); }
.brand img { height: 88px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 1.2rem; }
.brand-sub { font-size: .8rem; color: var(--muted); }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--soft); color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; margin: 5px 0; background: var(--text); }

/* Hero */
.hero { background: var(--hero-bg); padding: 64px 0; }
.hero-inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 600; color: var(--accent); margin-bottom: .75em; }
.hero-lead { font-size: 1.1rem; color: var(--muted); max-width: 34em; }
.hero-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn { display: inline-block; padding: 12px 22px; border-radius: var(--radius-btn); font-weight: 600; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { border: 1px solid var(--line-strong); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--soft); }
.section-head { margin-bottom: 40px; }
.section-head p { color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { display: flex; flex-direction: column; background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card-body p { color: var(--muted); flex: 1; }
.more { color: var(--accent); font-weight: 600; }
.more::after { content: ' →'; }

.info { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.hours { border-collapse: collapse; width: 100%; max-width: 420px; }
.hours th, .hours td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.hours th { font-weight: 600; padding-right: 24px; }
.note { color: var(--muted); font-size: .95rem; margin-top: 16px; }
address { font-style: normal; margin-bottom: .5em; }
.maps-link { font-weight: 600; text-decoration: none; }
.maps-link::after { content: ' ↗'; }
.emergency { margin-top: 24px; padding: 16px 20px; background: var(--card-bg); border-left: 4px solid var(--red); border-radius: var(--radius-sm); }
.emergency strong { display: block; }

/* Footer */
.footer { background: var(--footer-bg); color: var(--footer-text); font-size: .9rem; padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer p { margin: 0; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.footer-links a:hover { color: var(--footer-hover); }

/* Mobile */
@media (max-width: 860px) {
  .topbar-phone { display: none; }
  .header-inner { min-height: 84px; }
  .brand img { height: 60px; }
  .brand-name { font-size: 1.05rem; }
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--header-bg); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; }
  .nav.open { display: flex; }
  .hero { padding: 40px 0; }
  .hero-inner, .info { grid-template-columns: 1fr; gap: 32px; }
  .cards { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
}

/* Navigation: current page */
.nav a[aria-current="page"] { color: var(--accent); background: var(--soft); }

/* Inner pages */
.page-head { padding-top: 64px; padding-bottom: 40px; }
.page-head .lead { font-size: 1.15rem; color: var(--muted); margin: 0; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 0; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); }
.gallery figcaption { margin-top: 12px; font-weight: 600; color: var(--heading); }

.banner { width: 100%; margin: 8px 0 32px; }
.pillars { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 32px; }
.pillars li { padding: 6px 14px; border-radius: 999px; background: var(--card-bg); border: 1px solid var(--line); font-weight: 600; font-size: .95rem; color: var(--accent); }
.prose p { margin-bottom: 1.1em; }
.claim { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 1.2rem; font-weight: 600; color: var(--heading); }

/* Team */
.team-group + .team-group { margin-top: 64px; }
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 32px; }
.member img { width: 180px; height: 180px; object-fit: cover; border-radius: 50%; margin-bottom: 16px; }
.member h3 { margin: 0; }
.member .role { margin: 0; color: var(--accent); font-weight: 600; font-size: .95rem; }
.member .focus { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }

.member-button { all: unset; display: block; cursor: pointer; border-radius: var(--radius); }
.member-button img { transition: transform .2s; }
.member-button:hover img { transform: scale(1.04); }
.member-button .member-name { display: block; font-size: 1.25rem; font-weight: 600; line-height: 1.2; color: var(--heading); }
.member-button .role { display: block; }
.member-button:hover .member-name { color: var(--accent); }
.member-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.member-button .role::after { content: ' · Mehr'; color: var(--muted); font-weight: 400; }

.member-dialog { padding: 0; border: 0; border-radius: var(--radius); width: min(760px, calc(100% - 32px)); max-height: calc(100% - 32px); box-shadow: 0 24px 64px rgba(0,0,0,.25); color: var(--text); }
.member-dialog[open] { display: grid; grid-template-columns: 1fr 1fr; }
.member-dialog::backdrop { background: rgba(18,24,21,.6); }
.member-dialog > img { width: 100%; height: 100%; max-height: 80vh; object-fit: cover; }
.member-dialog-body { padding: 40px 32px; align-self: center; }
.member-dialog-body h2 { margin-bottom: 4px; }
.member-dialog .role { margin: 0 0 24px; color: var(--accent); font-weight: 600; }
.member-dialog .focus-label { margin: 0 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.member-dialog .focus { margin: 0; font-size: 1.1rem; }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--text); }
.dialog-close:hover { background: #fff; color: var(--accent); }
@media (max-width: 640px) {
  .member-dialog[open] { grid-template-columns: 1fr; }
  .member-dialog > img { max-height: 55vh; }
  .member-dialog-body { padding: 24px; }
}

/* Contact */
.contact-list { border-collapse: collapse; width: 100%; max-width: 460px; }
.contact-list th, .contact-list td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.contact-list th { font-weight: 600; padding-right: 24px; white-space: nowrap; }
.contact-list a { text-decoration: none; }
.info h3 { margin-top: 40px; }

/* Legal pages */
.legal { max-width: 720px; }
.legal h2 { font-size: 1.4rem; margin-top: 48px; }
.legal h3 { font-size: 1.05rem; margin: 28px 0 6px; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal ul { padding-left: 1.2em; }

/* Footer address */
.footer-inner p span + span::before { content: ' · '; }

@media (max-width: 860px) {
  .gallery { grid-template-columns: 1fr 1fr; }
  .page-head { padding-top: 40px; padding-bottom: 24px; }
}
@media (max-width: 520px) {
  .gallery { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
.member-dialog h2:focus { outline: none; }

/* Animal easter egg (js/critter.js) */
.critter { position: fixed; right: 20px; bottom: 16px; width: 120px; z-index: 20; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; filter: drop-shadow(0 6px 12px rgba(0,0,0,.15)); transition: transform .2s; }
.critter:hover { transform: translateY(-4px) rotate(-3deg); }
.critter svg { display: block; width: 100%; height: auto; overflow: visible; }
.critter-eye { transform-box: fill-box; transform-origin: center; transition: transform .08s; }
.critter.blink .critter-eye { transform: scaleY(.1); }
.critter-ear { transform-box: fill-box; }
.critter-ear-l { transform-origin: right center; }
.critter-ear-r { transform-origin: left center; }
.critter.talk .critter-ear-l { animation: critter-ear-l .5s ease-in-out 2; }
.critter.talk .critter-ear-r { animation: critter-ear-r .5s ease-in-out 2; }
@keyframes critter-ear-l { 50% { transform: rotate(18deg); } }
@keyframes critter-ear-r { 50% { transform: rotate(-18deg); } }
.critter-bubble { position: absolute; right: 92%; top: -4px; padding: 6px 12px; background: #fff; color: var(--heading); font-weight: 600; border-radius: 14px; border: 2px solid var(--heading); white-space: nowrap; opacity: 0; transform: translateY(6px) scale(.9); pointer-events: none; }
.critter-bubble::after { content: ''; position: absolute; right: -9px; bottom: 6px; border: 8px solid transparent; border-left-color: var(--heading); border-right: 0; }
.critter.talk .critter-bubble { animation: critter-talk 1.6s ease-out; }
@keyframes critter-talk { 10%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-4px); } }
@media (max-width: 860px) { .critter { width: 84px; right: 12px; bottom: 76px; } }
@media (prefers-reduced-motion: reduce) { .critter, .critter-eye { transition: none; } .critter.talk .critter-ear-l, .critter.talk .critter-ear-r { animation: none; } }

/* Open / closed badge */
.open-status { display: inline-flex; align-items: flex-start; gap: 8px; font-weight: 600; font-size: .9rem; line-height: 1.35; }
.open-status[hidden] { display: none; }
.open-dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa39e; flex: none; margin-top: .35em; }
.open-status[data-state="open"] .open-dot { background: #1f9d55; box-shadow: 0 0 0 0 rgba(31,157,85,.5); animation: open-pulse 2s infinite; }
.open-status[data-state="closed"] .open-dot { background: var(--red); }
@keyframes open-pulse { 70% { box-shadow: 0 0 0 7px rgba(31,157,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); } }
.topbar .open-status { font-size: inherit; margin-right: 16px; }
.topbar .open-status[data-state="open"] .open-dot { background: #6ee7a0; }
.topbar .open-status[data-state="closed"] .open-dot { background: #ff9b9b; }

/* Bento grid (home) */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(170px, auto);
  gap: 16px;
  grid-template-areas:
    "gross gross klein hours"
    "gross gross klein hours"
    "team  team  fleisch emergency"
    "team  team  fleisch contact";
}
.tile { position: relative; border-radius: 18px; overflow: hidden; padding: 24px; background: var(--soft); color: inherit; text-decoration: none; display: flex; flex-direction: column; }
.tile h3 { margin-bottom: .35em; }
.tile p, .tile h3 { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.tile-gross { grid-area: gross; } .tile-klein { grid-area: klein; } .tile-hours { grid-area: hours; }
.tile-team { grid-area: team; } .tile-fleisch { grid-area: fleisch; } .tile-emergency { grid-area: emergency; } .tile-contact { grid-area: contact; }

.tile-photo { justify-content: flex-end; color: #fff; min-height: 240px; }
.tile-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.tile-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,16,13,.9) 0%, rgba(10,16,13,.62) 38%, rgba(10,16,13,.12) 72%, rgba(10,16,13,0) 100%); }
.tile-photo .tile-body { position: relative; z-index: 1; }
.tile-photo h3 { color: #fff; font-size: 1.5rem; }
.tile-gross h3 { font-size: 2rem; }
.tile-photo p { margin: 0 0 .6em; color: rgba(255,255,255,.85); max-width: 32em; }
.tile-photo .more { color: #fff; }
.tile-photo:hover img { transform: scale(1.05); }

.tile-hours { background: var(--soft); }
.tile-hours .open-status { margin-bottom: 12px; }
.tile-hours .hours th, .tile-hours .hours td { padding: 7px 0; font-size: .95rem; }
.tile-hours .note { margin: 12px 0 0; font-size: .85rem; }

.tile-emergency { background: #fdf0f0; color: var(--red-dark); border: 1px solid #f5d0d0; justify-content: space-between; transition: border-color .15s, background .15s; }
.tile-emergency:hover { background: #fbe6e6; border-color: var(--red); }
.tile-kicker { font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.tile-big { font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; line-height: 1.15; margin: 8px 0; color: var(--red); }
.tile-emergency .more { color: var(--red-dark); margin-top: 8px; }

.tile-contact { background: var(--heading); color: #dfe6e2; }
.tile-contact h3 { color: #fff; }
.tile-contact address { margin-bottom: .4em; }
.tile-contact p { margin: 0 0 .6em; }
.tile-contact a { color: #fff; text-decoration: none; }
.tile-contact .maps-link { margin-top: auto; }

@media (max-width: 1000px) {
  .bento { grid-template-columns: 1fr 1fr; grid-template-areas: "gross gross" "klein hours" "team team" "fleisch emergency" "fleisch contact"; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; grid-template-areas: "gross" "hours" "klein" "emergency" "team" "fleisch" "contact"; }
  .tile-gross h3 { font-size: 1.6rem; }
  .tile-photo { min-height: 300px; }
}

/* Mobile action bar */
.action-bar { display: none; }
@media (max-width: 860px) {
  body { padding-bottom: 64px; }
  .action-bar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.06); padding-bottom: env(safe-area-inset-bottom); }
  .action-bar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px; font-size: .78rem; font-weight: 600; color: var(--text); text-decoration: none; }
  .action-bar a svg { color: var(--accent); }
  .action-bar .action-emergency { color: var(--red-dark); }
  .action-bar .action-emergency svg { color: var(--red); }
}

