/* ═══════════════════════════════════════════════════
   maciejzak.com – Personal Website
   Style: Modio Studio inspired, minimalist, elegant
   ═══════════════════════════════════════════════════ */

/* ─── Reset & Base ─── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-light: #6b6b6b;
  --color-text-muted: #999999;
  --color-border: #e8e8e8;
  --color-border-dark: #d0d0d0;
  --color-accent: #1a1a1a;
  --color-surface: #f7f7f7;
  --color-dark: #111111;
  --color-dark-text: #ffffff;

  --sidebar-width: 240px;
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-weight: 300;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

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

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

strong {
  font-weight: 500;
}

::selection {
  background: var(--color-text);
  color: var(--color-bg);
}

/* ─── Sidebar ─── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 32px;
  border-right: 1px solid var(--color-border);
  background: var(--color-bg);
  z-index: 100;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 48px;
}

.logo-icon {
  font-size: 16px;
  opacity: 0.7;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--color-text-light);
  transition: color 0.3s var(--ease-smooth);
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 1px;
  background: var(--color-text);
  transition: width 0.4s var(--ease-out);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
}

.nav-link.active::before {
  width: 20px;
}

.nav-counter {
  font-size: 10px;
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.sidebar__bottom {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar__cta-label {
  font-size: 11px;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.sidebar__cta-link {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--color-text);
  transition: opacity 0.3s;
}

.sidebar__cta-link:hover {
  opacity: 0.6;
}

.sidebar__social {
  display: flex;
  gap: 16px;
}

.sidebar__social a {
  color: var(--color-text-light);
  transition: color 0.3s;
}

.sidebar__social a:hover {
  color: var(--color-text);
}

.sidebar__copyright {
  font-size: 10px;
  color: var(--color-text-muted);
  line-height: 1.6;
  letter-spacing: 0.02em;
}

/* ─── Mobile Header ─── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 0 24px;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  z-index: 200;
}

.menu-toggle {
  position: relative;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.menu-toggle span {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--color-text);
  transition: all 0.3s var(--ease-smooth);
}

.menu-toggle span:first-child { top: 4px; }
.menu-toggle span:last-child { bottom: 4px; }

.menu-toggle.open span:first-child {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.open span:last-child {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* ─── Main Content ─── */
.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ─── Top Bar ─── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 48px;
  border-bottom: 1px solid var(--color-border);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Sections ─── */
.section {
  padding: 80px 48px;
  border-bottom: 1px solid var(--color-border);
}

.section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 56px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.section__label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.section__title-right {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ─── Hero ─── */
.section--hero {
  padding: 100px 48px 80px;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
}

.hero__content {
  flex: 1;
  min-width: 0;
}

.hero__photo {
  flex-shrink: 0;
  width: 320px;
}

.hero__photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: grayscale(0%);
  transition: filter 0.5s var(--ease-smooth);
}

.hero__photo img:hover {
  filter: grayscale(100%);
}

.hero__title {
  font-size: 32px;
  font-weight: 300;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}

.hero__title-accent {
  display: block;
  font-size: 18px;
  font-weight: 300;
  color: var(--color-text-light);
  margin-top: 12px;
  line-height: 1.5;
}

.hero__subtitle {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--color-text-light);
  margin-bottom: 40px;
}

.hero__cta {
  display: inline-block;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--color-text);
  transition: opacity 0.3s;
}

.hero__cta:hover {
  opacity: 0.6;
}

/* ─── Expertise ─── */
.expertise__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
}

.expertise__card {
  background: var(--color-bg);
  padding: 40px 32px;
  transition: background 0.4s var(--ease-smooth);
}

.expertise__card:hover {
  background: var(--color-surface);
}

.expertise__card-num {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.expertise__card-title {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  margin-bottom: 24px;
  letter-spacing: -0.005em;
}

.expertise__card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.expertise__card-list li {
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-text-light);
  padding-left: 16px;
  position: relative;
}

.expertise__card-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-text-muted);
}

/* ─── Clients ─── */
.clients__intro {
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text-light);
  max-width: 640px;
  margin-bottom: 48px;
}

.clients__list {
  display: flex;
  flex-direction: column;
}

.clients__item {
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.4s var(--ease-smooth);
}

.clients__item:last-child {
  border-bottom: 1px solid var(--color-border);
}

.clients__item:hover {
  background: var(--color-surface);
  padding-left: 24px;
  padding-right: 24px;
  margin-left: -24px;
  margin-right: -24px;
}

.clients__item-header {
  display: flex;
  align-items: flex-start;
}

.clients__item-title-box {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.005em;
  text-transform: none;
  padding: 0;
  padding-left: 16px;
  border: none;
  border-left: 2px solid var(--color-text);
  border-radius: 0;
  color: var(--color-text);
  margin: 0;
  line-height: 1.4;
}

.clients__item-desc {
  font-size: 13px;
  line-height: 1.75;
  color: var(--color-text-light);
}

/* ─── Evidence ─── */
.evidence__subtitle {
  font-size: 13px;
  font-style: italic;
  color: var(--color-text-muted);
  margin-bottom: 40px;
  font-weight: 300;
}

.evidence__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
}

.evidence__card {
  background: var(--color-bg);
  transition: background 0.4s var(--ease-smooth);
}

.evidence__card:hover {
  background: var(--color-surface);
}

.evidence__card-inner {
  padding: 40px 36px;
}

.evidence__card-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--color-border-dark);
  border-radius: 3px;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.evidence__card-title {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.evidence__card-desc {
  font-size: 13px;
  line-height: 1.75;
  color: var(--color-text-light);
}

/* ─── Experience / Track Record ─── */
.section--experience {
  background: var(--color-dark);
  color: var(--color-dark-text);
  border-bottom: none;
}

.section__header--dark {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.section__header--dark .section__label,
.section__header--dark .section__title-right {
  color: rgba(255, 255, 255, 0.45);
}

.experience__intro {
  margin-bottom: 56px;
}

.experience__intro-text {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.7);
}

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline__item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding: 36px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.4s var(--ease-smooth);
}

.timeline__item:hover {
  background: rgba(255, 255, 255, 0.03);
  padding-left: 24px;
  padding-right: 24px;
  margin-left: -24px;
  margin-right: -24px;
}

.timeline__date {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.4);
  padding-top: 3px;
}

.timeline__role {
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 4px;
}

.timeline__company {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 16px;
  font-weight: 400;
}

.timeline__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline__list li {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.6);
  padding-left: 16px;
  position: relative;
}

.timeline__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

/* ─── Contact ─── */
.section--contact {
  padding-bottom: 0;
  background: var(--color-surface);
  border-bottom: none;
}

.contact__wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
  padding-bottom: 60px;
}

.contact__info-lead {
  font-size: 24px;
  font-weight: 300;
  line-height: 1.45;
  margin-bottom: 48px;
  letter-spacing: -0.01em;
}

.contact__details {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact__detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: opacity 0.3s;
}

.contact__detail:hover {
  opacity: 0.6;
}

.contact__detail-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.contact__detail-value {
  font-size: 15px;
  font-weight: 400;
}

/* ─── Form ─── */
.contact__form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form__label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.form__input {
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 300;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.3s var(--ease-smooth);
  letter-spacing: 0.01em;
}

.form__input:focus {
  border-bottom-color: var(--color-text);
}

.form__textarea {
  resize: vertical;
  min-height: 100px;
  border: 1px solid var(--color-border);
  padding: 12px 16px;
  border-radius: 0;
}

.form__textarea:focus {
  border-color: var(--color-text);
}

.form__submit {
  align-self: flex-start;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.03em;
  padding: 14px 36px;
  background: var(--color-text);
  color: var(--color-bg);
  border: 1px solid var(--color-text);
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
}

.form__submit:hover {
  background: transparent;
  color: var(--color-text);
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 20px 48px;
}

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

.footer__copy,
.footer__credit {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════
   ANIMATIONS (fade-in on scroll)
   ═══════════════════════════════════════════ */

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger children */
.fade-in-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.fade-in-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.fade-in-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.fade-in-stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.fade-in-stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.fade-in-stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 1100px) {
  .hero__photo {
    width: 260px;
    max-width: 260px;
  }

  .expertise__grid {
    grid-template-columns: 1fr;
  }

  .evidence__grid {
    grid-template-columns: 1fr;
  }

  .contact__wrapper {
    grid-template-columns: 1fr;
    gap: 48px;
  }


  .timeline__item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    transition: left 0.4s var(--ease-out);
    z-index: 300;
    border-right: 1px solid var(--color-border);
  }

  .sidebar.open {
    left: 0;
  }

  .mobile-header {
    display: flex;
  }

  .main {
    margin-left: 0;
    padding-top: 60px;
  }

  .topbar {
    padding: 16px 24px;
  }

  .section {
    padding: 56px 24px;
  }

  .section--hero {
    padding: 60px 24px 56px;
    min-height: auto;
    flex-direction: column;
  }

  .hero__photo {
    width: 100%;
    max-width: 280px;
    order: -1;
  }

  .hero__title {
    font-size: 24px;
  }


  .hero__title-accent {
    font-size: 15px;
  }

  .hero__subtitle {
    font-size: 14px;
  }

  .section__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .experience__intro-text {
    font-size: 18px;
  }

  .contact__info-lead {
    font-size: 18px;
  }

  .footer {
    padding: 16px 24px;
  }

  .footer__inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ─── Sidebar overlay (mobile) ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 250;
  opacity: 0;
  transition: opacity 0.4s var(--ease-smooth);
}

.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}
