/* ============================================================
   PROJECT PAGES
   Shared by Apps / Graphic Design / Websites
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap");

/* ============================================================
   RESET
   ============================================================ */

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

:root {
  --accent: #f4ca30;
  --dark: #1d1d1d;
  --text: #222;
  --muted: #7f7f7f;
  --background: #f6f6f6;
  --background-alt: #eeeeee;
  --card-radius: 14px;
  --ease: cubic-bezier(0.77, 0, 0.175, 1);
}

html {
  width: 100%;
  min-height: 100%;
  background: var(--background);
  -webkit-text-size-adjust: 100%;
}

html {
  width: 100%;
  min-height: 10%
}

body {
  width: 100%;
  min-height: 100%;
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* ============================================================
   FULL PAGE WRAPPER
   ============================================================ */

#fullpage-works {
  width: 100%;
  will-change: transform;
}

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

.page { position: relative; width: 100%; display: flex; align-items: center; justify-content: center; background: radial-gradient( circle at 20% 10%, color-mix( in srgb, var(--accent) 8%, transparent ), transparent 28% ), var(--background); }
.page:nth-child(even) { background: radial-gradient( circle at 80% 90%, color-mix( in srgb, var(--accent) 6%, transparent ), transparent 30% ), #f1f1f1; }

/* ============================================================
   CONTAINER
   ============================================================ */

.container {
  position: relative;
  z-index: 2;
  width: min(1360px, calc(100% - 100px));
  margin-inline: auto;
}

/* ============================================================
   BACK BUTTON
   ============================================================ */

.back {
  position: fixed;
  top: max(24px, env(safe-area-inset-top));
  left: max(30px, env(safe-area-inset-left));
  z-index: 999;
  min-height: 44px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(29, 29, 29, 0.08);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.07);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease,
    background 0.25s ease;
}

.back:hover {
  color: var(--dark);
  border-color: var(--accent);
  background: var(--accent);
  transform: translateX(-3px);
}

/* ============================================================
   SECTION HEADING
   ============================================================ */

.eyebrow {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.65;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.eyebrow span {
  display: inline-block;
  margin-bottom: 3px;
  color: var(--accent);
  font-weight: 700;
}

.center {
  text-align: center;
}

/* ============================================================
   PROJECT GRID
   ============================================================ */

.works-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-inline: auto;
}

.works-grid + .works-grid {
  margin-top: 20px;
}

/* Single project automatically centers */

.works-grid > .work:only-child {
  width: 100%;
  max-width: 540px;
  grid-column: 1 / -1;
  justify-self: center;
}

/* ============================================================
   PROJECT CARD
   ============================================================ */

.work {
  position: relative;
  width: 100%;
  height: clamp(175px, 22vh, 245px);
  overflow: hidden;
  display: block;
  border-radius: var(--card-radius);
  background: #222;
  isolation: isolate;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.07);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

/* Image */

.work-img {
  position: absolute;
  inset: 0;

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

  transform: scale(1.001);

  transition: transform 0.7s var(--ease), filter 0.5s ease;
}

/* Always-visible bottom gradient */

.work::after {
  content: "";

  position: absolute;
  inset: 0;

  z-index: 1;

  background: linear-gradient(
    to top,
    rgba(10, 10, 10, 0.88) 0%,

    rgba(10, 10, 10, 0.38) 43%,

    rgba(10, 10, 10, 0.03) 78%
  );

  transition: background 0.4s ease;
}

/* External-link indicator */

.work::before {
  content: "↗";

  position: absolute;

  top: 15px;
  right: 15px;

  z-index: 4;

  width: 35px;
  height: 35px;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background: rgba(15, 15, 15, 0.62);

  border: 1px solid rgba(255, 255, 255, 0.18);

  backdrop-filter: blur(10px);

  color: #fff;

  font-size: 15px;

  opacity: 0;

  transform: translateY(-5px);

  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

/* ============================================================
   CARD INFO
   ============================================================ */

.work-info {
  position: absolute;

  left: 0;
  right: 0;
  bottom: 0;

  z-index: 3;

  padding: 26px 25px 22px;

  color: #fff;

  text-align: left;
}

.work-info h4 {
  margin-bottom: 7px;

  font-size: clamp(15px, 1.15vw, 18px);

  line-height: 1.3;

  font-weight: 600;

  letter-spacing: -0.2px;
}

.work-info span {
  display: block;

  color: var(--accent);

  font-size: 10px;

  line-height: 1.55;

  letter-spacing: 1.5px;

  text-transform: uppercase;

  opacity: 0.92;
}

/* ============================================================
   DESKTOP CARD HOVER
   ============================================================ */

@media (hover: hover) and (pointer: fine) {
  .work:hover {
    transform: translateY(-7px);

    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.16);
  }

  .work:hover .work-img {
    transform: scale(1.075);

    filter: brightness(0.76);
  }

  .work:hover::after {
    background: linear-gradient(
      to top,
      rgba(10, 10, 10, 0.94) 0%,

      rgba(10, 10, 10, 0.5) 50%,

      rgba(10, 10, 10, 0.1) 100%
    );
  }

  .work:hover::before {
    opacity: 1;

    transform: translateY(0);

    background: var(--accent);

    color: var(--dark);
  }
}

/* ============================================================
   KEYBOARD ACCESSIBILITY
   ============================================================ */

.work:focus-visible,
.back:focus-visible,
.gallery-arrows:focus-visible {
  outline: 3px solid var(--accent);

  outline-offset: 4px;
}

/* ============================================================
   GALLERY ARROWS
   ============================================================ */

.gallery-arrows {
  width: 46px;
  height: 46px;

  margin: 18px auto 0;

  display: grid;
  place-items: center;

  border: 1px solid rgba(29, 29, 29, 0.12);

  border-radius: 50%;

  color: var(--dark);

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

  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);

  font-size: 18px;

  cursor: pointer;

  user-select: none;

  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.arrow-up {
  margin: 0 auto 18px;
}

.gallery-arrows:hover {
  background: var(--accent);

  transform: translateY(2px);
}

.arrow-up:hover {
  transform: translateY(-2px);
}

/* ============================================================
   DESKTOP FULL-PAGE MODE
   ============================================================ */

@media (min-width: 901px) {
  html,
  body {
    width: 100%;
    height: 100%;

    overflow: hidden;
  }

  #fullpage-works {
    height: 100vh;

    transition: transform 0.82s var(--ease);
  }

  .page {
    height: 100vh;

    overflow: hidden;
  }
}

/* ============================================================
   SHORT DESKTOP / LAPTOP SCREENS
   ============================================================ */

@media (min-width: 901px) and (max-height: 760px) {
  .container {
    width: min(1320px, calc(100% - 100px));
  }

  .eyebrow {
    margin-bottom: 18px;

    font-size: 12px;
  }

  .works-grid {
    gap: 14px;
  }

  .works-grid + .works-grid {
    margin-top: 14px;
  }

  .work {
    height: clamp(145px, 19vh, 185px);
  }

  .work-info {
    padding: 18px 20px;
  }

  .gallery-arrows {
    width: 38px;
    height: 38px;

    margin-top: 10px;

    font-size: 15px;
  }

  .arrow-up {
    margin-top: 0;
    margin-bottom: 10px;
  }
}

/* ============================================================
   TABLET / MOBILE
   Natural scrolling
   ============================================================ */

@media (max-width: 900px) {
  html,
  body {
    height: auto;

    overflow-x: hidden;
    overflow-y: auto;

    scroll-snap-type: none;

    -webkit-overflow-scrolling: touch;
  }

  body {
    touch-action: pan-y;
  }

  #fullpage-works {
    height: auto;

    transform: none !important;

    transition: none !important;

    will-change: auto;
  }

  .page {
    width: 100%;

    height: auto;
    min-height: 0;

    overflow: visible;

    display: block;

    padding: 105px 0 58px;
  }

  .page + .page {
    padding-top: 60px;
  }

  .container {
    width: min(680px, calc(100% - 34px));
  }

  .back {
    top: max(14px, env(safe-area-inset-top));

    left: max(16px, env(safe-area-inset-left));

    min-height: 42px;

    padding: 0 14px;

    font-size: 10px;

    letter-spacing: 1.3px;
  }

  .eyebrow {
    margin-bottom: 24px;

    font-size: 12px;

    letter-spacing: 1.8px;
  }

  .works-grid {
    grid-template-columns: 1fr;

    gap: 16px;
  }

  .works-grid + .works-grid {
    margin-top: 16px;
  }

  .works-grid > .work:only-child {
    max-width: none;
  }

  .work {
    height: auto;

    aspect-ratio: 16 / 10;

    min-height: 220px;

    border-radius: 13px;
  }

  .work-info {
    padding: 22px 20px 19px;
  }

  .work-info h4 {
    font-size: 17px;
  }

  .work-info span {
    font-size: 10px;

    letter-spacing: 1.15px;

    line-height: 1.6;
  }

  /*
     Touch devices don't really
     have hover, so keep the
     external indicator visible.
  */

  .work::before {
    opacity: 1;

    transform: none;

    width: 34px;
    height: 34px;

    font-size: 14px;
  }

  /*
     Arrows aren't required on
     mobile because scrolling is
     now natural.
  */

  .gallery-arrows {
    display: none;
  }
}

/* ============================================================
   SMALL PHONES
   ============================================================ */

@media (max-width: 480px) {
  .page {
    padding: 115px 0 48px;
  }

  .page + .page {
    padding-top: 45px;
  }

  .page:first-child .eyebrow {
    display: block;
    visibility: visible;
    opacity: 1;
    position: relative;
    z-index: 5;

    margin-top: 0;
    margin-bottom: 24px;
  }

  .container {
    width: calc(100% - 26px);
  }

  .eyebrow {
    font-size: 11px;

    letter-spacing: 1.5px;

    margin-bottom: 20px;
  }

  .work {
    min-height: 215px;

    aspect-ratio: 4 / 3;
  }

  .work-info {
    padding: 20px 18px 17px;
  }

  .work-info h4 {
    font-size: 16px;
  }

  .work-info span {
    font-size: 9px;

    letter-spacing: 1px;
  }
}

/* ============================================================
   TOUCH DEVICES
   ============================================================ */

@media (hover: none), (pointer: coarse) {
  .work-img {
    transform: none;
  }

  .work::after {
    background: linear-gradient(
      to top,
      rgba(10, 10, 10, 0.9) 0%,

      rgba(10, 10, 10, 0.33) 55%,

      transparent 100%
    );
  }
}

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

@media (prefers-reduced-motion: reduce) {
  #fullpage-works,
  .work,
  .work-img,
  .back,
  .gallery-arrows {
    transition: none !important;
  }
}
