/*
DESIGN INTENT: JACKSON PORTER SCROLL-SEQUENCE VISUAL SYSTEM
What:  Defines one sticky viewport with three hard-cut video layers, responsive painting overlays,
       a Pretzel Regular identity wordmark, and the existing full-screen artwork record viewer.
Why:   Lets scroll position change only the active video frame while shot changes happen instantly
       and paintings remain the only saturated interface color over the nocturnal footage.
Where: DESK/jackson-porter/site-concepts/2026-08-14-intake/prototype/styles.css
*/

@font-face {
  font-family: "Pretzel";
  src: url("./public/assets/fonts/Pretzel-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
  --page: #05070a;
  --ink: #f5f4ef;
  --paper: #f6f5f1;
  --paper-ink: #111111;
  --muted: #777772;
  --line: rgba(255, 255, 255, 0.22);
  --paper-line: #d8d8d2;
  --page-gutter: clamp(18px, 3vw, 52px);
  --content-width: 1600px;
  --header-height: 66px;
}

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

html {
  background: var(--page);
  /* Scroll drives media; browser animation must not lag or overwrite the playhead. */
  scroll-behavior: auto;
  scroll-snap-type: y mandatory;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  overflow-x: hidden;
}

body.has-open-work {
  overflow: hidden;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

a {
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--paper-ink);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-height);
  padding: 0 var(--page-gutter);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 7, 10, 0.56);
  color: #ffffff;
  backdrop-filter: blur(14px);
}

.site-brand {
  justify-self: start;
  font-family: "Pretzel", Arial, Helvetica, sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0;
}

.site-context {
  display: flex;
  gap: 18px;
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-context span {
  color: rgba(255, 255, 255, 0.58);
}

.site-nav {
  display: flex;
  justify-self: end;
  gap: clamp(18px, 2.5vw, 42px);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav a {
  padding: 8px 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  border-color: currentColor;
}

.visual-sequence {
  position: relative;
  min-height: var(--sequence-height, 700svh);
  background: var(--page);
}

.visual-sequence__stage {
  position: sticky;
  top: 0;
  z-index: 1;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  background: #05070a;
  isolation: isolate;
}

.checkpoint-rail {
  position: relative;
  z-index: 0;
  width: 1px;
  margin-top: -100svh;
  pointer-events: none;
}

.checkpoint-marker {
  display: block;
  width: 1px;
  height: var(--checkpoint-travel, 100svh);
  opacity: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.checkpoint-marker:last-child {
  height: 100svh;
}

.video-chapter {
  position: absolute;
  inset: 0;
  z-index: 0;
  visibility: hidden;
  background: #030508;
  pointer-events: none;
}

.video-chapter.is-active {
  z-index: 1;
  visibility: visible;
  pointer-events: auto;
}

.video-chapter__sticky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #05070a;
  isolation: isolate;
}

.scroll-video,
.video-chapter__veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scroll-video {
  z-index: 0;
  display: block;
  object-fit: cover;
  background: #05070a;
  opacity: 0;
}

.video-chapter.is-video-ready .scroll-video {
  opacity: 1;
}

.video-chapter__veil {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(1, 3, 7, 0.2) 0%, rgba(1, 3, 7, 0.04) 44%, rgba(1, 3, 7, 0.48) 100%),
    radial-gradient(circle at 50% 40%, transparent 36%, rgba(1, 3, 7, 0.2) 100%);
  pointer-events: none;
}

.video-chapter__fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
}

.video-chapter.is-video-ready .video-chapter__fallback {
  display: none;
}

.video-chapter.is-video-error .video-chapter__fallback {
  color: #ffffff;
}

.video-chapter__meta {
  position: absolute;
  right: var(--page-gutter);
  bottom: 22px;
  left: var(--page-gutter);
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 24px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 9px;
  letter-spacing: 0.1em;
  pointer-events: none;
  text-transform: uppercase;
}

.video-chapter__meta p {
  margin: 0;
}

.scroll-cue {
  opacity: var(--cue-opacity, 1);
}

.checkpoint-gallery {
  position: absolute;
  inset: var(--header-height) 0 0;
  z-index: 3;
  contain: layout paint;
  pointer-events: none;
}

.loading-state {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
}

.artwork-card {
  position: absolute;
  top: 50%;
  right: var(--page-gutter);
  width: auto;
  margin: 0;
  opacity: var(--card-opacity, 0);
  pointer-events: none;
  transform: translate3d(0, calc(-50% + var(--card-y, 28px)), 0)
    scale(var(--card-scale, 0.98));
  transform-origin: center;
  will-change: opacity, transform;
}

.artwork-card.is-interactive {
  pointer-events: auto;
}

.artwork-card__link {
  display: grid;
  grid-template-columns: minmax(110px, 180px) clamp(300px, 34vw, 520px);
  align-items: end;
  gap: clamp(18px, 2vw, 34px);
  padding: 0;
  background: transparent;
  color: #ffffff;
}

.artwork-card__media {
  grid-row: 1;
  grid-column: 2;
  background: transparent;
}

.artwork-card__media .art-crop {
  background: transparent;
}

.art-crop {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #e4e3de;
}

.art-crop {
  aspect-ratio: var(--art-ratio);
}

.art-crop img {
  position: absolute;
  top: var(--source-top);
  left: var(--source-left);
  display: block;
  width: var(--source-width);
  max-width: none;
  height: var(--source-height);
}

.artwork-card__link:hover .art-crop,
.artwork-card__link:focus-visible .art-crop {
  opacity: 0.9;
}

.artwork-card figcaption {
  grid-row: 1;
  grid-column: 1;
  display: flex;
  align-items: baseline;
  align-self: end;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 0 2px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.045em;
  line-height: 1.2;
  text-align: right;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.74);
}

.artwork-card__year {
  color: rgba(255, 255, 255, 0.56);
  font-variant-numeric: tabular-nums;
}

.artist-section,
.site-footer {
  width: min(calc(100% - (2 * var(--page-gutter))), var(--content-width));
  margin-right: auto;
  margin-left: auto;
  scroll-snap-align: start;
}

.artist-section {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, 3fr);
  gap: clamp(40px, 7vw, 140px);
  padding: clamp(120px, 14vw, 220px) 0 clamp(110px, 13vw, 210px);
  border-top: 1px solid var(--paper-line);
  background: var(--paper);
  color: var(--paper-ink);
  scroll-margin-top: var(--header-height);
}

main {
  background: var(--paper);
}

.artist-section__heading {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.artist-section__heading p,
.artist-section__heading h2,
.artist-statement p {
  margin: 0;
}

.artist-section__heading p {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.artist-section__heading h2 {
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
}

.artist-statement {
  max-width: 760px;
}

.artist-statement p {
  max-width: 620px;
  font-size: clamp(16px, 1.35vw, 22px);
  line-height: 1.45;
}

.artist-statement__lead {
  max-width: none !important;
  margin-bottom: clamp(34px, 4vw, 64px) !important;
  font-size: clamp(34px, 4.6vw, 68px) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.05em !important;
}

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  min-height: 360px;
  padding: clamp(80px, 9vw, 140px) 0 var(--page-gutter);
  border-top: 1px solid var(--paper-line);
  background: var(--paper);
  color: var(--paper-ink);
  scroll-margin-top: var(--header-height);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  display: inline-block;
  margin-top: 10px;
  font-size: clamp(20px, 2.4vw, 38px);
  letter-spacing: -0.04em;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.footer-label,
.site-footer__credit {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.site-footer__credit {
  display: flex;
  gap: 24px;
}

.work-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--paper-ink);
}

.work-dialog::backdrop {
  background: var(--paper);
}

.work-dialog__frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 24vw);
  width: 100%;
  height: 100%;
  min-height: 0;
}

.work-dialog__close {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 3;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  color: var(--paper-ink);
  cursor: pointer;
}

.work-dialog__close span {
  position: absolute;
  top: 17px;
  left: 4px;
  width: 28px;
  height: 1px;
  background: currentColor;
}

.work-dialog__close span:first-child {
  transform: rotate(45deg);
}

.work-dialog__close span:last-child {
  transform: rotate(-45deg);
}

.work-dialog__image {
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: clamp(48px, 5vw, 86px);
  background: #e8e7e2;
  place-items: center;
}

.work-dialog__image .art-crop {
  width: min(100%, calc((100dvh - 10rem) * var(--art-ratio-number)));
  max-width: 100%;
  background: transparent;
}

.work-dialog__record {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  padding: 76px var(--page-gutter) var(--page-gutter);
  border-left: 1px solid var(--paper-line);
}

.work-dialog__number,
.work-dialog__record h2,
.work-dialog__record > p {
  margin: 0;
}

.work-dialog__number {
  margin-bottom: 30px !important;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-dialog__record h2 {
  max-width: 12ch;
  font-size: clamp(28px, 3vw, 52px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.05em;
}

#dialog-year {
  margin-top: 12px;
  color: var(--muted);
}

.work-dialog__navigation {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(54px, 11vh, 120px);
  padding-top: 12px;
  border-top: 1px solid var(--paper-line);
}

.work-dialog__navigation button {
  padding: 8px 0;
  background: transparent;
  color: var(--paper-ink);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  :root {
    --header-height: 62px;
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-brand {
    font-size: 16px;
  }

  .site-context {
    display: none;
  }

  .site-nav {
    gap: 18px;
    font-size: 9px;
  }

  .video-chapter__meta {
    bottom: 16px;
  }

  .video-chapter__meta p:last-child {
    display: none;
  }

  .artwork-card {
    right: 16px;
    width: auto;
  }

  .artwork-card__link {
    grid-template-columns: minmax(72px, 24vw) min(64vw, 280px);
    gap: 10px;
  }

  .artwork-card figcaption {
    gap: 6px;
    font-size: 8px;
  }

  .artist-section {
    display: block;
    padding-top: 120px;
    padding-bottom: 110px;
  }

  .artist-statement {
    margin-top: 84px;
  }

  .artist-statement__lead {
    font-size: clamp(34px, 10vw, 52px) !important;
  }

  .site-footer {
    display: block;
    min-height: 340px;
  }

  .site-footer__credit {
    justify-content: space-between;
    margin-top: 150px;
  }

  .work-dialog__frame {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .work-dialog__image {
    padding: 62px 18px 24px;
  }

  .work-dialog__image .art-crop {
    width: min(100%, calc(61dvh * var(--art-ratio-number)));
  }

  .work-dialog__record {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 20px;
    border-top: 1px solid var(--paper-line);
    border-left: 0;
  }

  .work-dialog__number {
    grid-column: 1 / -1;
    margin-bottom: 14px !important;
  }

  .work-dialog__record h2 {
    max-width: 10ch;
    font-size: 28px;
  }

  #dialog-year {
    align-self: end;
    margin-top: 0;
  }

  .work-dialog__navigation {
    grid-column: 1 / -1;
    margin-top: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll-video {
    transition: none;
  }

  .artwork-card {
    transform: none;
  }
}
