/* ============================================================
   Novion Ghost Theme — screen.css
   Brand tokens + full theme styles for blogs.novion.one
   ============================================================ */

/* -- Brand Tokens ------------------------------------------ */
:root {
  --primary:     17 17 17;
  --primary-50:  250 250 250;
  --primary-100: 244 244 245;
  --primary-200: 228 228 231;
  --primary-300: 161 161 170;
  --primary-400: 113 113 122;
  --primary-700: 39 39 42;
  --primary-800: 24 24 27;
  --primary-900: 9 9 11;

  --accent:      20 184 166;
  --accent-50:   240 253 250;
  --accent-100:  204 251 241;
  --accent-200:  153 246 228;
  --accent-700:  15 118 110;
  --accent-800:  17 94 89;

  --paper: 250 250 247;

  --ease-soft: cubic-bezier(.2, .65, .25, 1);
  --ease-out:  cubic-bezier(.22, .68, 0, 1.02);
}

/* -- Keyframes --------------------------------------------- */
@keyframes brand-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.55; transform: scale(0.92); }
}
@keyframes ring-out {
  0%   { transform: scale(.6); opacity: .8; }
  100% { transform: scale(2.4); opacity: 0; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* -- Reset + Base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  background-color: rgb(var(--paper));
  color: rgb(var(--primary));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-color: rgb(var(--paper));
  position: relative;
}

/* Paper grain overlay */
body.novion-paper-grain::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  pointer-events: none;
  z-index: 1000;
  opacity: .35;
  mix-blend-mode: multiply;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgb(var(--primary));
  line-height: 1.2;
}

p { line-height: 1.7; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

::selection { background: rgb(var(--accent-100)); color: rgb(var(--primary-800)); }
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: rgb(var(--paper)); }
::-webkit-scrollbar-thumb { background: rgb(var(--primary-200)); border-radius: 3px; }

/* -- Layout ------------------------------------------------ */
.container    { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 48rem; margin: 0 auto; padding: 0 1.5rem; }

/* -- Novion Dot -------------------------------------------- */
.novion-dot {
  position: relative; display: inline-block;
  width: 6px; height: 6px; border-radius: 999px;
  background: rgb(var(--accent));
  flex-shrink: 0;
  vertical-align: middle;
}
.novion-dot::after {
  content: ''; position: absolute; inset: -2px;
  border-radius: 999px; background: rgb(var(--accent));
  animation: ring-out 2s ease-out infinite;
}
.brand-dot { animation: brand-pulse 2.8s ease-in-out infinite; transform-origin: center; }

/* -- Dot Grid ---------------------------------------------- */
.novion-dot-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgb(var(--primary) / .07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(60% 60% at 50% 30%, black, transparent 75%);
  -webkit-mask-image: radial-gradient(60% 60% at 50% 30%, black, transparent 75%);
}

/* -- Site Header ------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid rgb(var(--primary-100));
  background-color: rgb(var(--paper) / 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.875rem 1.5rem;
}

.site-header-inner {
  max-width: 72rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}

.site-brand {
  display: flex; align-items: center; gap: 0.625rem;
  text-decoration: none;
}

.novion-mark {
  width: 2.25rem; height: 2.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / .08);
  transition: box-shadow 200ms var(--ease-soft);
  flex-shrink: 0;
}
.site-brand:hover .novion-mark {
  box-shadow: 0 4px 14px rgb(0 0 0 / .14);
}

.site-name-product {
  display: block;
  font-size: 0.875rem; font-weight: 900;
  letter-spacing: -0.02em;
  color: rgb(var(--primary));
  line-height: 1.1; margin-bottom: 0.125rem;
}
.site-name-product span { color: rgb(39 39 42); }

.site-name-sub {
  display: block;
  font-size: 0.5rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: rgb(156 163 175);
  line-height: 1;
}

.site-nav-link {
  font-size: 0.75rem; font-weight: 600;
  color: rgb(156 163 175); text-decoration: none;
  transition: color 200ms var(--ease-soft);
}
.site-nav-link:hover { color: rgb(var(--primary)); }

/* -- Hero -------------------------------------------------- */
.site-hero {
  position: relative; overflow: hidden;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}

.hero-glow-teal {
  position: absolute; top: -4rem; right: -4rem;
  width: 28rem; height: 28rem; border-radius: 50%;
  background: radial-gradient(rgb(var(--accent) / .08), transparent 70%);
  pointer-events: none;
}
.hero-glow-dark {
  position: absolute; bottom: -4rem; left: -4rem;
  width: 24rem; height: 24rem; border-radius: 50%;
  background: radial-gradient(rgb(var(--primary) / .05), transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.6875rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: rgb(var(--accent-700));
  background: rgb(var(--accent-50));
  border: 1px solid rgb(var(--accent-200));
  border-radius: 999px;
  padding: 0.375rem 0.875rem;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: rgb(var(--primary));
  margin-bottom: 1.25rem;
}
.hero-title em {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  color: rgb(var(--accent-700));
}

.hero-desc {
  max-width: 36rem; margin: 0 auto 2rem;
  font-size: 1.0625rem;
  color: rgb(var(--primary-400));
  line-height: 1.7;
}

/* -- Section Label ----------------------------------------- */
.section-label {
  font-size: 0.6875rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: rgb(var(--primary-300));
  margin-bottom: 1.5rem;
}

/* -- Post Grid --------------------------------------------- */
.post-grid-section { padding: 3rem 0 5rem; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1.5rem;
}

/* -- Post Card --------------------------------------------- */
.post-card {
  background: #fff;
  border: 1px solid rgb(var(--primary-100));
  border-radius: 1.25rem;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 18px 48px -28px rgb(var(--primary) / .14);
  transition: box-shadow 250ms var(--ease-soft), transform 250ms var(--ease-out);
  text-decoration: none; color: inherit;
}
.post-card:hover {
  box-shadow: 0 2px 4px rgb(0 0 0 / .06), 0 24px 56px -24px rgb(var(--primary) / .2);
  transform: translateY(-2px);
}

.post-card-image {
  aspect-ratio: 16 / 9; overflow: hidden;
  background: rgb(var(--primary-50));
}
.post-card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 400ms var(--ease-soft);
}
.post-card:hover .post-card-image img { transform: scale(1.03); }

.post-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  flex: 1; display: flex; flex-direction: column;
}

.post-card-tag {
  display: inline-block;
  font-size: 0.6875rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: rgb(var(--accent-700));
  margin-bottom: 0.625rem;
}

.post-card-title {
  font-size: 1.0625rem; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.3;
  color: rgb(var(--primary));
  margin-bottom: 0.5rem; flex: 1;
}

.post-card-excerpt {
  font-size: 0.875rem; color: rgb(var(--primary-400));
  line-height: 1.6; margin-bottom: 1rem;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

.post-card-meta {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  font-size: 0.75rem; color: rgb(var(--primary-300));
  font-family: 'Geist Mono', monospace;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgb(var(--primary-100));
}
.post-card-meta-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: rgb(var(--primary-200));
  flex-shrink: 0;
}

/* Featured card (spans full width) */
.post-card.featured {
  grid-column: 1 / -1;
  flex-direction: row;
}
.post-card.featured .post-card-image {
  flex: 0 0 45%; aspect-ratio: auto;
}
.post-card.featured .post-card-body {
  padding: 2rem; justify-content: center;
}
.post-card.featured .post-card-title { font-size: 1.375rem; }

.featured-badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: 0.625rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: rgb(var(--accent-700));
  background: rgb(var(--accent-50));
  border: 1px solid rgb(var(--accent-200));
  border-radius: 999px; padding: 0.25rem 0.625rem;
  margin-bottom: 0.75rem;
}

/* -- Pagination -------------------------------------------- */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; padding: 2.5rem 0;
}

.pagination-btn {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: 0.875rem; font-weight: 500;
  color: rgb(var(--primary));
  background: #fff; border: 1px solid rgb(var(--primary-100));
  border-radius: 0.75rem; padding: 0.625rem 1.25rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / .04);
  text-decoration: none;
  transition: box-shadow 200ms var(--ease-soft), border-color 200ms;
}
.pagination-btn:hover {
  border-color: rgb(var(--primary-200));
  box-shadow: 0 2px 8px rgb(0 0 0 / .08);
}

.pagination-count {
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem; color: rgb(var(--primary-300));
}

/* -- Post Header ------------------------------------------- */
.post-header { padding: 4rem 0 2rem; }
.post-header-inner { max-width: 48rem; margin: 0 auto; padding: 0 1.5rem; }

.post-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }

.post-tag {
  font-size: 0.6875rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: rgb(var(--accent-700));
  background: rgb(var(--accent-50));
  border: 1px solid rgb(var(--accent-200));
  border-radius: 999px; padding: 0.25rem 0.75rem;
  text-decoration: none;
  transition: background 200ms var(--ease-soft);
}
.post-tag:hover { background: rgb(var(--accent-100)); }

.post-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 900; letter-spacing: -0.04em; line-height: 1.1;
  color: rgb(var(--primary));
  margin-bottom: 1.25rem;
}
.post-title em {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic; color: rgb(var(--accent-700));
}

.post-meta {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  font-size: 0.8125rem; color: rgb(var(--primary-300));
  font-family: 'Geist Mono', monospace;
}
.post-meta-author {
  color: rgb(var(--primary-400));
  font-family: 'Geist', sans-serif; font-weight: 500;
}
.post-meta-sep {
  width: 3px; height: 3px; border-radius: 50%;
  background: rgb(var(--primary-200)); flex-shrink: 0;
}

/* -- Post Feature Image ------------------------------------ */
.post-feature-image {
  max-width: 56rem; margin: 0 auto 3rem;
  padding: 0 1.5rem;
}
.post-feature-image img {
  width: 100%; border-radius: 1rem;
  box-shadow: 0 2px 4px rgb(0 0 0 / .06), 0 24px 56px -24px rgb(var(--primary) / .18);
}

/* -- Post Content (Prose) ---------------------------------- */
.post-content {
  max-width: 48rem; margin: 0 auto; padding: 0 1.5rem 4rem;
  font-size: 1.0625rem; line-height: 1.75; color: rgb(24 24 27);
}

.post-content h2 {
  font-size: 1.625rem; font-weight: 700; letter-spacing: -0.025em;
  margin: 2.5rem 0 1rem; color: rgb(var(--primary));
}
.post-content h3 {
  font-size: 1.3125rem; font-weight: 700; letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem; color: rgb(var(--primary));
}
.post-content h4 {
  font-size: 1.125rem; font-weight: 600;
  margin: 1.5rem 0 0.625rem; color: rgb(var(--primary));
}
.post-content p { margin-bottom: 1.5rem; }
.post-content a {
  color: rgb(var(--accent-700));
  text-decoration: underline; text-underline-offset: 3px;
}
.post-content a:hover { color: rgb(var(--accent-800)); }
.post-content strong { font-weight: 700; color: rgb(var(--primary)); }
.post-content ul, .post-content ol { margin: 1.5rem 0; padding-left: 1.75rem; }
.post-content li { margin-bottom: 0.5rem; }
.post-content blockquote {
  border-left: 3px solid rgb(var(--accent));
  margin: 2rem 0; padding: 1rem 1.5rem;
  background: rgb(var(--accent-50));
  border-radius: 0 0.75rem 0.75rem 0;
  font-style: italic; color: rgb(var(--primary-700));
}
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content pre {
  background: rgb(var(--primary-900));
  border-radius: 0.75rem; padding: 1.5rem;
  overflow-x: auto; margin: 2rem 0;
}
.post-content code {
  font-family: 'Geist Mono', monospace; font-size: 0.875em;
  background: rgb(var(--primary-100));
  padding: 0.1em 0.4em; border-radius: 0.25rem;
}
.post-content pre code {
  background: none; padding: 0;
  color: rgb(var(--paper)); font-size: 0.875rem; line-height: 1.7;
}
.post-content img {
  border-radius: 0.75rem; margin: 2rem 0;
  box-shadow: 0 1px 3px rgb(0 0 0 / .08);
}
.post-content hr {
  border: none; border-top: 1px solid rgb(var(--primary-100)); margin: 3rem 0;
}
.post-content figure { margin: 2rem 0; }
.post-content figcaption {
  text-align: center; font-size: 0.8125rem;
  color: rgb(var(--primary-300)); margin-top: 0.75rem; font-style: italic;
}
.post-content table {
  width: 100%; border-collapse: collapse; margin: 2rem 0;
  font-size: 0.9375rem;
}
.post-content th {
  background: rgb(var(--primary-50));
  font-weight: 600; text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid rgb(var(--primary-100));
}
.post-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgb(var(--primary-100));
}

/* Ghost kg card overrides */
.kg-width-wide {
  margin-left: -4rem; margin-right: -4rem;
}
.kg-width-full {
  margin-left: calc(50% - 50vw + 1.5rem);
  margin-right: calc(50% - 50vw + 1.5rem);
}

/* -- Author Card ------------------------------------------- */
.post-author {
  max-width: 48rem; margin: 0 auto; padding: 0 1.5rem 2rem;
}
.post-author-inner {
  display: flex; align-items: center; gap: 1.25rem;
  background: #fff; border: 1px solid rgb(var(--primary-100));
  border-radius: 1rem; padding: 1.5rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / .04);
}
.post-author-avatar {
  width: 3.5rem; height: 3.5rem; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  background: rgb(var(--primary-100));
}
.post-author-name {
  font-size: 0.9375rem; font-weight: 700;
  color: rgb(var(--primary)); margin-bottom: 0.25rem;
}
.post-author-bio {
  font-size: 0.875rem; color: rgb(var(--primary-400)); line-height: 1.6;
}

/* -- Post Navigation --------------------------------------- */
.post-nav {
  max-width: 48rem; margin: 0 auto 4rem; padding: 0 1.5rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.post-nav-card {
  background: #fff; border: 1px solid rgb(var(--primary-100));
  border-radius: 0.875rem; padding: 1rem 1.25rem;
  text-decoration: none; color: inherit;
  transition: box-shadow 200ms var(--ease-soft), border-color 200ms;
}
.post-nav-card:hover {
  border-color: rgb(var(--primary-200));
  box-shadow: 0 2px 12px rgb(0 0 0 / .08);
}
.post-nav-label {
  font-size: 0.625rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: rgb(var(--primary-300)); margin-bottom: 0.375rem;
}
.post-nav-title {
  font-size: 0.875rem; font-weight: 600;
  line-height: 1.4; color: rgb(var(--primary));
}
.post-nav-card.next { text-align: right; }

/* -- Archive (Tag / Author) -------------------------------- */
.archive-header { padding: 4rem 0 3rem; text-align: center; }
.archive-title {
  font-size: 2rem; font-weight: 900; letter-spacing: -0.035em; margin-bottom: 0.75rem;
}
.archive-desc {
  font-size: 1rem; color: rgb(var(--primary-400));
  max-width: 32rem; margin: 0 auto;
  line-height: 1.7;
}
.archive-count {
  display: inline-block; margin-top: 1rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem; color: rgb(var(--primary-300));
}
.archive-avatar {
  width: 5rem; height: 5rem; border-radius: 50%;
  object-fit: cover; margin: 0 auto 1rem;
  border: 3px solid rgb(var(--primary-100));
}

/* -- Footer ------------------------------------------------ */
.site-footer {
  border-top: 1px solid rgb(var(--primary-100));
  padding: 2.5rem 1.5rem;
  margin-top: 5rem;
}
.site-footer-inner {
  max-width: 72rem; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.site-footer-brand {
  display: flex; align-items: center; gap: 0.5rem; text-decoration: none;
}
.site-footer-mark {
  width: 1.75rem; height: 1.75rem; border-radius: 0.5rem;
}
.site-footer-name {
  font-size: 0.8125rem; font-weight: 700;
  letter-spacing: -0.02em; color: rgb(var(--primary));
}
.site-footer-copy {
  font-size: 0.75rem; color: rgb(var(--primary-300));
  font-family: 'Geist Mono', monospace;
}
.site-footer-links { display: flex; gap: 1.25rem; align-items: center; }
.site-footer-link {
  font-size: 0.8125rem; color: rgb(var(--primary-300));
  text-decoration: none;
  transition: color 200ms var(--ease-soft);
}
.site-footer-link:hover { color: rgb(var(--primary)); }

/* -- Error Pages ------------------------------------------- */
.error-page { text-align: center; padding: 8rem 1.5rem; }
.error-code {
  font-family: 'Geist Mono', monospace;
  font-size: 5rem; font-weight: 900;
  color: rgb(var(--primary-100)); line-height: 1;
  margin-bottom: 1rem;
}
.error-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.75rem; }
.error-desc { color: rgb(var(--primary-400)); margin-bottom: 2rem; }
.error-btn {
  display: inline-flex; align-items: center;
  background: rgb(var(--primary)); color: rgb(var(--paper));
  border-radius: 0.875rem; padding: 0.75rem 1.75rem;
  font-size: 0.9375rem; font-weight: 600;
  text-decoration: none;
  transition: opacity 200ms var(--ease-soft);
}
.error-btn:hover { opacity: 0.88; }

/* -- Responsive -------------------------------------------- */
@media (max-width: 768px) {
  .post-card.featured { flex-direction: column; }
  .post-card.featured .post-card-image { flex: none; aspect-ratio: 16 / 9; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-card.next { text-align: left; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; }
  .post-grid { grid-template-columns: 1fr; }
  .kg-width-wide { margin-left: 0; margin-right: 0; }
}

@media (max-width: 480px) {
  .site-hero { padding: 3rem 1.5rem 2.5rem; }
  .post-header { padding: 2.5rem 0 1.5rem; }
  .post-author-inner { flex-direction: column; text-align: center; }
}
