/* Homepage only. Shared pieces (header, buttons, sticker, cta, reveal...) live in site.css. */

/* ---------- portrait ---------- */

.portrait {
  --d: clamp(15rem, 31vw, 33rem);
  position: relative;
  width: var(--d);
  aspect-ratio: 1;
  justify-self: center;
}

.portrait > * {
  position: absolute;
}

.portrait-sun {
  width: 138%;
  aspect-ratio: 1;
  left: 5%;
  top: -27%;
  border-radius: 50%;
  background: var(--tangerine);
  animation: pop 1.1s var(--spring-soft) 0.1s both;
}

.portrait-photo {
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--teal);
  box-shadow:
    0 0 0 calc(var(--d) * 0.028) var(--cream),
    0 calc(var(--d) * 0.12) calc(var(--d) * 0.22) calc(var(--d) * -0.1) rgba(13, 19, 33, 0.6);
  animation: pop 1s var(--spring) 0.22s both;
  transition:
    rotate 0.9s var(--spring),
    scale 0.9s var(--spring);
  touch-action: manipulation;
}

.portrait-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (hover: hover) {
  .portrait-photo:hover {
    rotate: 3deg;
    scale: 1.03;
  }
}

.bub-logo {
  display: grid;
  place-items: center;
  width: 27%;
  left: -8%;
  bottom: 2%;
  background: var(--cream);
  color: var(--teal);
  box-shadow: 0 0.75rem 1.5rem -0.75rem rgba(13, 19, 33, 0.5);
  animation-delay: 0.5s;
}

.bub-logo svg {
  width: 58%;
  height: 58%;
  transition:
    rotate 0.8s var(--spring),
    scale 0.8s var(--spring);
}

@media (hover: hover) {
  .bub-logo:hover svg {
    rotate: -14deg;
    scale: 1.14;
  }
}

.bub-ring {
  width: 11%;
  right: -4%;
  bottom: 12%;
  border: 0.22rem solid var(--cream);
  animation-delay: 0.62s;
}

.bub-dot {
  width: 5.5%;
  left: 12%;
  bottom: -9%;
  background: var(--tangerine);
  animation-delay: 0.7s;
}

.note {
  right: 88%;
  top: 1%;
  color: var(--cream);
  font: 600 clamp(1.35rem, 2vw, 1.8rem) / 1 var(--font-hand);
  white-space: nowrap;
  rotate: -7deg;
  animation: rise 0.9s var(--spring-soft) 0.9s both;
}

.note svg {
  position: absolute;
  left: 78%;
  top: 100%;
  width: 3em;
  height: auto;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- where to go next: three bubbles ---------- */

.routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: clamp(1rem, 2.4vw, 2rem);
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  list-style: none;
}

.routes li:nth-child(2) {
  margin-top: clamp(2rem, 6vw, 5rem);
}

.route {
  container-type: inline-size; /* the type inside scales with the bubble (cqi below) */
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.8rem;
  aspect-ratio: 1;
  padding: 13%;
  border-radius: 50%;
  background: var(--bub-bg);
  color: var(--bub-fg);
  text-align: center;
  text-decoration: none;
  transition:
    scale 0.8s var(--spring),
    translate 0.9s var(--spring);
}

.route.is-magnet {
  transition:
    scale 0.8s var(--spring),
    translate 0.25s ease-out;
}

.route-title {
  font: 800 clamp(1.7rem, 1.1rem + 1.6vw, 2.5rem) / 1 var(--font-display);
  letter-spacing: -0.025em;
}

.route-text {
  max-width: 23ch;
  font-size: var(--step--1);
  line-height: 1.42;
}

/* 1cqi is 1% of the bubble's content box, which is 74% of its diameter */
@supports (width: 1cqi) {
  .route-title {
    font-size: clamp(1.6rem, 14.2cqi, 3rem);
  }
  .route-text {
    font-size: clamp(0.94rem, 5.9cqi, 1.22rem);
  }
}

.route-go {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-top: 0.25rem;
  border-radius: 50%;
  background: var(--bub-fg);
  color: var(--bub-bg);
  transition: transform 0.7s var(--spring);
}

.route:active {
  scale: 0.97;
}

@media (hover: hover) {
  .route:hover {
    scale: 1.045;
  }
  .route:hover .route-go {
    transform: rotate(-45deg) scale(1.12);
  }
}

/* ---------- a line between sections that the scroll draws ---------- */

.divider {
  margin-top: var(--section);
  pointer-events: none;
  overflow-x: clip; /* the line is drawn by sliding boxes: they must never widen the page */
}

.divider svg {
  width: 100%;
  min-width: 44rem;
  height: auto;
  stroke-width: clamp(4px, 0.45vw, 7px);
}

/* while the scroll draws it, the end of the line fades out softly instead of being cut off
   (site.js parks the faded zone off screen once the line is complete) */
@media (prefers-reduced-motion: no-preference) {
  .js .divider .wipe {
    --soft: clamp(3rem, 9vw, 7rem);
    margin-left: calc(-1 * var(--soft));
    padding-left: var(--soft);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - var(--soft)), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - var(--soft)), transparent);
  }
}

.divider + .section {
  padding-top: calc(var(--section) * 0.6);
}

/* ---------- about ---------- */

/* a white field on the cream page, rounded like the hero and the closing block */
.about-field {
  margin-top: calc(var(--section) * 0.6);
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(13, 19, 33, 0.04), 0 18px 50px -30px rgba(13, 19, 33, 0.22);
}

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(2.5rem, 7vw, 7rem);
}

.about-text {
  display: grid;
  gap: var(--s-5);
}

.about-big {
  margin-top: var(--s-3);
  color: var(--accent);
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.about-text > p:not(.about-big) {
  max-width: 52ch;
  color: var(--muted);
}

.facts {
  margin-top: var(--s-3);
}

/* the little 2 in "Študujem²": raised without making its row taller */
.facts sup {
  position: relative;
  top: -0.55em;
  margin-left: 0.08em;
  font-size: 0.68em;
  line-height: 0;
  vertical-align: baseline;
}

.facts div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: var(--s-4);
  padding-block: 0.9rem;
  border-top: 1.5px solid var(--line);
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  font-weight: 500;
}

/* study programmes link to their pages: a soft tangerine underline that fills in on hover */
.facts dd a {
  text-decoration: underline;
  text-decoration-color: var(--tangerine);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.22em;
  transition:
    color 0.2s ease,
    text-decoration-thickness 0.2s ease;
}

.facts dd a:hover,
.facts dd a:focus-visible {
  color: var(--accent);
  text-decoration-thickness: 0.2em;
}

.hobbies {
  position: relative;
  width: 100%;
  max-width: 33rem;
  aspect-ratio: 1 / 0.96;
  justify-self: center;
  list-style: none;
}

.hobby {
  position: absolute;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bub-bg);
  color: var(--bub-fg);
  font: 700 clamp(0.95rem, 0.65rem + 1.3vw, 1.45rem) / 1 var(--font-display);
  letter-spacing: -0.02em;
}

.hobby span {
  transition: scale 0.7s var(--spring);
}

@media (hover: hover) {
  .hobby:hover span {
    scale: 1.15;
  }
}

.hobby.is-line {
  --bub-bg: transparent;
  --bub-fg: var(--text);
  box-shadow: inset 0 0 0 2.5px var(--text);
}

.hobby:nth-child(1) {
  width: 46%;
  left: 3%;
  top: 6%;
}

.hobby:nth-child(2) {
  width: 36%;
  left: 56%;
  top: 0;
}

.hobby:nth-child(3) {
  width: 31%;
  left: 61%;
  top: 43%;
}

.hobby:nth-child(4) {
  width: 28%;
  left: 12%;
  top: 59%;
}

.hobby:nth-child(5) {
  width: 23%;
  left: 42%;
  top: 72%;
}

/* ---------- now building ---------- */

.now {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
  list-style: none;
}

.card {
  --card-a: var(--tangerine);
  --card-b: var(--teal);
  --card-i: var(--cream);
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: space-between;
  gap: var(--s-7);
  height: 100%;
  min-height: 16rem;
  padding: 1.6rem;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--surface);
  text-decoration: none;
  transition: translate 0.8s var(--spring);
}

.now li:nth-child(even) .card {
  --card-a: var(--teal);
  --card-b: var(--tangerine);
  --card-i: var(--ink);
}

/* a bubble peeks from the corner and grows on hover */
.card::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -3.75rem;
  bottom: -3.75rem;
  width: 11.5rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--card-a);
  transform: scale(0.5);
  transition: transform 0.9s var(--spring);
}

/* the first screen of the project, edge to edge at the top of its card */
.card-shot {
  width: calc(100% + 3.2rem);
  max-width: none;
  height: auto;
  margin: -1.6rem -1.6rem 0;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  background: var(--cream);
  border-bottom: 1px solid var(--line, rgba(13, 19, 33, 0.1));
}

.card h3 {
  font-size: clamp(1.4rem, 1.2rem + 0.7vw, 1.75rem);
}

.card p {
  margin-top: var(--s-3);
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.5;
}

.card-go {
  display: grid;
  place-items: center;
  justify-self: end;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--card-b);
  color: var(--card-i);
  transition: transform 0.7s var(--spring);
}

@media (hover: hover) {
  .card:hover {
    translate: 0 -0.4rem;
  }
  .card:hover::before {
    transform: scale(1);
  }
  .card:hover .card-go {
    transform: rotate(-45deg) scale(1.1);
  }
}

.more {
  margin-top: var(--s-6);
}

/* ---------- narrower screens ---------- */

@media (max-width: 1000px) {
  .now {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card {
    min-height: 14rem;
  }
}

@media (max-width: 900px) {
  .home-hero .hero-in {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5);
  }
  .portrait {
    --d: min(54vw, max(17rem, 40vw)); /* grows again on tablets, where there is room beside it */
    order: -1;
    justify-self: end;
    margin-right: 3%;
  }
  .note {
    right: 110%;
    top: 28%;
    white-space: normal;
    width: 5.2em;
    text-align: right;
  }
  .note svg {
    left: 62%;
    top: 104%;
    width: 2.3em;
  }
  .routes {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    max-width: 35rem;
    margin-inline: auto;
  }
  .routes li {
    width: min(82vw, 22rem);
  }
  .routes li:nth-child(2) {
    justify-self: end;
    margin-top: -1.75rem;
  }
  .routes li:nth-child(3) {
    margin-top: -1.75rem;
    margin-left: 6%;
  }
  .about {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .now {
    grid-template-columns: minmax(0, 1fr);
  }
  .card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s-4);
    min-height: 0;
    padding: 1.4rem 1.25rem 1.4rem 1.5rem;
  }
  .card-shot {
    grid-column: 1 / -1;
    width: calc(100% + 2.75rem);
    margin: -1.4rem -1.25rem 0 -1.5rem;
    aspect-ratio: 16 / 8.5;
  }
  .facts div {
    grid-template-columns: 6.25rem 1fr;
  }
}
