/* ============================================================
   HOME — single-viewport index. Requires foundation.css + nav.css.
   ============================================================ */

body.home {
  height: 100%;
  overflow: hidden; /* this page never scrolls — one glance, done */
}

html:has(body.home) {
  height: 100%;
}

.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 1fr auto;
  padding: 0 var(--space-3) var(--space-3);
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  opacity: 0.34;
  filter: contrast(1.1) grayscale(0.15);
}

/* Name block — lower-left, closer to the bottom third than
   dead center. Grid-placed, not centered. */
.hero__name {
  grid-column: 1 / 9;
  align-self: end;
  margin: 0;
  padding-bottom: 0.08em; /* room for the descenders in "hasanbegović" */
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--size-name);
  line-height: 1.05;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 2;
}

.hero__role {
  grid-column: 1 / 6;
  grid-row: 2;
  margin: var(--space-1) 0 var(--space-4);
  font-size: var(--size-meta);
  letter-spacing: var(--tracking-meta);
  color: var(--color-fg-dim);
  position: relative;
  z-index: 1;
}

/* The fragment — sits near the center of the frame but not on
   it: shifted slightly up and right of true-center, an
   unresolved position rather than a tidy corner or a balanced
   middle. That imbalance is deliberate. */
.hero__fragment {
  position: absolute;
  top: 42%;
  left: 57%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: 18ch;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.125rem, 2.2vw, 1.625rem);
  line-height: 1.25;
  color: var(--color-fg-dim);
  z-index: 1;
}

/* ---- The fragment, alive ----
   Normal arrow cursor, no underline: it never reads as a link. */
.hero__fragment {
  cursor: default;
  touch-action: none;       /* lets a finger drag across the letters on phones */
  -webkit-user-select: none;
  user-select: none;
}

.hero__hope .w { white-space: nowrap; }

.hero__hope .l,
.hero__stop .l {
  display: inline-block;
  will-change: transform;   /* moved every frame by home.js; no CSS transition */
}

.hero__hope .l.is-wave,
.hero__stop .l.is-wave { animation: hope-wave 0.7s var(--ease); }

@keyframes hope-wave {
  0%   { translate: 0 0; }
  35%  { translate: 0 -0.28em; }
  100% { translate: 0 0; }
}

/* the sentence the phrase was cut from, in the faded grey used
   for the original-language titles */
.hero__origin {
  position: absolute;
  left: 0;
  bottom: 100%;
  width: 24ch;
  color: rgba(242, 240, 236, 0.3);
  opacity: 0;
  transform: translateY(0.4em);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  pointer-events: none;
}

.hero__stop {
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}

/* "have" slides in on the phrase's own line, so the sentence reads
   straight down; the phrase moves over just enough to make room */
.hero__have {
  display: inline-block;
  max-width: 0;
  overflow: clip;
  white-space: nowrap;
  color: rgba(242, 240, 236, 0.3);
  opacity: 0;
  transition: max-width 0.9s var(--ease), opacity 0.9s var(--ease);
}

.hero__fragment.is-open .hero__have { max-width: 3.4em; opacity: 1; }

.hero__fragment.is-open .hero__origin { opacity: 1; transform: none; }
.hero__fragment.is-open .hero__stop { opacity: 1; }

/* The one static red mark on the page — a hairline cut running
   the full height of the frame, off-center, unexplained. */
.hero__cut {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 44%;
  width: 1px;
  background: var(--color-red);
  opacity: 0.85;
  z-index: 1;
}

.hero__footer {
  grid-column: 1 / 13;
  grid-row: 2;
  justify-self: end;
  align-self: end;
  padding-bottom: var(--space-2);
  position: relative;
  z-index: 1;
}

.hero__footer a {
  font-size: 0.75rem;
  color: var(--color-fg-faint);
  transition: color var(--dur) var(--ease);
}

.hero__footer a:hover,
.hero__footer a:focus-visible {
  color: var(--color-fg-dim);
}

@media (max-width: 640px) {
  .hero {
    padding: 0 var(--space-2);
    grid-template-rows: 1fr auto auto;
  }
  .hero__name {
    grid-column: 1 / 13;
    font-size: clamp(2.25rem, 11vw, 3.5rem);
  }
  .hero__role {
    grid-column: 1 / 13;
    grid-row: 3;
    margin-bottom: var(--space-3);
  }
  .hero__fragment {
    position: static;
    transform: none;
    max-width: none;
    width: auto;
    grid-column: 1 / 13;
    grid-row: 2;
    margin-top: var(--space-2);
    font-size: 1.0625rem;
  }
  .hero__cut {
    left: 78%;
  }
  .hero__origin {
    position: static;
    display: block;
    width: auto;
    max-height: 0;
    overflow: hidden;
    transform: none;
    transition: opacity 0.9s var(--ease), max-height 0.9s var(--ease);
  }
  .hero__fragment.is-open .hero__origin { max-height: 4em; margin-bottom: 0.2em; }
  .hero__footer {
    grid-row: 3;
  }
}
