/* 우리 이야기: /characters/ (in-world introductions) and /behind/ (the real lineage).
   Two static readers sharing one sheet and one Pretendard cut; the header and tokens come from style.css.
   No JS: every anchor, tab and article reads the same with scripts off. */
@font-face {
  font-family: "Pretendard Story";
  src: url("./fonts/pretendard-story-400-subset.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard Story";
  src: url("./fonts/pretendard-story-700-subset.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

.story-page {
  font-family: "Pretendard Story", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Apple SD Gothic Neo", sans-serif;
}

/* Local tabs under 우리 이야기; the way back to the reunion scene sits at the far end. */
.story-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1rem;
  padding-inline: var(--page-inline);
  border-block-end: 1px solid var(--line);
}

.story-tabs a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.375rem;
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: none;
}

.story-tabs a:hover,
.story-tabs a[aria-current="page"] {
  color: var(--text);
}

.story-tabs a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.5rem;
}

.story-tabs .story-home {
  margin-inline-start: auto;
  color: var(--agent-blue);
}

.story {
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--page-inline) 5rem;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.story-shell {
  width: min(70rem, 100%);
  margin-inline: auto;
}

.story-intro {
  max-width: 46rem;
}

.story-eyebrow {
  color: var(--muted);
  font-size: 0.8125rem;
  letter-spacing: 0.07em;
}

.story h1 {
  margin: 0.75rem 0 1rem;
  font-size: clamp(2.125rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.story-subtitle {
  margin-block-end: 1.25rem;
  font-size: clamp(1.375rem, 2.6vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.story-intro > p:not(.story-eyebrow):not(.story-subtitle):not(.story-note) {
  color: #b8c0d2;
  font-size: 1.0625rem;
  line-height: 1.85;
}

.story-intro > p + p {
  margin-block-start: 1rem;
}

.story-intro .story-note {
  color: var(--amber);
  font-size: 0.9375rem;
}

.story-world {
  padding: 1rem 1.25rem;
  border-inline-start: 2px solid var(--amber);
  background: var(--surface);
}

.story-jumps,
.story-end {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-block-start: 1.5rem;
}

.story-jumps a,
.story-end a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.375rem;
  padding-inline: 0.875rem;
  border: 1px solid rgba(162, 174, 214, 0.27);
  border-radius: 0.375rem;
  color: var(--text);
  font-size: 0.875rem;
  text-decoration: none;
}

.story-jumps a:hover,
.story-end a:hover {
  border-color: var(--agent-blue);
}

.story-end {
  margin-block-start: 3rem;
}

/* Roster: birth order, not rank. */
.cast {
  margin-block: 2.5rem 1rem;
}

.cast ol {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cast a {
  display: flex;
  min-height: 3rem;
  align-items: center;
  gap: 0.5rem;
  padding-inline: 0.25rem;
  border-block-end: 1px solid var(--line);
  color: var(--text);
  font-size: 0.9375rem;
  text-decoration: none;
}

.cast a:hover {
  border-color: var(--agent-blue);
}

.cast-no {
  color: var(--muted);
  font-family: var(--font-latin);
  font-size: 0.75rem;
}

/* One PV article per colleague: identity first in the source, the art to its left on wide screens. */
.pv {
  padding-block: 2.5rem 3.5rem;
  border-block-start: 1px solid var(--line);
  scroll-margin-top: 1rem;
}

.pv-top {
  display: grid;
  grid-template-areas: "art identity";
  grid-template-columns: minmax(0, 1.6fr) minmax(17.5rem, 1fr);
  gap: 2.25rem;
  align-items: center;
}

.pv-identity {
  grid-area: identity;
}

.pv-art {
  grid-area: art;
}

.pv-art img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.pv-art figcaption {
  margin-block-start: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.pv-epithet {
  margin-block-end: 0.75rem;
  color: var(--amber);
}

.pv-lune .pv-epithet {
  color: #9bdecf;
}

.pv h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.875rem, 3.4vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.pv-latin {
  display: block;
  margin-block-start: 0.25rem;
  color: var(--muted);
  font-family: var(--font-latin);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.24em;
}

.pv-opening {
  margin-block-end: 1.25rem;
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.75;
}

.pv-address {
  color: var(--muted);
  font-size: 0.875rem;
}

.pv-address strong {
  margin-inline-start: 0.375rem;
  color: var(--text);
}

.pv-story {
  max-width: 46.25rem;
  margin: 1.75rem auto 0;
}

.pv-story p {
  font-size: 1.0625rem;
  line-height: 1.88;
}

.pv-story p + p {
  margin-block-start: 1rem;
}

.pv-story .pv-closing {
  margin-block: 1.5rem;
  padding-inline-start: 1.25rem;
  border-inline-start: 2px solid var(--amber);
  font-size: 1.1875rem;
}

.pv-lune .pv-closing {
  border-color: #9bdecf;
}

.pv-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
}

.pv-links a {
  display: inline-block;
  padding-block: 0.625rem;
  color: var(--agent-blue);
  font-size: 0.9375rem;
  text-underline-offset: 0.2em;
}

.story-history {
  max-width: 46.25rem;
  margin-block-start: 2rem;
  padding-block-start: 2.5rem;
  border-block-start: 1px solid var(--line);
}

.story-history h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

.story-history p {
  color: #b8c0d2;
  font-size: 1.0625rem;
  line-height: 1.85;
}

/* Behind story: dated beats, 150px date column, 28px gap, about 760px of prose. Overlapping months stay ranges. */
.beat {
  display: grid;
  grid-template-columns: 9.375rem minmax(0, 1fr);
  gap: 1.75rem;
  max-width: 58.75rem;
  padding-block: 2.25rem 2.5rem;
  border-block-start: 1px solid var(--line);
  scroll-margin-top: 1rem;
}

.story-intro + .beat {
  margin-block-start: 2.5rem;
}

.beat-date {
  padding-block-start: 0.3125rem;
  color: var(--agent-blue);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.beat h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.4375rem, 2.2vw, 1.5625rem);
  letter-spacing: -0.01em;
  line-height: 1.45;
}

.beat-body p,
.beat-body li {
  font-size: 1.0625rem;
  line-height: 1.88;
}

.beat-body p + p,
.beat-body ul + p,
.beat-body p + ul {
  margin-block-start: 1rem;
}

.beat-body ul {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.beat-body a {
  color: var(--agent-blue);
  text-underline-offset: 0.2em;
}

.beat-reconstructed {
  color: var(--muted);
}

@media (max-width: 799.98px) {
  .story {
    padding-inline: 1.25rem;
  }

  .story-tabs .story-home {
    margin-inline-start: 0;
  }

  .cast ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Text first on small screens: who is speaking, then the uncropped 3:2 art, then the story. */
  .pv-top {
    grid-template-areas:
      "identity"
      "art";
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .pv-story p,
  .beat-body p,
  .beat-body li {
    font-size: 1rem;
    line-height: 1.85;
  }

  .beat {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
    padding-block: 2rem;
  }

  .beat-date {
    padding-block-start: 0;
  }
}

@media (max-width: 419.98px) {
  .cast ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 340px) {
  .story {
    padding-inline: 1rem;
  }
}
