@import url('https://fonts.googleapis.com/css2?family=Cal+Sans&family=Inter:wght@300;400;500;600&family=Roboto+Mono:wght@500;600&display=swap');

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f8f8f8;
  --text-primary: #242424;
  --text-deep: #111111;
  --text-secondary: #898989;
  --link: #0099ff;
  --focus: rgba(59, 130, 246, 0.5);
  --ring: rgba(34, 42, 53, 0.08);
  --shadow-contact: rgba(19, 19, 22, 0.7) 0px 1px 5px -4px;
  --shadow-soft: rgba(34, 42, 53, 0.05) 0px 4px 8px 0px;
  --shadow-stack: var(--shadow-contact), 0px 0px 0px 1px var(--ring), var(--shadow-soft);
  --radius-4: 4px;
  --radius-6: 6px;
  --radius-8: 8px;
  --radius-12: 12px;
  --radius-16: 16px;
  --radius-pill: 9999px;
  --site-width: 1200px;
}

* {
  box-sizing: border-box;
}

.site-theme {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

.site-theme a {
  color: inherit;
  text-decoration: none;
  transition: color 150ms ease, opacity 150ms ease;
}

.site-theme a:hover {
  color: var(--text-deep);
}

.site-theme a:focus-visible,
.site-theme button:focus-visible,
.site-theme input:focus-visible,
.site-theme textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-shell {
  width: min(var(--site-width), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, #ffffff 92%, transparent);
  border-bottom: 1px solid var(--ring);
}

.top-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-family: 'Cal Sans', 'Inter', sans-serif;
  font-size: clamp(2rem, 6vw, 2.9rem);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: 0;
  color: var(--text-primary);
}

.brand .accent {
  color: var(--text-secondary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-link {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.14;
  padding: 9px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  color: var(--text-deep);
}

.nav-link.is-active,
.nav-link:hover {
  border-color: var(--ring);
  color: var(--text-primary);
  background: var(--surface-soft);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-menu-wrap {
  position: relative;
}

.search-inline {
  display: flex;
  align-items: center;
  border: 1px solid var(--ring);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0px 0px 0px 1px rgba(34, 42, 53, 0.03);
}

.search-inline input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  padding: 10px 14px;
  width: 220px;
  font-size: 0.9rem;
}

.search-inline input::placeholder {
  color: var(--text-secondary);
}

.search-inline button {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 12px;
  cursor: pointer;
}

.search-inline button:hover {
  color: var(--text-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-8);
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--text-primary);
  color: #ffffff;
  padding: 10px 18px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: var(--shadow-contact), rgba(255, 255, 255, 0.15) 0px 2px 0px inset;
}

.btn-primary:hover {
  opacity: 0.86;
}

.btn-outline {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--ring);
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: var(--shadow-soft);
}

.btn-outline:hover {
  background: var(--surface-soft);
}

.btn-inline {
  display: inline-flex;
}

.btn-inline-gap {
  margin-left: 8px;
}

.mobile-toggle {
  display: none;
  border: 1px solid var(--ring);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: 50%;
  width: 42px;
  height: 42px;
}

.mobile-panel {
  display: none;
  padding: 8px 0 16px;
  border-top: 1px solid var(--ring);
}

.mobile-panel.is-open {
  display: block;
}

.mobile-panel .nav-link {
  display: block;
  margin-bottom: 8px;
}

.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: var(--radius-12);
  padding: 10px;
  box-shadow: var(--shadow-stack);
}

.mobile-search-inline {
  margin-top: 10px;
}

.mobile-auth-actions {
  margin-top: 10px;
}

.top-post-carousel {
  width: 100%;
  border-bottom: 1px solid var(--ring);
  background: var(--surface-soft);
  overflow: hidden;
}

.top-post-carousel__track-wrap {
  overflow: hidden;
}

.top-post-carousel__track {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  padding: 10px 16px;
  animation: topCarouselScroll 65s linear infinite;
}

.top-post-carousel:hover .top-post-carousel__track {
  animation-play-state: paused;
}

.top-post-carousel__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 360px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--ring);
}

.top-post-carousel__item:hover {
  color: var(--text-primary);
}

.top-post-carousel__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.top-post-carousel__title {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.top-post-carousel__date {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 0.76rem;
  white-space: nowrap;
}

@keyframes topCarouselScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.hero-banner {
  padding: 96px 0 28px;
}

.hero-kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.hero-title {
  margin: 14px 0 14px;
  font-family: 'Cal Sans', 'Inter', sans-serif;
  font-size: clamp(2.6rem, 7vw, 4rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 760px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.5;
}

.home-section {
  margin: 0;
  padding: 80px 0 0;
}

.home-section:last-child {
  padding-bottom: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}

.section-title {
  margin: 0;
  font-family: 'Cal Sans', 'Inter', sans-serif;
  font-size: clamp(1.8rem, 4.3vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
}

.story-grid {
  display: grid;
  gap: 16px;
}

.story-grid.grid,
.story-grid.story-grid--latest {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.story-grid.story-grid--popular {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.story-grid.story-grid--featured {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.story-grid.story-grid--category {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.story-grid.story-grid--random {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.story-grid.story-grid--custom {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.story-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-12);
  background: var(--surface);
  box-shadow: var(--shadow-stack);
}

.story-card.story-card--feature {
  border-radius: var(--radius-16);
}

.story-card.story-card--accent-1,
.story-card.story-card--accent-2,
.story-card.story-card--accent-3,
.story-card.story-card--accent-4 {
  background: var(--surface);
  color: var(--text-primary);
}

.story-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid rgba(34, 42, 53, 0.08);
}

.story-media-placeholder {
  margin: 0;
  border-radius: 0;
  border: 0;
}

.story-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ring);
  border-radius: var(--radius-pill);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text-secondary);
  padding: 6px 10px;
}

.chip:hover {
  color: var(--text-primary);
}

.chip-more {
  border-style: dashed;
}

.story-title {
  margin: 0;
  font-family: 'Cal Sans', 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.story-excerpt {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.96rem;
  font-weight: 300;
  line-height: 1.5;
}

.story-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.story-link {
  color: var(--link);
  text-decoration: underline;
}

.story-empty {
  border-radius: var(--radius-12);
  padding: 22px;
  color: var(--text-secondary);
  text-align: center;
  box-shadow: 0px 0px 0px 1px var(--ring);
}

.page-headline {
  font-family: 'Cal Sans', 'Inter', sans-serif;
  font-size: clamp(2.3rem, 6vw, 4rem);
  font-weight: 600;
  line-height: 1.1;
  margin: 34px 0 14px;
}

.page-headline--article {
  margin-top: 0;
  margin-bottom: 16px;
}

.post-not-found-title {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 8vw, 3.2rem);
}

.article-shell {
  max-width: 980px;
  margin: 34px auto;
  border-radius: var(--radius-16);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-stack);
}

.article-cover {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.article-content-wrap {
  padding: clamp(20px, 4vw, 36px);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
}

.article-title-chips {
  margin-bottom: 18px;
}

.blog-content {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
}

.blog-content h2,
.blog-content h3,
.blog-content h4 {
  font-family: 'Cal Sans', 'Inter', sans-serif;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 1.8em 0 0.7em;
  letter-spacing: 0;
}

.blog-content h2 {
  font-size: 2rem;
  border-bottom: 1px solid var(--ring);
  padding-bottom: 0.4em;
}

.blog-content h3 {
  font-size: 1.5rem;
}

.blog-content h4 {
  font-size: 1.25rem;
  letter-spacing: 0.2px;
}

.blog-content a {
  color: var(--link);
  text-decoration: underline;
}

.blog-content blockquote {
  border-left: 2px solid var(--text-primary);
  margin: 1.4em 0;
  padding: 0.8em 1em;
  background: #fbfbfb;
  border-radius: var(--radius-6);
  color: var(--text-secondary);
}

.blog-content code,
.blog-content pre {
  font-family: 'Roboto Mono', 'Courier New', monospace;
}

.blog-content code {
  background: #f5f5f5;
  padding: 2px 5px;
  border-radius: var(--radius-4);
  color: var(--text-deep);
}

.blog-content pre {
  background: #fafafa;
  border-radius: var(--radius-8);
  overflow: auto;
  padding: 14px;
  box-shadow: 0px 0px 0px 1px var(--ring);
}

.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-stack);
}

.split-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border-top: 1px solid var(--ring);
  border-bottom: 1px solid var(--ring);
  padding: 14px 0;
  margin: 24px 0;
}

.split-nav .nav-post {
  color: var(--text-secondary);
}

.split-nav .nav-post strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.split-nav .next {
  text-align: right;
}

.engagement-panel,
.share-panel {
  border-radius: var(--radius-12);
  padding: 18px;
  background: var(--surface);
  margin-top: 22px;
  box-shadow: var(--shadow-stack);
}

.engagement-title {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.comments-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.share-title {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.panel-block {
  margin-top: 20px;
}

.panel-form {
  margin-bottom: 18px;
}

.panel-gap-sm {
  margin-bottom: 10px;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.site-theme label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.site-theme input[type='text'],
.site-theme input[type='email'],
.site-theme input[type='password'],
.site-theme input[type='search'],
.site-theme textarea {
  width: 100%;
  border: 1px solid var(--ring);
  background: var(--surface);
  color: var(--text-primary);
  border-radius: var(--radius-8);
  padding: 10px;
  font-family: 'Inter', Arial, sans-serif;
}

.site-theme input:focus,
.site-theme textarea:focus {
  outline: none;
  box-shadow: 0px 0px 0px 2px var(--focus);
}

.share-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.share-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--ring);
  background: var(--surface);
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

.share-chip:hover {
  background: var(--surface-soft);
}
/graphify .
.related-carousel-panel {
  border-radius: var(--radius-12);
  padding: 18px;
  background: var(--surface);
  margin-top: 22px;
  box-shadow: var(--shadow-stack);
}

.related-carousel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.related-carousel-title {
  font-size: 1.2rem;
}

.related-carousel-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}

.related-carousel-track::-webkit-scrollbar {
  height: 8px;
}

.related-carousel-track::-webkit-scrollbar-thumb {
  background: #d9d9d9;
  border-radius: var(--radius-pill);
}

.related-card {
  min-width: 255px;
  max-width: 255px;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-12);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--ring);
  overflow: hidden;
  scroll-snap-align: start;
}

.related-card-image-link {
  display: block;
}

.related-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--ring);
}

.related-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  min-height: 128px;
}

.related-card-title {
  margin: 0;
  font-family: 'Cal Sans', 'Inter', sans-serif;
  font-size: 1.1rem;
  line-height: 1.25;
}

.related-card-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-read-link {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--link);
  text-decoration: underline;
}

.related-read-link:hover {
  color: var(--text-primary);
}

.post-not-found-main {
  padding: 40px 0;
}

.site-footer {
  border-top: 1px solid var(--ring);
  margin-top: 80px;
  padding: 36px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
}

.footer-title {
  margin: 0 0 8px;
  font-family: 'Cal Sans', 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.footer-note {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 0.84rem;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 1024px) {
  .story-grid.grid,
  .story-grid.story-grid--latest,
  .story-grid.story-grid--popular,
  .story-grid.story-grid--category,
  .story-grid.story-grid--random,
  .story-grid.story-grid--custom,
  .story-grid.story-grid--featured {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-banner {
    padding-top: 80px;
  }
}

@media (max-width: 900px) {
  .top-nav {
    grid-template-columns: 1fr auto;
  }

  .nav-links,
  .nav-actions {
    display: none;
  }

  .mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .user-menu-panel {
    position: static;
    margin-top: 10px;
  }
}

@media (max-width: 768px) {
  .site-shell {
    width: min(var(--site-width), calc(100% - 20px));
  }

  .top-post-carousel__track {
    padding: 8px 10px;
    gap: 10px;
  }

  .top-post-carousel__item {
    min-width: 230px;
    max-width: 300px;
  }

  .hero-banner {
    padding-top: 48px;
  }

  .hero-title {
    font-size: clamp(2.25rem, 12vw, 3rem);
  }

  .story-grid.grid,
  .story-grid.story-grid--latest,
  .story-grid.story-grid--popular,
  .story-grid.story-grid--category,
  .story-grid.story-grid--random,
  .story-grid.story-grid--custom,
  .story-grid.story-grid--featured,
  .footer-grid,
  .form-grid,
  .split-nav {
    grid-template-columns: 1fr;
  }

  .split-nav .next {
    text-align: left;
  }

  .home-section {
    padding-top: 48px;
  }

  .site-footer {
    margin-top: 48px;
  }

  .related-card {
    min-width: 220px;
    max-width: 220px;
  }
}