:root {
  --accent: #ff4b60;
  --text: #15171a;
  --text-muted: #73808c;
  --bg: #fff;
  --bg-soft: #f5f6f7;
  --border: #e6e9ec;
  --max: 840px;
  --wide: 1120px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover {
  text-decoration: underline;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header__inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.site-title:hover {
  color: var(--accent);
  text-decoration: none;
}

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

.site-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

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

.hero {
  padding: 3.5rem 1.25rem 2.5rem;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 75, 96, 0.12), transparent 70%),
    var(--bg);
}

.hero__title {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero__desc {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.post-feed {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 0.5rem;
}

@media (min-width: 720px) {
  .post-feed {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.25rem;
  }
}

.post-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  text-decoration: none;
}

.post-card__image {
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  overflow: hidden;
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.post-card:hover .post-card__image img {
  transform: scale(1.03);
}

.post-card__body {
  padding: 1.1rem 0.15rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.post-card__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.post-card__title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
}

.post-card:hover .post-card__title {
  color: var(--accent);
}

.post-card__excerpt {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.75rem 1.25rem 1.5rem;
}

.post-hero__meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.post-hero__title {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.post-hero__excerpt {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.55;
}

.post-feature {
  max-width: 1080px;
  margin: 0 auto 2rem;
  padding: 0 1.25rem;
}

.post-feature img {
  width: 100%;
  border-radius: 12px;
  background: var(--bg-soft);
}

.article {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.75;
}

.article > *:first-child {
  margin-top: 0;
}

.article h2,
.article h3,
.article h4 {
  font-family: var(--sans);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 2.25rem 0 0.85rem;
}

.article h2 {
  font-size: 1.65rem;
}

.article h3 {
  font-size: 1.35rem;
}

.article p {
  margin: 0 0 1.25rem;
}

.article a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article ul,
.article ol {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
}

.article li {
  margin-bottom: 0.4rem;
}

.article blockquote {
  margin: 1.75rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-style: italic;
}

.article pre {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  background: #1e2430;
  color: #e8ecf1;
  border-radius: 10px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.55;
}

.article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.article pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.article figure {
  margin: 1.75rem 0;
}

.article figcaption {
  margin-top: 0.5rem;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article img {
  border-radius: 8px;
  margin: 1.5rem auto;
}

.article hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.article iframe {
  max-width: 100%;
  margin: 1.5rem 0;
}

/* Ghost oembed iframes ship with tiny width="200" - force full-width 16:9 */
.kg-embed-card {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1.75rem 0;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 - more reliable than aspect-ratio alone */
  background: #0f1115;
  border-radius: 10px;
  overflow: hidden;
}

.kg-embed-card iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  margin: 0;
  border: 0;
}


.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--accent);
}

.kg-card {
  margin: 1.75rem 0;
}

.kg-image-card img,
.kg-gallery-image img {
  margin: 0 auto;
}

.kg-bookmark-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.kg-bookmark-container {
  display: flex;
  text-decoration: none;
  color: inherit;
}

.kg-bookmark-content {
  padding: 1rem;
  flex: 1;
  min-width: 0;
}

.kg-bookmark-title {
  font-family: var(--sans);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.kg-bookmark-description {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kg-bookmark-metadata {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.kg-bookmark-thumbnail {
  width: 140px;
  flex-shrink: 0;
}

.kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
}

@media (max-width: 600px) {
  .kg-bookmark-thumbnail {
    display: none;
  }
}
