:root {
  color-scheme: light;

  /* Brand */
  --paper: #ffffff;
  --ink: #071a49;
  --muted: #5f6b82;
  --rule: #d9dee7;
  --accent: #071a49;
  --accent-ink: #ffffff;

  /* Typography */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Layout – pełna szerokość, odstępy robi tylko --page-gutter */
  --content-width: none;
  --page-gutter: 2.5rem;
  --radius: 3px;

  /* Spacing */
  --section-space: 3.25rem;
  --transition: 160ms ease;
}

/* =========================
   RESET & BASE
   ========================= */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button,
input,
textarea,
select {
  font: inherit;
  max-width: 100%;
}

iframe {
  max-width: 100%;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

/* =========================
   FULL WIDTH LAYOUT
   ========================= */

.top,
.section,
.foot {
  width: 100%;
  padding-inline: var(--page-gutter);
}

main {
  width: 100%;
}

/* =========================
   HEADER & NAVIGATION
   ========================= */

.top {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.top-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-block: 1.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--ink);
  font: 800 1.4rem/1.1 var(--serif);
  letter-spacing: 0.045em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand img {
  width: min(13rem, 38vw);
  max-height: 10rem;
  object-fit: contain;
}

.top nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem;
}

.top nav a {
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition);
}

.top nav a:hover,
.top nav a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* =========================
   SECTIONS
   ========================= */

.section {
  padding-block: var(--section-space);
  border-top: 1px solid var(--rule);
}

.section h2 {
  margin: 0 0 1.75rem;
  color: var(--ink);
  font: 700 1.85rem/1.2 var(--serif);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.section p {
}

.section > :last-child {
  margin-bottom: 0;
}

.cta {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

#videos,
#videos + .section {
  border-top: 0;
}
/* =========================
   FADED BG & GRADIENT MASKS
   Tło idzie przez zmienną --bg-image ustawianą w HTML
   ========================= */

.faded-bg {
  position: relative;
  overflow: hidden;
}

.faded-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.faded-bg > * {
  position: relative;
  z-index: 1;
}

/* Notatki: widoczny prawy górny róg, niewidoczny lewy dolny */
.notes-faded::before {
  -webkit-mask-image: linear-gradient(to top right, transparent 30%, #000 100%);
  mask-image: linear-gradient(to top right, transparent 30%, #000 100%);
}

/* Korepetycje: pełna widoczność w lewym dolnym, zero już od 70% */
.consultations-faded::before {
  -webkit-mask-image: linear-gradient(to top right, #000 0%, transparent 70%);
  mask-image: linear-gradient(to top right, #000 0%, transparent 70%);
}

/* =========================
   NOTES – SIATKA KART
   ========================= */

.notes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0.5rem 0 0;          /* miejsce na podniesienie karty przy hoverze */
  list-style: none;
}

.note {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.85);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition),
    background-color var(--transition);
}

.note:hover,
.note:focus-within {
  transform: translateY(-6px);
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 30px rgba(7, 26, 73, 0.16);
}

.note > div {
  min-width: 0;
}

.note h3 {
  margin: 0 0 0.5rem;
  color: var(--ink);
  font: 700 1.4rem/1.3 var(--serif);
  letter-spacing: -0.015em;
}

.note p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.note form {
  margin: 0;
}
/* =========================
   BUTTONS
   ========================= */

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font: 650 0.975rem/1.3 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    opacity var(--transition),
    background-color var(--transition),
    color var(--transition);
}

.btn:hover {
  opacity: 0.84;
}

.btn:active {
  opacity: 0.72;
}

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

.btn.secondary:hover {
  border-color: var(--ink);
  opacity: 1;
}

/* =========================
   VIDEO GRID
   ========================= */

.videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18.5rem), 1fr));
  gap: 2rem 1.75rem;
}

.video {
  min-width: 0;
  margin: 0;
}

.video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--rule);
}

.video figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* =========================
   TEXT UTILITIES
   ========================= */

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.serif {
  font-family: var(--serif);
}

.eyebrow {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* =========================
   FOOTER
   ========================= */

.foot {
  padding-block: 2.25rem 3.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.foot-content {
  max-width: var(--content-width);
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.foot-socials {
  display: flex;
  gap: 1.5rem;
}

.foot-socials a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.foot-socials a:hover {
  color: var(--ink);
}

.foot a {
  text-decoration-color: var(--rule);
  text-underline-offset: 0.25em;
}

.foot a:hover {
  color: var(--ink);
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 48rem) {
  :root {
    --page-gutter: 1.35rem;
  }

  .top-content {
    gap: 1.25rem;
  }

  .top nav {
    gap: 0.75rem 1.25rem;
  }

  .section {
    padding-block: 2.75rem;
  }

  .videos {
    gap: 1.75rem;
  }

  .foot-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 40rem) {
  :root {
    --page-gutter: 1.1rem;
    --section-space: 2.5rem;
  }

  body {
    font-size: 1rem;
  }

  .top-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    padding-block: 1.25rem;
  }

  .top nav {
    justify-content: flex-start;
    width: 100%;
    gap: 0.65rem 1.25rem;
  }

  .top nav a {
    font-size: 0.9rem;
  }

  .section h2 {
    font-size: 1.65rem;
    margin-bottom: 1.25rem;
  }

  .videos {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .foot {
    padding-block: 1.75rem 2.5rem;
  }
}

/* =========================
   ACCESSIBILITY
   ========================= */

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

.redeem { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0 2rem; }
.redeem input { flex: 1 1 14rem; padding: .6rem .8rem; font: inherit; letter-spacing: .08em; text-transform: uppercase; }
.group { margin: 1.5rem 0; padding-top: 1rem; border-top: 1px solid rgba(128, 128, 128, .3); }
.files { list-style: none; padding: 0; margin: .5rem 0 0; }
.files li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid rgba(128, 128, 128, .15); }
.files li span:last-child { white-space: nowrap; display: flex; gap: 1rem; }
.flash { padding: .6rem .8rem; border-radius: 6px; }
.flash.ok { background: rgba(60, 160, 90, .18); }
.flash.err { background: rgba(200, 60, 60, .18); }
.code { font-size: 2rem; font-weight: 700; letter-spacing: .12em; font-family: ui-monospace, monospace; user-select: all; }
