/* Core layout scaffolding */
.container {
  width: min(100% - 2.5rem, var(--max-width));
  margin: 0 auto;
}

/* Sticky header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--header-border);
}

.site-header.scrolled {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

body[data-theme="dark"] .site-header.scrolled {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* Navbar layout */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-light);
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.nav-profile,
.nav-close {
  display: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 0.25rem;
  width: 40px;
  height: 32px;
  justify-content: center;
  align-items: center;
}

.nav-toggle-bars {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
  transition: background var(--transition);
}

/* Hero layout */
.hero {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.hero-text p {
  margin: 1rem 0 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-photo {
  justify-self: center;
  width: min(320px, 80vw);
  aspect-ratio: 3 / 4;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-portrait {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.hero-avatar {
  width: min(320px, 70vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 8px solid var(--surface);
  box-shadow: var(--shadow-card);
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

/* Grids */
.stats-grid,
.section-grid,
.projects-grid,
.testimonials-grid,
.footer-grid {
  display: grid;
  gap: 1.5rem;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.section-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.projects-grid {
  --project-columns: 1;
  grid-template-columns: repeat(var(--project-columns), minmax(0, 1fr));
}

@media (min-width: 600px) {
  .projects-grid {
    --project-columns: 2;
  }
}

@media (min-width: 900px) {
  .projects-grid {
    --project-columns: 3;
  }
}

@media (min-width: 1200px) {
  .projects-grid {
    --project-columns: 4;
  }
}

#featured-projects {
  display: block;
}

/* Client marquee */
.clients-strip {
  overflow: hidden;
}

.clients-marquee {
  overflow: hidden;
  width: 100%;
}

.clients-track {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  width: max-content;
  animation: clients-marquee 24s linear infinite;
}

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

.clients-track .logo-card {
  min-width: 150px;
}

.clients-strip img {
  filter: grayscale(1);
  opacity: 0.7;
  transition: filter var(--transition), opacity var(--transition);
}

.clients-strip img:hover {
  filter: grayscale(0);
  opacity: 1;
}

/* Section headings */
.section-heading {
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  font-size: 2rem;
}

/* Footer */
.site-footer {
  background: var(--surface);
  color: var(--text);
  padding: 3rem 0 0;
  margin-top: 4rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.site-footer a {
  color: inherit;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  align-items: flex-start;
}

.footer-profile-block {
  display: flex;
  align-items: center;
  gap: 2rem;
  grid-column: 1 / -1;
}

.footer-avatar {
  width: 106px;
  height: 106px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid rgba(15, 23, 42, 0.08);
}

.footer-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.footer-title {
  color: var(--text-light);
  font-size: 0.95rem;
}

.footer-column h3 {
  margin-bottom: 0.75rem;
}

@media (min-width: 992px) {
  .footer-content {
    grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(200px, 1fr));
  }

  .footer-profile-block {
    grid-column: span 1;
  }
}

.footer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
}

.footer-credit {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  margin-top: 2rem;
  padding: 1.5rem 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  text-align: center;
  font-size: 0.9rem;
}

/* Mobile nav quick actions */
.nav-quick-links {
  display: none;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.nav-quick-links a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: color-mix(in srgb, var(--brand) 85%, transparent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition), box-shadow var(--transition);
}

.nav-quick-links a svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.nav-quick-links a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

/* Clients marquee animation */
@keyframes clients-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Mobile nav layout */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(340px, 85vw);
    background: var(--surface);
    flex-direction: column;
    padding: 4rem 2rem 2rem;
    transform: translateX(100%);
    transition: transform var(--transition);
    border-left: 1px solid var(--header-border);
    box-shadow: -10px 0 30px rgba(15, 23, 42, 0.2);
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    display: none;
    pointer-events: none;
  }

  .nav-links.open {
    display: flex;
    transform: translateX(0);
    pointer-events: auto;
  }

  .nav-links a {
    color: var(--text);
    font-size: 1.05rem;
    padding: 0.05rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.15);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.15);
  }

  .nav-profile img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
  }

  .nav-profile div {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
  }

  .nav-profile strong {
    font-size: 1rem;
  }

  .nav-profile span {
    font-size: 0.85rem;
    color: var(--text-light);
  }
  .nav-quick-links {
    display: flex;
  }
  .nav-quick-links {
    display: flex;
  }

  html[data-theme="dark"] .nav-links {
    background: #ffffff;
  }

  html[data-theme="dark"] .nav-links a,
  html[data-theme="dark"] .nav-close,
  html[data-theme="dark"] .nav-profile strong,
  html[data-theme="dark"] .nav-profile span {
    color: #0f172a;
  }

  html:not([data-theme="dark"]) .nav-links {
    background: #0f172a;
  }

  html:not([data-theme="dark"]) .nav-links a,
  html:not([data-theme="dark"]) .nav-close,
  html:not([data-theme="dark"]) .nav-profile strong,
  html:not([data-theme="dark"]) .nav-profile span {
    color: #f8fafc;
  }

  .nav-toggle {
    display: flex;
    color: var(--text);
  }

  .nav-close {
    display: flex;
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    background: color-mix(in srgb, var(--text) 85%, transparent);
    color: color-mix(in srgb, var(--surface) 90%, transparent);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  }

  html[data-theme="dark"] .nav-close {
    background: #0f172a;
    color: #f8fafc;
  }

  html:not([data-theme="dark"]) .nav-close {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.15);
  }

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

  .sub-footer {
    flex-direction: column;
  }

}

/* Compact footer layout on small screens */
@media (max-width: 480px) {
  .footer-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (min-width: 769px) {
  .nav-quick-links {
    display: none !important;
  }
}
