/* Strona gry Megawatt Valley – te same kolory co plansza gry; typografia z tablic drogowych (Barlow) */
:root {
  --board: #f4f1ea; --board-2: #ebe6db; --ink: #2c3540; --soft: #66615c; --line: #d6453d; --river: #9fc7e3;
  --road: #ddd6c8; --panel: #fffdf8; --night: #15212f; --night-2: #1d2c3d; --lamp: #f2b84b; --ok: #24734f;
  --wrap: 1120px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--board); color: var(--ink); font: 400 18px/1.6 "Barlow", system-ui, sans-serif; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--line); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: .005em; }
h2 { font-size: clamp(34px, 5vw, 56px); }
h3 { font-size: 26px; }
p { margin: 0; max-width: 62ch; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; }

/* języki: jeden plik, dwa teksty – widoczny ten z <html data-lang> */
[data-lang="en"] [lang="pl"], [data-lang="pl"] [lang="en"] { display: none !important; }

/* nagłówek */
.top { position: absolute; z-index: 5; inset: 0 0 auto; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.top nav { display: flex; gap: 22px; font-weight: 500; font-size: 16px; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.lang { display: flex; border: 1.5px solid var(--ink); border-radius: 99px; overflow: hidden; }
.lang button { border: 0; background: none; font: 600 14px "Barlow", sans-serif; padding: 4px 11px; cursor: pointer; color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--board); }

/* hero: żywa plansza */
.hero { position: relative; min-height: min(100svh, 920px); padding: 0; overflow: hidden; display: grid; align-items: center; }
.hero .scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .wrap { position: relative; z-index: 2; width: 100%; }
/* tekst czytelny na planszy: lewa część przygaszona kolorem planszy */
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, var(--board) 0%, color-mix(in srgb, var(--board) 88%, transparent) 34%, transparent 58%); }
.hero-copy { width: min(440px, 100%); padding: 120px 0 80px; }
.logo { width: 100%; height: auto; }
.lead { font-size: 21px; line-height: 1.5; margin: 22px 0 30px; color: var(--ink); }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 12px; border: 2px solid var(--ink); background: var(--panel);
  font: 600 17px "Barlow", sans-serif; text-decoration: none; color: var(--ink); cursor: pointer; transition: transform .15s; }
.btn:hover { transform: translateY(-2px); }
.btn.main { background: var(--ink); color: var(--board); }
.btn.soon { border-style: dashed; cursor: default; color: var(--soft); border-color: #b8b0a2; }
.btn.soon:hover { transform: none; }
.btn small { font-weight: 500; font-size: 13px; opacity: .8; }

/* scena – animacje (jak ekran startowy gry) */
.gridl { fill: none; stroke: var(--board-2); stroke-width: 2; }
.s-river { fill: none; stroke: var(--river); stroke-width: 22; stroke-linecap: round; }
.s-roads path { fill: none; stroke: var(--road); stroke-width: 7; stroke-linecap: round; }
.s-hv path, .s-hv { fill: none; stroke: var(--line); stroke-width: 7; stroke-linecap: round; }
.s-pulse path { fill: none; stroke: var(--panel); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 26; animation: flow 1.6s linear infinite; }
.s-plan { opacity: .45; stroke-dasharray: 14 12; }
.s-build { stroke-dasharray: 1; stroke-dashoffset: 1; animation: build 9s ease-in-out infinite; }
.s-node { fill: var(--panel); stroke: var(--ink); stroke-width: 6; }
.s-node.red { stroke: var(--line); }
.s-node.wind { stroke: var(--ok); }
.s-coil { fill: none; stroke: var(--ink); stroke-width: 5; }
.s-ink { fill: none; stroke: var(--ink); stroke-width: 6; stroke-linecap: round; }
.s-turbine { transform-box: fill-box; transform-origin: center; animation: spin 3.2s linear infinite; }
/* niewidoczne koło o promieniu łopatek – środek obrysu (fill-box) wypada na piaście, wirnik się nie chybocze */
.s-turbine .hub { fill: none; stroke: none; }
.s-turbine path { fill: none; stroke: var(--ok); stroke-width: 5; stroke-linecap: round; }
.s-town path { fill: var(--panel); stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
@keyframes flow { to { stroke-dashoffset: -28; } }
@keyframes build { 0%, 15% { stroke-dashoffset: 1; } 55%, 100% { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
/* logo – raz przy wejściu */
.l-curve { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.2s .3s ease-out forwards; }
.l-band { transform-box: fill-box; transform-origin: left; transform: scaleX(0); animation: band 1.1s 1.6s cubic-bezier(.2,.8,.2,1) forwards; }
.l-word { opacity: 0; animation: fade .8s .9s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes band { to { transform: scaleX(1); } }
@keyframes fade { to { opacity: 1; } }

/* doba na sieci – krzywa poboru jako oś czasu */
.day h2 { max-width: 16ch; }
.day .intro { margin-top: 18px; color: var(--soft); }
.curve-wrap { margin-top: 56px; position: relative; }
.curve-svg { width: 100%; height: auto; overflow: visible; }
.c-base { fill: var(--line); }
.c-line { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.c-tick { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 3 5; }
.c-dot { fill: var(--board); stroke: var(--ink); stroke-width: 4; }
.c-hour { font: 600 15px "Barlow", sans-serif; fill: var(--soft); }
.moments { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 18px; }
.moments time { font: 700 30px "Barlow Condensed", sans-serif; display: block; }
.moments h3 { margin: 2px 0 8px; font-size: 22px; }
.moments p { font-size: 16.5px; color: var(--soft); }

/* zrzuty */
.shots { background: var(--panel); }
.shots-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { font: 600 15px "Barlow", sans-serif; padding: 7px 14px; border-radius: 99px; border: 1.5px solid var(--ink); background: none; color: var(--ink); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--panel); }
.frame { margin-top: 28px; border-radius: 16px; overflow: hidden; border: 1.5px solid var(--board-2); box-shadow: 0 30px 60px -30px rgba(44,53,64,.35); background: var(--board); }
.frame img { width: 100%; height: auto; }
#frame { cursor: zoom-in; }
.frame.phone { max-width: 340px; margin-left: auto; margin-right: auto; border-radius: 28px; border: 8px solid var(--ink); }
.caption { margin-top: 14px; color: var(--soft); font-size: 16px; }

/* okna: opis scenariusza i powiększony zrzut */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(44,53,64,.55); }
.pop { width: min(920px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 28px 30px 30px; border: 0; border-radius: 18px; background: var(--panel); box-shadow: 0 30px 80px -20px rgba(0,0,0,.4); }
.pop h3 { font-size: 32px; padding-right: 40px; }
.pop .where { margin: 6px 0 16px; font-size: 15px; font-weight: 600; color: var(--soft); display: flex; align-items: center; gap: 10px; }
.pop-img { position: relative; display: block; width: 100%; padding: 0; border: 1.5px solid var(--board-2); border-radius: 12px; overflow: hidden; background: var(--board); cursor: zoom-in; }
.pop-img img { width: 100%; height: auto; max-height: 56vh; object-fit: contain; margin: 0 auto; }
.zoom-hint { position: absolute; right: 10px; bottom: 10px; padding: 3px 10px; border-radius: 99px; background: rgba(255,253,248,.92); font: 600 13px "Barlow", sans-serif; color: var(--ink); }
.osm-note { margin-top: 6px; font-size: 12px; color: var(--soft); }
.pop-text { margin-top: 16px; }
.pop-text p { font-size: 17px; line-height: 1.6; max-width: none; }
.pop-x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--panel); color: var(--ink); font: 400 26px/1 "Barlow", sans-serif; cursor: pointer; }
.pop-x:hover { background: var(--ink); color: var(--panel); }
.lightbox { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 12px; background: var(--board); overflow: hidden; }
.lightbox img { display: block; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); width: auto; height: auto; cursor: zoom-out; }
.lightbox .pop-x { top: 10px; right: 10px; }
body:has(dialog[open]) { overflow: hidden; }

/* prawdziwe miejsca */
.places-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 56px; align-items: center; }
.island { width: 100%; height: auto; }
.i-sea { fill: var(--river); opacity: .35; }
.i-land { fill: var(--panel); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.i-river { fill: none; stroke: var(--river); stroke-width: 2.2; stroke-linecap: round; }
.i-town { fill: var(--line); }
.i-name { font: 600 13px "Barlow", sans-serif; fill: var(--ink); }
.places p + p { margin-top: 14px; }
.places h2 + p { margin-top: 20px; }
.osm { margin-top: 18px; font-size: 13px; color: var(--soft); }
/* scenariusze: karty; poziom trudności – trzy kreski jak słupki mocy */
.scen { list-style: none; padding: 0; margin: 56px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.scen li { background: var(--panel); border: 1.5px solid var(--board-2); border-radius: 14px; padding: 18px 20px 20px; }
.scen h3 { font-size: 23px; }
.scen .where { margin: 4px 0 10px; font-size: 14px; font-weight: 600; color: var(--soft); display: flex; align-items: center; gap: 10px; }
.scen li { display: flex; flex-direction: column; }
.scen .more { margin-top: auto; align-self: flex-start; font: 600 15px "Barlow", sans-serif; padding: 6px 16px; border-radius: 99px; border: 1.5px solid var(--ink); background: none; color: var(--ink); cursor: pointer; }
.scen .more::after { content: " →"; }
.scen .more:hover { background: var(--ink); color: var(--panel); }
.lvl { --on: var(--line); display: inline-block; width: 26px; height: 12px; background:
  linear-gradient(var(--on), var(--on)) 0 100% / 6px 6px no-repeat,
  linear-gradient(var(--c2, var(--board-2)), var(--c2, var(--board-2))) 10px 100% / 6px 9px no-repeat,
  linear-gradient(var(--c3, var(--board-2)), var(--c3, var(--board-2))) 20px 100% / 6px 12px no-repeat; }
.lvl[data-l="2"], .lvl[data-l="3"] { --c2: var(--line); }
.lvl[data-l="3"] { --c3: var(--line); }

/* co jest w grze */
.facts dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 34px 56px; margin: 44px 0 0; }
.facts dt { font: 700 24px "Barlow Condensed", sans-serif; }
.facts dd { margin: 6px 0 0; color: var(--soft); font-size: 17px; }

/* noc – granie */
.night { background: var(--night); color: #ece6da; position: relative; overflow: hidden; padding: 120px 0 56px; }
.night h2 { color: #fff; font-size: clamp(44px, 7vw, 92px); max-width: 12ch; }
.night .lead { color: #c9c2b4; max-width: 46ch; }
.night .btn { background: transparent; color: #fff; border-color: #fff; }
.night .btn.main { background: var(--lamp); border-color: var(--lamp); color: var(--night); }
.night .btn.soon { color: #9aa3ad; border-color: #4a5868; }
.skyline { position: absolute; right: -40px; bottom: 120px; width: min(620px, 60%); opacity: .95; }
.skyline .h { fill: var(--night-2); }
.skyline .w { fill: var(--lamp); animation: lit 6s ease-in-out infinite; }
@keyframes lit { 0%, 100% { opacity: .95; } 50% { opacity: .55; } }
.ver { margin-top: 18px; font-size: 15px; color: #9aa3ad; }
/* pod tekstem miejsce na sylwetkę miasta (absolutna, przy dolnej krawędzi) */
.after { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 48px 0 170px; max-width: 900px; position: relative; z-index: 1; }
.after h3, .install summary { font: 700 24px "Barlow Condensed", sans-serif; color: #fff; }
.news ul { margin: 10px 0 0; padding-left: 20px; color: #c9c2b4; font-size: 16.5px; }
.news li + li { margin-top: 6px; }
.install summary { cursor: pointer; list-style-position: inside; }
.install dl { margin: 10px 0 0; font-size: 16px; }
.install dt { font-weight: 600; color: #fff; margin-top: 10px; }
.install dd { margin: 2px 0 0; color: #c9c2b4; }
.install code { background: var(--night-2); padding: 1px 6px; border-radius: 4px; color: #fff; }
.foot { margin-top: 110px; padding-top: 26px; border-top: 1px solid #2c3c4f; display: flex; flex-wrap: wrap; gap: 14px 28px; font-size: 15px; color: #9aa3ad; }
.foot a { color: #d8d1c4; }

/* podstrony */
.page { padding: 120px 0 80px; }
.page h1 { font-size: clamp(40px, 6vw, 64px); }
.page h2 { font-size: 30px; margin-top: 44px; }
.page p, .page li { max-width: 68ch; }
.page p { margin-top: 14px; }
.page ul { padding-left: 20px; }
.page .meta { color: var(--soft); margin-top: 10px; }
.kit { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin-top: 22px; }
.kit a { display: block; border: 1.5px solid var(--board-2); border-radius: 12px; overflow: hidden; background: var(--panel); text-decoration: none; }
.kit a span { display: block; padding: 10px 12px; font-size: 15px; }
table.fact { border-collapse: collapse; margin-top: 18px; }
table.fact th, table.fact td { text-align: left; padding: 7px 18px 7px 0; border-bottom: 1px solid var(--board-2); vertical-align: top; }
table.fact th { font-weight: 600; white-space: nowrap; }

@media (max-width: 860px) {
  body { font-size: 17px; }
  section { padding: 72px 0; }
  .top nav { display: none; }
  .hero { min-height: auto; align-items: end; }
  .hero .scene { height: 56%; }
  .hero::before { background: linear-gradient(180deg, transparent 40%, var(--board) 56%); }
  .hero-copy { padding: 52svh 0 56px; }
  .moments { grid-template-columns: 1fr 1fr; }
  .places-grid { grid-template-columns: 1fr; gap: 32px; }
  .facts dl { grid-template-columns: 1fr; }
  .scen { grid-template-columns: 1fr 1fr; }
  .after { grid-template-columns: 1fr; gap: 28px; margin-bottom: 0; }
  .skyline { position: static; width: 100%; margin-top: 40px; }
}
@media (max-width: 520px) { .moments, .scen { grid-template-columns: 1fr; } .wrap { padding: 0 16px; } .pop { padding: 20px 16px 22px; } .pop h3 { font-size: 26px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .s-pulse path, .s-build, .s-turbine, .skyline .w { animation: none; }
  .s-build { stroke-dashoffset: 0; }
  .l-curve, .l-band, .l-word { animation-duration: 1ms; animation-delay: 0s; }
}
