/* ============================================================
   NodePhase — Kennisbank / Blog styles
   Shares the design tokens of the homepage, adds prose layout.
   ============================================================ */

:root {
  --bg: #0a0f1a;
  --bg-2: #0d1424;
  --panel: rgba(13, 20, 36, 0.62);
  --fg: #eef3fb;
  --muted: #93a3be;
  --muted-dim: rgba(146, 170, 210, 0.62);
  --cyan: #00d5ff;
  --teal: #20e6b0;
  --border: rgba(146, 170, 210, 0.14);
  --border-lit: rgba(146, 170, 210, 0.26);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 90% 55% at 70% 6%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 55% at 70% 6%, #000 30%, transparent 100%);
  opacity: 0.45;
  z-index: 0;
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 84% 4%, rgba(0, 213, 255, 0.14), transparent 40%),
    radial-gradient(circle at 4% 92%, rgba(32, 230, 176, 0.1), transparent 44%);
  z-index: 0;
  pointer-events: none;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.wrap.wide { max-width: 1080px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 0.5rem;
  position: relative;
  z-index: 1;
}
.topbar-in {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}
.brand svg { display: block; }
.topbar .link {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.topbar .link:hover { color: var(--fg); border-color: var(--border-lit); }

/* ---------- Breadcrumb ---------- */
.crumb {
  font-size: 0.82rem;
  color: var(--muted-dim);
  padding: 2rem 0 0.4rem;
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--fg); }
.crumb .sep { opacity: 0.6; }

/* ---------- Blog index ---------- */
.hub-head {
  padding: clamp(2.4rem, 6vh, 4rem) 0 clamp(1.6rem, 4vh, 2.6rem);
  max-width: 44rem;
}
.eyebrow {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.9rem;
}
.hub-head h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}
.hub-head h1 .grad {
  background: linear-gradient(100deg, var(--cyan), var(--teal));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hub-head p { color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.15rem); }

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
  padding-bottom: 3rem;
}
.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 16px;
  padding: 1.5rem 1.5rem 1.6rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--border-lit); transform: translateY(-3px); }
.card .tag {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.7rem;
}
.card h2 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 0.55rem;
}
.card p { font-size: 0.92rem; color: var(--muted); margin-bottom: 1.1rem; }
.card .more {
  margin-top: auto;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.card:hover .more svg { transform: translateX(3px); }
.card .more svg { transition: transform 0.18s ease; }

/* ---------- Article ---------- */
article.post {
  padding: 1.4rem 0 2rem;
}
.post-head { margin-bottom: 2.2rem; }
.post-head .meta {
  font-size: 0.82rem;
  color: var(--muted-dim);
  margin-bottom: 1rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
.post-head .meta .dot { opacity: 0.5; }
.post-head h1 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}
.post-head .standfirst {
  font-size: clamp(1.05rem, 1.7vw, 1.22rem);
  color: var(--muted);
  line-height: 1.6;
}

.prose { font-size: 1.04rem; color: #dbe4f2; }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.8vw, 1.75rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 2.6rem;
  margin-bottom: 0.2rem;
  color: var(--fg);
  scroll-margin-top: 1.5rem;
}
.prose h3 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin-top: 1.8rem;
  color: var(--fg);
}
.prose p { color: #cdd8ea; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid var(--border-lit);
  transition: border-color 0.18s ease;
}
.prose a:hover { border-color: var(--cyan); }
.prose ul, .prose ol { padding-left: 1.3rem; color: #cdd8ea; }
.prose li { margin-top: 0.5rem; }
.prose li::marker { color: var(--teal); }

.prose blockquote {
  border-left: 2px solid var(--teal);
  background: rgba(32, 230, 176, 0.06);
  border-radius: 0 10px 10px 0;
  padding: 0.9rem 1.2rem;
  color: var(--fg);
  font-size: 1.06rem;
}

.callout {
  border: 1px solid var(--border-lit);
  background: radial-gradient(ellipse 120% 130% at 100% 0%, rgba(0, 213, 255, 0.08), transparent 55%), var(--panel);
  border-radius: 14px;
  padding: 1.2rem 1.35rem;
  margin-top: 1.6rem;
}
.callout .k {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.4rem;
}
.callout p { color: var(--muted); font-size: 0.96rem; }

/* Key-takeaways box */
.tldr {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 14px;
  padding: 1.3rem 1.45rem;
  margin: 1.8rem 0 2.4rem;
}
.tldr .k {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.7rem;
}
.tldr ul { list-style: none; padding: 0; }
.tldr li { position: relative; padding-left: 1.4rem; margin-top: 0.55rem; color: #cdd8ea; font-size: 0.98rem; }
.tldr li::before {
  content: "→";
  position: absolute; left: 0;
  color: var(--cyan);
  font-weight: 700;
}

/* FAQ block */
.faq { margin-top: 2.6rem; }
.faq h2 { margin-bottom: 1.2rem; }
.faq details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: 0 1.1rem;
  margin-top: 0.7rem;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 0;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--cyan);
  font-size: 1.3rem;
  font-weight: 400;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); font-size: 0.96rem; padding-bottom: 1.1rem; }

/* End CTA */
.post-cta {
  border: 1px solid var(--border-lit);
  border-radius: 20px;
  background: radial-gradient(ellipse 120% 130% at 100% 0%, rgba(0, 213, 255, 0.1), transparent 55%), var(--panel);
  padding: clamp(1.8rem, 4vw, 2.6rem);
  text-align: center;
  margin: 3rem 0 1rem;
}
.post-cta h2 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
}
.post-cta p { color: var(--muted); max-width: 32rem; margin: 0 auto 1.6rem; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #05131a;
  text-decoration: none;
  background: linear-gradient(100deg, var(--cyan), var(--teal));
  border-radius: 12px;
  padding: 0.9rem 1.6rem;
  transition: transform 0.18s ease, box-shadow 0.25s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0, 213, 255, 0.28); }
.cta svg { transition: transform 0.18s ease; }
.cta:hover svg { transform: translateX(3px); }
/* Keep the CTA's dark text + no underline even inside .prose (which colours links cyan) */
.prose a.cta,
.prose a.cta:hover { color: #05131a; border-bottom: 0; }

/* Related */
.related { margin: 2.6rem 0 1rem; }
.related .k {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin-bottom: 1rem;
}
.related-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.related-list a {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: var(--fg);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 0.96rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.related-list a:hover { border-color: var(--border-lit); transform: translateY(-2px); }

/* ---------- Author card ---------- */
.author {
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  margin: 2.6rem 0 1rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 14px;
}
.author .av {
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-lit);
  background: rgba(0, 213, 255, 0.08);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem; font-weight: 600;
  color: var(--cyan);
}
.author .k {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin-bottom: 0.35rem;
}
.author .name { font-weight: 600; color: var(--fg); }
.author p { font-size: 0.92rem; color: var(--muted); margin-top: 0.35rem; }
.author a { color: var(--cyan); text-decoration: none; border-bottom: 1px solid var(--border-lit); }
.author a:hover { color: var(--fg); }

/* ---------- Footer ---------- */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}
.foot-in {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 0 2.4rem;
  font-size: 0.83rem;
  color: var(--muted-dim);
  max-width: 1080px;
  margin: 0 auto;
}
.foot-in a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); }
.foot-in a:hover { color: var(--fg); }
.foot-in .links { display: flex; gap: 1.2rem; flex-wrap: wrap; }

@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
  .related-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
