/* Sabrina Montoya — sabrinamontoya.design
   Sizes are set against the 1920px-wide Figma frames: 1vw ≈ 19.2px there. */

:root {
  --lav: #e9d8f8;        /* page lavender */
  --ink: #000;
  --paper: #fff;         /* body text on black */
  --rule: rgba(0, 0, 0, .55);
  --rule-dark: rgba(255, 255, 255, .45);
  --pad: clamp(16px, 2.3vw, 44px);
  --font: "Inter", "Helvetica Neue", Arial, sans-serif;
  --band: clamp(260px, 30vw, 580px); /* height of the mosaic and the logo band */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--lav); color: var(--ink); line-height: 1.4; }
/* Reel sizing, shared by the reel and the About section below it.
   --rw/--rh: the video's size (full width, but never taller than the
   window, and at least 440px tall). --reel-gap: the empty space a centred
   video leaves below it on tall, narrow screens. */
body {
  container-type: inline-size;
  --reel-pad: clamp(16px, 2vw, 40px);
  --rw: min(100cqw - var(--pad) * 2, max(440px, 100svh - var(--reel-pad) * 2) * 16 / 9);
  --rh: calc(var(--rw) * 9 / 16);
  --reel-gap: max(0px, 50svh - var(--rh) / 2 - var(--reel-pad));
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
.dark { background: var(--ink); color: var(--paper); }

/* ---------- Name block (hero + category pages) ---------- */
/* The name logo, from the Figma "Capa_1" frame (605 x 231.5 at 93.55px
   Inter Black). Everything is in em so it keeps those exact proportions at
   any size: box 6.466em x 2.475em, text 0.145em from the left, lines 1em
   apart. Top/bottom padding include the difference between Figma's
   "normal" line height (1.21) and the 1 used here. */
.name {
  display: inline-block;
  box-sizing: border-box;
  width: 6.466em;
  height: 2.475em;
  padding: .204em 0 0 .145em;
  background: var(--ink);
  color: var(--lav);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(34px, 4.87vw, 94px);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  padding-top: clamp(20px, 4.4vw, 84px);
}
.hero .name { align-self: flex-start; }
.hero-title {
  margin-top: auto;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: right;
}
.hero-title h1 {
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(38px, 6.55vw, 126px);
  line-height: .86;
  letter-spacing: -.015em;
  margin-top: .02em;
}
.hero-title p {
  font-weight: 300;
  font-size: clamp(18px, 3.45vw, 66px);
  line-height: 1.12;
  letter-spacing: -.01em;
}
.hero-intro {
  align-self: flex-end;
  width: min(100%, 39vw);
  min-width: min(100%, 360px);
  margin: clamp(20px, 2.6vw, 50px) 0 clamp(20px, 4vw, 80px);
  font-size: clamp(15px, 1.25vw, 24px);
  line-height: 1.5;
  text-align: justify;
  hyphens: none;
}
.hero-intro b { font-weight: 700; }

/* ---------- Tilted work mosaic ---------- */
.mosaic {
  position: relative;
  height: var(--band);
  overflow: hidden;
  background: var(--lav);
}
.mosaic-track {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  gap: var(--gap);
  --tile: clamp(170px, 16vw, 320px);
  --gap: clamp(8px, .9vw, 18px);
  transform: translate(-50%, -50%) rotate(-10deg);
}
.mosaic-col { display: flex; flex-direction: column; gap: var(--gap); }
.mosaic-col:nth-child(odd) { transform: translateY(calc(var(--tile) * -.42)); }
.mosaic .tile { width: var(--tile); height: var(--tile); }

/* ---------- Tiles (shared) ---------- */
.tile {
  position: relative;
  overflow: hidden;
  background: #111;
  cursor: pointer;
}
.tile img, .tile video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.tile video { opacity: 0; transition: opacity .3s; }
.tile video.on { opacity: 1; }

/* ---------- Services ---------- */
/* One window tall, words centred; never shorter than 600px so the words and
   floating thumbnails keep room on short or landscape screens. */
.services {
  position: relative;
  overflow: hidden;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  padding: var(--pad);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cats {
  position: relative;
  z-index: 2;
  list-style: none;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cats li { display: flex; align-items: center; position: relative; }
.cats a {
  display: block;
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(36px, 4.75vw, 92px);
  line-height: .96;
  letter-spacing: -.01em;
  color: var(--lav);
  position: relative;
  transition: color .45s;
}
/* Hover: swirling green paint, drawn live by a small WebGL shader in
   js/site.js and masked to the word's letters. The paint canvas fades in
   over the word while the lavender fades out. Without WebGL the word just
   turns green. */
.cats li:nth-child(n) a:hover, .cats li:nth-child(n) a:focus-visible { color: #fff; outline: none; }
.cats li:nth-child(n) a.painting { color: transparent; }
.cats .paint {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity .45s;
  z-index: 1;
}
.cats .paint.on { opacity: 1; }
.cats .note {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-weight: 300;
  font-size: clamp(11px, 1vw, 19px);
  line-height: 1.25;
  color: var(--paper);
}
.cats .note.left { right: calc(100% + .7em); text-align: right; } /* lines flush against the word */
.cats .note.right { left: calc(100% + .9em); }
/* On screens with a mouse, a word's note shows only while it's hovered,
   switching straight on and off. */
@media (hover: hover) and (min-width: 821px) {
  .cats .note { visibility: hidden; }
  .cats li:hover .note, .cats li:focus-within .note { visibility: visible; }
}

/* Hovering a word pops in its projects behind the words; js/site.js sets
   each one's size and spot. No fades: they switch on and off. */
.floaters { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.floaters .tile { position: absolute; background: #111; visibility: hidden; }
.floaters .tile.on { visibility: visible; }

/* ---------- Clients + reel ---------- */
/* Logos in a band as tall as the mosaic, then the reel. */
.clients { padding: 0 var(--pad); }
.logos {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, 2.4vw, 48px);
  height: var(--band); /* same height as the tilted mosaic */
  margin: 0 calc(var(--pad) * -1);
  overflow: hidden;
}
.logo-row { overflow: hidden; }
.logo-track {
  list-style: none;
  display: flex;
  align-items: center;
  width: max-content;
  animation: logos-left var(--logo-speed, 99s) linear infinite;
}
.logo-row:nth-child(2) .logo-track { animation-name: logos-right; }
@keyframes logos-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes logos-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .logo-track { animation: none; } }
/* Logos are SVGs from Sabrina's Illustrator file. --w is each one's width in
   the 1920px Figma frame, so they keep the Figma's relative sizes and scale
   with the window. Shown at 1.65× the Figma size. */
.logo-track li { line-height: 0; padding-right: clamp(28px, 3.4vw, 64px); }
.logos img {
  width: clamp(calc(var(--w) * .825px), calc(var(--w) * .0859vw), calc(var(--w) * 2.23px)); /* 1.65× the Figma sizes */
  height: auto;
}
/* Wolford's file is a picture on white; multiply drops the white into the
   lavender. The moving track is its own layer, so it needs the lavender
   behind it for multiply to have something to blend with. */
.logo-track { background: var(--lav); }
.logos img[src*="wolford"] { mix-blend-mode: multiply; }
/* The reel starts right under the logos, rises to the middle of the screen
   and sticks there while you scroll, then lets go the moment the logos
   leave the top of the screen (which is also when the section's bottom
   meets the bottom of the screen), scrolling up with the page from there.
   --rw/--rh: the video's size (full width, but never taller than the
   window, and at least 440px tall). The content height is set so the
   release lands exactly then; the bottom padding is the gap left under
   the centred video, so the section's bottom meets the bottom of the
   screen at that moment. */
.reel {
  box-sizing: content-box;
  height: max(var(--rh), (100svh + var(--rh)) / 2 - var(--reel-pad));
  padding: var(--reel-pad) 0 max(var(--reel-pad) * 3, var(--reel-pad) + var(--reel-gap)); /* at least 3x the top gap below the video */
}
.reel video {
  display: block;
  width: var(--rw);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  object-fit: cover;
  position: sticky;
  top: max(var(--reel-pad), 50svh - var(--rh) / 2);
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 56fr) minmax(0, 44fr);
  gap: var(--pad);
  /* --rise: About gets this much extra height at the top: 100px, or more
     on tall, narrow screens where the reel leaves lavender below it. js/site.js holds the
     text and ABOUT in place for the last --rise of scrolling, so About
     enters as normal and then only its black top, phone and email keep
     rising. */
  --rise: max(100px, var(--reel-gap) * .45);
  padding: calc(clamp(36px, 2.6vw, 50px) + var(--rise)) var(--pad) clamp(30px, 2.4vw, 46px);
  min-height: 37.5vw;
}
.about-text {
  grid-row: 1 / 3;
  padding: clamp(40px, 4.6vw, 90px) 0 0 clamp(0px, 1vw, 20px);
  font-size: clamp(15px, 1.38vw, 26.5px);
  line-height: 1.42;
  text-align: justify;
}
.about-text p + p { margin-top: 1.4em; }
.contact { text-align: right; font-size: clamp(15px, 1.3vw, 25px); line-height: 1.55; margin-top: calc(var(--rise, 0px) * -1); /* stays at the top of the black */ }
.contact a:hover { color: var(--lav); }
.about h2 {
  align-self: end;
  justify-self: end;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(56px, 6.3vw, 122px);
  line-height: .8;
  color: var(--lav);
  letter-spacing: -.01em;
}

/* ---------- Category pages ---------- */
.cat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--pad);
  padding: var(--pad);
  padding-top: clamp(20px, 4.4vw, 84px);
}
.cat-head .name { font-size: clamp(26px, 3vw, 58px); }
.cat-nav { list-style: none; text-align: right; font-size: clamp(14px, 1.2vw, 22px); line-height: 1.5; }
.cat-nav a { font-weight: 300; }
.cat-nav a:hover { font-weight: 400; }
.cat-nav a[aria-current] { font-weight: 800; }
.cat-title {
  margin: clamp(40px, 8vw, 150px) var(--pad) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--pad);
}
.cat-title h1 {
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(42px, 8.5vw, 164px);
  line-height: .84;
  letter-spacing: -.015em;
}
.cat-title p { font-weight: 300; font-size: clamp(14px, 1.45vw, 28px); text-align: right; padding-bottom: .5em; }
.grid {
  display: flex;
  align-items: flex-start;
  gap: clamp(10px, 1.2vw, 22px);
  padding: clamp(30px, 3.4vw, 64px) var(--pad) clamp(60px, 6vw, 120px);
}
.grid-col { flex: 1; min-width: 0; }
.grid .item { margin-bottom: clamp(10px, 1.2vw, 22px); }
.grid .tile { width: 100%; }
.grid .cap { font-size: clamp(13px, .95vw, 18px); padding: .45em 0 0; font-weight: 400; }
.grid .cap span { font-weight: 300; opacity: .7; }

.foot {
  display: flex; justify-content: space-between; align-items: flex-end; gap: var(--pad);
  padding: clamp(30px, 3vw, 56px) var(--pad);
  font-size: clamp(14px, 1.2vw, 22px);
}
.foot a:hover { color: var(--lav); }
.foot .big { font-weight: 900; font-size: clamp(40px, 5vw, 96px); line-height: .8; color: var(--lav); text-transform: uppercase; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, .92);
  display: none; align-items: center; justify-content: center; flex-direction: column;
  padding: var(--pad);
  color: var(--paper);
}
.lightbox.open { display: flex; }
.lightbox video { max-width: 100%; max-height: calc(100vh - 140px); }
.lightbox .lb-cap { margin-top: 14px; font-size: 16px; }
.lightbox button {
  position: absolute; top: var(--pad); right: var(--pad);
  background: none; border: 0; color: var(--lav); font: 300 32px/1 var(--font); cursor: pointer;
}

/* ---------- Narrow screens ---------- */
@media (max-width: 820px) {
  .hero-intro, .about-text { width: 100%; text-align: left; }
  .cats .note { position: static; transform: none; white-space: normal; font-size: 12px; }
  .cats li { flex-direction: column; margin-bottom: .6em; }
  .cats li .note { order: 2; text-align: center !important; }
  .floaters { display: none; }
  .about { grid-template-columns: 1fr; }
  .about-text { grid-row: auto; padding-top: 0; }
  .contact { order: -1; text-align: left; }
  .about h2 { justify-self: start; }
  .cat-head { flex-direction: column; }
  .cat-nav { text-align: left; display: flex; flex-wrap: wrap; gap: 0 1em; }
  .cat-title { flex-direction: column; align-items: flex-start; }
  .cat-title p { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .tile video { transition: none; }
}
