/* KORTEX — PATCH STYLES v1.0
   Drop this under kortex_theme.css if you don't want to replace the full stylesheet.
   It fixes heading selector mismatches, article pages, validation states and shared utilities.
*/
body {
  opacity: 0;
  transition: opacity 0.45s ease;
}

body.is-ready {
  opacity: 1;
}

.nav-links a {
  color: var(--text-muted);
}

.hero-subtitle,
.section-subtitle,
.blog-card p,
.feature-card p,
.pipeline-step p,
.faq-item p,
.footer-tagline,
.price-period,
.contact-method-label {
  color: var(--text-secondary);
}

.pipeline-step h2,
.feature-card h3,
.blog-card h2,
.pricing-card h2,
.faq-item h3,
.article-header h1,
.article-content h2,
.article-content h3 {
  font-family: var(--ff-display);
  color: var(--white);
}

.pipeline-step h2,
.feature-card h3,
.blog-card h2,
.pricing-card h2,
.faq-item h3 {
  font-size: 26px;
  font-style: italic;
  margin-bottom: 14px;
}

.blog-card h2 {
  line-height: 1.2;
}

.faq-item h3 {
  font-size: 20px;
}

.article-shell {
  width: min(900px, 90%);
  margin: 0 auto;
}

.article-header {
  padding-bottom: 36px;
  border-bottom: 1px solid var(--edge);
  margin-bottom: 44px;
}

.article-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.article-kicker,
.article-time,
.article-pill {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 2px;
  border: 1px solid var(--edge);
  background: var(--surface);
}

.article-kicker {
  color: var(--primary);
  border-color: rgba(229, 9, 20, 0.25);
  background: rgba(229, 9, 20, 0.08);
}

.article-pill {
  color: var(--secondary);
  border-color: rgba(139, 92, 246, 0.25);
  background: rgba(139, 92, 246, 0.08);
}

.article-header h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 300;
  line-height: 0.98;
  margin-bottom: 18px;
}

.article-header h1 em {
  font-style: italic;
  background: linear-gradient(135deg, var(--secondary), #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.article-lead {
  font-family: var(--ff-display);
  font-size: clamp(18px, 2vw, 24px);
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 760px;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 40px;
}

.article-content {
  min-width: 0;
}

.article-content p,
.article-content li {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-primary);
}

.article-content p+p,
.article-content ul+p,
.article-content ol+p,
.article-content h2,
.article-content h3,
.article-content blockquote,
.article-content pre,
.article-content .callout,
.article-content .metric-strip {
  margin-top: 28px;
}

.article-content h2 {
  font-size: clamp(28px, 3vw, 40px);
  font-style: italic;
  margin-bottom: 10px;
}

.article-content h3 {
  font-size: 24px;
  font-style: italic;
  margin-bottom: 8px;
}

.article-content ul,
.article-content ol {
  padding-left: 20px;
}

.article-content li+li {
  margin-top: 10px;
}

.article-content strong {
  color: var(--white);
}

.article-content blockquote {
  border-left: 2px solid var(--secondary);
  padding: 18px 22px;
  background: rgba(139, 92, 246, 0.06);
  color: var(--text-primary);
  font-family: var(--ff-display);
  font-size: 22px;
  font-style: italic;
}

.callout,
.metric-strip,
.authority-box {
  background: var(--surface);
  border: 1px solid var(--edge);
  padding: 24px;
  border-radius: 2px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--edge);
  padding: 2px;
}

.metric-strip .metric {
  background: var(--surface);
  padding: 20px;
  text-align: center;
}

.metric-strip .metric strong {
  display: block;
  font-family: var(--ff-display);
  font-size: 36px;
  line-height: 1;
  margin-bottom: 8px;
}

.metric-strip .metric span {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.article-aside {
  position: sticky;
  top: 110px;
  height: fit-content;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--edge);
  padding: 24px;
  border-radius: 2px;
}

.toc h4 {
  font-family: var(--ff-mono);
  color: var(--primary);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  margin-bottom: 16px;
}

.toc ul {
  list-style: none;
  padding-left: 0;
}

.toc li+li {
  margin-top: 10px;
}

.toc a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
}

.toc a:hover {
  color: var(--white);
}

.inline-cta {
  margin-top: 36px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(229, 9, 20, 0.08), rgba(139, 92, 246, 0.06));
  border: 1px solid rgba(229, 9, 20, 0.22);
}

.field-invalid {
  border-color: rgba(229, 9, 20, 0.6) !important;
  box-shadow: 0 0 16px rgba(229, 9, 20, 0.15) !important;
}

.field-valid {
  border-color: rgba(139, 92, 246, 0.4) !important;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.1) !important;
}

.yt-preview {
  margin-top: 12px;
  padding: 12px;
  background: var(--card);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 2px;
  display: flex;
  gap: 12px;
  align-items: center;
  animation: slideIn 0.3s ease;
}

@media (max-width: 980px) {
  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-aside {
    position: static;
  }
}

@media (max-width: 768px) {
  .metric-strip {
    grid-template-columns: 1fr;
  }
}

/* =========================
   PORTAL LAYOUT
   ========================= */

.portal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.portal-main {
  padding: 72px 80px;
}

/* Sidebar */
.portal-sidebar {
  background: linear-gradient(
    180deg,
    rgba(10,10,15,0.98),
    rgba(5,5,7,1)
  );
  border-right: 1px solid var(--edge);
  padding: 32px;
}

.portal-logo {
  font-family: var(--ff-ui);
  font-weight: 800;
  letter-spacing: 0.14em;
  margin-bottom: 48px;
}

.portal-nav a {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.portal-nav a.active,
.portal-nav a:hover {
  color: var(--white);
}

.portal-footer {
  margin-top: auto;
  padding-top: 32px;
  font-size: 11px;
}
