/* ==========================================================================
   Erdenebayar — portfolio styles
   Palette is deliberately greyscale so the photographs carry all the colour.
   The one accent is darkroom safelight red, used only for the active frame.
   ========================================================================== */

:root {
  --paper:    #E6E6E2;
  --paper-2:  #DBDBD5;
  --ink:      #131416;
  --muted:    #62636A;
  --rule:     #C7C7C0;
  --safelight:#A32B1E;

  --edge: clamp(1.25rem, 5vw, 4.5rem);
  --gap:  clamp(1.5rem, 3vw, 2.75rem);

  --sans: "Archivo", system-ui, sans-serif;
  --display: "Syne", "Archivo", sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:    #131416;
    --paper-2:  #1C1E21;
    --ink:      #E9E9E4;
    --muted:    #93949A;
    --rule:     #2E3135;
    --safelight:#D9503F;
  }
}

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

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

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

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

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--safelight);
  outline-offset: 4px;
}

.shell {
  max-width: 96rem;
  margin: 0 auto;
  padding: 0 var(--edge);
}

/* --- shared small type ---------------------------------------------------- */

.mono {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.rule-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

/* --- masthead (home) ------------------------------------------------------ */

.masthead {
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(2rem, 5vw, 3.5rem);
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.75rem);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}

.masthead-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-top: clamp(1.25rem, 3vw, 2rem);
}

.intro {
  margin: 0;
  max-width: 34ch;
  font-size: 1.05rem;
}

.contact-block {
  display: grid;
  gap: 0.9rem;
  justify-items: end;
}

.contact {
  display: grid;
  gap: 0.3rem;
  text-align: right;
}

.contact a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.contact a:hover { border-color: var(--safelight); color: var(--safelight); }

.ig-btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.6rem 1.05rem;
  transition: background 200ms ease, border-color 200ms ease;
}

.ig-btn:hover,
.ig-btn:focus-visible {
  background: var(--safelight);
  border-color: var(--safelight);
  color: #fff;
}

/* --- зураг хуулбарлахаас сэргийлэх ---------------------------------------- */

.protect { position: relative; }

.protect img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

/* зургийн дээгүүр ил тод давхарга — удаан дарж хадгалахыг хаана */
.protect::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* --- album grid (home) ---------------------------------------------------- */

.grid {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: calc(var(--gap) * 1.5) var(--gap);
}

.card-link {
  display: block;
  text-decoration: none;
}

.frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-2);
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

.card-link:hover .frame img,
.card-link:focus-visible .frame img { transform: scale(1.03); }

.card-meta {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--rule);
}

.card-no {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  transition: color 200ms ease;
}

.card-link:hover .card-no,
.card-link:focus-visible .card-no { color: var(--safelight); }

.card-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.card-sub {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- album page ----------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem var(--edge);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.topbar a { text-decoration: none; }
.topbar a:hover { color: var(--safelight); }

.album-head { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(1.5rem, 4vw, 3rem); }

.album-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.25rem, 7vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
}

.head-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem;
  gap: var(--gap);
  align-items: start;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.lede {
  margin: 0;
  max-width: 58ch;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.6;
}

.specs { margin: 0; display: grid; gap: 0.4rem; }

.spec-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

.spec-item span:last-child { color: var(--ink); }

/* plates: number rail | photo | caption */

.plates { padding: clamp(2rem, 5vw, 4rem) 0 0; }

.plate {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) 17rem;
  gap: var(--gap);
  align-items: start;
  margin-bottom: clamp(3rem, 8vw, 7rem);
}

.plate-no {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding-top: 0.15rem;
  transition: color 300ms ease;
}

.plate.is-current .plate-no { color: var(--safelight); }

.plate figcaption {
  margin: 0;
  padding-top: 0.15rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

.plate figcaption:not(:empty)::before {
  content: "";
  display: block;
  width: 1.5rem;
  border-top: 1px solid var(--rule);
  margin-bottom: 0.75rem;
}

/* --- missing image placeholder (shown until you add your own photos) ------- */

.missing {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 12rem;
  padding: 1rem;
  background: var(--paper-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-align: center;
  word-break: break-all;
}

.plate .missing { aspect-ratio: 3 / 2; }

/* --- empty / not-found state ---------------------------------------------- */

.notice {
  padding: clamp(4rem, 12vw, 9rem) 0;
  max-width: 40ch;
}

.notice h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin: 0 0 0.75rem;
}

/* --- footer --------------------------------------------------------------- */

.site-foot {
  margin-top: clamp(4rem, 10vw, 8rem);
  padding: 1.25rem 0 3rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 60rem) {
  .head-row { grid-template-columns: 1fr; }

  .plate {
    grid-template-columns: 3rem minmax(0, 1fr);
    gap: 1rem;
  }
  .plate figcaption {
    grid-column: 2;
    max-width: 46ch;
  }
}

@media (max-width: 34rem) {
  .contact { text-align: left; }
  .contact-block { justify-items: start; }
  .plate { grid-template-columns: 1fr; }
  .plate-no { grid-column: 1; }
  .plate figcaption { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
