/* Mono Munkhjargal — site styles */

:root {
  --plaster: #eef1ec;
  --sage: #c7eac1;
  --pine: #2f4a3a;
  --ink: #1d2420;
  --stone: #555d58;
  --rule: #cdd4cc;
  --night: #161b18;

  --sans: "Figtree", "Avenir Next", "Segoe UI", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.625rem;
  --step-3: 2.0625rem;
  --step-4: 2.5625rem;

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 76rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--plaster);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--pine);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 500;
  line-height: 1.2;
}

p {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  background: var(--pine);
  color: #fff;
}

.skip-link:focus {
  top: 1rem;
}

/* The script wordmark from Mono's business card, colored by CSS. */
.wordmark {
  display: block;
  aspect-ratio: 60.12 / 21.89;
  background: currentColor;
  -webkit-mask: url("/assets/mono-wordmark.svg") center / contain no-repeat;
  mask: url("/assets/mono-wordmark.svg") center / contain no-repeat;
}

/* ---------- Header and footer (inner pages) ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--gutter);
}

.site-header .home-link {
  color: var(--pine);
}

.site-header .wordmark {
  width: 6.5rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--pine);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

main {
  display: block;
}

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) clamp(3rem, 8vw, 6rem);
}

.page-title {
  font-family: var(--serif);
  font-size: var(--step-4);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--stone);
  font-size: var(--step--1);
}

/* ---------- Home ---------- */

.home {
  display: grid;
  grid-template-columns: minmax(17rem, 30%) 1fr;
  min-height: 100vh;
  min-height: 100svh;
}

.home-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  padding: clamp(2rem, 4vw, 3.5rem);
  background: var(--sage);
  color: var(--pine);
}

.home-panel .wordmark {
  width: min(15rem, 100%);
}

.home-name {
  display: block;
  margin-top: 1.5rem;
  font-size: var(--step-0);
  font-weight: 500;
  line-height: 1.4;
}

.home-role {
  font-weight: 600;
}

.home-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-nav li + li {
  margin-top: 0.35rem;
}

.home-nav a {
  font-family: var(--serif);
  font-size: var(--step-3);
  line-height: 1.25;
  color: var(--pine);
  text-decoration: none;
}

.home-nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.home-contact {
  font-size: var(--step--1);
}

.home-work {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: clamp(1.5rem, 5vw, 4rem);
}

.home-work figure {
  margin: 0;
}

.home-work img {
  width: auto;
  max-height: calc(100vh - 12rem);
  max-height: calc(100svh - 12rem);
}

.home-work figcaption {
  margin-top: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .home-work img {
    animation: arrive 1.4s ease-out both;
  }

  @keyframes arrive {
    from {
      opacity: 0;
    }
  }
}

/* ---------- Captions (shared) ---------- */

.caption {
  color: var(--stone);
  font-size: var(--step--1);
  line-height: 1.5;
}

.caption .title {
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-1);
  font-style: italic;
}

.caption .note {
  display: block;
  margin-top: 0.35rem;
  color: var(--pine);
  font-weight: 500;
}

/* ---------- Portfolio ---------- */

.series + .series {
  margin-top: clamp(4rem, 10vw, 7rem);
}

.series-head {
  max-width: 38rem;
  margin: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(1.5rem, 4vw, 2.25rem);
}

.series-head h2 {
  font-family: var(--serif);
  font-size: var(--step-3);
  font-style: italic;
  font-weight: 400;
}

.series-head p {
  margin-top: 0.75rem;
  color: var(--stone);
}

.works {
  margin: 0;
  padding: 0;
  list-style: none;
}

.zoom {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

/* Faded Memory: one painting per wall, caption beside it. */
.works--walls > li {
  display: flex;
  align-items: flex-end;
  gap: 2rem;
}

.works--walls > li + li {
  margin-top: clamp(3rem, 8vw, 5.5rem);
}

.works--walls .zoom {
  flex: 0 1 auto;
  min-width: 0;
}

.works--walls .caption {
  flex: 0 0 14rem;
}

.works--walls img {
  width: auto;
  max-height: min(78vh, 56rem);
}

/* Small Moments: 6 × 6 in paintings, kept small on purpose. */
.works--small {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 17rem));
  gap: 2.5rem 2rem;
}

.works--small .caption {
  margin-top: 0.75rem;
}

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--night);
  color: #e8ece7;
}

.lightbox::backdrop {
  background: var(--night);
}

.lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.lightbox-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem var(--gutter);
  font-size: var(--step--1);
}

.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 var(--gutter);
}

.lightbox-stage img {
  width: auto;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter) 1.25rem;
}

.lightbox .caption {
  color: #b9c2bb;
}

.lightbox .caption .title {
  color: #fff;
}

.lightbox .caption .note {
  color: var(--sage);
}

.lightbox button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid #4a554e;
  border-radius: 2px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: var(--step--1);
  cursor: pointer;
}

.lightbox button:hover {
  border-color: var(--sage);
}

.lightbox :focus-visible {
  outline-color: var(--sage);
}

.lightbox-steps {
  display: flex;
  gap: 0.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] {
    animation: arrive 0.25s ease-out;
  }
}

/* ---------- Statement and about ---------- */

.text-and-image {
  display: grid;
  grid-template-columns: minmax(0, 36rem) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.text-and-image aside {
  position: sticky;
  top: 2rem;
}

.text-and-image aside img {
  width: auto;
  max-height: 80vh;
}

.text-and-image aside .caption {
  margin-top: 0.75rem;
}

.prose {
  margin-top: 2rem;
  font-family: var(--serif);
  font-size: var(--step-1);
  line-height: 1.6;
}

.prose p + p {
  margin-top: 1.1em;
}

.resume {
  margin-top: clamp(3rem, 8vw, 5rem);
  max-width: 44rem;
}

.resume h2 {
  font-family: var(--serif);
  font-size: var(--step-3);
  font-weight: 400;
}

.resume h3 {
  margin-top: 2.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  font-size: var(--step-0);
  font-weight: 600;
}

.resume dl {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.75rem 1.5rem;
  margin: 1rem 0 0;
}

.resume dt {
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}

.resume dd {
  margin: 0;
}

.resume dd span {
  display: block;
  color: var(--stone);
}

/* ---------- Contact ---------- */

.contact-lede {
  margin-top: 2rem;
  max-width: 30rem;
}

.contact-email {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 5vw, var(--step-4));
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.copy-email {
  display: block;
  margin-top: 1.25rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--pine);
  border-radius: 2px;
  background: transparent;
  color: var(--pine);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.copy-email:hover {
  background: var(--sage);
}

.contact-where {
  margin-top: 2.5rem;
  color: var(--stone);
}

/* ---------- Small screens ---------- */

@media (max-width: 52rem) {
  .home {
    grid-template-columns: 1fr;
  }

  .home-panel {
    gap: 2rem;
  }

  .home-panel .wordmark {
    width: 10rem;
  }

  .home-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
  }

  .home-nav li + li {
    margin-top: 0;
  }

  .home-nav a {
    font-size: var(--step-2);
  }

  .home-work img {
    max-height: none;
  }

  .works--walls > li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.875rem;
  }

  .works--walls .caption {
    flex: none;
  }

  .works--walls img {
    max-height: none;
  }

  .works--small {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1.25rem;
  }

  .text-and-image {
    grid-template-columns: 1fr;
  }

  .text-and-image aside {
    position: static;
  }

  .text-and-image aside img {
    max-height: none;
  }

  .resume dl {
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 0.75rem 1rem;
  }
}
