/* ============================================================================
   main.css — landing HomeLink24 (www/)
   ----------------------------------------------------------------------------
   Jeden plik, zero frameworków, zero zewnętrznych fontów (stos systemowy —
   kanon concept/05 §4.3: aplikacja używa SF Pro, strona ma wyglądać jak jedno
   z produktem). Tokeny = concept/05 §4.3 (= concept/02-ux.md §7.1). Dark mode
   wyłącznie przez prefers-color-scheme, bez przełącznika (§4.4). Bez czystej
   czerni: tło dark #111827, tekst #E8EEF7. brand-24 (#C25E00 / #E07A1F) jest
   zarezerwowane dla grafiki brandowej (logo PNG, OG) — poza paletą akcji.
   Układ: siatka 8 px, marginesy sekcji 96 px desktop / 56 px mobile, treść
   1200 px, kolumna czytelności 720 px, promienie 6 px (przyciski) / 10 px
   (karty i sekcje) — §4.1–4.2, concept/02 §7.3. Cienie tylko dla elementów
   unoszących się nad treścią (sticky CTA) — karty separuje obrys i tło.
   ========================================================================== */

:root {
  --bg: #FFFFFF;            /* tło strony */
  --surface: #F0F2F5;       /* karty, wyróżnione sekcje */
  --text: #111827;          /* tekst główny (ink) */
  --text-muted: #4B5563;    /* lead, podpisy */
  --border: #E5E7EB;        /* linie, karty */
  --accent: #1D5BA6;        /* CTA, linki (primary aplikacji) */
  --accent-hover: #2569B8;  /* stan hover — ciemniejszy odcień (§4.5) */
  --accent-ink: #FFFFFF;    /* tekst na akcencie */
  --brand-24: #C25E00;      /* wyłącznie grafika brandowa (logo, OG) */
  --radius-btn: 6px;
  --radius-card: 10px;
  --shadow-sticky: 0 -4px 16px rgba(17, 24, 39, 0.10);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;
    --surface: #1E2430;
    --text: #E8EEF7;
    --text-muted: #9AA4B2;
    --border: #334155;
    --accent: #8AB8E8;
    --accent-hover: #6FA3DE;
    --accent-ink: #0B1220;
    --brand-24: #E07A1F;
    --shadow-sticky: 0 -4px 16px rgba(0, 0, 0, 0.40);
  }
}

/* ---- Reset i baza ------------------------------------------------------- */

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

* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.15; font-weight: 700; }

h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: 2rem; letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; }

p + p { margin-top: 16px; }

a { color: var(--accent); }

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

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 2px 6px;
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Układ: kontener i sekcje (§4.1–4.2) -------------------------------- */

.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
}

.readability { max-width: 720px; }

.section { padding-block: 96px; }

.section--surface { background: var(--surface); }

.section-head { margin-bottom: 48px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.lead {
  font-size: 1.125rem;
  color: var(--text-muted);
}

.microcopy {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Skip link ----------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 24px;
  border-radius: 0 0 var(--radius-btn) 0;
  text-decoration: none;
}

.skip-link:focus-visible { left: 0; }

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

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.brand { display: inline-flex; align-items: center; }

.brand-img { height: 36px; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  padding: 12px 8px;
  border-radius: var(--radius-btn);
}

.nav-link:hover { color: var(--accent); }

/* ---- Przyciski i stany CTA (§4.5) ---------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  border: 1.5px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, transform 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: var(--surface);
  box-shadow: inset 0 0 0 0.5px var(--accent); /* pełniejszy obrys bez przeskoku layoutu */
}

.btn-secondary:active { transform: scale(0.98); }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-sm { min-height: 40px; padding: 8px 16px; }

.btn-block { width: 100%; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-block: 32px;
}

/* ---- Hero ----------------------------------------------------------------- */

.hero { padding-block: 96px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

.hero-copy .lead { margin-top: 24px; }

.hero-visual {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
}

.hero-visual img { width: 100%; height: auto; }

/* ---- Trzy kroki ----------------------------------------------------------- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
}

.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  margin-bottom: 16px;
}

.card h3 { margin-bottom: 8px; }

.card p { color: var(--text-muted); }

.steps-visual {
  margin-top: 64px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
}

.steps-visual img { width: 100%; height: auto; }

/* ---- Funkcje --------------------------------------------------------------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: center;
  padding-block: 48px;
  border-top: 1px solid var(--border);
}

.feature:first-of-type { border-top: 0; padding-top: 0; }

.feature--flip .feature-media { order: -1; }

.feature-icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
  margin-bottom: 16px;
}

.feature-copy h3 { margin-bottom: 8px; }

.feature-copy p { color: var(--text-muted); }

.feature-media {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
}

.feature-media img { width: 100%; height: auto; }

.feature-intro { max-width: 720px; }

.feature-intro p { color: var(--text-muted); margin-top: 8px; }

/* ---- Prywatność (tło akcentowe, §4.1) -------------------------------------- */

.section--accent {
  background: var(--accent);
  color: var(--accent-ink);
}

.section--accent h2 { color: var(--accent-ink); }

.privacy-list {
  list-style: none;
  max-width: 720px;
  display: grid;
  gap: 24px;
}

.privacy-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.privacy-list svg {
  width: 24px;
  height: 24px;
  flex: none;
  margin-top: 4px;
}

.privacy-cta {
  display: inline-block;
  margin-top: 48px;
  color: var(--accent-ink);
  font-weight: 600;
}

.section--accent .privacy-cta:focus-visible {
  outline-color: var(--accent-ink);
}

/* ---- Polityka prywatności (www/prywatnosc/) --------------------------------- */

.privacy-h2 { margin-top: 48px; }

/* ---- Architektura (diagram HTML+CSS, font mono §4.1) ------------------------ */

.arch {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr minmax(200px, 300px) 1fr;
  row-gap: 24px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875rem;
}

.arch-node {
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-btn);
  padding: 12px 16px;
  text-align: center;
  font-weight: 600;
}

.arch-node span {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
}

.arch-node--ctrl { grid-column: 1; grid-row: 1; }

.arch-node--host { grid-column: 3; grid-row: 1; }

.arch-lane-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.arch-link-line {
  position: relative;
  height: 2px;
  background: var(--text-muted);
  align-self: center;
  min-width: 48px;
}

.arch-link-line::after {
  content: "";
  position: absolute;
  top: -3.5px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--text-muted);
  border-right: 2px solid var(--text-muted);
}

.arch-link-line--to-cloud { grid-column: 1; grid-row: 2; }

.arch-link-line--to-cloud::after { right: 0; transform: rotate(45deg); }

.arch-link-line--to-host { grid-column: 3; grid-row: 2; }

.arch-link-line--to-host::after { left: 0; transform: rotate(-135deg); }

.arch-cloud {
  grid-column: 2;
  grid-row: 2;
  border: 1.5px dashed var(--text-muted);
  border-radius: var(--radius-btn);
  padding: 12px 16px;
  text-align: center;
  font-weight: 600;
}

.arch-cloud span {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
}

.arch-media { grid-column: 1 / -1; grid-row: 3; }

.arch-media-line {
  position: relative;
  height: 8px;
  border-top: 3px double var(--accent);
  border-bottom: 3px double var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.arch-media-line strong {
  background: var(--surface);
  padding-inline: 16px;
  font-weight: 600;
}

.arch-relay {
  grid-column: 2;
  grid-row: 4;
  text-align: center;
  color: var(--text-muted);
  padding-top: 8px;
}

.arch-summary { margin-top: 48px; }

/* ---- Wymagania ---------------------------------------------------------------- */

.req-list {
  list-style: none;
  display: grid;
  gap: 24px;
}

.req-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.req-list svg {
  width: 24px;
  height: 24px;
  flex: none;
  margin-top: 4px;
  color: var(--accent);
}

/* ---- FAQ ---------------------------------------------------------------------- */

.faq { display: grid; gap: 8px; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  min-height: 48px;
  font-weight: 600;
}

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

.faq summary::after {
  content: "+";
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent);
  flex: none;
}

.faq details[open] summary::after { content: "−"; }

.faq .faq-answer {
  padding: 0 24px 24px;
  color: var(--text-muted);
}

/* ---- Pobranie ------------------------------------------------------------------- */

.download-list {
  list-style: none;
  display: grid;
  gap: 24px;
  margin-top: 48px;
}

.download-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.download-list svg {
  width: 24px;
  height: 24px;
  flex: none;
  margin-top: 4px;
  color: var(--accent);
}

/* ---- Finalne CTA ------------------------------------------------------------------ */

.section--final { text-align: center; }

.section--final .cta-row { justify-content: center; }

/* ---- Stopka ------------------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-block: 48px;
  font-size: 0.875rem;
}

.site-footer p + p { margin-top: 8px; }

.footer-links a { color: var(--accent); }

.disclaimer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  max-width: 720px;
}

.disclaimer strong { color: var(--text); }

/* ---- Sticky dolny pasek CTA (mobile, §4.2) ------------------------------------------- */

.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: none;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-sticky);
}

/* ---- Mobile (§4.2: 390 px; breakpoint 720 px) ------------------------------------------ */

@media (max-width: 720px) {
  .section { padding-block: 56px; }

  .hero { padding-block: 56px; }

  .hero-grid,
  .feature,
  .feature--flip { grid-template-columns: 1fr; gap: 32px; }

  .feature--flip .feature-media { order: 0; }

  .grid-3 { grid-template-columns: 1fr; }

  .nav-link { display: none; }

  .arch {
    grid-template-columns: 1fr;
    row-gap: 16px;
    padding: 24px;
  }

  .arch-node--ctrl,
  .arch-node--host,
  .arch-cloud,
  .arch-media,
  .arch-relay { grid-column: 1; }

  .arch-node--ctrl { grid-row: 1; }
  .arch-node--host { grid-row: 2; }
  .arch-cloud { grid-row: 3; }
  .arch-media { grid-row: 4; }
  .arch-relay { grid-row: 5; }

  .arch-link-line { display: none; }

  .sticky-cta { display: block; }

  body { padding-bottom: 88px; }
}

/* ---- Ruch (§4.7) -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  html { scroll-behavior: auto; }

  .btn-primary:hover,
  .btn-primary:active,
  .btn-secondary:active { transform: none; }
}
