:root {
  --accent: #5a4fcf;
  --text: #1d1d24;
  --muted: #7a7a85;
  --line: #ececf2;
  --panel: #f6f6f9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

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

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
}
.brand { font-weight: 800; font-size: 19px; white-space: nowrap; }
.site-header nav a { margin-left: 18px; color: var(--muted); }
.site-header nav a.active { color: var(--accent); font-weight: 600; }

/* Section chips */
.chips {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  padding: 10px max(24px, calc((100vw - 1200px) / 2 + 24px));
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.chips a {
  flex: none;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 10%, white);
}
.chips a:hover { background: var(--c); color: #fff; }

.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #fff;
  background: var(--c, var(--accent));
}

.magazine { max-width: 1200px; margin: 0 auto; padding: 8px 24px 40px; }
.today { margin: 18px 0; font-size: 15px; font-weight: 600; color: var(--muted); }

/* Picture tiles: colored placeholder with source name; the image covers it when it loads */
.thumb, .thumb-sm, .lead-image {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 65%, black));
}
.thumb { aspect-ratio: 16 / 9; }
.thumb-sm { flex: none; width: 96px; height: 64px; border-radius: 8px; }
.lead-image { aspect-ratio: 16 / 9; }
.thumb img, .thumb-sm img, .lead-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-label {
  position: absolute;
  left: 10px;
  bottom: 8px;
  right: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  opacity: .9;
}
.thumb-sm .thumb-label { font-size: 10px; left: 6px; bottom: 4px; }

/* Lead story */
.lead {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 36px;
}
.lead h1 { margin: 10px 0 6px; font-size: 30px; line-height: 1.2; }
.lead p { color: #4a4a55; font-size: 15px; }

/* Writing strip */
.writing { margin-bottom: 36px; }
.writing-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.writing-card {
  display: block;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--panel);
  border-left: 4px solid var(--accent);
}
.writing-card .t { font-weight: 650; margin-bottom: 6px; }

/* Sections */
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.see-all { color: var(--accent); font-size: 13px; }
.topic { margin-bottom: 40px; scroll-margin-top: 60px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card .t { margin: 10px 0 4px; font-weight: 650; font-size: 16px; line-height: 1.3; }
.card p { margin: 6px 0 0; color: #555; font-size: 14px; }

.more {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 24px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.row { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.row .t { font-weight: 600; font-size: 14px; line-height: 1.3; }

.meta { color: var(--muted); font-size: 12px; }
.label {
  display: inline-block;
  background: #eeedfb;
  color: var(--accent);
  border-radius: 8px;
  padding: 0 6px;
  font-size: 11px;
  margin-right: 6px;
}

/* Blog, post and about pages */
.page { max-width: 720px; margin: 0 auto; padding: 24px; }
.post-row { padding: 12px 0; border-top: 1px solid var(--line); }
.post-row a { font-weight: 600; font-size: 17px; }
.post-row p { margin: 4px 0 0; color: #444; }
.post h1 { margin-bottom: 4px; }
.post img { max-width: 100%; }
.post pre { overflow-x: auto; background: var(--panel); padding: 12px; }

/* About */
.about { max-width: 820px; padding-top: 40px; }
.profile { display: flex; gap: 36px; align-items: flex-start; }
.avatar {
  flex: none;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px #fff, 0 0 0 7px color-mix(in srgb, var(--accent) 35%, white);
}
.profile-text h2 { margin: 6px 0 12px; font-size: 28px; }
.profile-text p { font-size: 16px; color: #3a3a45; }
.profile-text p a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.profile-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, white);
}
.profile-link:hover { background: var(--accent); color: #fff; }

.site-footer { max-width: 1200px; margin: 0 auto; padding: 20px 24px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }

@media (max-width: 800px) {
  .site-header { padding: 12px 16px; }
  .site-header nav a { margin-left: 12px; }
  .chips { padding: 8px 16px; }
  .magazine { padding: 4px 16px 32px; }
  .lead, .cards, .writing-cards, .more { grid-template-columns: minmax(0, 1fr); }
  .lead { gap: 14px; }
  .lead h1 { font-size: 22px; }
  .about { padding-top: 24px; }
  .profile { flex-direction: column; align-items: center; text-align: center; gap: 18px; }
  .avatar { width: 128px; height: 128px; }
  .profile-links { justify-content: center; }
}
