/* ============================================================
   PARKK — STYLES
   Tokens first; everything derives from them.
   ============================================================ */

:root {
  --ink: #0b0b0c;
  --paper: #f2f2ef;
  --mute: #86867f;
  --line: rgba(11, 11, 12, 0.14);
  --accent: #2431ff;

  --font-sans: "neue-haas-grotesk-text", "Neue Haas Grotesk Text", "neue-haas-grotesk-display", "Neue Haas Grotesk Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: var(--font-sans); /* mono retired: labels use the sans stack */

  --nav-h: 56px;
  --pad: clamp(16px, 2.2vw, 32px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.6s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
html, body { background: var(--paper); overflow-x: clip; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- smooth-scroll shell ---------- */
/* JS transforms #smooth; body height is synced to its height. */
#smooth { will-change: transform; }
html.native-scroll #smooth { will-change: auto; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--pad);
  z-index: 100;
  mix-blend-mode: difference;
  color: #fff;
}
.nav a, .nav button { color: #fff; }

.nav__mark {
  justify-self: start;
  font-family: "Archivo", var(--font-sans);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav__clock {
  justify-self: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
}

.nav__links {
  justify-self: end;
  display: flex;
  gap: clamp(14px, 2vw, 28px);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nav__links a, .nav__links button {
  position: relative;
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
}
.nav__links a::after, .nav__links button::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.nav__links a:hover::after, .nav__links button:hover::after,
.nav__links .is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ============================================================
   PLACEHOLDER MEDIA
   Animated tinted field + label telling you what file goes here.
   Disappears automatically once a real src is set in data.js.
   ============================================================ */
.ph {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(120deg,
      hsl(var(--h, 200) 18% 14%) 0%,
      hsl(var(--h, 200) 30% 22%) 45%,
      hsl(var(--h, 200) 16% 10%) 100%);
}
.ph::before {
  content: "";
  position: absolute;
  inset: -60%;
  background:
    radial-gradient(40% 55% at 30% 35%, hsl(var(--h, 200) 70% 55% / 0.5), transparent 65%),
    radial-gradient(45% 60% at 72% 68%, hsl(calc(var(--h, 200) + 40) 75% 60% / 0.4), transparent 65%);
  animation: ph-drift 14s ease-in-out infinite alternate;
}
@keyframes ph-drift {
  from { transform: translate(-4%, -3%) rotate(0deg) scale(1); }
  to   { transform: translate(4%, 3%) rotate(8deg) scale(1.12); }
}
.ph__label {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  border: 1px dashed rgba(255,255,255,0.45);
  padding: 8px 12px;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

.media-frame {
  position: relative;
  overflow: hidden;
  background: #101012;
}
.media-frame video,
.media-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Background Vimeo: scale a 16:9 player to fully cover any frame aspect */
.media-frame .vimeo-embed {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw;      /* 16:9 relative to width */
  min-width: 177.78%;   /* 100 / 56.25, so height-bound frames still cover */
  min-height: 100%;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}

/* ============================================================
   FEED VIEW  (default home view)
   ============================================================ */
.feed { display: block; }
.feed-item {
  position: relative;
  display: block;
}

/* ============================================================
   DECK VIEW (default "stack" home view)
   Cards pin in place with rounded corners; the next card peeks
   from the bottom and rises over the current one on scroll while
   the covered card recedes. Motion is driven from js (Deck).
   ============================================================ */
body:not(.mode-grid) .feed { position: relative; }
body:not(.mode-grid) .feed-item {
  position: absolute;
  top: 6vh;
  left: var(--pad);
  right: var(--pad);
  height: 84vh;
  border-radius: clamp(14px, 1.6vw, 24px);
  overflow: hidden;
  background: #101012;
  will-change: transform;
}

/* the sizzle reel is the first feed item; it has no link or meta */
.feed-item--sizzle { background: #101012; overflow: hidden; }
.feed-item--sizzle .feed-item__scrim { height: 24%; opacity: 0.55; }
.feed-item .media-frame { position: absolute; inset: 0; }

.feed-item__scrim {
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
  pointer-events: none;
}

.feed-item__meta {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: var(--pad);
  color: #fff;
}

.feed-item__title {
  font-weight: 800;
  font-size: clamp(22px, 3.2vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  max-width: 14ch;
}
.feed-item__blurb {
  margin-top: 10px;
  font-size: clamp(15px, 1.5vw, 19px);
  max-width: 44ch;
  opacity: 0.85;
}
.feed-item__idx {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  padding-bottom: 6px;
}

/* ============================================================
   GRID VIEW  (toggled via body.mode-grid)
   Even 3-column grid, uniform 4:5 cards, media cover-cropped.
   ============================================================ */
body.mode-grid .feed {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 24px);
  padding: calc(var(--nav-h) + 20px) var(--pad) 10vh;
}
body.mode-grid .feed-item {
  position: relative;
  height: auto;
  min-height: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: clamp(10px, 1.1vw, 18px);
}
body.mode-grid .feed { height: auto !important; }
body.mode-grid .feed-item .media-frame {
  transition: transform 0.6s var(--ease-out);
}
body.mode-grid .feed-item:hover .media-frame {
  transform: scale(1.04);
}
body.mode-grid .feed-item__meta { padding: 14px 16px; }
body.mode-grid .feed-item__title {
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
body.mode-grid .feed-item__blurb,
body.mode-grid .feed-item__idx { display: none; }
body.mode-grid .feed-item__scrim { height: 55%; }

/* media covers the 4:5 card: 16:9 sources fit to height, sides crop */
body.mode-grid .feed-item .media-inner {
  inset: 0;                      /* no parallax bleed in grid */
  transform: none !important;    /* overrides the parallax frame transform */
}

@media (max-width: 1100px) {
  body.mode-grid .feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body.mode-grid .feed { grid-template-columns: 1fr; }
}

/* the grid/stack switch only applies to work views, not index */
body.mode-index #gridToggle { display: none; }

/* reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }

/* subtle parallax inner */
.feed-item .media-inner {
  position: absolute;
  inset: -8% 0;
  will-change: transform;
}
.feed-item .media-inner .ph,
.feed-item .media-inner video,
.feed-item .media-inner img { position: absolute; inset: 0; width: 100%; height: 100%; }
.feed-item .media-inner .vimeo-embed {
  position: absolute;
  top: 50%; left: 50%;
  width: 100vw; height: 56.25vw;
  min-width: 177.78%; min-height: 100%;
  transform: translate(-50%, -50%);
}

/* ============================================================
   INDEX VIEW  (Show all — dense list w/ hover preview)
   ============================================================ */
.index-view {
  display: none;
  padding: calc(var(--nav-h) + 4vh) var(--pad) 4vh;
}
body.mode-index .index-view { display: block; }
body.mode-index .feed { display: none; }

.index-head {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--mute);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) 12rem 3.5rem;
  gap: 16px;
  padding: 0 0 12px;
}

.index-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) 12rem 3.5rem;
  gap: 16px;
  /* uniform compact rows regardless of blurb wrap */
  align-items: start;
  align-content: center;
  min-height: 2.9rem;
  padding: 10px 0;
  transition: opacity 0.3s ease;
}
.index-list:hover .index-row { opacity: 0.35; }
.index-list:hover .index-row:hover { opacity: 1; }

.index-row__title {
  font-weight: 400;
  font-size: 14pt;
  line-height: 1.4;
  letter-spacing: 0;
  transition: color 0.3s;
}
.index-row:hover .index-row__title {
  color: var(--accent);
}
.index-row__blurb { font-size: 14pt; color: var(--mute); line-height: 1.4; }
.index-row__tags { font-family: var(--font-mono); font-size: 14pt; line-height: 1.4; }
.index-row__year { font-family: var(--font-mono); font-size: 14pt; line-height: 1.4; text-align: right; }

/* inline expanding preview: hovering a row morphs the list open
   and the cover media eases into its own full-width container */
.index-row__preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s var(--ease-out);
}
.index-row__preview-box {
  overflow: hidden;
  min-height: 0;
}
.index-row__preview .media-frame {
  height: clamp(240px, 42vh, 500px);
  margin: 20px 0 6px;
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  transition: opacity 0.4s ease 0.06s, transform 0.55s var(--ease-out) 0.06s;
}
@media (hover: hover) {
  .index-row:hover .index-row__preview { grid-template-rows: 1fr; }
  .index-row:hover .index-row__preview .media-frame {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   NEWS  (home, below feed)
   ============================================================ */
.news {
  padding: 6vh var(--pad) 10vh;
}
.news h2 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--mute);
  margin-bottom: 28px;
}
.news li {
  list-style: none;
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 16px;
  padding: 14px 0;
  font-size: 15px;
}
.news li a:hover { color: var(--accent); }
.news time { font-family: var(--font-mono); font-size: 11px; color: var(--mute); padding-top: 3px; }

/* ============================================================
   FOOTER  (marquee + contact)
   ============================================================ */
.footer { }

.marquee {
  overflow: hidden;
  white-space: nowrap;
  padding: 4vh 0;
}
.marquee__track {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0;
  will-change: transform;
  animation: marquee 26s linear infinite;
}
.marquee__track > span { flex: 0 0 auto; }
.marquee__track > span {
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(14px, 1.6vw, 24px);
  line-height: 1;
  letter-spacing: -0.02em;
  padding-right: 0.6em;
}
.marquee__track em { font-style: normal; color: var(--accent); }
.marquee__mark {
  display: inline-block;
  /* fixed size so the mark keeps its scale independent of text size */
  height: clamp(20px, 3.8vw, 56px);
  width: clamp(20px, 3.8vw, 56px);
  object-fit: contain;
  vertical-align: middle;
  margin: 0 0.6em;
  transform: translateY(-0.05em);
}
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee__track:has(.mq-swap:hover),
.marquee__track:has(.mq-cycle:hover) { animation-play-state: paused; }
.mq-swap, .mq-cycle { transition: color 0.2s; }
.mq-swap:hover { color: var(--accent); }
.mq-cycle { cursor: default; }

.footer__grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px var(--pad) 32px;
  font-size: 13px;
}
.footer__grid a:hover { color: var(--accent); }
.footer__grid .mono { font-family: var(--font-mono); font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.06em; }

/* ============================================================
   CASE STUDY
   ============================================================ */
.case-head {
  padding: calc(var(--nav-h) + 12vh) var(--pad) 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.case-head__title {
  font-weight: 800;
  font-size: clamp(24px, 3.6vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  max-width: 18ch;
}
.case-head__client {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  padding-bottom: 6px;
}

.case-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  padding: 8vh var(--pad) 10vh;
}
.case-intro__desc { font-size: clamp(18px, 2vw, 26px); line-height: 1.35; letter-spacing: -0.01em; max-width: 30ch; }
.case-credits { display: grid; gap: 14px; align-content: start; font-size: 14px; }
.case-credits dt { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mute); margin-bottom: 3px; }
.case-credits div { border-top: 1px solid var(--line); padding-top: 10px; }

.case-body { display: grid; gap: clamp(12px, 1.6vw, 24px); padding: 0 var(--pad) 10vh; }

.sec-full .media-frame { aspect-ratio: 16 / 9; width: 100%; }
.sec-twoup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 1.6vw, 24px);
}
.sec-twoup .media-frame { aspect-ratio: 4 / 5; }

/* grid section: mixed aspect ratios, uniform gaps, rounded corners.
   Each frame can set its own --ar; rows align to the tallest item. */
.sec-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 24px);
  align-items: start;
}
.sec-grid .media-frame {
  aspect-ratio: var(--ar, 1 / 1);
  border-radius: clamp(8px, 0.8vw, 14px);
  overflow: hidden;
}
.sec-text { padding: 6vh 0; max-width: 56ch; }
.sec-text h3 { font-family: var(--font-mono); font-size: 11px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mute); margin-bottom: 14px; }
.sec-text p { font-size: clamp(16px, 1.5vw, 20px); line-height: 1.5; }

.case-next { display: block; border-top: 1px solid var(--ink); }
.case-next .mono {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mute);
  padding: 24px var(--pad) 0;
}
.case-next__title {
  display: block;
  font-weight: 800;
  font-size: clamp(40px, 8vw, 120px);
  line-height: 1;
  letter-spacing: -0.03em;
  padding: 8px var(--pad) 6vh;
  transition: color 0.3s;
}
.case-next:hover .case-next__title { color: var(--accent); }

/* ============================================================
   ABOUT
   ============================================================ */
.about { padding: calc(var(--nav-h) + 12vh) var(--pad) 10vh; }
.about__intro {
  font-weight: 500;
  font-size: clamp(22px, 2.6vw, 32pt);
  line-height: 1.3;
  letter-spacing: -0.02em;
  max-width: 60ch;
  text-wrap: pretty;
}
.about__intro em { font-style: normal; color: var(--accent); }

.about__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 64px);
  margin-top: 12vh;
}
.about__col h2 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--mute);
  padding-top: 12px;
  margin-bottom: 18px;
}
.about__col p { margin-bottom: 1em; font-size: 14pt; font-weight: 400; max-width: 40ch; }
.about__col li { list-style: none; padding: 7px 0; font-size: 14pt; font-weight: 400; }

.client-groups { display: grid; gap: 24px; }
.client-group__label {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--mute);
  margin-bottom: 6px;
}
.client-list {
  font-size: 14pt;
  font-weight: 400;
  line-height: 1.5;
  max-width: 40ch;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .index-head { display: none; }
  .index-row { grid-template-columns: 1fr 3.4rem; }
  .index-row__blurb, .index-row__tags { display: none; }
  .case-intro { grid-template-columns: 1fr; }
  .about__grid { grid-template-columns: 1fr; gap: 40px; }
  .sec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  :root { --nav-h: 50px; }
  .nav { grid-template-columns: auto 1fr auto; gap: 12px; }
  .nav__clock { display: none; }
  /* narrow screens: landscape containers so more work is visible
     per scroll. Stack keeps its media's landscape ratio; grid cards
     flip from 4:5 portrait to 5:4 landscape. */
  body.mode-grid .feed-item { aspect-ratio: 5 / 4; }
  /* deck cards go landscape (16:9 of their width) on narrow screens */
  body:not(.mode-grid) .feed-item {
    height: calc((100vw - (2 * var(--pad))) * 0.5625);
    top: calc(var(--nav-h) + 4vh);
  }
  .feed-item__meta { flex-direction: column; align-items: flex-start; gap: 10px; }
  .sec-twoup { grid-template-columns: 1fr; }
  .sec-twoup .media-frame { aspect-ratio: 4 / 5; }
  .news li { grid-template-columns: 1fr; gap: 4px; }
}

/* extra headroom for the 3-button nav (Grid / Index / About) on
   the narrowest phones */
@media (max-width: 380px) {
  .nav__mark { font-size: 14px; }
  .nav__links { gap: 10px; font-size: 11px; }
  .nav__links a, .nav__links button { font-size: 11px; }
}

@media (min-width: 1800px) {
  body { font-size: 16px; }
  :root { --pad: 40px; }
}

/* landscape phones: keep feed usable */
@media (max-height: 480px) and (orientation: landscape) {
}

/* ============================================================
   MOTION PREFERENCES
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .ph::before, .marquee__track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}
