/* Shared texture assets */
:root {
  --texture-page: url(/img/bg.png);
  --texture-noise-dark: url(/img/noise-dark.png);
}

body {
  transform-origin: 0 0;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0 90px;
  font-family: 'Montserrat', Arial, sans-serif;
  overflow-x: hidden;
  overflow-y: scroll;
  color: #e5e5e5;
  background: #1c1c1c var(--texture-page);
}

a,
button,
* {
  outline: none;
}

img {
  font-size: 0;
}

/* Decorative surfaces belong on wrappers, not on img tags */
.media-frame {
  display: block;
}

.media-frame > img {
  display: block;
  width: 100%;
  height: auto;
}

.media-frame--noise {
  background-image: var(--texture-noise-dark);
}

::selection {
  background: #bbb;
  color: #222;
}

.content {
  position: relative;
  max-width: 1150px;
  margin: 0 auto;
}

h1,
h2 {
  margin: 0;
  padding: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 40px;
}



h1 a {
  text-decoration: none;
  color: #e5e5e5;
}

h3 {
  margin: 20px 0 0 0;
  padding: 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 36px;
  text-align: center;
  color: #aaa;
}


header {
  position: relative;
  padding: 40px 5px 50px;
  display: flex;
  flex-direction: column;
}

.header-top {
  display: flex;
  flex-wrap: nowrap;
  /* Prevent accidental wrapping - use breakpoint instead */
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 20px;
  /* Minimum gap between logo and nav */
}

header h1 {
  /* float: left; Removed float */
  line-height: 0;
  /* Fix for image height */
}

h1 a {
  text-decoration: none;
  display: block;
}

.header-logo-link {
  display: block;
  position: relative;
  text-decoration: none;
  width: 280px;
  max-width: 100%;
}

.header-logo {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.back-text {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 35px;
  font-weight: 700;
  color: #e5e5e5;
  white-space: nowrap;
  letter-spacing: normal;
  opacity: 0;
  filter: blur(3px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

/* Hover effect only when 'back' class is present */
.header-logo-link.back:hover .header-logo {
  opacity: 0.3;
  filter: grayscale(100%) blur(3px);
  /* Slight ghosting or 0 for full hide */
}

.header-logo-link.back:hover .back-text {
  opacity: 1;
  filter: blur(0);
  color: #00c8ff;
}

header ul {
  display: block;
  margin: 0;
  padding: 0;
  font-weight: 400;
  text-align: right;
  list-style: none;
  align-self: flex-end;
  padding-bottom: 5px;
}

header ul li {
  display: inline-block;
  margin: 0 0 0 15px;
  padding: 0;
  font-size: 17px;
  line-height: 40px;
}

header ul li a {
  display: block;
  color: #e5e5e5;
  text-decoration: none;
  height: 41px;
  box-sizing: border-box;
}

header ul li a:hover {
  border-bottom: 2px solid;
  height: 40px;
  transition: height 0.3s cubic-bezier(0, 0, 0, 1);
}

footer {
  padding: 80px 5px 40px;
  font-weight: 300;
  text-align: center;
  color: #999;
}

footer a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: #e5e5e5;
}

footer small {
  color: #666;
}

/* Homepage intro spacing */
.home-page .tagline {
  margin-top: 0;
}

.home-page .tagline p {
  text-align: left;
  color: #808080;
  margin: 0 0 40px;
}

/* Project title spacing */
.project h2 {
  margin-top: 30px;
  margin-bottom: 5px;
}

.project h2:first-child {
  margin-top: 0;
}

.project h2+p,
.project h2+ul {
  margin-top: 5px;
}

.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}


.thumb {
  position: relative;
  overflow: hidden;
  background: var(--texture-noise-dark);
  animation: noiser 0.3s infinite;
}

@keyframes noiser {
  0% {
    background-position: 0;
  }

  49% {
    background-position: 0;
  }

  50% {
    background-position: 0 1000px;
  }

  51% {
    background-position: 0 2000px;
  }

  100% {
    background-position: 0 2000px;
  }
}

.thumb.x1 {
  grid-column: span 1;
  aspect-ratio: 1 / 1;
}

.thumb.x2 {
  grid-column: span 2;
  aspect-ratio: 2 / 1;
}

.thumb.x3 {
  grid-column: span 3;
  aspect-ratio: 3 / 1;
}

.thumb.y2 {
  grid-column: span 1;
  grid-row: span 2;
  aspect-ratio: 1 / 2;
}

.thumb img,
.thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition-duration: 0.8s;
  transition-timing-function: cubic-bezier(0, 1, 0.3, 1);
}

.thumb .caption {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9;
  text-align: center;
  justify-content: center;
  align-items: center;
  flex-flow: column;
  opacity: 0;
  transition-duration: 0.3s;
  transition-timing-function: cubic-bezier(0, 1, 0.3, 1);
  transform: scale(1.1);
}

.thumb .caption b {
  font-size: 22px;
  font-weight: 400;
  line-height: 30px;
  color: #eee;
  margin: 0 80px;
}

.thumb .caption em {
  font-size: 14px;
  font-weight: 400;
  line-height: 24px;
  font-style: normal;
  color: #aaa;
}

.thumb:after {
  display: block;
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .thumb:hover img,
  .thumb:hover video {
    opacity: 0.15;
    transition-duration: 0.2s;
    transform: scale(1.05);
    filter: blur(10px) grayscale(100%);
  }

  .thumb:hover .caption {
    opacity: 1;
    transition-duration: 0.2s;
    transform: scale(1);
  }
}




/* Project layout */

.project {
  padding: 0 5px 50px;
}

.work-page .project {
  padding-top: 80px;
}

.video {
  position: relative;
  padding: 56.25% 0 0 0;
  margin: 40px 0;
  background: #111;
}

.video.flush {
  margin-bottom: 0;
  margin-top: 0;
}

.video iframe,
.video video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}



.project p {
  font-size: 17px;
  line-height: 28px;
  font-weight: 400;
  color: #999;
  margin: 10px 0;
}

/* ============================================================
   Project role / credits block
   Lives under the video on each work page. Uses a hidden <table>
   purely as an alignment grid so the value column stays flush.
   Borrows the showreel-timestamps hairline + color stack.
   ============================================================ */

.role {
  margin: 30px 0 0;
}

.role table {
  border-collapse: collapse;
  border-spacing: 0;
  width: auto;
  max-width: 880px;
  margin: 0;
}

.role th,
.role td {
  text-align: left;
  vertical-align: baseline;
  padding: 14px 0;
  line-height: 28px;
  border-bottom: 1px solid #222;
}

.role th {
  width: 1px;
  white-space: nowrap;
  padding-right: 40px;
  font-size: 17px;
  font-weight: 500;
  color: #e5e5e5;
}

.role td {
  font-size: 17px;
  font-weight: 400;
  color: #999;
}

.role tr:last-child th,
.role tr:last-child td {
  border-bottom: 0;
}

.role p { margin: 0; }

.role .detail {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  line-height: 26px;
  font-weight: 300;
  color: #777;
}

/* Optional time-breakdown inside a role cell (e.g. partial contribution) */
.role .role-times {
  border-collapse: collapse;
  border-spacing: 0;
  width: auto;
  margin: 0;
}

.role .role-times td {
  border: 0;
  padding: 0 28px 4px 0;
  font-size: 17px;
  line-height: 28px;
  vertical-align: baseline;
  color: #999;
}

.role .role-times tr:last-child td {
  padding-bottom: 0;
}

.role .role-times td:first-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.project p a,
.project li a {
  color: #999;
  text-decoration: none;
  border-bottom: 1px solid #999;
  transition: 0.2s;
}

.project p a:hover,
.project li a:hover {
  color: #eee;
  border-bottom: 1px solid #eee;
  padding-bottom: 3px;
}

.project p a.link-white {
  color: #e5e5e5;
  border-bottom-color: #e5e5e5;
}

.project p a.link-white:hover {
  color: #fff;
  border-bottom-color: #fff;
}

.project a img {
  cursor: zoom-in;
}

.project a:active img {
  transform: scale(0.98);
  transition: 0.1s;
}


/* Timestamps */

.timestamps {
  text-align: left;
}

.timestamps table {
  width: auto;
  border-collapse: collapse;
  font-size: 15px;
  color: #999;
  margin-bottom: 30px;
  text-align: left;
  margin-left: 0;
  margin-right: auto;
}

.timestamps td {
  padding: 8px 30px 8px 0;
  border-bottom: 1px solid #222;
  vertical-align: top;
  white-space: nowrap;
  text-align: left;
}

.timestamps td:nth-child(1) {
  width: 1px;
  font-variant-numeric: tabular-nums;
}

.timestamps td:nth-child(2) {
  width: 1px;
  font-weight: 500;
  color: #ccc;
}

.timestamps td:last-child {
  white-space: normal;
}

.timestamps a {
  color: #ccc;
  text-decoration: none;
  border-bottom: 1px solid #555;
  transition: 0.2s;
}

.timestamps a:hover {
  color: #fff;
  border-bottom-color: #fff;
}


/* Role note (showreel intro) */

.role-note {
  margin: 40px 0;
  max-width: 720px;
  text-align: left;
}

.role-note .role-note__label {
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
  color: #e5e5e5;
  margin: 0 0 4px;
}

.role-note .role-note__body {
  font-size: 17px;
  line-height: 28px;
  color: #999;
  margin: 0;
}


/* Music credit styling */

.music-credit {
  font-size: 14px;
  color: #999;
  text-align: left;
}

.music-credit .label {
  font-size: 16px;
  font-weight: 500;
  color: #ccc;
}


/* ANIMATION */

.page-stage {
  position: relative;
  display: grid;
}

.page-stage.is-transitioning {
  overflow: hidden;
  isolation: isolate;
}

.page-stage > .page-shell {
  grid-area: 1 / 1;
  min-width: 0;
}

.page-stage.is-transitioning > .page-shell {
  transition:
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.page-shell--active {
  opacity: 1;
  transform: translateY(0);
}

.page-shell--enter {
  opacity: 0;
  transform: translateY(-18px);
  pointer-events: none;
}

.page-shell--enter-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 2;
}

.page-shell--exit {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .page-stage.is-transitioning > .page-shell {
    transition: none;
  }

  .page-shell--enter,
  .page-shell--enter-active,
  .page-shell--exit,
  .page-shell--active {
    opacity: 1;
    transform: none;
  }
}


/* Text-heavy pages */

.text-page .project {
  padding-top: 0;
}

ul.links-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.links-list li {
  padding: 0;
  margin: 0 0 16px;
  font-weight: 300;
  color: #808080;
  font-size: 17px;
  line-height: 28px;
}

ul.links-list li a {
  color: #e5e5e5;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: padding 0.2s;
}

ul.links-list li a:hover {
  color: #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 3px;
  transition: padding 0.1s;
}

/* About Page Layout */
.about-layout {
  display: flex;
  gap: 60px;
  align-items: flex-start;
}

.about-image {
  flex: 0 0 45%;
}

.about-text {
  flex: 1;
}

.about-text h2:first-child {
  margin-top: 0;
}

.section-divider {
  border: 0;
  height: 1px;
  background: #333;
  margin: 60px 0 40px;
}

/* FAQ Hero Icon */
.faq-hero {
  width: 100%;
  max-width: 400px;
  margin: 0 auto 50px;
}
