/* ============================================================
   Design Tokens
   ============================================================ */
:root {
  --bg: #eef1f5;
  --ink: #14213d;
  --mute: #5b667a;
  --card: #fff;
  --line: #d5dbe5;
  --accent: #1d4ed8;
  --accent-ink: #fff;
  --shadow: 0 10px 30px rgba(20, 33, 61, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1624;
    --ink: #e8edf6;
    --mute: #93a0b8;
    --card: #18223a;
    --line: #2a3652;
    --accent: #7aa2ff;
    --accent-ink: #0f1624;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

/* ============================================================
   Reset / Base
   ============================================================ */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 "Instrument Sans", system-ui, sans-serif;
}

h1,
h2,
h3 {
  font-family: Newsreader, Georgia, serif;
  margin: 0;
}

/* ============================================================
   Layout
   ============================================================ */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ============================================================
   Header
   ============================================================ */
header h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.05;
}

header p {
  color: var(--mute);
  margin: 8px 0 0;
  max-width: 52ch;
}

/* ============================================================
   Cover
   ============================================================ */
.cover {  
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: block;
}

.cover img,
.cover canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover.empty {
  display: grid;
  place-items: center;
  color: var(--mute);
  font-size: 0.9rem;
}

/* ============================================================
   Latest Feature
   ============================================================ */
.latest {
  display: grid;
  grid-template-columns: minmax(0, 320px) 1fr;
  gap: 40px;
  align-items: center;
  margin: 48px 0 64px;
}

.latest h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 6px 0 10px;
}

.latest p {
  color: var(--mute);
  max-width: 46ch;
  margin: 0 0 20px;
}

.tag {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
}

/* ============================================================
   Buttons
   ============================================================ */
.btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  font: 600 0.95rem "Instrument Sans", sans-serif;
  text-decoration: none;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn:focus-visible,
.cover:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================================
   Year / Archive
   ============================================================ */
.year {
  font-size: 1.4rem;
  margin: 0 0 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}

.item h3 {
  font-size: 1.1rem;
  margin: 12px 0 8px;
}

.item .btn {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* ============================================================
   Messages
   ============================================================ */
.msg {
  color: var(--mute);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
  .latest {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .latest .cover {
    max-width: 280px;
  }
}