:root {
  --ink: #17362d;
  --ink-soft: #405c52;
  --cream: #f7f3e9;
  --paper: #fffdf8;
  --mint: #dbeade;
  --orange: #e77645;
  --orange-dark: #bd4f25;
  --line: rgba(23, 54, 45, 0.16);
  --shadow: 0 24px 70px rgba(39, 57, 46, 0.13);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.site-header { width: min(1180px, calc(100% - 40px)); min-height: 84px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark { position: relative; width: 38px; height: 38px; border-radius: 14px 14px 17px 17px; background: var(--ink); transform: rotate(-4deg); }
.brand-mark::after { content: ""; position: absolute; width: 17px; height: 14px; left: 11px; top: 14px; border-radius: 50% 50% 45% 45%; background: var(--cream); }
.brand-mark i { position: absolute; width: 8px; height: 10px; border-radius: 50%; background: var(--cream); top: 6px; }
.brand-mark i:first-child { left: 7px; transform: rotate(-20deg); }
.brand-mark i:last-child { right: 7px; transform: rotate(20deg); }
.header-nav { display: flex; align-items: center; gap: 20px; }
.header-link { font-size: 14px; font-weight: 700; text-underline-offset: 5px; }
.back-link { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.back-link:hover { background: var(--mint); }

.hero { width: min(1180px, calc(100% - 40px)); min-height: 650px; margin: 0 auto; display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: clamp(40px, 7vw, 100px); padding: 64px 0 82px; }
.eyebrow { margin: 0 0 16px; color: var(--orange-dark); font-size: 12px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
h1 { max-width: 670px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(54px, 6.7vw, 91px); font-weight: 500; line-height: 0.95; letter-spacing: -0.055em; }
h1 em { color: var(--orange); font-weight: 500; }
.lead { max-width: 660px; margin: 28px 0 34px; color: var(--ink-soft); font-size: 18px; line-height: 1.65; }
.search-card { max-width: 690px; padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 253, 248, 0.84); box-shadow: 0 14px 40px rgba(44, 66, 55, 0.08); backdrop-filter: blur(12px); }
.search-card label { display: block; margin: 0 0 9px 5px; font-size: 13px; font-weight: 800; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.search-row input { width: 100%; min-width: 0; height: 58px; padding: 0 18px; border: 1.5px solid #b9c9bd; border-radius: 14px; outline: none; background: white; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 18px; letter-spacing: 0.035em; transition: border-color .2s, box-shadow .2s; }
.search-row input:focus { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(231, 118, 69, .13); }
.search-row button, .secondary { border: 0; border-radius: 14px; cursor: pointer; font-weight: 900; }
.search-row button { min-width: 155px; padding: 0 20px; background: var(--ink); color: white; display: inline-flex; align-items: center; justify-content: center; gap: 20px; }
.search-row button:hover { background: #0e2b23; }
.search-row button:disabled { opacity: .62; cursor: wait; }
.search-card > p { margin: 9px 5px 0; color: #698077; font-size: 12px; }
.status { max-width: 690px; display: flex; align-items: center; gap: 11px; margin-top: 15px; padding: 13px 16px; border-radius: 14px; font-size: 14px; font-weight: 700; }
.status.loading { background: #e5efe7; }
.status.error { background: #f9e2dc; color: #8a2e19; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
.status.error .status-dot { animation: none; }
@keyframes pulse { 50% { opacity: .28; transform: scale(.78); } }

.hero-visual { position: relative; width: min(100%, 465px); aspect-ratio: 1 / 1.03; margin: 0 auto; border-radius: 48% 52% 42% 58% / 56% 45% 55% 44%; background: var(--mint); isolation: isolate; }
.hero-visual::before { content: ""; position: absolute; inset: 10%; border-radius: 50%; border: 1px dashed rgba(23,54,45,.28); }
.hero-visual img { position: absolute; z-index: 2; width: 80%; height: 83%; left: 10%; bottom: 2%; object-fit: contain; filter: drop-shadow(0 26px 18px rgba(26,52,40,.15)); }
.orbit { position: absolute; z-index: -1; border: 1px solid rgba(23,54,45,.18); border-radius: 50%; }
.orbit-one { inset: -6% -2% 4% -7%; transform: rotate(13deg); }
.orbit-two { inset: 7% -10% -7% 5%; transform: rotate(-19deg); }
.chip-tag, .data-tag { position: absolute; z-index: 3; padding: 11px 15px; border: 1px solid rgba(23,54,45,.12); border-radius: 999px; background: var(--paper); box-shadow: 0 12px 28px rgba(36,60,48,.12); font-size: 12px; font-weight: 900; }
.chip-tag { left: -6%; top: 18%; transform: rotate(-5deg); }
.data-tag { right: -7%; bottom: 18%; transform: rotate(4deg); }

.result-wrap { padding: 0 20px 92px; }
.result-card { width: min(1050px, 100%); margin: 0 auto; display: grid; grid-template-columns: 40% 60%; overflow: hidden; border: 1px solid var(--line); border-radius: 32px; background: var(--paper); box-shadow: var(--shadow); }
.dog-portrait { min-height: 480px; padding: 28px 30px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--mint); text-align: center; }
.portrait-kicker { align-self: flex-start; padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.64); font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.dog-portrait img { width: min(100%, 320px); height: 300px; object-fit: contain; filter: drop-shadow(0 22px 16px rgba(26,52,40,.13)); }
.breed-fallback { width: min(100%, 320px); height: 300px; display: grid; place-items: center; align-content: center; gap: 10px; color: #597166; }
.breed-fallback img { width: 100%; height: 260px; object-fit: contain; }
.breed-fallback small { font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.breed-note { max-width: 310px; margin: 5px 0 9px; font-family: Georgia, "Times New Roman", serif; font-size: 17px; font-weight: 500; line-height: 1.35; }
.dog-portrait p { max-width: 270px; margin: 0; color: #597166; font-size: 11px; line-height: 1.5; }
.other-animal { display: grid; place-items: center; width: 260px; height: 300px; font-size: 86px; }
.pet-data { padding: clamp(32px, 5vw, 56px); }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.result-heading h2, .info-section h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.035em; }
.result-heading h2 { font-size: clamp(39px, 5vw, 58px); line-height: 1; }
.found-badge { flex: 0 0 auto; padding: 9px 12px; border-radius: 999px; background: #dff0e1; color: #2c693d; font-size: 12px; font-weight: 900; }
.important-note { margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: #ece8e1; font-size: 13px; font-weight: 800; }
.important-note.warning { background: #f8dfd4; color: #7d2c18; }
.data-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.data-grid > div { min-width: 0; padding: 23px 18px 23px 0; border-bottom: 1px solid var(--line); }
.data-grid > div:nth-child(even) { padding-left: 22px; border-left: 1px solid var(--line); }
.data-grid > .wide { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
.data-grid dt { margin-bottom: 7px; color: #71847b; font-size: 11px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.data-grid dd { margin: 0; overflow-wrap: anywhere; font-size: 16px; font-weight: 800; line-height: 1.45; }
.data-grid .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.vaccination-row { position: relative; }
.vaccination-badge { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 10px 6px 7px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.vaccination-badge b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: white; font-size: 13px; }
.vaccination-badge.recent { background: #dff3e3; color: #25693a; }
.vaccination-badge.recent b { background: #2b8a46; }
.vaccination-badge.older { background: #f3ead8; color: #795a20; }
.vaccination-badge.older b { background: #a87a25; }
.result-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 27px; }
.secondary { padding: 13px 17px; background: var(--ink); color: white; }
.result-actions a { font-size: 13px; font-weight: 800; text-underline-offset: 4px; }

.info-section { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 86px 0 90px; border-top: 1px solid var(--line); }
.info-section > div:first-child { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: end; }
.info-section h2 { max-width: 620px; font-size: clamp(39px, 5vw, 63px); line-height: 1.02; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 52px; }
.info-grid article { min-height: 230px; padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,253,248,.55); }
.info-grid span { color: var(--orange); font-family: Georgia, serif; font-size: 14px; }
.info-grid h3 { margin: 47px 0 9px; font-size: 18px; }
.info-grid p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 38px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 30px; color: #6c7d76; font-size: 12px; }
footer p { margin: 0; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 52px; }
  .hero-copy { order: 1; }
  .hero-visual { width: min(78vw, 430px); order: 2; }
  .result-card { grid-template-columns: 1fr; }
  .dog-portrait { min-height: 390px; }
  .dog-portrait img { height: 275px; }
  .info-section > div:first-child { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .site-header, .hero, .info-section, footer { width: min(100% - 28px, 1180px); }
  .site-header { min-height: 70px; }
  .header-nav { gap: 8px; }
  .info-link { display: none; }
  .back-link { display: inline-flex; padding: 8px 10px; font-size: 12px; }
  .hero { gap: 48px; padding: 45px 0 62px; }
  h1 { font-size: clamp(49px, 15vw, 68px); }
  .lead { margin-top: 23px; font-size: 16px; }
  .search-card { padding: 13px; border-radius: 18px; }
  .search-row { grid-template-columns: 1fr; }
  .search-row input { height: 55px; font-size: 16px; }
  .search-row button { height: 52px; }
  .hero-visual { width: min(82vw, 370px); }
  .chip-tag { left: -2%; }
  .data-tag { right: -3%; }
  .result-wrap { padding: 0 14px 65px; }
  .result-card { border-radius: 24px; }
  .dog-portrait { min-height: 350px; padding: 22px; }
  .dog-portrait img { height: 245px; }
  .pet-data { padding: 30px 22px; }
  .result-heading { align-items: center; }
  .found-badge { font-size: 10px; }
  .data-grid { grid-template-columns: 1fr; }
  .data-grid > div, .data-grid > div:nth-child(even), .data-grid > .wide { grid-column: auto; padding: 18px 0; border-left: 0; }
  .result-actions { align-items: flex-start; flex-direction: column; }
  .info-section { padding: 65px 0; }
  .info-grid { grid-template-columns: 1fr; margin-top: 35px; }
  .info-grid article { min-height: 185px; }
  .info-grid h3 { margin-top: 35px; }
  footer { flex-direction: column; gap: 8px; }
}

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