/* UI readability update (v11): enlarge small interface type by 20%.
   These values override the main site's 12px / 11px UI tokens without
   changing its introductory animation or the ABOUT body copy. */
:root { --ui-size: 14.4px; }

/* The site gives the brand and project title independent font sizes. */
.brand,
.project-title {
  font-size: clamp(16.8px, 1.38vw, 21.6px);
}

/* Optional portfolio guidance; deliberately isolated from main styles.css. */

/* Landing screen: keep the arrows and replacement text at the same viewport center. */
#introIntroduction.intro-introduction {
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: none;
}

#introIntroductionText.guidance-intro-text {
  margin: 0;
  width: auto;
  line-height: 1;
  letter-spacing: 0;
}

.guidance-scroll-instruction {
  position: relative;
  display: block;
  width: 140px;
  height: 150px;
  animation: guidance-arrow-float 2.8s ease-in-out infinite;
  will-change: transform;
}

/* Both elements occupy the exact same center; only their opacity changes. */
.guidance-scroll-words,
.guidance-scroll-chevrons {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 1200ms ease;
}

.guidance-scroll-words {
  font-family: 'Space Mono', monospace;
  font-size: clamp(20px, 2.6vw, 44px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.04em;
  white-space: nowrap;
  opacity: 0;
}

.guidance-scroll-instruction.show-words .guidance-scroll-words {
  opacity: 1;
}

.guidance-scroll-chevrons {
  display: flex;
  width: 140px;
  height: 150px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  opacity: 1;
}

.guidance-scroll-instruction.show-words .guidance-scroll-chevrons {
  opacity: 0;
}

/* 22px -> 55px: precisely 2.5x the former desktop arrows. */
.guidance-scroll-chevrons > span {
  display: block;
  width: 55px;
  height: 55px;
  box-sizing: border-box;
  border-right: 5px solid currentColor;
  border-bottom: 5px solid currentColor;
  transform: rotate(45deg);
}

@keyframes guidance-arrow-float {
  0%, 100% { transform: translateY(-8px); }
  50% { transform: translateY(9px); }
}

/* Fixed filter heading, outside the list layout (no button displacement). */
#filters .guidance-filter-heading {
  position: absolute;
  right: 0;
  bottom: calc(100% + 30px);
  white-space: nowrap;
  /* Inherit the same type metrics and black treatment as .filter. */
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
  color: #000;
  -webkit-text-stroke: 0.65px #fff;
  paint-order: stroke fill;
  text-shadow: -1px 0 #fff, 1px 0 #fff, 0 -1px #fff, 0 1px #fff;
  pointer-events: none;
}

/* A short rule immediately beneath FILTER BY, matching existing dividers. */
#filters .guidance-filter-heading::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -15px;
  display: block;
  width: 34px;
  height: 1px;
  background: #000;
  box-shadow: 0 -1px #fff, 0 1px #fff;
}

/* Only draw the hand cursor when the actual photograph is under the mouse. */
#stream .item.is-project-link.is-visible {
  cursor: default;
}
#stream .item.is-project-link.is-visible img,
#stream .item.is-project-link.is-visible video {
  cursor: inherit;
}
#stream .item.is-project-link.is-visible.guidance-media-hover {
  cursor: pointer;
}

/* Project navigation is explained once at the bottom left of the intro,
   without a hover label obscuring or following photographs. */
#introIntroduction .guidance-intro-project-instruction {
  position: absolute;
  left: var(--edge, 18px);
  bottom: var(--edge, 18px);
  max-width: calc(100vw - 2 * var(--edge, 18px));
  font-family: 'Space Mono', monospace;
  font-size: var(--ui-size, 14.4px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-align: left;
  color: #000;
  display: flex;
  align-items: center;
  gap: 10px;
}

#introIntroduction .guidance-intro-project-icon {
  display: block;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
}

/* Dismiss the entire opening overlay as soon as the page actually scrolls.
   It returns automatically if the site navigates back to scroll position 0. */
#introIntroduction.guidance-scrolled {
  opacity: 0;
  visibility: hidden;
}

@media (max-width: 700px) {
  :root { --ui-size: 13.2px; }
  .guidance-scroll-words { font-size: clamp(18px, 6vw, 30px); }
  .guidance-scroll-chevrons > span { width: 45px; height: 45px; border-width: 4px; }
  #introIntroduction .guidance-intro-project-instruction { max-width: calc(100vw - 2 * var(--edge, 14px)); }
}

@media (prefers-reduced-motion: reduce) {
  .guidance-scroll-words, .guidance-scroll-chevrons { transition: none; }
  .guidance-scroll-instruction { animation: none; }
}

/* v12: more white space on both sides of the divider above ALL. */
#filters > .separator {
  margin-top: 12px;
  margin-bottom: 12px;
}

/* End-of-sequence message: center in the VIEWPORT, not in the area
   left of the filter column. Limit text width symmetrically so its right
   edge never enters the filter controls. */
.guidance-end-message {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: clamp(18px, 3vw, 52px);
  background: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.guidance-end-message.is-visible {
  opacity: 1;
  visibility: visible;
}

.guidance-end-message-text {
  margin: 0;
  box-sizing: border-box;
  width: min(760px, var(--guidance-end-text-max, 760px));
  max-width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
  font-family: 'Space Mono', monospace;
  font-size: clamp(20px, 2.6vw, 44px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.04em;
  text-wrap: balance;
  text-align: center;
  color: #000;
}

@media (max-width: 700px) {
  .guidance-end-message {
    /* Crucially, keep BOTH axes centered also on narrow viewports. */
    align-items: center;
    justify-content: center;
    padding: var(--edge, 14px);
  }
  .guidance-end-message-text {
    font-size: clamp(13px, 3.25vw, 18px);
    line-height: 1.25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guidance-end-message { transition: none; }
}
