/* ———————————— FONTS ———————————— */
@font-face {
    font-family: "Archivo_medium";
    src: url("fonts/Archivo_medium.woff");
    font-style: normal;
    font-weight: 600;
}

@font-face {
    font-family: "Archivo_regular";
    src: url("fonts/Archivo-Regular.woff2");
    font-style: normal;
    font-weight: 500;
}

@font-face {
  font-family: "CMUNBold";
  src: url("fonts/cmunbbx.woff") format("woff");
  font-style: normal;
  font-weight: 700;
}

@font-face {
  font-family: "CMUNMedium";
  src: url("fonts/cmunbmr.woff") format("woff");
  font-style: normal;
  font-weight: 500;
}

@font-face {
  font-family: "CMUNOblique";
  src: url("fonts/cmunbmo.woff") format("woff");
  font-style: oblique;
  font-weight: 500;
}

@font-face {
  font-family: "CMUNBoldOblique";
  src: url("fonts/cmunbxo.woff") format("woff");
  font-style: oblique;
  font-weight: 700;
}

/* ———————————— DOT ———————————— */
.dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
  clip-path: circle(20%);
  z-index: 10000;
}

/* ———————————— Global page layout ———————————— */

html {
  box-sizing: border-box;
}

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

@media (hover: none), (pointer: coarse), (max-width: 1024px) {
  *,
  *::before,
  *::after,
  html,
  body,
  button,
  a {
    cursor: auto;
  }

  .dot {
    display: none;
  }
}

/* this just to control the grid!! */
/* body > * {
  outline: 1px dashed rgba(0, 0, 0, 0.1);
} */

body {
  margin: 0;
  padding: 30px 50px;
  font-family: "Archivo_regular", "Archivo_medium", Helvetica, sans-serif;
  background: #050505;
  color: #f5f5f5;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 40px;
}

.portfoliopage {
  grid-template-rows: auto repeat(3, minmax(0, 1fr));
  height: 100vh;
  overflow: hidden;
}

p {
    max-width: 100%;
    margin-top: 0%;
    text-align: justify;
    margin-bottom: -5pt;
    font-size: clamp(14px, 1vw + 12px, 16px);
}

h4 {
    margin-top: 24pt;
    margin-bottom: -5pt;
    font-weight: 600;
}

/* ———————————— Header / navigation panel ———————————— */
.panel {
  width: 100%;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 30px;
  align-items: start;
}

.portfoliopage .panel { 
  grid-column: 1 / 2;
  grid-row: 1 / 5;
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: start;
}

/* ———————————— Logo ———————————— */
.logo {
  grid-column: 1 / 2;
  align-self: end;
  justify-self: start;
  padding-bottom: 8px;
}

.portfoliopage .logo {
  align-self: start;
}

.logo img {
  height: 45px;
  width: auto;
  display: block;
  filter: invert(1) brightness(1.2);
}

.menu {
  /* grid-based mega header */
  grid-column: 3 / -1;
  grid-row: 1 / 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
}

.portfoliopage .menu {
  grid-column: 1 / 2;
  grid-row: 2 / 5;
  grid-template-columns: 1fr;
  justify-self: stretch;
  align-self: end;
}

/* ———————————— artwork page title ———————————— */

.title-block {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
  align-self: start;
  justify-self: end;
}

.title-block h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  word-break: break-word;
}

.portfoliopage .title-block {
  grid-column: 3 / -1;
  grid-row: 1 / 2;
  justify-self: end;
  align-self: start;
  text-align: right;
}

.portfoliopage .content {
  grid-column: 2 / 6;
  grid-row: 2 / 5;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  align-self: stretch;
  justify-self: stretch;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.portfoliopage .content-text {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portfoliopage .artwork-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 20px;
}

.portfoliopage .artwork-info p {
  margin: 0;
  line-height: 1.4;
}

.portfoliopage .artwork-info p:first-line {
  font-weight: 600;
}

.portfoliopage .content figure {
  grid-column: 2 / 5;
  margin: 0;
}

.portfoliopage .content figure img {
  width: 100%;
  height: auto;
  display: block;
}

figcaption {
  font-size: 12px;
  opacity: 0.45;
  text-align: right;
  margin-top: 5px;
  font-style: italic;
}

.portfoliopage .content img {
  grid-column: 2 / 5;
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.dreamatlas-page .content img:first-of-type {
  grid-column: 1 / -1;
}

/* Portrait/vertical header images — apply class="portrait-header" to the <img> */
.portfoliopage .content img.portrait-header {
  grid-column: 3 / -1;
  max-height: 68vh;
  justify-self: end;
}

.runtime-landscape-page .content img:first-of-type {
  grid-column: 3 / -1;
  max-height: 68vh;
  justify-self: end;
}

.runtime-landscape-page .title-block {
  justify-self: end;
  text-align: right;
}

.artwork-preview {
  grid-column: 3 / -1;
  grid-row: 1 / 2;
  justify-self: end;
  align-self: start;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.artwork-preview.is-visible {
  opacity: 1;
}

.artwork-preview-title {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  word-break: break-word;
}

.artwork-preview-year {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
}

.artwork-preview-type {
  font-size: clamp(13px, 1vw + 11px, 15px);
  opacity: 0.7;
}

.artworks-overview-page .content {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  align-self: end;
}

.artworks-overview-page .content img {
  grid-column: auto;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.artwork-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  align-self: end;
  width: 100%;
  padding-bottom: 6px;
}

.artwork-card {
  color: inherit;
  text-decoration: none;
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.artwork-card:hover,
.artwork-card:focus-visible {
  outline: none;
}

.artworks-overview-page .artwork-card img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.1);
  will-change: transform;
}

.artwork-card-meta {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  display: grid;
  gap: 2px;
  padding: 22px 18px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.artwork-card:hover .artwork-card-meta,
.artwork-card:focus-visible .artwork-card-meta {
  opacity: 1;
  transform: translateY(0);
}

.artwork-card-title {
  font-size: 0.98rem;
  line-height: 1.15;
}

.artwork-card-year {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

.slider {
  grid-column: 1 / -1;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 10px;
}

.slider-track {
  position: relative;
  width: 100%;
  height: min(500px, 60vh);
  max-height: 500px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  z-index: 1;
}

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  place-items: center;
  opacity: 1;
  visibility: visible;
}

.slide img {
  width: 100%;
  height: 100%;
}

.slide:not(.is-active) {
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.slider-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(245, 255, 245, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #111;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  z-index: 2;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.slider-control[data-prev] {
  left: 14px;
}

.slider-control[data-next] {
  right: 14px;
}

.slider-control:hover,
.slider-control:focus-visible {
  border-color: rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.95);
  outline: none;
}

.slider-dots {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  padding: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.slider-dot.is-active {
  transform: scale(1.25);
  background: rgb(252, 252, 252);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 999;
}

[hidden].lightbox {
  display: none;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lightbox-control {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(245, 255, 245, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #111;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  z-index: 1000;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lightbox-control:hover,
.lightbox-control:focus-visible {
  border-color: rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.95);
  outline: none;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}


.category {
  /* floating dropdown blocks */
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: start;
}

.category-title {
  font-size: 16px;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  color: inherit;
  text-align: inherit;
  text-decoration: none;
}

.category-title.selected {
  text-decoration: underline;
}

.category-items {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding-left: 14px;
}

.category.active .category-items {
  display: flex;
}

.category-items a {
  text-decoration: none;
  color: inherit;
  font-size: 16px;
  opacity: 0.9;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.category-items a:hover {
  opacity: 1;
  transform: translateX(4px);
}

/* Keep menu alignment stable when dropdowns open */
body:not(.portfoliopage) {
  --menu-align: flex-end;
  --menu-text-align: right;
}

.portfoliopage {
  --menu-align: flex-start;
  --menu-text-align: left;
}

.menu {
  align-items: var(--menu-align, flex-start);
  text-align: var(--menu-text-align, left);
}

.category {
  align-items: var(--menu-align, flex-start);
  text-align: var(--menu-text-align, left);
  width: 100%;
}

.category-title {
  align-self: var(--menu-align, flex-start);
}

.category-items {
  align-items: var(--menu-align, flex-start);
  text-align: var(--menu-text-align, left);
  width: 100%;
}

/* ———————————— Mobile ———————————— */
@media (min-width: 1400px) {
  .portfoliopage .content .content-text {
    grid-column: 1 / 4;
  }
}

@media (max-width: 1024px) {
  body {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px 16px;
    gap: 24px;
  }

  body:not(.portfoliopage) .logo {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 5;
  }

  .portfoliopage {
    grid-template-rows: auto;
    height: auto;
    overflow: visible;
  }

  .panel {
    grid-template-columns: 1fr;
    gap: 16px;
    align-self: start;
  }

  .portfoliopage .panel {
    grid-column: 1 / -1;
    grid-row: auto;
  }


  .menu {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    align-items: flex-end;
  }

  .category {
    grid-column: auto !important;
    align-items: flex-end;
  }

  .category-items {
    padding-left: 0;
    align-items: flex-end;
  }

  .portfoliopage .menu {
    align-items: flex-start;
    text-align: left;
  }

  .portfoliopage .category,
  .portfoliopage .category-items {
    align-items: flex-start;
    text-align: left;
  }

  .title-block,
  .portfoliopage .title-block {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
    max-width: 100%;
  }

  .title-block h1 {
    font-size: clamp(1.6rem, 8vw, 2.4rem);
  }

  .portfoliopage .content {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    gap: 18px;
    max-height: none;
    overflow: visible;
  }

  /* Reset all direct content children to full-width stack on mobile */
  .portfoliopage .content > * {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  /* Higher-specificity overrides to beat desktop placement rules */
  .portfoliopage .content > img,
  .portfoliopage .content > figure {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .portfoliopage .content img.portrait-header {
    grid-column: 1 / -1;
    justify-self: stretch;
    max-height: none;
  }

  .artwork-preview {
    display: none;
  }

  .artwork-grid {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .artwork-card {
    aspect-ratio: 1 / 1;
  }

  .portfoliopage .content-text {
    gap: 12px;
  }

  .slider {
    margin-top: 0;
  }

  .slider-track {
    aspect-ratio: 4 / 3;
    height: auto;
    max-height: 70vh;
  }

  .slider-control {
    width: 44px;
    height: 44px;
  }

  .slider-control[data-prev] {
    left: 10px;
  }

  .slider-control[data-next] {
    right: 10px;
  }

  .slider-dots {
    margin-left: 0;
    justify-content: center;
  }

  .slider-dot {
    box-sizing: content-box;
    padding: 8px;
    background-clip: content-box;
    -webkit-background-clip: content-box;
  }

  .artwork-card-meta {
    opacity: 1;
    transform: none;
  }

}

@media (max-width: 720px) {
  .title-block,
  .portfoliopage .title-block {
    max-width: 100%;
  }

  .title-block h1 {
    font-size: clamp(1.4rem, 9vw, 2rem);
  }
}

/* ———————————— Image placeholder ———————————— */
.img-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.25);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.img-placeholder.square {
  aspect-ratio: 1 / 1;
}

.img-placeholder.portrait {
  aspect-ratio: 3 / 4;
}

/* ———————————— CV collapsible ———————————— */
.cv-collapsible {
  list-style: none;
  margin-top: 24pt;
}

.cv-collapsible summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-collapsible summary::-webkit-details-marker {
  display: none;
}

.cv-collapsible summary::after {
  content: "+";
  font-size: 14px;
  opacity: 0.45;
  transition: opacity 0.2s ease;
  margin-left: 4px;
  line-height: 1;
}

.cv-collapsible[open] summary::after {
  content: "−";
}

.cv-collapsible summary h4 {
  margin: 0;
}

.cv-collapsible summary:hover::after {
  opacity: 0.8;
}

/* ———————————— About contacts ———————————— */
.bio {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bio p {
  margin-bottom: 0;
}


.about-contacts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.about-contacts a {
  color: inherit;
  text-decoration: none;
  font-size: clamp(14px, 1vw + 12px, 16px);
  opacity: 0.85;
}

.about-contacts a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ———————————— About page ———————————— */
.about-page .content {
  align-content: start;
}

.about-page .about-portrait {
  grid-column: 4 / -1;
  grid-row: 1 / 2;
  width: 100%;
  max-height: 68vh;
  height: auto;
  display: block;
  object-fit: cover;
  object-position: top;
}

.about-page .content-text {
  grid-column: 1 / 3;
}

.about-page .about-cv {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 24px;
  margin-top: 8px;
}

.about-page .cv-section {
  grid-column: 1 / -1;
}

.about-page .cv-entry {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 4px 16px;
  margin-bottom: 6px;
}

.about-page .cv-entry-year {
  opacity: 0.5;
  font-size: 13px;
  padding-top: 2px;
}

.about-page .cv-entry p {
  margin: 0;
  font-size: clamp(13px, 1vw + 11px, 15px);
  text-align: left;
}

@media (max-width: 1024px) {
  .about-page .about-portrait {
    grid-column: 1 / -1;
  }
  .about-page .content-text {
    grid-column: 1 / -1;
  }
  .about-page .about-cv {
    grid-template-columns: 1fr;
  }
  .about-page .cv-entry {
    grid-template-columns: 4.5rem 1fr;
  }
}

/* ———————————— Landing intro ———————————— */
.landing-intro {
  grid-column: 3 / -1;
  grid-row: -2 / -1;
  align-self: end;
  justify-self: end;
  text-align: right;
  margin: 0;
  max-width: 28ch;
  font-size: clamp(14px, 1vw + 12px, 16px);
  opacity: 0.85;
}

/* ———————————— CONTENT ———————————— */
.content {
  max-width: 100%;
}

.content img {
  max-width: 100%;
  height: auto;
}
