/* ============================================================
   Ewa Ściera Temat — notatnik z maskotką
   Hand-drawn notebook aesthetic. Zero zależności.
   ============================================================ */

/* --- Czcionka Caveat (hostowana lokalnie, zmienna 400–700) --- */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/caveat-latin-ext-f626b95c.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/caveat-latin-891951df.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokeny --- */
:root {
  --paper: #fdf6e3;
  --paper-lines: #d9cfb8;
  --ink: #2b2622;
  --ink-soft: #5c5347;
  --red: #d9534f;
  --yellow: #f0ad4e;
  --blue: #5bc0de;
  --green: #5cb85c;
  --purple: #8e5ad6;
  --sticker-yellow: #ffe66d;
  --sticker-orange: #ffb347;
  --brand-highlight: #ffe066;   /* marker pod "Ściera" w logo — light mode */
  --marker-yellow: rgba(240, 173, 78, 0.55);
  --marker-red: rgba(217, 83, 79, 0.35);
  --card: #fffdf5;
  --shadow: rgba(43, 38, 34, 0.15);

  --font-hand: 'Caveat', 'Comic Sans MS', 'Segoe Print', cursive;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --line-gap: 2.6rem;            /* odstęp między liniami notatnika */
  --content-width: 62rem;
}

[data-theme="dark"] {
  --paper: #22201c;
  --paper-lines: #35322b;
  --ink: #f5efe0;
  --ink-soft: #d8cfc0;
  --red: #e87570;
  --yellow: #f5c477;
  --card: #2e2b25;
  --shadow: rgba(0, 0, 0, 0.4);
  --sticker-yellow: #4a4436;
  --sticker-orange: #5a4a33;
  --brand-highlight: rgba(245, 196, 119, 0.35); /* żółty przydymiony — czytelny na ciemnym tle */
  --marker-yellow: rgba(245, 196, 119, 0.45);   /* ciepły amber — widoczny na ciemnym papierze */
  --marker-red: rgba(232, 117, 112, 0.45);
}

/* --- Reset + baza --- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  /* Linie notatnika + czerwony margines */
  background-image:
    linear-gradient(90deg, transparent 0 4.5rem, rgba(217, 83, 79, 0.25) 4.5rem 4.7rem, transparent 4.7rem),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--line-gap) - 1px),
      var(--paper-lines) calc(var(--line-gap) - 1px),
      var(--paper-lines) var(--line-gap)
    );
  background-attachment: local;
  line-height: 1.65;
}

/* --- Typografia odręczna --- */
h1, h2, h3, .hand {
  font-family: var(--font-hand);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.4em;
}

h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.7rem); }

/* Podkreślenie markerem */
.marker {
  background-image: linear-gradient(100deg, transparent 2%, var(--marker-yellow) 4%, var(--marker-yellow) 96%, transparent 98%);
  padding: 0 0.25em;
  border-radius: 0.2em;
}

.marker-red { background-image: linear-gradient(100deg, transparent 2%, var(--marker-red) 4%, var(--marker-red) 96%, transparent 98%); }

/* --- Layout --- */
.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

section { padding: 3rem 0 2rem; }

/* --- Skip link --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--yellow);
  color: var(--ink);
  padding: 0.5rem 1rem;
  font-weight: 700;
  border-radius: 0 0 0.5rem 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* --- Focus --- */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px dashed var(--red);
  outline-offset: 2px;
}

/* --- Header --- */
header.site {
  border-bottom: 3px solid var(--ink);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px var(--shadow);
}

.site-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  max-width: var(--content-width);
  margin: 0 auto;
  flex-wrap: wrap;
}

/* Twarda ochrona przed poziomym scrollowaniem */
html, body { overflow-x: hidden; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}

.brand img { width: 40px; height: 40px; }

.brand-name {
  font-family: var(--font-hand);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.brand-accent {
  background: linear-gradient(transparent 55%, var(--brand-highlight) 55%);
  padding: 0 2px;
}

.brand-dot {
  color: var(--red);
  font-size: 2rem;
  line-height: 0;
  vertical-align: -0.15em;
}

nav ul {
  display: flex;
  gap: 0.3rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
}

nav a {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-family: var(--font-hand);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 0.5rem 0.9rem 0.6rem 0.9rem;
  transition: background 0.15s, transform 0.15s;
}

nav a:hover { background: var(--sticker-yellow); transform: rotate(-2deg); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.header-lang {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.header-lang:hover { background: var(--sticker-yellow); transform: rotate(-5deg); }

/* Theme toggle */
.theme-toggle {
  border: 2px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  font-size: 1.2rem;
  border-radius: 50%;
  width: 2.4rem;
  height: 2.4rem;
  cursor: pointer;
  transition: transform 0.2s;
}
.theme-toggle:hover { transform: rotate(20deg); }

/* --- Hero --- */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  padding: 4rem 0 3rem;
}

@media (max-width: 700px) { .hero { grid-template-columns: 1fr; } }

.hero p.lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 34rem;
}

/* --- Sklep + Kontakt: dwa słupki na desktopie (balans layoutu) --- */
@media (min-width: 900px) {
  .duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
  }
}

/* --- Dymek dialogowy --- */
.speech-bubble {
  position: relative;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 1rem 1.2rem 1.2rem 1.2rem;
  padding: 0.8rem 1.1rem;
  font-family: var(--font-hand);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  box-shadow: 3px 3px 0 var(--shadow);
}
/* Ogon dymku — wychodzi z lewego-dolnego rogu, wskazuje na twarz Ewy */
.speech-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 18px;
  height: 18px;
  background: var(--card);
  border-right: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}

/* Avatar */
.avatar-figure { margin: 0; text-align: center; }
.avatar-figure img { width: min(100%, 300px); height: auto; }

/* --- Sticky notes / karteczki --- */
.notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  padding: 0;
  list-style: none;
}

.note {
  background: var(--sticker-yellow);
  border: 2px solid var(--ink);
  padding: 1.2rem 1.3rem;
  box-shadow: 4px 4px 0 var(--shadow);
  transform: rotate(-1deg);
  transition: transform 0.2s;
}
.note:nth-child(2n) { background: var(--sticker-orange); transform: rotate(2.2deg) translateY(10px); }
.note:nth-child(3n) { transform: rotate(-2deg) translateY(-6px); }
.note:nth-child(4n) { transform: rotate(1.3deg) translateY(4px); }
.note:nth-child(5n) { transform: rotate(-3deg) translateY(14px); }
.note:nth-child(6n) { transform: rotate(2.6deg) translateY(-10px); }

.note:hover { transform: rotate(0deg) scale(1.03); }

.note h3 { margin-top: 0; }

/* Pinezka */
.note::before {
  content: '';
  display: block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--ink);
  box-shadow: 0 2px 3px var(--shadow);
  margin: 0 auto 0.8rem;
}
.note:nth-child(2n)::before { margin-left: 20%; }
.note:nth-child(3n)::before { margin-right: 15%; }

/* --- Przyciski --- */
.btn {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--sticker-yellow);
  border: 2.5px solid var(--ink);
  padding: 0.5rem 1.4rem;
  text-decoration: none;
  border-radius: 0.7rem 1.1rem 0.8rem 1.1rem;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translate(-2px, -2px) rotate(-1deg); box-shadow: 5px 5px 0 var(--shadow); }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--shadow); }

.btn-red { background: var(--red); color: #fff; }
.btn-blue { background: var(--blue); color: #1a1a1a; border-color: #1a1a1a; }

/* Linki w klimacie notatnika (nie default-owy niebieski) */
a { color: var(--ink); }
main a:not(.btn) { text-decoration: underline; text-decoration-style: wavy; text-decoration-color: var(--red); text-underline-offset: 3px; }
main a:not(.btn):hover { text-decoration-color: var(--purple); }

/* --- Kontakt: kartka --- */
.contact-card {
  background: var(--card);
  border: 2.5px dashed var(--ink);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 34rem;
  box-shadow: 4px 4px 0 var(--shadow);
}

.contact-card dl { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 1rem; }
.contact-card dt { font-family: var(--font-hand); font-weight: 700; font-size: 1.25rem; white-space: nowrap; }
.contact-card dd { margin: 0; }

/* --- Footer --- */
footer.site {
  border-top: 3px solid var(--ink);
  margin-top: 3rem;
  padding: 1.5rem 0 2.5rem;
  background: var(--card);
}
footer.site .wrap { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
footer.site p { margin: 0; color: var(--ink-soft); }

/* Siatka platform kontaktowych — stała kolejność niezależnie od stanu Turnstile */
.contact-platforms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}

.contact-platforms a,
.contact-platforms .contact-platform-disabled {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.1s;
  white-space: nowrap;
}

.contact-platforms .contact-platform-disabled {
  border-color: var(--ink-soft);
  color: var(--ink-soft);
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(1);
  user-select: none;
}

main .contact-platforms a {
  text-decoration: none;
}

/* Dane kontaktowe ukryte do czasu weryfikacji Turnstile */
.contact-locked {
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  user-select: none;
}

.contact-lock-note {
  margin-top: 1.2rem;
  color: var(--ink-soft);
}

#reveal-contact {
  font: inherit;
  cursor: pointer;
}

#reveal-contact:disabled {
  cursor: default;
  opacity: 0.75;
}

/* Turnstile działa w nakładce, więc nie zmienia wymiarów sekcji kontaktowej. */
.turnstile-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(20 18 15 / 72%);
}

.turnstile-overlay[hidden] { display: none; }

.turnstile-dialog {
  position: relative;
  width: min(100%, 22rem);
  padding: 1.1rem;
  border: 2.5px solid var(--ink);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: 6px 6px 0 var(--shadow);
  color: var(--ink);
  text-align: center;
}

.turnstile-dialog .hand {
  margin: 0 2rem 0.9rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.turnstile-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 700 1.6rem/1 var(--font-body);
  cursor: pointer;
}

#turnstile-slot {
  display: grid;
  min-height: 4.1rem;
  place-items: center;
  margin: 0;
  overflow: hidden;
}

#turnstile-slot > * { max-width: 100%; }

#reveal-status {
  min-height: 3.4em;
  margin: 0.6rem 0 0;
  color: var(--ink-soft);
}

.contact-platforms a.is-locked {
  cursor: not-allowed;
  opacity: 0.6;
}

.contact-platforms a.is-locked:hover {
  transform: none;
  box-shadow: none;
  background: var(--card);
  color: var(--ink);
  border-color: var(--ink);
}

.contact-platforms a:hover {
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--ink);
}

.contact-platforms svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Kolory brandowe przy hover */
.contact-platforms a[data-brand="whatsapp"]:hover  { background: #25D366; color: #fff; border-color: #25D366; }
.contact-platforms a[data-brand="telegram"]:hover  { background: #26A5E4; color: #fff; border-color: #26A5E4; }
.contact-platforms a[data-brand="signal"]:hover    { background: #3A76F0; color: #fff; border-color: #3A76F0; }
.contact-platforms a[data-brand="facebook"]:hover  { background: #1877F2; color: #fff; border-color: #1877F2; }
.contact-platforms a[data-brand="instagram"]:hover { background: #E4405F; color: #fff; border-color: #E4405F; }
.contact-platforms a[data-brand="tiktok"]:hover    { background: #000;    color: #fff; border-color: #000;    }

.lang-switch { font-family: var(--font-hand); font-size: 1.2rem; font-weight: 700; }

/* Mobile: logo + język/motyw, niżej zwarta nawigacja bez scrolla */
@media (max-width: 640px) {
  .site-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 0.15rem;
    padding: 0.35rem 0.65rem 0.3rem;
  }
  .brand { min-width: 0; }
  .brand-name { font-size: 1.15rem; white-space: nowrap; }
  .header-actions {
    grid-column: 2;
    grid-row: 1;
    gap: 0.25rem;
  }
  .header-lang,
  .theme-toggle { width: 2rem; height: 2rem; font-size: 0.95rem; }
  nav {
    grid-column: 1 / -1;
    width: 100%;
    border-top: 1px solid var(--paper-lines);
    padding-top: 0.15rem;
  }
  nav ul {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0;
  }
  nav a {
    display: flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.22rem clamp(0.2rem, 1.1vw, 0.4rem);
    font-size: clamp(0.92rem, 3.6vw, 1.05rem);
    white-space: nowrap;
  }
  .hero { padding: 2.5rem 0 2rem; }
  h1 { font-size: clamp(1.9rem, 8vw, 2.8rem); }
  .speech-bubble { font-size: 1.3rem; max-width: 100%; }
  .btn { display: block; text-align: center; margin: 0.4rem 0; }
  section { padding: 2rem 0 1.5rem; }
  .contact-card { padding: 0.95rem; }
  .contact-card dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }
  .contact-card dt {
    margin-top: 0.6rem;
    font-size: 1.15rem;
    white-space: normal;
  }
  .contact-card dt:first-child { margin-top: 0; }
  .contact-card dd {
    min-width: 0;
    padding-left: 1.65rem;
    overflow-wrap: anywhere;
  }
  .contact-platforms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }
  .contact-platforms a,
  .contact-platforms .contact-platform-disabled {
    gap: 0.35rem;
    padding: 0.4rem 0.45rem;
    font-size: 0.86rem;
  }
  .contact-platforms svg { width: 16px; height: 16px; }
  .note { transform: none !important; }
  .avatar-figure img { width: min(80vw, 260px); }
}

/* --- 404 --- */
.center-wrap { min-height: 60vh; display: grid; place-content: center; text-align: center; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
