/* ==========================================================
   JULIAN MAPLE-OLIVEIRA — PORTFOLIO

   Visual direction:
   - white, gallery-like canvas
   - compact geometric typography
   - artwork dominates
   - minimal navigation
   - refined information layers
   ========================================================== */

:root {
  --background: #ffffff;
  --text: #111111;
  --muted: #898989;
  --soft: #f2f2f2;
  --line: #e9e9e9;
  --gutter: 22px;
  --side: 34px;

  --font:
    "Montserrat", "Futura PT", Futura, "Avenir Next", Avenir, "Helvetica Neue",
    Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

body:has(.work-modal[open]) {
  overflow: hidden;
}

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

button,
audio {
  font: inherit;
}

button {
  color: inherit;
}

/* ---------- HEADER ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 35px var(--side) 31px;
}

.site-title {
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.045em;
}

.site-nav {
  display: flex;
  gap: 28px;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  text-transform: lowercase;
}

.site-nav a {
  color: #969696;
  transition: color 150ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: #111;
}

/* ---------- PORTFOLIO GRID ---------- */

.portfolio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
  padding: 0 var(--side) 110px;
}

.project {
  min-width: 0;
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
}

.project-visual {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  margin: 0;
  border: 0 !important;
  border-radius: 0;
  outline: 0 !important;
  box-shadow: none !important;
  overflow: hidden;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  text-align: inherit;
}

.project-visual img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  outline: 0 !important;
  box-shadow: none !important;
}

/* The source artwork contains slightly more visual breathing room than
   the other covers. A tiny crop makes it read at the same scale. */
.project-visual img.artwork-jeuxdeau {
  transform: scale(1.045);
}

.project-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(255, 255, 255, 0.91);
  opacity: 0;
  text-align: center;
  transition: opacity 220ms ease;
}

.project-overlay strong {
  display: block;
  margin: 0 0 7px;
  font-size: clamp(15px, 1.45vw, 21px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.project-overlay small {
  display: block;
  color: #777;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.015em;
  text-transform: lowercase;
}

.project-visual:hover .project-overlay,
.project-visual:focus-visible .project-overlay {
  opacity: 1;
}

/* ---------- LISTEN CONTROL ---------- */

.play-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #777;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  font-weight: 500;
  text-transform: lowercase;
  transition: color 150ms ease;
}

.play-button:hover {
  color: #111;
}

.play-icon {
  display: inline-flex;
  width: 10px;
  justify-content: center;
  color: #111;
  font-size: 8px;
}

/* ---------- WORK MODAL ---------- */

.work-modal {
  width: min(430px, calc(100vw - 48px));
  max-height: min(76vh, 620px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #111;
  box-shadow: 0 16px 54px rgba(0, 0, 0, 0.18);
  overflow: visible;
}

.work-modal::backdrop {
  background: rgba(0, 0, 0, 0.48);
}

.modal-copy {
  max-height: min(76vh, 620px);
  padding: 42px 42px 38px;
  overflow-y: auto;
}

.modal-type {
  margin: 0 0 10px;
  color: #929292;
  font-size: 9px;
  line-height: 1.3;
  font-weight: 500;
  text-transform: lowercase;
}

.modal-copy h2 {
  margin: 0 38px 30px 0;
  font-size: clamp(21px, 2.2vw, 29px);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 500;
}

.work-metadata {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 26px;
  row-gap: 8px;
  margin: 0;
  font-size: 10.5px;
  line-height: 1.55;
}

.work-metadata dt {
  color: #969696;
  font-weight: 500;
}

.work-metadata dd {
  margin: 0;
}

.modal-close {
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 14px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #8a8a8a;
  font-size: 22px;
  line-height: 1;
  font-weight: 300;
}

.modal-close:hover {
  color: #111;
}

/* ---------- ABOUT ---------- */

.about {
  display: grid;
  grid-template-columns: 85px minmax(0, 1fr);
  gap: 38px;
  align-items: start;
  max-width: 1220px;
  padding: 104px var(--side) 122px;
}

.about-heading {
  padding-top: 3px;
  color: #8a8a8a;
  font-size: 9px;
  font-weight: 500;
  text-transform: lowercase;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.82fr);
  gap: clamp(48px, 6vw, 86px);
  align-items: start;
  min-width: 0;
}

.about-copy {
  max-width: 610px;
}

.about-copy p {
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.78;
  letter-spacing: -0.006em;
  font-weight: 400;
}

.inline-link {
  border-bottom: 1px solid #c8c8c8;
  transition: border-color 150ms ease;
}

.inline-link:hover {
  border-color: #111;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  margin-top: 29px;
  font-size: 9.5px;
  font-weight: 500;
  text-transform: lowercase;
}

.about-links a {
  border-bottom: 1px solid #bbb;
  padding-bottom: 2px;
}

/* Editorial image composition:
   one dominant portrait + two supporting mentor portraits. */
.about-gallery {
  width: 100%;
  max-width: 410px;
  justify-self: end;
}

.about-photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #f3f3f3;
}

.about-photo-main {
  width: 100%;
  aspect-ratio: 4 / 3;
}

.about-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border: 0;
  outline: 0;
  box-shadow: none;
}

.mentor-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.mentor-photo {
  overflow: visible;
  background: transparent;
}

.mentor-photo img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f3f3f3;
}

.mentor-photo figcaption {
  margin-top: 6px;
  color: #969696;
  font-size: 7px;
  line-height: 1.4;
  font-weight: 400;
}

.photo-placeholder {
  display: none;
}

.about-photo.is-empty {
  min-height: 120px;
  background: #f3f3f3;
}

.about-photo.is-empty .photo-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #aaa;
  font-size: 7px;
  font-weight: 500;
  text-transform: lowercase;
}

.mentor-photo.is-empty figcaption {
  position: relative;
}

/* ---------- CONTACT ---------- */

.contact {
  display: grid;
  grid-template-columns: 85px minmax(0, 620px);
  gap: 38px;
  align-items: start;
  padding: 40px var(--side) 110px;
}

.contact-label {
  padding-top: 4px;
  color: #8a8a8a;
  font-size: 10px;
  font-weight: 500;
  text-transform: lowercase;
}

.contact-content p {
  max-width: 560px;
  margin: 0 0 15px;
  color: #6f6f6f;
  font-size: 11px;
  line-height: 1.65;
}

.contact-content > a {
  display: inline-block;
  font-size: clamp(18px, 2vw, 27px);
  line-height: 1.2;
  letter-spacing: -0.035em;
  border-bottom: 1px solid #111;
}

/* ---------- RIGHTS NOTICE ---------- */

.rights-notice {
  width: min(1040px, calc(100% - 120px));
  margin: 0 auto;
  padding: 30px 0 36px;
  border-top: 1px solid var(--line);
}

.rights-notice p {
  width: 100%;
  margin: 0;
  color: #999;
  font-size: 7.5px;
  line-height: 1.7;
  letter-spacing: 0.02em;
}

/* ---------- FOOTER ---------- */

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px var(--side) 82px;
  color: #9b9b9b;
  font-size: 9px;
  font-weight: 500;
  text-transform: lowercase;
}

/* ---------- AUDIO PLAYER ---------- */

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;

  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(280px, 620px);
  justify-content: center;
  align-items: center;
  gap: 20px;

  min-height: 58px;
  padding: 6px var(--side);

  border-top: 1px solid #e3e3e3;
  background: rgba(255, 255, 255, 0.98);

  transform: translateY(100%);
  transition: transform 180ms ease;
}

.player.visible {
  transform: translateY(0);
}

.player-title {
  overflow: hidden;
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player audio {
  display: block;
  width: 100%;
  height: 38px;
}

/* ---------- ACCESSIBILITY ---------- */

a:focus-visible,
button:focus-visible {
  outline: 1px solid #111;
  outline-offset: 4px;
}

.project-visual:focus-visible {
  outline: 0;
}

.project-visual:focus-visible .project-overlay {
  opacity: 1;
}

/* ---------- TABLET ---------- */

@media (max-width: 900px) {
  :root {
    --side: 24px;
    --gutter: 16px;
  }

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

  .project-overlay {
    opacity: 1;
    align-items: flex-end;
    justify-content: flex-start;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.44), transparent 52%);
    color: #fff;
    text-align: left;
  }

  .project-overlay small {
    color: rgba(255, 255, 255, 0.8);
  }

  .about {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 28px;
    max-width: 1000px;
  }

  .about-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
    gap: 40px;
  }

  .about-gallery {
    max-width: 340px;
  }
}

/* ---------- MOBILE ---------- */

@media (max-width: 620px) {
  :root {
    --side: 18px;
    --gutter: 14px;
  }

  .site-header {
    align-items: flex-start;
    padding-top: 24px;
    padding-bottom: 25px;
  }

  .site-title {
    max-width: 155px;
    font-size: 15px;
    line-height: 1.08;
  }

  .site-nav {
    gap: 13px;
    font-size: 10px;
  }

  .portfolio {
    grid-template-columns: 1fr;
    padding-bottom: 66px;
  }

  .project-overlay {
    padding: 18px;
  }

  .project-overlay strong {
    font-size: 16px;
  }

  .about {
    display: block;
    padding-top: 66px;
    padding-bottom: 84px;
  }

  .about-heading {
    margin-bottom: 24px;
  }

  .about-layout {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .about-gallery {
    order: 1;
    width: 100%;
    max-width: none;
    justify-self: auto;
  }

  .about-copy {
    order: 2;
    max-width: none;
  }

  .about-photo-main {
    aspect-ratio: 4 / 3;
  }

  .mentor-photos {
    gap: 10px;
    margin-top: 10px;
  }

  .mentor-photo img {
    aspect-ratio: 4 / 3;
  }

  .mentor-photo figcaption {
    font-size: 6.5px;
  }

  .about-copy p {
    font-size: 12px;
    line-height: 1.72;
  }

  .about-links {
    gap: 14px 18px;
    margin-top: 24px;
    font-size: 9px;
  }

  .contact {
    grid-template-columns: 1fr;
    gap: 17px;
    padding-top: 24px;
    padding-bottom: 76px;
  }

  .contact-content p {
    font-size: 10.5px;
  }

  .contact-content > a {
    font-size: 18px;
    word-break: break-word;
  }

  .rights-notice {
    width: calc(100% - 36px);
    margin: 0 auto;
    padding: 24px 0 29px;
  }

  .rights-notice p {
    font-size: 7px;
    line-height: 1.75;
  }

  .work-modal {
    width: min(360px, calc(100vw - 28px));
    max-height: calc(100vh - 44px);
  }

  .modal-copy {
    max-height: calc(100vh - 44px);
    padding: 34px 26px 30px;
  }

  .modal-copy h2 {
    margin: 0 34px 25px 0;
    font-size: 22px;
  }

  .work-metadata {
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 7px;
    font-size: 10px;
  }

  .modal-close {
    top: 10px;
    right: 11px;
  }

  .player {
    grid-template-columns: 1fr;
    gap: 2px;
    min-height: 72px;
    padding: 5px 18px 7px;
  }

  .player-title {
    text-align: center;
  }

  .player audio {
    height: 36px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 92px;
  }
}

@media (max-width: 380px) {
  .mentor-photo figcaption {
    font-size: 6px;
  }

  .site-header {
    gap: 16px;
  }

  .site-title {
    max-width: 128px;
    font-size: 14px;
  }

  .site-nav {
    gap: 10px;
    font-size: 9.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* ---------- CROSS-BROWSER METADATA FIX ---------- */
.work-metadata {
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 26px;
  row-gap: 8px;
}

.work-metadata dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  .work-metadata {
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 7px;
  }
}
