/* ============================================================
   Michelle Yin — michelleyin.com
   v3: editorial split hero + film strip reel + terminal receipts.
   Near-monochrome chrome; the products bring the color.
   ============================================================ */

/* ---------- Fonts (self-hosted) ---------- */

@font-face {
  font-family: 'Geist Mono';
  src: url('../assets/fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Jokker';
  src: url('../assets/fonts/Jokker-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --paper: #FAFAF7;
  --ink: #161616;
  --ink-60: rgba(22, 22, 22, 0.62);
  --ink-40: rgba(22, 22, 22, 0.4);
  --hairline: rgba(22, 22, 22, 0.16);
  --tile: #F1F0EB;
  --pink: #EE2D68;

  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --font-display: 'Jokker', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* the top nav is gone — kept at 0 so the offset math collapses cleanly */
  --topbar-h: 0px;
  --ticker-h: 40px;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* anchor jumps clear the fixed ticker + sticky topbar */
  scroll-padding-top: calc(var(--ticker-h) + var(--topbar-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* keep the fixed top ticker off the content */
  padding-top: var(--ticker-h);
}

h1, h2, h3, p, ul, ol, figure, blockquote {
  margin: 0;
}

ul, ol {
  padding: 0;
}

img, video {
  max-width: 100%;
}

::selection {
  background: var(--pink);
  color: #fff;
}

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

.container {
  width: min(1140px, 100% - 40px);
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.55rem 0.9rem;
  border-radius: 0 0 6px 6px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.skip-link:focus {
  top: 0;
}

.contact {
  scroll-margin-top: 4.5rem;
}

/* ---------- Shared mono pieces ---------- */

.mono-link {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  /* invisible tap-target padding, cancelled by negative margins */
  display: inline-block;
  padding: 12px 8px;
  margin: -12px -8px;
}

.mono-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--pink);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

/* ---------- Ticker (fixed, top) ---------- */

.ticker {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 50;
  height: var(--ticker-h);
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: stretch;
}

.ticker-viewport {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 60s linear infinite;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-copy {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.ticker-clock {
  color: var(--pink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ticker-pause {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-60);
  background: none;
  border: 0;
  border-left: 1px solid var(--hairline);
  padding: 0 20px;
  cursor: pointer;
  white-space: nowrap;
}

.ticker-pause:hover {
  color: var(--ink);
}

@media (max-width: 440px) {
  .ticker-pause {
    padding: 0 14px;
  }
}

/* set by the pause-motion toggle in main.js */
.motion-paused .ticker-track {
  animation-play-state: paused;
}

/* ---------- Hero: editorial split spread ---------- */

.hero {
  display: flex;
  flex-direction: column;
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.75rem 20px 3.5rem;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-60);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 5.5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 1.1rem 0 1.5rem;
}

.intro-copy {
  max-width: 34em;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
}

.intro-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  list-style: none;
  margin-top: 1.9rem;
}

/* photo first on small screens; DOM keeps the h1 first for readers */
.hero-photo {
  order: -1;
  width: 100%;
  height: 65vw;
}

.hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--tile);
}

@media (min-width: 1100px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
    /* short of the fold so the work grid peeks and pulls the eye down */
    min-height: calc(88vh - var(--ticker-h) - var(--topbar-h));
  }
  .hero-text {
    grid-column: 1;
    grid-row: 1;
    padding: clamp(3rem, 6vw, 5.5rem) clamp(2.5rem, 5vw, 5rem);
  }
  /* the photo bleeds to the viewport's right edge and the hero's foot:
     no radius, no border — a magazine spread, not a card */
  .hero-photo {
    order: 0;
    grid-column: 2;
    grid-row: 1;
    position: relative;
    height: auto;
  }
  .hero-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
}

/* ---------- Work: uniform trio + billboard moment ---------- */

.workgrid {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.work-tiles {
  display: grid;
  gap: 10px;
}

.tile-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--tile);
  /* stacked full-bleed on small screens: contained portrait so a
     full-width tile fills the space without dominating the screen */
  aspect-ratio: 4 / 5;
  scroll-margin-top: calc(var(--ticker-h) + var(--topbar-h) + 10px);
}

.tile-card video,
.tile-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* keep the "Michelle's internet bedroom" title in frame when cropping */
#internetbedroom video {
  object-position: top;
}

/* the housewarming promo image is ~0.63 ratio; bias the crop upward so
   the phone mockup + friendship card stay centered in the tile and the
   baked-in headline reads at the top, at both the 3/5 and 4/5 crops */
#housewarming img {
  object-position: 50% 34%;
}

/* on mobile (vertical stack, heights need not match), let this tile take
   the promo image's near-native ratio and pin the crop to the TOP so the
   full "a close friends only social app…" headline always reads; only the
   phone's lower camera edge crops off, and the caption sits over it */
@media (max-width: 899.98px) {
  #housewarming {
    aspect-ratio: 5 / 8;
  }
  #housewarming img {
    object-position: 50% 0%;
  }
}

/* the promo image is light and already carries its own text — keep the
   scrim short and gentle so it only anchors the caption without dimming
   the phone mockup above it */
#housewarming .tile-scrim {
  height: 46%;
  background: linear-gradient(to top, rgba(12, 9, 10, 0.86), rgba(12, 9, 10, 0));
}

/* the billboard: landscape photo, so a gentler frame when narrow */
#discz {
  aspect-ratio: 4 / 3;
}

/* keep the white billboard band ("The app where artists get discovered")
   fully readable in every crop. Y (42%) tunes the wide crops: the band's
   center sits ~45% down the photo, so bias the window slightly above
   center. X (46%) tunes the narrow square crop below: the band copy
   starts ~11.5% in from the left, so nudge the window left to keep it. */
#discz img {
  object-position: 46% 42%;
}

/* the billboard's bright LED rows sit right behind the caption in every
   crop (rainbow wall on the square, white parade photo on the 4/3, the
   Levi's/Invicta row on the 21/9) — deepen and raise the scrim on this
   tile only, at every width (same system gradient) */
#discz .tile-scrim {
  height: 64%;
  background: linear-gradient(to top, rgba(12, 9, 10, 0.82), rgba(12, 9, 10, 0));
}

@media (max-width: 600px) {
  /* at phone widths a 4/3 tile puts the band's lower-left corner under
     the caption (white on white) — go square so the caption sits in the
     dark strip beneath the band instead */
  #discz {
    aspect-ratio: 1 / 1;
  }
}

.tile-scrim {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  background: linear-gradient(to top, rgba(12, 9, 10, 0.68), rgba(12, 9, 10, 0));
}

/* Verse's resting frame has white sign-lettering right behind the caption —
   deepen its scrim to match the bespoke treatment of the other tiles */
#verse .tile-scrim {
  height: 64%;
  background: linear-gradient(to top, rgba(12, 9, 10, 0.85), rgba(12, 9, 10, 0));
}

.tile-text {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  color: #fff;
}

.tile-caption {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.45;
  max-width: 38em;
}

.tile-receipts {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 0.45rem;
  /* when the line wraps, balance equalizes the two line lengths; the
     &nbsp; glued before each "·" in the markup binds separators to the
     preceding token, so breaks can only fall AFTER a separator — a
     trailing "·" (the editorial 'continued' cue) never a leading one */
  text-wrap: balance;
}

/* the work section breaks to the trio earlier than the hero split
   (which stays at 1100px): at 900–1099 a single centered 520px column
   is taller than a landscape-tablet viewport, while trio tiles land at
   286–353px — comfortably above the caption legibility floor */
@media (min-width: 900px) {
  /* the trio: three identical portrait tiles in one row */
  .work-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tile-card {
    aspect-ratio: 3 / 5;
  }

  /* the billboard moment: one full-width landscape beneath the trio */
  #discz {
    aspect-ratio: 21 / 9;
  }
}

/* ---------- Press: the clippings ---------- */

.press {
  padding: 4.5rem 0 5rem;
  scroll-margin-top: calc(var(--ticker-h) + var(--topbar-h) + 16px);
}

.press-label {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-60);
  padding-bottom: 1.4rem;
}

.press-list {
  list-style: none;
  border-bottom: 1px solid var(--hairline);
}

.press-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.05rem 0.75rem 1.05rem 0;
  border-top: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.12s ease;
}

.press-row:hover {
  background: var(--tile);
}

.press-outlet {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.press-headline {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink);
}

.press-year {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--ink-60);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.press-row:hover .press-year {
  color: var(--pink);
}

/* phone widths: two-line clipping — outlet + year on line 1, headline below */
@media (max-width: 600px) {
  .press-row {
    grid-template-columns: 1fr auto;
    gap: 0.15rem 1rem;
    padding: 0.85rem 0;
  }
  .press-outlet {
    grid-column: 1;
    grid-row: 1;
  }
  .press-year {
    grid-column: 2;
    grid-row: 1;
  }
  .press-headline {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* ---------- Contact / footer ---------- */

.contact {
  /* the press section above is borderless — close it off */
  border-top: 1px solid var(--hairline);
  padding: 2rem 0 1rem;
}

.smallprint {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-40);
}

/* ---------- Touch targets ---------- */

@media (pointer: coarse) {
  :root {
    --ticker-h: 44px;
  }
}

/* ---------- Scroll reveals ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .press-row {
    transition: none;
  }
}
