/* ============================================================= */
/*  Smart Drifty — sections.css                                   */
/*  Header · Hero · Services · How it works                       */
/* ============================================================= */

/* ---------------- HEADER ---------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), backdrop-filter var(--dur) var(--ease);
}
.site-header.scrolled {
  background: rgba(228, 228, 226, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.main-nav { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 0.4rem; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 0.96rem;
  color: var(--text-heading);
  background: none;
  border: none;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-link:hover { color: var(--brand-blue); background: rgba(108, 126, 155, 0.10); }
.nav-link .chev { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.has-dropdown { position: relative; }
.has-dropdown.open .dropdown-toggle .chev { transform: rotate(180deg); }
.has-dropdown.open .dropdown-toggle { color: var(--brand-blue); }

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 290px;
  background: var(--card-light);
  border: 1px solid var(--card-light-border);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
}
.has-dropdown.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.7rem;
  border-radius: 14px;
  transition: background var(--dur) var(--ease);
}
.dropdown a:hover { background: var(--bg-soft); }
.dropdown .dd-ic {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border-radius: 12px;
  background: var(--cream);
  color: var(--charcoal);
}
.dropdown .dd-ic svg { width: 21px; height: 21px; }
.dropdown a strong { display: block; font-family: var(--font-heading); font-weight: 600; color: var(--text-heading); font-size: 0.96rem; }
.dropdown a small { color: var(--text-muted); font-size: 0.8rem; }

.header-cta { padding-block: 0.7em; }
.hamburger {
  display: none;
  width: 46px; height: 46px;
  border: none; background: transparent;
  color: var(--text-heading);
  border-radius: 12px;
}
.hamburger svg { width: 26px; height: 26px; }

/* ---------------- MOBILE MENU ---------------- */
.mobile-menu {
  position: fixed; inset: 0;
  z-index: 200;
  background: rgba(40, 40, 45, 0.4);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.mobile-menu.open { opacity: 1; }
.mobile-menu-panel {
  position: absolute;
  top: 0; right: 0;
  width: min(85vw, 340px);
  height: 100%;
  background: var(--bg-page);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transform: translateX(100%);
  transition: transform var(--dur) var(--ease);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
}
.mobile-menu.open .mobile-menu-panel { transform: translateX(0); }
.mobile-menu-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.mobile-menu nav { display: flex; flex-direction: column; }
.mm-link {
  display: block;
  padding: 0.95rem 0.6rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-heading);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}
.mm-link:hover { color: var(--brand-blue); }
.mm-cta { margin-top: 1.2rem; }

/* ---------------- HERO ---------------- */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(0.25rem, 2vw, 1.25rem));
  padding-bottom: clamp(1.25rem, 1rem + 2.5vw, 3rem);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.hero-copy h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  margin-bottom: 1.3rem;
}
.hero-lead {
  font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.2rem);
  max-width: 30rem;
  margin-bottom: 1.9rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
}
/* Hero animation: the source green screen was keyed out and baked onto the page
   gray (--bg-page), so the clip needs no frame — it melts into the page like an
   animated backdrop. Height-driven sizing keeps the 9:16 phone clip balanced
   next to the copy; the matching gray makes any surrounding space seamless. */
.hero-media {
  position: relative;
  height: clamp(583px, 88vh, 972px);
  aspect-ratio: 9 / 16;
  width: auto;
  margin-inline: auto;
  background: var(--bg-page);
}
.hero-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* hero -> services stitch */
.hero-stitch {
  position: relative;
  margin-top: clamp(1rem, 3vw, 2.5rem);
  height: 120px;
}
.stitch-wave { width: 100%; height: 120px; }
.stitch-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  display: grid; place-items: center;
  background: var(--cream);
  border-radius: 50%;
  box-shadow: var(--shadow-card);
}
.stitch-badge img { width: 42px; height: auto; }

/* ---------------- SERVICES (organic cards -> service modal) ---------------- */
.services { padding-block: clamp(0.5rem, 1vw, 1.2rem) var(--space-section); }

.svc-layout { display: block; }
.svc-head .section-title { margin-bottom: clamp(1.6rem, 4vw, 2.2rem); }

/* Mobile-first: cards stack vertically, centered (big gap absorbs the rotation) */
.svc-stage { display: flex; flex-direction: column; align-items: center; gap: clamp(2.6rem, 8vw, 3.4rem); }
.svc-lines { display: none; }
.svc-slot { width: min(100%, 360px); }

/* Card = real <button> with an organic blob shape; no default button chrome.
   The shape rotates; .svc-inner counter-rotates so the text stays level. */
.svc-card {
  position: relative;
  width: 100%;
  padding: clamp(1.9rem, 4vw, 2.5rem);
  border: none;
  text-align: left;
  color: #fff;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.svc-inner { display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; min-height: 300px; }
.svc-01 .svc-inner, .svc-04 .svc-inner { min-height: 320px; }

.svc-01 { border-radius: 40px 60px 40px 100px; transform: rotate(-3deg); background: #4A4A4A; box-shadow: 0 12px 26px rgba(0, 0, 0, .18); }
.svc-02 { border-radius: 40px 80px 100px 40px; transform: rotate(2deg);  background: #7983A8; box-shadow: 0 12px 26px rgba(0, 0, 0, .18); }
.svc-03 { border-radius: 40px 60px 100px 40px; transform: rotate(-1deg); background: #FDFCE6; color: var(--text-heading); box-shadow: 0 12px 26px rgba(0, 0, 0, .10); }
.svc-04 { border-radius: 80px 40px 40px 100px; transform: rotate(1deg);  background: #EAEBEE; color: var(--text-heading); border: 2px solid #fff; box-shadow: 0 0 20px rgba(255, 255, 255, .55), 0 12px 22px rgba(0, 0, 0, .06); }
.svc-01 .svc-inner { transform: rotate(3deg); }
.svc-02 .svc-inner { transform: rotate(-2deg); }
.svc-03 .svc-inner { transform: rotate(1deg); }
.svc-04 .svc-inner { transform: rotate(-1deg); }

.svc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.svc-num { font-family: var(--font-heading); font-weight: 300; font-size: 3rem; line-height: 1; }
.svc-01 .svc-num, .svc-02 .svc-num { opacity: .8; }
.svc-03 .svc-num, .svc-04 .svc-num { color: #9CA3AF; }
.svc-ic { flex: none; }
.svc-ic svg { width: 40px; height: 40px; display: block; }
.svc-01 .svc-ic, .svc-02 .svc-ic { opacity: .8; }
.svc-03 .svc-ic, .svc-04 .svc-ic { color: #4B5563; }
.svc-text { display: flex; flex-direction: column; }
.svc-title { font-family: var(--font-heading); font-weight: 600; font-size: 1.5rem; line-height: 1.15; margin-bottom: 1rem; }
.svc-desc { font-size: .9rem; line-height: 1.6; margin-bottom: 1.8rem; }
.svc-01 .svc-desc { color: #E5E7EB; }
.svc-02 .svc-desc { color: #F3F4F6; }
/* Kafelek 02 ma duże prawe zaokrąglenia + kontrobrót, przez które prawe końce
   linii wychodziły poza kolorowe pole na tło strony (jasny tekst znikał).
   Wciągamy sam blok tekstu w lewo, by mieścił się w całości. Kształt i ikona bez zmian. */
.svc-02 .svc-text { padding-right: 1.4rem; }
.svc-03 .svc-desc, .svc-04 .svc-desc { color: #4B5563; }
.svc-link { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-heading); font-weight: 600; font-size: .9rem; }
.svc-link .svc-arrow { width: 1rem; height: 1rem; display: block; flex: none; }
.svc-04 .svc-link { color: #7983A8; }

/* hover / keyboard focus: subtle lift that preserves each card's own rotation */
.svc-01:hover, .svc-01:focus-visible { transform: rotate(-3deg) scale(1.03); }
.svc-02:hover, .svc-02:focus-visible { transform: rotate(2deg)  scale(1.03); }
.svc-03:hover, .svc-03:focus-visible { transform: rotate(-1deg) scale(1.03); }
.svc-04:hover, .svc-04:focus-visible { transform: rotate(1deg)  scale(1.03); }
.svc-card:hover .svc-link, .svc-card:focus-visible .svc-link { text-decoration: underline; text-underline-offset: 4px; }

/* ---- Desktop: scattered, connected layout (matches the visualisation) ----
   Cards live in a fixed 1010x700 stage scaled to fit the column, so the exact
   composition holds at every desktop width without clipping. */
@media (min-width: 1024px) {
  .svc-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem; align-items: start; --svc-scale: .62; }
  .svc-head { padding-top: 0; margin-top: -1rem; }
  .svc-head .section-title { margin-bottom: 0; }

  .svc-stagebox { position: relative; height: calc(700px * var(--svc-scale)); }
  .svc-stage {
    display: block;
    position: absolute; top: 0; left: 0;
    width: 1010px; height: 700px;
    transform-origin: top left;
    transform: scale(var(--svc-scale));
  }
  .svc-lines { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

  .svc-slot { position: absolute; width: auto; }
  .svc-slot-01 { left: 0;     top: 50px;  width: 340px; z-index: 20; }
  .svc-slot-02 { left: 350px; top: -20px; width: 360px; z-index: 10; }
  .svc-slot-03 { left: 300px; top: 300px; width: 340px; z-index: 30; }
  .svc-slot-04 { left: 655px; top: 160px; width: 350px; z-index: 20; }
}
@media (min-width: 1140px) { .svc-layout { --svc-scale: .72; } }
@media (min-width: 1260px) { .svc-layout { --svc-scale: .82; } }
@media (min-width: 1400px) { .svc-layout { --svc-scale: .88; } }

@media (prefers-reduced-motion: reduce) {
  .svc-01:hover, .svc-01:focus-visible { transform: rotate(-3deg); }
  .svc-02:hover, .svc-02:focus-visible { transform: rotate(2deg); }
  .svc-03:hover, .svc-03:focus-visible { transform: rotate(-1deg); }
  .svc-04:hover, .svc-04:focus-visible { transform: rotate(1deg); }
}

/* ---------------- HOW IT WORKS ---------------- */
.how { padding-block: var(--space-section); }
.how .section-title { text-align: left; margin-bottom: clamp(2.5rem, 4vw, 4rem); }

.steps-wrap { position: relative; }
/* dashed connector running behind the icon circles (desktop / tablet only) */
.steps-line {
  display: none;
  position: absolute;
  top: 56px;
  left: 10%;
  right: 10%;
  border-top: 1.5px dashed #CBD0D8;
  z-index: 0;
}

/* Mobile-first: one column; cards stack with their full descriptions */
.steps {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  text-align: center;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.step-icon {
  width: 112px; height: 112px;
  display: grid; place-items: center;
  background: #FCFCEB;
  border-radius: 50%;
  color: #374151;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}
.step-icon svg { width: 40px; height: 40px; }
.step-num { font-family: var(--font-heading); font-weight: 500; font-size: 1.25rem; color: var(--text-heading); margin-bottom: 0.5rem; }
.step-title { font-size: 1.125rem; font-weight: 600; color: var(--text-heading); margin-bottom: 0.75rem; }
.step-desc { font-size: 0.875rem; line-height: 1.6; color: #4B5563; max-width: 250px; }

@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
  .steps-line { display: block; }
}
