/* ==========================================================================
   Creator Toolkit — Blog
   Uses the same brand tokens as home-v2.css, but a distinct editorial layout:
   masthead strip, featured post, topic filter pills, magazine grid.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root{
  --bg:            #0D1117;
  --bg-elevated:   #10151C;
  --card:          #161B22;
  --card-hover:    #1C222B;
  --border:        rgba(255,255,255,0.07);
  --border-soft:   rgba(255,255,255,0.04);

  --primary:       #6C63FF;
  --primary-soft:  rgba(108,99,255,0.14);
  --accent:        #00D4FF;
  --accent-soft:   rgba(0,212,255,0.12);

  --text:          #F3F5F7;
  --text-secondary:#8B93A1;
  --text-faint:    #5B6472;
  --text-body:     #C9CDD4;

  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 24px;
  --r-xl: 28px;
  --r-pill: 999px;

  --shadow-sm: 0 2px 10px rgba(0,0,0,0.28);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.34);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.4);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*{ box-sizing: border-box; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a{ text-decoration: none; color: inherit; }

h1, h2, h3{
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  margin: 0;
  letter-spacing: -0.01em;
}

::selection{ background: var(--primary-soft); color: var(--text); }

/* Masthead accent strip */
.mast-strip{
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  background-size: 200% 100%;
  animation: mast-shift 6s linear infinite;
}
@keyframes mast-shift{
  0%{ background-position: 0% 0; }
  100%{ background-position: 200% 0; }
}

body::before{
  content:"";
  position: fixed;
  top: -160px; left: 50%;
  width: 640px; height: 380px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0,212,255,0.14), rgba(108,99,255,0.06) 55%, transparent 80%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

.site-bar{
  position: sticky;
  top: 0;
  z-index: 30;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(13,17,23,0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
}

.brand{
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 16px;
}
.brand span{ color: var(--accent); }

.back-link{
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color .18s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.back-link:hover{ color: var(--accent); }

main{
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 24px 90px;
}

/* ---------- Hero / masthead ---------- */
.hero{ margin-bottom: 36px; max-width: 640px; }

.eyebrow{
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
}

.hero h1{
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 700;
  margin: 0 0 14px;
}

.hero-sub{
  color: var(--text-secondary);
  font-size: 1.02rem;
  max-width: 56ch;
  margin: 0;
  line-height: 1.65;
}

/* ---------- Topic filter pills ---------- */
.topics{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.topic-pill{
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 7px 14px;
  cursor: pointer;
  transition: all .16s var(--ease);
}
.topic-pill:hover{
  color: var(--text);
  border-color: rgba(255,255,255,0.16);
  transform: translateY(-1px);
}
.topic-pill.active{
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* ---------- Featured post ---------- */
.featured-card{
  display: block;
  position: relative;
  background: linear-gradient(155deg, var(--card) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px;
  margin-bottom: 40px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.featured-card::after{
  content:"";
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(closest-side, var(--primary-soft), transparent 75%);
  pointer-events: none;
}
.featured-card:hover{
  transform: translateY(-5px);
  border-color: rgba(255,255,255,0.18);
  box-shadow: var(--shadow-lg);
}

.featured-label{
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.featured-label::before{
  content:"";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.featured-card h2{
  position: relative;
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 12px;
  max-width: 34ch;
}

.featured-card p{
  position: relative;
  color: var(--text-secondary);
  font-size: 0.98rem;
  max-width: 58ch;
  margin: 0 0 20px;
}

.featured-card .card-meta{
  position: relative;
}

/* ---------- Grid feed ---------- */
.feed{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.post-card{
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: block;
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}

.post-card::before{
  content:"";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}

.post-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255,255,255,0.16);
  background: var(--card-hover);
}
.post-card:hover::before{ transform: scaleX(1); }

.tag-row{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag-chip{
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--primary-soft);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  letter-spacing: 0.01em;
}

.post-card h2{
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 10px;
  line-height: 1.35;
  transition: color .18s var(--ease);
}
.post-card:hover h2{ color: var(--accent); }

.post-card p, .featured-card p{
  color: var(--text-secondary);
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.card-meta{
  font-size: 12.5px;
  color: var(--text-faint);
  font-weight: 500;
  display: flex;
  align-items: center;
}
.card-meta .dot{ margin: 0 6px; }

.empty-state{
  color: var(--text-secondary);
  padding: 40px 0;
  font-size: 14px;
  text-align: center;
}

/* ---------- Individual post page ---------- */
.post{
  animation: post-in .5s var(--ease);
}
@keyframes post-in{
  from{ opacity: 0; transform: translateY(8px); }
  to{ opacity: 1; transform: translateY(0); }
}

.post > .eyebrow{ margin-bottom: 18px; }

.post h1{
  font-size: clamp(1.9rem, 4.4vw, 2.6rem);
  margin: 0 0 20px;
  font-weight: 700;
  line-height: 1.18;
  max-width: 26ch;
}

.post-meta{
  font-size: 13px;
  color: var(--text-faint);
  font-weight: 500;
  margin: 0 0 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-body{
  font-size: 1.05rem;
  max-width: 70ch;
}

.post-body h2{
  font-size: 1.4rem;
  margin-top: 44px;
  margin-bottom: 14px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  scroll-margin-top: 80px;
}

.post-body h3{
  font-size: 1.15rem;
  margin-top: 30px;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text);
  scroll-margin-top: 80px;
}

.post-body p{
  color: var(--text-body);
  margin: 0 0 18px;
  line-height: 1.75;
}

.post-body > p:first-of-type{
  font-size: 1.12rem;
  color: var(--text);
}

.post-body strong{ color: var(--text); font-weight: 600; }
.post-body em{ color: var(--text-secondary); }

.post-body a{
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(0,212,255,0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color .18s var(--ease);
}
.post-body a:hover{ text-decoration-color: var(--accent); }

.post-body code{
  font-family: ui-monospace, 'JetBrains Mono', monospace;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.88em;
  color: var(--accent);
}

.post-body pre{
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 24px 0;
}
.post-body pre code{
  background: none;
  border: none;
  padding: 0;
  color: var(--text-body);
}

.post-body blockquote{
  border-left: 3px solid var(--primary);
  margin: 28px 0;
  padding: 14px 22px;
  color: var(--text-secondary);
  background: var(--primary-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 1rem;
}
.post-body blockquote p:last-child{ margin-bottom: 0; }

.post-body ul, .post-body ol{
  color: var(--text-body);
  padding-left: 22px;
  margin: 0 0 20px;
}
.post-body li{ margin-bottom: 10px; line-height: 1.65; }
.post-body li::marker{ color: var(--accent); }

.post-body hr{
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

.post-body img{
  max-width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin: 24px 0;
  display: block;
}

.post-body table{
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.94rem;
}
.post-body th, .post-body td{
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.post-body th{
  background: var(--card);
  color: var(--text);
  font-weight: 600;
}
.post-body td{ color: var(--text-body); }

/* Closing CTA line at end of posts (italic paragraph pattern) */
.post-body > p:last-child em,
.post-body > hr + p em{
  color: var(--text-secondary);
}

/* ---------- Like button ---------- */
.like-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 44px;
  padding: 10px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all .18s var(--ease);
}
.like-btn:hover{
  color: var(--text);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}
.like-btn:disabled{ opacity: 0.7; cursor: default; transform: none; }

.like-btn .like-icon{
  font-size: 18px;
  line-height: 1;
  transition: transform .2s var(--ease);
}
.like-btn.liked{
  color: #FF5C7A;
  background: rgba(255,92,122,0.1);
  border-color: rgba(255,92,122,0.3);
}
.like-btn.liked .like-icon{
  transform: scale(1.15);
}

.site-footer{
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 24px;
  color: var(--text-faint);
  font-size: 12.5px;
  border-top: 1px solid var(--border-soft);
}
.site-footer a{ color: var(--text-secondary); transition: color .18s var(--ease); }
.site-footer a:hover{ color: var(--accent); }

@media (max-width: 720px){
  .feed{ grid-template-columns: 1fr; }
  .featured-card{ padding: 26px; }
}

@media (max-width: 600px){
  main{ padding: 36px 16px 70px; }
  .post-card{ padding: 18px; }
  .post-body{ font-size: 1rem; }
}
