@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

/* =========================================================
   Główne style serwisu OptoNet
   - jasna, bardziej naturalna baza
   - beż jako kolor pomocniczy, nie dominujące tło
   - akcenty inspirowane logo: granat, błękit, pomarańcz
   ========================================================= */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #f7f8fb;
  --sand: #f6eadb;
  --sand-strong: #efd9bf;
  --ink: #10203b;
  --muted: #5e6a80;
  --line: #dfe5ef;
  --navy: #0e2f63;
  --blue: #1769d1;
  --blue-bright: #2d7ff0;
  --blue-soft: #eaf2ff;
  --orange: #ff7a1a;
  --orange-strong: #dd5d00;
  --orange-soft: #fff1e6;
  --red: #d83a4f;
  --red-strong: #b51f36;
  --red-soft: #ffe8ec;
  --yellow: #ffe600;
  --focus: #0f62fe;
  --shadow: 0 18px 48px rgba(16, 32, 59, 0.1);
}

html {
  scroll-behavior: smooth;
}

html[data-font-size="large"] {
  font-size: 112.5%;
}

html[data-contrast="high"] {
  --bg: #000000;
  --surface: #000000;
  --surface-strong: #000000;
  --surface-soft: #050505;
  --sand: #101010;
  --sand-strong: #161616;
  --ink: #ffe600;
  --muted: #fff08a;
  --line: #ffe600;
  --navy: #ffe600;
  --blue: #ffe600;
  --blue-bright: #ffe600;
  --blue-soft: #000000;
  --orange: #ffe600;
  --orange-strong: #ffe600;
  --orange-soft: #000000;
  --red: #ffe600;
  --red-strong: #ffe600;
  --red-soft: #000000;
  --focus: #ffffff;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(45, 127, 240, 0.08), transparent 28rem),
    radial-gradient(circle at 88% 8%, rgba(255, 122, 26, 0.1), transparent 22rem),
    var(--bg);
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

html[data-contrast="high"] body {
  background: #000000;
}

html[data-contrast="high"] img:not(.brand__logo) {
  filter: grayscale(1) contrast(1.12);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.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;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 0.8rem;
  color: var(--orange-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.section {
  padding: 4.6rem 0;
}

.section--soft {
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

html[data-contrast="high"] .section--soft {
  background: #050505;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 1.8rem;
}

.section-heading::after,
.page-hero__inner::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin-top: 1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), var(--blue-bright));
}

.section-heading h2,
.page-hero h1,
.hero-copy h1,
.info-panel h2,
.content-card h2,
.contact-card h2,
.visual-story__copy h2 {
  margin: 0;
  line-height: 1.08;
}

.section-heading h2 {
  font-size: clamp(1.75rem, 3vw, 2.55rem);
}

/* =========================================================
   Nagłówek i nawigacja
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(223, 229, 239, 0.9);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
}

html[data-contrast="high"] .site-header {
  background: rgba(0, 0, 0, 0.96);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 102px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  font-weight: 800;
}

.brand__logo-wrap {
  display: grid;
  width: 150px;
  height: 84px;
  overflow: hidden;
  place-items: center;
  border-radius: 1rem;
  background: transparent;
}

.brand__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand__text {
  display: none;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}

.main-nav a {
  padding: 0.65rem 0.88rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: var(--blue-soft);
  color: var(--navy);
}

html[data-contrast="high"] .main-nav a:hover,
html[data-contrast="high"] .main-nav a[aria-current="page"] {
  color: #000000;
  background: var(--yellow);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.search {
  position: relative;
}

.search input {
  width: 220px;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

html[data-contrast="high"] .search input::placeholder {
  color: var(--muted);
}

.search input:focus-visible,
.accessibility-tools button:focus-visible,
.button:focus-visible,
.link-card:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-results a {
  display: block;
  padding: 0.72rem 0.8rem;
  border-radius: 0.75rem;
  text-decoration: none;
}

.search-results a:hover {
  background: var(--orange-soft);
}

.search-results strong,
.search-results span {
  display: block;
}

.search-results span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.search-empty {
  display: block;
  padding: 0.72rem 0.8rem;
  color: var(--muted);
}

.accessibility-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.accessibility-tools button {
  min-height: 44px;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.accessibility-tools button:hover {
  transform: translateY(-1px);
}

.accessibility-tools button[aria-pressed="true"] {
  color: #ffffff;
  background: var(--navy);
  border-color: var(--navy);
}

html[data-contrast="high"] .accessibility-tools button[aria-pressed="true"] {
  color: #000000;
  background: var(--yellow);
}

/* =========================================================
   Hero i układy treści
   ========================================================= */

.hero-section {
  padding: 4.2rem 0 3.8rem;
}

.hero-grid,
.split-grid,
.content-grid,
.contact-grid,
.page-hero__grid {
  display: grid;
  gap: 1.5rem;
}

.hero-grid {
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 0.78fr);
  align-items: center;
}

.hero-copy h1 {
  max-width: 760px;
  font-size: clamp(2.25rem, 5vw, 4.1rem);
  letter-spacing: -0.03em;
}

.hero-copy p {
  max-width: 680px;
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-media,
.page-hero__media,
.wide-media,
.visual-story__large,
.visual-story__small,
.contact-visual {
  overflow: hidden;
  border-radius: 1.35rem;
  box-shadow: var(--shadow);
}

.hero-media {
  min-height: 420px;
}

.hero-media img,
.page-hero__media img,
.wide-media img,
.visual-story__large img,
.visual-story__small img,
.contact-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-media:hover img,
.page-hero__media:hover img,
.wide-media:hover img,
.visual-story__large:hover img,
.visual-story__small:hover img,
.contact-visual:hover img {
  transform: scale(1.035);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  box-shadow: 0 14px 28px rgba(23, 105, 209, 0.18);
}

.button--secondary {
  border: 1px solid var(--line);
  background: var(--surface);
}

html[data-contrast="high"] .button--primary {
  color: #000000;
  background: var(--yellow);
}

.feature-grid,
.mini-card-grid,
.link-card-grid {
  display: grid;
  gap: 1rem;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.mini-card,
.content-card,
.contact-card,
.info-panel,
.link-card,
.visual-story__copy {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.info-panel,
.visual-story__copy {
  background: linear-gradient(180deg, var(--surface), rgba(246, 234, 219, 0.7));
}

html[data-contrast="high"] .info-panel,
html[data-contrast="high"] .visual-story__copy {
  background: #000000;
}

.feature-card,
.mini-card,
.content-card,
.contact-card,
.info-panel,
.visual-story__copy {
  padding: 1.4rem;
  border-radius: 1.15rem;
}

.feature-card,
.mini-card,
.link-card,
.content-card,
.contact-card {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.feature-card:hover,
.mini-card:hover,
.link-card:hover,
.content-card:hover,
.contact-card:hover {
  transform: translateY(-4px);
  border-color: rgba(23, 105, 209, 0.3);
}

.feature-card h3,
.mini-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
}

.feature-card p,
.mini-card p,
.content-card p,
.contact-card p,
.info-panel p,
.visual-story__copy p {
  margin: 0;
  color: var(--muted);
}

.split-grid {
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  align-items: start;
}

.info-panel h2,
.visual-story__copy h2 {
  margin-bottom: 0.8rem;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.link-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.link-card {
  display: grid;
  gap: 0.35rem;
  padding: 1.2rem;
  border-radius: 1.15rem;
  text-decoration: none;
}

.link-card span {
  color: var(--orange-strong);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.link-card strong {
  font-size: 1.08rem;
}

.page-hero {
  padding: 3.4rem 0 1.9rem;
}

.page-hero--split .page-hero__grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 0.7fr);
  align-items: center;
}

.page-hero__inner {
  max-width: 860px;
}

.page-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.45rem);
  letter-spacing: -0.03em;
}

.page-hero p {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.page-hero__media {
  min-height: 280px;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-card h2 {
  margin-bottom: 0.8rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.check-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.check-list li + li {
  margin-top: 0.45rem;
}

.mini-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-card h2 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
}

.contact-card h2 a {
  text-decoration: none;
}

.contact-visual {
  display: flex;
  align-items: center;
  min-height: 100%;
}

.media-band {
  padding-top: 0;
}

.wide-media {
  min-height: 380px;
}

.visual-story__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.52fr);
  gap: 1rem;
  align-items: stretch;
}

.visual-story__large {
  min-height: 420px;
  grid-row: span 2;
}

.visual-story__small {
  min-height: 240px;
}

.visual-story__copy {
  display: grid;
  align-content: center;
  gap: 0.5rem;
}

/* =========================================================
   FAQ, mapa i stopka
   ========================================================= */

.faq-list {
  display: grid;
  gap: 0.8rem;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, border-color 180ms ease;
}

.faq-list details:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 105, 209, 0.25);
}

.faq-list summary {
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 1.25rem;
  font-weight: 800;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list p {
  margin: 0;
  padding: 0 1.25rem 1.25rem;
  color: var(--muted);
}

.map-note {
  max-width: 760px;
  color: var(--muted);
}

.coverage-map {
  width: 100%;
  height: 420px;
  margin-top: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.map-fallback {
  display: grid;
  min-height: 100%;
  place-items: center;
  margin: 0;
  color: var(--muted);
}

.site-footer {
  padding: 2.5rem 0 3rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

/* =========================================================
   Animacje i dostępność ruchu
   ========================================================= */

html.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 650ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================
   Responsywność
   ========================================================= */

@media (max-width: 1080px) {
  .site-header__inner {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.9rem 0;
  }

  .hero-grid,
  .split-grid,
  .page-hero--split .page-hero__grid,
  .visual-story__grid {
    grid-template-columns: 1fr;
  }

  .visual-story__large {
    grid-row: auto;
  }
}

@media (max-width: 820px) {
  .feature-grid,
  .mini-card-grid,
  .content-grid,
  .contact-grid,
  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .link-card-grid {
    grid-template-columns: 1fr;
  }

  .main-nav {
    order: 3;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 20px, 1180px);
  }

  .header-tools {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .search input {
    width: 100%;
  }

  .accessibility-tools {
    justify-content: flex-end;
  }

  .hero-section,
  .section {
    padding: 3rem 0;
  }

  .page-hero {
    padding-top: 2.4rem;
  }

  .hero-media {
    min-height: 280px;
  }

  .wide-media {
    min-height: 240px;
  }
}
