/* ---------- Theme ---------- */
:root {
  --bg: #07121c;            /* deep night-sky navy */
  --bg-2: #0c1f2e;
  --text: #e8f1f2;
  --muted: #9fb3bd;
  --accent: #5eead4;        /* teal "aurora" */
  --accent-2: #f9b872;      /* warm sunrise */
  --glass: rgba(10, 26, 38, 0.55);
  --line: rgba(232, 241, 242, 0.12);
  --radius: 999px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Solid fallback behind the gradient, so long pages never show white below the fold */
html {
  background: #07121c;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(94, 234, 212, 0.18), transparent 60%),
    radial-gradient(900px 400px at 85% 0%, rgba(249, 184, 114, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 0.35s ease,
    padding 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

/* Frosted-glass bar once you scroll */
.navbar.scrolled {
  padding-top: 12px;
  padding-bottom: 12px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
}

/* ---------- Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: var(--text);
}

/* Little sun sitting on a horizon line */
.brand-mark {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 75%, var(--accent-2), #f0766b 55%, transparent 56%);
  box-shadow: 0 0 18px rgba(249, 184, 114, 0.45);
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(180deg, var(--accent), #2b8a9e);
  border-top: 1.5px solid rgba(255, 255, 255, 0.7);
}

/* ---------- Right side ---------- */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  display: inline-flex;
  align-items: center;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  padding: 0.55em 1.1em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  padding: 0.55em 1.1em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.btn--ghost {
  color: var(--muted);
  border-color: var(--line);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: rgba(94, 234, 212, 0.5);
  background: rgba(94, 234, 212, 0.08);
}

.btn--accent {
  color: #04211f;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #8be9c8);
  box-shadow: 0 6px 20px -6px rgba(94, 234, 212, 0.6);
}

.btn--accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -6px rgba(94, 234, 212, 0.75);
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Hero / destination search ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 120px 20px 60px;
}

.hero-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(34px, 7vw, 64px);
  line-height: 1.2;
  letter-spacing: -0.5px;
  /* room for descenders (g, y, p) – gradient text is clipped to the element's box */
  padding: 0 0.06em 0.14em;
  background: linear-gradient(180deg, #ffffff, #b9d6dc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 14px 0 28px;
  color: var(--muted);
  font-size: 16px;
}

.dest-form {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 520px;
  padding: 6px;
  border-radius: var(--radius);
  background: rgba(10, 26, 38, 0.6);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.dest-form:focus-within {
  border-color: rgba(94, 234, 212, 0.6);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.12);
}

.dest-input {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

.dest-input::placeholder {
  color: rgba(159, 179, 189, 0.6);
}

.dest-go {
  padding: 0.6em 1.4em;
}

.dest-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  background: rgba(232, 241, 242, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 14px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.chip:hover {
  color: var(--text);
  border-color: rgba(94, 234, 212, 0.5);
  background: rgba(94, 234, 212, 0.08);
}

.chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dest-status {
  min-height: 1.5em;
  margin: 18px 0 -12px;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.3px;
}

.globe-wrap {
  width: min(100%, 600px);
  aspect-ratio: 1;
  margin-top: 12px;
}

.globe-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.dest-form.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

.btn:disabled {
  cursor: default;
}

/* ---------- Page transitions ---------- */
main {
  /* "backwards" so the animation doesn't hold opacity/transform after it ends –
     otherwise it would block the fade-out below */
  animation: page-in 0.5s ease backwards;
}

body.is-leaving main {
  opacity: 0;
  transform: scale(1.03);
  filter: blur(4px);
  transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ======================================================================
   Destination page
   ====================================================================== */
.dest {
  max-width: 1160px;
  margin: 0 auto;
  padding: 100px 20px 60px;
}

.back-link {
  display: inline-block;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 18px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--accent);
}

.dest-eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}

.dest-title {
  margin: 4px 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: clamp(36px, 7vw, 68px);
  line-height: 1.2;
  padding-bottom: 0.08em;
  letter-spacing: -0.5px;
  color: #f2f8f8;
}

.dest-meta {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.dest-meta .dot {
  margin: 0 8px;
  opacity: 0.6;
}

.dest-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  margin-top: 28px;
  align-items: start;
}

.dest-globe {
  width: min(100%, 520px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.dest-globe canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.dest-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

/* ---------- Cards ---------- */
.card {
  padding: 20px 22px;
  border-radius: 20px;
  background: rgba(10, 26, 38, 0.6);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 12px;
}

.card-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 22px;
}

.card-note {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Forecast ---------- */
.wx-days {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wx-day {
  display: grid;
  grid-template-columns: 48px 26px minmax(0, 1fr) 40px 66px;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  font-size: 14px;
  border-top: 1px solid var(--line);
}

.wx-day:first-child {
  border-top: 0;
}

.wx-name {
  color: var(--text);
  font-weight: 500;
}

.wx-icon {
  font-size: 18px;
  text-align: center;
}

.wx-label {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wx-rain {
  color: #7cc4f0;
  font-size: 13px;
  text-align: right;
}

.wx-temp {
  text-align: right;
  color: var(--muted);
}

.wx-temp b {
  color: var(--text);
  font-weight: 600;
}

.wx-loading {
  padding: 8px 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Packing list ---------- */
.progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(232, 241, 242, 0.08);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}

.pack-hint {
  margin: 12px 0 6px;
  font-size: 13px;
  color: var(--muted);
}

.pack-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pack-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.pack-item:first-child {
  border-top: 0;
}

.pack-item input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border-radius: 6px;
  border: 1.5px solid rgba(232, 241, 242, 0.35);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pack-item input::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #04211f;
  border-bottom: 2px solid #04211f;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform 0.15s ease;
}

.pack-item input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.pack-item input:checked::after {
  transform: rotate(-45deg) translate(1px, -1px) scale(1);
}

.pack-item input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pack-item label {
  flex: 1;
  font-size: 15px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.pack-item.is-done .pack-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(159, 179, 189, 0.6);
}

.pack-remove {
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.pack-item:hover .pack-remove,
.pack-remove:focus-visible {
  opacity: 1;
}

.pack-remove:hover {
  color: var(--text);
  background: rgba(232, 241, 242, 0.08);
}

@media (hover: none) {
  .pack-remove {
    opacity: 0.6;
  }
}

.pack-add {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.pack-add input {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: rgba(232, 241, 242, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s ease;
}

.pack-add input:focus {
  border-color: rgba(94, 234, 212, 0.6);
}

.pack-add input::placeholder {
  color: rgba(159, 179, 189, 0.6);
}

.pack-error {
  min-height: 1.2em;
  margin: 6px 0 0;
  font-size: 13px;
  color: #f0766b;
}

/* ---------- Trip dates ---------- */
.trip-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.trip-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.trip-field input {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: rgba(232, 241, 242, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color-scheme: dark;
  transition: border-color 0.2s ease;
}

.trip-field input:focus {
  border-color: rgba(94, 234, 212, 0.6);
}

/* ---------- Heads up (risks) ---------- */
.risk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.risk {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(232, 241, 242, 0.03);
}

.risk b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.risk p {
  margin: 3px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.risk a {
  color: var(--accent);
}

.risk-icon {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 17px;
  background: rgba(232, 241, 242, 0.06);
}

.risk--danger {
  border-color: rgba(240, 118, 107, 0.55);
  background: rgba(240, 118, 107, 0.08);
}

.risk--danger .risk-icon {
  background: rgba(240, 118, 107, 0.18);
}

.risk--warn {
  border-color: rgba(249, 184, 114, 0.45);
  background: rgba(249, 184, 114, 0.06);
}

.risk--warn .risk-icon {
  background: rgba(249, 184, 114, 0.16);
}

.risk--info .risk-icon {
  background: rgba(94, 234, 212, 0.12);
}

.risk--ok {
  border-color: rgba(94, 234, 212, 0.4);
}

.risk--ok .risk-icon {
  color: var(--accent);
  background: rgba(94, 234, 212, 0.14);
}

.risk-sources {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

.risk-sources a {
  color: var(--accent);
}

/* ---------- Typical climate rows ---------- */
.wx-stat {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.wx-stat:first-child {
  border-top: 0;
}

.wx-stat b {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Why an item was suggested ---------- */
.pack-item label {
  display: grid;
  gap: 1px;
}

.pack-why {
  font-size: 12px;
  color: rgba(159, 179, 189, 0.8);
}

@media (min-width: 900px) {
  .dest-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 40px;
  }

  .dest-globe {
    position: sticky;
    top: 90px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .navbar,
  .btn,
  .chip,
  .dest-form,
  .progress span {
    transition: none;
  }

  main {
    animation: none;
  }

  body.is-leaving main {
    transition: none;
  }
}

/* ---------- Larger screens ---------- */
@media (min-width: 768px) {
  .navbar {
    padding: 24px 48px;
  }

  .navbar.scrolled {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .brand {
    font-size: 22px;
  }

  .btn {
    font-size: 15px;
  }
}
