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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: "TsangerJinKai02", STKaiti, KaiTi, "PingFang SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--canvas);
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  background: var(--canvas);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: min(calc(100% - 2rem), 660px);
  min-height: 36px;
  margin: 30px auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 7px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-nav a {
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--link);
}

.home-main {
  width: min(calc(100% - 2rem), 660px);
  margin: 0 auto;
}

.latest-issue {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  min-height: 320px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transition: box-shadow 180ms ease-out, transform 180ms ease-out;
}

.latest-issue:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.latest-cover {
  display: block;
  min-width: 0;
  overflow: hidden;
  background: var(--paper-raised);
}

.latest-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 47% 50%;
  transition: transform 260ms ease-out;
}

.latest-issue:hover .latest-cover img {
  transform: scale(1.015);
}

.latest-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.25rem;
}

.latest-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.latest-meta strong {
  color: var(--active);
}

.latest-copy h1 {
  margin: 1.35rem 0 0.65rem;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.32;
}

.latest-copy > p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.latest-stories {
  margin: auto 0 0;
  padding: 1rem 0 0;
  list-style-position: inside;
}

.latest-stories li {
  overflow: hidden;
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issues-section {
  padding: 2.5rem 0 5rem;
  scroll-margin-top: 1rem;
}

.issues-heading {
  padding: 0 0.25rem 1rem;
  border-bottom: 1px solid var(--line-strong);
}

.issues-heading h2 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.25;
}

.issues-heading p {
  margin: 0.25rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.issue-month {
  padding-top: 1.9rem;
}

.issue-month h3 {
  margin: 0 0 0.6rem;
  padding: 0 0.25rem;
  color: var(--active);
  font-size: 1.05rem;
  line-height: 1.4;
}

.issue-list {
  border-bottom: 1px solid var(--line);
}

.issue-row {
  border-top: 1px solid var(--line);
}

.issue-row > a {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 2.8rem;
  align-items: center;
  gap: 1rem;
  min-height: 82px;
  padding: 0.8rem 0.25rem;
  text-decoration: none;
  transition: background 140ms ease-out, color 140ms ease-out;
}

.issue-row > a:hover {
  background: var(--paper-raised);
}

.issue-row time {
  display: flex;
  align-items: center;
  flex-direction: column;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.issue-row time strong {
  color: var(--ink);
  font-size: 1.25rem;
}

.issue-row time span {
  margin-top: 0.3rem;
  font-size: 0.72rem;
}

.issue-row-copy {
  min-width: 0;
}

.issue-row-copy h4 {
  margin: 0;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-row-copy p {
  margin: 0.25rem 0 0;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 0.82rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issue-row-count {
  color: var(--ink-muted);
  font-size: 0.76rem;
  text-align: right;
  white-space: nowrap;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: min(calc(100% - 2rem), 660px);
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.footer-meta strong {
  color: var(--ink-soft);
}

.footer-credit {
  margin: 0;
  color: var(--ink-muted);
}

.footer-credit a {
  color: var(--link);
  text-decoration: none;
}

.footer-credit a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

@media (max-width: 640px) {
  .masthead {
    margin: 18px auto 22px;
  }

  .brand {
    gap: 0.45rem;
    font-size: 1.3rem;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .site-nav {
    gap: 1rem;
  }

  .site-nav a {
    font-size: 0.9rem;
  }

  .latest-issue {
    grid-template-columns: 1fr;
  }

  .latest-cover {
    height: min(64vw, 270px);
  }

  .latest-cover img {
    object-position: center 48%;
  }

  .latest-copy {
    min-height: 290px;
    padding: 1rem;
  }

  .latest-copy h1 {
    font-size: 1.4rem;
  }

  .issue-row > a {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: 0.75rem;
  }

  .issue-row-count {
    display: none;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }
}

@media (max-width: 380px) {
  .site-nav a:first-child {
    display: none;
  }
}
