/* =========================================================================
   Quintaro — strona wizytówka. Styl nawiązuje do aplikacji: granatowe tło
   #161F3D, akcent indygo/teal, motyw wirujących "glisz" spiral. Mobile-first.
   ========================================================================= */

/* ----- Zmienne palety marki (spójne z colors.xml aplikacji) ----- */
:root {
  --bg-deep:      #161F3D;   /* granat główny (palette_navy_deep) */
  --bg-navy:      #1D2A52;   /* granat gradientu (palette_navy)   */
  --bg-navy-2:    #101B33;   /* ciemniejszy (histogram_bg)        */
  --accent:       #4A63A8;   /* akcent indygo (palette_indigo)    */
  --accent-soft:  #6D9CE0;   /* jasny akcent (histogram_line)     */
  --teal:         #2FC9A8;   /* teal z logo                        */
  --teal-bright:  #5FD9B8;   /* teal jasny (histogram_recommend)   */
  --ink-light:    #F2F3F9;   /* tekst jasny na granacie            */
  --ink-dim:      #98A2C4;   /* tekst drugorzędny na granacie      */
  --card-line:    rgba(255,255,255,0.10);
  --maxw:         1120px;
  --radius:       16px;
  --shadow:       0 18px 40px rgba(10,15,40,0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink-light);
  background-color: var(--bg-deep);
  background-image: linear-gradient(160deg, var(--bg-deep) 0%, var(--bg-navy) 55%, var(--bg-deep) 100%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

/* Globalna tekstura obwodów (motyw ze splash aplikacji) — subtelna warstwa
   pod całą treścią, spójna z ekranem startowym Quintaro. */
.page-texture {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("../assets/backgrounds/circuit.png") center top / cover no-repeat;
  opacity: 0.12;
  pointer-events: none;
}

code {
  font-family: ui-monospace, "SF Mono", Consolas, "Roboto Mono", monospace;
  background: rgba(255,255,255,0.08);
  padding: 0.1em 0.35em;
  border-radius: 6px;
  font-size: 0.9em;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================ NAGŁÓWEK ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(16, 23, 45, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-line);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-light); }
.brand-logo { height: 42px; width: auto; }
.brand-name { font-weight: 700; letter-spacing: 0.14em; font-size: 0.95rem; }

.nav-links { display: flex; gap: 26px; }
.nav-links a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink-light); }

.nav-actions { display: flex; align-items: center; gap: 14px; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  overflow: hidden;
}
.lang-btn {
  background: transparent;
  border: 0;
  color: var(--ink-dim);
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.lang-btn.active { background: var(--accent); color: #fff; }

/* Hamburger — widoczny tylko na mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  cursor: pointer;
  padding: 0 9px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink-light);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================== HERO ============================== */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 64px 0 72px;
}
/* Warstwa "glisz" — spirale z karty konta aplikacji */
.hero-glisz {
  position: absolute;
  inset: -10% -5% auto -5%;
  height: 130%;
  background: url("../assets/backgrounds/glisz-hero.png") center top / cover no-repeat;
  opacity: 0.5;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.hero-inner { position: relative; z-index: 1; }
.hero-logo {
  width: min(340px, 74vw);
  height: auto;
  margin: 0 auto 8px;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.45));
}
.hero-title {
  font-size: clamp(1.9rem, 6vw, 3.1rem);
  line-height: 1.15;
  margin: 12px auto 14px;
  max-width: 14ch;
  font-weight: 800;
}
.hero-subtitle {
  color: var(--ink-dim);
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  max-width: 60ch;
  margin: 0 auto 30px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }

/* ----- Przyciski ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-bright) 100%);
  color: #08312a;
}
/* Odznaka Google Play: oficjalny PNG z wbudowanym polem ochronnym (1/4 wysokości) — bez zmian kolorów i proporcji */
.play-badge { display: inline-block; line-height: 0; }
.play-badge img { height: 74px; width: auto; display: block; }
.btn-ghost {
  background: transparent;
  color: var(--ink-light);
  border-color: var(--card-line);
}
.btn-ghost:hover { border-color: var(--accent-soft); }

/* ============================ SEKCJE ============================= */
.section { padding: 64px 0; }
.section-tint { background: rgba(255,255,255,0.02); }

.section-title {
  font-size: clamp(1.6rem, 4.5vw, 2.3rem);
  text-align: center;
  margin: 0 0 12px;
  font-weight: 800;
}
.section-subtitle {
  text-align: center;
  color: var(--ink-dim);
  margin: 0 auto 40px;
  max-width: 52ch;
}

/* ----- Czym jest Quintaro ----- */
.what-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  max-width: 900px;
  margin: 30px auto 0;
}
.what-grid .lead { font-size: 1.2rem; color: var(--ink-light); margin: 0; }
.what-grid p:last-child { color: var(--ink-dim); margin: 0; }

/* ----- Karty zalet ----- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-top: 40px;
}
.card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 28px 26px;
  background:
    linear-gradient(150deg, rgba(29,42,82,0.92) 0%, rgba(22,31,61,0.94) 100%);
  border: 1px solid var(--card-line);
  box-shadow: var(--shadow);
}
/* Delikatny motyw glisz na całej powierzchni karty (obraz ma pełne tło, więc musi wypełniać kartę bez krawędzi) */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/backgrounds/glisz-card.png") right center / cover no-repeat;
  opacity: 0.35;
  pointer-events: none;
}
/* Treść karty nad warstwą glisz */
.card > * { position: relative; z-index: 1; }
.card-icon {
  font-size: 1.8rem;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(95,217,184,0.14);
  color: var(--teal-bright);
  margin-bottom: 16px;
}
.card-title { margin: 0 0 10px; font-size: 1.25rem; font-weight: 700; }
.card-text { margin: 0; color: var(--ink-dim); position: relative; z-index: 1; }

/* ----- Galeria zrzutów ----- */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.shot { margin: 0; text-align: center; }
.shot img {
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--card-line);
  box-shadow: var(--shadow);
  background: var(--bg-navy-2);
}
.shot figcaption {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--ink-dim);
}

/* ----- Bezpieczeństwo ----- */
.section-security { position: relative; overflow: hidden; }
.circuit-bg {
  position: absolute;
  inset: 0;
  background: url("../assets/backgrounds/circuit.png") center / cover no-repeat;
  opacity: 0.16;
  pointer-events: none;
}
.section-security .container { position: relative; z-index: 1; }
.sec-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-top: 36px;
  max-width: 900px;
  margin-inline: auto;
}
.sec-item {
  border-left: 3px solid var(--teal);
  padding: 4px 0 4px 18px;
}
.sec-item h3 { margin: 0 0 6px; font-size: 1.15rem; }
.sec-item p { margin: 0; color: var(--ink-dim); }

/* ----- Słownik pojęć (rozwijane hasła <details>) ----- */
.glossary {
  display: grid;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}
.gloss-item {
  border: 1px solid var(--card-line);
  border-radius: 12px;
  background: rgba(29,42,82,0.55);
  transition: border-color 0.2s;
}
.gloss-item[open] { border-color: rgba(95,217,184,0.45); }
.gloss-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
}
.gloss-item summary::-webkit-details-marker { display: none; }
/* Znak "+" obracany w "×" po rozwinięciu hasła */
.gloss-item summary::after {
  content: "+";
  flex-shrink: 0;
  color: var(--teal-bright);
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.2s;
}
.gloss-item[open] summary::after { transform: rotate(45deg); }
.gloss-item summary:hover { color: var(--teal-bright); }
.gloss-item summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 12px; }
.gloss-item p { margin: 0; padding: 0 20px 18px; color: var(--ink-dim); }
/* Skok do hasła: odstęp pod przyklejonym nagłówkiem i wyróżnienie wskazanego hasła */
.gloss-item { scroll-margin-top: 80px; }
.gloss-item:target { border-color: var(--teal-bright); }

/* Odnośnik z tekstu do hasła w słowniku pojęć */
.gloss-link {
  color: inherit;
  text-decoration: underline dotted var(--teal-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.gloss-link:hover { color: var(--teal-bright); }

/* Zwykły odnośnik w tekście akapitu (np. do polityki prywatności) */
.text-link {
  color: var(--teal-bright);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.text-link:hover { color: var(--ink-light); }

/* ============================ STOPKA ============================= */
.site-footer {
  border-top: 1px solid var(--card-line);
  padding: 34px 0;
  background: rgba(16,23,45,0.6);
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}
.footer-logo { height: 48px; width: auto; }
.footer-text { margin: 0; color: var(--ink-dim); font-size: 0.9rem; }
.footer-copy { font-size: 0.82rem; }
.footer-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid var(--card-line);
  transition: color 0.2s, border-color 0.2s;
}
.footer-link:hover { color: var(--teal-bright); border-color: var(--teal-bright); }
.footer-legal { display: inline-block; margin-top: 8px; font-size: 0.75rem; opacity: 0.75; }

/* ========================= RESPONSYWNOŚĆ ========================= */
@media (max-width: 860px) {
  .what-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  /* Menu mobilne: linki chowają się do wysuwanego panelu */
  .nav-links {
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(16,23,45,0.98);
    border-bottom: 1px solid var(--card-line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links a { padding: 14px 20px; border-top: 1px solid var(--card-line); }
  .nav-toggle { display: flex; }

  .cards { grid-template-columns: 1fr; }
  .sec-list { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 54px; }
  .section { padding: 52px 0; }
}

@media (max-width: 460px) {
  .gallery { grid-template-columns: 1fr; }
  .brand-name { display: none; }
}

/* Dostępność: szanuj preferencję ograniczenia ruchu */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
