* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --ink: #000;
  --paper: #fff;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

body {
  font-family: "lft-etica-mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 700;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* --- header --- */

header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
}

/* linia pod nagłówkiem rysuje się przy wejściu */
header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--ink);
  transform-origin: left;
  animation: draw .9s var(--ease) both;
}

.logo {
  font-size: 1.4rem;
  color: var(--ink);
  text-decoration: none;
}

.caret {
  display: inline-block;
  width: .55em;
  height: 1em;
  margin-left: 2px;
  vertical-align: -.12em;
  background: var(--ink);
  animation: blink 1.06s steps(1) infinite;
}

.nav-links a {
  margin-left: 30px;
  font-size: 1.1rem;
}

/* wypełnienie wjeżdża od lewej zamiast pojawiać się od razu */
.nav-links a,
.button {
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(var(--ink), var(--ink)) no-repeat left / 0% 100%;
  transition: background-size .28s var(--ease), color .28s var(--ease);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.button:hover,
.button:focus-visible {
  background-size: 100% 100%;
  color: var(--paper);
  outline: none;
}

/* --- main --- */

main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 60px;
  padding: 60px 40px;
}

.code {
  font-family: inherit;
  font-weight: 400;
  font-size: clamp(.8rem, 1.15vw, 1.05rem);
  line-height: 1.55;
  letter-spacing: .02em;
  white-space: pre;
  overflow: hidden;
  color: #3a3a3a;
  /* to samo blednięcie w prawo i w dół co na starym kod.png */
  -webkit-mask-image: linear-gradient(165deg, #000 15%, rgba(0, 0, 0, .12) 80%);
          mask-image: linear-gradient(165deg, #000 15%, rgba(0, 0, 0, .12) 80%);
}

.code .cursor {
  display: inline-block;
  width: .6em;
  height: 1.15em;
  vertical-align: -.2em;
  background: var(--ink);
  animation: blink 1.06s steps(1) infinite;
}

.text-section {
  align-self: end;
  justify-self: end;
  max-width: 600px;
  text-align: right;
}

.text-section > * {
  animation: rise .8s var(--ease) both;
}
.text-section > :nth-child(1) { animation-delay: .5s; }
.text-section > :nth-child(2) { animation-delay: .6s; }
.text-section > :nth-child(3) { animation-delay: .7s; }
.text-section > :nth-child(4) { animation-delay: .8s; }

.index {
  display: block;
  font-weight: 400;
  font-size: .85rem;
  color: #8a8a8a;
  margin-bottom: 8px;
}

.text-section h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  letter-spacing: -.02em;
  margin-bottom: 14px;
}

.text-section p {
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.button {
  display: inline-block;
  border: 1px solid var(--ink);
  padding: 6px 12px;
  font-size: 1.33rem;
}

.button .arrow {
  display: inline-block;
  transition: transform .28s var(--ease);
}

.button:hover .arrow {
  transform: translateX(4px);
}

/* --- footer --- */

footer {
  display: flex;
  justify-content: space-between;
  padding: 16px 40px;
  border-top: 1px solid var(--ink);
  font-weight: 400;
  font-size: .85rem;
  color: #6a6a6a;
}

#clock {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* --- animacje --- */

@keyframes draw {
  from { transform: scaleX(0); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* --- telefon --- */

@media (max-width: 860px) {
  header,
  main,
  footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav-links a {
    margin-left: 14px;
    font-size: 1rem;
  }

  main {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 32px;
  }

  .code {
    font-size: .72rem;
    height: 40vh;
  }
}

@media (max-width: 420px) {
  .logo { font-size: 1.15rem; }
  .nav-links a { margin-left: 10px; font-size: .9rem; }
}
