:root{
  --bg0:#0b1020;
  --bg1:#0f1730;
  --card:#111b36cc;
  --card2:#0e1730cc;
  --text:#e9eefc;
  --muted:#a8b3d6;
  --accent:#7aa2ff;
  --orbColor: rgba(122,162,255,.9);
  --good:#4ade80;
  --bad:#fb7185;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial;
  color:var(--text);
  background:
    radial-gradient(900px 450px at 10% 10%, rgba(122,162,255,.35), transparent 60%),
    radial-gradient(700px 350px at 90% 20%, rgba(74,222,128,.20), transparent 55%),
    radial-gradient(800px 500px at 50% 90%, rgba(251,113,133,.18), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  background-size: 120% 120%;
  animation: bg-pan 18s ease-in-out infinite;
}

@keyframes bg-pan {
  0%   { background-position: 0% 0%, 100% 0%, 50% 100%, 0% 0%; }
  50%  { background-position: 30% 15%, 70% 10%, 55% 85%, 0% 0%; }
  100% { background-position: 0% 0%, 100% 0%, 50% 100%, 0% 0%; }
}

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}

.wrap{max-width:1000px;margin:0 auto;padding:28px 18px 22px; position:relative}

/* animated glassy orbs */
.orbs{position:absolute; inset:-40px -20px auto -20px; height:220px; pointer-events:none; z-index:0}
.header,.panel,.footer{position:relative; z-index:1}
.orb{position:absolute; border-radius:999px; opacity:.45}
.orb.o1{width:180px;height:180px; left:-10px; top:10px; background: radial-gradient(circle at 30% 30%, var(--orbColor), rgba(0,0,0,0)); animation: orb1 10s ease-in-out infinite}
.orb.o2{width:220px;height:220px; right:40px; top:-20px; background: radial-gradient(circle at 30% 30%, rgba(74,222,128,.70), rgba(74,222,128,0)); animation: orb2 12s ease-in-out infinite}
.orb.o3{width:160px;height:160px; right:-10px; top:90px; background: radial-gradient(circle at 30% 30%, rgba(251,113,133,.65), rgba(251,113,133,0)); animation: orb3 14s ease-in-out infinite}

@keyframes orb1{0%,100%{transform:translate(0,0)}50%{transform:translate(18px,10px)}}
@keyframes orb1-windy{0%,100%{transform:translate(0,0)}50%{transform:translate(34px,18px)}}
@keyframes orb1-storm{0%,100%{transform:translate(0,0)}20%{transform:translate(18px,-8px)}40%{transform:translate(-10px,10px)}60%{transform:translate(22px,6px)}80%{transform:translate(-6px,-6px)}}

@keyframes orb2{0%,100%{transform:translate(0,0)}50%{transform:translate(-14px,16px)}}
@keyframes orb3{0%,100%{transform:translate(0,0)}50%{transform:translate(-10px,-8px)}}

/* default animation speed, overridable by data-anim */
:root[data-anim="calm"] .orb.o1{animation-name: orb1; animation-duration: 16s}
:root[data-anim="windy"] .orb.o1{animation-name: orb1-windy; animation-duration: 10s}
:root[data-anim="storm"] .orb.o1{animation-name: orb1-storm; animation-duration: 7s}

@media (prefers-reduced-motion: reduce) {
  .orbs, .orb { animation: none !important; }
}

/* iOS Safari artifact guard: disable heavy animations/gradients that can cause banding */
@supports (-webkit-touch-callout: none) {
  /* iOS Safari: avoid gradient banding by using a solid base + subtle grain + ONE soft orb */
  body {
    animation: none !important;
    background: #0b1020 !important;
  }

  /* Grain overlay */
  body::before{
    content:"";
    position:fixed;
    inset:0;
    pointer-events:none;
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
    opacity:.18;
    mix-blend-mode:overlay;
  }

  /* One orb */
  .orbs{display:block !important; height:260px}
  .orb.o2, .orb.o3{display:none !important}
  .orb.o1{
    opacity:.22;
    width:260px;
    height:260px;
    left:-40px;
    top:-30px;
    background: radial-gradient(circle at 35% 35%, var(--orbColor), rgba(0,0,0,0));
    animation: orb1 16s ease-in-out infinite;
  }

  .panel {
    animation: none !important;
    background: rgba(17, 27, 54, 0.92) !important;
    border-color: rgba(255,255,255,.10) !important;
  }
  .card, .day {
    background: rgba(255,255,255,.06) !important;
  }
}

.header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}
.header h1{margin:0;font-size:28px;letter-spacing:.3px}
.subtitle{margin:4px 0 0;color:var(--muted)}

.panel{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  box-shadow: var(--shadow);
  overflow:hidden;
  transform: translateY(0);
  animation: floaty 6s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  .panel { animation: none; }
}

.row{display:grid;grid-template-columns: 1.2fr .8fr;gap:0}
@media (max-width: 860px){
  .row{grid-template-columns:1fr}
}

.current{padding:22px}
.side{padding:22px;border-left:1px solid rgba(255,255,255,.08)}
@media (max-width: 860px){
  .side{border-left:none;border-top:1px solid rgba(255,255,255,.08)}
}

.big{display:flex;align-items:flex-end;gap:18px;flex-wrap:wrap}
.temp{font-size:64px;line-height:1;font-weight:750;letter-spacing:-1px}
.meta{padding-bottom:6px}
.cond{font-size:18px;font-weight:650}
.details{margin-top:6px;color:var(--muted);font-size:14px;line-height:1.4}

.pillrow{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
.pill{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  padding:10px 12px;
  border-radius:999px;
  font-size:13px;
  color: var(--text);
}
.pill span{color:var(--muted)}

.card{
  background: rgba(0,0,0,.10);
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  padding:14px;
}

.card h2{margin:0 0 8px;font-size:16px;letter-spacing:.2px}
.small{color:var(--muted);font-size:12px}

.forecast{display:grid;grid-template-columns:1fr;gap:10px;margin-top:12px}
.day{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.09);
  border-radius:12px;
  padding:10px 10px;
}
.day .left{display:flex;align-items:center;gap:10px;min-width:0}
.badge{
  width:34px;height:34px;border-radius:12px;
  display:grid;place-items:center;
  background: rgba(122,162,255,.18);
  border:1px solid rgba(122,162,255,.28);
  font-size:18px;
}
.day .name{font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.day .desc{font-size:12px;color:var(--muted)}
.day .right{display:flex;align-items:center;gap:10px}
.hilo{font-variant-numeric: tabular-nums; font-size:13px}
.hilo b{font-weight:750}

.btn{
  appearance:none;
  border:none;
  cursor:pointer;
  padding:10px 12px;
  border-radius:12px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border:1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn:hover{background: color-mix(in srgb, var(--accent) 30%, transparent)}

.footer{display:flex;justify-content:space-between;gap:12px;margin-top:10px}
