/* ============================================================
   PsychoProsto - style.css
   Koncept "Spokojna mądrość": teal + szałwia + krem + bursztyn
   Typografia: Spectral (display serif) + Manrope (body)
   ============================================================ */

:root {
  /* Paleta - jasny motyw */
  --accent: #0f766e;          /* teal - spokój, zaufanie, opieka */
  --accent-strong: #115e59;
  --accent-soft: #d9ece9;     /* jasny teal do podświetleń */
  --amber: #b45309;           /* bursztyn - nadzieja, optymizm */
  --amber-soft: #f7e8d7;
  --sage: #6a8f6e;            /* szałwia - natura, równowaga */
  --sage-soft: #e3ecdf;
  --bg: #faf7f1;              /* ciepły krem */
  --bg-soft: #f3efe6;
  --card: #ffffff;
  --text: #1c2422;            /* atrament z domieszką zieleni */
  --muted: #57655f;
  --border: #e3dccd;
  --header-bg: rgba(250, 247, 241, 0.92);
  --shadow: 0 1px 2px rgba(28, 36, 34, 0.05), 0 4px 16px rgba(28, 36, 34, 0.06);
  --shadow-hover: 0 2px 4px rgba(28, 36, 34, 0.06), 0 12px 28px rgba(15, 118, 110, 0.12);
  --accent-subtle: rgba(15, 118, 110, 0.35);
  --accent-light: rgba(15, 118, 110, 0.5);

  /* Typografia */
  --font-display: 'Spectral', Georgia, serif;
  --font-body: 'Manrope', system-ui, sans-serif;

  /* Geometria */
  --radius: 12px;
  --radius-sm: 8px;
  --header-height: 60px;
  --sidebar-w: 300px;
  --transition: .2s ease-out;

  /* Orb */
  --ox: 50vw;
  --oy: 30vh;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: #12312d;
    --amber: #f59e0b;
    --amber-soft: #35270f;
    --sage: #9cbf9f;
    --sage-soft: #1e2a1d;
    --bg: #0c1312;
    --bg-soft: #101a18;
    --card: #141f1d;
    --text: #d3ddd8;
    --muted: #93a49d;
    --border: #243330;
    --header-bg: rgba(12, 19, 18, 0.92);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 28px rgba(45, 212, 191, 0.08);
    --accent-subtle: rgba(45, 212, 191, 0.3);
    --accent-light: rgba(45, 212, 191, 0.35);
  }
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 100% 0%, var(--accent-light) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, var(--accent-light) 0%, transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
body.orb-on::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: 0;
  width: 480px;
  height: 480px;
  left: calc(var(--ox) - 240px);
  top: calc(var(--oy) - 240px);
  background: radial-gradient(circle, var(--accent-light) 0%, transparent 65%);
  opacity: .5;
  border-radius: 50%;
  transition: left .18s linear, top .18s linear;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  z-index: 200;
  font-weight: 600;
}
.skip-link:focus { left: 8px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  text-wrap: balance;
  color: var(--text);
}
h1 { font-size: 2.35rem; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; font-weight: 600; }
h3 { font-size: 1.13rem; font-weight: 600; }

/* ---------- header ---------- */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.app-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-subtle), transparent);
  opacity: .3;
  pointer-events: none;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}
.mark {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  white-space: nowrap;
}
.mark:hover { text-decoration: none; }
.mark-svg { color: var(--accent); flex: none; }
.mark-text em { font-style: italic; color: var(--accent); }

.header-search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.header-search input {
  width: 100%;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .92rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.header-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  overflow: hidden;
  z-index: 120;
}
.sr-item {
  display: block;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--bg-soft); text-decoration: none; }
.sr-title { font-weight: 600; font-size: .92rem; }
.sr-meta { font-size: .78rem; color: var(--muted); }
.sr-empty { padding: 12px 16px; color: var(--muted); font-size: .88rem; }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  padding: 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.burger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- layout ---------- */
.layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--header-height) 20px 0;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: max(20px, calc((100vw - 1400px) / 2));
  width: var(--sidebar-w);
  overflow-y: auto;
  padding: 22px 14px 60px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 90;
  scrollbar-width: thin;
}
.side-group { margin-bottom: 18px; }
.side-group-title {
  font-family: var(--font-body);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
  padding: 0 10px;
}
.side-links { display: flex; flex-direction: column; gap: 1px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition: background-color var(--transition), border-color var(--transition);
}
.sidebar-link:hover { background: var(--bg-soft); text-decoration: none; }
.sidebar-link.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 600;
}
.sl-ic { flex: none; font-size: .85rem; }
.sidebar-foot {
  margin-top: 24px;
  padding: 14px 10px;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--muted);
}
.sidebar-foot p { margin: 0; line-height: 1.5; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 14, 0.55);
  z-index: 85;
}
.main {
  flex: 1;
  margin-left: calc(var(--sidebar-w) + 40px);
  padding: 34px 12px 80px;
  max-width: 860px;
}

/* ---------- footer ---------- */
.app-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  margin-left: calc(var(--sidebar-w) + 40px);
}
.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px;
  font-size: .86rem;
  color: var(--muted);
  line-height: 1.6;
}
.footer-inner p { margin: 0 0 8px; }
.footer-inner strong em { font-style: italic; color: var(--accent); }
.footer-meta { font-size: .78rem; }

/* ---------- hero ---------- */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
  align-items: center;
  padding: 44px 0 36px;
}
.hero-eyebrow {
  grid-column: 1 / -1;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sage);
}
.home-hero h1 {
  grid-column: 1;
  font-size: 2.9rem;
  line-height: 1.12;
  margin: 10px 0 14px;
}
.home-hero h1 .hl { color: var(--accent); font-style: italic; }
.hero-lead {
  grid-column: 1;
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 22px;
}
.hero-cta {
  grid-column: 1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(15, 118, 110, 0.4); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-ghost:hover { background: var(--accent-soft); }

.hero-stats {
  grid-column: 1;
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}
.hs-num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; color: var(--accent); line-height: 1.1; }
.hs-label { font-size: .76rem; color: var(--muted); letter-spacing: .02em; }

/* hero-art: koło oddechowe */
.hero-art {
  grid-column: 2;
  grid-row: 2 / 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.breath { position: relative; width: 260px; height: 260px; }
.breath-svg { width: 100%; height: 100%; }
.breath-ring {
  fill: none;
  stroke-width: 2;
}
.breath-ring-outer { stroke: var(--sage); stroke-dasharray: 4 6; animation: spin 40s linear infinite; transform-origin: 130px 130px; }
.breath-ring-mid { stroke: var(--accent-soft); stroke-dasharray: 2 5; animation: spin 26s linear infinite reverse; transform-origin: 130px 130px; }
.breath-core {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 2.5;
}
.breath-ticks line { stroke: var(--border); stroke-width: 2; stroke-linecap: round; }
.breath-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}
.breath-phase { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--accent); font-style: italic; }
.breath-count { font-size: .85rem; color: var(--muted); font-weight: 700; letter-spacing: .05em; }
@keyframes spin { to { transform: rotate(360deg); } }

.spec-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.spec-chip {
  font-size: .76rem;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
}
.spec-chip b { color: var(--accent); }

/* ---------- home sections ---------- */
.home-section { margin-top: 44px; }
.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 18px;
}
.home-section-head h2 { margin: 0; font-size: 1.5rem; }
.sec-count { font-size: .78rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.home-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 18px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  overflow: hidden;
}
.home-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--amber));
  opacity: 0;
  transition: opacity var(--transition);
}
.home-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-subtle);
  text-decoration: none;
}
.home-card:hover::before { opacity: 1; }
.hc-icon { font-size: 1.25rem; }
.hc-title { font-weight: 700; font-size: .95rem; line-height: 1.4; }
.hc-excerpt { font-size: .85rem; color: var(--muted); line-height: 1.55; }
.hc-arrow {
  position: absolute;
  right: 14px; bottom: 12px;
  font-size: 1rem;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity var(--transition), transform var(--transition);
}
.home-card:hover .hc-arrow { opacity: 1; transform: translateX(0); }

/* ---------- article ---------- */
.page-enter { animation: fadeUp .28s ease-out both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.crumbs {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.crumb-sep { color: var(--border); }
.article-head { margin-bottom: 22px; }
.article-tag {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 12px;
}
.article-head h1 { font-size: 2.15rem; margin: 0 0 12px; }
.article-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: .84rem;
  color: var(--muted);
}
.am-icon { font-size: .95rem; }

.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 6px 16px 12px;
  margin: 0 0 26px;
  font-size: .9rem;
}
.toc summary {
  cursor: pointer;
  font-weight: 700;
  padding: 8px 0;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1rem;
}
.toc ol { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 4px; }
.toc a { color: var(--text); }
.toc a:hover { color: var(--accent); }

.content-article { font-size: 1.02rem; }
.content-article h2 {
  margin: 34px 0 12px;
  padding-top: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.content-article h2:first-child { margin-top: 0; }
.content-article h3 { margin: 24px 0 8px; }
.content-article p { margin: 0 0 16px; }
.content-article ul, .content-article ol { margin: 0 0 16px; padding-left: 24px; }
.content-article li { margin-bottom: 6px; }
.content-article strong { color: var(--accent-strong); }

.tip-box, .info-box, .warn-box {
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 18px 0;
  font-size: .95rem;
  line-height: 1.6;
}
.tip-box { background: var(--sage-soft); border-left: 4px solid var(--sage); }
.info-box { background: var(--accent-soft); border-left: 4px solid var(--accent); }
.warn-box { background: var(--amber-soft); border-left: 4px solid var(--amber); }
.tip-box p, .info-box p, .warn-box p { margin: 0 0 8px; }
.tip-box p:last-child, .info-box p:last-child, .warn-box p:last-child { margin: 0; }

.content-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: .92rem;
}
.content-article th {
  text-align: left;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.content-article td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.content-article tr:nth-child(even) td { background: var(--bg-soft); }
.table-responsive { overflow-x: auto; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 14px 0;
  background: var(--card);
}
.faq-item h3 { margin: 0 0 8px; font-size: 1.05rem; }
.faq-item h3::before { content: '❓ '; font-size: .9em; }
.faq-item p { margin: 0; font-size: .95rem; }

.content-article dl { margin: 18px 0; }
.content-article dt {
  font-weight: 700;
  color: var(--accent-strong);
  margin-top: 14px;
  font-size: 1rem;
}
.content-article dd { margin: 4px 0 0 0; font-size: .95rem; color: var(--muted); }
.content-article dd + dt { margin-top: 18px; }

.content-article blockquote {
  margin: 18px 0;
  padding: 4px 18px;
  border-left: 3px solid var(--amber);
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

/* ---------- prev/next ---------- */
.prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 40px;
}
.pn-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.pn-card:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); text-decoration: none; }
.pn-card.next { text-align: right; }
.pn-dir { font-size: .76rem; color: var(--muted); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 4px; }
.pn-title { font-size: .92rem; font-weight: 600; line-height: 1.4; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease-out, transform .5s ease-out; }
.reveal.on { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .home-hero { grid-template-columns: 1fr; }
  .hero-art { grid-column: 1; grid-row: auto; flex-direction: row; justify-content: flex-start; gap: 22px; }
  .breath { width: 200px; height: 200px; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-105%);
    transition: transform .25s ease-out;
    background: var(--bg);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    left: 0;
    width: min(300px, 86vw);
  }
  .sidebar.open { transform: translateX(0); }
  .burger { display: flex; }
  .header-search { max-width: none; }
  .main { margin-left: 0; padding-top: 26px; }
  .app-footer { margin-left: 0; }
  .home-hero h1 { font-size: 2.2rem; }
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  .header-inner { padding: 0 14px; gap: 12px; }
  .mark-text { font-size: 1.1rem; }
  .home-hero { padding-top: 26px; }
  .home-hero h1 { font-size: 1.9rem; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .hero-stats { gap: 16px; }
  .home-grid { grid-template-columns: 1fr; }
  .prevnext { grid-template-columns: 1fr; }
  .article-head h1 { font-size: 1.7rem; }
  .hero-art { flex-direction: column; }
  .main { padding-left: 6px; padding-right: 6px; }
  .content-article { font-size: 1rem; }
}
