:root {
  color-scheme: light;
  --paper: #f7f3e8;
  --paper-blue: #e8f2ff;
  --ink: #10223f;
  --muted: #5c6983;
  --blue: #155bc7;
  --deep-blue: #082e7d;
  --sky: #78c8ff;
  --coral: #ff6f61;
  --lime: #b9e769;
  --yellow: #ffe06f;
  --card: #ffffff;
  --line: #b7c8e8;
  --shadow: 0 14px 34px rgba(8, 46, 125, 0.14);
  --typewriter: "Courier Prime", "Courier New", Courier, ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--typewriter);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 3px solid var(--ink);
  background: rgba(247, 243, 232, 0.94);
  backdrop-filter: blur(14px);
}

.header-inner,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: grid;
  gap: 0.05rem;
  text-decoration: none;
}

.brand-kicker,
.eyebrow {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-name {
  font-size: clamp(1.35rem, 4vw, 2.15rem);
  font-weight: 700;
  line-height: 0.95;
}

.top-nav {
  display: flex;
  gap: 0.5rem;
}

.top-nav a,
.back-link,
.card-link,
.link-chip {
  min-height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  padding: 0.35rem 0.8rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
}

main {
  display: grid;
  gap: 1.2rem;
  padding: 1.1rem 0 3rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 320px);
  gap: 1rem;
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.detail-view,
.toolbar,
.photo-map,
.empty-state {
  border: 3px solid var(--ink);
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-copy {
  min-height: 260px;
  display: grid;
  align-content: end;
  gap: 1rem;
  padding: clamp(1.1rem, 4vw, 2rem);
  background: var(--paper-blue);
}

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

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-size: clamp(2.3rem, 7vw, 5.6rem);
  line-height: 0.88;
}

.intro {
  max-width: 680px;
  color: #21385f;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  line-height: 1.45;
}

.hero-panel {
  display: grid;
  align-content: center;
  gap: 0.7rem;
  padding: 1rem;
  background: var(--deep-blue);
  color: #fff;
}

.hero-panel span {
  display: block;
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.11);
  font-weight: 700;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(160px, 220px);
  gap: 0.8rem;
  padding: 0.85rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 2.8rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0.62rem 0.72rem;
}

.featured-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.featured-card,
.listing-card {
  position: relative;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--ink);
}

.featured-card {
  min-height: 260px;
  display: grid;
  align-content: end;
}

.featured-card img,
.listing-photo img,
.detail-main-photo img,
.detail-thumb img,
.map-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.featured-card img {
  position: absolute;
  inset: 0;
}

.featured-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  min-height: 44%;
  background: var(--deep-blue);
  opacity: 0.9;
}

.featured-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem;
  color: #fff;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.listing-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.listing-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-blue);
}

.no-photo,
.empty-state {
  display: grid;
  place-items: center;
  color: var(--deep-blue);
  font-weight: 700;
  text-align: center;
}

.card-body {
  display: grid;
  gap: 0.7rem;
  align-content: start;
  padding: 0.85rem;
}

.card-top,
.detail-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: start;
}

.card-title {
  font-size: 1.25rem;
  line-height: 1.02;
}

.price {
  align-self: start;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--lime);
  padding: 0.24rem 0.55rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 2px 2px 0 var(--ink);
}

.meta-row,
.detail-meta,
.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-blue);
  color: var(--deep-blue);
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.description {
  color: var(--muted);
  line-height: 1.45;
}

.map-section {
  display: grid;
  gap: 0.8rem;
  padding-top: 0.5rem;
}

.section-heading {
  display: grid;
  gap: 0.25rem;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 0.95;
}

.photo-map-list {
  display: grid;
  gap: 1rem;
}

.photo-map {
  display: grid;
  gap: 0.6rem;
  padding: 0.8rem;
}

.photo-map h3 {
  font-size: 1.45rem;
}

.map-stage {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: #d7eaff;
}

.map-photo {
  position: relative;
  width: 100%;
}

.map-photo img {
  height: auto;
}

.bbox {
  position: absolute;
  border: 2px solid var(--yellow);
  background: rgba(255, 224, 111, 0.08);
  box-shadow: 0 0 0 1px rgba(16, 34, 63, 0.55);
}

.map-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-line {
  stroke: var(--yellow);
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
}

.map-label {
  position: absolute;
  max-width: min(210px, 34%);
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0.35rem 0.45rem;
  font-size: clamp(0.68rem, 1.5vw, 0.88rem);
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--coral);
}

.map-label small {
  display: block;
  margin-top: 0.12rem;
  color: var(--blue);
  font-size: 0.75em;
}

.detail-view {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.detail-view[hidden] {
  display: none;
}

.detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 1rem;
}

.detail-gallery {
  display: grid;
  gap: 0.75rem;
}

.detail-main-photo {
  min-height: 360px;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--paper-blue);
}

.detail-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.detail-thumb {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 2px solid var(--ink);
  background: var(--paper-blue);
}

.detail-copy {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.detail-copy h2 {
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 0.9;
}

.detail-note,
.detail-comp {
  border-left: 5px solid var(--coral);
  background: #fff7d6;
  padding: 0.75rem;
  line-height: 1.45;
}

.detail-comp {
  border-left-color: var(--blue);
  background: #e9f3ff;
}

.source-links {
  align-items: center;
}

.link-chip {
  min-height: 2rem;
  border-width: 1.5px;
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 0.85rem;
}

.empty-state {
  min-height: 220px;
  padding: 2rem;
}

@media (max-width: 980px) {
  .hero,
  .detail-shell,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .featured-strip,
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.8rem 0;
  }

  .top-nav {
    width: 100%;
  }

  .top-nav a {
    flex: 1;
  }

  .hero-copy {
    min-height: auto;
    padding: 1rem;
  }

  .hero-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0.5rem;
  }

  .hero-panel span {
    min-height: 3.2rem;
    display: flex;
    align-items: center;
    padding: 0.45rem;
    font-size: 0.86rem;
    line-height: 1.15;
  }

  h1 {
    font-size: clamp(1.85rem, 10.5vw, 2.75rem);
    line-height: 0.92;
  }

  .intro {
    font-size: 0.98rem;
  }

  .featured-strip,
  .catalog-grid,
  .detail-thumbs {
    grid-template-columns: 1fr;
  }

  .map-label {
    max-width: 42%;
    font-size: 0.66rem;
  }
}
