/* ==========================================================
   GMART — webzine styles
   Palette sampled from the original site.
   ========================================================== */
:root {
  --paper: #e9e7df;
  --paper-2: #dfdcd3;
  --ink: #0a0a09;
  --ink-soft: #3b3a36;
  --muted: #6d6b64;
  --white: #f4f2ec;
  --rule: 2px solid var(--ink);

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Courier Prime", "Courier New", Courier, monospace;

  --gutter: clamp(16px, 3.2vw, 62px);
  --header-h: clamp(56px, 5vw, 72px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
body { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
body > * { min-width: 0; }
a { color: inherit; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 12px; }

/* ---------- type helpers ---------- */
.label {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.mono {
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}
.display {
  font-family: var(--sans);
  font-weight: 900;
  font-stretch: 74%;
  font-variation-settings: "wdth" 74;
  text-transform: uppercase;
  line-height: 0.86;
  letter-spacing: -0.012em;
  margin: 0;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  background: var(--paper);
  border-bottom: var(--rule);
}
.logo {
  font-family: var(--sans);
  font-weight: 900;
  font-stretch: 62%;
  font-variation-settings: "wdth" 62;
  font-size: calc(var(--header-h) * 1.05);
  line-height: 1;
  letter-spacing: -0.04em;
  text-decoration: none;
  margin-top: 0.06em;
}
.nav { display: flex; gap: clamp(18px, 3vw, 58px); }
.nav a {
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--ink); }

.menu-btn { display: none; }

@media (max-width: 760px) {
  .menu-btn {
    display: block;
    font: 700 0.8rem/1 var(--sans);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: none; border: var(--rule); color: var(--ink);
    padding: 9px 12px; cursor: pointer;
  }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper);
    border-bottom: var(--rule);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a, .nav a:hover, .nav a[aria-current="page"] { padding: 16px var(--gutter); border-bottom: 1px solid rgba(10,10,9,.15); }
  .nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
}

/* ---------- cover ---------- */
.cover {
  display: grid;
  grid-template-columns: minmax(0, 39.1fr) minmax(0, 60.9fr);
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
}
.cover-text {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 6vw, 110px) var(--gutter);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.4px);
  background-size: 14px 14px;
}
.cover-text .kicker { margin: 0 0 clamp(18px, 2.2vw, 36px); }
.cover-title { font-size: clamp(3.6rem, 9.4vw, 12.5rem); white-space: nowrap; }
@media (max-width: 900px) { .cover-title { font-size: clamp(3.6rem, 21vw, 9rem); } }
.cover-title span { display: block; }
.cover-text .themes { margin: clamp(28px, 3vw, 46px) 0 0; }
.read-link {
  display: inline-flex;
  align-items: center;
  gap: 2.2em;
  margin-top: clamp(44px, 5vw, 92px);
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 1.02rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--ink);
}
.read-link:hover .arrow { transform: translateY(3px); }
.arrow { transition: transform .2s ease; }

.cover-photo {
  position: relative;
  background: var(--ink);
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.cover-photo img {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: cover;
}
.plate-no {
  position: absolute;
  right: 16px; bottom: 16px;
  color: var(--white);
  font-family: var(--mono);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
}

@media (max-width: 900px) {
  .cover { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .cover-photo { display: block; padding: var(--gutter) var(--gutter) calc(var(--gutter) + 1.8em); }
  .cover-photo img { height: auto; width: 100%; max-width: 100%; }
  .cover-photo .zoom { display: block; width: 100%; }
  .cover-photo .plate-no { right: var(--gutter); bottom: 0.9em; }
}

/* ---------- editor's note ---------- */
.note {
  display: grid;
  grid-template-columns: minmax(0, 39.1fr) minmax(0, 60.9fr);
  border-top: var(--rule);
  border-bottom: var(--rule);
}
.note-side {
  padding: clamp(36px, 5vw, 90px) var(--gutter);
  border-right: var(--rule);
}
.note-side .display { font-size: clamp(2.6rem, 4.6vw, 5rem); margin-top: 18px; }
.note-body {
  padding: clamp(36px, 5vw, 90px) var(--gutter);
  max-width: 62ch;
}
.note-body p { font-size: clamp(1.1rem, 1.45vw, 1.42rem); line-height: 1.5; margin: 0 0 1.1em; }
.note-body .sign { margin-top: 2em; }
@media (max-width: 900px) {
  .note { grid-template-columns: 1fr; }
  .note-side { border-right: 0; border-bottom: var(--rule); }
}

/* ---------- chapters ---------- */
.chapter {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(60px, 9vw, 160px) var(--gutter) clamp(28px, 3vw, 44px);
  border-bottom: var(--rule);
}
.chapter .display { font-size: clamp(3.4rem, 9vw, 11rem); }
.chapter-break {
  margin-top: clamp(90px, 14vw, 260px);
  border-top: 10px solid var(--ink);
  padding-top: clamp(70px, 10vw, 180px);
}
.chapter .label { white-space: nowrap; padding-bottom: .6em; }
@media (max-width: 640px) { .chapter { flex-direction: column; align-items: flex-start; } }

/* ---------- plates ---------- */
.plate { margin: 0; }
.plate button.zoom {
  display: block; width: 100%;
  padding: 0; border: 0; background: none; cursor: zoom-in;
}
.plate figcaption {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

/* full-bleed black band */
.band-dark {
  background: var(--ink);
  color: var(--white);
  padding: clamp(28px, 5vw, 90px) var(--gutter);
}
.band-dark .plate img { max-height: 88vh; width: auto; margin: 0 auto; }
@media (max-width: 900px) { .band-dark .plate img { width: 100%; max-height: none; margin: 0; } }
.band-dark .plate figcaption { color: #b9b6ad; max-width: 1400px; margin-left: auto; margin-right: auto; }

/* offset single on paper */
.band-paper { padding: clamp(48px, 7vw, 130px) var(--gutter); }
.offset {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gutter);
  align-items: end;
}
.offset .plate { grid-column: 1 / span 8; }
.offset .aside { grid-column: 10 / span 3; padding-bottom: 40px; }
.offset.right .plate { grid-column: 5 / span 8; grid-row: 1; }
.offset.right .aside { grid-column: 1 / span 3; grid-row: 1; }
.offset.portrait .plate { grid-column: 1 / span 6; }
.offset.portrait.right .plate { grid-column: 6 / span 6; }
.aside .display { font-size: clamp(1.8rem, 2.6vw, 3rem); margin: 10px 0 14px; }
.aside p { margin: 0; color: var(--ink-soft); }

/* pairs */
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
  align-items: start;
}
.pair .plate:nth-child(2) { margin-top: clamp(40px, 8vw, 160px); }

@media (max-width: 760px) {
  .offset, .pair { grid-template-columns: 1fr; }
  .offset .plate, .offset.right .plate, .offset.portrait .plate, .offset.portrait.right .plate,
  .offset .aside, .offset.right .aside { grid-column: 1; grid-row: auto; }
  .offset .aside { padding-bottom: 0; }
  .pair .plate:nth-child(2) { margin-top: 0; }
}

.rule { border: 0; border-top: var(--rule); margin: 0; }

/* ---------- end of issue ---------- */
.end {
  padding: clamp(70px, 10vw, 180px) var(--gutter);
  text-align: center;
  border-top: var(--rule);
}
.end .display { font-size: clamp(3rem, 8vw, 9rem); }
.end p { margin: 22px auto 0; max-width: 46ch; }
.btn-row { display: flex; justify-content: center; gap: 26px; flex-wrap: wrap; margin-top: 40px; }
.btn-row a { font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; border-bottom: 3px solid var(--ink); padding-bottom: 8px; }

/* ---------- inner pages ---------- */
.page-head {
  padding: clamp(60px, 9vw, 150px) var(--gutter) clamp(30px, 4vw, 60px);
  border-bottom: var(--rule);
  background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.4px);
  background-size: 14px 14px;
}
.page-head .display { font-size: clamp(4rem, 12vw, 14rem); margin-top: 18px; }

/* archive */
.issues { list-style: none; margin: 0; padding: 0; }
.issue-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) minmax(0, 240px) minmax(0, 200px);
  grid-template-areas: "no title meta thumb";
  gap: var(--gutter);
  align-items: center;
  padding: 28px var(--gutter);
  border-bottom: var(--rule);
  text-decoration: none;
}
a.issue-row:hover { background: var(--paper-2); }
.issue-row .display { font-size: clamp(2.2rem, 4.4vw, 4.6rem); }
.issue-row > .label { grid-area: no; }
.issue-row > .display { grid-area: title; overflow-wrap: anywhere; }
.issue-row > .mono { grid-area: meta; }
.issue-row .thumb {
  grid-area: thumb;
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.issue-row .thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.issue-row.soon { color: var(--muted); }
.issue-row .soon-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--paper-2);
  background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.4px);
  background-size: 14px 14px;
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
@media (max-width: 1000px) {
  .issue-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
    grid-template-areas: "no thumb" "title thumb" "meta thumb";
    row-gap: 8px;
  }
}
@media (max-width: 560px) {
  .issue-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "thumb" "no" "title" "meta";
  }
}

/* index grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: var(--gutter);
  padding: clamp(36px, 5vw, 80px) var(--gutter);
}
.grid a { text-decoration: none; }
.grid a { min-width: 0; }
.grid .thumb { aspect-ratio: 1 / 1; overflow: hidden; }
.grid img { width: 100%; height: 100%; object-fit: contain; object-position: left bottom; transition: transform .5s ease; }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid a:hover img { transform: scale(1.03); }
.grid .meta { display: flex; justify-content: space-between; margin-top: 10px; font-family: var(--mono); font-size: .84rem; }

/* about */
.about {
  display: grid;
  grid-template-columns: minmax(0, 39.1fr) minmax(0, 60.9fr);
}
.about-photo { background: var(--ink); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-body { padding: clamp(40px, 6vw, 110px) var(--gutter); max-width: 70ch; }
.about-body p { font-size: clamp(1.08rem, 1.35vw, 1.3rem); }
.about-body dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px 20px; margin: 40px 0 0; border-top: var(--rule); padding-top: 24px; }
.about-body dt { font-weight: 700; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; padding-top: 3px; }
.about-body dd { margin: 0; font-family: var(--mono); }
@media (max-width: 900px) { .about { grid-template-columns: 1fr; } .about-photo img { max-height: 70vh; } }

/* ---------- footer ---------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  padding: 28px var(--gutter);
  background: var(--ink);
  color: var(--white);
}
.site-footer .logo { font-size: 3.4rem; color: var(--white); }
.site-footer .mono { color: #b9b6ad; }
.site-footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer nav a { font-family: var(--mono); font-size: .86rem; text-decoration: none; text-transform: uppercase; letter-spacing: .06em; }
.site-footer nav a:hover { text-decoration: underline; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(10,10,9,.97);
  color: var(--white);
  display: none;
  grid-template-rows: 1fr auto;
}
.lightbox.open { display: grid; }
.lightbox .stage { display: flex; align-items: center; justify-content: center; padding: 56px 64px 12px; min-height: 0; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox .bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px 22px; font-family: var(--mono); font-size: .88rem; color: #cfccc3; gap: 16px; }
.lightbox button {
  background: none; border: 0; color: var(--white); cursor: pointer;
  font-family: var(--mono); font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; padding: 10px;
}
.lightbox .close { position: absolute; top: 10px; right: 14px; }
.lightbox .prev, .lightbox .next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 1.6rem; }
.lightbox .prev { left: 10px; } .lightbox .next { right: 10px; }
@media (max-width: 640px) { .lightbox .stage { padding: 52px 8px 8px; } .lightbox .prev, .lightbox .next { top: auto; bottom: 8px; transform: none; } }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.band-dark :focus-visible, .lightbox :focus-visible { outline-color: var(--white); }

/* contact */
.contact { padding: clamp(48px, 8vw, 140px) var(--gutter); display: grid; gap: 14px; min-height: 40vh; align-content: start; }
.contact-mail {
  font-weight: 900;
  font-stretch: 74%;
  font-variation-settings: "wdth" 74;
  font-size: clamp(1.7rem, 6.2vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
  border-bottom: 4px solid var(--ink);
  justify-self: start;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.contact-mail:hover { background: var(--ink); color: var(--paper); }
