/* ==========================================================================
   Components: header, phone menu, buttons, footer, hero, caution tape,
   project cards. Values from reference/homepage.dc.html (desktop, 1440)
   and reference/homepage-mobile.dc.html (phone, 360).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Header (020, 025, 032): logo, nav right next to it. Fixed; hides while
   scrolling down and folds back in as a dark bar when scrolling up
   (js/main.js). The spacer keeps the layout from jumping.
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  padding-block: var(--header-pad);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), background-color .25s, padding .25s;
}
.site-header.is-solid {
  padding-block: var(--sp-16);
  background: rgba(11, 11, 11, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
/* Hidden while scrolling down, but never while a link in it has focus */
.site-header.is-hidden:not(:focus-within) {
  transform: translateY(-100%);
}
.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--sp-56);
  row-gap: var(--sp-8);
}
.head-space {
  height: var(--header-h);
}

/* Logo (041): one link, two sizes, swapped by screen width only.
   L2 wordmark from 760px up, L3 'SW' below 760px. */
.logo {
  display: inline-flex;
  align-items: center;
  line-height: 0.9;
  color: var(--bone);
  text-decoration: none;
}
.logo-l2 {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}
.logo-l3 {
  display: none;
  font-family: var(--font-something); /* both letters, normal kerning */
  font-size: 28px;
}
.logo:hover {
  color: var(--bone);
}
.logo-something {
  font-family: var(--font-something);
  font-size: 20px;
}
.logo-wicked {
  margin-top: -0.5px;
  font-family: var(--font-wicked);
  font-size: 21px; /* Heartless draws large: 21 matches the canvas */
}

/* Main nav, everywhere: current page yellow, the rest grey, hover bone (025).
   The nav keeps the brand yellow on case studies too (014). */
.nav {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--sp-32);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.nav a,
.menu-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-link);
  color: var(--muted);
  text-decoration: none;
}
.nav a:hover,
.menu-nav a:hover {
  color: var(--bone);
}
.nav a[aria-current='page'],
.menu-nav a[aria-current='page'] {
  color: var(--yellow);
}

/* The dark MENU box (phones only) */
.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--sp-12);
  min-height: var(--target-link);
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: var(--card);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}
.menu-btn svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 759.98px) {
  .site-header {
    padding-bottom: 0;
  }
  .site-header-inner {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: var(--sp-16);
  }
  .site-header .nav {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
  }
  .logo {
    min-height: var(--target-link);
  }
  .logo-l2 {
    display: none;
  }
  .logo-l3 {
    display: inline;
  }
}

/* --------------------------------------------------------------------------
   Phone menu (020): full screen, a native <dialog> so focus stays inside
   and Escape closes it.
   -------------------------------------------------------------------------- */
.menu {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100svh;
  max-height: none;
  margin: 0;
  padding: var(--sp-24) var(--sp-16) calc(var(--sp-32) + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  border: 0;
  background: var(--ink);
  color: var(--bone);
}
.menu[open] {
  display: flex;
  flex-direction: column;
}
.menu::backdrop {
  background: var(--ink);
}
.menu-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.menu .menu-btn {
  display: inline-flex;
}
.menu-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  margin-top: var(--sp-96);
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  font-stretch: var(--head-stretch);
  font-size: 56px;
  line-height: 48px;
  text-transform: uppercase;
}
.menu-nav a {
  align-self: flex-start;
}
.menu-meta {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  margin-top: auto;
  padding-top: var(--sp-48);
  font-size: 16px;
}
.menu-meta a {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: var(--target-link);
}
.menu-meta a + a {
  color: var(--muted);
}
.menu-meta a + a:hover {
  color: var(--bone);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
/* Yellow, the one primary action */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--target-button);
  padding: 0 var(--sp-32);
  background: var(--accent-paint) var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-button);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
.btn:hover {
  color: var(--on-accent);
}

/* Outlined pill: Load more */
.btn-pill {
  display: inline-flex;
  align-items: center;
  min-height: 64px;
  padding: 0 var(--sp-32);
  border: 1.5px solid var(--bone);
  border-radius: 999px;
  background: transparent;
  color: var(--bone);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}

/* Dark box on the yellow paper: GET IN TOUCH */
.btn-dark {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  height: var(--target-link);
  padding: 0 var(--sp-16);
  background: var(--card);
  color: var(--bone);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
}
.btn-dark:hover {
  color: var(--bone);
}

/* --------------------------------------------------------------------------
   Footer (031, 040): a sheet of torn yellow paper, all text black.
   The same on every page except the 404.
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: var(--z-footer); /* over the grain: the paper never gets grain */
  isolation: isolate;
  padding-block: var(--sp-96) var(--sp-48);
  color: var(--ink);
}
.footer-paper {
  position: absolute;
  top: -40px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
}
/* The torn edge, baked from the reference SVG (1440 x 64 user units plus
   40 above for the shadow), stretched across the width like the SVG */
.footer-edge {
  position: absolute;
  top: -40px;
  left: 0;
  width: 100%;
  height: 104px;
  background: url('/img/paper/footer-edge.webp') 0 0 / 100% 100% no-repeat;
}
.footer-paper-fill {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--yellow-paint) var(--yellow);
}
.footer-title {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
}
.footer-sub {
  margin-top: var(--sp-16);
  color: var(--paper-ink);
}
.footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-24);
  margin-top: var(--sp-40);
}
.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-link);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
}
.site-footer .footer-link,
.site-footer .footer-link:hover {
  color: var(--ink);
}
.site-footer a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

@media (max-width: 759.98px) {
  .site-footer {
    margin-top: var(--sp-96);
    padding-block: var(--sp-32);
  }
  .footer-title {
    font-size: clamp(36px, 13.4vw, 48px);
    line-height: 1;
  }
  .footer-title span {
    white-space: nowrap;
  }
  .footer-sub {
    margin-top: var(--sp-8);
    text-wrap: balance;
  }
  .footer-actions {
    margin-top: var(--sp-16);
  }
}

/* --------------------------------------------------------------------------
   Shared bits: gloss, masking tape, handwritten notes
   -------------------------------------------------------------------------- */
/* Gloss coating over a photo and its white border, like a glossy print */
.gloss {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background: var(--gloss-photo);
}

/* Masking tape: beige, slightly see-through, torn ends */
.tape {
  position: absolute;
  background: linear-gradient(180deg, rgba(236, 226, 196, 0.92), rgba(214, 202, 166, 0.88));
  clip-path: polygon(0 10%, 5% 0, 100% 4%, 96% 22%, 100% 44%, 97% 66%, 100% 90%, 95% 100%, 3% 96%, 0 78%, 4% 56%, 0 34%);
}

/* Handwriting (053): Reenie Beanie */
.hand {
  font-family: var(--font-hand);
  font-weight: 400;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

/* --------------------------------------------------------------------------
   Hero, desktop (760px and up): torn paper on the right 51.5% of the
   screen from the top of the page down behind the tape, headline in
   cols 1-7, square photo in cols 8-11. Fills the first screen.
   -------------------------------------------------------------------------- */
.hero-bleed {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
}
.hero-paper {
  position: absolute;
  top: 0;
  right: 0;
  z-index: -1;
  width: 51.5%;
  height: 100%;
  pointer-events: none;
}
/* Baked paper (img/paper/hero.webp): the reference SVG's 742 x 1000 box
   plus 40 user units on every side for the shadow, stretched like the SVG
   (preserveAspectRatio none) */
.hero-paper .paper-bake {
  position: absolute;
  left: -5.391%;  /* -40 / 742 */
  top: -4%;       /* -40 / 1000 */
  width: 110.512%; /* 820 / 742 */
  height: 108%;    /* 1080 / 1000 */
  background: url('/img/paper/hero.webp') 0 0 / 100% 100% no-repeat;
}

.hero {
  position: relative;
  isolation: isolate;
  align-content: center;
  align-items: stretch;
  row-gap: var(--sp-40);
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  padding-block: clamp(64px, 8.9vw, 128px) clamp(80px, 10vw, 144px);
}
.hero-text {
  grid-column: 1 / span 7;
  min-width: 0;
}
.hero-title {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: -0.01em;
}
.hero-something {
  font-family: var(--font-something);
  font-size: 0.82em;
  font-weight: 400;
  text-transform: none;
  color: var(--accent);
}
.hero-wicked {
  margin-right: 0.12em; /* the swashes touched 'in it.' */
  font-family: var(--font-wicked);
  font-size: 1.2em;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-32);
  margin-top: var(--sp-56);
}
.hero-intro {
  max-width: 416px;
  color: var(--bone-muted);
}

/* Photo: square at every width (040), straight white frame, gloss, tape,
   rotated 3deg, crossing the tear. Above the page, never under grain. */
.hero-photo {
  position: relative;
  z-index: var(--z-media);
  grid-column: 8 / span 4;
  align-self: center;
  aspect-ratio: 1;
  transform: rotate(3deg);
}
.hero-frame {
  position: absolute;
  inset: 0;
  display: flex;
  padding: var(--sp-12);
  background: var(--frame);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
}
.hero-frame img {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.hero-photo .tape {
  top: -16px;
  left: 50%;
  width: 136px;
  height: 40px;
  transform: translateX(-50%) rotate(-6deg);
}

/* 'that's me!' left of the photo, arrow pointing at it */
.hero-note {
  position: absolute;
  left: -168px;
  bottom: 72px;
  width: 160px;
  height: 112px;
  transform: rotate(-3deg);
  pointer-events: none;
}
.hero-note .hand {
  position: absolute;
  left: 0;
  bottom: 0;
  font-size: 28px;
  line-height: 1;
  color: var(--bone);
  transform: rotate(-8deg);
}
.hero-note svg {
  position: absolute;
  inset: 0;
  width: 160px;
  height: 112px;
  overflow: visible;
}

/* Small laptops and tablets (760-1023px): no canvas board. The headline
   keeps its three lines in cols 1-8, the photo moves to cols 9-12 and
   'that's me!' goes under it, so the note never runs into the headline. */
@media (min-width: 760px) and (max-width: 1023px) {
  .hero-text {
    grid-column: 1 / span 8;
  }
  .hero-title > span {
    white-space: nowrap;
  }
  .hero-photo {
    grid-column: 9 / span 4;
  }
  .hero-note {
    left: 8px;
    top: calc(100% + 16px);
    bottom: auto;
    width: 112px;
    height: 80px;
    transform: rotate(-3deg);
  }
  .hero-note svg {
    width: 64px;
    height: 48px;
    transform: rotate(-110deg) scaleY(-1);
  }
  .hero-note .hand {
    left: 40px;
    top: 40px;
    bottom: auto;
    transform: rotate(-6deg);
  }
}

/* Phone-only parts of the hero */
.hero-mpaper,
.hero-mnote {
  display: none;
}

/* --------------------------------------------------------------------------
   Hero, phones (below 760px, 040): headline, a full-width band of torn
   yellow paper with the photo left and 'that's me!' + intro right, then a
   centred See the work. One grid, so the photo, intro and button exist
   once; .hero-text and .hero-cta dissolve into it.
   Rows: title / 40 + 48 / note / 24 / intro / 48 + 40 / button.
   -------------------------------------------------------------------------- */
@media (max-width: 759.98px) {
  .hero-paper,
  .hero-note {
    display: none;
  }

  .hero {
    grid-template-rows: auto 88px auto 24px auto 88px auto;
    row-gap: 0;
    align-items: start;
    min-height: calc(100vh - var(--header-h));
    min-height: calc(100svh - var(--header-h));
    padding-block: var(--sp-32);
  }
  .hero-text,
  .hero-cta {
    display: contents;
  }

  .hero-title {
    position: relative;
    z-index: 2;
    grid-row: 1;
    grid-column: 1 / -1;
    font-size: clamp(40px, 13.3vw, 56px);
    line-height: 0.857; /* 48 at 56 */
  }
  .hero-title > span {
    white-space: nowrap;
  }
  .hero-wicked {
    margin-right: 0;
    margin-left: 4px;
  }

  /* The paper band: full width, 48px of paper above and below the photo
     row, plus the 4px the torn rims stick out. Stretched over rows 3-5. */
  .hero-mpaper {
    display: block;
    position: relative;
    grid-row: 3 / 6;
    grid-column: 1 / -1;
    align-self: stretch;
    margin: -52px calc(-1 * var(--margin));
    pointer-events: none;
  }
  /* Baked band (img/paper/hero-phone.webp): the reference SVG's 360 x 312
     box plus 20 user units on every side, stretched like the SVG */
  .hero-mpaper .paper-bake {
    position: absolute;
    left: -5.556%;   /* -20 / 360 */
    top: -6.410%;    /* -20 / 312 */
    width: 111.111%; /* 400 / 360 */
    height: 112.821%; /* 352 / 312 */
    background: url('/img/paper/hero-phone.webp') 0 0 / 100% 100% no-repeat;
  }

  .hero-photo {
    grid-row: 3 / 6;
    grid-column: 1 / span 2;
    align-self: start;
    height: 216px;
    aspect-ratio: auto;
    transform: rotate(-3deg);
  }
  .hero-frame {
    padding: var(--sp-8);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  }
  .hero-photo .tape {
    top: -12px;
    width: 96px;
    height: 32px;
    transform: translateX(-50%) rotate(-4deg);
  }

  /* 'that's me!' with the arrow pointing left at the photo */
  .hero-mnote {
    display: block;
    position: relative;
    grid-row: 3;
    grid-column: 3 / span 2;
    height: 56px; /* 8px top padding + 48 */
    margin-top: 0;
    pointer-events: none;
  }
  .hero-mnote svg {
    position: absolute;
    left: -8px;
    top: 8px;
    width: 72px;
    height: 40px;
    overflow: visible;
  }
  .hero-mnote .hand {
    position: absolute;
    left: 40px;
    top: 32px;
    font-size: 24px;
    line-height: 32px;
    color: var(--ink);
    transform: rotate(-6deg);
  }

  .hero-intro {
    position: relative;
    grid-row: 5;
    grid-column: 3 / span 2;
    max-width: none;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: var(--ink);
  }

  /* See the work: filled yellow like desktop (not outlined as the export) */
  .hero .btn {
    grid-row: 7;
    grid-column: 1 / -1;
    justify-self: center;
    min-height: var(--target-link);
    padding: 0 var(--sp-24);
  }
}

/* --------------------------------------------------------------------------
   Caution tape band: over the paper, tilted, scrolling
   -------------------------------------------------------------------------- */
.band-clip {
  overflow-x: clip; /* the band is wider than the screen */
}
.band {
  position: relative;
  z-index: var(--z-band);
  width: 104%;
  margin: -8px 0 0 -2%;
  padding: var(--sp-24) var(--margin);
  overflow: hidden;
  transform: rotate(-1.4deg);
  box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.45);
  background:
    repeating-linear-gradient(-45deg, var(--ink) 0 14px, transparent 14px 28px) top / 100% 10px no-repeat,
    repeating-linear-gradient(-45deg, var(--ink) 0 14px, transparent 14px 28px) bottom / 100% 10px no-repeat,
    var(--yellow-paint) var(--yellow);
  color: var(--ink);
  font-size: var(--fs-band);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.marquee {
  display: flex;
  width: max-content;
}
/* Two identical groups; the trailing padding makes -50% loop seamlessly */
.marquee-group {
  display: flex;
  gap: var(--sp-40);
  padding-right: var(--sp-40);
}
/* Pause / play at the visible end of the band: ink on yellow, 48px
   target. The band overhangs the screen by 2% of the page (1.92% of its
   own width); the yellow fades out to the left so the words slide under
   it cleanly, and covers the overhang on the right. */
.band-toggle {
  position: absolute;
  top: 50%;
  right: calc(1.92% + var(--sp-8));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--target-link);
  height: var(--target-link);
  margin-top: calc(var(--target-link) / -2);
  padding: 0;
  border: 0;
  background: var(--yellow-paint) var(--yellow);
  box-shadow: -24px 0 16px var(--yellow), 32px 0 0 var(--yellow);
  color: var(--ink);
  cursor: pointer;
}
.band-toggle[hidden] {
  display: none;
}
.band-toggle svg {
  width: 16px;
  height: 16px;
}
.band-toggle:focus-visible {
  outline-color: var(--ink);
  outline-offset: -6px;
}
.band-icon-play,
.is-stopped .band-icon-pause {
  display: none;
}
.is-stopped .band-icon-play {
  display: block;
}
/* Nothing moves with reduced motion, so nothing to pause */
@media (prefers-reduced-motion: reduce) {
  .band-toggle {
    display: none;
  }
}

@media (max-width: 759.98px) {
  .band {
    z-index: 3;
    width: 108%;
    margin: 4px 0 0 -4%;
    padding: var(--sp-16) 0 var(--sp-16) var(--sp-24);
    box-shadow: none;
    background:
      repeating-linear-gradient(-45deg, var(--ink) 0 10px, transparent 10px 20px) top / 100% 8px no-repeat,
      repeating-linear-gradient(-45deg, var(--ink) 0 10px, transparent 10px 20px) bottom / 100% 8px no-repeat,
      var(--yellow-paint) var(--yellow);
    line-height: 32px;
  }
  .marquee-group {
    gap: var(--sp-24);
    padding-right: var(--sp-24);
  }
  .band-toggle {
    right: calc(3.7% + var(--sp-8)); /* 4% overhang of a 108% band */
  }
}

/* --------------------------------------------------------------------------
   Selected work (019): big (16:8), small + small (4:3), repeating.
   -------------------------------------------------------------------------- */
.work {
  padding-block: var(--sp-120) var(--sp-144);
}
.work-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-24);
  margin-bottom: var(--sp-56);
}
.work-title {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
}
.work-intro {
  max-width: 360px;
  color: var(--bone-muted);
}
.wgrid {
  row-gap: var(--sp-56);
  align-items: start;
}

/* Focus links (048, 066): projects outside the focus wait for Load more
   (js/main.js) */
.work .card.is-out {
  display: none;
}

/* Cards from 'Load more' stay hidden until the button is pressed. Only
   once js/main.js has set up the button (.has-more): if the script never
   runs, every card shows and the button stays hidden. */
.has-more .card[data-more]:not(.is-shown) {
  display: none;
}

/* Project card: the whole card is one link */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  color: var(--bone);
  text-decoration: none;
}
.card:hover {
  color: var(--bone);
}
.card--big {
  grid-column: 1 / -1;
}
.card--small {
  grid-column-end: span 6;
}

/* Image: thick white frame, glossy sheen, shadow, no grain. Images fill
   the frame so every small card is exactly 4:3. No yellow inside (014). */
.card-img {
  position: relative;
  z-index: var(--z-media);
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: var(--sp-12) solid var(--frame);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  background: var(--placeholder);
}
.card--big .card-img {
  aspect-ratio: 16 / 8;
}
.card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-gloss {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 36%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.07) 100%);
}
.pill {
  position: absolute;
  top: 20px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  min-height: var(--sp-40);
  padding: 0 var(--sp-16);
  border-radius: 999px;
  background: var(--bone);
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: 600;
}

/* Just seen (021): this visit only, set by the case study (sessionStorage) */
.seen {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 11, 11, 0.62);
  pointer-events: none;
}
.seen[hidden] {
  display: none;
}
.seen-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-12);
  color: var(--bone);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.seen-label svg {
  width: 22px;
  height: 22px;
}

/* Caption row: name + one line left, type right */
.card-cap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-16);
  line-height: 1.4;
}
.card-cap strong {
  font-weight: 700;
}
.card-type {
  flex: none;
  color: var(--muted);
  font-size: var(--fs-small);
  font-style: italic;
}

.more {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-40);
}
.more[hidden] {
  display: none;
}

/* View case ticket (040): a cream ticket with a perforated stub. Follows
   the pointer over the image once the card has lifted (js/main.js); on
   keyboard focus it parks top-right of the frame. Decorative: the link
   already says where it goes. */
.ticket {
  position: absolute;
  z-index: var(--z-ticket);
  display: none;
  width: 104px;
  height: 22px;
  pointer-events: none;
  transform: translate(-6px, -50%) rotate(-3deg);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4));
  animation: ticketIn .22s cubic-bezier(.2, .7, .2, 1) .22s both;
}
.tk-p {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #ECE2C4, #D6CAA6);
}
.tk-main {
  clip-path: path('M 0 0 L 79 0 A 3 3 0 0 0 82 3 L 82 19 A 3 3 0 0 0 79 22 L 0 22 L 0 20.75 A 1.5 1.5 0 0 0 0 17.75 L 0 15.25 A 1.5 1.5 0 0 0 0 12.25 L 0 9.75 A 1.5 1.5 0 0 0 0 6.75 L 0 4.25 A 1.5 1.5 0 0 0 0 1.25 L 0 0 Z');
}
.tk-stub {
  clip-path: path('M 82 3 A 3 3 0 0 0 85 0 L 104 0 L 104 1.25 A 1.5 1.5 0 0 0 104 4.25 L 104 6.75 A 1.5 1.5 0 0 0 104 9.75 L 104 12.25 A 1.5 1.5 0 0 0 104 15.25 L 104 17.75 A 1.5 1.5 0 0 0 104 20.75 L 104 22 L 85 22 A 3 3 0 0 0 82 19 Z');
}
.tk-label {
  position: absolute;
  top: 0;
  left: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 22px;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 800;
  font-stretch: 85%;
  line-height: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tk-arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 82px;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tk-arrow svg {
  width: 9px;
  height: 9px;
}
.tk-perf {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 81.5px;
  width: 0;
  border-left: 1px dotted rgba(11, 11, 11, .45);
}

/* Pointer ticket: only with a fine pointer, set up by js/main.js */
.has-ticket .card-img {
  cursor: none;
}
.card.is-hover .ticket--pointer {
  display: block;
}

/* Keyboard focus: lift, yellow ring around the frame, ticket top-right */
.card:focus {
  outline: none;
}
.card:focus-visible .card-img {
  outline: 3px solid var(--yellow);
  outline-offset: 6px;
}
.ticket--focus {
  left: calc(100% - 90px);
  top: 43px;
}
.card:focus-visible .ticket--focus {
  display: block;
}
.card:focus-visible .ticket--pointer {
  display: none;
}

/* Hover and focus lift: subtle, never with reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: transform .2s;
  }
  .btn:hover {
    transform: rotate(-2deg) scale(1.04);
  }
  .card-img {
    transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s;
  }
  .card:focus-visible .card-img {
    transform: translateY(-8px) rotate(-.8deg);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6);
  }
}
/* Hover tilt only with a real mouse: a tap on a phone never tilts the card */
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .card:hover .card-img {
    transform: translateY(-8px) rotate(-.8deg);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6);
  }
}

/* Selected work on phones: single cards, all 4:3, 8px frames */
@media (max-width: 759.98px) {
  .work {
    padding-block: 76px 0; /* 56 + the 20px the tape is lifted */
  }
  .work-head {
    display: block;
    margin-bottom: var(--sp-40);
  }
  .work-title {
    font-size: 48px;
    line-height: 48px;
  }
  .work-intro {
    max-width: none;
    margin-top: var(--sp-16);
    line-height: 24px;
  }
  .wgrid {
    row-gap: var(--sp-40);
  }
  .card--small {
    grid-column: 1 / -1;
  }
  .card--big .card-img,
  .card-img {
    aspect-ratio: 4 / 3;
    border-width: var(--sp-8);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
  }
  .pill {
    top: var(--sp-16);
    left: var(--sp-16);
    min-height: var(--sp-32);
    padding: 0 var(--sp-12);
    font-size: var(--fs-label);
  }
  .card-cap {
    flex-direction: column;
    gap: var(--sp-4);
    line-height: 24px;
  }
}
