:root {
  --font-sans: 'Space Grotesk', sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

html {
  background-color: var(--color-bg, #000);
}

html:has(.has-page-video) {
  overflow: hidden;
  background-color: #000;
}

/* Navbar */
.site-nav {
  right: auto;
  left: 0;
  width: 100vw;
  max-width: 100vw;
}

.site-nav .site-nav-inner {
  position: relative;
}

/* Marquee */
.marquee-wrapper {
  --marquee-track-spacing-x: 1rem;
  padding: 1rem 0;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-track {
  display: inline-flex;
  gap: var(--marquee-track-spacing-x);
  padding: 0 calc(var(--marquee-track-spacing-x) / 2);
  will-change: transform;
}

/* Portfolio Grid */
.pf-grid {
  display: grid;
  gap: 1.75rem 1.25rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 576px) {
  .pf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .pf-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .pf-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1400px) {
  .pf-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.pf-card {
  min-width: 0;
}

.pf-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s;
}

.pf-thumb:focus-visible,
.pf-thumb:hover {
  border-color: var(--color-accent);
  transform: translateY(-3px);
}

.pf-thumb:focus-visible {
  outline: 0;
}

.pf-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.5s, filter 0.3s;
}

.pf-thumb:hover img {
  transform: scale(1.05);
  filter: brightness(1.08);
}

.pf-meta {
  padding-top: 0.75rem;
}

.pf-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.pf-sub {
  font-size: 0.8rem;
  margin-bottom: 0;
  color: var(--color-text-secondary);
}

/* Custom Icons */
.ci-artstation {
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask-image: url("https://cdn.simpleicons.org/artstation");
  mask-image: url("https://cdn.simpleicons.org/artstation");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* Project & Article Content */
.article-flow > *:not(.media-wide) {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.article-flow > .media-wide {
  width: 100%;
  max-width: 1680px;
  margin-left: auto;
  margin-right: auto;
}

.pf-proj-head {
  padding-top: calc(var(--nav-h, 4.5rem) + 3.5rem);
}

.pf-proj-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text-secondary);
  transition: color 0.2s;
}

.pf-proj-back:focus-visible,
.pf-proj-back:hover {
  color: var(--color-accent);
}

.pf-proj-title {
  font-family: Outfit, sans-serif;
  font-size: clamp(1.9rem, 4.6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
}

.pf-proj-lead {
  max-width: 60ch;
}

.pf-proj-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.pf-proj-meta dt {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.pf-proj-meta dd {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
}

.pf-proj-media {
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  overflow: hidden;
  background: #000;
}

.pf-proj-media iframe,
.pf-proj-media video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}

.article-media {
  display: block;
  height: auto;
  max-width: 100%;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

.article-caption,
.pf-proj-caption {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(640px, 100%);
  margin-top: 0.65rem;
  margin-bottom: 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  text-align: center;
}

.pf-proj-body {
  font-size: 1.02rem;
  line-height: 1.75;
}

.pf-proj-body h2 {
  font-family: Outfit, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.25rem 0 0.75rem;
}

.pf-proj-body > :first-child {
  margin-top: 0;
}

.pf-proj-gallery {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
}

.pf-proj-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  background: #111;
}

/* Pagers */
.article-pager,
.pf-proj-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.article-pager a,
.blog-card-title a,
.pf-proj-pager a {
  text-decoration: none;
}

.pf-proj-pager a {
  font-size: 0.95rem;
  font-weight: 600;
}

.pf-proj-pager a:focus-visible,
.pf-proj-pager a:hover {
  color: var(--color-accent);
}

.pf-proj-pager span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}

/* Blog Layout & Cards */
.blog-container {
  width: 100%;
  max-width: var(--blog-max-width, none);
  margin-left: auto;
  margin-right: auto;
}

.blog-max-sm { --blog-max-width: 960px; }
.blog-max-md { --blog-max-width: 1200px; }
.blog-max-lg { --blog-max-width: 1440px; }
.blog-max-xl { --blog-max-width: 1680px; }
.blog-max-full { --blog-max-width: none; }

.blog-grid-4 {
  display: block;
}

.blog-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  min-width: 0;
  padding: 1.75rem 0;
  border-top: 1px solid var(--color-border);
}

.blog-card:last-child {
  border-bottom: 1px solid var(--color-border);
}

@media (min-width: 768px) {
  .pf-proj-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blog-card {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 2.25rem;
    align-items: center;
    padding: 2rem 0;
  }
}

.blog-card-media {
  position: relative;
  display: block;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #111;
  transition: border-color 0.25s;
}

.blog-card-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.5s, filter 0.3s;
}

.pf-thumb img.thumb-anim-overlay,
.blog-card-media img.thumb-anim-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #111;
  clip-path: inset(0.5px);
  pointer-events: none;
}

.blog-card-body {
  padding-top: 0;
  min-width: 0;
}

.blog-card-meta {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.blog-card-title {
  font-family: Outfit, sans-serif;
  font-size: clamp(1.15rem, 1.9vw, 1.55rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.blog-card-excerpt {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-bottom: 0;
}

.blog-card:hover .blog-card-media {
  border-color: var(--color-accent);
}

.blog-card:hover .blog-card-media img {
  transform: scale(1.04);
  filter: brightness(1.08);
}

.blog-card-title a:focus-visible,
.blog-card-title a:hover,
.blog-card:hover .blog-card-title a {
  color: var(--color-accent);
}

@media (min-width: 992px) {
  :root {
    --media-stage-width: min(100vw - 3rem, 1680px);
  }

  .article-media {
    max-width: var(--media-stage-width);
  }

  .pf-proj-media,
  .embed-ratio.embed-16x9 {
    width: var(--media-stage-width);
    margin-left: calc((100% - var(--media-stage-width)) / 2);
  }

  .article-pager,
  .pf-proj-pager {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    padding: 0 1.25rem;
    border: 0;
    pointer-events: none;
  }

  .article-pager a,
  .pf-proj-pager a {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 6.5rem;
    height: 6.5rem;
    margin: 0 !important;
    border: 0;
    background: transparent;
    color: var(--color-text);
    opacity: 0.45;
    font-size: 0;
    line-height: 0;
    text-decoration: none;
    transition: opacity 0.25s, color 0.25s, transform 0.25s;
  }

  .article-pager a span,
  .pf-proj-pager a span {
    display: none;
  }

  .article-pager a::before,
  .pf-proj-pager a::before {
    content: "";
    display: block;
    width: 1.75rem;
    height: 1.75rem;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(-135deg);
  }

  .article-pager a:last-child::before,
  .pf-proj-pager a:last-child::before {
    transform: rotate(45deg);
  }

  .article-pager a:focus-visible,
  .article-pager a:hover,
  .pf-proj-pager a:focus-visible,
  .pf-proj-pager a:hover {
    opacity: 1;
    color: var(--color-accent);
  }

  .article-pager a:focus-visible,
  .pf-proj-pager a:focus-visible {
    outline: 0;
  }

  .site-nav .site-nav-menu {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
  }

  .site-nav .site-nav-menu > * {
    pointer-events: auto;
  }

  .site-nav .site-nav-list {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Footer */
.site-footer .site-footer-row {
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1rem;
  min-height: 0;
}

.footer-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  align-self: center;
  padding: 0;
}

.footer-actions .footer-copy {
  line-height: 1.4;
  margin-bottom: 0;
}

@media (max-width: 767.98px) {
  .site-footer {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }

  .site-footer .site-footer-row {
    gap: 0.5rem;
  }

  footer .footer-actions .footer-copy {
    font-size: 0.75rem;
  }
}

@media (max-width: 400px) {
  .site-footer {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  footer .footer-actions .footer-copy {
    font-size: 0.65rem;
  }
}

/* Home Page Video Background & Reel Player Morph */
.hero-display-title {
  font-size: clamp(3.5rem, 13.5vw, 230px);
}

.has-page-video {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background-color: #000;
}

.has-page-video .site-nav {
  background-color: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.has-page-video > .hero-section {
  position: relative;
  z-index: 9;
  flex: 1 1 auto;
  height: auto !important;
  min-height: 0 !important;
  padding-top: var(--nav-h, 4.5rem);
  padding-bottom: 0;
  background-color: transparent;
}

.has-page-video > .marquee-wrapper,
.has-page-video > footer {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
}

.has-page-video > .marquee-wrapper {
  background-color: rgba(0, 0, 0, 0.45);
}

.has-page-video > footer {
  background-color: rgba(0, 0, 0, 0.25);
}

.page-video-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0);
  border-radius: 0;
  box-shadow: 0 2.5rem 6rem rgba(0, 0, 0, 0);
}

.page-video-bg .page-video-poster {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.page-video-bg video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  clip-path: inset(0.5px);
  opacity: 0;
  transition: opacity 0.45s ease;
}

.page-video-bg video.is-video-ready {
  opacity: 1;
}

.page-video-bg.is-morphing {
  inset: auto;
  z-index: 5;
  will-change: top, left, width, height, border-radius, border-color, box-shadow;
  transition:
    top 480ms cubic-bezier(0.22, 1, 0.36, 1),
    left 480ms cubic-bezier(0.22, 1, 0.36, 1),
    width 480ms cubic-bezier(0.22, 1, 0.36, 1),
    height 480ms cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 480ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 480ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.page-video-bg.is-resizing {
  transition: none !important;
}

.has-page-video.is-reel-mode .page-video-bg {
  pointer-events: auto;
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 0.75rem;
  box-shadow: 0 2.5rem 6rem rgba(0, 0, 0, 0.75);
}

.has-page-video.is-reel-mode .page-video-bg video {
  pointer-events: auto;
  clip-path: none;
}

/* Scrim, Vignette & CRT Overlays */
.page-video-scrim,
.page-vignette,
.page-crt {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  transition: opacity 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.page-video-scrim {
  z-index: 6;
  opacity: 1;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.15) 30%,
    rgba(0, 0, 0, 0.18) 65%,
    rgba(0, 0, 0, 0.6) 100%
  );
}

.page-vignette {
  z-index: 7;
  opacity: 0.6;
  background-image:
    radial-gradient(
      ellipse 46% 46% at 50% 50%,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0) 12%,
      rgba(0, 0, 0, 0.34) 34%,
      rgba(0, 0, 0, 0.72) 56%,
      rgba(0, 0, 0, 0.94) 78%,
      #000 100%
    ),
    radial-gradient(
      ellipse 88% 88% at 50% 50%,
      rgba(0, 0, 0, 0) 40%,
      rgba(0, 0, 0, 0.55) 100%
    );
}

.page-crt {
  z-index: 8;
  opacity: 1;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.07) 0 1px,
    rgba(0, 0, 0, 0) 1px 4px
  );
  background-repeat: repeat;
  mix-blend-mode: overlay;
}

.page-crt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)' opacity='0.25'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 160px 160px;
  mix-blend-mode: overlay;
  opacity: 0.6;
}

.has-page-video.is-reel-mode .page-video-scrim,
.has-page-video.is-reel-mode .page-vignette,
.has-page-video.is-reel-mode .page-crt {
  opacity: 0;
}

/* Hero Copy & Reel Target Layout Box */
.has-page-video .hero-section > .hero-inner {
  position: relative;
  z-index: 9;
  opacity: 1;
  transform: scale(1) translate3d(0, 0, 0);
  visibility: visible;
  will-change: opacity, transform;
  transition:
    opacity 360ms cubic-bezier(0.22, 1, 0.36, 1) 80ms,
    transform 440ms cubic-bezier(0.22, 1, 0.36, 1) 60ms,
    visibility 0s linear 0s;
}

.has-page-video.is-reel-mode > .hero-section {
  pointer-events: none;
}

.has-page-video.is-reel-mode .hero-section > .hero-inner {
  opacity: 0;
  transform: scale(0.95) translate3d(0, 12px, 0);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 260ms cubic-bezier(0.22, 1, 0.36, 1) 0s,
    transform 340ms cubic-bezier(0.22, 1, 0.36, 1) 0s,
    visibility 0s linear 260ms;
}

.has-page-video .hero-section > .reel-section {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: calc(var(--nav-h, 4.5rem) + 0.75rem) clamp(0.75rem, 2vw, 1.5rem) 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  container-type: size;
}

.reel-shell {
  width: min(100%, calc(100cqh * 16 / 9), 1720px);
  margin: 0 auto;
}

.reel-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.75rem;
}

@media (max-height: 640px) {
  .has-page-video > .hero-section {
    padding-top: var(--nav-h, 4.5rem);
    padding-bottom: 0;
  }

  .hero-display-title {
    font-size: clamp(2.5rem, 11vh, 6rem);
  }
}

/* Above-the-fold Hero Entrance (transform-only so LCP paints at 0ms) */
@keyframes hero-rise {
  from {
    transform: translate3d(0, 24px, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

.hero-anim {
  animation: hero-rise 550ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-anim-delay-1 {
  animation-delay: 70ms;
}

.hero-anim-delay-2 {
  animation-delay: 130ms;
}

/* Entrance Animations (data-aos) */
[data-aos] {
  --aos-duration: 400ms;
  --aos-delay: 0ms;
  --aos-rise: 32px;
  opacity: 0;
  transform: translate3d(0, var(--aos-rise), 0);
  transition-property: opacity, transform;
  transition-duration: var(--aos-duration);
  transition-delay: var(--aos-delay);
  transition-timing-function: ease;
}

[data-aos].aos-in {
  opacity: 1;
  transform: none;
}

[data-aos].aos-done {
  transition: none;
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .page-video-bg video,
  .page-video-bg.is-morphing,
  .page-video-scrim,
  .page-vignette,
  .page-crt,
  .has-page-video .hero-section > .hero-inner {
    transition: none !important;
  }

  .hero-anim {
    animation: none !important;
    transform: none !important;
  }

  [data-aos] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
