/* Atlas — local weather + city guide */
:root {
  --bg: #0a0c11;
  --bg-2: #0f131a;
  --panel: #11151c;
  --panel-2: #161b24;
  --border: #1d2330;
  --border-2: #2a3142;
  --text: #e8ecf3;
  --muted: #8893a8;
  --dim: #5c667b;
  --accent: #ffb86b;
  --accent-2: #f6a44a;
  --cool: #9ccfd8;
  --warm: #f6c177;
  --bad: #eb6f92;
  --grad: linear-gradient(135deg, #ffb86b 0%, #ec6f5c 50%, #d63384 100%);
  --grad-cool: linear-gradient(135deg, #9ccfd8 0%, #6e9bd1 50%, #7a5cd1 100%);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --radius: 18px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

#bg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none;
}

.hidden { display: none !important; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 40px;
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: rgba(10, 12, 17, 0.6);
  border-bottom: 1px solid rgba(29, 35, 48, 0.6);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -0.02em; font-size: 17px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.logo {
  width: 22px; height: 22px;
  background: var(--grad);
  border-radius: 6px;
  box-shadow: 0 4px 18px -4px rgba(214, 51, 132, 0.5);
  position: relative; overflow: hidden;
}
.logo::after {
  content: ''; position: absolute; inset: 4px;
  background: var(--bg);
  border-radius: 3px;
}
.nav-right { display: flex; align-items: center; gap: 12px; }
#user-chip {
  padding: 6px 12px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; font-size: 13px; color: var(--muted);
}

main {
  max-width: 1080px; margin: 0 auto;
  padding: 32px 40px 80px;
}

/* Landing */
.landing {
  min-height: calc(100vh - 80px);
  display: flex; align-items: center; justify-content: center;
}
.landing-inner { max-width: 640px; text-align: center; }
.landing h1 {
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 18px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lede {
  font-size: 18px; color: var(--muted); line-height: 1.55;
  max-width: 520px; margin: 0 auto 32px;
}
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--text); color: var(--bg);
  padding: 14px 24px; border-radius: 12px;
  font-weight: 600; font-size: 15px;
  border: none; cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
  box-shadow: 0 10px 30px -10px rgba(255, 184, 107, 0.3);
}
.cta:hover { transform: translateY(-1px); background: #fff; box-shadow: 0 16px 40px -12px rgba(255, 184, 107, 0.5); text-decoration: none; }
.cta.sm { padding: 11px 18px; font-size: 14px; }
.cta.full { width: 100%; }
.cta:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.ghost {
  background: transparent; color: var(--text);
  padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border); cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: border-color 120ms ease, background 120ms ease;
}
.ghost:hover { border-color: var(--border-2); background: var(--panel); }
.fineprint { color: var(--dim); font-size: 13px; margin-top: 28px; }

/* Locating */
.locate {
  min-height: calc(100vh - 80px);
  display: flex; align-items: center; justify-content: center;
}
.locate-inner { max-width: 560px; text-align: center; }
.locate-inner h2 {
  font-size: 32px; margin: 24px 0 12px;
  letter-spacing: -0.02em;
}
.pulse {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--grad);
  margin: 0 auto;
  position: relative;
  box-shadow: 0 0 60px rgba(255, 184, 107, 0.4);
}
.pulse::before, .pulse::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse 2.4s ease-out infinite;
}
.pulse::after { animation-delay: 1.2s; }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}
.row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  justify-content: center; margin-top: 20px;
}
.sep { color: var(--dim); font-size: 13px; }
input, select {
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); padding: 11px 14px; border-radius: 10px;
  font-size: 14px; font-family: inherit;
  outline: none; transition: border-color 120ms ease;
  min-width: 220px;
}
input:focus, select:focus { border-color: var(--accent); }
.error { color: var(--bad); font-size: 13px; margin-top: 16px; }

/* App */
.hero {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 40px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 36px 32px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(900px circle at 100% 0%, rgba(255, 184, 107, 0.10), transparent 60%);
  pointer-events: none;
}
.hero-text { position: relative; z-index: 1; min-width: 0; }
.kicker { color: var(--muted); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 8px; }
.hero-text h1 {
  font-size: clamp(36px, 5vw, 56px);
  margin: 0; letter-spacing: -0.03em; line-height: 1.05;
}
.hero-meta { color: var(--muted); margin: 10px 0 0; font-size: 16px; text-transform: capitalize; }
.hero-temp { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.hero-temp img { width: 110px; height: 110px; filter: drop-shadow(0 8px 24px rgba(255,184,107,0.25)); }
.hero-stats { display: flex; flex-direction: column; align-items: flex-start; }
.big { font-size: 64px; font-weight: 300; letter-spacing: -0.04em; line-height: 1; }
.muted { color: var(--muted); font-size: 14px; }

.hero-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-top: 12px;
}
.kv {
  background: var(--panel); border: 1px solid var(--border);
  padding: 16px 18px; border-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 4px;
}
.kv .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.kv .v { font-size: 18px; font-weight: 500; }

.section-title {
  margin: 36px 0 14px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); font-weight: 500;
}

.forecast {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
}
.fc-day {
  background: var(--panel); border: 1px solid var(--border);
  padding: 18px 14px; border-radius: var(--radius-sm);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: border-color 160ms ease, transform 160ms ease;
}
.fc-day:hover { border-color: var(--border-2); transform: translateY(-2px); }
.fc-day .dow { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.fc-day img { width: 56px; height: 56px; }
.fc-day .temps { display: flex; gap: 8px; align-items: baseline; }
.fc-day .hi { font-weight: 500; font-size: 16px; }
.fc-day .lo { color: var(--muted); font-size: 14px; }
.fc-day .desc { color: var(--muted); font-size: 11px; text-align: center; text-transform: capitalize; }

.tabs {
  display: flex; gap: 4px; margin: 36px 0 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab {
  background: transparent; border: none; color: var(--muted);
  padding: 12px 18px; cursor: pointer; font-family: inherit;
  font-size: 14px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.tab-content {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  min-height: 220px;
  line-height: 1.65; color: var(--text);
}
.tab-content h1, .tab-content h2, .tab-content h3 { color: var(--warm); margin: 18px 0 8px; }
.tab-content h1 { font-size: 20px; }
.tab-content h2 { font-size: 17px; }
.tab-content h3 { font-size: 15px; }
.tab-content p { margin: 8px 0; color: var(--text); }
.tab-content ul, .tab-content ol { padding-left: 22px; }
.tab-content li { margin: 6px 0; }
.tab-content strong { color: var(--cool); font-weight: 600; }
.cites {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
  display: flex; flex-direction: column; gap: 6px;
}
.cites a { color: var(--cool); }

.skeleton {
  background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: var(--radius-sm);
}
.skeleton.fc { height: 130px; }
.skeleton.lg { height: 200px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.itinerary-cta {
  margin-top: 36px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  position: relative; overflow: hidden;
}
.itinerary-cta::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(700px circle at 0% 100%, rgba(156, 207, 216, 0.08), transparent 60%);
  pointer-events: none;
}
.itinerary-cta h3 { margin: 0 0 6px; font-size: 19px; letter-spacing: -0.01em; }
.itinerary-cta p { margin: 0; }
.itinerary-cta > * { position: relative; z-index: 1; }

/* Modal */
.modal {
  border: none; padding: 0; background: transparent;
  max-width: 600px; width: calc(100% - 32px);
  border-radius: var(--radius);
}
.modal::backdrop {
  background: rgba(5, 7, 11, 0.7);
  backdrop-filter: blur(8px);
}
.modal-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  max-height: 80vh; display: flex; flex-direction: column;
}
.modal-head {
  padding: 20px 24px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 18px; }
.iconbtn {
  background: transparent; border: none; color: var(--muted);
  width: 32px; height: 32px; border-radius: 8px;
  font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.iconbtn:hover { background: var(--panel-2); color: var(--text); }
.modal-body { padding: 24px; overflow: auto; }
.form-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.form-row label { font-size: 13px; color: var(--muted); min-width: 50px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.chip {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: all 120ms ease;
}
.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.itin-output {
  margin-top: 20px; padding: 20px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; line-height: 1.65;
  max-height: 360px; overflow: auto;
}
.itin-output h2, .itin-output h3 { color: var(--warm); }
.itin-actions { margin-top: 16px; display: flex; gap: 10px; }
.itin-actions input { flex: 1; }
.status { margin-top: 14px; font-size: 13px; color: var(--cool); }
.status.error { color: var(--bad); }

.footer {
  text-align: center; padding: 32px 20px;
  color: var(--dim); font-size: 13px;
}

@media (max-width: 760px) {
  .nav { padding: 16px 20px; }
  main { padding: 20px 20px 40px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px; }
  .hero-temp img { width: 80px; height: 80px; }
  .big { font-size: 48px; }
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
  .forecast { grid-template-columns: repeat(2, 1fr); }
  .itinerary-cta { flex-direction: column; align-items: stretch; text-align: left; }
  input { min-width: 0; flex: 1; }
}
