/* ==========================================================
   JAJIM — editorial redesign
   Full-bleed cover · floating monospace cards · giant type
   ========================================================== */

:root {
  --paper:  #ECEAE5;   /* light editorial gray */
  --card:   #FFFFFF;
  --ink:    #111111;
  --muted:  #9A958C;
  --line:   #D6D2C9;

  --sans:   'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:   'Space Mono', ui-monospace, monospace;
  --marker: 'Caveat', cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ===== Persistent header ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 34px;
  color: var(--ink);                /* dark on light inner pages */
}
/* Home header sits over the dark cover photo and scrolls away with it */
.site-header.home {
  position: absolute;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0,0,0,.65);
}
.corner {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
  text-transform: uppercase;
  transition: opacity .2s;
}
.corner:hover { opacity: .6; }
.brand {
  text-align: center;
  font-weight: 800;
  font-size: 22px;
  line-height: .98;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.brand span { display: block; }

/* ===== COVER : full-bleed loom image (monochrome) ===== */
.cover {
  position: relative;
  height: 100vh;
  height: 100svh;
  width: 100%;
  background: #1a1a1a url('cover-home.jpg') center / cover no-repeat;
}
.cover::after {                       /* desaturate + darken, B&W mood */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.18) 15%, rgba(10,10,10,.22) 45%, rgba(10,10,10,.6) 100%);
  backdrop-filter: grayscale(1) contrast(1.05);
  -webkit-backdrop-filter: grayscale(1) contrast(1.05);
  pointer-events: none;
}
/* ---- Hover-reveal media collage (Readymag-style) ---- */
.reveal-grid {
  position: absolute; inset: 0; z-index: 5;
  pointer-events: none; opacity: 0;
  transition: opacity .35s ease;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.30) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.30) 1px, transparent 1px);
  background-size: 6.25vw 6.25vw;
}
.cover.revealing .reveal-grid { opacity: 1; }
.cover.revealing::after {            /* deepen the dark wash while revealing */
  background: linear-gradient(180deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.5) 40%, rgba(0,0,0,.7) 100%);
}

.reveal-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.reveal-group { position: absolute; inset: 0; }

/* Borderless image blocks, anchored to the screen edges, grid-aligned */
.reveal-tile {
  position: absolute; margin: 0; overflow: hidden;
  opacity: 0;
  transition: opacity .45s ease, transform .55s cubic-bezier(.2,.8,.2,1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.reveal-tile img,
.reveal-tile video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.reveal-group.on .reveal-tile { opacity: 1; transform: none; }

.reveal-tile.tr { top: 0;   right: 0;   width: 43.75vw; height: 62vh; transform: translateY(-16px); }
.reveal-tile.bl { left: 0;  bottom: 0;  width: 37.5vw;  height: 56vh; transform: translateX(-16px); }
.reveal-tile.bc { left: 50vw; bottom: 0; width: 37.5vw; height: 58vh; transform: translateY(16px); }
.reveal-tile.tl { top: 0;   left: 0;    width: 37.5vw;  height: 54vh; transform: translateX(-16px); }
.reveal-tile.mr { top: 24vh; right: 0;  width: 37.5vw;  height: 54vh; transform: translateX(16px); }

/* Masking-tape marker label, sits right next to the dot */
.reveal-caption {
  position: absolute; z-index: 6;
  font-family: var(--marker);
  font-size: 30px; line-height: 1;
  color: #1c1c1c; white-space: nowrap;
  background: rgba(232,228,219,.92);
  padding: 6px 16px;
  transform: rotate(-3deg);
  box-shadow: 0 8px 22px rgba(0,0,0,.4);
  opacity: 0; transition: opacity .3s ease .05s;
  pointer-events: none;
}
.reveal-group.on .reveal-caption { opacity: 1; }

.cover-side {
  position: absolute;
  top: 46%; left: 34px; z-index: 2;
  font-family: var(--sans);
  font-weight: 700; font-size: 13px;
  letter-spacing: .5px; text-transform: uppercase;
  color: #fff;
}
.cover-issue {
  position: absolute;
  top: 46%; right: 34px; z-index: 2;
  font-family: var(--mono); font-size: 12px;
  color: #fff;
}

/* Dot hotspots over yarn balls */
.dot {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: #fff;
  font-family: var(--mono);
  font-size: 14px;
  padding-left: 18px;
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0,0,0,.7);
  transition: transform .2s, opacity .2s;
}
.dot::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,.6);
  animation: pulse 2.4s infinite;
}
.dot:hover { transform: translate(-50%, -50%) scale(1.06); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.5); }
  70%  { box-shadow: 0 0 0 12px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.scroll-hint {
  position: absolute;
  bottom: 30px; left: 50%; z-index: 2;
  transform: translateX(-50%);
  text-align: center;
  font-family: var(--mono); font-size: 12px;
  color: #fff;
  line-height: 1.3;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%,100%{ transform: translateX(-50%) translateY(0);} 50%{ transform: translateX(-50%) translateY(6px);} }

/* ===== CHAPTERS ===== */
.chapter {
  position: relative;
  min-height: 100vh;
  padding: 14vh 5vw 16vh;
  border-top: 1px solid var(--line);
  overflow: hidden;
  scroll-margin-top: 0;
}
.chapter-title {
  position: sticky;
  top: 42vh;
  z-index: 0;
  text-align: center;
  font-weight: 500;
  font-size: clamp(64px, 16vw, 260px);
  line-height: .9;
  letter-spacing: -.04em;
  color: var(--ink);
  pointer-events: none;
}
.sticker {
  display: inline-block;
  font-family: var(--marker);
  font-weight: 600;
  font-size: .42em;
  letter-spacing: 0;
  color: #2a2a2a;
  background: #DCD8CE;
  padding: .02em .35em;
  transform: rotate(-4deg);
  border-radius: 2px;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
  vertical-align: .35em;
}

/* Floating cards layered over the giant headline */
.cards {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 26vh;
}
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 30px 34px;
  box-shadow: 0 24px 60px -28px rgba(0,0,0,.35);
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 16px;
  align-items: start;
}
.card .tag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  padding-top: 4px;
}
.card .en {
  grid-column: 2;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
}
.card .fa {
  grid-column: 2;
  font-family: var(--mono);
  font-size: 15px;
  line-height: 2;
  color: var(--muted);
  direction: rtl;
  text-align: right;
  margin-top: 14px;
}
.card .quote {
  grid-column: 2;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(19px, 2.1vw, 26px);
  line-height: 1.25;
  letter-spacing: -.01em;
}
.card-a { margin-right: 8%; }
.card-b { margin-left: 14%; }
.card-c {
  display: block;
  text-align: center;
  margin-right: 4%;
}
.card .more {
  font-family: var(--mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 4px;
}
.card .more:hover { opacity: .6; }

/* ===== CONTENTS ===== */
.contents {
  background: var(--ink);
  color: var(--paper);
  padding: 12vh 5vw;
}
.contents .tag {
  font-family: var(--mono);
  font-size: 13px;
  color: #8a8a8a;
  display: block;
  margin-bottom: 30px;
}
.toc { list-style: none; max-width: 1100px; margin: 0 auto; }
.toc li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid #333;
  padding: 22px 0;
}
.toc li:last-child { border-bottom: 1px solid #333; }
.toc a {
  font-weight: 600;
  font-size: clamp(34px, 6vw, 84px);
  letter-spacing: -.03em;
  transition: opacity .2s, padding-left .2s;
}
.toc li:hover a { opacity: .55; padding-left: 14px; }
.toc span {
  font-family: var(--mono);
  font-size: 13px;
  color: #8a8a8a;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  padding: 60px 24px;
  font-family: var(--mono);
  font-size: 12px;
}
.footer .tag-line {
  font-family: var(--marker);
  font-size: 30px;
  margin-bottom: 12px;
}

/* ===== INNER CONTENT PAGES (category / article / about) ===== */
.page {
  padding: 22vh 5vw 12vh;
  max-width: 1100px;
  margin: 0 auto;
}
.back {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8vh;
}
.back:hover { color: var(--ink); }

.page-eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 22px;
}
.page-title {
  font-weight: 500;
  font-size: clamp(54px, 12vw, 180px);
  line-height: .9;
  letter-spacing: -.04em;
  margin-bottom: 30px;
}
.page-lede {
  font-family: var(--mono);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.7;
  max-width: 620px;
  color: var(--ink);
}
.page-lede.fa {
  direction: rtl; text-align: right;
  color: var(--muted);
  margin-top: 16px;
}
.byline {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .5px;
  color: var(--muted);
  margin-top: 34px;
}

/* Story list (category + "keep reading") */
.story-list { list-style: none; margin-top: 10vh; }
.story-item {
  display: grid;
  grid-template-columns: 60px 1fr auto 30px;
  align-items: baseline;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: padding-left .2s, background .2s;
}
.story-list .story-item:last-child { border-bottom: 1px solid var(--line); }
.story-item:hover { padding-left: 14px; }
.story-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.story-name {
  font-weight: 600;
  font-size: clamp(20px, 2.6vw, 34px);
  letter-spacing: -.02em;
  line-height: 1.1;
}
.story-cat {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.story-arrow {
  font-family: var(--mono);
  font-size: 18px;
  opacity: 0;
  transition: opacity .2s, transform .2s;
}
.story-item:hover .story-arrow { opacity: 1; transform: translateX(4px); }

.list-head {
  font-weight: 500;
  font-size: clamp(34px, 6vw, 80px);
  letter-spacing: -.03em;
  margin-bottom: 2vh;
}

/* Article reading column */
.doc {
  max-width: 660px;
  margin: 10vh auto 0;
}
.doc p {
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.9;
  margin-bottom: 28px;
}
.doc h2 {
  font-weight: 700;
  font-size: clamp(24px, 3vw, 38px);
  letter-spacing: -.02em;
  margin: 8vh 0 26px;
}
.doc strong { font-weight: 700; }
.doc blockquote {
  font-weight: 700;
  font-size: clamp(24px, 3.4vw, 40px);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 8vh 0;
  padding-left: 26px;
  border-left: 3px solid var(--ink);
}
.doc a.inline {
  border-bottom: 1px solid var(--ink);
}

/* Page footer (shared on inner pages) */
.page-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 10vh 5vw 6vh;
  text-align: center;
}
.page-footer .mark {
  font-family: var(--marker);
  font-size: 34px;
  margin-bottom: 26px;
}
.page-footer .links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 26px;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 34px;
}
.page-footer .links a { color: #c9c9c9; }
.page-footer .links a:hover { color: #fff; }
.page-footer .copy {
  font-family: var(--mono);
  font-size: 12px;
  color: #7c7c7c;
}

/* Mid-size screens: shrink the hover collage so tiles don't swallow the page */
@media (max-width: 1100px) {
  .reveal-tile.tr { width: 50vw; height: 40vh; }
  .reveal-tile.bl { width: 44vw; height: 36vh; }
  .reveal-tile.bc { left: 52vw; width: 44vw; height: 38vh; }
  .reveal-tile.tl { width: 44vw; height: 34vh; }
  .reveal-tile.mr { top: 30vh; width: 44vw; height: 36vh; }
  .reveal-caption { font-size: 24px; }
}

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .brand { font-size: 16px; }
  .corner { font-size: 11px; }
  .cover-side, .cover-issue { display: none; }
  .dot { font-size: 12px; }
  /* Touch: first tap previews, second tap opens. Compact tile layout. */
  .reveal-grid { display: none; }
  .reveal-tile.tr { top: 0;    right: 0;  width: 62vw; height: 26vh; }
  .reveal-tile.tl { top: 0;    left: 0;   width: 62vw; height: 24vh; }
  .reveal-tile.mr { top: 26vh; right: 0;  width: 56vw; height: 24vh; }
  .reveal-tile.bl { bottom: 0; left: 0;   width: 62vw; height: 26vh; }
  .reveal-tile.bc { left: auto; right: 0; bottom: 0; width: 56vw; height: 24vh; }
  .reveal-caption { font-size: 20px; padding: 4px 12px; }
  .chapter { padding: 12vh 6vw 14vh; }
  .chapter-title { top: 38vh; }
  .cards { gap: 18vh; }
  .card { grid-template-columns: 54px 1fr; padding: 22px 20px; }
  .card-a, .card-b, .card-c { margin: 0; }
  .card .quote { grid-column: 1 / -1; }
  .page { padding: 18vh 7vw 10vh; }
  .story-item {
    grid-template-columns: 36px 1fr;
    gap: 6px 16px;
  }
  .story-cat { grid-column: 2; }
  .story-arrow { display: none; }
}
