.up-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.up-wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(34px, 5vw, 56px) var(--gut) var(--sec-y);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.up-wrap .up-older { margin-top: clamp(26px, 3.4vw, 44px); }

.up-tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.up-tile:hover {
  border-color: var(--accent);
  background: var(--raise);
}

.up-thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--line);
}

.up-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.up-tile:hover .up-thumb img { transform: scale(1.05); }

.up-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 24px;
}

.up-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}

.up-tag { color: var(--accent); }
.up-date { color: var(--dim); }

.up-title {
  font-size: 1.02rem;
  letter-spacing: 1.4px;
  color: #fff;
}

.up-sum {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.up-featured {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
}

.up-featured .up-thumb {
  border-bottom: none;
  border-right: 1px solid var(--line);
}

.up-featured .up-info {
  justify-content: center;
  gap: 16px;
  padding: clamp(24px, 3.4vw, 48px);
}

.up-featured .up-title {
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  letter-spacing: var(--ls-display);
}

.up-featured .up-sum {
  font-size: 1rem;
  -webkit-line-clamp: 5;
}

.up-read {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}

.up-read svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.up-tile:hover .up-read svg { transform: translateX(4px); }

.up-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.up-lock,
.up-lock body { overflow: hidden; }

.up-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.up-modal.open {
  opacity: 1;
  visibility: visible;
}

.up-shell {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  max-width: 1560px;
  margin-inline: auto;
  padding: clamp(20px, 4vw, 48px) var(--gut);
}

.up-panel {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line-2);
  outline: none;
  transform: translateY(14px);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.up-modal.open .up-panel { transform: none; }

.up-cover {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.up-cover img {
  width: 100%;
  aspect-ratio: 100 / 21;
  object-fit: cover;
  cursor: zoom-in;
}

.up-head {
  position: absolute;
  inset: auto 0 0 0;
  padding: clamp(60px, 8vw, 110px) clamp(22px, 3.4vw, 40px) clamp(20px, 2.6vw, 30px);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.55) 50%, transparent 100%);
  pointer-events: none;
}

.up-head h2 {
  font-size: clamp(1.35rem, 2.8vw, 2.2rem);
  margin-top: 10px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.up-body { padding: 28px clamp(22px, 3.4vw, 40px) 8px; }

.up-body h2 {
  font-size: clamp(1.1rem, 2.1vw, 1.4rem);
  margin: 40px 0 16px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.up-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.up-body h3 {
  font-size: 1rem;
  margin: 28px 0 12px;
}

.up-body h4 {
  font-size: 0.8rem;
  letter-spacing: var(--ls-label);
  color: var(--accent);
  margin: 24px 0 10px;
}

.up-body p { color: var(--muted); margin-bottom: 16px; }
.up-body strong { color: #fff; }

.up-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.up-body a:hover { text-decoration-color: var(--accent); }
.up-body a.btn { color: #0d0d0d; text-decoration: none; margin: 8px 0 4px; }
.up-body a.btn:hover { color: var(--accent); }

.up-body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--accent);
  background: #080808;
  border: 1px solid var(--line);
  padding: 1px 6px;
}

.up-body .wk-code code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.up-body img {
  width: auto;
  max-width: min(100%, 760px);
  margin: 22px 0;
  border: 1px solid var(--line-2);
  cursor: zoom-in;
}

.up-foot { padding: 12px clamp(22px, 3.4vw, 40px) 36px; }
.up-foot[hidden] { display: none; }

.up-rail {
  position: sticky;
  top: clamp(20px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.up-rail button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  background: rgba(13, 13, 13, 0.75);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.up-rail button svg { width: 20px; height: 20px; }

.up-rail button:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d0d0d;
}

.up-rail button:disabled {
  opacity: 0.3;
  cursor: default;
}

.up-rail .up-close { margin-bottom: 8px; }

@media (max-width: 860px) {
  .up-featured { grid-template-columns: 1fr; }

  .up-featured .up-thumb {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .up-modal {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .up-shell { padding: 0; }

  .up-cover img { aspect-ratio: 16 / 9; }

  .up-panel {
    max-width: none;
    min-height: 100dvh;
    border: none;
  }

  .up-rail {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 2;
    flex-direction: row;
    gap: 8px;
  }

  .up-rail button { width: 42px; height: 42px; }
  .up-rail .up-close { margin-bottom: 0; order: 3; }
}
