/* ------------------------------------------------------------
   hjLabs.in Engineering Notes — Enterprise Design System
   Palette: Navy #0A0E27 · Gold #D4AF37 · Ink #0E1526 · Paper #F7F7F5
   ------------------------------------------------------------ */

:root {
  --navy: #0A0E27;
  --navy-2: #141A35;
  --navy-3: #1F2747;
  --gold: #D4AF37;
  --gold-soft: #E5C76A;
  --ink: #0E1526;
  --ink-muted: #4A5269;
  --paper: #F7F7F5;
  --paper-2: #FBFBF9;
  --line: #E5E5E0;
  --line-dark: rgba(255, 255, 255, 0.08);

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --shadow-sm: 0 1px 2px rgba(10, 14, 39, 0.05);
  --shadow-md: 0 4px 16px rgba(10, 14, 39, 0.08);
  --shadow-lg: 0 24px 48px -12px rgba(10, 14, 39, 0.18);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--gold); }

.container { max-width: 1160px; margin: 0 auto; padding: 0 32px; }

/* ----- Header ----- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.site-brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--ink); text-decoration: none;
  font-weight: 700;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--navy); color: var(--gold);
  font-family: var(--serif); font-weight: 800; font-size: 22px;
  border-radius: 8px;
  letter-spacing: -0.02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 700; letter-spacing: -0.01em; font-size: 15.5px; }
.brand-tagline { font-size: 11.5px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  color: var(--ink); text-decoration: none;
  font-size: 14.5px; font-weight: 500;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--gold); }
.nav-cta {
  background: var(--navy); color: var(--paper) !important;
  padding: 9px 16px; border-radius: 999px;
  font-weight: 600 !important; font-size: 13.5px !important;
}
.nav-cta:hover { background: var(--gold); color: var(--navy) !important; }

/* ----- Hero ----- */
.hero {
  position: relative;
  background: linear-gradient(180deg, var(--navy) 0%, #0C1030 100%);
  color: #F4F4EF;
  padding: 96px 0 88px;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(900px 380px at 78% 20%, rgba(212, 175, 55, 0.16), transparent 60%),
    radial-gradient(700px 320px at 12% 80%, rgba(120, 160, 255, 0.08), transparent 60%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 900px; }
.hero-eyebrow {
  display: inline-block;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold);
  padding: 7px 14px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  margin-bottom: 28px;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
}
.hero-subtitle {
  font-size: 19px; line-height: 1.6;
  color: #D4D4CC;
  max-width: 680px;
  margin: 0 0 40px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
  font-size: 12.5px; font-weight: 500;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: #D4D4CC;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 24px;
  font-family: var(--sans);
  font-size: 15px; font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  transition: all 0.18s ease;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--gold); color: var(--navy);
  box-shadow: 0 8px 24px -8px rgba(212, 175, 55, 0.5);
}
.btn-primary:hover { background: var(--gold-soft); transform: translateY(-1px); color: var(--navy); box-shadow: 0 12px 32px -8px rgba(212, 175, 55, 0.65); }
.btn-secondary { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-secondary:hover { background: var(--navy); color: var(--paper); }
.btn-ghost { background: transparent; color: #F4F4EF; border: 1.5px solid rgba(255, 255, 255, 0.25); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--gold); border-color: var(--gold); }

/* ----- Article Grid (Homepage) ----- */
.articles-section { padding: 96px 0 72px; }
.section-header { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-header h2 {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--navy);
}
.section-header p {
  font-size: 17px; color: var(--ink-muted); line-height: 1.6;
  margin: 0;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}
.article-card {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--navy);
  color: inherit;
}
.article-card-cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--navy);
}
.article-card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.article-card:hover .article-card-cover img { transform: scale(1.04); }
.article-card-body { padding: 28px 28px 32px; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.article-card-meta {
  display: flex; gap: 8px;
  font-size: 12.5px; color: var(--ink-muted);
  font-weight: 500; letter-spacing: 0.02em;
}
.article-card h3 {
  font-family: var(--serif);
  font-size: 22px; font-weight: 700; line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--navy);
}
.article-card p {
  font-size: 15px; line-height: 1.6; color: var(--ink-muted);
  margin: 0 0 8px;
}
.article-card-read {
  margin-top: auto;
  font-size: 14px; font-weight: 600;
  color: var(--navy);
  transition: color 0.2s ease;
}
.article-card:hover .article-card-read { color: var(--gold); }

/* ----- CTA Block ----- */
.cta-block {
  background: var(--navy);
  color: #F4F4EF;
  padding: 72px 0;
  position: relative;
  overflow: hidden;
}
.cta-block::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(600px 220px at 70% 30%, rgba(212, 175, 55, 0.14), transparent 70%);
}
.cta-inner {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 32px;
}
.cta-text { max-width: 620px; }
.cta-text h3 {
  font-family: var(--serif);
  font-size: 32px; font-weight: 700; line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  color: #fff;
}
.cta-text p {
  font-size: 17px; color: #D4D4CC; line-height: 1.6; margin: 0;
}
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ----- Article Page ----- */
.article-hero {
  width: 100%;
  max-height: 560px;
  overflow: hidden;
  background: var(--navy);
}
.article-hero-img {
  width: 100%; max-height: 560px;
  object-fit: cover;
  object-position: center;
}
.article-container { max-width: 780px; padding-top: 56px; padding-bottom: 56px; }
.article-backlink {
  display: inline-block;
  font-size: 13.5px; font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.2s ease;
}
.article-backlink:hover { color: var(--gold); }
.article-header { margin-bottom: 48px; }
.article-title {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  color: var(--navy);
}
.article-subtitle {
  font-size: 20px; line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 28px;
  font-weight: 400;
}
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  font-size: 14px; color: var(--ink-muted);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.article-author { display: flex; align-items: center; gap: 12px; }
.author-avatar {
  width: 40px; height: 40px;
  background: var(--navy); color: var(--gold);
  font-family: var(--serif); font-weight: 800; font-size: 18px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.author-info { display: flex; flex-direction: column; line-height: 1.2; }
.author-name { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.author-role { font-size: 12.5px; color: var(--ink-muted); }
.meta-dot { color: var(--line); }
.article-tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11.5px; font-weight: 500;
  padding: 3px 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-transform: lowercase;
}

/* ----- Prose (article body) ----- */
.prose {
  font-size: 18px;
  line-height: 1.78;
  color: #1E2438;
}
.prose p { margin: 0 0 26px; }
.prose h2 {
  font-family: var(--serif);
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 56px 0 20px;
  color: var(--navy);
  scroll-margin-top: 100px;
}
.prose h3 {
  font-family: var(--serif);
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.015em;
  margin: 40px 0 16px;
  color: var(--navy);
  scroll-margin-top: 100px;
}
.prose h4 { font-size: 19px; font-weight: 700; margin: 32px 0 12px; color: var(--navy); }
.prose a { color: var(--navy); font-weight: 500; text-decoration: underline; text-decoration-color: rgba(10, 14, 39, 0.25); text-decoration-thickness: 1.5px; text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.prose a:hover { text-decoration-color: var(--gold); color: var(--gold); }
.prose strong { font-weight: 700; color: var(--navy); }
.prose em { font-style: italic; }
.prose ul, .prose ol { padding-left: 24px; margin: 0 0 26px; }
.prose li { margin-bottom: 10px; }
.prose li::marker { color: var(--gold); font-weight: 700; }
.prose blockquote {
  border-left: 4px solid var(--gold);
  padding: 6px 0 6px 24px;
  margin: 32px 0;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.5;
  font-style: italic;
  color: var(--navy);
}
.prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: #EEEEE8;
  padding: 2px 6px;
  border-radius: 4px;
  color: #29304A;
}
.prose pre {
  background: #0E1526;
  color: #E8E8E0;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 28px 0;
  font-size: 14.5px;
  line-height: 1.7;
}
.prose pre code { background: transparent; color: inherit; padding: 0; font-size: inherit; }
.prose hr {
  border: none; border-top: 1px solid var(--line);
  margin: 56px 0;
}
.prose table {
  width: 100%; border-collapse: collapse;
  margin: 32px 0;
  font-size: 15px;
}
.prose th, .prose td {
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--line);
}
.prose th { font-weight: 700; color: var(--navy); background: var(--paper-2); }
.prose img { border-radius: var(--radius-md); margin: 32px 0; box-shadow: var(--shadow-md); }

/* ----- Article Footer ----- */
.article-footer { margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--line); }
.article-share {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  font-size: 14px;
  margin-bottom: 48px;
}
.share-label { font-weight: 600; color: var(--ink-muted); }
.article-share a {
  text-decoration: none;
  padding: 6px 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  font-weight: 500;
  transition: all 0.2s;
}
.article-share a:hover { background: var(--navy); color: var(--paper); border-color: var(--navy); }

.article-author-bio {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 32px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.author-avatar-lg {
  width: 64px; height: 64px;
  background: var(--navy); color: var(--gold);
  font-family: var(--serif); font-weight: 800; font-size: 28px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.article-author-bio h4 { margin: 0 0 8px; font-size: 17px; color: var(--navy); }
.article-author-bio p { margin: 0 0 12px; font-size: 14.5px; color: var(--ink-muted); line-height: 1.6; }
.author-links { display: flex; gap: 14px; flex-wrap: wrap; }
.author-links a { font-size: 13.5px; font-weight: 600; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.author-links a:hover { color: var(--gold); }

/* ----- Footer ----- */
.site-footer {
  background: var(--navy);
  color: #D4D4CC;
  padding: 64px 0 0;
  margin-top: 48px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.3fr 2fr;
  gap: 56px;
  padding-bottom: 48px;
}
.footer-brand { max-width: 320px; }
.footer-logo {
  display: inline-flex; align-items: center; gap: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 14px;
}
.footer-tagline { font-size: 14px; line-height: 1.6; color: #8A8F9D; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.footer-col h4 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--gold);
  margin: 0 0 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: #D4D4CC; text-decoration: none; font-size: 14px; transition: color 0.2s; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px 0;
}
.footer-bottom-inner {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: #8A8F9D;
}
.footer-bottom a { color: #D4D4CC; text-decoration: underline; }
.footer-bottom a:hover { color: var(--gold); }

/* ----- Content Section (home bottom) ----- */
.content-section { padding: 64px 0; }

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .container { padding: 0 22px; }
  .site-nav { gap: 14px; }
  .site-nav a:not(.nav-cta) { display: none; }
  .hero { padding: 64px 0 56px; }
  .hero-title { font-size: 36px; }
  .hero-subtitle { font-size: 16.5px; }
  .article-grid { grid-template-columns: 1fr; gap: 20px; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .cta-text h3 { font-size: 26px; }
  .article-container { padding-top: 32px; padding-bottom: 32px; }
  .article-title { font-size: 32px; }
  .article-subtitle { font-size: 17px; }
  .prose { font-size: 16.5px; }
  .prose h2 { font-size: 26px; }
  .prose h3 { font-size: 21px; }
  .footer-inner { grid-template-columns: 1fr; gap: 40px; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom-inner { flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
