/* ---------------------------------------------------------------
   kuevi.design — portfolio
   --------------------------------------------------------------- */

@font-face {
  font-family: 'Nohemi';
  src: url('../assets/other/Nohemi-Medium.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --fg: #f5f5f7;
  --muted: rgba(245, 245, 247, 0.55);
  --line: rgba(245, 245, 247, 0.16);
  --accent: #ffb300;

  --pad-x: clamp(1.25rem, 3vw, 2.75rem);
  --pad-y: clamp(1.1rem, 2.2vw, 1.85rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* Home doesn't scroll but project pages do. Without a permanently reserved
     gutter the content box changes width between them and the centred wordmark
     jumps ~7.5px on navigation. overflow-y:scroll reserves it on every page;
     scrollbar-gutter keeps it tidy where supported. */
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 245, 247, 0.22) transparent;
}

/* WebKit equivalent of the above */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(245, 245, 247, 0.22);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(245, 245, 247, 0.34); }

body {
  min-height: 100vh;
  color: var(--fg);
  font-family: 'Nohemi', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* soft light bloom off the top corners, falling away to near-black */
  background-color: #17181c;
  background-image:
    radial-gradient(88% 72% at -4% -10%, rgba(203, 211, 226, 0.62), transparent 64%),
    radial-gradient(82% 66% at 104% -8%, rgba(191, 199, 216, 0.54), transparent 64%),
    radial-gradient(70% 58% at -10% 104%, rgba(168, 178, 198, 0.30), transparent 66%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

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

::selection { background: var(--accent); color: #101114; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* small caps-y label used for meta text throughout */
.meta {
  font-size: clamp(0.5rem, 0.62vw, 0.66rem);
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* ---------------------------------------------------------------
   HOME
   --------------------------------------------------------------- */

/* Deliberately NOT overflow:hidden — that would propagate to the viewport and
   stop html being a scroll container, which cancels scrollbar-gutter and shifts
   the centred wordmark 7.5px between home and the project pages. The stage is
   exactly one viewport tall, so nothing scrolls anyway. */
.home { overflow-x: clip; }

.wordmark {
  /* absolute, not fixed — pinned to the top of the document so it scrolls away
     with the page instead of sitting over the gallery. left:50% still resolves
     against the viewport width, so it stays centred. */
  position: absolute;
  top: var(--pad-y);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: clamp(96px, 11vw, 152px);
  transition: opacity 0.35s var(--ease);
}
.wordmark:hover { opacity: 0.65; }

.stage {
  position: relative;
  height: 100vh;
  height: 100svh;
}

/* preview panel (left) --------------------------------------- */

.preview {
  position: absolute;
  top: 50%;
  left: clamp(1.25rem, 8vw, 7.5rem);
  transform: translateY(-50%);
  /* Also capped against viewport height: sized on width alone, a short window
     grows this box down into the headline. 42vh wide => 52.5vh tall, so the
     bottom edge never passes 76.25vh. */
  width: min(clamp(230px, 27vw, 400px), 42vh);
  aspect-ratio: 4 / 5;
}

.preview-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

.preview-item.is-active { opacity: 1; }

.preview-item img,
.preview-item video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* the resting-state monogram is smaller than a full collage */
.preview-item.is-default img { transform: scale(0.82); }

/* subject list + socials (centre) ------------------------------ */

.column {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.subjects { list-style: none; }

.subject {
  display: inline-flex;
  align-items: baseline;
  gap: 0.7em;
  padding: 0.34em 0;
  /* matches .statement p */
  font-size: clamp(0.56rem, 0.76vw, 0.78rem);
  letter-spacing: 0.03em;
  color: var(--fg);
  transition: color 0.25s var(--ease);
}

.subject::before {
  content: '-';
  flex: none;
  color: inherit;
}

.subject:hover,
.subject:focus-visible { color: var(--accent); }

.social {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: clamp(1.75rem, 4vw, 3rem);
}

.social a {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  opacity: 0.85;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.social a:hover { opacity: 1; transform: translateY(-2px); }
.social img { width: 100%; height: auto; }

/* founder statement (right) ------------------------------------ */

.statement {
  position: absolute;
  top: 50%;
  right: var(--pad-x);
  transform: translateY(-50%);
  width: clamp(190px, 21vw, 300px);
  text-align: right;
}

.statement p {
  font-size: clamp(0.56rem, 0.76vw, 0.78rem);
  line-height: 1.5;
  letter-spacing: 0.03em;
}

.statement .attribution {
  margin-top: 1.4em;
  color: var(--muted);
  letter-spacing: 0.12em;
}

/* headline (bottom right) ------------------------------------- */

.headline {
  position: absolute;
  right: var(--pad-x);
  bottom: clamp(0.6rem, 1.6vh, 1.4rem);
  max-width: calc(100% - var(--pad-x) * 2);
  text-align: right;
  /* 14vh cap keeps the type off the preview on short windows; nowrap keeps it
     one line, so its height stays predictable no matter how long the title is.
     Top edge therefore never rises above ~83.9vh, clearing the preview. */
  font-size: min(clamp(2rem, 6.6vw, 8rem), 14vh);
  white-space: nowrap;
  line-height: 0.95;
  letter-spacing: -0.015em;
  pointer-events: none;
  z-index: 5;
}

.headline-text {
  display: inline-block; /* shrinks to the text so JS can measure it */
  transition: opacity 0.28s var(--ease);
}

.headline.is-swapping .headline-text { opacity: 0; }

/* ---------------------------------------------------------------
   PROJECT PAGES
   --------------------------------------------------------------- */

.project { overflow-x: hidden; }

.project-head {
  min-height: 66vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--pad-y) * 5) var(--pad-x) clamp(1.75rem, 4vw, 3rem);
}

.project-title {
  font-size: clamp(2rem, 8.4vw, 9rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  font-weight: 500;
}

/* meta on the left, statement on the right — echoes the home composition */
.project-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(1.5rem, 5vw, 5rem);
  margin-top: clamp(1rem, 2vw, 1.6rem);
  padding-top: clamp(0.85rem, 1.6vw, 1.25rem);
  border-top: 1px solid var(--line);
}

.project-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem clamp(1.25rem, 3vw, 3rem);
}

.project-foot .statement {
  position: static;
  transform: none;
  flex: none;
  width: clamp(240px, 30vw, 420px);
}

/* gallery — even columns, natural heights ---------------------- */

.gallery {
  padding: 0 var(--pad-x) clamp(4rem, 10vw, 8rem);
  columns: 2;
  column-gap: clamp(0.6rem, 1.4vw, 1.25rem);
}

.gallery figure {
  break-inside: avoid;
  margin: 0 0 clamp(0.6rem, 1.4vw, 1.25rem);
  background: rgba(245, 245, 247, 0.05);
  overflow: hidden;
}

.gallery img,
.gallery video {
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

.gallery img.is-loaded,
.gallery video.is-loaded { opacity: 1; }

/* next project ------------------------------------------------- */

.next {
  display: block;
  padding: clamp(2.5rem, 7vw, 6rem) var(--pad-x) clamp(3rem, 8vw, 6rem);
  border-top: 1px solid var(--line);
}

.next .meta { margin-bottom: 0.7rem; }

.next-name {
  font-size: clamp(1.6rem, 5.5vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  transition: color 0.25s var(--ease);
}

.next:hover .next-name { color: var(--accent); }

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

@media (min-width: 1700px) {
  .gallery { columns: 3; }
}

@media (max-width: 1000px) {
  .home { overflow: auto; }

  .stage {
    height: auto;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(2rem, 6vw, 3rem);
    padding: calc(var(--pad-y) * 5) var(--pad-x) calc(var(--pad-y) * 3);
  }

  /* the panel is hover-driven — in a stacked layout it would just sit empty */
  .preview { display: none; }

  .column,
  .statement {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    transform: none;
    width: auto;
    text-align: left;
  }

  /* bumped together so the two stay matched */
  .subject,
  .statement p { font-size: clamp(0.8rem, 2.4vw, 0.95rem); }

  .statement { max-width: 34rem; }

  .headline {
    position: relative;
    right: auto;
    bottom: auto;
    max-width: none;
    text-align: left;
    font-size: clamp(1.9rem, 9vw, 4rem);
    white-space: normal; /* preview is hidden here — wrapping is free */
  }

  .gallery { columns: 1; }

  .project-head { min-height: 50vh; }
}

@media (hover: none) {
  .preview { display: none; }
}

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