/* ============================================================
   Luka Verč — Portfolio
   Scroll-driven, bold black-on-white. The scroll is the interaction:
   giant project names slide behind cards that rotate in 3D.
   ============================================================ */

:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --soft: rgba(10, 10, 10, 0.58);
  --hair: rgba(10, 10, 10, 0.14);
  --pad: clamp(1.25rem, 4vw, 4.5rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Custom cursor ---------- */

.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 13px; height: 13px;
  border-radius: 8rem;
  background: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
  z-index: 300;
  display: grid;
  place-items: center;
  transition: width 0.3s var(--ease), height 0.3s var(--ease),
    padding 0.3s var(--ease), background 0.2s, mix-blend-mode 0s;
}
.cursor span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  color: #fff;
}
.cursor.hover { width: 64px; height: 64px; }
.cursor.label {
  mix-blend-mode: normal;
  background: var(--ink);
  width: auto; height: auto;
  padding: 0.7rem 1.15rem;
}
.cursor.label span { opacity: 1; }

@media (pointer: coarse) {
  .cursor { display: none; }
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1.1rem, 2vw, 1.9rem) var(--pad);
  mix-blend-mode: difference;
}
.nav__logo {
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #fff;
}
.nav__logo span { color: #fff; }
.nav__links { display: flex; gap: clamp(1.1rem, 2.5vw, 2.6rem); }
.nav__links a {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
  transition: opacity 0.2s var(--ease);
}
.nav__links a:hover { opacity: 0.45; }

/* ---------- Shared display heading ---------- */

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--soft);
}

.big-head {
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(2.1rem, 6.4vw, 6rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 18ch;
}

/* word-reveal split */
.word { display: inline-block; }
.word > span {
  display: inline-block;
  transform: translateY(0.5em);
  opacity: 0;
  transition: transform 0.85s var(--ease), opacity 0.85s var(--ease);
}
.word > span.in { transform: none; opacity: 1; }

/* generic fade reveal */
.reveal {
  opacity: 0;
  transform: translateY(1.6rem);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 7rem var(--pad) 3rem;
  position: relative;
}
.hero__title {
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(3.2rem, 13vw, 13rem);
  line-height: 0.88;
  letter-spacing: -0.045em;
}
.hero__title .line {
  display: block;
  overflow: hidden;
}
.hero__title .line > span {
  display: block;
  transform: translateY(110%);
  animation: rise 1s var(--ease) forwards;
}
.hero__title .line:nth-child(1) > span { animation-delay: 0.15s; }
.hero__title .line:nth-child(2) > span { animation-delay: 0.27s; }
.hero__title .line:nth-child(3) > span { animation-delay: 0.39s; }
@keyframes rise { to { transform: translateY(0); } }

.hero__foot {
  margin-top: clamp(1.75rem, 3.5vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  opacity: 0;
  animation: fade 0.9s var(--ease) 0.7s forwards;
}
@keyframes fade { to { opacity: 1; } }
.hero__sub {
  max-width: 34rem;
  color: var(--soft);
  font-size: clamp(1rem, 1.1vw + 0.8rem, 1.2rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.85rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8rem;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: transform 0.4s var(--ease);
}
.btn:hover { transform: scale(1.06); }

.hero__apps {
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  opacity: 0;
  animation: fade 0.9s var(--ease) 0.85s forwards;
}
.hero__apps-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
}
.hero__icons { display: flex; gap: 0.8rem; }
.hero__icons img {
  width: 3rem; height: 3rem;
  border-radius: 0.7rem;
  box-shadow: 0 4px 14px rgba(10, 10, 10, 0.16);
}

.scroll-cue {
  position: absolute;
  bottom: 1.6rem; right: var(--pad);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
}
.scroll-cue__line {
  width: 3rem; height: 1px;
  background: var(--ink);
  transform-origin: right;
  animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue {
  0%, 100% { transform: scaleX(0.25); opacity: 0.4; }
  50% { transform: scaleX(1); opacity: 1; }
}

/* ---------- Work — one fixed phone, app rectangles scroll past it ---------- */

.work {
  padding: clamp(4rem, 9vw, 9rem) var(--pad) clamp(3rem, 6vw, 6rem);
}
.work__head {
  max-width: 82rem;
  margin: 0 auto clamp(2rem, 4vw, 3.5rem);
}
.work__head .eyebrow { margin-bottom: 1.1rem; }

.showcase {
  position: relative;
  max-width: 82rem;
  margin: 0 auto;
}

/* the app rectangles, stacked */
.showcase__rects {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.75rem);
}
.rect {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(2rem, 5vw, 5rem);
  border-radius: 2rem;
  background: var(--rtint, #e9f1ff);
}
.rect__body {
  max-width: 27rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  opacity: 0.4;
  transition: opacity 0.5s var(--ease);
}
.rect.active .rect__body { opacity: 1; }
.rect__num {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
}
.rect__name {
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(1.7rem, 3.2vw, 3rem);
  line-height: 1;
  letter-spacing: -0.035em;
}
.rect__desc {
  font-size: clamp(1rem, 1vw + 0.8rem, 1.2rem);
  color: var(--soft);
}
.rect__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}
.rect__tags li {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(10, 10, 10, 0.18);
  border-radius: 8rem;
}
.rect__link {
  align-self: flex-start;
  margin-top: 0.4rem;
  font-size: 0.83rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 3px;
  transition: opacity 0.2s var(--ease);
}
.rect__link:hover { opacity: 0.5; }

.rect__actions {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.rect__actions .rect__link { margin-top: 0; }

/* expandable "about this app" */
.rect__more { max-width: 30rem; }
.rect__more summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.83rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  opacity: 0.6;
  transition: opacity 0.2s var(--ease);
}
.rect__more summary::-webkit-details-marker { display: none; }
.rect__more summary::after {
  content: "+";
  font-size: 1.05em;
  line-height: 1;
}
.rect__more[open] summary::after { content: "–"; }
.rect__more summary:hover { opacity: 1; }
.rect__more p {
  margin-top: 0.85rem;
  font-size: 0.97rem;
  line-height: 1.5;
  color: var(--soft);
}

/* per-card phone — only used on mobile */
.rect__phone { display: none; }

/* one phone, sticky — always in focus while rectangles scroll past */
.showcase__phone {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.phone-pin {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: clamp(1.5rem, 7vw, 7rem);
}
.phone {
  position: relative;
  height: min(40rem, 84svh);
  aspect-ratio: 1308 / 2710;
}
/* the screen sits in the frame PNG's transparent cutout */
.phone__screen {
  position: absolute;
  top: 1.62%;
  left: 3.9%;
  right: 3.9%;
  bottom: 1.62%;
  overflow: hidden;
  border-radius: 16% / 7.4%;
  background: #000;
}
.frame {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  will-change: clip-path;
}
/* real iPhone 16 Pro frame (Apple device-frame export), drawn on top */
.phone__device {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 1.8rem 2.8rem rgba(10, 10, 10, 0.32));
}

/* ---------- Design ---------- */

.design {
  max-width: 82rem;
  margin: 0 auto;
  padding: clamp(5rem, 12vw, 11rem) var(--pad);
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3.5vw, 2.75rem);
}
.design__text {
  max-width: 40rem;
  font-size: clamp(1.05rem, 1.3vw + 0.8rem, 1.4rem);
  color: var(--soft);
}
.design__icons {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: clamp(0.5rem, 2vw, 2rem);
}
.design__icons figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}
.design__icons img {
  width: clamp(4.5rem, 9vw, 7rem);
  height: clamp(4.5rem, 9vw, 7rem);
  border-radius: 23%;
  box-shadow: 0 1rem 2rem rgba(10, 10, 10, 0.14);
}
.design__icons figcaption {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--soft);
}

/* ---------- About ---------- */

.about {
  padding: clamp(6rem, 14vw, 13rem) var(--pad);
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  max-width: 82rem;
  margin: 0 auto;
}
.about__media {
  border-radius: 1.5rem;
  overflow: hidden;
  background: var(--ink);
  aspect-ratio: 4 / 5;
}
.about__media img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.about__content {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}
.about__text {
  max-width: 38rem;
  font-size: clamp(1.05rem, 1.3vw + 0.8rem, 1.4rem);
  color: var(--soft);
}

/* ---------- Skills strip ---------- */

.strip {
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  overflow: hidden;
  padding: 1.4rem 0;
}
.strip__track {
  display: flex;
  width: max-content;
  animation: scrollx 34s linear infinite;
}
.strip__seq {
  display: flex;
  gap: 1.6rem;
  padding-right: 1.6rem;        /* keeps spacing even across the loop seam */
  flex-shrink: 0;
}
.strip__seq span {
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
@keyframes scrollx {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Contact ---------- */

.contact {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(6rem, 14vw, 13rem) var(--pad) 2.5rem;
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  min-height: 100svh;
  justify-content: center;
}
.contact .eyebrow { color: rgba(255, 255, 255, 0.55); }
.contact__head { color: var(--paper); }

.contact__links {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
}
.contact__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.1rem, 2.5vw, 2rem) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: clamp(2rem, 7vw, 5.5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  line-height: 1;
  transition: padding-left 0.45s var(--ease), color 0.3s var(--ease);
}
.contact__links .contact__link:last-of-type {
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.contact__link:hover {
  padding-left: clamp(1rem, 3vw, 2.5rem);
  color: rgba(255, 255, 255, 0.6);
}
.contact__arrow {
  font-weight: 400;
  transition: transform 0.45s var(--ease);
}
.contact__link:hover .contact__arrow { transform: translate(0.4rem, -0.4rem); }

.footer {
  margin-top: clamp(3rem, 8vw, 7rem);
  padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  /* normal stacked cards — each keeps its own phone, no fixed-phone scroll effect */
  .showcase__phone { display: none; }

  .rect {
    min-height: auto;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: clamp(1.75rem, 6vw, 2.75rem) clamp(1.75rem, 6vw, 2.75rem) 0;
    overflow: hidden;
  }
  .rect__body {
    max-width: 100%;
    align-items: center;
    opacity: 1;
    gap: 1rem;
  }
  .rect__actions { justify-content: center; }
  .rect__more { text-align: center; }

  .rect__phone {
    --ph: min(25rem, 62svh);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    margin-top: 1.75rem;
    margin-bottom: 0;
    height: calc(var(--ph) * 0.8);   /* bottom 20% cut off, flush with card edge */
    overflow: hidden;
  }
  .rect__phone .phone { height: var(--ph); }
  .rect__phone .phone__screen img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
  }
  .rect__phone .phone__device { filter: none; }

  .about { grid-template-columns: 1fr; gap: 2rem; }
  .about__media { max-width: 17rem; margin: 0 auto; }

  .scroll-cue { right: 50%; transform: translateX(50%); }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { display: none; }
  .strip__track { animation: none; }
  .scroll-cue__line { animation: none; }
  .hero__title .line > span,
  .hero__foot, .hero__apps { animation: none; transform: none; opacity: 1; }
  .reveal { opacity: 1; transform: none; }
  .word > span { transform: none; }
}
