/* =============================================
   PICK SIGNAL Magazine — 基于 SIGNAL 设计系统
   优选信号 / MSA505 · 2026 年夏季创刊号
   ============================================= */

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --paper: #f5f0e8;
  --ink: #1a1a18;
  --accent: #c23616;
  --muted: #7a7568;
  --rule: #b8b0a0;
  --col-gap: 2rem;
  --page-pad: 4vw;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  position: relative;
  overflow-x: hidden;
}

/* Paper texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  mix-blend-mode: multiply;
}

/* Secondary grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.008) 2px,
    rgba(0,0,0,0.008) 4px
  );
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 900;
  line-height: 1.05;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection {
  background: var(--accent);
  color: var(--paper);
}

/* ===== PAGE WRAPPER ===== */
.magazine {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

/* ===== COVER / HERO ===== */
.cover {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem var(--page-pad) 4rem;
  position: relative;
  border-bottom: 3px double var(--ink);
}

.cover__issue {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.cover__title {
  font-size: clamp(4rem, 12vw, 11rem);
  letter-spacing: -0.04em;
  margin-left: -6vw;
  color: var(--ink);
  position: relative;
}

.cover__title span {
  display: block;
  font-style: italic;
  font-weight: 400;
  font-size: 0.28em;
  letter-spacing: 0.02em;
  margin-top: 0.3em;
  color: var(--accent);
}

.cover__meta {
  display: flex;
  gap: 3rem;
  margin-top: 3rem;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.cover__rule {
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin-top: 2rem;
}

/* ===== NAVIGATION (TOC) ===== */
.toc {
  padding: 4rem var(--page-pad);
  border-bottom: 1px solid var(--rule);
}

.toc__heading {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.toc__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.toc__item {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: all 0.3s ease;
}

.toc__item:first-child { border-top: 1px solid var(--rule); }

.toc__item:hover {
  padding-left: 1rem;
  background: rgba(0,0,0,0.015);
}

.toc__num {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 2.5rem;
  transition: font-size 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: left center;
}

.toc__item:hover .toc__num {
  font-size: 2.2rem;
  transform: translateY(-2px);
}

.toc__text { flex: 1; }

.toc__text h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.toc__text p {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.toc__page {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* ===== ARTICLES GRID ===== */
.articles { padding: 5rem 0; }

.article {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: var(--col-gap);
  padding: 4rem var(--page-pad);
  border-bottom: 1px solid var(--rule);
  position: relative;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.article.visible {
  opacity: 1;
  transform: translateY(0);
}

.article:nth-child(even) {
  grid-template-columns: 1fr 1fr 1.6fr;
}

.article:nth-child(3n) {
  grid-template-columns: 1.2fr 2fr 0.8fr;
}

.article__col { position: relative; }
.article__col--main { grid-row: 1; }

.article__title {
  font-size: clamp(2rem, 4.5vw, 4.5rem);
  margin-left: calc(var(--page-pad) * -1.5);
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
  position: relative;
}

.article__title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--accent);
  margin-top: 0.8rem;
}

.article__category {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.article__body {
  font-size: 0.85rem;
  line-height: 1.75;
  color: #3a3832;
}

.article__body p + p {
  margin-top: 1em;
  text-indent: 1.5em;
}

.article__pullquote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.4;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 1.2rem;
  margin: 2rem 0;
}

.article__sidebar {
  font-size: 0.75rem;
  color: var(--muted);
  border-left: 1px solid var(--rule);
  padding-left: 1.5rem;
}

.article__sidebar h4 {
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
  color: var(--ink);
}

.article__sidebar ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.article__sidebar li::before {
  content: '→ ';
  color: var(--accent);
}

.article__dateline {
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 2rem;
}

/* ===== IMAGES (sepia + noise) ===== */
.mag-img {
  position: relative;
  overflow: hidden;
  margin: 1.5rem 0;
}

.mag-img img {
  width: 100%;
  display: block;
  filter: sepia(0.2) contrast(1.05) brightness(0.98);
  transition: filter 0.5s ease;
}

.mag-img:hover img {
  filter: sepia(0.05) contrast(1.1) brightness(1);
}

.mag-img::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: multiply;
}

.mag-img__caption {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-style: italic;
  letter-spacing: 0.05em;
}

/* Placeholder badge */
.mag-badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ===== PAGE TRANSITION (flip) ===== */
.page-flip {
  position: relative;
  overflow: hidden;
}

.page-flip::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 60px;
  background: linear-gradient(to left,
    rgba(0,0,0,0.06) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

.page-break {
  height: 4px;
  background: linear-gradient(
    to right,
    transparent 0%,
    var(--rule) 10%,
    var(--ink) 50%,
    var(--rule) 90%,
    transparent 100%
  );
  margin: 0;
  position: relative;
}

.page-break::before {
  content: '§';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--paper);
  padding: 0 1.5rem;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--muted);
}

.flip-enter {
  animation: flipIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes flipIn {
  0% {
    transform: perspective(1200px) rotateY(-8deg);
    transform-origin: left center;
    opacity: 0;
    filter: brightness(0.7);
  }
  100% {
    transform: perspective(1200px) rotateY(0deg);
    opacity: 1;
    filter: brightness(1);
  }
}

/* ===== SPREAD (dark feature) ===== */
.spread {
  padding: 6rem var(--page-pad);
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}

.spread::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  mix-blend-mode: screen;
  pointer-events: none;
}

.spread__grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  position: relative;
  z-index: 1;
}

.spread h2 {
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  margin-left: calc(var(--page-pad) * -1);
  margin-bottom: 2rem;
  color: var(--paper);
}

.spread h2::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: var(--accent);
  margin-top: 1rem;
}

.spread p {
  font-size: 0.9rem;
  line-height: 1.8;
  color: #c8c0b0;
}

.spread .article__pullquote {
  color: #e8c547;
  border-color: #e8c547;
}

.spread .article__category { color: #e8c547; }

/* ===== TWO-COLUMN LAYOUT ===== */
.article--two-col {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 3rem;
}

.article--two-col .article__body p + p {
  margin-top: 0.8em;
  text-indent: 1.5em;
}

/* ===== COLOPHON (footer) ===== */
.colophon {
  padding: 5rem var(--page-pad) 3rem;
  border-top: 3px double var(--ink);
  margin-top: 4rem;
}

.colophon__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.colophon__section h4 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.colophon__section p,
.colophon__section li {
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--muted);
}

.colophon__section ul { list-style: none; }

.colophon__legal {
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.colophon__issn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.colophon__issn strong {
  font-size: 0.8rem;
  color: var(--ink);
  display: block;
  margin-bottom: 0.3rem;
}

.colophon__mark {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--ink);
  opacity: 0.15;
}

.colophon__copy {
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

/* ===== DECORATIVE ===== */
.drop-cap::first-letter {
  font-family: 'Playfair Display', serif;
  font-size: 4.5em;
  float: left;
  line-height: 0.8;
  margin-right: 0.1em;
  margin-top: 0.05em;
  color: var(--accent);
  font-weight: 900;
}

.divider {
  text-align: center;
  padding: 2rem 0;
  color: var(--muted);
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  letter-spacing: 0.5em;
}

.folio {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
  padding: 1rem 0;
}

/* Back to home link */
.back-home {
  position: fixed;
  top: 1.5rem;
  left: 2vw;
  z-index: 10001;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.5rem 1rem;
  border: 1px solid var(--rule);
  background: rgba(245,240,232,0.9);
  transition: all 0.3s ease;
}

.back-home:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .article {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
  .article--two-col {
    grid-template-columns: 1fr !important;
  }
  .article__sidebar {
    border-left: none;
    border-top: 1px solid var(--rule);
    padding-left: 0;
    padding-top: 1.5rem;
  }
  .spread__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .colophon__grid {
    grid-template-columns: 1fr 1fr;
  }
  .cover__title {
    margin-left: -3vw;
  }
  .article__title {
    margin-left: calc(var(--page-pad) * -0.8);
  }
}

@media (max-width: 600px) {
  :root {
    --page-pad: 5vw;
    --col-gap: 1rem;
  }
  .colophon__grid {
    grid-template-columns: 1fr;
  }
  .cover__meta {
    flex-direction: column;
    gap: 1rem;
  }
  .toc__item:hover .toc__num {
    font-size: 1.6rem;
  }
}

/* ===== SCROLL PROGRESS ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 10000;
  transition: width 0.1s linear;
}

/* ===== STITCH (decorative binding) ===== */
.stitch {
  position: fixed;
  left: 2vw;
  top: 0;
  bottom: 0;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    var(--rule) 0px,
    var(--rule) 8px,
    transparent 8px,
    transparent 16px
  );
  opacity: 0.4;
  z-index: 100;
  pointer-events: none;
}

@media (max-width: 900px) {
  .stitch { display: none; }
}

/* ===== HOME ENTRY CARD (for main site integration) ===== */
.mag-entry {
  background: rgba(26,26,24,0.03);
  border-top: 1px solid rgba(0,0,0,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 2rem var(--page-pad);
  max-width: 1400px;
  margin: 0 auto;
}

.mag-entry__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.mag-entry__label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
}

.mag-entry__cta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: all 0.2s ease;
}

.mag-entry__cta:hover {
  color: var(--ink);
  border-color: var(--ink);
  text-decoration: none;
}

.mag-entry__grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  align-items: center;
}

.mag-entry__cover {
  width: 180px;
  height: 240px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.mag-entry__cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  mix-blend-mode: screen;
}

.mag-entry__cover-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.mag-entry__cover-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 0.5rem;
  color: #a09888;
  position: relative;
  z-index: 1;
}

.mag-entry__articles {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.mag-entry__article {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  font-size: 0.82rem;
  color: var(--ink);
  transition: color 0.2s ease;
}

.mag-entry__article:hover {
  color: var(--accent);
  text-decoration: none;
}

.mag-entry__article-num {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  color: var(--accent);
  min-width: 1.5rem;
}

@media (max-width: 600px) {
  .mag-entry__grid {
    grid-template-columns: 1fr;
  }
  .mag-entry__cover {
    width: 120px;
    height: 160px;
  }
}
