/* ════════════════════════════════════════════════════════════════
   MAŁGORZATA ZAJĄC — Personal Site
   Design system: Swiss editorial + warm humanity
   ════════════════════════════════════════════════════════════════ */

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

/* ── Design Tokens ── */
:root {
  --ink: #1a1a1a;
  --ink-light: #3d3831;
  --paper: #f6f1eb;
  --paper-deep: #ece5db;
  --warm: #b85c38;
  --warm-light: #d4845f;
  --warm-pale: rgba(184, 92, 56, .07);
  --muted: #918579;
  --rule: #d6cdc2;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Spacing scale */
  --space-xs: .5rem;
  --space-s: 1rem;
  --space-m: 2rem;
  --space-l: 3.5rem;
  --space-xl: 6rem;

  /* Layout */
  --page-px: clamp(1.5rem, 5vw, 6rem);
  --section-py: clamp(5rem, 12vh, 9rem);
  --col-max: 1080px;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--warm);
  color: var(--paper);
}

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

/* ── Centered container — every section uses this ── */
.container {
  max-width: var(--col-max);
  margin: 0 auto;
  width: 100%;
}

/* ── The Thread — progress on left edge ── */
.thread {
  position: fixed;
  left: calc(var(--page-px) + 2px);
  top: 0;
  width: 1px;
  height: 100vh;
  background: var(--rule);
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity .8s ease;
}
.thread.visible { opacity: 1; }
.thread-progress {
  width: 100%;
  background: var(--warm);
  height: 0%;
  transition: height .1s linear;
}

/* ════════════════════════════════════════
   LOADER
   ════════════════════════════════════════ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-m);
}
#loader.fade-out {
  animation: loaderFade 1.2s cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes loaderFade {
  0% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; pointer-events: none; }
}

.loader-text {
  font-family: var(--sans);
  font-size: clamp(1.4rem, 3.5vw, 2.6rem);
  font-weight: 300;
  letter-spacing: .3em;
  color: var(--ink);
  white-space: nowrap;
  border-right: 1.5px solid var(--ink);
  animation: cursorBlink .65s step-end infinite alternate;
  transition: opacity .6s ease;
}
.loader-text.hide {
  opacity: 0;
}
@keyframes cursorBlink { 50% { border-color: transparent; } }

.loader-rule {
  width: 0;
  height: 1px;
  background: var(--warm);
  animation: ruleExpand 1.6s cubic-bezier(.4, 0, .2, 1) .6s forwards;
  transition: opacity .6s ease;
}
.loader-rule.hide {
  opacity: 0;
}
@keyframes ruleExpand { to { width: min(280px, 50vw); } }

/* ════════════════════════════════════════
   NAVIGATION
   ════════════════════════════════════════ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--page-px);
  height: 56px;
  background: rgba(246, 241, 235, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  transform: translateY(-100%);
  transition: transform .45s cubic-bezier(.4, 0, .2, 1);
}
#nav.visible { transform: translateY(0); }

.nav-mark {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: .08em;
  color: var(--ink);
}

.nav-items {
  display: flex;
  gap: 2.4rem;
  list-style: none;
}
.nav-items a {
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .3s ease;
}
.nav-items a:hover { color: var(--ink); }

/* ════════════════════════════════════════
   HERO
   ════════════════════════════════════════ */
#hero {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 0 var(--page-px);
  position: relative;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--col-max);
  margin: 0 auto;
  width: 100%;
  padding-top: 8vh;
}

.hero-label {
  font-size: .75rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--warm);
  margin-bottom: var(--space-m);
  display: flex;
  align-items: center;
  gap: var(--space-s);
}
.hero-label::before {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--warm);
}

.hero-name {
  font-family: var(--serif);
  font-size: clamp(3rem, 8.5vw, 7.5rem);
  font-weight: 400;
  line-height: .95;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: var(--space-m);
  position: relative;
}
.hero-name .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
}

.hero-headline {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 300;
  line-height: 1.65;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: var(--space-l);
}
.hero-headline strong {
  color: var(--ink);
  font-weight: 500;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-size: .78rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--warm);
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--warm);
  transition: gap .3s ease, color .3s ease;
  width: fit-content;
}
.hero-cta:hover { gap: 1.2rem; }
.hero-cta svg { transition: transform .3s ease; }
.hero-cta:hover svg { transform: translateX(3px); }

.hero-bottom {
  max-width: var(--col-max);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: var(--space-m);
  border-top: 1px solid var(--rule);
  padding-top: var(--space-m);
}

.hero-meta {
  display: flex;
  gap: var(--space-l);
}
.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.hero-meta-label {
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-meta-value {
  font-size: .95rem;
  color: var(--ink);
}

.hero-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}
.hero-scroll-text {
  font-size: .65rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  writing-mode: vertical-rl;
}
.hero-scroll-line {
  width: 1px;
  height: 48px;
  position: relative;
  overflow: hidden;
  background: var(--rule);
}
.hero-scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--warm);
  animation: scrollDown 2s ease-in-out infinite;
}
@keyframes scrollDown {
  0% { top: -100%; }
  100% { top: 100%; }
}

/* ════════════════════════════════════════
   SECTION COMMON
   ════════════════════════════════════════ */
.section {
  padding: var(--section-py) var(--page-px);
  position: relative;
}

.section-header {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--space-s);
  align-items: start;
  margin-bottom: var(--space-l);
}

.section-num {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  line-height: .85;
  color: var(--muted);
  font-weight: 400;
  user-select: none;
}

.section-label {
  font-size: .72rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--warm);
  margin-bottom: .5rem;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--ink);
  max-width: 520px;
}

/* ── Section divider ── */
.divider {
  max-width: var(--col-max);
  margin: 0 auto;
  height: 1px;
  background: var(--rule);
}

/* ════════════════════════════════════════
   STORY
   ════════════════════════════════════════ */
.story-body {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0;
}

.story-text {
  padding-right: clamp(2rem, 4vw, 3.5rem);
}
.story-text p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink-light);
  margin-bottom: 1.5rem;
}
.story-text p:last-child { margin-bottom: 0; }
.story-text strong {
  color: var(--ink);
  font-weight: 600;
}

.story-rule {
  width: 1px;
  background: var(--rule);
  align-self: stretch;
}

.story-journey {
  padding-left: clamp(2rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.journey-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: var(--space-s);
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--rule);
  transition: padding-left .35s cubic-bezier(.4, 0, .2, 1);
  cursor: default;
}
.journey-item:last-child { border-bottom: none; }
.journey-item:hover { padding-left: .8rem; }

.journey-num {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--warm);
  line-height: 1;
  padding-top: .1rem;
}

.journey-label {
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .15rem;
}
.journey-sub {
  font-size: .85rem;
  color: var(--muted);
}

/* ════════════════════════════════════════
   CAPABILITIES
   ════════════════════════════════════════ */
.cap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.cap-cell {
  padding: clamp(1.8rem, 3vw, 2.8rem);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
  transition: background .4s ease;
}
.cap-cell:hover {
  background: var(--warm-pale);
}
.cap-cell::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--warm);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}
.cap-cell:hover::after {
  width: 100%;
}

.cap-num {
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
  line-height: 1;
  transition: color .4s ease;
}
.cap-cell:hover .cap-num { color: var(--warm-light); }

.cap-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: .6rem;
  color: var(--ink);
}

.cap-desc {
  font-size: .92rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

.cap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.cap-tag {
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--warm);
  padding: .25rem 0;
  border-bottom: 1px solid rgba(184, 92, 56, .2);
}

/* ════════════════════════════════════════
   EXPERIENCE / TIMELINE
   ════════════════════════════════════════ */
.tl-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding: 2rem 0;
  border-bottom: 1px solid var(--rule);
  transition: background .3s ease;
  position: relative;
}
.tl-item:first-child {
  border-top: 1px solid var(--rule);
}
.tl-item:hover {
  background: var(--warm-pale);
  padding-left: 1.2rem;
  padding-right: 1.2rem;
  margin-left: -1.2rem;
  margin-right: -1.2rem;
}

.tl-year {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--warm);
  padding-top: .15rem;
}

.tl-role {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .2rem;
}

.tl-company {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: .75rem;
}

.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.tl-tag {
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .35rem .85rem;
  border: 1px solid var(--rule);
  color: var(--ink-light);
  transition: border-color .3s ease, color .3s ease;
}
.tl-item:hover .tl-tag {
  border-color: rgba(184, 92, 56, .3);
  color: var(--warm);
}

/* ════════════════════════════════════════
   SKILLS
   ════════════════════════════════════════ */
.skills-body {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0;
}

.skills-col:first-child { padding-right: clamp(2rem, 4vw, 3.5rem); }
.skills-col:last-child { padding-left: clamp(2rem, 4vw, 3.5rem); }

.skills-rule {
  width: 1px;
  background: var(--rule);
}

.skill-group-label {
  font-size: .72rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--warm);
  margin-bottom: var(--space-m);
  padding-bottom: var(--space-s);
  border-bottom: 1px solid var(--rule);
}

/* ── Skill rows ── */
.skill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.skill-row:last-child { border-bottom: none; }

.skill-name {
  font-size: .95rem;
  color: var(--ink);
}

.skill-meter {
  display: flex;
  gap: 4px;
}
.skill-pip {
  width: 20px;
  height: 3px;
  background: var(--rule);
  transition: background .4s ease;
}
.skill-pip.filled { background: var(--warm); }

/* ── Language display ── */
.lang-item {
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.lang-item:last-child { border-bottom: none; }

.lang-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--ink);
}

.lang-info {
  display: flex;
  align-items: center;
  gap: var(--space-s);
}

.lang-level {
  font-size: .72rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
}

.lang-bar {
  display: flex;
  gap: 3px;
}
.lang-segment {
  width: 18px;
  height: 2px;
  background: var(--rule);
}
.lang-segment.active {
  background: var(--warm);
}

/* ════════════════════════════════════════
   EDGE / CREDENTIALS
   ════════════════════════════════════════ */
.edge-strip {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.edge-cell {
  flex: 1;
  padding: 1.8rem;
  border-right: 1px solid var(--rule);
  transition: background .3s ease;
}
.edge-cell:last-child { border-right: none; }
.edge-cell:hover { background: var(--warm-pale); }

.edge-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .25rem;
}
.edge-sub {
  font-size: .82rem;
  color: var(--muted);
}

/* ════════════════════════════════════════
   EDUCATION
   ════════════════════════════════════════ */
.edu-row {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.edu-cell {
  flex: 1;
  padding: 2rem 0;
}
.edu-cell:first-child {
  padding-right: clamp(2rem, 4vw, 3.5rem);
  border-right: 1px solid var(--rule);
}
.edu-cell:last-child {
  padding-left: clamp(2rem, 4vw, 3.5rem);
}

.edu-degree {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: .2rem;
}
.edu-school {
  font-size: .88rem;
  color: var(--muted);
}

/* ════════════════════════════════════════
   CONTACT
   ════════════════════════════════════════ */
.contact-body {
  padding-top: var(--space-l);
}

.contact-headline {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: var(--space-s);
  max-width: 500px;
}

.contact-sub {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: var(--space-l);
  max-width: 400px;
}

.contact-rows {
  display: flex;
  flex-direction: column;
}

.contact-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: var(--space-m);
  align-items: baseline;
  padding: 1.2rem 0;
  border-top: 1px solid var(--rule);
  transition: padding-left .3s ease;
}
.contact-row:hover { padding-left: .6rem; }

.contact-label {
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-value {
  font-size: 1.05rem;
  color: var(--ink);
  transition: color .3s ease;
}
a.contact-value:hover { color: var(--warm); }

/* ════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════ */
footer {
  padding: var(--space-l) var(--page-px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--rule);
}
footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.footer-left {
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .06em;
}
.footer-right {
  font-family: var(--serif);
  font-size: .9rem;
  color: var(--muted);
  letter-spacing: .04em;
}

/* ════════════════════════════════════════
   REVEAL ANIMATIONS
   ════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s cubic-bezier(.4, 0, .2, 1), transform .7s cubic-bezier(.4, 0, .2, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-d1 { transition-delay: .08s; }
.reveal-d2 { transition-delay: .16s; }
.reveal-d3 { transition-delay: .24s; }
.reveal-d4 { transition-delay: .32s; }
.reveal-d5 { transition-delay: .40s; }
.reveal-d6 { transition-delay: .48s; }

/* ════════════════════════════════════════
   RESPONSIVE — TABLET
   ════════════════════════════════════════ */
@media (max-width: 860px) {
  :root {
    --space-l: 2.5rem;
    --space-xl: 4rem;
  }

  .story-body {
    grid-template-columns: 1fr;
    gap: var(--space-m);
  }
  .story-text { padding-right: 0; }
  .story-rule { display: none; }
  .story-journey { padding-left: 0; }

  .cap-grid { grid-template-columns: 1fr; border-left: none; }
  .cap-cell { border-left: 1px solid var(--rule); }

  .skills-body {
    grid-template-columns: 1fr;
    gap: var(--space-l);
  }
  .skills-rule { display: none; }
  .skills-col:first-child { padding-right: 0; }
  .skills-col:last-child { padding-left: 0; }

  .tl-item {
    grid-template-columns: 1fr;
    gap: .4rem;
  }

  .edge-strip { flex-direction: column; }
  .edge-cell {
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .edge-cell:last-child { border-bottom: none; }

  .edu-row { flex-direction: column; }
  .edu-cell:first-child {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: var(--space-m);
  }
  .edu-cell:last-child { padding-left: 0; padding-top: var(--space-m); }

  .hero-meta { gap: var(--space-m); flex-wrap: wrap; }

  .section-header {
    grid-template-columns: 56px 1fr;
    gap: var(--space-s);
  }
  .section-num { font-size: 2.2rem; }

  .nav-items { display: none; }

  .hero-bottom { flex-direction: column; gap: var(--space-m); align-items: flex-start; }
  .hero-scroll { display: none; }

  .contact-row { grid-template-columns: 1fr; gap: .25rem; }

  .thread { display: none; }
}

/* ════════════════════════════════════════
   RESPONSIVE — MOBILE
   ════════════════════════════════════════ */
@media (max-width: 520px) {
  :root {
    --page-px: 1.25rem;
    --section-py: 3.5rem;
    --space-l: 2rem;
  }

  /* Bump all small text up for mobile readability */
  .hero-label {
    font-size: .82rem;
    letter-spacing: .2em;
  }

  .hero-headline {
    font-size: 1.15rem;
    line-height: 1.7;
  }

  .hero-cta { font-size: .82rem; }

  .hero-meta-label { font-size: .78rem; }
  .hero-meta-value { font-size: 1rem; }
  .hero-meta { flex-direction: column; gap: var(--space-s); }

  .section-label { font-size: .78rem; letter-spacing: .2em; }

  .story-text p {
    font-size: 1.05rem;
    line-height: 1.8;
  }

  .journey-label { font-size: 1rem; }
  .journey-sub { font-size: .9rem; }

  .cap-cell { padding: 1.5rem; }
  .cap-title { font-size: 1.15rem; }
  .cap-desc { font-size: .95rem; }
  .cap-tag { font-size: .75rem; }

  .tl-year { font-size: 1rem; }
  .tl-role { font-size: 1.05rem; }
  .tl-company { font-size: .92rem; }
  .tl-tag { font-size: .75rem; padding: .4rem .9rem; }

  .skill-group-label { font-size: .78rem; }
  .skill-name { font-size: 1rem; }
  .skill-pip { width: 16px; }

  .lang-name { font-size: 1.35rem; }
  .lang-level { font-size: .78rem; }
  .lang-segment { width: 14px; }

  .edge-cell { padding: 1.4rem 1.25rem; }
  .edge-title { font-size: 1rem; }
  .edge-sub { font-size: .88rem; }

  .edu-degree { font-size: 1.1rem; }
  .edu-school { font-size: .92rem; }

  .contact-label { font-size: .78rem; }
  .contact-value { font-size: 1.05rem; }
  .contact-sub { font-size: 1.05rem; }

  .footer-left { font-size: .82rem; }
  .footer-right { font-size: .92rem; }

  footer {
    flex-direction: column;
    gap: var(--space-s);
    text-align: center;
    padding: var(--space-m) var(--page-px);
  }
  footer .container {
    flex-direction: column;
    gap: var(--space-s);
  }
}
