:root {
  --radius: 0.5rem;
  --page-pad: 1.25rem;
  --background: oklch(0.965 0.008 90);
  --foreground: oklch(0.18 0.015 270);
  --muted: oklch(0.91 0.01 90);
  --muted-foreground: oklch(0.47 0.02 270);
  --border: oklch(0.78 0.015 270);
  --pink: oklch(0.72 0.13 350);
  --lime: oklch(0.84 0.12 115);
  --violet: oklch(0.76 0.09 292);
  --petrol: oklch(0.53 0.065 220);
  --ink: oklch(0.15 0.015 270);
  --font-sans: "Space Grotesk", sans-serif;
  --font-display: "Archivo Black", sans-serif;
  --dots: radial-gradient(
    circle,
    rgba(17, 17, 17, 0.08) 1px,

    transparent 1px
  );
}

/* ========================================
   DARK MODE
   ======================================== */

:root.dark-mode,
.dark-mode {
  color-scheme: dark;

  --background: oklch(0.17 0.012 270);
  --foreground: oklch(0.95 0.008 90);
  --muted: oklch(0.28 0.014 270);
  --muted-foreground: oklch(0.72 0.015 270);
  --border: oklch(0.34 0.015 270);
  --ink: oklch(0.95 0.008 90);
  --dots: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.18) 1px,
    transparent 1px
  );
}

.dark-mode .profile-card,
.dark-mode .toolbox-card,
.dark-mode .marquee,
.dark-mode .nav a.active,
.dark-mode .project-link {
  --ink: oklch(0.15 0.015 270);
}

.nav-container,
.footer {
  background-image: var(--dots);
  background-size: 12px 12px;
  background-position: center;
}

.dark-mode .card:hover {
  box-shadow: 0 14px 28px rgb(0 0 0 / 0.5);
}

.dark-mode .theme-toggle img,
.dark-mode .footer-link img,
.dark-mode .project-icon {
  filter: invert(1);
}

.dark-mode .hero-star,
.dark-mode .hero-star-left {
  content: url("resources/starDark.svg");
}

/* ==========================================================================

   Base

   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: var(--header-h, 80px);
}

body {
  background-color: var(--background);

  min-height: 100vh;

  margin: 0;

  padding: var(--page-pad);

  padding-top: var(--nav-h, 5.5rem);

  font-family: var(--font-display);

  color: var(--ink);
}

h1,
h2,
h3,
.footer-title,
.marquee-track {
  font-family: var(--font-display);

  font-weight: 700;

  text-transform: uppercase;
}

.hero,
.nav,
.about .eyebrow,
.fact-title,
.experience-dates,
.experience-role,
.work-card-top,
.work-card-discipline,
.profile-card-label,
.toolbox-label,
.portrait-name,
.showreel-header,
.banner-section-title .tool-tip {
  font-weight: 700;

  text-transform: uppercase;
}

.hero,
.nav,
.about .eyebrow,
.experience-dates,
.experience-role,
.work-eyebrow,
.work-card-top,
.work-card-discipline {
  font-size: 0.75rem;
}

.profile-card-label,
.toolbox-label,
.portrait-name,
.showreel-header {
  font-size: 0.625rem;
}

.text-pink {
  color: var(--pink);
}

.text-violet {
  color: var(--violet);
}

/* ==========================================================================

   Header

   ========================================================================== */

header {
  margin-bottom: 3rem;
}

.nav-container {
  position: fixed;

  top: 0;

  left: 0;

  width: 100%;

  display: grid;

  grid-template-columns: minmax(0, 1fr) auto auto;

  align-items: start;

  gap: 1rem;

  padding: 1rem var(--page-pad);

  border-bottom: 1px solid var(--border);
  background-image: var(--dots);
  background-size: 12px 12px;
  background-position: center;

  background-color: var(--background);

  z-index: 1000;
}

.header-title {
  display: flex;

  flex-direction: column;
}

.header-title h1 {
  font-size: 0.875rem;

  line-height: 1;

  color: var(--ink);
}

.nav {
  margin-left: auto;

  margin-bottom: 1rem;

  display: flex;

  align-items: center;

  gap: 0.25rem;

  border: 1px solid var(--border);

  border-radius: 9999px;

  background-color: var(--card);

  padding: 0.25rem;
}

.nav a {
  border-radius: 9999px;

  padding: 0.5rem 1.25rem;

  color: var(--ink);

  text-decoration: none;
}

.nav a:hover {
  background-color: var(--muted);
}

.nav a.active,
.nav a.active:hover {
  background-color: var(--pink);
}

/* ==========================================================================

   Hero

   ========================================================================== */

.hero {
  display: flex;

  flex-direction: column;

  margin-bottom: 3rem;

  color: var(--muted-foreground);
}

.hero .hero-top-line {
  display: grid;

  grid-template-columns: minmax(0, 1fr) auto;

  align-items: center;

  column-gap: clamp(0.7rem, 3vw, 1.5rem);
}

.hero .role,
.hero .meta,
.hero .contract-line {
  font-size: clamp(0.55rem, 1vw, 1rem);
}

.hero .title-and-contract {
  margin: 3rem 0 2rem;
}

.hero .title-and-contract p {
  margin: 0;

  line-height: 1.3;
}

.hero .role {
  white-space: nowrap;
}

.hero .meta {
  display: inline-flex;

  align-items: center;

  gap: 0.5rem;

  white-space: nowrap;
}

.hero .meta-dot {
  display: block;

  width: 0.5rem;

  height: 0.5rem;

  flex-shrink: 0;

  border-radius: 9999px;

  background: var(--lime);
}

.hero .contract-line {
  margin-top: 0.25rem !important;
}

.hero .relative-block {
  position: relative;

  display: flex;

  justify-content: center;
}

.hero h1 {
  margin: 0;

  display: flex;

  flex-direction: column;

  align-items: center;

  font-size: clamp(2.85rem, 9.1vw, 10.25rem);

  line-height: 0.9;
}

.hero h1 .line--pink {
  display: block;

  white-space: nowrap;
}

.hero h1 .line-centered {
  position: relative;
  color: var(--muted-foreground);
}

.hero h1 .line--pink {
  margin-left: 0;

  color: var(--pink);
}

.letter-c {
  position: relative;
  display: inline-block;
}

.hero-star,
.hero-star-left {
  position: absolute;
  width: 0.7em;
  height: 0.7em;
  object-fit: contain;
  pointer-events: none;
  animation: star-appear 60s ease forwards;
}

.hero-star-left {
  left: 0;
  top: 50%;
  transform: translate(-70%, -10%);
  animation-delay: 10s;
}

.hero-star {
  left: 50%;
  top: 0;
  transform: translate(20%, -50%);
  animation-delay: 15s;
}

@keyframes star-appear {
  to {
    opacity: 1;
  }
}

/* ==========================================================================

   Banner gallery

   ========================================================================== */
.banner-grid {
  display: grid;
  gap: 0.75rem;
  align-items: stretch;
  margin: 2.5rem 0 3rem;
}

.banner-section {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin: 0;
}

.banner-section--purple {
  background-color: var(--violet);
}

.banner-section--green {
  background-color: var(--lime);
}

.banner-section .gallery {
  margin: 1.5rem 0 0;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 1rem;
}

.gallery {
  list-style: none;

  padding: 0;

  margin: 4rem 0 3rem;

  display: grid;

  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));

  gap: 2rem;
}

.gallery--landscape {
  --card-ratio: 16 / 9;

  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));

  gap: 1rem;
}

.gallery--mixed {
  --card-ratio: 1 / 1;

  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));

  gap: 1rem;
}

/* --------------------------------------------------------------------------
   Gallery lightbox
   -------------------------------------------------------------------------- */

.gallery-lightbox {
  position: fixed;

  inset: 0;

  z-index: 2000;

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 2rem;

  background: rgb(0 0 0 / 0.9);

  opacity: 0;

  visibility: hidden;

  pointer-events: none;

  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;

  visibility: visible;

  pointer-events: auto;
}

.gallery-lightbox-figure {
  position: relative;

  z-index: 1;

  max-width: min(90vw, calc(1200px + 8rem));

  max-height: 90vh;

  margin: 0;

  display: flex;

  flex-direction: column;

  align-items: center;

  gap: 1rem;
}

.gallery-lightbox-stage {
  display: grid;

  grid-template-columns: 3rem minmax(0, auto) 3rem;

  column-gap: 1rem;

  align-items: center;

  width: fit-content;

  max-width: 100%;
}

.gallery-lightbox-image-wrap {
  position: relative;

  line-height: 0;
}

.gallery-lightbox-image {
  display: block;

  max-width: min(calc(90vw - 8rem), 1200px);

  max-height: 82vh;

  width: auto;

  height: auto;

  object-fit: contain;
}

.gallery-lightbox-title {
  color: white;

  text-align: center;
}

.gallery-lightbox-close,
.gallery-lightbox-prev,
.gallery-lightbox-next {
  display: flex;

  align-items: center;

  justify-content: center;

  width: 3rem;

  height: 3rem;

  padding: 0;

  border: 0;

  border-radius: 50%;

  background: rgb(0 0 0 / 0.55);

  color: white;

  cursor: pointer;

  opacity: 1;

  transition: background 0.2s ease;
}

.gallery-lightbox-close svg,
.gallery-lightbox-prev svg,
.gallery-lightbox-next svg {
  display: block;

  width: 1.25rem;

  height: 1.25rem;

  fill: none;

  stroke: currentColor;

  stroke-width: 2;

  stroke-linecap: round;

  stroke-linejoin: round;
}

.gallery-lightbox-close {
  position: absolute;

  top: 1rem;

  right: 1rem;

  z-index: 2;
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
  position: relative;

  z-index: 2;

  border: 1px solid rgb(255 255 255 / 0.35);
}

.gallery-lightbox-close:hover,
.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
  background: rgb(0 0 0 / 0.8);
}

body.lightbox-open {
  overflow: hidden;
}

body.lightbox-open {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Media stages
   -------------------------------------------------------------------------- */

.stage-section {
  margin-top: 3.5rem;
}

.stage-grid {
  display: grid;

  grid-template-columns: minmax(0, 1fr);

  gap: 1rem;
}

.media-stage {
  position: relative;

  display: grid;

  place-items: center;

  overflow: hidden;

  border: 1px solid var(--border);

  border-radius: var(--radius);

  background-color: var(--card);

  margin-bottom: 3rem;
}

.media-stage--portrait {
  aspect-ratio: 9 / 16;
}

.media-stage--landscape {
  aspect-ratio: 16 / 9;
}

.media-stage--banner {
  aspect-ratio: 2 / 3;
}

.media-stage-placeholder {
  position: absolute;

  inset: 0;

  display: grid;

  place-items: center;
}

.media-stage-link {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.media-stage img,
.media-stage video {
  display: block;

  width: 100%;

  height: 100%;

  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Cards and previews
   -------------------------------------------------------------------------- */

.card {
  border-radius: 6px;

  overflow: hidden;

  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s ease,
    background-color 0.2s ease;
}

.card:hover {
  transform: translateY(-8px);

  box-shadow: 0 14px 28px oklch(0.15 0.015 270 / 0.25);
}

.card-link {
  display: block;

  text-decoration: none;

  color: inherit;
}

.preview-box {
  position: relative;

  width: 100%;

  aspect-ratio: var(--card-ratio, 2 / 3);

  margin: 0;

  overflow: hidden;
  background-color: transparent;
}

.preview-box video,
.preview-box img {
  display: block;

  width: 100%;

  height: 100%;

  object-fit: cover;
}

.preview-box video {
  pointer-events: none;
}

.preview-frame,
.banner-modal-frame {
  color-scheme: light;
}

.preview-frame {
  display: block;

  border: 0;

  pointer-events: none;

  transform-origin: top left;
}

/* --------------------------------------------------------------------------
   Banner modal
   -------------------------------------------------------------------------- */

.banner-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(15 15 15 / 0.72);
  color: white;
  cursor: pointer;
}
.banner-modal-nav:hover {
  background: rgb(15 15 15 / 0.95);
}
.banner-modal-nav[hidden] {
  display: none;
}
.banner-modal-nav--prev {
  left: calc(-1 * var(--edge));
}
.banner-modal-nav--next {
  right: calc(-1 * var(--edge));
}

.banner-modal-nav svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.banner-modal-close {
  position: absolute;
  top: 0;
  right: calc(-1 * var(--edge));
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(15 15 15 / 0.72);
  color: white;
  cursor: pointer;
}
.banner-modal-close svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.banner-modal {
  width: min(70vw, 470px);

  max-width: calc(100vw - 2rem);

  max-height: calc(100vh - 2rem);

  height: auto;

  padding: 0;

  border: 0;

  border-radius: 0.5rem;

  overflow: visible;

  background: transparent;
  --btn: 2.75rem;
  --gap: 0.75rem;
  --edge: calc(var(--btn) + var(--gap));
}

.banner-modal::backdrop {
  background: transparent;

  backdrop-filter: blur(8px);
}

.banner-modal:has(.banner-modal-frame:not([hidden])) {
  width: min(70vw, 500px, calc((100dvh - 2 * var(--edge) - 2rem) * 2 / 3));
}

.banner-modal-frame {
  display: block;

  width: 100%;

  aspect-ratio: 2 / 3;

  height: auto;

  margin: 0;

  border: 0;
  border-radius: 0.5rem;
  background-color: transparent;
}

.banner-modal:has(.banner-modal-video-wrap:not([hidden])),
.banner-modal:has(.banner-modal-image:not([hidden])) {
  width: min(86vw, 1200px);

  max-width: 86vw;

  height: calc(100dvh - 8rem);
}

.banner-modal[open]:has(.banner-modal-video-wrap:not([hidden])) {
  display: flex;

  align-items: center;

  justify-content: center;
}

.banner-modal-video-wrap {
  position: relative;

  display: inline-block;

  line-height: 0;
}

.banner-modal-video {
  display: block;

  width: auto;

  height: auto;

  max-width: min(86vw, 1200px);

  max-height: calc(100dvh - 8rem);

  margin: 0;

  border-radius: 0.5rem;

  background: transparent;
}

.banner-modal-image {
  display: block;

  width: 100%;

  height: 100%;

  margin: 0;

  object-fit: contain;

  border-radius: 0.5rem;

  background: transparent;
}

.banner-modal-mute {
  position: absolute;

  top: 0.75rem;

  right: 0.75rem;

  z-index: 10;

  width: 2.5rem;

  height: 2.5rem;

  padding: 0;

  display: flex;

  align-items: center;

  justify-content: center;

  border: 0;

  border-radius: 0.25rem;

  background: rgb(15 15 15 / 0.72);

  color: white;

  cursor: pointer;

  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}

.banner-modal-mute:hover {
  background: rgb(15 15 15 / 0.95);

  transform: scale(1.05);
}

.banner-modal-mute:focus-visible {
  outline: 2px solid white;

  outline-offset: 2px;
}

.banner-modal-mute-icon {
  width: 1.35rem;

  height: 1.35rem;

  fill: currentColor;

  display: none;
}

.banner-modal-mute[aria-pressed="true"] .banner-modal-mute-icon--muted {
  display: block;
}

.banner-modal-mute[aria-pressed="false"] .banner-modal-mute-icon--unmuted {
  display: block;
}

.banner-modal-mute[hidden] {
  display: none;
}

.banner-modal-frame[hidden],
.banner-modal-image[hidden],
.banner-modal-video-wrap[hidden] {
  display: none;
}

.banner-modal-frame[hidden],
.banner-modal-image[hidden],
.banner-modal-video[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   Perelyn gallery
   -------------------------------------------------------------------------- */

.perelyn-gallery {
  margin-top: 3.5rem;
}

.perelyn-stage {
  position: relative;

  width: 100%;

  aspect-ratio: 16 / 10;

  overflow: hidden;

  border-radius: 0.5rem;

  background: var(--card);
}

.perelyn-stage--hero {
  aspect-ratio: 16 / 10;
}

.perelyn-image-home-page {
  width: 100%;

  height: 100%;

  object-fit: cover;

  object-position: top;
}

.perelyn-image-1 {
  width: 100%;

  height: 100%;

  object-fit: contain;

  object-position: top;
}

.perelyn-image-2 {
  width: 100%;

  height: 100%;

  object-fit: fill;

  object-position: top;
}

.perelyn-secondary-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 1rem;

  margin-top: 1rem;
}

.perelyn-link {
  position: absolute;

  right: 1rem;

  bottom: 1rem;

  display: inline-flex;

  align-items: center;

  gap: 0.5rem;

  padding: 0.5rem 1rem;

  border-radius: 999px;

  background: var(--background);

  color: var(--foreground);

  font-size: 0.75rem;

  font-weight: 700;

  text-transform: uppercase;

  text-decoration: none;

  box-shadow: 0 10px 20px rgb(0 0 0 / 15%);
}

.perelyn-link:hover {
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Embedded video
   -------------------------------------------------------------------------- */

.video-feature {
  margin: 0;

  width: 100%;

  overflow: hidden;

  border-radius: 15px;

  margin-bottom: 3rem;
}

.video-feature video {
  display: block;

  width: 100%;

  height: auto;

  max-height: 85vh;

  background: #000;
}

.video-feature--youtube iframe {
  display: block;

  width: 100%;

  aspect-ratio: 16 / 9;

  height: auto;

  border: 0;

  background: #000;
}

/* --------------------------------------------------------------------------
   Work details and back link
   -------------------------------------------------------------------------- */

.work-info {
  display: grid;

  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);

  gap: 2rem;

  align-items: start;

  margin-block: 1.5rem;
}

.work-info .gallery {
  margin: 0;

  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));

  gap: 0.75rem;
}

.work-description {
  line-height: 1.6;

  color: var(--muted-foreground);

  text-align: justify;
}

.card-size {
  font-size: 0.75rem;

  color: #6b6b6b;
}

.card:hover .card-size {
  color: #d4a24c;
}

.back-link {
  display: inline-block;

  margin-bottom: 1.5rem;

  font-size: 0.75rem;

  font-weight: 700;

  text-transform: uppercase;

  color: var(--muted-foreground);

  text-decoration: none;
}

.back-link:hover {
  color: var(--pink);
}

/* ==========================================================================

   Profile grid (profile / portrait / toolbox / showreel)

   ========================================================================== */

.profile-grid {
  margin-top: 2.5rem;

  display: grid;

  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   Profile grid and cards
   -------------------------------------------------------------------------- */

.raster-dots {
  background-image: radial-gradient(
    circle,
    rgba(0, 0, 0, 0.08) 1px,

    transparent 1px
  );

  background-size: 12px 12px;

  background-position: center;
}

/* profile card */

.profile-card {
  position: relative;

  overflow: hidden;

  border-radius: 0.75rem;

  background-color: var(--lime);

  padding: 1.5rem;

  color: var(--ink);
}

.profile-card-header {
  display: flex;

  align-items: flex-start;

  justify-content: space-between;
}

.profile-card-label {
  letter-spacing: 0.04em;
}

.profile-card-icon {
  animation: drift 5s ease-in-out infinite;
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.profile-card-content {
  margin-top: 4rem;
}

.profile-card h2 {
  margin: 0;

  font-size: clamp(1.75rem, 2vw, 2.5rem);

  line-height: 0.9;

  letter-spacing: -0.04em;
}

.profile-card p {
  margin-top: 1.25rem;

  max-width: 22rem;

  font-size: 0.875rem;

  line-height: 1.6;
}

/* portrait card */

.portrait-card {
  position: relative;

  min-height: 16rem;

  overflow: hidden;

  border-radius: 0.75rem;
}

.portrait-card img {
  display: block;

  width: 100%;

  height: 100%;

  object-fit: cover;

  transition: transform 0.7s ease;
}

.portrait-card:hover img {
  transform: scale(1.03);
}

.portrait-overlay {
  position: absolute;

  inset-inline: 0;

  bottom: 0;

  display: flex;

  align-items: end;

  justify-content: space-between;

  padding: 1rem;

  padding-top: 5rem;
}

.portrait-name {
  color: var(--lime);

  letter-spacing: 0.04em;
}

.portrait-role {
  margin-top: 0.25rem;

  font-size: 0.75rem;

  color: rgba(255, 255, 255, 0.8);
}

.portrait-arrow {
  color: var(--lime);

  width: 1.125rem;

  height: 1.125rem;
}

/* toolbox card */

.toolbox-card {
  overflow: hidden;

  border-radius: 0.75rem;

  background-color: var(--violet);

  padding: 1.25rem;

  color: var(--ink);

  display: flex;

  flex-direction: column;

  min-height: 0;
}

.toolbox-header {
  display: flex;

  align-items: flex-start;

  justify-content: space-between;

  flex-shrink: 0;
}

.toolbox-arrow {
  font-size: 1.125rem;
}

.toolbox-grid {
  display: grid;

  grid-template-columns: repeat(5, minmax(0, 1fr));

  grid-template-rows: repeat(2, minmax(0, 1fr));

  gap: 0.25rem;

  width: 100%;

  max-width: 100%;
}

.tool {
  position: relative;

  min-width: 0;
}

.tool-button {
  position: relative;

  display: block;

  aspect-ratio: 1 / 1;

  width: 100%;

  overflow: hidden;

  border: 1px solid rgba(17, 17, 17, 0.1);

  border-radius: 0.5rem;

  background-color: rgba(255, 255, 255, 0.15);

  padding: 0;

  transition:
    transform 0.3s ease,
    background-color 0.3s ease;
}

.tool:hover .tool-button {
  transform: translateY(-2px);

  background-color: var(--background);
}

.tool img {
  position: absolute;

  inset: 0.5rem;

  width: calc(100% - 1rem);

  height: calc(100% - 1rem);

  object-fit: contain;
}

.tool-tip {
  position: absolute;

  left: 50%;

  top: -2rem;

  z-index: 10;

  display: none;

  transform: translateX(-50%);

  white-space: nowrap;

  border-radius: 0.25rem;

  background-color: var(--ink);

  padding: 0.25rem 0.5rem;

  font-size: 0.5rem;

  color: white;
}

.tool:hover .tool-tip {
  display: block;
}

/* showreel card */

.showreel-button {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: stretch;
  width: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0.75rem;
  background-color: var(--petrol);
  padding: 1.25rem;
  text-align: left;
  color: white;
  cursor: pointer;
}

.showreel-preview {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: auto;
  max-width: calc(100% - 2.5rem);
  max-height: calc(100% - 2.5rem);
  border-radius: 15px;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.showreel-button-inner {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.raster-dots-lighter {
  background-image: radial-gradient(
    circle,
    rgba(174, 164, 164, 0.65) 1px,
    transparent 1px
  );
  background-size: 12px 12px;
  background-position: center;
}

.showreel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.showreel-button:hover .showreel-preview {
  opacity: 0.85;
}

/* ==========================================================================

   Marquee

   ========================================================================== */

.marquee {
  margin-block: 3rem;

  margin-inline: calc(-1 * var(--page-pad));

  overflow: hidden;

  border-block: 1px solid var(--border);

  background-color: var(--pink);

  padding: 0.75rem 0;

  color: var(--ink);
}

.marquee-track {
  display: flex;

  width: max-content;

  font-size: 1.25rem;

  animation: marquee 18s linear infinite;
}

.marquee-track span {
  white-space: nowrap;

  padding-right: 1.5rem;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-25%);
  }
}

/* ==========================================================================

   About / CV

   ========================================================================== */

.about {
  border-bottom: 1px solid var(--border);

  padding: 3.5rem 0;
}

.about-inner {
  display: grid;

  gap: 3rem;

  max-width: 1600px;

  margin: 0 auto;

  padding: 0 1.25rem;
}

.about .eyebrow {
  margin: 0;

  color: var(--pink);
}

.about-title {
  margin: 1rem 0 0;

  font-size: clamp(2.7rem, 8vw, 5.5rem);

  line-height: 0.9;
}

.about-text {
  max-width: 36rem;

  margin: 1.75rem 0 0;

  font-family: var(--font-sans);

  font-size: 1rem;

  line-height: 1.625;

  color: var(--muted-foreground);
}

.about-facts {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 1.5rem;

  margin-top: 2.5rem;

  padding-top: 1.5rem;

  border-top: 1px solid var(--border);

  font-size: 0.875rem;
}

.fact-title {
  margin: 0;
}

.fact-text {
  margin: 0.5rem 0 0;

  font-family: var(--font-sans);

  color: var(--muted-foreground);
}

.experience-list {
  border-top: 1px solid var(--border);
}

.experience-item {
  display: grid;

  gap: 1rem;

  padding: 1.75rem 0;
}

.experience-item + .experience-item {
  border-top: 1px solid var(--border);
}

.experience-dates {
  margin: 0;

  color: var(--muted-foreground);
}

.experience-company {
  margin: 0;

  font-size: 1.25rem;
}

.experience-item:hover .experience-company {
  color: var(--pink);
}

.experience-role {
  margin: 0.25rem 0 0;

  color: var(--pink);
}

.experience-text {
  margin: 0;

  font-family: var(--font-sans);

  font-size: 0.875rem;

  line-height: 1.625;

  color: var(--muted-foreground);
}

/* ==========================================================================

   Selected work

   ========================================================================== */

.work {
  max-width: 1600px;

  margin: 0 auto;

  padding: 4rem 1.25rem;
}

.work-header {
  display: grid;

  gap: 1rem;

  margin-bottom: 2.5rem;

  padding-bottom: 1.5rem;

  border-bottom: 1px solid var(--border);
}

.work-eyebrow {
  margin: 0 0 0.5rem;

  font-weight: 700;

  color: var(--muted-foreground);
}

.work-title {
  margin: 0;

  font-size: clamp(3rem, 8vw, 7rem);

  line-height: 0.88;
}

.work-intro {
  max-width: 20rem;

  margin: 0;

  font-family: var(--font-sans);

  font-size: 0.875rem;

  line-height: 1.625;

  color: var(--muted-foreground);
}

.work-grid {
  display: grid;

  gap: 1rem;
}

.work-card {
  position: relative;

  display: flex;

  flex-direction: column;

  min-height: 24rem;

  overflow: hidden;

  border-radius: 0.5rem;

  color: white;

  text-decoration: none;

  background-color: var(--petrol);
}

.work-card-image {
  position: absolute;

  inset: -2px;

  width: calc(100% + 4px);

  height: calc(100% + 4px);

  object-fit: cover;

  opacity: 0.75;

  transition:
    transform 0.7s ease,
    opacity 0.7s ease;
}

.work-card:hover .work-card-image {
  transform: scale(1.05);

  opacity: 1;
}

.work-card-overlay {
  position: absolute;

  inset: 0;

  background: linear-gradient(
    to top,

    oklch(0.15 0.015 270 / 0.95),
    transparent,
    oklch(0.15 0.015 270 / 0.2)
  );
}

.work-card-content {
  position: relative;

  flex: 1;

  display: flex;

  flex-direction: column;

  justify-content: space-between;

  padding: 1.25rem;
}

.work-card-arrow {
  width: 1.25rem;

  height: 1.25rem;

  overflow: visible;

  fill: none;

  stroke: currentColor;

  stroke-width: 1.75;

  stroke-linecap: round;

  stroke-linejoin: round;

  transition: transform 0.2s ease;

  align-self: flex-end;
}

.work-card:hover .work-card-arrow {
  transform: translate(0.25rem, -0.25rem);
}

.work-card-discipline {
  margin: 0 0 0.5rem;

  color: var(--lime);
}

.work-card-title {
  margin: 0;

  white-space: pre-line;

  font-size: clamp(1rem, 4vw, 1.875rem);

  line-height: 0.9;
}

/* ==========================================================================

   Project page

   ========================================================================== */

#project {
  padding-top: 1.5rem;
}

.project-hero {
  display: grid;

  grid-template-columns: minmax(0, 1fr);

  gap: 2rem;

  border-bottom: 1px solid var(--border);
}

.project-hero > * {
  min-width: 0;
}

.project-number {
  margin: 0 0 1.25rem;

  font-size: 0.75rem;

  font-weight: 700;

  text-transform: uppercase;

  color: var(--lime);
}

.project-title {
  margin: 0;

  font-size: clamp(3rem, 5vw, 7rem);

  line-height: 0.8;

  white-space: pre-line;
}

.project-icon {
  display: block;
  width: clamp(4rem, 7vw, 6rem);
  height: auto;
  border-radius: 10px;
  margin-top: 1.25rem;
  object-fit: contain;
}

.project-subtitles {
  margin: 3rem 0 3rem;

  display: grid;

  gap: 0.5rem;
}

.project-subtitle-japanese {
  margin: 0;

  font-size: 0.875rem;

  line-height: 1;

  color: var(--pink);
}

.project-subtitle {
  margin: 0;

  font-size: clamp(1.5rem, 3vw, 2.5rem);

  line-height: 0.95;
}

.project-info {
  padding-top: 1.25rem;
}

.project-description {
  margin: 0;

  font-family: var(--font-sans);

  font-size: 1rem;

  line-height: 1.625;

  color: var(--muted-foreground);
}

.project-meta {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 1.25rem;

  margin-top: 2rem;

  font-size: 0.75rem;

  font-weight: 700;

  text-transform: uppercase;

  color: var(--muted-foreground);
}

.project-meta b {
  color: var(--ink);
}

.project-content {
  margin-top: 3.5rem;
}

.project-image {
  display: block;

  width: 100%;

  border-radius: 0.5rem;
}

.project-link {
  display: inline-block;

  margin-top: 1.5rem;

  padding: 0.75rem 1.25rem;

  border-radius: 9999px;

  background: var(--pink);

  color: var(--ink);

  font-size: 0.75rem;

  font-weight: 700;

  text-transform: uppercase;

  text-decoration: none;
}

.project-images {
  display: grid;

  gap: 1rem;
}

.project-images img {
  width: 100%;

  border-radius: 0.5rem;
}

/* ==========================================================================

   Footer

   ========================================================================== */

.footer {
  position: relative;

  margin-inline: calc(-1 * var(--page-pad));

  border-top: 1px solid var(--border);

  padding: 2rem var(--page-pad);

  background-color: var(--background);

  background-image: var(--dots);

  background-size: 12px 12px;

  background-position: center;
}

.footer-inner {
  display: grid;

  grid-template-columns: minmax(0, 1fr) repeat(3, auto);

  align-items: end;

  gap: 1rem;
}

.footer-copy {
  min-width: 0;
}

.footer-title {
  margin: 0;

  font-size: 1.25rem;

  font-weight: 700;

  line-height: 1;

  letter-spacing: -0.04em;

  color: var(--ink);
}

.footer-meta {
  margin-top: 0.75rem;

  white-space: pre-line;

  font-size: 0.75rem;

  line-height: 1.6;

  color: var(--muted-foreground);
}

button.footer-link,
.theme-toggle {
  padding: 0;

  cursor: pointer;

  font: inherit;
}

.footer-link,
.theme-toggle {
  display: inline-flex;

  align-items: center;

  justify-content: center;

  width: 2.75rem;

  height: 2.75rem;

  border: 1px solid var(--border);

  border-radius: 9999px;

  color: var(--ink);

  background: transparent;

  text-decoration: none;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.footer-link:hover,
.theme-toggle:hover {
  background-color: var(--card);

  border-color: var(--muted);
}

.footer-link img,
.theme-toggle img {
  display: block;

  width: 1.5rem;

  height: 1.5rem;

  object-fit: contain;
}

.footer-link svg {
  width: 1rem;

  height: 1rem;
}

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

@media (min-width: 900px) {
  .banner-grid {
    grid-template-columns: var(--banner-columns, 1fr);
  }
}

@media (max-width: 600px) {
  html {
    scroll-padding-top: var(--nav-h, 6.5rem);
  }

  .gallery-lightbox {
    padding: 1rem;
  }

  .gallery-lightbox-close,
  .gallery-lightbox-prev,
  .gallery-lightbox-next {
    width: 2.5rem;

    height: 2.5rem;
  }

  .gallery-lightbox-close svg,
  .gallery-lightbox-prev svg,
  .gallery-lightbox-next svg {
    width: 1rem;

    height: 1rem;
  }

  .gallery-lightbox-stage {
    grid-template-columns: 2.5rem minmax(0, auto) 2.5rem;

    column-gap: 0.5rem;
  }

  .gallery-lightbox-close {
    top: 0.25rem;

    right: 0.25rem;
  }

  .gallery-lightbox-image {
    max-width: min(calc(90vw - 6rem), 1200px);

    max-height: 78vh;
  }

  body {
    padding-top: 6.5rem;
  }

  .nav-container {
    grid-template-columns: 1fr;

    gap: 0.75rem;
  }

  .nav {
    margin: 0;

    width: 100%;

    justify-content: center;

    flex-wrap: wrap;
  }

  .nav a {
    padding: 0.5rem 0.9rem;
  }

  .stage-title {
    font-size: 3rem;
  }

  .stage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-stage--wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 639px) {
  .showreel-button {
    order: -1;
  }

  .hero .relative-block {
    transform: translateX(-2rem);
  }

  .hero h1 .line--pink {
    position: relative;

    left: var(--hero-static-offset, 0px);

    font-size: 1.1em;

    font-weight: 900;
  }
  .hero-star-left {
    transform: translate(-70%, -120%);
  }
}

@media (max-width: 480px) {
  .toolbox-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 640px) {
  :root {
    --page-pad: 2rem;
  }

  .hero .title-and-contract {
    margin-bottom: 3rem;
  }

  .hero h1 {
    flex-direction: row;

    justify-content: center;

    gap: 0.2em;

    font-size: clamp(3rem, 8vw, 9rem);
  }

  .marquee-track {
    font-size: 1.875rem;
  }

  .about {
    padding: 6rem 0;
  }

  .about-inner {
    padding: 0 2rem;
  }

  .work {
    padding: 6rem 2rem;
  }

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

    align-items: end;
  }

  .work-card-content {
    padding: 1.5rem;
  }

  .project-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-title {
    font-size: 1.875rem;
  }
}

@media (max-width: 700px) {
  .banner-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;

    transform: translate(-50%, -50%);

    margin: 0;

    max-height: calc(100dvh - 7rem);
    overflow: visible;
  }

  .banner-modal:has(.banner-modal-frame:not([hidden])) {
    width: min(90vw, 500px, calc((100dvh - 9rem) * 2 / 3));
  }

  .banner-modal:has(.banner-modal-video-wrap:not([hidden])),
  .banner-modal:has(.banner-modal-image:not([hidden])) {
    height: calc(100dvh - 9rem);
    max-height: calc(100dvh - 9rem);
  }

  .banner-modal-video {
    max-height: calc(100dvh - 9rem);
  }

  .banner-modal-nav {
    position: absolute;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    z-index: 20;
  }

  .banner-modal-nav--prev {
    left: calc(-1 * var(--edge));
    right: auto;
  }

  .banner-modal-nav--next {
    right: calc(-1 * var(--edge));
    left: auto;
  }

  .banner-modal-close {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    left: auto;
    bottom: auto;
    transform: none;
    z-index: 21;
  }
  .work-info {
    grid-template-columns: 1fr;
  }

  .perelyn-secondary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 565px) {
  .banner-modal-nav {
    position: fixed;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }

  .banner-modal-nav--prev {
    left: 0.75rem;
    right: auto;
  }

  .banner-modal-nav--next {
    right: 0.75rem;
    left: auto;
  }
}

@media (min-width: 640px) and (max-width: 1023.98px) {
  .profile-grid {
    grid-template-columns: 1fr 1fr;

    grid-template-rows: auto auto auto;
  }

  .showreel-button {
    grid-column: 1 / -1;

    grid-row: 1;

    min-height: 10rem;
  }

  .portrait-card {
    grid-column: 1;

    grid-row: 2 / span 2;

    min-height: 22rem;
  }

  .toolbox-card {
    grid-column: 2;

    grid-row: 2;
  }

  .profile-card {
    grid-column: 2;

    grid-row: 3;

    min-height: 10rem;

    padding: 1rem;
  }

  .profile-card-content {
    margin-top: 1.5rem;
  }

  .profile-card p {
    margin-top: 0.75rem;

    font-size: 0.8rem;

    line-height: 1.4;
  }

  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-card {
    min-height: 20rem;
  }

  .work-card:first-child {
    grid-column: 1 / -1;

    min-height: 26rem;
  }

  .experience-item {
    grid-template-columns: 6rem 1fr;

    column-gap: 1.5rem;
  }

  .experience-item > :last-child {
    grid-column: 2;
  }

  .project-hero {
    grid-template-columns: 1fr;
  }

  .project-title {
    font-size: clamp(1.5rem, 7vw, 6rem);
  }
}

@media (min-width: 1024px) {
  :root {
    --page-pad: 2.5rem;
  }

  .hero .title-japanese {
    display: block;
  }

  .profile-grid {
    grid-template-columns: 1.1fr 0.55fr 1fr;

    grid-template-rows: 12rem 12rem;
  }

  .showreel-button {
    grid-column: 1;

    grid-row: 1 / span 2;

    min-height: 0;
  }

  .portrait-card {
    grid-column: 2;

    grid-row: 1 / span 2;
  }

  .profile-card {
    grid-column: 3;

    grid-row: 2;

    min-height: 12rem;

    padding: 1rem;
  }

  .profile-card-content {
    margin-top: 1.5rem;
  }

  .profile-card p {
    margin-top: 0.75rem;

    font-size: 0.8rem;

    line-height: 1.4;
  }

  .toolbox-card {
    min-height: 0;

    padding: 1rem;
  }

  .toolbox-grid {
    flex: 1;

    min-height: 0;

    margin-top: 0.75rem;
  }

  .tool {
    min-height: 0;
  }

  .tool-button {
    aspect-ratio: auto;

    height: 100%;
  }

  .tool img {
    inset: 0.375rem;

    width: calc(100% - 0.75rem);

    height: calc(100% - 0.75rem);
  }

  .about-inner {
    grid-template-columns: 0.75fr 1.25fr;

    padding: 0 3rem;
  }

  .experience-item {
    grid-template-columns: 7rem 1fr 1.4fr;
  }

  .work {
    padding-inline: 3rem;
  }

  .work-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .work-card {
    grid-column: span 3;

    min-height: 22rem;
  }

  .work-card:nth-child(1) {
    grid-column: span 5;

    grid-row: span 2;

    min-height: 46rem;
  }

  .work-card:nth-child(2) {
    grid-column: span 7;
  }

  .work-card:nth-child(3) {
    grid-column: span 4;
  }

  .project-hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);

    align-items: end;
  }

  .project-heading {
    grid-column: 1;

    grid-row: 1;
  }

  .project-info {
    grid-column: 2;

    grid-row: 1;
  }

  .project-subtitles {
    grid-column: 1;

    grid-row: 2;
  }
}

@media (max-width: 639px) {
  .showreel-button {
    min-height: 16rem;

    padding: 1rem;
  }

  .showreel-button-inner {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track,
  .profile-card-icon {
    animation: none;
  }
}
