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


/* ---------- BASE ---------- */

:root {
  --nav-link-light: #bbbbbb;

  /* same pink used on homepage */
  --process-pink: rgb(251, 237, 237);

  /* darker + stronger pink outline */
  --process-line: rgba(222, 157, 169, 0.5);

  /* same green used on homepage hover */
  --highlight-green: #e2fed9;
}


html {
  font-size: 16px;
}


body {
  font-size: 16px;
  font-family: 'Roboto', Arial, 'Helvetica Neue', Helvetica, sans-serif;
  background: #fff;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


*,
*::before,
*::after {
  box-sizing: inherit;
}



/* =========================================================
   HEADER
   ========================================================= */

.container_1 {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  margin-bottom: 0 !important;
  padding: 0;
  margin-top: 10px;
  font-size: 16px;
}


.header-nav {
  display: flex;
  justify-content: center;
  gap: 100px;
  width: 100%;
  padding: 0;
  margin: 0;
}


.header-nav .nav-link {
  font-size: 1.15em;
  letter-spacing: 1px;
  color: var(--nav-link-light) !important;
  text-decoration: none;
  margin-right: 0;
  transition: color 0.2s;
}


.header-nav .nav-link:hover,
.header-nav .nav-link:focus {
  color: #000 !important;
}



/* =========================================================
   PROCESS WRAPPER
   ========================================================= */

.process-wrapper {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}



/* =========================================================
   PROCESS STAGE
   ========================================================= */

.process-stage {
  position: relative;

  width: 100%;
  height: calc(100vh - 110px);

  min-height: 720px;

  overflow: hidden;

  margin: 0;
  padding: 0;
}



/* =========================================================
   FLOATING ITEMS
   ========================================================= */

.floating-item {
  position: absolute;

  top: 0;
  left: 0;

  width: var(--w);
  height: var(--h);

  user-select: none;

  will-change: transform;
}



/* =========================================================
   FILE / FOLDER CARD
   ========================================================= */

.file-card {
  /* folded corner size */
  --fold: 48px;

  /* thicker outline */
  --line: 2.5px;

  position: absolute;

  /*
    Outer document shape.
    This layer becomes the pink outline.
  */
  background: var(--process-line);

  clip-path: polygon(
    0 0,
    calc(100% - var(--fold)) 0,
    100% var(--fold),
    100% 100%,
    0 100%
  );

  overflow: hidden;

  cursor: pointer;
}



/* =========================================================
   INNER PAPER + GRAIN
   ========================================================= */

.file-card::before {
  content: "";

  position: absolute;

  inset: var(--line);

  /*
    Pink paper + same noise texture as homepage
  */
  background-color: var(--process-pink);

  background-image:
    linear-gradient(
      rgba(251, 237, 237, 0.68),
      rgba(251, 237, 237, 0.68)
    ),
    url("../assets/noise.svg");

  background-repeat:
    no-repeat,
    repeat;

  background-size:
    100% 100%,
    auto;

  clip-path: polygon(
    0 0,
    calc(100% - (var(--fold) - var(--line) * 2)) 0,
    100% calc(var(--fold) - var(--line) * 2),
    100% 100%,
    0 100%
  );

  z-index: 0;

  pointer-events: none;

  transition:
    background-color 0.25s ease,
    background-image 0.25s ease;
}



/* =========================================================
   FOLDED CORNER
   ========================================================= */

.file-card::after {
  content: "";

  position: absolute;

  top: var(--line);
  right: var(--line);

  width: calc(var(--fold) - var(--line));
  height: calc(var(--fold) - var(--line));

  /*
    Slightly lighter pink than the paper
  */
  background: rgb(252, 240, 240);

  border-left:
    var(--line) solid var(--process-line);

  border-bottom:
    var(--line) solid var(--process-line);

  z-index: 4;

  pointer-events: none;

  transition: background 0.25s ease;
}



/* =========================================================
   HOVER STATE
   ========================================================= */

.file-card.is-hovered::before {
  background-color: var(--highlight-green);

  background-image:
    linear-gradient(
      rgba(226, 254, 217, 0.68),
      rgba(226, 254, 217, 0.68)
    ),
    url("../assets/noise.svg");

  background-repeat:
    no-repeat,
    repeat;

  background-size:
    100% 100%,
    auto;
}


/*
  Folded corner becomes lighter green.
  Green itself is unchanged.
*/
.file-card.is-hovered::after {
  background: rgb(235, 254, 229);
}



/* =========================================================
   CONTENT INSIDE FILES
   ========================================================= */

.file-card > * {
  position: relative;
  z-index: 3;
}



/* =========================================================
   IMAGES / GIFS
   ========================================================= */

.file-card img {
  position: absolute;

  /*
    往內縮一個框線厚度，
    這樣不會蓋到粉紅 outline
  */
  top: var(--line);
  left: var(--line);

  width: calc(100% - var(--line) * 2);
  height: calc(100% - var(--line) * 2);

  object-fit: cover;

  /*
    圖片本身也裁成文件形狀
  */
  clip-path: polygon(
    0 0,
    calc(100% - (var(--fold) - var(--line) * 2)) 0,
    100% calc(var(--fold) - var(--line) * 2),
    100% 100%,
    0 100%
  );

  z-index: 1;

  /* floating state */
  opacity: 0.62;

  transition: opacity 0.3s ease;
}


/* hover / paused */
.file-card.is-hovered img {
  opacity: 1;
}



/* =========================================================
   OPTIONAL TEXT
   ========================================================= */

.file-card h3 {
  margin: 18px 18px 8px 18px;

  font-size: 18px;
  font-weight: 600;
  line-height: 1.05;

  color: #222;
}


.file-card p {
  margin: 0 18px 18px 18px;

  font-size: 12px;
  font-weight: 300;
  line-height: 1.35;

  color: #666;
}



/* =========================================================
   FOOTER
   ========================================================= */

.footer-container {
  width: 100%;

  padding: 0 0 24px 0;

  text-align: center;

  margin-top: 24px;
}


.footer-line {
  border: none;

  border-top: 1.5px solid #bbb;

  margin: 0 0 12px 0;

  width: 100%;
}


.footer-copy {
  font-size: 0.90rem;

  color: #666;

  margin: 0;
}



/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 480px) {

  .header-nav {
    gap: 15px;

    flex-wrap: nowrap;

    justify-content: center;
  }


  .header-nav .nav-link {
    font-size: 10px;

    white-space: nowrap;
  }


  .process-stage {
    width: 100%;

    height: calc(100vh - 80px);

    min-height: 620px;
  }


  .floating-item {
    transform-origin: top left;
  }


  .file-card {
    --fold: 26px;

    /* slightly thicker on mobile too */
    --line: 1.5px;
  }


  .file-card h3 {
    margin: 9px 9px 4px 9px;

    font-size: 10px;
  }


  .file-card p {
    margin: 0 9px 9px 9px;

    font-size: 8px;
  }


  .footer-line {
    margin: 0 0 2px 0;
  }


  .footer-copy {
    font-size: 8px;
  }


  .footer-container {
    padding: 0 0 6px 0;

    margin-top: 6px;
  }
}



/* =========================================================
   TABLET
   ========================================================= */

@media (min-width: 481px) and (max-width: 1024px) {

  .header-nav {
    gap: 60px;
  }


  .process-stage {
    min-height: 700px;
  }


  .file-card {
    --fold: 38px;

    /* thicker outline on tablet */
    --line: 2px;
  }


  .file-card h3 {
    font-size: 15px;

    margin: 14px 14px 6px 14px;
  }


  .file-card p {
    font-size: 10px;

    margin: 0 14px 14px 14px;
  }
}