/* Kayak Arizona — desert & water palette */

:root {
  --canyon-900: #16110f;
  --canyon-800: #241a16;
  --canyon-700: #33241d;
  --sand-100:   #f6efe6;
  --sand-200:   #e9dcc9;
  --sand-300:   #d3c0a5;
  --rust:       #c2562c;
  --rust-dark:  #a3441f;
  --sunset:     #e8963a;
  --water:      #1f8a8a;
  --water-lt:   #35b0ad;
  --water-dk:   #14615f;
  --ink:        #1b1512;
  --muted:      #8a7b6d;
  --line:       rgba(0,0,0,.10);

  --radius:     14px;
  --radius-sm:  9px;
  --shadow:     0 1px 2px rgba(22,17,15,.06), 0 8px 24px -12px rgba(22,17,15,.28);
  --shadow-lg:  0 2px 4px rgba(22,17,15,.07), 0 24px 56px -20px rgba(22,17,15,.42);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--sand-100);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--water-dk); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); }
h3 { font-size: 1.1rem; }

/* ---------- Header ---------- */

.site-head {
  background: var(--canyon-900);
  color: var(--sand-100);
  position: sticky;
  top: 0;
  z-index: 900;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--sand-100);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.35rem; }
.brand-text em { font-style: normal; color: var(--water-lt); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.site-nav a { color: rgba(246,239,230,.82); font-size: .94rem; font-weight: 500; }
.site-nav a:hover { color: #fff; text-decoration: none; }

.nav-score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: .82rem;
  color: var(--sunset);
  background: rgba(232,150,58,.12);
  border: 1px solid rgba(232,150,58,.3);
  padding: 3px 10px;
  border-radius: 999px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--sand-100);
  margin: 4px 0;
  border-radius: 2px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--rust);
  color: #fff;
  border: 1px solid var(--rust);
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, transform .08s ease;
  font-family: inherit;
}
.btn:hover { background: var(--rust-dark); border-color: var(--rust-dark); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 14px; font-size: .87rem; }
.btn-block { width: 100%; }

.btn-water { background: var(--water); border-color: var(--water); }
.btn-water:hover { background: var(--water-dk); border-color: var(--water-dk); }

.btn-ghost {
  background: transparent;
  color: rgba(246,239,230,.9);
  border-color: rgba(255,255,255,.25);
}
.btn-ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.4); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--sand-300);
}
.btn-outline:hover { background: var(--sand-200); color: var(--ink); border-color: var(--sand-300); }

.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(1200px 380px at 15% -10%, rgba(53,176,173,.22), transparent 60%),
    linear-gradient(170deg, var(--canyon-900), var(--canyon-700) 70%, #46301f);
  color: var(--sand-100);
  padding: 52px 0 44px;
}
.hero h1 { color: #fff; max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--sunset); }
.hero p { color: rgba(246,239,230,.8); max-width: 56ch; font-size: 1.06rem; margin: 0 0 26px; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.14);
}
.hero-stat .n {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--water-lt);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.hero-stat .l { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: rgba(246,239,230,.6); }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Progress bar (logged in) ---------- */

.progress-strip {
  background: var(--canyon-800);
  color: var(--sand-100);
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.progress-strip .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.pbar {
  flex: 1 1 260px;
  height: 9px;
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  overflow: hidden;
  min-width: 180px;
}
.pbar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--water), var(--water-lt));
  border-radius: 999px;
  transition: width .5s ease;
}

/* ---------- Map ---------- */

.map-section { padding: 32px 0 8px; }

.map-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

#map {
  height: 620px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  background: var(--sand-200);
  z-index: 1;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.chip {
  border: 1px solid var(--sand-300);
  background: #fff;
  color: var(--ink);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--water); }
.chip.on { background: var(--canyon-900); border-color: var(--canyon-900); color: var(--sand-100); }

/* Leaflet popup restyle */
.leaflet-popup-content-wrapper { border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.leaflet-popup-content { margin: 14px 16px; font-family: var(--font); line-height: 1.5; width: 250px !important; }
.pop-name { font-weight: 700; font-size: 1.02rem; margin: 0 0 3px; }
.pop-meta { font-size: .78rem; color: var(--muted); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.pop-blurb { font-size: .88rem; margin: 0 0 12px; }
.pop-actions { display: flex; align-items: center; gap: 10px; }
.pop-pts {
  font-size: .78rem; font-weight: 700; color: var(--rust);
  background: rgba(194,86,44,.1); padding: 3px 9px; border-radius: 999px;
}
.pop-done {
  font-size: .78rem; font-weight: 700; color: var(--water-dk);
  background: rgba(31,138,138,.12); padding: 3px 9px; border-radius: 999px;
}

.marker-pin {
  background: var(--rust);
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.marker-pin.visited { background: var(--water); }

/* ---------- Cards / grid ---------- */

.section { padding: 46px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .3em; }

.feed-card { padding: 0; overflow: hidden; }
.feed-card img { width: 100%; height: 190px; object-fit: cover; background: var(--sand-200); }
.feed-body { padding: 14px 16px; }
.feed-body .who { font-size: .82rem; color: var(--muted); }
.feed-body .where { font-weight: 600; display: block; margin-bottom: 2px; }
.feed-note { font-size: .9rem; margin: 8px 0 0; }

/* ---------- Location page ---------- */

.loc-head {
  background: linear-gradient(160deg, var(--canyon-900), var(--canyon-700));
  color: var(--sand-100);
  padding: 40px 0 34px;
}
.loc-head h1 { color: #fff; margin-bottom: .25em; }
.loc-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.tag {
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: rgba(246,239,230,.92);
  border: 1px solid rgba(255,255,255,.16);
}
.tag-pts { background: rgba(232,150,58,.16); color: var(--sunset); border-color: rgba(232,150,58,.34); }
.tag-done { background: rgba(53,176,173,.18); color: var(--water-lt); border-color: rgba(53,176,173,.36); }

.two-col { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }

.tip-box {
  background: rgba(232,150,58,.1);
  border: 1px solid rgba(232,150,58,.3);
  border-left: 3px solid var(--sunset);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: .92rem;
}
.tip-box strong { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--rust-dark); margin-bottom: 3px; }

/* ---------- Forms ---------- */

.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

label { display: block; font-weight: 600; font-size: .88rem; margin: 0 0 6px; }

input[type=text], input[type=email], input[type=password], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--sand-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--water);
  outline-offset: -1px;
  border-color: var(--water);
}
textarea { resize: vertical; min-height: 88px; }

.field { margin-bottom: 18px; }
.field .hint { font-size: .8rem; color: var(--muted); margin: 5px 0 0; font-weight: 400; }

input[type=file] {
  width: 100%;
  padding: 22px;
  border: 2px dashed var(--sand-300);
  border-radius: var(--radius-sm);
  background: var(--sand-100);
  font-size: .9rem;
  cursor: pointer;
}

.flash {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-weight: 500;
}
.flash-info    { background: rgba(31,138,138,.1);  border: 1px solid rgba(31,138,138,.3);  color: var(--water-dk); }
.flash-success { background: rgba(31,138,138,.12); border: 1px solid rgba(31,138,138,.34); color: var(--water-dk); }
.flash-error   { background: rgba(194,86,44,.1);   border: 1px solid rgba(194,86,44,.32);  color: var(--rust-dark); }

.error-list {
  background: rgba(194,86,44,.09);
  border: 1px solid rgba(194,86,44,.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px 12px 32px;
  margin: 0 0 18px;
  font-size: .9rem;
  color: var(--rust-dark);
}

/* ---------- Leaderboard ---------- */

.board { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.board th {
  text-align: left;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--sand-100);
  font-weight: 700;
}
.board td { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.board tr:last-child td { border-bottom: 0; }
.board tr.me { background: rgba(232,150,58,.09); }
.board .rank { font-weight: 700; font-variant-numeric: tabular-nums; width: 62px; color: var(--muted); }
.board .rank-1 .rank, .board .rank-2 .rank, .board .rank-3 .rank { color: var(--rust); font-size: 1.05rem; }
.board .pts { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.board .locs { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Badges ---------- */

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.badge {
  background: linear-gradient(155deg, var(--canyon-800), var(--canyon-700));
  color: var(--sand-100);
  border-radius: var(--radius-sm);
  padding: 15px 16px;
  border: 1px solid rgba(232,150,58,.25);
}
.badge .bn { font-weight: 700; font-size: .95rem; color: var(--sunset); }
.badge .bd { font-size: .8rem; color: rgba(246,239,230,.7); margin-top: 3px; }

/* ---------- Region progress ---------- */

.region-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.region-row:last-child { border-bottom: 0; }
.region-row .rn { flex: 1 1 auto; font-size: .92rem; font-weight: 500; }
.region-row .rc { font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.region-row .rbar { flex: 0 0 110px; height: 6px; background: var(--sand-200); border-radius: 999px; overflow: hidden; }
.region-row .rbar > i { display: block; height: 100%; background: var(--water); }
.region-row.done .rbar > i { background: var(--sunset); }

/* ---------- Footer ---------- */

.site-foot {
  background: var(--canyon-900);
  color: rgba(246,239,230,.75);
  padding: 40px 0 30px;
  margin-top: 56px;
}
.site-foot strong { color: var(--sand-100); }
.site-foot a { color: var(--water-lt); }
.foot-inner { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; }
.foot-links { display: flex; flex-direction: column; gap: 7px; font-size: .9rem; }
.foot-legal { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.1); padding-top: 18px; margin: 8px 0 0; line-height: 1.6; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  #map { height: 460px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--canyon-900);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.1);
  }
  body.nav-open .site-nav { display: flex; }
  .site-nav a { padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
  .site-nav .btn { margin-top: 10px; }
  .nav-score { align-self: flex-start; margin: 10px 0 0; }
  .foot-inner { grid-template-columns: 1fr; }
  .hero { padding: 38px 0 34px; }
  .hero-stats { gap: 22px; }
}
