* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2em;
  font-size: 15px;
  line-height: 1.4;
  font-family: -apple-system, BlinkMacSystemFont, "helvetica neue", helvetica, arial, sans-serif;
  text-transform: lowercase;
  background: #fff5f5;
  color: #3f3e3e;
}

a {
  color: #3f3e3e;
  text-decoration: none;
}

a:hover {
  opacity: 0.5;
}

.project a:hover {
  opacity: 1;
}

.project-gallery > div::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--overlay-color, #c8d9b8);
  pointer-events: none;
  transition: opacity 1.5s ease;
  will-change: opacity;
}

@keyframes overlay-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.project.loading .project-gallery > div::after {
  animation: overlay-pulse 0.85s ease-in-out infinite;
}

.project.loading .project-gallery img {
  display: none;
}

/* Exact-ratio placeholder sized to the painting before image loads */
body.index .project.loading .project-gallery > div.active {
  height: calc(100vh - 14em);
  height: calc(100dvh - 14em);
  height: min(calc(100dvh - 14em), calc((100vw - 4em) * var(--img-inv, 100)));
  aspect-ratio: var(--img-ratio, 1);
}

.project.revealed .project-gallery > div::after {
  opacity: 0;
}

img {
  max-width: 100%;
  opacity: 0.9;
  display: block;
}

.gray {
  opacity: 0.5;
}

hr {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin: 2em 0;
}

/* ── page grid ── */

.page {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: start;
  background: transparent;
}

/* ── sidebar ── */

.sidebar {
  position: sticky;
  top: 2em;
  z-index: 10;
  background: transparent;
}

.site-name {
  font-size: 1em;
  font-weight: normal;
  border: 0;
  display: block;
}

.sidebar-nav {
  font-size: 2.25em;
  font-weight: 300;
  line-height: 1.15;
  margin: 0.5em 0 1.5em;
}

.sidebar-nav a {
  display: block;
  border: 0;
  color: inherit;
}

.sidebar-text {
  opacity: 0.6;
  line-height: 1.55;
  margin: 0;
}

/* ── home: stepped scroll ── */

body.index {
  overflow: clip;
}

body.index .project {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5em;
  margin-bottom: 0;
}

/* ── home: single column ── */

.projects {
  columns: 1;
  min-width: 0;
}

body.index .project-gallery {
  height: calc(100vh - 14em);
  height: calc(100dvh - 14em);
}

.project {
  break-inside: avoid;
  margin-bottom: 28px;
}




.project-gallery {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75em;
  overflow: visible;
}

.project-gallery > div {
  position: relative;
  display: block;
  flex-shrink: 0;
}

.project-gallery > div img,
.project-gallery > img {
  display: block;
  width: auto;
  height: 110px;
  max-width: none;
  max-height: none;
  opacity: 0.65;
  flex-shrink: 0;
  object-fit: cover;
  cursor: pointer;
  pointer-events: none;
}

.project-gallery > img {
  opacity: 0;
}



/* ── work detail page ── */

.back-link {
  display: block;
  margin: 0.75em 0 1.75em;
  border: 0;
  opacity: 0.45;
}

.back-link:hover {
  opacity: 1;
}

.work-title {
  font-size: 1em;
  font-weight: normal;
  margin: 0 0 0.35em;
}

.work-meta {
  opacity: 0.5;
  line-height: 1.6;
  margin: 0 0 1.5em;
}

.work-desc {
  line-height: 1.75;
  opacity: 0.75;
}

.work-images img {
  width: 100%;
  height: auto;
  margin-bottom: 1.5em;
}

/* ── about page ── */

.about-body p {
  margin: 0 0 1em;
  line-height: 1.75;
  opacity: 0.8;
  max-width: 52ch;
}

.cv-section {
  margin-top: 2em;
}

.cv-section h2 {
  font-size: 1em;
  font-weight: normal;
  opacity: 0.4;
  margin: 0 0 0.6em;
  letter-spacing: 0.03em;
}

.cv-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2em;
}

.cv-list li {
  margin-bottom: 0.4em;
  line-height: 1.5;
  opacity: 0.75;
}

.cv-list .year {
  opacity: 0.5;
  margin-right: 0.75em;
  display: inline-block;
  min-width: 2.5em;
}

/* ── psp nav ── */

.psp-nav {
  position: fixed;
  right: 1.75em;
  top: 4em;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55em;
  z-index: 200;
}

.psp-item {
  text-align: right;
  white-space: nowrap;
  font-size: 0.72em;
  opacity: 0.25;
  cursor: pointer;
  padding: 0.25em 0.6em;
  border-radius: 10px;
}


.psp-item.active {
  font-size: 1em;
  opacity: 1;
}

.psp-indicator {
  position: absolute;
  right: 0;
  border-radius: 12px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0);
  box-shadow:
    inset 0 2px 4px 0 #fff,
    inset 0 -4px 16px 0 #fff,
    inset 0 4px 10px 0 hsla(240, 3%, 45%, 0.07),
    0 4px 14px -10px rgba(53, 53, 79, 0.4),
    0 11px 28px -10px rgba(53, 53, 79, 0.1);
  pointer-events: none;
}



/* ── footer ── */

footer {
  margin-top: 4em;
  font-size: 0.85em;
  opacity: 0.5;
}

/* ── responsive ── */

@media (max-width: 680px) {
  .page {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .sidebar-nav {
    font-size: 1.75em;
  }
  .psp-nav {
    display: none;
  }
}

/* Clip the wide filmstrip to the viewport (at every width) so iOS doesn't widen/shrink the page */
body.index .page {
  margin-left: -2em;
  margin-right: -2em;
  padding-left: 2em;
  padding-right: 2em;
  overflow-x: clip;
}

/* Home: contact is its own full-screen slide, centred like the paintings */
body.index footer {
  height: 100vh;
  height: 100dvh;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
