/* Monte Videos: white editorial gallery style, split-pane SPA */

:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --grey: #8a8a8a;
  --light: #b5b5b5;
  --hair: #d9d9d9;
  --serif: "Palatino", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif;
  --bar-h: 3.1rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  border-bottom: 1px solid var(--hair);
  padding: 0.85rem 1.25rem;
  font-size: 0.875rem;
  color: var(--grey);
  height: var(--bar-h);
  background: var(--bg);
}

.topbar .brand { color: var(--ink); white-space: nowrap; }
.topbar a:hover, .topbar button:hover { color: var(--ink); }

/* ---------- Split layout ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: calc(100vh - var(--bar-h));
  height: calc(100dvh - var(--bar-h));
}

.pane {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pane-index {
  border-right: 1px solid var(--hair);
  padding: 2rem 2.5rem 5rem;
}

.pane-detail { padding: 2.5rem 2.5rem 4rem; }

/* ---------- Filters ---------- */

.filters {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--grey);
  margin-bottom: 3rem;
}

.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}

/* ---------- Work index ---------- */

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 4rem 2.5rem;
}

.work {
  display: block;
  max-width: 12rem;
  margin: 0 auto;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--grey);
}

.work[hidden] { display: none; }

.work .thumb {
  width: 100%;
  max-width: 11rem;
  height: auto !important;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  margin: 0 auto 0.9rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.work .thumb-blank {
  width: 100%;
  max-width: 11rem;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0 auto 0.9rem;
  border: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--light);
  font-size: 0.75rem;
  background: var(--tint, #f7f5f1);
}

.work .thumb-blank .ph-emoji,
.placeholder-media .ph-emoji {
  font-style: normal;
  font-size: 2.2rem;
  line-height: 1;
}

.work .title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink);
  display: block;
}

a.work:hover .title { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Default (wordmark) view ---------- */

.home-view {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1.05;
  text-align: center;
  margin-top: clamp(2rem, 10vh, 6rem);
}

.about {
  text-align: center;
  margin: clamp(2rem, 8vh, 5rem) auto 0;
  max-width: 34rem;
  color: var(--grey);
}

.about .about-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 0.9rem;
}

.home-view .address {
  margin-top: auto;
  padding-top: 3rem;
  border-top: 1px solid var(--hair);
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 2rem;
  color: var(--grey);
  font-size: 0.875rem;
  line-height: 1.7;
  text-align: right;
}

.home-view .address .copyright { margin-right: auto; }
.home-view .address a:hover { color: var(--ink); }

/* ---------- Detail view ---------- */

.detail { max-width: 46rem; margin: 0 auto; }

.media-block { margin-bottom: 1.5rem; }

.facade {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.facade img {
  width: 100%;
  height: 100% !important;
  aspect-ratio: auto;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}

.facade:hover img { opacity: 0.85; }

.facade .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.facade .play span {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--ink);
  padding-left: 0.25rem;
}

.media-block iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}

.media-caption {
  color: var(--grey);
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin: 2rem 0 1.5rem;
}

.detail-head .dh-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1.3;
}

.detail-head .dh-client { color: var(--grey); font-size: 0.875rem; margin-top: 0.2rem; }

.detail-head .dh-meta {
  text-align: right;
  color: var(--grey);
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: nowrap;
}

.detail .summary {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.detail .desc { color: var(--grey); margin-bottom: 1.5rem; max-width: 36rem; }

.detail .links { font-size: 0.9375rem; line-height: 2; }

.textlink {
  border-bottom: 1px solid var(--light);
  transition: border-color 0.15s;
}

.textlink:hover { border-bottom-color: var(--ink); }

.awards { color: var(--grey); font-size: 0.875rem; margin-bottom: 1.5rem; }

.placeholder-media {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--light);
  background: var(--tint, #f7f5f1);
}

/* ---------- Information view ---------- */

.info-view { max-width: 50rem; margin: 0 auto; }

.info-cols {
  column-count: 2;
  column-gap: 3rem;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.6;
}

.info-cols p { margin-bottom: 1.2rem; break-inside: avoid; }
.info-cols .info-label { font-style: italic; }
.info-cols a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 404 ---------- */

.nf {
  min-height: calc(100vh - 8rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
}

.nf h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin-bottom: 1rem;
}

.nf p { color: var(--grey); }

.pagefoot {
  border-top: 1px solid var(--hair);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: var(--grey);
  font-size: 0.875rem;
}

.pagefoot a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .split { display: block; height: auto; }
  .pane { overflow: visible; }
  .pane-index { border-right: 0; border-bottom: 1px solid var(--hair); padding: 1.5rem 1.25rem 4rem; }
  .pane-detail { padding: 2rem 1.25rem 3rem; }
  .filters { margin-bottom: 2.5rem; }
  .index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3.5rem 2rem;
  }
  .work, .work .thumb, .work .thumb-blank { max-width: 13rem; }
  .info-cols { column-count: 1; }
  .detail-head { flex-direction: column; gap: 0.5rem; }
  .detail-head .dh-meta { text-align: left; white-space: normal; }
  .home-view .address {
    margin-top: 3rem;
    justify-content: flex-start;
    text-align: left;
    padding-bottom: 1rem;
  }
  .home-view .address .copyright { margin-right: 0; order: 2; }
}

@media (max-width: 500px) {
  .index-grid {
    grid-template-columns: 1fr;
    gap: 4.5rem;
  }
  .work { max-width: 20rem; }
  .work .thumb, .work .thumb-blank { max-width: 16rem; }
  .work .thumb-blank .ph-emoji { font-size: 2.5rem; }
  .pane-detail, .pane-index { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* ---------- Progressive enhancement: detail source sections ---------- */

/* With JS: hidden source of truth for the router */
html:not(.no-js) .details-src { display: none; }
/* Without JS: filters are inert, hide them */
.no-js .filters { display: none; }
/* Without JS: page scrolls as one column; panes must not trap scroll */
.no-js .split { display: block; height: auto; }
.no-js .pane { overflow: visible; }
.no-js .pane-index { border-right: 0; border-bottom: 1px solid var(--hair); }

/* Fallback flow: stacked readable sections below the index */
.details-src .detail-src {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.25rem;
  border-top: 1px solid var(--hair);
}

/* Facade rendered as an anchor keeps its overlay */
a.facade { color: inherit; }
