:root {
  --bg: #f6f1e8;
  --ink: #1a1a1a;
  --muted: #5c564e;
  --line: #e4dccd;
  --card: #fffdf8;
  --accent: #c45c26;
  --accent-ink: #fffdf8;
  --ok: #2f6b4f;
  --danger: #9b2c2c;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  /* Shared page container (Library width): Library-aligned page width */
  --shell-max: 960px;
  --shell-pad-x: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

.shell {
  width: min(100%, var(--shell-max));
  margin: 0 auto;
  padding: 28px var(--shell-pad-x) 64px;
}

.hero { margin-bottom: 28px; }
.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
h1 {
  margin: 0;
  font-size: clamp(34px, 9vw, 44px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.lede {
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
  padding: 4px;
  border-radius: 999px;
  background: #ebe4d6;
}
.tab {
  appearance: none;
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.tab.is-active {
  background: var(--card);
  color: var(--ink);
}
.tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
input#city {
  appearance: none;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 600;
}
input#city:focus {
  outline: none;
  border-color: var(--accent);
}
.hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.go {
  appearance: none;
  border: 0;
  min-height: 56px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.35s var(--ease), opacity 0.2s;
}
.go:active { transform: scale(0.98); }
.go:disabled { opacity: 0.45; cursor: not-allowed; }

.status {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}
.status strong { color: var(--ink); font-weight: 700; }
.status.error { border-color: var(--danger); color: var(--danger); }

.status-pipeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.status-count {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.status-line {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 600;
  text-wrap: pretty;
}
@media (max-width: 419px) {
  .status-line { font-size: 14px; }
  .status { padding: 12px 14px; }
}


.fact {
  margin: 0 0 18px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--card);
}
.fact .kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c9b8a0;
}
.fact h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.fact p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: #e8dfd2;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.25s var(--ease), transform 0.35s var(--ease);
}
.card:hover, .card:focus-visible {
  border-color: var(--ink);
  outline: none;
}
.card.selected {
  border-color: var(--accent);
}
.card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #ebe4d6;
}
.card .meta {
  padding: 0 10px 10px;
}
.card .name {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}
.card .stats {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.card .badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
}
.card.skeleton img {
  background: #ebe4d6;
}
@media (prefers-reduced-motion: reduce) {
  .go { transition: none; }
}

.pick {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}
.secondary, .ghost {
  appearance: none;
  min-height: 48px;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.secondary {
  border: 2px solid var(--ink);
  background: var(--card);
  color: var(--ink);
}
.ghost {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.foot {
  margin-top: 12px;
  text-align: center;
}
.fine, .site-visits {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.site-visits { margin-top: 6px; }

@media (min-width: 720px) {
  .shell { padding-top: 48px; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .pick {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .pick .secondary { flex: 1; }
}

.again { display: block; width: 100%; margin: 8px 0 24px; }

.viewer {
  border: 0;
  padding: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  background: #0f0e0c;
  color: #f6f1e8;
}
.viewer::backdrop { background: rgba(15, 14, 12, 0.92); }
.viewer[open] {
  display: flex;
  flex-direction: column;
}
.viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, var(--shell-max));
  margin: 0 auto;
  padding: 14px var(--shell-pad-x);
  padding-top: max(14px, env(safe-area-inset-top));
  box-sizing: border-box;
}
.viewer-close {
  appearance: none;
  border: 0;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: #2a2723;
  color: #f6f1e8;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.viewer-title { min-width: 0; }
.viewer-label {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.viewer-stats {
  margin: 2px 0 0;
  font-size: 12px;
  color: #b7aea2;
  font-variant-numeric: tabular-nums;
}
.viewer-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, var(--shell-max));
  margin: 0 auto;
  padding: 8px var(--shell-pad-x) calc(12px + env(safe-area-inset-bottom));
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.viewer-frame {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(100%, 360px);
  max-height: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.viewer-frame img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 290px);
  object-fit: contain;
  border-radius: 12px;
  background: #1a1815;
}
.viewer-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 0;
  box-sizing: border-box;
}
.viewer-actions .secondary {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-color: #f6f1e8;
  background: #f6f1e8;
  color: #1a1a1a;
  padding: 0 8px;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}
@media (min-width: 720px) {
  .viewer-frame {
    width: min(100%, 420px);
  }
  .viewer-frame img {
    max-height: calc(100dvh - 300px);
  }
}

/* Phone stays 2x2 */
@media (min-width: 720px) {
  .grid { grid-template-columns: 1fr 1fr; max-width: 560px; }
}


/* Travel poster: one big 3:4 hero */
.hero-stack {
  width: min(100%, 420px);
  margin: 0 auto 18px;
}
.hero-result {
  margin: 0 0 12px;
}
.hero-card {
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.hero-card:hover,
.hero-card:focus-visible {
  border-color: var(--ink);
  outline: none;
}
.hero-card img,
.hero-frame {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #ebe4d6;
  max-height: 80vh;
}
.hero-stats {
  margin: 0;
  padding: 12px 14px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hero-card.skeleton .hero-frame {
  background: #ebe4d6;
}
.hero-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin: 0;
  width: 100%;
}
.hero-actions .secondary {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 12px;
  line-height: 1.2;
  white-space: nowrap;
}

/* Community library */
.tabs .tab {
  font-size: 13px;
  padding: 0 6px;
}
.library {
  margin: 0 0 24px;
}
.library-head {
  margin: 0 0 12px;
}
.library-lede {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.library-card {
  appearance: none;
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #ebe4d6;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  aspect-ratio: 1 / 1;
}
.library-card:hover,
.library-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.library-card img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #ebe4d6;
}
.library-card .meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 7px 7px;
  background: rgba(15, 14, 12, 0.78);
}
.library-card .name {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  color: #fffdf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.library-card .style,
.library-card .stats {
  display: none;
}
@media (min-width: 720px) {
  .library-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
  }
  .library-card {
    border-radius: 12px;
  }
  .library-card .name {
    font-size: 12px;
  }
}
.library-empty,
.library-status {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
  text-align: center;
}
.library-status.error {
  color: var(--danger);
}
.library-more {
  display: block;
  width: 100%;
  margin: 16px 0 0;
  min-height: 48px;
}
/* Site nav (Make / About) */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 22px;
  min-height: 44px;
}
.site-nav-home {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.site-nav-links {
  display: flex;
  gap: 16px;
}
.site-nav-links a {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-nav-links a[aria-current="page"],
.site-nav-links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* About page: three paragraphs */
.about-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 8px 0 40px;
}
.about-copy p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}
.about-copy strong {
  color: var(--ink);
  font-weight: 800;
}
.about-copy a {
  color: var(--accent);
  font-weight: 700;
}
.page-about .site-nav {
  margin-bottom: 28px;
}

/* Researched landmark caption on finished art */
.landmark {
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
}
.landmark-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.landmark-name {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.landmark-note {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.viewer-landmark { width: 100%; }
.viewer-landmark-inner .landmark-kicker { color: #e0915f; }
.viewer-landmark-inner .landmark-name { color: #f6f1e8; font-size: 17px; }
.viewer-landmark-inner .landmark-note {
  color: #b7aea2;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
