/* === Reset (minimal, modern) ============================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, picture, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }

/* === Design tokens ====================================================== */
:root {
  /* Colors */
  --c-bg:        #FBF7F1;   /* cream */
  --c-bg-alt:    #F4EEE3;   /* slightly darker cream for alt sections */
  --c-text:      #2A2A2A;   /* graphite */
  --c-text-mute: #5A5A5A;
  --c-accent:    #C66B4A;   /* terracotta — placeholder, may be tuned */
  --c-accent-soft: #E8B89A;
  --c-line:      rgba(42, 42, 42, 0.12);

  /* Typography */
  --f-serif: "Fraunces", Georgia, serif;
  --f-sans:  "Inter", system-ui, -apple-system, sans-serif;

  /* Spacing scale (8-point grid) */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-5: 3rem;
  --s-6: 4rem;
  --s-7: 6rem;
  --s-8: 8rem;

  /* Layout */
  --container-max: 1200px;
  --container-pad: var(--s-3);
  --topnav-height: 64px;

  /* Motion */
  --t-fast: 150ms ease-out;
  --t-base: 200ms ease-out;
  --t-slow: 400ms ease-out;
}

/* === Base typography =================================================== */
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-sans);
  font-size: 17px;
  padding-top: var(--topnav-height);
}

h1, h2, h3, h4 {
  font-family: var(--f-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.5rem; }

p { color: var(--c-text); }

a { text-decoration: none; }
a:hover { color: var(--c-accent); }

/* === Layout primitives ================================================= */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section-title {
  font-family: var(--f-serif);
  font-weight: 600;
  margin-bottom: var(--s-5);
}

.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  background: var(--c-accent);
  margin-top: var(--s-2);
}

/* === Skip link (a11y) ================================================== */
.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  position: fixed;
  top: var(--s-2);
  left: var(--s-2);
  background: var(--c-text);
  color: var(--c-bg);
  padding: var(--s-1) var(--s-2);
  z-index: 1000;
}

/* === Section padding ================================================== */
main > section {
  padding-block: var(--s-7);
}
main > section:first-child {
  padding-block: 0;  /* hero handles its own padding */
}

/* === Top navigation ==================================================== */
.topnav {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  height: var(--topnav-height);
  background: rgba(251, 247, 241, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-line);
}

.topnav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.topnav__logo {
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.topnav__links {
  display: flex;
  gap: var(--s-4);
}

.topnav__links a {
  font-size: 0.95rem;
  position: relative;
  padding-block: var(--s-1);
  transition: color var(--t-fast);
}

.topnav__links a.is-active {
  color: var(--c-accent);
}

.topnav__links a.is-active::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -2px;
  height: 2px;
  background: var(--c-accent);
}

.topnav__hamburger {
  display: none;  /* shown only on mobile, in Task 12 */
  width: 32px;
  height: 32px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.topnav__hamburger span {
  display: block;
  height: 2px;
  background: var(--c-text);
  border-radius: 1px;
  transition: transform var(--t-base), opacity var(--t-base);
}

/* === Hero ============================================================== */
.hero {
  position: relative;
  min-height: calc(80vh - var(--topnav-height));
  display: flex;
  align-items: center;
  padding-block: var(--s-6);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--s-6);
  align-items: center;
  width: 100%;
}

.hero__title { margin-bottom: var(--s-3); }

.hero__lead {
  font-size: 1.125rem;
  color: var(--c-text-mute);
  margin-bottom: var(--s-4);
  max-width: 32ch;
}

.hero__media img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.18);
}

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: var(--s-3);
  transform: translateX(-50%);
  font-size: 1.5rem;
  color: var(--c-text-mute);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(8px); }
}

/* === Buttons =========================================================== */
.btn {
  display: inline-block;
  padding: var(--s-2) var(--s-3);
  border-radius: 999px;
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.btn--primary {
  background: var(--c-text);
  color: var(--c-bg);
}

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

/* === Prace / grid ====================================================== */
.grid {
  column-count: 3;
  column-gap: var(--s-3);
}

@media (max-width: 1024px) {
  .grid { column-count: 2; }
}
@media (max-width: 600px) {
  .grid { column-count: 1; }
}

.grid__loading,
.grid__empty {
  color: var(--c-text-mute);
  text-align: center;
  padding: var(--s-5);
}

.grid__card {
  break-inside: avoid;
  margin-bottom: var(--s-3);
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: var(--c-bg-alt);
  cursor: pointer;
  transition: transform var(--t-base), box-shadow var(--t-base);
}

.grid__card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.18);
}

.grid__card img {
  width: 100%;
  height: auto;
  transition: transform var(--t-slow);
}

.grid__card:hover img { transform: scale(1.03); }

.grid__card-title {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: var(--s-2) var(--s-3);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.65));
  color: #fff;
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity var(--t-base);
}

.grid__card:hover .grid__card-title,
.grid__card:focus-visible .grid__card-title { opacity: 1; }

@media (hover: none) {
  .grid__card-title { opacity: 1; }
}

/* === Filter chips ====================================================== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1);
  margin-bottom: var(--s-4);
}

.chip {
  padding: var(--s-1) var(--s-3);
  border-radius: 999px;
  border: 1px solid var(--c-line);
  font-size: 0.9rem;
  color: var(--c-text);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.chip:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
}

.chip.is-active {
  background: var(--c-accent);
  color: var(--c-bg);
  border-color: var(--c-accent);
}

.grid__card.is-hidden { display: none; }

/* === Lightbox ========================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-3);
  animation: fade-in var(--t-base);
}

.lightbox[hidden] { display: none; }

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  transition: background var(--t-fast);
}

.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(255, 255, 255, 0.18); }

.lightbox__close { top: var(--s-2); right: var(--s-2); }
.lightbox__nav--prev { left: var(--s-2); top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: var(--s-2); top: 50%; transform: translateY(-50%); }

.lightbox__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  max-width: min(1100px, 95vw);
  max-height: 90vh;
}

.lightbox__media img {
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  border-radius: 4px;
}

.lightbox__caption { color: #fff; text-align: center; }

.lightbox__caption h3 {
  font-family: var(--f-serif);
  font-size: 1.25rem;
  margin-bottom: var(--s-1);
}

.lightbox__counter {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

/* --- Lightbox tryb B (work with description) --------------------------- */
.lightbox__inner.is-tryb-b {
  flex-direction: row;
  align-items: stretch;
  gap: var(--s-5);
  text-align: left;
}

.lightbox__inner.is-tryb-b .lightbox__media {
  flex: 1 1 60%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
}

.lightbox__inner.is-tryb-b .lightbox__caption {
  flex: 1 1 40%;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-2);
  max-width: 360px;
}

.lightbox__description {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  line-height: 1.6;
}

.lightbox__more { align-self: flex-start; margin-top: var(--s-2); }

.lightbox__dots {
  display: flex;
  gap: var(--s-1);
  justify-content: center;
}

/* `display: flex/inline-block` overrides the default [hidden] behaviour;
   restore it explicitly so dots and the moreUrl button hide between works. */
.lightbox__dots[hidden],
.btn[hidden] { display: none; }

.lightbox__dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: background var(--t-fast);
}

.lightbox__dots button.is-active { background: #fff; }

@media (max-width: 700px) {
  .lightbox__inner.is-tryb-b {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .lightbox__inner.is-tryb-b .lightbox__caption { text-align: center; }
  .lightbox__more { align-self: center; }
}

body.is-lightbox-open { overflow: hidden; }

/* === About / O mnie ==================================================== */
.about { background: var(--c-bg-alt); }

.about__inner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--s-5);
  align-items: center;
}

.about__photo img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.18);
}

.about__text p {
  margin-bottom: var(--s-2);
  color: var(--c-text);
}

.about__quote {
  margin-top: var(--s-3);
  padding-left: var(--s-3);
  border-left: 3px solid var(--c-accent);
  font-family: var(--f-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--c-text-mute);
}

/* === Opinions ========================================================== */
.opinions__intro {
  max-width: 60ch;
  margin: 0 auto var(--s-4);
  color: var(--c-text-mute);
  text-align: center;
  font-size: 1.05rem;
}

.opinions__grid {
  column-count: 4;
  column-gap: var(--s-3);
}

@media (max-width: 1024px) { .opinions__grid { column-count: 3; } }
@media (max-width: 700px)  { .opinions__grid { column-count: 2; } }
@media (max-width: 480px)  { .opinions__grid { column-count: 1; } }

.opinion-shot {
  break-inside: avoid;
  display: block;
  margin-bottom: var(--s-3);
  border-radius: 4px;
  overflow: hidden;
  background: var(--c-bg-alt);
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.1);
  transition: transform var(--t-base), box-shadow var(--t-base);
}

.opinion-shot:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.18);
}

.opinion-shot img {
  width: 100%;
  height: auto;
  display: block;
}

/* === Contact =========================================================== */
.contact__inner {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
}

.contact__head p { margin-bottom: var(--s-2); color: var(--c-text-mute); }

.contact__email a {
  font-family: var(--f-serif);
  font-size: 1.5rem;
  color: var(--c-accent);
}

.contact__social {
  list-style: none;
  padding: 0;
  display: flex;
  gap: var(--s-3);
  margin-top: var(--s-4);
  justify-content: center;
}

.contact__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c-bg-alt);
  color: var(--c-text);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.contact__social a:hover {
  background: var(--c-accent);
  color: var(--c-bg);
  transform: translateY(-2px);
}

.contact__social svg {
  width: 28px;
  height: 22px;
  fill: currentColor;
}

/* === Footer ============================================================ */
.footer {
  border-top: 1px solid var(--c-line);
  padding-block: var(--s-3);
  font-size: 0.9rem;
  color: var(--c-text-mute);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* === Mobile breakpoints ================================================ */

/* Tablet & below */
@media (max-width: 900px) {
  .hero__inner       { grid-template-columns: 1fr; }
  .hero__media       { order: -1; }
  .about__inner      { grid-template-columns: 1fr; }
  .about__photo      { max-width: 320px; margin-inline: auto; }
}

/* Phone */
@media (max-width: 700px) {
  :root { --container-pad: var(--s-2); }

  body { font-size: 16px; }

  /* Topnav: hamburger replaces inline links */
  .topnav__hamburger { display: flex; }

  .topnav__links {
    position: fixed;
    inset-block-start: var(--topnav-height);
    inset-inline: 0;
    flex-direction: column;
    background: var(--c-bg);
    padding: var(--s-3);
    gap: var(--s-2);
    transform: translateY(-100%);
    transition: transform var(--t-base);
    border-bottom: 1px solid var(--c-line);
  }

  .topnav__links.is-open { transform: translateY(0); }

  .topnav__hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .topnav__hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .topnav__hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  /* Hero copy bigger on phone so it doesn't feel cramped */
  .hero__title { font-size: clamp(2rem, 8vw, 3rem); }

  /* Tighter section padding on phone */
  main > section { padding-block: var(--s-5); }

  /* Lightbox nav buttons closer to edges */
  .lightbox__nav--prev { left: 4px; }
  .lightbox__nav--next { right: 4px; }
}

/* === Prose (regulamin and similar text-heavy pages) ==================== */
.prose {
  max-width: 720px;
  padding-block: var(--s-7);
}

.prose__title {
  font-family: var(--f-serif);
  font-size: clamp(2.25rem, 4vw, 3rem);
  margin-bottom: var(--s-2);
}

.prose__title::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  background: var(--c-accent);
  margin-top: var(--s-2);
}

.prose__lead {
  font-family: var(--f-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--c-text-mute);
  margin-bottom: var(--s-5);
}

.prose__list {
  display: grid;
  gap: var(--s-4);
  padding-left: var(--s-3);
  counter-reset: rule;
  list-style: none;
}

.prose__list > li {
  counter-increment: rule;
  position: relative;
  padding-left: var(--s-4);
  line-height: 1.65;
  color: var(--c-text);
}

.prose__list > li::before {
  content: counter(rule) ".";
  position: absolute;
  left: -0.25rem;
  top: 0;
  font-family: var(--f-serif);
  font-weight: 600;
  color: var(--c-accent);
  width: var(--s-3);
  text-align: right;
}

.prose__list ul {
  margin: var(--s-1) 0 var(--s-2);
  padding-left: var(--s-3);
}

.prose__list ul li {
  margin-bottom: 4px;
  color: var(--c-text);
}

.prose__list strong { color: var(--c-text); font-weight: 600; }

.prose a { color: var(--c-accent); border-bottom: 1px solid currentColor; }
.prose a:hover { color: var(--c-text); }

.prose__back {
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-line);
  font-family: var(--f-serif);
}

.prose__back a { border-bottom: 0; }
.prose__back a:hover { color: var(--c-accent); }

.topnav__links a[aria-current="page"] {
  color: var(--c-accent);
}
