/* ==========================================================
   STYLE.CSS — psycholog Edyta
   Mobile-first, responsive, accessible
   ========================================================== */

/* ----------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------- */
:root {
  --bg: #F5F6F0;
  --bg-alt: #EAEEE3;
  --paper: #FBFCF8;
  --ink: #26302B;
  --ink-muted: #5B665E;
  --sage: #6F8871;
  --sage-deep: #4F6653;
  --slate: #7C93A0;
  --line: #DBE1D2;
  --radius: 18px;

  /* Functional aliases */
  --ff-serif: "Fraunces", Georgia, serif;
  --ff-sans: "Public Sans", system-ui, sans-serif;

  /* Fluid spacing */
  --space-xs: clamp(0.5rem, 1vw, 0.75rem);
  --space-sm: clamp(0.75rem, 1.5vw, 1.25rem);
  --space-md: clamp(1.25rem, 3vw, 2rem);
  --space-lg: clamp(2rem, 5vw, 3.5rem);
  --space-xl: clamp(3rem, 7vw, 5rem);
  --space-2xl: clamp(4rem, 9vw, 7rem);

  /* Fluid type */
  --fs-body: clamp(0.938rem, 0.9rem + 0.2vw, 1.063rem);
  --fs-small: clamp(0.813rem, 0.78rem + 0.15vw, 0.875rem);
  --fs-h1: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  --fs-h2: clamp(1.625rem, 1.3rem + 1.5vw, 2.25rem);
  --fs-h3: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --fs-h4: clamp(1.063rem, 1rem + 0.3vw, 1.188rem);
}

/* ----------------------------------------------------------
   2. RESET
   -------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* Respect reduced motion for smooth scroll */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--ff-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ----------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--ff-serif);
  font-weight: 450;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--fs-h1);
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
}

h4 {
  font-size: var(--fs-h4);
}

p+p {
  margin-top: 1em;
}

.eyebrow {
  font-family: var(--ff-sans);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: var(--space-xs);
}

.lead {
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.7;
  color: var(--ink-muted);
}

/* ----------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.section {
  padding-block: var(--space-xl);
}

/* Full-screen sections on mobile */
@media (max-width: 767px) {
  .section {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Hero already has its own padding, just fill the screen */
  .hero {
    min-height: 100svh;
    justify-content: center;
  }
}

.section--alt {
  background-color: var(--bg-alt);
}

.section__header {
  max-width: 600px;
  margin-bottom: var(--space-lg);
}

.section__header p {
  margin-top: var(--space-xs);
  color: var(--ink-muted);
}

/* ----------------------------------------------------------
   5. BUTTONS
   -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--ff-sans);
  font-weight: 600;
  font-size: var(--fs-body);
  padding: 1em 2.25em;
  border-radius: 999px;
  min-height: 52px;
  min-width: 52px;
  transition: background-color 0.25s ease, color 0.25s ease,
    box-shadow 0.25s ease, transform 0.15s ease;
  white-space: nowrap;
}

.btn--primary {
  background-color: var(--sage-deep);
  color: #fff;
}

.btn--primary:hover {
  background-color: var(--sage);
  box-shadow: 0 4px 18px rgba(79, 102, 83, 0.25);
  transform: translateY(-1px);
}

.btn--ghost {
  background-color: transparent;
  color: var(--sage-deep);
  border: 1.5px solid var(--line);
}

.btn--ghost:hover {
  border-color: var(--sage);
  background-color: rgba(111, 136, 113, 0.06);
}

.btn--light {
  background-color: #fff;
  color: var(--sage-deep);
}

.btn--light:hover {
  background-color: var(--bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

/* ----------------------------------------------------------
   6. FOCUS VISIBLE (accessibility)
   -------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ----------------------------------------------------------
   7. HEADER / NAVIGATION
   -------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(251, 252, 248, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.3s ease;
}

/* Shadow appears once the user scrolls away from the top */
.site-header.scrolled {
  box-shadow: 0 4px 24px rgba(38, 48, 43, 0.09);
  border-bottom-color: transparent;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--ff-serif);
  font-size: 1.25rem;
  font-weight: 560;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-logo__img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 50%;
}

/* Responsive logo text — show only one span at a time */
.site-logo__text--full   { display: none; }
.site-logo__text--medium { display: none; }
.site-logo__text--short  { display: inline; }

@media (min-width: 860px) {
  .site-logo__text--short  { display: none; }
  .site-logo__text--medium { display: inline; }
}

@media (min-width: 1200px) {
  .site-logo__text--medium { display: none; }
  .site-logo__text--full   { display: inline; }
}

/* Nav links */
.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
}

.nav-list a {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-muted);
  transition: color 0.2s ease;
  padding: 0.5em 0;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--sage-deep);
}

.nav-list a.active {
  font-weight: 600;
  position: relative;
}

.nav-list a.active::after {
  content: '';
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--sage);
  border-radius: 2px;
  position: absolute;
  bottom: -2px;
  left: 0;
}

/* CTA button in nav should never show the underline */
.nav-list a.active.nav-cta::after {
  display: none;
}

/* Override muted color and padding for CTA button inside nav */
.nav-list .nav-cta.btn--primary {
  color: #fff;
  padding: 0.85em 1.75em;
  /* Przywracamy domyślny, duży padding przycisku */
}

/* Mobile overlay nav — hidden on desktop */
.nav-menu--mobile {
  display: none;
}

/* Hamburger button — hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  position: relative;
  z-index: 110;
}

.hamburger__line {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger__line+.hamburger__line {
  margin-top: 5px;
}

/* Hamburger → X animation when open */
.hamburger[aria-expanded="true"] .hamburger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] .hamburger__line:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] .hamburger__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- MOBILE NAV (< 768px) --- */
@media (max-width: 767px) {
  .hamburger {
    display: flex;
  }

  /* Hide the inline desktop nav */
  .nav-menu--desktop {
    display: none;
  }

  /* Show the mobile overlay nav */
  .nav-menu--mobile {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background-color: var(--paper);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 2rem 2rem;
    overflow-y: auto;

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
  }

  .nav-menu--mobile.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-menu--mobile .nav-list {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    align-items: center;
  }

  .nav-menu--mobile .nav-list a {
    font-size: 1.25rem;
    padding: 0.75em 1em;
    display: block;
    text-align: center;
  }

  /* Active link in mobile menu */
  .nav-menu--mobile .nav-list a.active {
    color: var(--sage-deep);
    font-weight: 600;
  }

  /* Ensure CTA button has readable text on mobile menu */
  .nav-menu--mobile .nav-cta.btn--primary {
    margin-top: 1.5rem;
    color: #fff;
    font-size: 1rem;
    padding: 1em 2.5em;
  }

  /* Prevent body scroll when menu is open */
  body.nav-open {
    overflow: hidden;
  }
}

/* ----------------------------------------------------------
   8. HERO
   -------------------------------------------------------- */
.hero {
  padding-block: var(--space-xl) var(--space-2xl);
}

@media (min-width: 768px) {
  .hero {
    padding-block-end: var(--space-lg);
  }
}

/* Mobile: flex column — title → image → body (natural order) */
.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.hero__title h1 {
  margin-bottom: 0;
  font-weight: 300;
}

.hero__visual {
  width: 100%;
  max-width: 320px;
}

.hero__body .lead {
  margin-bottom: var(--space-md);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
}

.hero__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  object-fit: cover;
}

/* Desktop: CSS grid — left col (title + body), right col (image) */
@media (min-width: 768px) {
  .hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "title  visual"
      "body   visual";
    column-gap: var(--space-xl);
    row-gap: var(--space-sm);
    align-items: start;
    text-align: left;
  }

  .hero__title  { grid-area: title; align-self: end; }
  .hero__visual { grid-area: visual; align-self: center; width: 100%; max-width: none; }
  .hero__body   { grid-area: body; align-self: start; }

  .hero__actions {
    justify-content: flex-start;
  }
}

/* ----------------------------------------------------------
   9. ABOUT (O mnie)
   -------------------------------------------------------- */
.about .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.about__avatar {
  flex-shrink: 0;
}

.about__photo {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(38, 48, 43, 0.08);
}

.about__text {
  max-width: 600px;
  color: var(--ink-muted);
  line-height: 1.75;
}

@media (min-width: 768px) {
  .about .container {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
  }
}

.about__extra,
.about .container.about__extra {
  margin-top: var(--space-xl);
  display: flex;
  flex-direction: column !important;
  align-items: stretch;
}

/* 3 numbered cards in about section */
.about-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .about-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.about-card {
  background-color: var(--paper);
  border-radius: var(--radius);
  padding: var(--space-md);
  border: 1px solid var(--line);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.about-card:hover {
  box-shadow: 0 6px 24px rgba(38, 48, 43, 0.06);
  transform: translateY(-2px);
}

.about-card__number {
  display: block;
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 300;
  font-size: var(--fs-h3);
  color: var(--sage);
  opacity: 0.6;
  margin-bottom: var(--space-xs);
}

.about-card h3 {
  font-size: var(--fs-h4);
  margin-bottom: var(--space-xs);
}

.about-card p {
  color: var(--ink-muted);
  font-size: var(--fs-body);
  line-height: 1.65;
}

/* Quote below the cards */
.about-quote {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--line);
  text-align: center;
}

.about-quote p {
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.5rem);
  color: var(--sage-deep);
  line-height: 1.5;
  max-width: 680px;
  margin-inline: auto;
}

/* ----------------------------------------------------------
   10. FOR WHOM (Dla kogo) — card grid
   -------------------------------------------------------- */
.cards-duo {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.card {
  background-color: var(--paper);
  border-radius: var(--radius);
  padding: var(--space-md);
  border: 1px solid var(--line);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: 0 6px 24px rgba(38, 48, 43, 0.06);
  transform: translateY(-2px);
}

.card__label {
  font-family: var(--ff-sans);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--sage);
  margin-bottom: 0.25rem;
}

.card h3 {
  margin-bottom: var(--space-xs);
}

.card p {
  color: var(--ink-muted);
  font-size: var(--fs-body);
  line-height: 1.65;
}

@media (min-width: 768px) {
  .cards-duo {
    grid-template-columns: 1fr 1fr;
  }
}

/* ----------------------------------------------------------
   11. AREAS (Obszary pomocy) — icon grid
   -------------------------------------------------------- */
.areas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.area-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background-color: var(--paper);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--line);
  transition: box-shadow 0.3s ease;
}

.area-item:hover {
  box-shadow: 0 4px 16px rgba(38, 48, 43, 0.05);
}

.area-item__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background-color: var(--bg-alt);
  color: var(--sage);
}

.area-item__icon svg {
  width: 20px;
  height: 20px;
}

.area-item span {
  font-weight: 500;
}

@media (min-width: 768px) {
  .areas-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ----------------------------------------------------------
   12. PROCESS (Jak wygląda współpraca) — steps
   -------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  counter-reset: step;
}

.step {
  background-color: var(--paper);
  border-radius: var(--radius);
  padding: var(--space-md);
  border: 1px solid var(--line);
}

.step__number {
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 300;
  font-size: var(--fs-h2);
  color: var(--sage);
  opacity: 0.6;
  margin-bottom: var(--space-xs);
  display: block;
}

.step h3 {
  margin-bottom: var(--space-xs);
}

.step p {
  color: var(--ink-muted);
  line-height: 1.65;
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ----------------------------------------------------------
   13. CONTACT — dark panel
   -------------------------------------------------------- */
.contact-panel {
  background-color: var(--sage-deep);
  border-radius: var(--radius);
  color: #fff;
  padding: var(--space-lg);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .contact-panel {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.contact-panel h2 {
  color: #fff;
}

.contact-panel .lead {
  color: rgba(255, 255, 255, 0.75);
}

.contact-info {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.contact-info__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-body);
}

.contact-info__item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.contact-info__item a {
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  transition: border-color 0.2s ease;
  padding-bottom: 1px;
}

.contact-info__item a:hover {
  border-color: #fff;
}


/* Contact form */
.contact-form {
  margin-top: 0;
}

.form-group {
  margin-bottom: var(--space-sm);
}

.form-group label {
  display: block;
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.4em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.85em 1.1em;
  font-family: var(--ff-sans);
  font-size: 1rem;
  border: none;
  border-radius: 12px;
  background-color: #fff;
  color: var(--ink);
  transition: box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--ink-muted);
  opacity: 0.6;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(111, 136, 113, 0.45);
}

.form-group textarea {
  resize: vertical;
  min-height: 130px;
}

.contact-form .btn {
  margin-top: var(--space-xs);
  width: 100%;
  justify-content: center;
}


/* ----------------------------------------------------------
   14. FOOTER
   -------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-md);
  text-align: center;
}

.site-footer p {
  font-size: var(--fs-small);
  color: var(--ink-muted);
}

/* ----------------------------------------------------------
   15. SCROLL REVEAL
   -------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Skip animations entirely for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ----------------------------------------------------------
   16. UTILITY
   -------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ensure no horizontal overflow — clip preserves sticky positioning */
html,
body {
  overflow-x: clip;
}

/* ----------------------------------------------------------
   17. RESPONSIVE PATCHES
   Three extra breakpoints on top of the 720px base:
   ① ≤ 479px  — small phones (iPhone SE, Galaxy A-series small)
   ② 480–719px — large phones / small tablets (iPhone Plus, Galaxy S)
   ③ ≥ 900px  — wide tablets & desktop (iPad, Galaxy Tab)
   -------------------------------------------------------- */

/* ① Small phones ----------------------------------------- */
@media (max-width: 479px) {

  /* Shrink logo so it never wraps or overflows */
  .site-logo {
    font-size: 1rem;
    max-width: calc(100% - 56px);
    /* leave room for hamburger */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Stack hero buttons vertically so they don't squeeze */
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Tighter section padding */
  .section {
    padding-block: var(--space-lg);
  }

  /* Contact panel: less padding */
  .contact-panel {
    padding: var(--space-md);
  }

  /* Form inputs: larger touch targets */
  .form-group input,
  .form-group textarea {
    padding: 0.9em 1em;
    font-size: 1rem;
    /* prevent iOS zoom on focus */
  }
}

/* ② Large phones (480–767px) ---------------------------- */
@media (min-width: 480px) and (max-width: 767px) {

  /* Areas: 2-col on larger phones */
  .areas-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Cards: side by side */
  .cards-duo {
    grid-template-columns: 1fr 1fr;
  }

  /* Prevent iOS zoom: keep font-size ≥ 16px on inputs */
  .form-group input,
  .form-group textarea {
    font-size: 1rem;
  }
}

/* ③ Wide tablets & desktop (≥ 900px) --------------------- */
@media (min-width: 900px) {

  /* Areas: 4-col on wide screens */
  .areas-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Logo: restore full size */
  .site-logo {
    font-size: 1.35rem;
  }
}