/* ============================================================
   Ben Darvill — portfolio
   Shared styles across work / about / contact
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;700&display=swap');

:root {
  --bg: #1e1e1e;
  --fg: #ffffff;
  --fg-dim: rgba(255, 255, 255, 0.55);
  --fg-faint: rgba(255, 255, 255, 0.3);
  --line: rgba(255, 255, 255, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* ===================== PRELOADER ===================== */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-logo {
  width: 44px;
  height: 44px;
  animation: preloaderPulse 1.4s ease-in-out infinite;
}

.preloader-logo img,
.preloader-logo svg {
  width: 100%;
  height: 100%;
}

@keyframes preloaderPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* ===================== NAV ===================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 44px 6%;
  pointer-events: none;
}

.site-header * {
  pointer-events: auto;
}

.logo-mark {
  width: 40px;
  height: 40px;
  display: block;

  opacity: 0;
  transform: translateX(-20px);

  transition:
    opacity 0.8s cubic-bezier(0.16,1,0.3,1),
    transform 0.8s cubic-bezier(0.16,1,0.3,1);
}

.logo-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.loaded .logo-mark {
  opacity: 1;
  transform: translateX(0);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;

  font-size: 13px;
  letter-spacing: 2px;
  color: var(--fg-dim);
}

.site-nav .sep {
  color: var(--fg-faint);
  font-weight: 300;
}

.site-nav a {
  font-weight: 700;
  color: var(--fg-dim);

  opacity: 0;
  transform: translateY(-20px);

  transition:
    opacity 0.7s cubic-bezier(0.16,1,0.3,1),
    transform 0.7s cubic-bezier(0.16,1,0.3,1),
    color 0.3s ease;
}

.site-nav a:hover {
  color: var(--fg);
}

.site-nav a.current {
  color: var(--fg);
}

.loaded .site-nav a {
  opacity: 1;
  transform: translateY(0);
}

.site-nav a:nth-child(1) {
  transition-delay: 0.05s;
}

.site-nav a:nth-child(3) {
  transition-delay: 0.15s;
}

.site-nav a:nth-child(5) {
  transition-delay: 0.25s;
}

/* generic page fade */

.page-fade {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.loaded .page-fade {
  opacity: 1;
}

/* ============================================================
   WORK PAGE — CAROUSEL
   ============================================================ */

.work-wrap {
  min-height: 100vh;

  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 160px 6% 60px;
}

.work-heading {
  font-size: 34px;
  font-weight: 300;
  margin-bottom: 44px;

  opacity: 0;
  transform: translateY(-20px);

  transition:
    opacity 0.8s cubic-bezier(0.16,1,0.3,1) 0.1s,
    transform 0.8s cubic-bezier(0.16,1,0.3,1) 0.1s;
}

.loaded .work-heading {
  opacity: 1;
  transform: translateY(0);
}

/* Full-width carousel viewport */

.carousel-viewport {
  position: relative;
  left: 50%;

  width: 100vw;
  margin-left: -50vw;

  overflow: hidden;
}

/* Horizontal track */

.carousel-track {
  display: flex;
  flex-wrap: nowrap;

  gap: 22px;

  width: max-content;

  padding-left: 6vw;
  padding-right: 6vw;

  will-change: transform;
}

/* Individual project */

.carousel-item {
  position: relative;

  flex: 0 0 180px;
  width: 180px;

  height: 720px;
  max-height: 62vh;

  overflow: hidden;

  cursor: pointer;

  background: #141414;

  /*
    IMPORTANT:
    The cards are visible by default.
    The old version hid them with opacity:0 and relied
    on site:loaded to reveal them.
  */
  opacity: 1;

  clip-path: none;

  transition:
    opacity 0.4s ease,
    clip-path 0.8s cubic-bezier(0.16,1,0.3,1);
}

/* =========================
   CAROUSEL IMAGE
   ========================= */

.carousel-item-bg {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;

  /*
    IMAGE IS 30% OPACITY
  */
  opacity: 0.3;

  z-index: 1;

  pointer-events: none;

  transform: scale(1);

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

.carousel-item:hover .carousel-item-bg {
  opacity: 1;
  transform: scale(1.04);
}

/* =========================
   CAROUSEL LOGO
   ========================= */

.carousel-item-logo {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20%;

  z-index: 2;

  pointer-events: none;

  opacity: 1;

  transition:
    opacity 0.6s ease,
    filter 0.5s ease;
}

.carousel-item-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.carousel-item:hover .carousel-item-logo {
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
}

/* =========================
   CAROUSEL RAIL
   ========================= */

.carousel-rail {
  position: relative;

  height: 1px;

  background: var(--line);

  margin: 40px 20% 0;
}

.carousel-rail-fill {
  position: absolute;

  top: -0.5px;
  left: 0;

  width: 80px;
  height: 2px;

  background: var(--fg);

  transition: transform 0.2s linear;
}

/* ============================================================
   FULLSCREEN PROJECT OVERLAY
   ============================================================ */

.project-overlay {
  position: fixed;
  inset: 0;

  z-index: 500;

  display: flex;

  visibility: hidden;
  opacity: 0;

  background: var(--bg);

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

.project-overlay.open {
  visibility: visible;
  opacity: 1;
}

/* =========================
   OVERLAY IMAGE
   ========================= */

.project-overlay-image {
  position: relative;

  flex: 1 1 55%;
  min-width: 0;

  overflow: hidden;

  background: #141414;
}

/*
  The image is deliberately placed on a pseudo-element.

  This means:
  - image = 30%
  - gradient = separate
  - play button = 100%
*/

/* Actual project image */
.project-overlay-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--overlay-img);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.3;
  z-index: 1;
}

/* Dark gradient over image */
.project-overlay-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0) 60%,
    rgba(30,30,30,0.5) 100%
  );
  z-index: 2;
}


/* =========================
   PLAY BUTTON
   ========================= */

.project-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 84px;
  height: 84px;
  transform: translate(-50%, -50%) scale(0.85);
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  z-index: 10;
  transition:
    opacity 0.6s ease,
    transform 0.5s cubic-bezier(0.16,1,0.3,1),
    background 0.3s ease,
    border-color 0.3s ease;
}

.project-play svg {
  width: 26px;
  height: 26px;
  fill: #fff;
  margin-left: 4px;
}

.project-play:hover {
  background: rgba(255,255,255,0.12);
  border-color: #fff;
}

.project-overlay.open .project-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  transition-delay: 0.35s;
}

/* =========================
   OVERLAY INFO
   ========================= */

.project-overlay-info {
  flex: 1 1 45%;

  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 100px 7%;

  max-width: 620px;
}

.project-overlay-close {
  position: absolute;

  top: 40px;
  right: 6%;

  z-index: 20;

  width: 34px;
  height: 34px;

  background: none;
  border: none;

  color: var(--fg-dim);

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  transform: translateY(-16px);

  transition:
    opacity 0.5s ease 0.4s,
    transform 0.5s cubic-bezier(0.16,1,0.3,1) 0.4s,
    color 0.3s ease;
}

.project-overlay-close svg {
  width: 22px;
  height: 22px;
}

.project-overlay-close:hover {
  color: var(--fg);
}

.project-overlay.open .project-overlay-close {
  opacity: 1;
  transform: translateY(0);
}

.project-overlay-info > * {
  opacity: 0;
  transform: translateY(24px);

  transition:
    opacity 0.6s cubic-bezier(0.16,1,0.3,1),
    transform 0.6s cubic-bezier(0.16,1,0.3,1);
}

.project-overlay.open .project-overlay-info > * {
  opacity: 1;
  transform: translateY(0);
}

.project-overlay.open .project-type {
  transition-delay: 0.15s;
}

.project-overlay.open .project-client {
  transition-delay: 0.22s;
}

.project-overlay.open .project-body {
  transition-delay: 0.3s;
}

.project-overlay.open .project-nav {
  transition-delay: 0.4s;
}

.project-type {
  font-size: 13px;
  letter-spacing: 1px;

  color: var(--fg-dim);

  margin-bottom: 14px;
}

.project-client {
  font-size: 46px;
  font-weight: 700;

  letter-spacing: -0.5px;

  margin-bottom: 28px;

  line-height: 1.1;
}

.project-body p {
  font-size: 15px;
  line-height: 1.75;

  color: var(--fg-dim);

  max-width: 46ch;

  margin-bottom: 16px;
}

/* =========================
   PROJECT NAV
   ========================= */

.project-nav {
  display: flex;

  justify-content: space-between;
  align-items: flex-end;

  margin-top: 60px;
  padding-top: 24px;

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

.project-nav-btn {
  background: none;
  border: none;

  color: var(--fg);

  cursor: pointer;

  text-align: left;
}

.project-nav-btn:last-child {
  text-align: right;
}

.project-nav-label {
  display: block;

  font-size: 11px;
  letter-spacing: 1.5px;

  color: var(--fg-faint);

  margin-bottom: 6px;
}

.project-nav-title {
  display: block;

  font-size: 13px;
  font-weight: 700;

  letter-spacing: 0.5px;

  transition: opacity 0.3s ease;
}

.project-nav-btn:hover .project-nav-title {
  opacity: 0.6;
}

/* ============================================================
   VIDEO MODAL
   ============================================================ */

.video-modal {
  position: fixed;
  inset: 0;

  z-index: 1100;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(30,30,30,0);

  visibility: hidden;

  transition:
    background 0.6s ease,
    visibility 0.6s;
}

.video-modal.open {
  background: rgba(30,30,30,0.75);
  visibility: visible;
}

.video-modal-close {
  position: absolute;

  top: 28px;
  right: 36px;

  background: none;
  border: none;

  color: rgba(255,255,255,0.6);

  font-size: 46px;
  font-weight: 300;

  cursor: pointer;

  line-height: 1;

  transition: color 0.2s;
}

.video-modal-close:hover {
  color: #fff;
}

.video-modal-inner {
  width: 90%;
  max-width: 920px;

  opacity: 0;

  transform: translateY(40px);

  transition:
    opacity 0.8s ease 0.15s,
    transform 0.8s ease 0.15s;
}

.video-modal.open .video-modal-inner {
  opacity: 1;
  transform: translateY(0);
}

.video-modal-inner video {
  width: 100%;

  display: block;

  border-radius: 6px 6px 0 0;

  background: #000;
}

.video-modal-note {
  padding: 60px 24px;

  text-align: center;

  color: var(--fg-dim);

  font-size: 14px;

  background: #141414;

  border-radius: 6px;

  display: none;
}

.video-controls {
  display: flex;

  align-items: center;

  gap: 14px;

  padding: 12px 16px;

  background: rgba(0,0,0,0.85);

  border-radius: 0 0 6px 6px;
}

.video-controls button {
  background: none;
  border: none;

  color: #fff;

  cursor: pointer;

  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;
}

.video-controls button svg {
  width: 18px;
  height: 18px;

  fill: #fff;
}

.video-scrub {
  flex: 1;

  position: relative;

  height: 20px;

  display: flex;
  align-items: center;

  cursor: pointer;
}

.video-scrub-track {
  width: 100%;
  height: 4px;

  background: rgba(255,255,255,0.2);

  border-radius: 2px;

  overflow: hidden;

  pointer-events: none;
}

.video-scrub-fill {
  height: 100%;
  width: 0%;

  background: #fff;

  border-radius: 2px;

  pointer-events: none;
}

.video-volume {
  display: flex;
  align-items: center;

  gap: 6px;
}

.video-volume-slider {
  width: 70px;

  position: relative;

  height: 20px;

  display: flex;
  align-items: center;

  cursor: pointer;
}

.video-volume-track {
  width: 100%;
  height: 4px;

  background: rgba(255,255,255,0.2);

  border-radius: 2px;

  overflow: hidden;
}

.video-volume-fill {
  height: 100%;
  width: 100%;

  background: rgba(255,255,255,0.6);

  border-radius: 2px;
}

.video-time {
  font-size: 11px;

  color: rgba(255,255,255,0.6);

  font-weight: 400;

  white-space: nowrap;
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */

.about-wrap {
  position: relative;

  min-height: 100vh;

  display: flex;
  align-items: center;

  padding: 0 6%;

  overflow: hidden;
}

.about-content {
  position: relative;

  z-index: 2;

  max-width: 640px;

  padding-top: 60px;
}

.about-content h1 {
  font-size: 44px;
  font-weight: 700;

  margin-bottom: 18px;

  letter-spacing: -0.5px;

  opacity: 0;
  transform: translateY(20px);

  transition:
    opacity 0.9s cubic-bezier(0.16,1,0.3,1) 0.1s,
    transform 0.9s cubic-bezier(0.16,1,0.3,1) 0.1s;
}

.about-content .about-lede {
  font-size: 19px;
  line-height: 1.6;

  margin-bottom: 30px;

  color: var(--fg);

  opacity: 0;
  transform: translateY(20px);

  transition:
    opacity 0.9s cubic-bezier(0.16,1,0.3,1) 0.2s,
    transform 0.9s cubic-bezier(0.16,1,0.3,1) 0.2s;
}

.about-content p.about-body {
  font-size: 15px;
  line-height: 1.8;

  color: var(--fg-dim);

  margin-bottom: 20px;

  max-width: 60ch;

  opacity: 0;
  transform: translateY(20px);

  transition:
    opacity 0.9s cubic-bezier(0.16,1,0.3,1) 0.3s,
    transform 0.9s cubic-bezier(0.16,1,0.3,1) 0.3s;
}

.loaded .about-content h1,
.loaded .about-content .about-lede,
.loaded .about-content p.about-body {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   ABOUT SOCIAL
   ========================= */

.about-follow {
  display: flex;
  align-items: center;

  /*
    IMPORTANT:
    Keeps Instagram + LinkedIn horizontally beside each other.
  */
  gap: 14px;

  font-size: 16px;

  opacity: 0;
  transform: translateY(20px);

  transition:
    opacity 0.9s cubic-bezier(0.16,1,0.3,1) 0.5s,
    transform 0.9s cubic-bezier(0.16,1,0.3,1) 0.5s;
}

.loaded .about-follow {
  opacity: 1;
  transform: translateY(0);
}

.about-follow a {
  width: 38px;
  height: 38px;

  flex: 0 0 38px;

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

  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

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

.about-follow a:hover {
  border-color: var(--fg);

  transform: translateY(-2px);
}

.about-follow svg {
  width: 18px;
  height: 18px;
}

/* Instagram */
.about-follow a.instagram-link svg {
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
}

/* LinkedIn — FILLED */
.about-follow a.linkedin-link svg {
  fill: #fff;
  stroke: none;
}

.particlehead {
  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  z-index: 1;

  pointer-events: auto;
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */

.contact-wrap {
  min-height: 100vh;

  display: flex;
  align-items: center;

  padding: 140px 6% 80px;
}

.contact-inner {
  width: 100%;
  max-width: 520px;
}

.contact-inner h1 {
  font-size: 40px;
  font-weight: 700;

  margin-bottom: 12px;

  opacity: 0;
  transform: translateY(20px);

  transition:
    opacity 0.8s cubic-bezier(0.16,1,0.3,1) 0.1s,
    transform 0.8s cubic-bezier(0.16,1,0.3,1) 0.1s;
}

.contact-inner .contact-sub {
  font-size: 16px;

  color: var(--fg-dim);

  margin-bottom: 44px;

  opacity: 0;
  transform: translateY(20px);

  transition:
    opacity 0.8s cubic-bezier(0.16,1,0.3,1) 0.2s,
    transform 0.8s cubic-bezier(0.16,1,0.3,1) 0.2s;
}

.loaded .contact-inner h1,
.loaded .contact-inner .contact-sub {
  opacity: 1;
  transform: translateY(0);
}

.contact-form {
  display: flex;
  flex-direction: column;

  gap: 18px;

  opacity: 0;
  transform: translateY(20px);

  transition:
    opacity 0.8s cubic-bezier(0.16,1,0.3,1) 0.3s,
    transform 0.8s cubic-bezier(0.16,1,0.3,1) 0.3s;
}

.loaded .contact-form {
  opacity: 1;
  transform: translateY(0);
}

.contact-form input,
.contact-form textarea {
  background: transparent;

  border: none;

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

  padding: 12px 2px;

  color: #fff;

  font-family: inherit;

  font-size: 15px;

  font-weight: 300;

  resize: vertical;

  transition: border-color 0.3s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--fg-faint);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;

  border-color: #fff;
}

.contact-form textarea {
  min-height: 110px;
}

.contact-form .btn-send {
  align-self: flex-start;

  margin-top: 8px;

  padding: 13px 34px;

  border: 1px solid #fff;

  background: transparent;

  color: #fff;

  font-size: 12px;

  font-weight: 700;

  letter-spacing: 1.5px;

  text-transform: uppercase;

  cursor: pointer;

  transition:
    background 0.35s ease,
    color 0.35s ease;
}

.contact-form .btn-send:hover {
  background: #fff;
  color: #1e1e1e;
}

.contact-form .btn-send:disabled {
  opacity: 0.5;
  cursor: default;
}

.contact-form-status {
  font-size: 13px;

  letter-spacing: 0.3px;

  min-height: 18px;
}

.contact-form-status.success {
  color: #7fd1b9;
}

.contact-form-status.error {
  color: #e08b8b;
}

.contact-social {
  display: flex;

  gap: 16px;

  margin-top: 40px;

  opacity: 0;
  transform: translateY(20px);

  transition:
    opacity 0.8s cubic-bezier(0.16,1,0.3,1) 0.4s,
    transform 0.8s cubic-bezier(0.16,1,0.3,1) 0.4s;
}

.loaded .contact-social {
  opacity: 1;
  transform: translateY(0);
}

.contact-social a {
  display: flex;
  align-items: center;

  gap: 8px;

  font-size: 13px;

  color: var(--fg-dim);

  transition: color 0.3s ease;
}

.contact-social a:hover {
  color: #fff;
}

.contact-social svg {
  width: 18px;
  height: 18px;

  fill: none;

  stroke: currentColor;

  stroke-width: 1.6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {

  .project-overlay {
    flex-direction: column;

    overflow-y: auto;
  }

  .project-overlay-image {
    flex: 0 0 42vh;
  }

  .project-overlay-info {
    padding: 40px 7% 60px;

    max-width: none;
  }

  .project-client {
    font-size: 34px;
  }

  .about-content {
    padding-top: 100px;

    max-width: 100%;
  }
}

/* ============================================================
   MOBILE WORK PAGE
   ============================================================ */

@media (max-width: 600px) {

  .site-header {
    padding: 28px 6%;
  }

  .work-wrap {
    min-height: auto;

    display: block;

    padding: 130px 6% 50px;
  }

  .work-heading {
    margin-bottom: 30px;
  }

  /*
    Kill the desktop breakout on mobile.
  */
  .carousel-viewport {
    position: static;

    left: auto;

    width: 100%;

    margin-left: 0;

    overflow: visible;
  }

  /*
    TWO COLUMN GRID.
    No horizontal carousel on mobile.
  */
  .carousel-track {
    display: grid !important;

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

    gap: 12px;

    width: 100%;

    padding: 0;

    transform: none !important;
  }

  /*
    Previous mobile height was 60vh.
    This is exactly half: 30vh.
  */
  .carousel-item {
    width: 100%;

    min-width: 0;

    height: 30vh;

    max-height: none;

    opacity: 1 !important;

    clip-path: none !important;

    transition: none;
  }

  /*
    On mobile the image itself is the tile.
  */
  .carousel-item-bg {
    opacity: 1;

    transform: none;

    transition: none;
  }

  .carousel-item:hover .carousel-item-bg {
    opacity: 1;

    transform: none;
  }

  /*
    Remove logos from mobile grid.
  */
  .carousel-item-logo {
    display: none;
  }

  /*
    Remove horizontal scroll indicator.
  */
  .carousel-rail {
    display: none;
  }

  .contact-inner h1 {
    font-size: 32px;
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}