/* =====================================================================
   Matej Lietava — Portfolio
   Design tokens + component styles (extracted from inline styles)
   ===================================================================== */

:root {
  /* Palette */
  --bg: #f3f1ec; /* page background / light ink on dark */
  --ink: #141414; /* primary text / dark surfaces */
  --rule: #dedad1; /* hairline rules & borders */
  --muted: #5c5c5c; /* secondary mono text */
  --faint: #9a968c; /* tertiary / captions */
  --list: #3f3f3f; /* experience list copy */

  /* Type */
  --serif: "Bodoni Moda", Georgia, serif;
  --mono: "IBM Plex Mono", monospace;
  --sans: "Spline Sans", system-ui, sans-serif;

  /* Layout: centered 1280px content with a 56px min gutter */
  --pad-x: max(56px, calc((100% - 1280px) / 2));
}

/* ---------- Base ---------- */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}
body {
  margin: 0;
  background: var(--bg);
  font-family: var(--sans);
}
a {
  text-decoration: none;
  color: inherit;
}

.page-top {
  position: relative;
  width: 100%;
}
.page {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
}

/* Shared horizontal gutters for every top-level band */
.sec {
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
}

/* ---------- Animations ---------- */
@keyframes heroUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes heroFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Scroll-reveal (progressive enhancement — content is visible without JS) */
.reveal-init {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}
.reveal-in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  background: var(--bg);
}
.nav__brand {
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Mobile menu button — hidden on desktop, shown in the mobile media query */
.nav__toggle {
  display: none;
  align-items: center;
  gap: 9px;
  background: none;
  border: 0;
  padding: 10px 2px;
  margin: -10px 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}
.nav__toggle-icon {
  position: relative;
  width: 18px;
  height: 11px;
  display: inline-block;
}
.nav__toggle-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s ease;
}
.nav__toggle-bar:nth-child(1) {
  top: 0;
}
.nav__toggle-bar:nth-child(2) {
  bottom: 0;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: 44px;
  padding-bottom: 72px;
}
.hero__issue {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
  animation: heroUp 0.7s 0.05s both ease-out;
}
.hero__spine {
  position: absolute;
  right: 22px;
  top: 190px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--faint);
  animation: heroFade 1.2s 0.75s both;
}
.hero__title-row {
  margin-top: 52px;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  animation: heroUp 0.9s 0.16s both ease-out;
}
.hero__folio {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--faint);
  padding-top: 14px;
}
.hero__name {
  margin: 0;
  font-weight: 500;
  font-size: clamp(46px, 13.5vw, 180px);
  line-height: 0.82;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.hero__lower {
  margin-top: 52px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 60px;
  align-items: start;
  animation: heroUp 0.9s 0.42s both ease-out;
}
.hero__intro {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  color: #4a4a4a;
}
.hero__actions {
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 15px 22px;
}
.btn--solid {
  background: var(--ink);
  color: var(--bg);
  transition:
    background 0.25s ease,
    transform 0.25s ease;
}
.btn--solid:hover {
  background: #3a3a3a;
  transform: translateY(-2px);
}
.btn--outline {
  border: 1px solid var(--ink);
  transition:
    background 0.25s ease,
    color 0.25s ease;
}
.btn--outline:hover {
  background: var(--ink);
  color: var(--bg);
}

/* ---------- Section headers ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 40px;
}
.section-title {
  margin: 0;
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.section-title--500 {
  font-weight: 500;
}
.section-index {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--faint);
}

/* ---------- Experience ---------- */
.experience {
  padding-top: 70px;
  padding-bottom: 70px;
  border-top: 1px solid var(--rule);
}

.exp {
  padding: 34px 0;
  border-top: 1px solid var(--rule);
}
.exp--first {
  border-top-color: var(--ink);
}
.exp--last {
  padding-bottom: 0;
}

.exp__row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.exp__no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  padding-top: 10px;
}
.exp__no--lg {
  padding-top: 14px;
}

.exp__name {
  font-size: 40px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
}
.exp__name--lg {
  font-size: 52px;
}

.exp__meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.exp__roles {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.exp__role {
  margin-top: 12px;
}

.exp__list {
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.exp__list--zumo {
  margin-top: 6px;
}
.exp__item {
  position: relative;
  padding-left: 20px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--list);
}
.exp__item::before {
  content: "\2014";
  position: absolute;
  left: 0;
}

/* Zumo "read more" toggle — hidden on desktop (all bullets shown) */
.exp__toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
  padding: 14px 0 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--rule);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.exp__toggle-sign {
  font-size: 15px;
  line-height: 1;
}

/* ---------- Tech stack ---------- */
.stack {
  padding-top: 64px;
  padding-bottom: 64px;
  border-top: 1px solid var(--rule);
}
.stack__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 26px;
}
.stack__list {
  font-weight: 400;
  font-size: clamp(20px, 4.5vw, 34px);
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.stack__list .sep {
  color: #c3bfb4;
}

/* ---------- Projects ---------- */
.projects {
  min-height: 100vh;
  padding-top: 96px;
  padding-bottom: 96px;
  border-top: 1px solid var(--rule);
}
.projects__more {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 3px;
}
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.project {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--rule);
  transition: border-color 0.25s ease;
}
.project:hover {
  border-color: var(--faint);
}
.project__thumb {
  height: 230px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Line-art icons centered in the frame; multiply collapses the JPG's white bg
   to the exact page colour so the icons sit flush on the paper background. */
.project__thumb-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  padding: clamp(24px, 5vw, 36px);
  mix-blend-mode: multiply;
}
.project__thumb-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a29e93;
}
.project__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 18px;
}
.project__name {
  font-size: 30px;
  font-weight: 500;
}
.project__plate {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}
.project__desc {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}
.project__tech {
  margin-top: auto;
  padding-top: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #8c8c8c;
}
.project__links {
  margin-top: 14px;
  padding-top: 12px;
  display: flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.project__link {
  border-bottom: 1px solid #c9c4b8;
  padding-bottom: 2px;
}

/* ---------- Contact ---------- */
.contact {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--bg);
  padding-top: 96px;
  padding-bottom: 96px;
}
.contact__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8c8c8c;
  padding-bottom: 40px;
  border-bottom: 1px solid #333;
}
.contact__title {
  margin: 48px 0 0;
  font-weight: 500;
  font-size: clamp(56px, 13vw, 110px);
  line-height: 0.9;
  letter-spacing: -0.03em;
}
.contact__grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.contact__intro-wrap {
  max-width: 520px;
}
.contact__intro {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  color: #b8b4aa;
}
.contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.contact__btn {
  padding: 14px 22px;
}
.contact__btn--solid {
  background: var(--bg);
  color: var(--ink);
}
.contact__btn--ghost {
  border: 1px solid #3a3a3a;
  color: var(--bg);
}
.contact__footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid #333;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6f6f6f;
}

/* ---------- Responsive — mobile / tablet (≤ 820px) ---------- */
@media (max-width: 820px) {
  html {
    scroll-padding-top: 70px;
  }
  .sec {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Nav — logo far-left, menu button far-right, links collapse to a dropdown */
  .nav {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .nav__toggle {
    display: inline-flex;
  }
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 26px 40px -30px rgba(20, 20, 20, 0.55);
    padding: 2px 20px 18px;
  }
  .nav.is-open .nav__links {
    display: flex;
  }
  .nav__links a {
    width: 100%;
    padding: 15px 0;
    border-bottom: 1px solid #e6e2d9;
    font-size: 13px;
    letter-spacing: 0.16em;
  }
  .nav__links a:last-child {
    border-bottom: 0;
  }
  .nav.is-open .nav__toggle-bar:nth-child(1) {
    transform: translateY(4.5px) rotate(45deg);
  }
  .nav.is-open .nav__toggle-bar:nth-child(2) {
    transform: translateY(-4.5px) rotate(-45deg);
  }

  /* Hero — full-screen cover minus the sticky nav */
  .hero {
    min-height: calc(100dvh - 50px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 26px 20px 40px;
  }
  .hero__issue {
    flex-wrap: wrap;
    gap: 8px 0;
    justify-content: flex-start;
  }
  .hero__issue > span {
    flex: 0 0 100%;
  }
  .hero__issue > span:last-child {
    color: var(--faint);
  }
  .hero__spine {
    display: none;
  }
  .hero__folio {
    display: none;
  }
  .hero__spacer {
    display: none;
  }
  .hero__title-row {
    margin-top: 0;
  }
  .hero__name {
    font-size: clamp(64px, 23vw, 90px);
  }
  .hero__lower {
    margin-top: 0;
  }

  /* Shared single-column grids */
  .hero__lower,
  .contact__grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  /* Experience */
  .experience {
    padding-top: 52px;
    padding-bottom: 52px;
  }
  .exp__row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .exp__name--lg {
    font-size: 46px;
  }
  .exp__item {
    font-size: 13.5px;
  }
  .exp__item--extra {
    display: none;
  }
  .exp--first.is-expanded .exp__item--extra {
    display: block;
  }
  .exp__toggle {
    display: flex;
  }

  /* Tech stack */
  .stack {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  /* Projects — drop the full-height minimum */
  .projects {
    min-height: 0;
    padding-top: 64px;
    padding-bottom: 64px;
  }
  .section-head--wrap {
    flex-wrap: wrap;
    gap: 12px 20px;
  }
  .projects__grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  /* Contact — full-screen inverted */
  .contact {
    min-height: 100dvh;
    padding-top: 56px;
    padding-bottom: 44px;
  }
  .contact__top {
    padding-bottom: 28px;
  }
  .contact__title {
    font-size: clamp(52px, 17vw, 80px);
    margin-top: 34px;
  }
}
