/* Full-screen photography portfolio with warm minimal side panel */

:root {
  --panel: #f5f1eb;
  --text: #181715;
  --muted: #77716a;
  --line: rgba(24, 23, 21, 0.16);
  --viewer-text: #ffffff;
  --panel-width: clamp(320px, 29vw, 460px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #111;
  color: var(--text);
  font-family: "DM Sans", sans-serif;
}

img {
  display: block;
  width: 100%;
}

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

button { font: inherit; }

.portfolio-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-width);
}

/* VIEWER */

.viewer {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: #171717;
}

.viewer > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 220ms ease;
  object-position: 50% 40%;
}

.viewer.is-changing > img { opacity: 0.25; }

.viewer::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 35%;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.5), transparent);
}

.viewer-caption {
  position: absolute;
  z-index: 2;
  left: clamp(1.5rem, 4vw, 4rem);
  right: clamp(1.5rem, 4vw, 4rem);
  bottom: clamp(1.5rem, 4vw, 3.5rem);
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  color: var(--viewer-text);
}

.viewer-caption p,
.viewer-caption span {
  margin: 0;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.viewer-caption h1 {
  margin: .25rem 0 0;
  font-family: "Instrument Serif", serif;
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 400;
  line-height: .95;
  letter-spacing: -.035em;
}

.viewer-controls {
  position: absolute;
  z-index: 3;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: .5rem;
}

.viewer-controls button {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  color: white;
  cursor: pointer;
  backdrop-filter: blur(5px);
}

.viewer-controls button:hover { background: rgba(0,0,0,.42); }

/* PANEL */

.side-panel {
  min-width: 0;
  background: var(--panel);
}

.panel-header {
  padding: 2.5rem 2rem 2.25rem;
}

.brand {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.brand span {
  display: block;
  margin-top: .4rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.panel-header > p {
  margin: 2rem 0 0;
  color: #504c47;
  font-size: .92rem;
  line-height: 1.7;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  margin-top: 1.5rem;
  padding-bottom: .25rem;
  border-bottom: 1px solid currentColor;
  font-size: .85rem;
}

/* THUMBNAILS */

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.thumbnail {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #ddd;
  cursor: pointer;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.thumbnail:hover img { transform: scale(1.025); }

.thumbnail.active::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 4px solid var(--panel);
  box-shadow: inset 0 0 0 1px rgba(24,23,21,.55);
}

.thumbnail:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: -5px;
}

/* ABOUT */

.panel-about {
  padding: 4rem 2rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.panel-about h2 {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  font-weight: 400;
  line-height: .95;
  letter-spacing: -.035em;
}

.panel-about > p:not(.eyebrow) {
  margin: 1.5rem 0 0;
  color: #504c47;
  font-size: .9rem;
  line-height: 1.7;
}

/* FOOTER */

.panel-footer {
  padding: 1.6rem 2rem 2.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .72rem;
}

.panel-footer div {
  display: flex;
  gap: 1.25rem;
}

.panel-footer p { margin: 1rem 0 0; }


@media (min-width: 901px) {
  .viewer > img {
    object-position: var(--desktop-position, center 45%);
  }
}
/* RESPONSIVE */

@media (max-width: 900px) {
  .portfolio-shell { display: block; }

  .viewer {
    position: relative;
    height: min(78vh, 760px);
  }

  .side-panel { width: 100%; }

  .panel-header,
  .panel-about,
  .panel-footer {
    padding-left: clamp(1.25rem, 5vw, 3rem);
    padding-right: clamp(1.25rem, 5vw, 3rem);
  }

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

@media (max-width: 600px) {
  .viewer {
    height: 68vh;
    min-height: 480px;
  }

  .viewer-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: .7rem;
  }

  .viewer-caption h1 {
    font-size: clamp(2.8rem, 14vw, 4.5rem);
  }

  .viewer-controls {
    top: 1rem;
    right: 1rem;
  }

  .viewer-controls button {
    width: 44px;
    height: 44px;
  }

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

@media (prefers-reduced-motion: reduce) {
  .viewer > img,
  .thumbnail img {
    transition: none;
  }
}
