/* ============================================================
   really bad dogs — shared styles
   ============================================================ */

@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/space-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/space-mono-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/space-mono-latin-400-italic.woff2') format('woff2');
}

:root {
  --red: #E5310F;
  --red-deep: #C5260A;
  --black: #0E0E0E;
  --white: #FFFFFF;
  --paper: #FBFBF9;
  --gray: #8A8A8A;
  --gray-soft: #B6B6B6;

  --display: 'Anton', 'Arial Narrow', sans-serif;
  --mono: 'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --edge: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--black);
  font-family: var(--sans);
  overflow-x: hidden;
  cursor: none;
}

a { color: inherit; text-decoration: none; }
a, button, input, select, textarea, label { cursor: none; }
img { display: block; max-width: 100%; }

/* ---------- keyboard focus ----------
   Only shown for keyboard navigation (not mouse clicks). */
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.site-footer :focus-visible { outline-color: #fff; }
.topbar :focus-visible { outline-color: currentColor; }
.work-row:focus-visible { outline-offset: -4px; }

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

/* ---------- custom cursor ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 32px; height: 32px;
  background: url('images/site/cursor-small.png') center / contain no-repeat;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .25s ease, height .25s ease, opacity .25s ease;
}
.cursor.is-hover {
  width: 68px; height: 68px;
  background: url('images/site/cursor.png') center / contain no-repeat;
}
@media (hover: none) { .cursor { display: none; } body { cursor: auto; } }

/* ---------- mono label ---------- */
.mono {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ---------- top utility nav ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px var(--edge);
  mix-blend-mode: difference;
  color: #fff;
}
.topbar a { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.topbar .nav-links { display: flex; gap: 26px; }
.topbar .nav-links a { position: relative; }
.topbar .nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.topbar .nav-links a:hover::after,
.topbar .nav-links a:focus-visible::after { transform: scaleX(1); }

/* ---------- red hairline rule with bracketed labels ---------- */
.rule {
  border-top: 1.5px solid var(--red);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px var(--edge);
  color: var(--red);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}
.rule .accent { color: var(--black); }
.rule--bottom { border-top: none; border-bottom: 1.5px solid var(--red); }

/* ---------- logo wordmark ---------- */
.wordmark {
  font-family: var(--display);
  color: var(--red);
  line-height: .82;
  letter-spacing: .005em;
  text-transform: lowercase;
  font-weight: 400;
}

/* ---------- footer ---------- */
.site-footer {
  padding: clamp(60px, 10vw, 140px) var(--edge) 48px;
  background: var(--black);
  color: var(--white);
}
.site-footer .big {
  font-family: var(--display);
  color: var(--red);
  font-size: clamp(44px, 10vw, 168px);
  line-height: 1.0;
  text-transform: lowercase;
  margin: 0 0 .45em;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid rgba(255,255,255,.18);
  padding-top: 28px;
}
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col .mono { color: var(--gray-soft); font-size: 11px; }
.footer-col a.line { font-size: clamp(18px, 2vw, 26px); font-weight: 700; letter-spacing: -.01em; }
.hero__play .label--mobile { display: none; }

.footer-col a.line:hover,
.footer-col a.line:focus-visible { color: var(--red); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- spl hover text ---------- */
.hx { display: inline-block; transition: color .2s ease, transform .35s cubic-bezier(.2,.8,.2,1); }

/* ============================================================
   PROJECT (case study) pages
   ============================================================ */
.case-head {
  padding: clamp(36px, 6vw, 64px) var(--edge) clamp(24px, 3vw, 36px);
  text-align: center;
}
.case-head .back {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--red);
  display: inline-block;
  margin-bottom: clamp(20px, 3vw, 34px);
}
.case-head .back:hover,
.case-head .back:focus-visible { color: var(--black); }
.case-head .logo {
  font-family: var(--display);
  color: var(--red);
  font-size: clamp(44px, 8vw, 104px);
  line-height: .82;
  text-transform: lowercase;
  letter-spacing: .004em;
}

.case-hero {
  position: relative;
  margin: clamp(20px, 3vw, 36px) var(--edge) 0;
  height: clamp(320px, 52vw, 720px);
}
.case-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.case-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 55%);
  pointer-events: none;
  z-index: 1;
}
.case-hero__caption {
  position: absolute;
  z-index: 2;
  left: clamp(20px, 4vw, 56px);
  bottom: clamp(28px, 4vw, 56px);
  right: clamp(20px, 4vw, 56px);
  color: #fff;
  text-shadow: 0 2px 40px rgba(0,0,0,.35);
  pointer-events: none;
}
.case-hero__caption h1 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 112px);
  line-height: .95;
  letter-spacing: -.02em;
  margin: 0;
}
.case-hero__caption .lede {
  font-size: clamp(16px, 1.7vw, 26px);
  font-weight: 400;
  margin-top: 14px;
  opacity: .94;
}
.case-hero__caption .lede strong { font-weight: 700; }

.case-intro {
  max-width: 980px;
  margin: clamp(60px, 9vw, 130px) auto;
  padding: 0 var(--edge);
  text-align: center;
  font-size: clamp(20px, 2.4vw, 34px);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -.01em;
  color: #2a2a2a;
  text-wrap: pretty;
}
.case-intro strong { color: var(--black); }

.case-gallery {
  padding: 0 var(--edge) clamp(60px, 9vw, 130px);
  display: grid;
  gap: clamp(14px, 2vw, 28px);
}
.case-gallery .full { grid-column: 1 / -1; }
.case-gallery .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2vw, 28px); }
.case-gallery img { width: 100%; display: block; }
.case-gallery .h-tall { height: clamp(360px, 46vw, 640px); }
.case-gallery .h-med  { height: clamp(280px, 34vw, 480px); }
.case-gallery .h-sq   { height: clamp(260px, 30vw, 440px); }

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: clamp(36px, 5vw, 64px) var(--edge);
  border-top: 1.5px solid var(--red);
}
.case-meta .cell .k { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--gray); display: block; margin-bottom: 8px; }
.case-meta .cell .v { font-size: clamp(15px, 1.3vw, 19px); font-weight: 700; line-height: 1.3; }

/* prev / next project nav */
.case-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(40px,6vw,80px) var(--edge);
  border-top: 1px solid #e6e3dd;
}
.case-nav .mono { color: var(--gray); }
.case-nav a { font-family: var(--display); text-transform: lowercase; font-size: clamp(28px, 5vw, 64px); line-height: 1; }
.case-nav a:hover,
.case-nav a:focus-visible { color: var(--red); }

@media (max-width: 720px) {
  .case-gallery .row2 { grid-template-columns: 1fr; }
  .case-meta { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   WORKS index page
   ============================================================ */
.works-page { padding-top: clamp(96px, 14vw, 180px); }
.works-page .intro {
  padding: 0 var(--edge) clamp(40px, 6vw, 90px);
  max-width: 1100px;
}
.works-page .intro .mono { color: var(--red); font-weight: 700; display: block; margin-bottom: 18px; }
.works-page .intro h1 {
  font-family: var(--display);
  text-transform: lowercase;
  color: var(--black);
  font-size: clamp(48px, 11vw, 180px);
  line-height: .84;
  margin: 0;
  letter-spacing: .004em;
}
.works-page .intro h1 .red { color: var(--red); }

/* ============================================================
   WORKS list (shared by homepage + works index)
   ============================================================ */
.works { border-top: 1.5px solid var(--red); }
.works__head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px var(--edge);
  color: var(--red);
}
.works__head .mono { font-weight: 700; }
.work-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: clamp(22px, 3.6vw, 48px) var(--edge);
  border-top: 1px solid #e6e3dd;
  position: relative;
  overflow: hidden;
}
.work-row__bg {
  position: absolute; inset: 0; z-index: 0;
  transform: translateY(101%);
  transition: transform .55s cubic-bezier(.76,0,.24,1);
}
.work-row__bg img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; display: block; }
.work-row:hover .work-row__bg,
.work-row:focus-visible .work-row__bg { transform: translateY(0); }
.work-row__title {
  font-family: var(--display);
  text-transform: lowercase;
  font-size: clamp(40px, 8.5vw, 132px);
  line-height: .92;
  letter-spacing: .004em;
  position: relative; z-index: 1;
  color: var(--black);
  transition: color .4s ease, transform .55s cubic-bezier(.76,0,.24,1), padding-left .45s cubic-bezier(.76,0,.24,1);
  mix-blend-mode: difference;
}
.work-row:hover .work-row__title,
.work-row:focus-visible .work-row__title { color: #fff; padding-left: clamp(16px, 3vw, 60px); }
.work-row__meta {
  position: relative; z-index: 1;
  font-family: var(--mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; text-align: right; color: var(--gray);
  transition: color .4s ease; mix-blend-mode: difference;
}
.work-row:hover .work-row__meta,
.work-row:focus-visible .work-row__meta { color: #fff; }
.work-row__num { display: block; }
.work-row__cat { display: block; margin-top: 4px; }

@media (max-width: 720px) {
  .work-row__title { font-size: clamp(34px, 12vw, 64px); }
}

/* ============================================================
   Static collage pieces (no drag/resize/rotate — layout is fixed)
   ============================================================ */
.c-item img { width: 100%; height: 100%; display: block; }
.c-item .img-empty {
  width: 100%; height: 100%; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 10px; background: rgba(0,0,0,.04); border: 1.5px dashed rgba(0,0,0,.2);
  font-family: var(--mono); font-size: 11px; letter-spacing: .02em; color: rgba(0,0,0,.4);
}

/* ============================================================
   MOBILE LAYOUT FIXES (≤ 720px)
   ============================================================ */
@media (max-width: 720px) {
  /* (prefixed with body to beat the page's own inline <style>)
     Home hero: drop the full-screen height so the dog sits right
     under the wordmark instead of after a big empty gap */
  body .hero { min-height: auto; padding-bottom: 0; }
  body .hero__dog {
    position: relative;
    left: auto; bottom: auto;
    transform: none;
    width: min(88vw, 440px);
    height: min(88vw, 440px);
    margin: clamp(24px, 8vw, 48px) auto 0;
  }
  /* play button moves under the dog, with its own label underneath */
  body .hero__play {
    position: relative;
    right: auto; bottom: auto;
    flex-direction: column;
    gap: 14px;
    margin: 28px auto 0;
  }
  body .hero__play .label { display: none; }
  body .hero__play .label--mobile { display: block; order: 2; text-align: center; font-size: 13px; color: var(--gray); }
  body .about { padding-top: clamp(56px, 14vw, 90px); }

  /* Case-study hero bands: the 1760px-wide desktop strip scales down
     to a sliver on phones and the title spills out of it.
     Give it a proper photo ratio instead. */
  .hero-band,
  .mc-wide { margin-left: var(--edge) !important; margin-right: var(--edge) !important; }
  .hero-band .c-canvas {
    height: auto !important;
    aspect-ratio: 4 / 3;
    overflow: hidden;
  }
  .hero-band .c-stage {
    transform: none !important;
    width: 100% !important;
    height: 100% !important;
  }
  .hero-band .c-item {
    left: 0 !important; top: 0 !important;
    width: 100% !important; height: 100% !important;
  }
  .hero-band .c-item img { object-fit: cover; }
  .hero-band__caption {
    padding: 0 20px 22px !important;
    justify-content: flex-end !important;
    align-items: flex-start !important;
    text-align: left !important;
  }
  .hero-band__caption::before {
    background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,0) 65%) !important;
  }
  .hero-band__caption h1 { font-size: clamp(34px, 10vw, 52px) !important; }
  .hero-band__caption .lede { font-size: 15px !important; }

  /* Spacing between sections on case pages */
  .mc-intro, .case-intro { margin: 48px auto; }
  .rule--bottom[style] { margin-top: 40px !important; }
  .tvc { margin-top: 32px; }

  /* "Next mischief" nav: stack label and link so neither wraps */
  .case-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 40px var(--edge);
  }
  .case-nav .mono { white-space: nowrap; }
  .case-nav a { font-size: clamp(34px, 11vw, 52px); }

  /* Project list: phones have no hover, so the blend-mode "ghost"
     titles would stay washed out. Show them solid instead. */
  .work-row__title, .work-row__meta { mix-blend-mode: normal; }
  .work-row__title { color: var(--black); }
  .work-row__meta { color: #6B6B6B; }

  /* Footer: stack the two columns */
  .footer-grid { flex-direction: column; align-items: flex-start; gap: 28px; }
}
