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

:root {
  --fg: hsl(0 0% 8%);
  --muted: hsl(0 0% 42%);
  --muted-bg: hsl(0 0% 96.5%);
  --border: hsl(0 0% 88%);
  --bg: hsl(0 0% 100%);
  --accent: hsl(0 0% 9%);
  --accent-fg: hsl(0 0% 98%);
  --brand: #0f2669;
  --brand-dark: #0a1c4d;
  --brand-light: #e6eaf5;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--fg);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── LAYOUT ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.section { padding: 80px 0; }
.section-alt { background: var(--muted-bg); }

/* ── NAVBAR ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.navbar-brand {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.navbar-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.navbar-links a:hover { color: var(--brand-dark); }

.navbar-links .nav-cta {
  color: var(--brand);
  font-weight: 600;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--fg);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 56px; left: 0; right: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px 24px;
  z-index: 99;
}

.mobile-menu.open { display: block; }

.mobile-menu a {
  display: block;
  padding: 12px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.mobile-menu a:last-child { border-bottom: none; }

/* ── TYPOGRAPHY ── */
h1 {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

h2 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.muted { color: var(--muted); }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand);
  color: #fff;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(15,38,105,0.3);
}
.btn-primary:hover { background: var(--brand-dark); box-shadow: 0 4px 12px rgba(15,38,105,0.35); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--fg);
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-outline:hover { background: var(--muted-bg); }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid var(--brand);
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-dark);
  background: var(--brand-light);
}

/* ── SECTION HEADER ── */
.section-header { margin-bottom: 40px; }

.section-header h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--brand);
  border-radius: 2px;
  margin-top: 12px;
}

.section-header p {
  color: var(--muted);
  font-size: 16px;
  margin-top: 12px;
  max-width: 600px;
  line-height: 1.7;
}

/* ── HERO ── */
.hero {
  padding: 120px 0 80px;
  background: var(--muted-bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
}

.hero-content { max-width: 680px; }

.hero-photo-wrap { display: flex; justify-content: center; }

.hero-photo {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 6px var(--brand-light), 0 0 0 8px var(--brand);
}

.hero h1 { margin: 20px 0 0; }

.hero-desc {
  color: var(--muted);
  font-size: 18px;
  margin: 20px 0 32px;
  max-width: 600px;
  line-height: 1.7;
}

.hero-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── TIMELINE ── */
.timeline {
  position: relative;
  padding-left: 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 40px 32px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -1px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--brand);
}

.timeline-item.highlight .timeline-dot {
  background: var(--brand);
}

.timeline-year {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-dark);
  margin-bottom: 4px;
}

.timeline-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
}

.timeline-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}

/* ── PROJECTS GRID ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  display: block;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.project-card--beforbuild {
  border-color: #178459;
  border-width: 2px;
}

.project-card--buildoto {
  border-color: #dae706;
  border-width: 2px;
}

.project-card.highlight {
  border-color: var(--brand);
  border-width: 2px;
}

.project-logo-wrap {
  height: 64px;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.project-logo {
  max-height: 64px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

.project-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-dark);
  background: var(--brand-light);
  border-radius: 4px;
  padding: 3px 8px;
  margin-bottom: 12px;
}

.project-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}

.project-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.project-stack {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}

.project-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── ARTICLE GRID (homepage) ── */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.article-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.article-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }

.article-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-dark);
  background: var(--brand-light);
  border-radius: 4px;
  padding: 3px 8px;
  margin-bottom: 12px;
  align-self: flex-start;
}

.article-card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.35;
  margin-bottom: 10px;
}

.article-card-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
}

.article-meta {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-meta-read {
  color: var(--brand);
  font-weight: 500;
}

/* ── ARTICLE PAGE ── */
.article-hero {
  padding: 100px 0 56px;
  background: var(--muted-bg);
  border-bottom: 1px solid var(--border);
}

.article-hero-inner { max-width: 800px; }

.article-hero .article-tag { margin-bottom: 20px; }

.article-hero h1 {
  font-size: 40px;
  margin-bottom: 16px;
  line-height: 1.15;
}

.article-hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
  flex-wrap: wrap;
}

.article-hero-meta span { display: flex; align-items: center; gap: 6px; }

.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 32px 80px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--fg);
}

.article-body h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 56px 0 16px;
  color: var(--fg);
}

.article-body h2::after {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  background: var(--brand);
  border-radius: 2px;
  margin-top: 10px;
}

.article-body h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 36px 0 12px;
  color: var(--fg);
}

.article-body p { margin-bottom: 20px; }
.article-body p:last-child { margin-bottom: 0; }

.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.article-body li { margin-bottom: 8px; line-height: 1.7; }

.article-body strong { font-weight: 600; }

.article-body a { color: var(--brand); text-decoration: underline; }
.article-body a:hover { color: var(--brand-dark); }
.article-body .btn-primary { color: #fff; text-decoration: none; }
.article-body .btn-primary:hover { color: #fff; }

.article-body code {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 14px;
  background: var(--muted-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

.article-body pre {
  background: hsl(0 0% 96%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
}

.article-body blockquote {
  border-left: 3px solid var(--brand);
  padding-left: 20px;
  margin: 28px 0;
  font-style: italic;
  color: var(--muted);
}

.article-callout {
  background: var(--brand-light);
  border: 1px solid rgba(49,140,231,0.2);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 28px 0;
  font-size: 15px;
  line-height: 1.7;
}

.article-callout strong { color: var(--brand-dark); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.15s;
}

.back-link:hover { color: var(--fg); }

.article-cta {
  background: var(--muted-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  margin-top: 56px;
  text-align: center;
}

.article-cta-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.article-cta-desc {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 20px;
  line-height: 1.7;
}

.article-nav {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 32px 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 40px;
}

.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--fg);
  max-width: 280px;
}

.article-nav-link:last-child { text-align: right; }

.article-nav-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.article-nav-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--brand);
}

/* ── CTA SECTION ── */
.cta-section {
  background: linear-gradient(135deg, hsl(212 45% 14%) 0%, var(--accent) 100%);
  padding: 80px 0;
}

.cta-inner {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.cta-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--accent-fg);
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.cta-desc {
  color: hsl(0 0% 70%);
  font-size: 16px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.cta-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: hsl(0 0% 80%);
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid hsl(0 0% 30%);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.cta-btn-secondary:hover { border-color: hsl(0 0% 50%); color: #fff; }

/* ── FOOTER ── */
.site-footer {
  background: hsl(0 0% 6%);
  padding: 32px 0;
  text-align: center;
  font-size: 13px;
  color: hsl(0 0% 52%);
  line-height: 2;
}

.footer-links-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.footer-links-row a {
  color: hsl(0 0% 60%);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}

.footer-links-row a:hover { color: #fff; }

/* ── GTM ── */
.gtm-noscript { display: none; visibility: hidden; }

/* ── FADE-IN ── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .navbar-links { display: none; }
  .hamburger { display: block; }

  .container { padding: 0 20px; }
  .navbar-inner { padding: 0 20px; }
  .mobile-menu { padding: 16px 20px 24px; }

  h1 { font-size: 34px; }
  h2 { font-size: 24px; }

  .hero { padding: 88px 0 56px; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-grid .hero-content { order: 2; }
  .hero-grid .hero-photo-wrap { order: 1; }

  .hero-photo { width: 160px; height: 160px; }
  .hero-desc { font-size: 16px; }

  .hero-btns { flex-direction: column; }
  .hero-btns a { width: 100%; justify-content: center; }

  .section { padding: 48px 0; }
  .section-header { margin-bottom: 24px; }

  .timeline { padding-left: 24px; }
  .timeline-item { padding: 0 0 32px 24px; }

  .projects-grid { grid-template-columns: 1fr; }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-hero h1 { font-size: 28px; }
  .article-body { padding: 40px 20px 60px; font-size: 16px; }

  .cta-section { padding: 48px 0; }
  .cta-title { font-size: 24px; }
  .cta-btns { flex-direction: column; align-items: center; }

  .article-nav { flex-direction: column; }
  .article-nav-link:last-child { text-align: left; }
}

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