
/* ==========================================================
   SHARED PROJECT INTRODUCTION
   ========================================================== */

/*
   Reusable introduction for all portfolio projects.

   Project-specific colours are defined in each
   project's page-specific stylesheet.

   Load AFTER appearance.css and
   BEFORE individual project stylesheets.
*/


/* ==========================================================
   01 — DEFAULT COLOUR TOKENS
   ========================================================== */

body {
  --project-highlight: #E9E2E8;
  --project-highlight-text: #171822;
  --project-description: var(--muted);
}


/* ==========================================================
   02 — PROJECT INTRODUCTION CONTAINER
   ========================================================== */

.portfolio-intro {
  padding: 42px var(--pad) 32px;
  background: var(--paper);
  color: var(--ink);
}


/* ==========================================================
   03 — TOP METADATA
   ========================================================== */

.portfolio-intro__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.13em;

  text-transform: uppercase;
  color: var(--accent);
}

.portfolio-intro__meta span:last-child {
  text-align: right;
}


/* ==========================================================
   04 — PROJECT TITLE AND TECHNOLOGY LOGOS
   ========================================================== */

.portfolio-intro__heading {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 24px;
  margin: 18px 0 16px;
}


/* Project title */

.portfolio-intro__title {
  margin: 0;
  padding: 0;
  min-width: 0;

  font-family: var(--display);
  font-size: clamp(52px, 5.5vw, 88px);
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: -0.065em;

  color: var(--ink);
}


/* ==========================================================
   05 — TWO-COLUMN INFORMATION LAYOUT
   ========================================================== */

.portfolio-intro__content {
  display: grid;

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

  gap: 32px;
  align-items: start;
}


/* ==========================================================
   06 — PROJECT STATEMENT AND DESCRIPTION
   ========================================================== */

.portfolio-intro__copy {
  min-width: 0;
}


/* Coloured project statement */

.portfolio-intro__statement {
  display: block;
  width: 100%;

  margin: 0 0 18px;
  padding: 11px 12px;

  background: var(--project-highlight);
  color: var(--project-highlight-text);

  border: none;
  border-radius: 3px;

  font-family: var(--display);
  font-size: clamp(19px, 1.55vw, 23px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.04em;
}


/* Supporting project description */

.portfolio-intro__description {
  margin: 0;
  padding: 0;

  font-family: var(--body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.68;
  letter-spacing: -0.01em;

  color: var(--project-description);
}


/* Multiple description paragraphs */

.portfolio-intro__description +
.portfolio-intro__description {
  margin-top: 12px;
}


/* ==========================================================
   07 — KEY DETAILS: INFORMATION CARDS
   ========================================================== */

.portfolio-intro__facts {
  display: grid;

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

  gap: 8px;
  align-content: start;

  margin: 0;
  padding: 0;
}


/* Individual detail cards */

.portfolio-intro__fact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;

  min-width: 0;
  min-height: 64px;
  gap: 5px;

  margin: 0;
  padding: 10px 12px;

  background: #171822;

  border: none;
  border-radius: 3px;
}


/* Card labels */

.portfolio-intro__fact dt {
  margin: 0;
  padding: 0;

  font-family: var(--body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.08em;

  text-transform: uppercase;
  color: #A7A6B0;
}


/* Card information */

.portfolio-intro__fact dd {
  margin: 0;
  padding: 0;

  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.02em;

  color: #FFFFFF;
}


/* ==========================================================
   08 — TABLET
   MAX WIDTH: 1150px
   ========================================================== */

@media (max-width: 1150px) {

  .portfolio-intro__content {
    gap: 24px;
  }

  .portfolio-intro__facts {
    gap: 8px;
  }

  .portfolio-intro__description {
    font-size: 15px;
  }

}


/* ==========================================================
   09 — SMALL TABLET
   MAX WIDTH: 900px
   ========================================================== */

@media (max-width: 900px) {

  .portfolio-intro__heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .portfolio-intro__content {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }

  .portfolio-intro__copy {
    max-width: 700px;
  }

  .portfolio-intro__facts {
    max-width: 700px;
  }

}


/* ==========================================================
   10 — MOBILE
   MAX WIDTH: 650px
   ========================================================== */

@media (max-width: 650px) {

  .portfolio-intro {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .portfolio-intro__meta {
    align-items: flex-start;
    gap: 12px;
    font-size: 10px;
  }

  .portfolio-intro__meta span:last-child {
    max-width: 155px;
  }

  .portfolio-intro__heading {
    margin: 18px 0 25px;
  }

  .portfolio-intro__title {
    font-size: clamp(42px, 9vw, 60px);
    line-height: 1.04;
    letter-spacing: -0.06em;
    overflow-wrap: anywhere;
  }

  .portfolio-intro__content {
    gap: 26px;
  }

  .portfolio-intro__statement {
    font-size: 19px;
    line-height: 1.3;
    padding: 12px;
    margin-bottom: 16px;
  }

  .portfolio-intro__description {
    font-size: 15px;
  }

  .portfolio-intro__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .portfolio-intro__fact {
    padding: 10px 12px;
    gap: 5px;
  }

  .portfolio-intro__fact dt {
    font-size: 12px;
  }

  .portfolio-intro__fact dd {
    font-size: 14px;
    line-height: 1.45;
  }

}


/* ==========================================================
   11 — SMALL MOBILE
   MAX WIDTH: 420px
   ========================================================== */

@media (max-width: 420px) {

  .portfolio-intro__statement {
    font-size: 18px;
  }

  .portfolio-intro__facts {
    gap: 8px;
  }

  .portfolio-intro__fact {
    padding: 9px 10px;
  }

  .portfolio-intro__fact dt {
    font-size: 12px;
  }

  .portfolio-intro__fact dd {
    font-size: 13px;
  }

}


/* ==========================================================
   12 — DARK MODE: INVERT KEY DETAILS CARDS
   Applies to all project pages
   ========================================================== */

html:not([data-theme="light"]) .portfolio-intro__fact {
  background: #F0F0F2;
}

html:not([data-theme="light"]) .portfolio-intro__fact dt {
  color: #6A6872;
}

html:not([data-theme="light"]) .portfolio-intro__fact dd {
  color: #171822;
}


/* ==========================================================
   13 — SHARED TECHNOLOGY LOGOS
   Applies to ALL project introductions
   ========================================================== */


/* Logo group container */

.portfolio-intro .green-tools-column {
  flex: 0 1 auto;

  min-width: 0;
  max-width: 100%;

  /* Push the entire group to the right margin */
  margin-left: auto;

  padding: 0;
  background: transparent;
  border: none;
}


/* Keep the logos in one horizontal row */
.portfolio-intro .green-tools-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;

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

  gap: 8px;

  width: max-content;
  max-width: 100%;
}


/* ==========================================================
   14 — INDIVIDUAL TECHNOLOGY LOGOS
   ========================================================== */

/*
   IMPORTANT CHANGE:

   Each container is at least 64px wide but can
   expand to fit longer captions.

   This prevents captions such as "Sewing Machine"
   from extending beyond the right page margin.

   The logo remains centred above its caption.
*/

.portfolio-intro .green-tool {
  display: grid;
  grid-template-columns: max-content;
  grid-template-rows: 50px 16px;

  justify-items: center;
  align-items: center;

  flex: 0 0 64px;
  width: 64px;
  min-width: 64px;
  height: 80px;

  gap: 3px;
  padding: 5px 0;
  box-sizing: border-box;

  background: transparent;
  border: none;
  border-radius: 0;
  text-align: center;

  opacity: 0;
  animation: project-tool-reveal 1.4s ease-in-out forwards;
}

/* Technology logo images */

.portfolio-intro .green-tool img {
  display: block;

  width: 42px;
  height: 42px;

  max-width: 100%;
  object-fit: contain;

  justify-self: center;
  align-self: center;
}


/* Technology logo captions */

.portfolio-intro .green-tool span {
  display: block;

  width: max-content;
  max-width: none;

  justify-self: center;
  align-self: center;

  font-family: var(--body);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;

  /* Always remain on a single line */
  white-space: nowrap;

  text-align: center;
  color: var(--ink);
}


/* ==========================================================
   15 — SEQUENTIAL LOGO ANIMATION
   ========================================================== */

.portfolio-intro .green-tool:nth-child(1) {
  animation-delay: 0.2s;
}

.portfolio-intro .green-tool:nth-child(2) {
  animation-delay: 0.6s;
}

.portfolio-intro .green-tool:nth-child(3) {
  animation-delay: 1.0s;
}

.portfolio-intro .green-tool:nth-child(4) {
  animation-delay: 1.4s;
}

.portfolio-intro .green-tool:nth-child(5) {
  animation-delay: 1.8s;
}

.portfolio-intro .green-tool:nth-child(6) {
  animation-delay: 2.2s;
}

.portfolio-intro .green-tool:nth-child(7) {
  animation-delay: 2.6s;
}

.portfolio-intro .green-tool:nth-child(8) {
  animation-delay: 3.0s;
}

.portfolio-intro .green-tool:nth-child(9) {
  animation-delay: 3.4s;
}

.portfolio-intro .green-tool:nth-child(10) {
  animation-delay: 3.8s;
}


/* Fade in and rise slightly */

@keyframes project-tool-reveal {

  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }

}


/* ==========================================================
   16 — RESPONSIVE TECHNOLOGY LOGOS
   ========================================================== */


/* Tablet */

@media (max-width: 1150px) {

  .portfolio-intro .green-tool {
    min-width: 60px;
    height: 66px;
    grid-template-rows: 40px 16px;
  }

  .portfolio-intro .green-tool img {
    width: 36px;
    height: 36px;
  }

}


/* Small tablet */

@media (max-width: 900px) {

  .portfolio-intro .green-tools-column {
    margin-left: 0;
  }

  .portfolio-intro .green-tools-grid {
    justify-content: flex-start;
  }

}


/* Mobile */

@media (max-width: 650px) {

  .portfolio-intro .green-tools-grid {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }

  .portfolio-intro .green-tool {
    min-width: 54px;
    height: 54px;

    grid-template-rows: 32px 12px;
    gap: 2px;

    padding: 3px 0;
  }

  .portfolio-intro .green-tool img {
    width: 29px;
    height: 29px;
  }

  .portfolio-intro .green-tool span {
    font-size: 9px;
  }

}


/* Small mobile */

@media (max-width: 420px) {

  .portfolio-intro .green-tool {
    min-width: 48px;
    height: 48px;

    grid-template-rows: 28px 10px;
    gap: 2px;
  }

  .portfolio-intro .green-tool img {
    width: 25px;
    height: 25px;
  }

  .portfolio-intro .green-tool span {
    font-size: 8px;
  }

}


/* ==========================================================
   17 — ACCESSIBILITY
   ========================================================== */

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

  .portfolio-intro .green-tool {
    opacity: 1;
    animation: none;
    transform: none;
  }

}

/* ==========================================================
   FINAL LOGO — ALIGN CAPTION WITH RIGHT MARGIN
   WITHOUT CHANGING SPACING BETWEEN LOGOS
   ========================================================== */

@media (min-width: 901px) {

  .portfolio-intro .green-tools-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;

    width: max-content;
    max-width: 100%;
    margin-left: auto;

    transform: none;
  }

  /* All logos retain their original spacing */
  .portfolio-intro .green-tool {
    flex: 0 0 64px;
    width: 64px;
    min-width: 64px;
  }

  /*
     Final logo's slot matches the caption width,
     so the caption ends at the right-hand margin.
  */
  .portfolio-intro .green-tool:last-child {
    flex: 0 0 auto;
    width: max-content;
    min-width: 0;
  }

  /* Keep the final image and caption centred */
  .portfolio-intro .green-tool:last-child img,
  .portfolio-intro .green-tool:last-child span {
    justify-self: center;
  }

}

/* ==========================================================
   EXCEL LOGO — HORIZONTAL SPACING ADJUSTMENT
   ========================================================== */

.portfolio-intro .green-tool:has(img[src*="excel"]) {
  position: relative;
  left: 8px;
}



/* ==========================================================
   DARK MODE — TECHNOLOGY LOGOS
   ========================================================== */

/* Brother */
html[data-theme="dark"] .portfolio-intro img[src*="brother"] {
  content: url("../../assets/images/tools/brotherw.png");
}

/* Canon */
html[data-theme="dark"] .portfolio-intro img[src*="canon"] {
  content: url("../../assets/images/tools/canonw.png");
}

/* Jupyter */
html[data-theme="dark"] .portfolio-intro img[src*="jupyter"] {
  content: url("../../assets/images/tools/jupyterw.png");
}

/* OpenAI */
html[data-theme="dark"] .portfolio-intro img[src*="gpt"] {
  content: url("../../assets/images/tools/gptw.png");
}

/* Pandas */
html[data-theme="dark"] .portfolio-intro img[src*="pandas"] {
  content: url("../../assets/images/tools/pandasw.png");
}

/* YUPO */
html[data-theme="dark"] .portfolio-intro img[src*="yupo"] {
  content: url("../../assets/images/tools/yupow.png");
}
