/* ── 0. Variables ─────────────────────────────────────── */
:root {
  --color-primary: #014397;
  --color-primary-dark: #012d6e;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-page: #faf9f7;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-border: #e5e7eb;
  --color-source-bg: rgba(1, 67, 151, 0.08);
  --radius: 10px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] {
  --color-primary: #60a5fa;
  --color-primary-dark: #3b82f6;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-page: #0b1220;
  --color-bg: #131b2c;
  --color-bg-alt: #1e293b;
  --color-border: #2a3548;
  --color-source-bg: rgba(96, 165, 250, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ── 1. Base / Typography ─────────────────────────────── */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--color-text);
  line-height: 1.7;
  background-color: var(--color-page);
  transition: background-color 0.2s, color 0.2s;
}

.site-header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-footer {
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--color-primary);
}

/* ── 3. CTA Button ────────────────────────────────────── */
.cta-button {
  display: inline-block;
  background-color: var(--color-primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.cta-button:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: #fff;
}

.cta-button:active,
.cta-button:visited {
  background-color: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

.cta-button--outline {
  background-color: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}

.cta-button--outline:hover {
  background-color: var(--color-bg-alt);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.cta-button--outline:visited {
  background-color: transparent;
  color: var(--color-text);
}

/* ── 4. Hero Section ──────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 2.5rem 0 2.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2.5rem;
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
  font-size: 2.4rem;
  margin: 0 0 0.4rem;
  color: var(--color-text);
}

.hero-tagline {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.hero-image img {
  width: 240px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: block;
}

@media (max-width: 640px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    gap: 1.5rem;
    padding: 2rem 0;
  }

  .hero-image img {
    width: 180px;
    margin: 0 auto;
  }

  .hero-text h1 {
    font-size: 1.8rem;
  }
}

/* ── 5. Logo Marquee ──────────────────────────────────── */
.logo-marquee {
  overflow: hidden;
  padding: 24px 0;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.logo-marquee-track {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  width: max-content;
  animation: marquee 28s linear infinite;
}

.logo-marquee-track img {
  height: 52px;
  width: auto;
  filter: grayscale(50%);
  opacity: 0.85;
  transition: filter 0.2s, opacity 0.2s;
  flex-shrink: 0;
}

.logo-marquee-track img:hover {
  filter: grayscale(0%);
  opacity: 1;
}

.logo-marquee:hover .logo-marquee-track {
  animation-play-state: paused;
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── 6. Project Grid + Cards ──────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

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

.project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  padding: 1.25rem;
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.project-card img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  object-position: center;
  background: var(--color-bg-alt);
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  display: block;
  box-sizing: border-box;
}

.project-card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.project-card br {
  display: none;
}

/* ── 7. Article Grid ─────────────────────────────────── */
.article-loading {
  color: var(--color-text-muted);
}

.article-section {
  margin-bottom: 2.5rem;
}

.article-section-heading {
  font-size: 1.5rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

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

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

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.article-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem;
}

.article-source {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-source-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
  align-self: flex-start;
}

.article-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.article-title:hover {
  color: var(--color-primary);
}

.article-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.article-excerpt {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
  line-height: 1.6;
  flex: 1;
}

.article-read-more {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
}

.article-read-more:hover {
  text-decoration: underline;
}

.article-cta {
  grid-column: 1 / -1;
  padding: 0.5rem 0 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── 8. Resume ────────────────────────────────────────── */
.resume-download {
  padding: 2rem 0;
}

.resume-download p {
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

/* ── 8. Cross-page consistency ────────────────────────── */
.home .page-heading {
  display: none;
}

.site-title {
  font-weight: 700 !important;
  letter-spacing: -0.01em;
}

.site-title:hover {
  text-decoration: underline !important;
  opacity: 0.8;
}


.page-content h1,
.page-content h2,
.page-content h3 {
  color: var(--color-text);
}

.page-content a:not(.cta-button) {
  color: var(--color-primary);
}

/* ── 9. Footer ────────────────────────────────────────── */
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 0;
  text-align: center;
}

.footer-social {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.footer-social a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-social a:hover {
  color: var(--color-primary);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ── 10. Theme Toggle ─────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  margin-left: 1rem;
  padding: 0;
  transition: color 0.15s, border-color 0.15s;
}

.theme-toggle:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  width: 16px;
  height: 16px;
}

[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"]  .theme-toggle .icon-moon { display: none; }

/* ── 11. Dark mode component overrides ───────────────── */
[data-theme="dark"] .site-title,
[data-theme="dark"] .page-link {
  color: var(--color-text) !important;
}

[data-theme="dark"] .post-link,
[data-theme="dark"] .page-content a:not(.cta-button) {
  color: var(--color-primary);
}

[data-theme="dark"] .logo-marquee {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius);
  padding: 18px 0;
}

[data-theme="dark"] .cta-button--outline {
  color: var(--color-text);
  border-color: var(--color-border);
}

[data-theme="dark"] .cta-button--outline:hover {
  color: var(--color-text);
  background-color: var(--color-bg-alt);
}

/* ── 12. Misc ─────────────────────────────────────────── */
iframe {
  z-index: 1;
}

/* ── 13. Services Page ───────────────────────────────── */
.services-hero {
  padding: 3rem 0 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.services-hero h1 {
  font-size: 2.6rem;
  margin: 0 0 1rem;
  color: var(--color-text);
}

.services-hero-tagline {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 660px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .services-hero h1 { font-size: 1.9rem; }
  .services-hero-tagline { font-size: 1rem; }
}

.services-problem,
.services-method,
.services-proof,
.services-tiers,
.services-addons,
.services-why-me,
.services-faq {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.services-problem h2,
.services-method h2,
.services-proof h2,
.services-tiers h2,
.services-addons h2,
.services-why-me h2,
.services-faq h2 {
  font-size: 1.6rem;
  margin: 0 0 1.5rem;
  color: var(--color-text);
}

.services-problem-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.services-problem-list li {
  padding: 0.5rem 0 0.5rem 1.25rem;
  position: relative;
  color: var(--color-text);
  line-height: 1.6;
}

.services-problem-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 600;
}

.services-method-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: method-step;
}

.services-method-list > li {
  counter-increment: method-step;
  position: relative;
  padding: 0 0 1.5rem 3.25rem;
  margin-bottom: 0.25rem;
}

.services-method-list > li::before {
  content: counter(method-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.services-method-list h3 {
  margin: 0.25rem 0 0.4rem;
  font-size: 1.1rem;
  color: var(--color-text);
}

.services-method-list p {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.case-study {
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
}

.case-study h3 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

.case-study p {
  color: var(--color-text);
  line-height: 1.65;
  margin: 0 0 0.75rem;
}

.case-study-meta {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 0.75rem;
}

.services-proof-intro {
  color: var(--color-text-muted);
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.services-proof-more {
  margin-top: 1.25rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.service-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.service-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  color: var(--color-text);
}

.service-price {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.service-tagline {
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0 0 1rem;
  line-height: 1.5;
}

.service-card ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--color-text);
}

.service-card ul li {
  margin-bottom: 0.4rem;
  line-height: 1.55;
}

.service-not-included {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  line-height: 1.55;
}

.service-timeline {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 1.25rem;
}

.service-card .cta-button,
.service-card .cta-button--outline {
  align-self: flex-start;
  margin-top: auto;
}

@media (min-width: 900px) {
  .services-tiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: stretch;
  }
  .services-tiers h2 {
    grid-column: 1 / -1;
  }
  .service-card {
    margin-bottom: 0;
  }
}

.services-addons-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.services-addons-list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.6;
  color: var(--color-text);
}

.services-addons-list li:last-child {
  border-bottom: none;
}

.services-why-me p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text);
  margin: 0 0 1rem;
  max-width: 720px;
}

.faq-item {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: var(--color-text);
}

.faq-item p {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.65;
}

.services-cta {
  text-align: center;
  padding: 3rem 0 4rem;
}

.services-cta h2 {
  font-size: 1.8rem;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.services-cta p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
}

.services-cta-fallback {
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.services-cta-fallback a {
  color: var(--color-primary);
}

/* ── 14. Video Card ──────────────────────────────────── */
.video-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.video-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.video-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-alt);
  overflow: hidden;
}

.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-card-thumb::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  transition: background 0.15s, transform 0.15s;
}

.video-card-thumb::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
  z-index: 2;
}

.video-card:hover .video-card-thumb::after {
  background: rgba(0, 0, 0, 0.9);
  transform: translate(-50%, -50%) scale(1.05);
}

.video-card-body {
  padding: 1.1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.video-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.video-card:hover .video-card-title {
  color: var(--color-primary);
}

.video-card-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ── 15. Inline Code & Text Selection ────────────────── */
code {
  background: var(--color-bg-alt);
  color: var(--color-text);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'SF Mono', Monaco, Menlo, 'Courier New', monospace;
  border: 1px solid var(--color-border);
}

::selection {
  background: var(--color-primary);
  color: #fff;
}
