/* ============================================================
   CSS Custom Properties
============================================================ */
:root {
  --bg:          #0D1420;
  --bg-card:     rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border:      rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text:        #E8EDF5;
  --text-muted:  rgba(255, 255, 255, 0.45);
  --text-dim:    rgba(255, 255, 255, 0.25);
  --accent:      #4D8EBF;
  --accent-dim:  rgba(77, 142, 191, 0.15);

  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:   'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  --radius:      12px;
  --transition:  0.2s ease;

  --container:   1100px;
  --nav-height:  64px;
}

/* ============================================================
   Reset & Base
============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ============================================================
   Layout
============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

/* ============================================================
   Navigation
============================================================ */
.nav-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

.nav-wrapper.scrolled {
  background: rgba(13, 20, 32, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-wordmark {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links > li > a,
.nav-apps-toggle {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav-links > li > a:hover,
.nav-apps-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-caret {
  font-size: 10px;
  opacity: 0.6;
  margin-left: 2px;
}

/* Apps dropdown */
.nav-apps-item {
  position: relative;
}

.nav-apps-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1A2433;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.nav-apps-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-apps-dropdown li a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

.nav-apps-dropdown li a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background var(--transition);
}

.nav-hamburger:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease, background var(--transition);
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   Hero
============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-height) + 48px) 0 96px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero-headline {
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 28px;
}

.hero-subtext {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 44px;
}

.cta-btn {
  display: inline-block;
  padding: 14px 32px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  transition: background var(--transition), transform var(--transition);
}

.cta-btn:hover {
  background: #5b9dce;
  transform: translateY(-1px);
}

/* ============================================================
   Section headings
============================================================ */
.section-heading {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 56px;
}

/* ============================================================
   Services
============================================================ */
.services {
  border-top: 1px solid var(--border);
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.service-card {
  padding: 40px 36px;
  background: var(--bg-card);
  border: none;
  transition: background var(--transition);
}

.service-card:hover {
  background: var(--bg-card-hover);
}

.service-card h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 14px;
}

.service-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================================
   Portfolio
============================================================ */
.portfolio {
  border-top: 1px solid var(--border);
}

.portfolio-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.portfolio-item {
  padding: 44px 40px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

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

.portfolio-item:hover {
  background: var(--bg-card-hover);
}

.portfolio-item h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 14px;
}

.portfolio-item p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 720px;
  margin-bottom: 20px;
}

.portfolio-disciplines {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin-bottom: 0 !important;
}

/* ============================================================
   Blog
============================================================ */
.blog {
  border-top: 1px solid var(--border);
}

.blog-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 56px;
}

.blog-header .section-heading {
  margin-bottom: 0;
}

.blog-see-all {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  transition: color var(--transition);
  white-space: nowrap;
}

.blog-see-all:hover {
  color: #7bb5d8;
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.blog-list:empty {
  display: none;
}

.blog-post-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 36px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  text-decoration: none;
}

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

.blog-post-item:hover {
  background: var(--bg-card-hover);
}

.blog-post-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.blog-post-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* ============================================================
   Contact
============================================================ */
.contact {
  border-top: 1px solid var(--border);
}

.contact-inner {
  display: flex;
  align-items: flex-start;
  gap: 56px;
}

.contact-photo-wrap {
  flex-shrink: 0;
}

.contact-photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: block;
}

.contact-text {
  max-width: 520px;
}

.contact-text h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 16px;
}

.contact-text p {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 36px;
}

.contact-email {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  color: var(--accent);
  border-bottom: 1px solid rgba(77, 142, 191, 0.3);
  padding-bottom: 2px;
  transition: border-color var(--transition), color var(--transition);
}

.contact-email:hover {
  color: #7bb5d8;
  border-bottom-color: rgba(77, 142, 191, 0.7);
}

/* ============================================================
   Footer
============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-dim);
  margin-right: auto;
}

.footer-apps {
  display: flex;
  gap: 20px;
}

.footer-apps a,
.footer-email {
  font-size: 13px;
  color: var(--text-dim);
  transition: color var(--transition);
}

.footer-apps a:hover,
.footer-email:hover {
  color: var(--text-muted);
}

/* ============================================================
   Blog listing page
============================================================ */
.blog-page {
  padding: calc(var(--nav-height) + 72px) 0 96px;
  min-height: 100vh;
}

.blog-page-header {
  margin-bottom: 64px;
}

.blog-page-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 16px;
}

.blog-page-desc {
  font-size: clamp(16px, 2vw, 18px);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 560px;
}

/* Active nav link */
.nav-active {
  color: var(--text) !important;
}

/* ============================================================
   Blog post page
============================================================ */
.post-page {
  padding: calc(var(--nav-height) + 72px) 0 120px;
}

.post-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.post-back {
  display: inline-block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 48px;
  transition: color var(--transition);
}

.post-back:hover {
  color: var(--text);
}

.post-header {
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.post-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.post-title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 20px;
}

.post-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 600px;
  margin-bottom: 28px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* Post body typography */
.post-body {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-muted);
}

.post-body h2 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 56px 0 20px;
}

.post-body h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 40px 0 16px;
}

.post-body p {
  margin-bottom: 24px;
}

.post-body a {
  color: var(--accent);
  border-bottom: 1px solid rgba(77, 142, 191, 0.3);
  transition: color var(--transition), border-color var(--transition);
}

.post-body a:hover {
  color: #7bb5d8;
  border-bottom-color: rgba(77, 142, 191, 0.7);
}

.post-body ul,
.post-body ol {
  margin: 0 0 24px 24px;
  list-style: disc;
}

.post-body ol {
  list-style: decimal;
}

.post-body li {
  margin-bottom: 8px;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text);
}

.post-body pre {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  overflow-x: auto;
  margin-bottom: 28px;
}

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

.post-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 0 0 28px;
  padding: 4px 0 4px 24px;
  color: var(--text-muted);
  font-style: italic;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ============================================================
   Scroll reveal animations
============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children of grids */
.services-grid .reveal:nth-child(1) { transition-delay: 0.05s; }
.services-grid .reveal:nth-child(2) { transition-delay: 0.12s; }
.services-grid .reveal:nth-child(3) { transition-delay: 0.19s; }
.services-grid .reveal:nth-child(4) { transition-delay: 0.26s; }

.portfolio-list .reveal:nth-child(1) { transition-delay: 0.05s; }
.portfolio-list .reveal:nth-child(2) { transition-delay: 0.1s; }
.portfolio-list .reveal:nth-child(3) { transition-delay: 0.15s; }
.portfolio-list .reveal:nth-child(4) { transition-delay: 0.2s; }

/* ============================================================
   Responsive — Tablet (768px)
============================================================ */
@media (max-width: 768px) {
  .section {
    padding: 72px 0;
  }

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

  .service-card {
    padding: 32px 28px;
  }

  .portfolio-item {
    padding: 36px 28px;
  }

  .contact-inner {
    flex-direction: column;
    gap: 32px;
  }

  .contact-photo {
    width: 120px;
    height: 120px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-copy {
    margin-right: 0;
  }
}

/* ============================================================
   Responsive — Mobile (< 640px): nav collapses
============================================================ */
@media (max-width: 640px) {
  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(13, 20, 32, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px 20px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links > li > a,
  .nav-apps-toggle {
    padding: 10px 12px;
    width: 100%;
    text-align: left;
  }

  .nav-apps-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    border: none;
    padding: 0 0 0 16px;
    margin-top: 4px;
  }

  .nav-apps-dropdown li a {
    padding: 8px 12px;
    font-size: 13px;
  }

  .hero {
    padding: calc(var(--nav-height) + 32px) 0 72px;
  }

  .hero-headline {
    font-size: 38px;
  }

  .section-heading {
    margin-bottom: 40px;
  }

  .portfolio-item {
    padding: 32px 24px;
  }

  .service-card {
    padding: 28px 24px;
  }
}

/* ============================================================
   Responsive — Small mobile (375px)
============================================================ */
@media (max-width: 400px) {
  .hero-headline {
    font-size: 34px;
  }

  .container {
    padding: 0 20px;
  }
}
