/* PanMapa – strona startowa */

@font-face {
  font-family: "Overpass";
  src: url("../fonts/overpass-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Overpass";
  src: url("../fonts/overpass-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Kolory – zmiana tutaj zmienia całą stronę.
   Nitki rysuje skrypt js/orbita.js (tam są ich kolory, na samej górze pliku). */
:root {
  --papier: #FAFAFA;        /* tło, to samo co na podstronach (dawniej #E6EBED) */
  --papier-jasny: #FFFFFF;  /* rozjaśnienie wokół logo i obwódka napisów */
  --grafit: #27313A;        /* napisy, węzły */
  --grafit-jasny: #57636D;  /* opisy (ciemniejsze niż #5F6C76, żeby mieć kontrast 4,5:1 – WCAG) */
  --zloto: #F0AA00;         /* złoto z orbity w logo */
  --zloto-ciemne: #9A6C00;  /* obwódka przy nawigacji klawiaturą */
  --cien-okienka: #27313A47; /* cień okienka zmiany miejsca pogody */
  color-scheme: light;
}

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

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background-color: var(--papier);
  background-image: radial-gradient(ellipse 65% 60% at 50% 50%, var(--papier-jasny) 0%, var(--papier) 72%);
  background-attachment: fixed;
  color: var(--grafit);
  font-family: "Overpass", "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Układ bez JavaScriptu: logo i zwykła lista linków ---------- */

.scena {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 2rem 1rem;
}

.logo {
  margin: 0;
  line-height: 0;
}

.logo img {
  display: block;
  width: min(42vw, 66vh, 600px);
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.orbita {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2rem;
}

.orbita a {
  color: var(--grafit);
  font-weight: 650;
  font-size: 1.125rem;
  text-decoration: none;
}

.nici { display: none; }

/* ---------- Wersja z orbitą ---------- */

.js body { overflow: hidden; }

.js .scena {
  position: fixed;
  inset: 0;
  display: block;
  padding: 0;
  overflow: hidden;
}

.js .nici {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.js .logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.js .logo img {
  animation: logo-wejscie 900ms cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes logo-wejscie {
  from { opacity: 0; scale: 0.94; }
  to   { opacity: 1; scale: 1; }
}

.js .orbita {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

/* Satelita: punkt zaczepienia nitki (.sat__wezel) i podpis (.sat__etykieta).
   Element <a> ma zerowy rozmiar i stoi dokładnie w miejscu węzła. */
.js .sat {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  will-change: transform, opacity;
  outline: none;
  cursor: pointer;
}

.js .sat.sat--ciagniety { cursor: grabbing; }

/* Punkt satelity: kropka, ikona w kółku albo własna grafika.
   Grafiki są czarno-białe, a w kolorze po najechaniu lub kliknięciu. */
.sat__wezel {
  --d: 28px;
  position: absolute;
  left: calc(var(--d) / -2);
  top: calc(var(--d) / -2);
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  border: 2px solid var(--grafit);
  background: var(--papier-jasny);
  transition: background-color 200ms ease, border-color 200ms ease, scale 220ms ease;
}

/* ikona w kółku */
.sat__wezel--ikona {
  --d: 56px;
  display: grid;
  place-items: center;
  border-width: 1.5px;
  color: var(--grafit);
}
.sat__wezel--ikona svg {
  width: 34px;
  height: 34px;
  overflow: visible;
}
.sat__wezel--ikona .akcent {
  fill: transparent;
  stroke: none;
  transition: fill 220ms ease;
}
.sat__wezel--ikona .pelne {
  fill: currentColor;
  stroke: none;
}

/* własna grafika (np. logo aplikacji) */
.sat__wezel--grafika {
  --d: 88px;
  border: none;
  background: radial-gradient(circle closest-side, var(--papier-jasny) 72%, rgba(255, 255, 255, 0) 100%);
}
.sat__wezel--grafika img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(1) contrast(1.1);
  transition: filter 250ms ease;
  -webkit-user-drag: none;
  user-select: none;
}

.sat__wezel--ikona::after,
.sat__wezel--grafika::after { display: none; }

/* przy logo nie ma podpisu – nazwa zostaje tylko dla czytników ekranu */
.sat--logo .sat__nazwa {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.sat--logo:focus-visible .sat__wezel {
  outline: 2px solid var(--zloto-ciemne);
  outline-offset: 2px;
}

.sat__wezel::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--grafit);
}

/* większe pole do złapania palcem lub myszką */
.sat__wezel::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
}

.sat__etykieta {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  text-shadow:
    0 0 1px var(--papier-jasny),
    0 0 3px var(--papier-jasny),
    0 0 6px var(--papier-jasny),
    0 0 10px var(--papier-jasny);
}

.sat__nazwa {
  display: block;
  padding: 2px 1px;
  font-weight: 650;
  font-size: clamp(1.125rem, 1rem + 0.35vw, 1.375rem);
  line-height: 1.15;
  letter-spacing: 0.005em;
  border-radius: 3px;
}

.sat__opis {
  position: absolute;
  top: 100%;
  left: 0;
  width: max-content;
  max-width: 30ch;
  margin-top: 3px;
  white-space: normal;
  font-size: 0.9rem;
  font-weight: 420;
  line-height: 1.35;
  color: var(--grafit-jasny);
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}

/* opis da się najechać kursorem, żeby go przeczytać (WCAG 1.4.13) */
.sat--aktywny .sat__opis { pointer-events: auto; }
/* Esc chowa opis (WCAG 1.4.13) */
.sat.sat--bez-opisu .sat__opis { opacity: 0; }

.sat__opis:empty { display: none; }

.sat--nad .sat__opis {
  top: auto;
  bottom: 100%;
  margin: 0 0 3px;
}

.sat--srodek .sat__opis {
  left: 50%;
  translate: -50% 0;
  text-align: center;
}

.sat--prawo .sat__opis {
  left: auto;
  right: 0;
  text-align: right;
}

.sat--aktywny .sat__wezel,
.sat--ciagniety .sat__wezel { background: var(--zloto); }

/* kolor po najechaniu, kliknięciu lub złapaniu */
.sat--aktywny .sat__wezel--ikona,
.sat--ciagniety .sat__wezel--ikona,
.sat--wkrotce .sat__wezel--ikona,
.sat:active .sat__wezel--ikona {
  background: var(--papier-jasny);
  border-color: var(--zloto);
  border-width: 2px;
}
.sat--aktywny .sat__wezel--ikona .akcent,
.sat--ciagniety .sat__wezel--ikona .akcent,
.sat--wkrotce .sat__wezel--ikona .akcent,
.sat:active .sat__wezel--ikona .akcent { fill: var(--zloto); }

.sat--aktywny .sat__wezel--grafika,
.sat--ciagniety .sat__wezel--grafika { background: radial-gradient(circle closest-side, var(--papier-jasny) 72%, rgba(255, 255, 255, 0) 100%); }
.sat--kolor .sat__wezel--grafika img,
.sat--aktywny .sat__wezel--grafika img,
.sat--ciagniety .sat__wezel--grafika img,
.sat--wkrotce .sat__wezel--grafika img,
.sat:active .sat__wezel--grafika img { filter: none; }

.sat--aktywny .sat__opis,
.sat--wkrotce .sat__opis { opacity: 1; }

.sat:focus-visible .sat__nazwa {
  outline: 2px solid var(--zloto-ciemne);
  outline-offset: 3px;
}

/* Stopka (prawy dolny róg) */
.stopka {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 1rem 1rem;
  color: var(--grafit-jasny);
  line-height: 1.3;
}

.stopka__prawa {
  font-size: 1.0625rem;     /* WIELKOŚĆ NAPISU „© PanMapa” */
  font-weight: 500;
}

.stopka__link {
  display: inline-block;
  min-height: 24px;         /* pole kliknięcia min. 24 px (WCAG 2.5.8) */
  padding-block: 3px;
  font-size: 0.8125rem;     /* wielkość linku „Prywatność i dane” */
  color: var(--grafit-jasny);
  text-decoration: underline;
  text-decoration-color: rgba(95, 108, 118, 0.45);
  text-underline-offset: 3px;
}
.stopka__zrodlo {
  font-size: 0.6875rem;     /* wielkość podpisu „IP Geolocation by DB-IP” */
  text-decoration: none;
}
.stopka__link:hover {
  color: var(--grafit);
  text-decoration-color: var(--zloto);
}
.stopka__link:focus-visible {
  outline: 2px solid var(--zloto-ciemne);
  outline-offset: 2px;
  border-radius: 2px;
}

.js .stopka {
  position: fixed;
  right: 16px;
  bottom: 12px;
  z-index: 20;
  align-items: flex-end;
  padding: 0;
}

/* Przycisk „Zatrzymaj ruch” (lewy dolny róg) – orbita krąży bez końca,
   więc musi dać się ją zatrzymać (WCAG 2.2.2). Bez JavaScriptu nic się nie rusza, więc go nie ma. */
.ruch[hidden] { display: none; }
.ruch {
  position: fixed;
  left: 16px;
  bottom: 12px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 12px 4px 8px;
  border: 1.5px solid var(--grafit-jasny);
  border-radius: 999px;
  background: var(--papier-jasny);
  color: var(--grafit);
  font: 600 0.8125rem/1 "Overpass", "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  transition: border-color 200ms ease;
}
.ruch:hover { border-color: var(--zloto); }
.ruch:focus-visible { outline: 2px solid var(--zloto-ciemne); outline-offset: 2px; }
.ruch svg { width: 16px; height: 16px; fill: currentColor; }
.ruch .ruch__wznow { display: none; }
.ruch--stoi .ruch__wznow { display: inline; }
.ruch--stoi .ruch__pauza { display: none; }

/* tekst tylko dla czytników ekranu */
.dla-czytnika {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Zegar i pogoda (lewy górny róg): [ikona] [wartość] [opis] w dwóch rzędach */
.pogoda[hidden] { display: none; }
.pogoda {
  position: fixed;
  left: 16px;
  top: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: 26px auto minmax(0, 1fr);
  align-items: center;
  column-gap: 9px;
  row-gap: 5px;
  max-width: min(420px, calc(100vw - 32px));
  color: var(--grafit);
  opacity: 0;
  transition: opacity 600ms ease;
}
.pogoda--jest { opacity: 1; }
.pogoda svg {
  width: 26px;
  height: 26px;
}
.pogoda__wartosc {
  font-size: 1.0625rem;      /* wielkość godziny i temperatury */
  font-weight: 650;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pogoda .akcent { fill: transparent; stroke: none; transition: fill 220ms ease; }
.pogoda .akcent-linia { transition: stroke 220ms ease; }
.pogoda .pelne { fill: currentColor; stroke: none; }
.pogoda .tlo { fill: var(--papier); }
.pogoda:hover .akcent { fill: var(--zloto); }
.pogoda:hover .akcent-linia { stroke: var(--zloto-ciemne); }
.pogoda__opis {
  display: block;
  min-width: 0;
  font-size: 0.8125rem;      /* wielkość daty i opisu pogody */
  line-height: 1.3;
  color: var(--grafit-jasny);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nazwa miejsca przy pogodzie to przycisk: otwiera okienko zmiany miejsca (js/pogoda.js) */
.pogoda__miejsce {
  position: relative;
  min-height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--grafit-jasny);
  text-align: left;
  cursor: pointer;
  text-decoration: underline dotted;
  text-decoration-color: var(--grafit-jasny);
  text-underline-offset: 3px;
}
.pogoda__miejsce:hover,
.pogoda__miejsce[aria-expanded="true"] { color: var(--grafit); text-decoration-style: solid; text-decoration-color: var(--zloto); }
.pogoda__miejsce:focus-visible { outline: 2px solid var(--zloto-ciemne); outline-offset: 2px; border-radius: 2px; }

.pogoda-panel {
  position: fixed;
  left: 16px;
  top: 72px;
  z-index: 21;
  display: grid;
  gap: 10px;
  width: min(320px, calc(100vw - 24px));
  padding: 14px 16px 16px;
  border: 1px solid var(--grafit);
  border-radius: 10px;
  background: var(--papier-jasny);
  color: var(--grafit);
  box-shadow: 0 16px 32px -18px var(--cien-okienka);
  font-size: 0.9375rem;
  line-height: 1.4;
}
.pogoda-panel[hidden], .pogoda-panel [hidden] { display: none; }
.pogoda-panel p { margin: 0; }
.pogoda-panel__info, .pogoda-panel label { font-size: 0.8125rem; color: var(--grafit-jasny); }
.pogoda-panel label { display: block; margin-bottom: 4px; }
.pogoda-panel__wiersz { display: flex; gap: 8px; }
.pogoda-panel input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--grafit-jasny);
  border-radius: 6px;
  background: var(--papier-jasny);
  color: var(--grafit);
  font: inherit;
  font-size: 1rem;
}
.pogoda-panel__btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--grafit-jasny);
  border-radius: 6px;
  background: var(--papier);
  color: var(--grafit);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.pogoda-panel__btn--glowny { background: var(--zloto); border-color: var(--zloto-ciemne); }
.pogoda-panel__btn:hover { border-color: var(--grafit); }
.pogoda-panel__link {
  justify-self: start;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--grafit);
  font: inherit;
  font-size: 0.8125rem;
  text-decoration: underline;
  text-decoration-color: var(--zloto);
  text-underline-offset: 3px;
  cursor: pointer;
}
.pogoda-panel__stan { font-size: 0.8125rem; }
.pogoda-panel__stan:empty { display: none; }
.pogoda-panel input:focus-visible,
.pogoda-panel__btn:focus-visible,
.pogoda-panel__link:focus-visible { outline: 2px solid var(--zloto-ciemne); outline-offset: 2px; }

/* Telefon i wąskie okna */
@media (max-width: 639px), (max-aspect-ratio: 4/5) {
  .logo img { width: min(54vw, 340px); }
  .sat__wezel--ikona { --d: 48px; }
  .sat__wezel--ikona svg { width: 29px; height: 29px; }
  .sat__wezel--grafika { --d: 72px; }
  .sat__nazwa { font-size: 1.0625rem; }
  .sat__opis { font-size: 0.8125rem; max-width: 18ch; }
  .pogoda { left: 12px; top: 10px; grid-template-columns: 24px auto minmax(0, 1fr); column-gap: 7px; }
  .pogoda-panel { left: 12px; }
  .pogoda svg { width: 24px; height: 24px; }
  .pogoda__wartosc { font-size: 1rem; }
}

/* Telefon trzymany poziomo (niski ekran): mniejsze logo i satelity, orbita szeroka i płaska
   (liczy ją js/orbita.js), stopka w jednym rzędzie, żeby nie zasłaniała satelitów */
@media (orientation: landscape) and (max-height: 500px) {
  .logo img { width: min(42vw, 38vh, 600px); }
  .sat__wezel--ikona { --d: 44px; }
  .sat__wezel--ikona svg { width: 26px; height: 26px; }
  .sat__wezel--grafika { --d: 64px; }
  .sat__nazwa { font-size: 1rem; }
  .sat__opis { font-size: 0.8125rem; max-width: 22ch; }
  .js .stopka {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: baseline;
    gap: 0 12px;
    max-width: calc(100vw - 180px);
    bottom: 6px;
  }
  .stopka__prawa { font-size: 0.875rem; }
  .stopka__link { font-size: 0.75rem; }
  .stopka__zrodlo { font-size: 0.6875rem; }
  .ruch { bottom: 8px; }
  /* zegar i pogoda w jednym niskim rzędzie: [zegar] godzina data  [ikona] temperatura miejsce */
  .pogoda {
    left: 12px;
    top: 8px;
    grid-template-columns: 22px auto auto 22px auto minmax(0, 1fr);
    column-gap: 7px;
    max-width: calc(100vw - 24px);
  }
  .pogoda svg { width: 22px; height: 22px; }
  .pogoda > :nth-child(4) { margin-left: 10px; }
  .pogoda__wartosc { font-size: 0.9375rem; }
}
/* bardzo niski ekran poziomo (np. 568 × 320): jeszcze mniejsze satelity */
@media (orientation: landscape) and (max-height: 340px) {
  .logo img { width: min(42vw, 34vh); }
  .sat__wezel--ikona { --d: 36px; }
  .sat__wezel--ikona svg { width: 22px; height: 22px; }
  .sat__wezel--grafika { --d: 50px; }
  .sat__nazwa { font-size: 0.875rem; }
  .ruch__tekst { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .ruch { padding: 4px 8px; }
  .js .stopka { max-width: calc(100vw - 72px); }
}

@media (prefers-reduced-motion: reduce) {
  .js .logo img { animation: none; }
  .sat__wezel, .sat__opis { transition: none; }
}
