/* ============================================
   Engine Labs - Component Styles
   ============================================ */

/* Animated star border */
@property --border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes border-rotate {
  to {
    --border-angle: 360deg;
  }
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  min-height: 128px;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  align-items: stretch;
  min-height: 400px;
  width: 100%;
  height: 100%;
}

.content-section .container {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-grid > div {
  max-width: none;
  width: calc(100% + 42px);
  border: 1px solid rgba(22, 21, 25, 0.08);
  padding: 20px;
  margin: 0 -21px;
  border-radius: 8px;
  height: 100%;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
}

/* Pixel Blast Background */
.pixel-blast-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.pixel-blast-bg canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-grid > div > *:not(.pixel-blast-bg) {
  position: relative;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .hero-grid > div:hover {
    background:
      linear-gradient(white, white) padding-box,
      conic-gradient(from var(--border-angle), rgba(22, 21, 25, 0.08) 60%, var(--color-bg-light) 90%, rgba(22, 21, 25, 0.08) 100%) border-box;
    animation: border-rotate 3s linear infinite;
  }
}

.hero-grid-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-grid-content .available-now-badge {
  margin-bottom: var(--spacing-sm);
}

.hero-grid > div .cta-button {
  align-self: flex-start;
  margin-top: 12px;
  width: auto;
  display: inline-flex;
}

.hero-grid-title {
  font-size: 33px;
  line-height: 115%;
  font-weight: 700;
  margin-bottom: 8px;
  color: #161519;
}

.faq-container .hero-grid {
  min-height: 0;
  padding: 0;
  height: 100%;
  align-items: stretch;
}

.faq-container .hero-grid > div {
  max-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
  border-radius: 4px;
}

.faq-container .hero-grid > div .hero-title {
  margin-top: 0;
}

.faq-container .hero-grid > div .cta-button {
  margin-top: auto;
  margin-bottom: 0;
  align-self: flex-start;
}

.faq-container .hero-grid > div .cta-button:hover,
.faq-container .hero-grid > div .cta-button:hover span {
  color: #161519;
}

.hero-grid > div.fade-in {
  margin-bottom: 48px;
}

/* ============================================
   Content Section (separate from hero)
   ============================================ */
.content-section {
  margin-top: 72px;
  margin-bottom: 48px;
  min-height: 400px;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  align-items: start;
  min-height: 256px;
}

.content-grid > div {
  max-width: 100%;
  text-align: center;
}

.content-grid > div.fade-in {
  margin-bottom: 0;
  text-align: left;
  padding-left: 0;
  padding-right: 0;
}

/* Content Card - Reusable card style */
.content-card {
  max-width: 50%;
  border: 1px solid var(--color-bg-light);
  padding: 16px;
  border-radius: 4px;
  margin-bottom: 24px;
}

/* Header version - no border or padding */
.content-card-header {
  max-width: 50%;
  border: none;
  padding: 0;
  border-radius: 0;
  margin-bottom: 24px;
}

.hero-title-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-sm);
}

.available-now-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid transparent;
  border-radius: var(--border-radius-full);
  position: relative;
  margin-bottom: 4px;
  background:
    linear-gradient(white, white) padding-box,
    conic-gradient(from var(--border-angle), rgba(22, 21, 25, 0.15) 60%, rgba(22, 21, 25, 0.35) 90%, rgba(22, 21, 25, 0.15) 100%) border-box;
  animation: border-rotate 3s linear infinite;
}

.hero-title-wrapper .available-now-icon-wrapper {
  position: relative;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.available-now-text {
  font-family: 'Neue Haas Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-muted);
  line-height: 16px;
  white-space: nowrap;
}

.hero-title {
  display: block;
  width: 100%;
  max-width: 100%;
  line-height: 150%;
  font-weight: 700;
  font-size: var(--font-size);
  overflow: visible;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h1.hero-title {
  font-size: 33px;
  line-height: 150%;
  padding-bottom: 3px;
  color: rgba(22, 21, 25, 1);
  position: relative;
  cursor: default;
}

.display-text {
  display: block;
  width: 100%;
  font-weight: 700;
  font-size: var(--font-size);
}

h2 {
  font-size: 33px;
  line-height: 115%;
}

#main-heading {
  width: 100%;
  margin-bottom: 8px;
}

/* Spotlight Effect - Blurry white circle follows cursor on hover */
.hero-title-spotlight {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  transform: translate(-50%, -50%);
  z-index: 1;
  filter: blur(10px);
}

/* ============================================
   Animations - Pure CSS Stagger Fade-In
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  /* Animation handled by CSS, will-change not needed for one-time animations */
  display: block;
}

div.fade-in {
  margin-top: 0;
  margin-bottom: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}

h1.fade-in {
  font-family: 'Neue Haas Grotesk', sans-serif;
  font-weight: 700;
  font-size: 33px;
  line-height: 115%;
}

/* Initial hidden state for fade-in elements */
.hero-title,
.cta-button:not(.services-modal-trigger),
.section-title.fade-in,
.process > .container,
.services-section > .container,
.project-section > .container,
.hero-grid > div.fade-in,
.content-grid > div.fade-in,
.faq-section,
.fade-in {
  opacity: 0;
  transform: translateY(8px);
}

/* Pure CSS animations with stagger - trigger when in-view class is added */
.nav-logo.in-view {
  animation: fadeInUp 0.3s var(--ease-out) 0s forwards;
}

.hero-title.in-view {
  animation: fadeInUp 0.3s var(--ease-out) 0.06s forwards;
}

.cta-button.in-view {
  animation: fadeInUp 0.3s var(--ease-out) 0.12s forwards;
}

.process > .container.in-view,
.services-section > .container.in-view,
.project-section > .container.in-view,
.faq-section.in-view,
.fade-in.in-view {
  animation: fadeInUp 0.3s var(--ease-out) 0s forwards;
}

/* ============================================
   Button Components
   ============================================ */
.btn,
.cta-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: calc(0.25rem + 4px) 0.75rem;
  border: 1px solid;
  text-decoration: none;
  font-size: var(--font-size);
  line-height: 150%;
  transition: color var(--transition-color),
              transform 0.15s var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
  transform-origin: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.cta-button-wrapper {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 1rem;
}

.content-grid .cta-button-wrapper .cta-button {
  margin-top: var(--spacing-md);
}

/* Button hover scale animation */
@media (hover: hover) and (pointer: fine) {
  .btn:hover,
  .cta-button:hover {
    color: #161519;
    transform: scale(1.02);
  }
}

.btn:active,
.cta-button:active {
  transform: scale(0.97);
}

.btn {
  border-color: var(--color-text-secondary);
  background-color: var(--color-bg);
  color: var(--color-text-secondary);
  border-radius: var(--border-radius-md);
}

.cta-button {
  border-color: #161519;
  background-color: #161519;
  color: #ffffff;
  border-radius: 16px;
  text-align: center;
  padding: 0 0.75rem;
  -webkit-appearance: none;
}

.cta-button:focus-visible {
  outline: 2px solid #161519;
  outline-offset: 2px;
}

.services-section .get-started-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.services-section .get-started-header h2 {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  transform: translateY(2px);
}

.services-section .get-started-header .cta-button {
  border-color: var(--color-text-muted);
  background-color: #ffffff;
  color: var(--color-text-muted);
  border-radius: var(--border-radius-full);
  padding: 8px 16px;
  line-height: 1;
}

.services-section .get-started-header .cta-button::before {
  background-color: var(--color-text-muted);
}

@media (hover: hover) and (pointer: fine) {
  .services-section .get-started-header .cta-button:hover {
    color: #ffffff;
  }
}

.services-section .get-started-header .cta-button span {
  color: var(--color-text-muted);
  position: relative;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .services-section .get-started-header .cta-button:hover span {
    color: #ffffff;
  }
}

.services-section .get-started-header .cta-button .plus-icon {
  color: var(--color-text-muted);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .services-section .get-started-header .cta-button:hover .plus-icon {
    color: #ffffff;
  }
}

.btn::before,
.cta-button::before {
  content: '';
  position: absolute;
  inset: 0;
  transform: translate3d(-101%, 0, 0);
  transition: transform 0.25s var(--ease-out);
  z-index: 0;
  backface-visibility: hidden;
}

.btn::before {
  background-color: var(--color-text-secondary);
}

.cta-button::before {
  background-color: #ffffff;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover::before,
  .cta-button:hover::before {
    transform: translate3d(0, 0, 0);
  }
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover span,
  .cta-button:hover span,
  .services-cta:hover span {
    color: #161519;
  }
}

.btn span,
.cta-button span,
.services-cta span {
  position: relative;
  z-index: 1;
  display: inline-block;
}

.cta-button .plus-icon,
.services-cta .plus-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  stroke: currentColor;
  stroke-width: 3;
  transition: color var(--transition-color);
}

@media (hover: hover) and (pointer: fine) {
  .cta-button:hover .plus-icon,
  .services-cta:hover .plus-icon {
    color: #161519;
  }
}

.cta-email {
  opacity: 0;
  font-size: var(--font-size);
  font-weight: 700;
  color: #161519;
  white-space: nowrap;
  text-decoration: none;
  transition: opacity 0.15s ease 0.08s;
  pointer-events: none;
  line-height: 150%;
  transform: translate(-4px, 0);
}

@media (hover: hover) and (pointer: fine) {
  .cta-button-wrapper:hover .cta-email {
    opacity: 1;
  }
}

/* ============================================
   Services CTA Button
   ============================================ */
.services-cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0.75rem;
  border: 1px solid #c0c0c0;
  background-color: transparent;
  color: #808080;
  border-radius: var(--border-radius-full);
  text-decoration: none;
  font-size: var(--font-size);
  line-height: 150%;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  transition: color var(--transition-color),
              border-color var(--transition-color),
              transform 0.15s var(--ease-out);
  transform-origin: center;
}

.services-cta:focus-visible {
  outline: 2px solid #161519;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .services-cta:hover {
    color: #161519;
    border-color: #161519;
    transform: scale(1.02);
  }
}

.services-cta:active {
  transform: scale(0.97);
}

.services-cta .plus-icon {
  color: #808080;
}

/* ============================================
   Project Components
   ============================================ */
.project-section {
  margin-bottom: 0;
}

.project-section > .container {
  margin-bottom: var(--spacing-xl);
}

.selected-work-header.container {
  margin-bottom: 32px;
}

.selected-work-section {
  height: auto;
  margin-top: var(--spacing-lg);
}

.selected-work-header {
  height: fit-content;
}

.project-carousel-wrapper {
  display: flex;
  flex-direction: column;
}

.project-carousel {
  position: relative;
  width: 100%;
}

.project-carousel-images {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.project-carousel-slide {
  display: none;
  width: 100%;
}

.project-carousel-slide.active {
  display: block;
}

.project-carousel-slide img {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 4px;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(22, 21, 25, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease-out, visibility 0s linear 0.15s, background-color 0.15s ease-out;
}

.project-carousel:hover .carousel-arrow {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s ease-out, visibility 0s, background-color 0.15s ease-out;
}

.carousel-arrow i {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.carousel-arrow:hover {
  background: rgba(22, 21, 25, 0.4);
}

.carousel-prev {
  left: 16px;
}

.carousel-next {
  right: 16px;
}

.project-image-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-image {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  transform-origin: center;
  /* Initial state — consistent with page fade-in language */
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease-out),
              transform 0.3s var(--ease-out);
}

/* Animated state when in view */
.project-image.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Hover effect */
@media (hover: hover) and (pointer: fine) {
  .project-image-wrapper:hover .project-image {
    transform: scale(1.02);
    transition-duration: 0.15s;
  }
}

.bento-large .project-image {
  aspect-ratio: 1 / 1;
  height: 100%;
}

.bento-medium .project-image {
  aspect-ratio: 2 / 1;
  height: 100%;
}

.bento-small .project-image {
  aspect-ratio: 1 / 1;
  height: 100%;
}

.project-link {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.project-link a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
}

.project-section:nth-of-type(3) .project-link {
  margin-bottom: var(--spacing-sm);
}

h3.project-title {
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  margin-right: var(--spacing-sm);
}

.project-tags {
  color: var(--color-text-muted);
  font-size: var(--font-size);
  font-weight: inherit;
  white-space: nowrap;
}

.section-title {
  font-size: var(--font-size);
  font-weight: 700;
}

#selected-work-heading {
  font-size: 18px;
}

/* ============================================
   Section Components
   ============================================ */
.faq-section {
  padding: 72px 0;
  color: #161519;
  display: flex;
  flex-wrap: wrap;
}

.faq-container {
  display: block;
  width: 100%;
  max-width: 580px;
  margin-inline: auto;
  padding-left: 16px;
  padding-right: 16px;
  flex: 1 1 100%;
}

.faq-title {
  line-height: 115%;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.faq-list {
  display: grid;
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

.faq-item {
  border-top: 1px solid var(--color-bg-light);
  display: flex;
  flex-direction: column;
}

.faq-item:first-child {
  border-top: none;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  cursor: pointer;
  gap: 1.5rem;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: var(--color-text-muted);
}

.faq-question h3 {
  color: var(--color-text-muted);
}

button.faq-question {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.faq-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.faq-icon svg {
  transition: transform 0.2s var(--ease-in-out);
  transform-origin: center;
  transform: rotate(0deg);
}

.faq-icon svg path {
  fill: var(--color-text-muted);
}

.faq-item.active .faq-icon svg {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.2s ease-out, opacity 0.15s ease-out, padding-bottom 0.2s ease-out;
  color: #161519;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  opacity: 1;
  padding-bottom: var(--spacing-sm);
}

.faq-answer p {
  margin-bottom: 1rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* ============================================
   Footer Components
   ============================================ */
.footer {
  margin-top: auto;
  padding: var(--spacing-md) 0 var(--spacing-sm);
  position: relative;
  z-index: 1;
  background-color: var(--color-bg);
  flex-shrink: 0;
  width: 100%;
  align-self: stretch;
}

.footer .container {
  margin-bottom: 0;
}

.footer-badge {
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.footer-badge-image {
  max-width: 200px;
  height: auto;
  object-fit: contain;
}

.footer-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: var(--spacing-md);
  padding-top: var(--spacing-md);
  width: 100%;
}

.footer-links a {
  color: #161519;
  text-decoration: none;
  transition: color var(--transition-base);
}

.footer-links a:hover,
.footer-links a:focus {
  color: rgba(22, 21, 25, 0.75);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-base);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: rgba(22, 21, 25, 0.6);
  font-size: var(--font-size);
  font-weight: 700;
  line-height: 150%;
  transition: color var(--transition-base);
}

.text-link:hover {
  color: #161519;
}

.text-link-arrow {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.contact-link .copy-icon {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.contact-link:hover {
  color: rgba(22, 21, 25, 0.75);
}

.contact-link:hover .copy-icon {
  opacity: 1;
}

.footer-address {
  grid-column: 1;
}

.footer-copyright {
  text-align: center;
  line-height: 150%;
  grid-column: 2;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  text-align: right;
  grid-column: 3;
}

/* ============================================
   Get Started Section
   ============================================ */
.process {
  padding: var(--spacing-md) 0 var(--spacing-lg);
}

.get-started-header {
  text-align: left;
  margin-bottom: var(--spacing-sm);
}

.get-started-header p {
  margin-bottom: var(--spacing-sm);
}

.get-started-header h1 {
  margin-bottom: var(--spacing-sm);
  line-height: 115%;
  font-weight: 700;
  font-size: 33px;
}

.get-started-header h2#process-heading {
  font-size: 33px;
  line-height: 115%;
  font-weight: 700;
  color: rgba(22, 21, 25, 1);
}

.content-section h2#about-heading.hero-title {
  font-size: 33px;
  line-height: 115%;
  font-weight: 700;
}

.get-started-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px var(--spacing-md);
  justify-items: start;
  max-width: 100%;
  width: 100%;
}

.get-started-card {
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.in-view .get-started-card:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0ms; }
.in-view .get-started-card:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 50ms; }
.in-view .get-started-card:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 100ms; }

.get-started-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.get-started-label {
  font-size: var(--font-size);
  display: inline-flex;
  align-items: center;
}

.get-started-label svg,
.get-started-icon {
  display: inline-block;
  vertical-align: middle;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.get-started-card h3 {
  margin-bottom: 4px;
  font-size: 18px;
  color: var(--color-text-secondary);
}

.get-started-card h3.text-muted {
  color: var(--color-text-muted);
}

/* ============================================
   Services Section
   ============================================ */
.services-section {
  padding: var(--spacing-lg) 0;
  overflow: visible;
}

.services-section > .container {
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.services-tags {
  max-width: 100%;
}

.services-list {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 48px;
  column-gap: var(--spacing-sm);
  align-items: start;
  min-height: 300px;
  max-width: 100%;
  width: 100%;
}

.services-section .service-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  margin: 0 -20px;
  border: 1px solid rgba(22, 21, 25, 0.08);
  border-radius: 8px;
}

@media (hover: hover) and (pointer: fine) {
  .services-section .service-item:hover {
    background:
      linear-gradient(white, white) padding-box,
      conic-gradient(from var(--border-angle), transparent 60%, var(--color-bg-light) 90%, transparent 100%) border-box;
    animation: border-rotate 3s linear infinite;
  }
}

.service-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.service-title-row h3 {
  margin: 0;
}

.service-title-row .text-muted {
  font-size: var(--font-size);
}

/* ============================================
   Blog Components
   ============================================ */
.blog-section {
  flex: 1;
}

div.blog-header {
  padding-top: 144px;
  margin-bottom: var(--spacing-sm);
}

.blog-header h3 {
  color: var(--color-text-secondary);
  font-weight: 400;
}

.blog-header p {
  color: var(--color-text-muted);
  font-weight: 700;
}

.blog-grid {
  margin-top: 80px;
  padding: 0;
}

.blog-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-bg-light);
}

.blog-item a {
  color: var(--color-text-muted);
  text-decoration: none;
  position: relative;
}

.blog-item a:hover {
  color: #161519;
}

.blog-item a:hover::after {
  content: '';
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background-color: #161519;
  border-radius: 50%;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

/* ============================================
   Blog Post Page
   ============================================ */
main > section.blog-post-header {
  padding-top: 144px;
  padding-bottom: 0;
  margin-bottom: 0;
}

.blog-post-meta,
.blog-post-meta.fade-in {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--spacing-sm);
}

.blog-post-meta p {
  margin: 0;
}

.blog-post-title {
  font-size: 33px;
  line-height: 115%;
  font-weight: 700;
  margin: 0;
  margin-bottom: var(--spacing-sm);
}

.blog-post-content {
  padding-bottom: var(--spacing-lg);
}

.blog-article p {
  font-size: 16px;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-muted);
}

.blog-article .blog-intro {
  font-size: var(--text-lg);
  margin-bottom: var(--spacing-md);
}

.blog-article h2 {
  font-size: var(--text-lg);
  line-height: 130%;
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}

.blog-article blockquote {
  margin: var(--spacing-md) 0;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

.blog-post-nav {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-text-tertiary);
}

/* ============================================
   Case Study Components
   ============================================ */
main > section:first-of-type:not(.blog-post-header) > .container {
  height: 144px;
}

main > section:first-of-type:not(.blog-post-header) {
  margin-bottom: 24px;
}

main > .container > section:first-of-type {
  margin-top: 0;
}

.case-study-header-primary {
  margin-top: 144px;
  margin-bottom: 0;
  padding: 0;
  height: fit-content;
}

.case-study-header-secondary {
  margin-top: var(--spacing-xl);
  margin-bottom: 0;
  padding: 0;
  height: fit-content;
}

.case-bottom-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--spacing-sm) 0;
  gap: var(--spacing-sm);
  margin-top: 48px;
}

.case-nav-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #161519;
}

.case-nav-label {
  margin-bottom: 4px;
  color: var(--color-text-muted);
}

.case-nav-project {
  text-decoration: none;
  color: var(--color-text-secondary);
}

.case-nav-link:hover .case-nav-project {
  opacity: 0.7;
}

.case-study-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-sm);
  align-items: start;
  margin-top: 0;
  margin-bottom: var(--spacing-md);
}

section:first-of-type .case-study-content {
  grid-template-columns: 1fr;
}

.case-study-content h1 {
  font-size: 33px;
  line-height: 115%;
  font-weight: 700;
}

.case-study-text {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.case-study-text p {
  margin: 0;
  color: var(--color-text-muted);
}

/* ============================================
   Blockquote Styles
   ============================================ */
blockquote {
  color: var(--color-text-secondary);
  margin: 0;
  padding: 0;
  border-left: none;
  font-style: normal;
  line-height: 120%;
  position: relative;
}

blockquote::before {
  display: none;
}

blockquote.margin-bottom {
  padding-left: 16px;
}

.project-metadata {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  border-top: none;
}

.metadata-item {
  display: flex;
  justify-content: space-between;
}

.metadata-label {
  color: var(--color-text-muted);
  font-size: var(--font-size);
  font-weight: 700;
  line-height: 150%;
}

.metadata-value {
  color: #161519;
  font-size: var(--font-size);
  font-weight: 700;
  line-height: 150%;
  text-align: right;
}

.metadata-column-right {
  display: flex;
  gap: var(--spacing-lg);
}

.tag-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.tags {
  border: none;
  border-radius: var(--border-radius-full);
  background-color: #f5f5f5;
  color: var(--color-text-muted);
  padding: 2px 10px;
  font-size: var(--font-size);
  font-family: inherit;
  font-weight: inherit;
  line-height: 150%;
  text-transform: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  .tags:hover {
    background-color: #161519;
    color: #ffffff;
  }
}

.tags.mb-sm {
  margin-bottom: var(--spacing-sm);
}

.project-placeholder {
  background-color: var(--color-bg-light);
  border-radius: 4px;
  width: 100%;
  max-width: 100%;
  display: block;
}

.about-placeholder {
  margin-top: var(--spacing-md);
}

.project-hero-image {
  margin: var(--spacing-lg) 0;
}

.project-hero-image img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.project-gallery-item {
  width: 100%;
  overflow: hidden;
}

.project-gallery-item img,
.project-gallery-item .project-placeholder {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 4px;
  transition: transform var(--transition-base);
}


/* Gallery item sizes */
.project-gallery-item-big {
  grid-column: 1 / -1;
}

.project-gallery-item-big img {
  aspect-ratio: 16 / 9;
}

.project-gallery-item-medium {
  grid-column: span 1;
}

.project-gallery-item-medium img,
.project-gallery-item-medium .project-placeholder {
  aspect-ratio: 4 / 3;
}

/* Text section in gallery */
.project-gallery-text {
  grid-column: 1 / -1;
  padding: var(--spacing-md) 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.project-gallery-text h3 {
  margin-bottom: var(--spacing-sm);
  font-size: 18px;
}

.project-gallery-text p {
  max-width: 65ch;
}

/* ============================================
   Image Lightbox
   ============================================ */
.image-lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(22, 21, 25, 0.95);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
  cursor: pointer;
}

.image-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.image-lightbox-content {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.image-lightbox img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(22, 21, 25, 0.5);
}

.image-lightbox-close {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-base);
  z-index: 10001;
}

.image-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Make images clickable */
.project-hero-image img,
.project-gallery-item img {
  cursor: pointer;
}

/* ============================================
   Services Modal
   ============================================ */
.services-modal {
  position: fixed;
  inset: 0;
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
  pointer-events: none;
}

.services-modal.active {
  pointer-events: all;
}

.services-modal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(22, 21, 25, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.services-modal.active .services-modal-overlay {
  opacity: 1;
  transition: opacity 0.2s ease-out;
}

.services-modal-content {
  position: relative;
  background-color: #ffffff;
  border-radius: 16px;
  padding: 48px;
  max-width: 720px;
  max-height: 720px;
  overflow-y: auto;
  z-index: 1;
  box-shadow: 0 8px 32px rgba(22, 21, 25, 0.2);
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.2s ease-out, transform 0.2s var(--ease-out);
}

.services-modal.active .services-modal-content {
  opacity: 1;
  transform: scale(1);
}

.services-modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #161519;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-base);
  z-index: 2;
}

.services-modal-close:hover {
  background-color: rgba(22, 21, 25, 0.05);
}

.services-modal-close i {
  width: 20px;
  height: 20px;
}

.services-modal-body {
  width: 100%;
  height: 100%;
}

.services-modal-body h1 {
  font-size: 33px;
  line-height: 115%;
  font-weight: 700;
  margin-bottom: var(--spacing-md);
}

.services-modal-body h2 {
  padding-bottom: var(--spacing-md);
}

.services-modal-body .cta-button {
  padding-top: 4px;
  padding-bottom: 4px;
  border-radius: var(--border-radius-full);
}

.services-modal-body .service-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--spacing-md);
}

.service-item-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  background: rgba(22, 21, 25, 0.06);
  border-radius: 8px;
}

.service-item-text {
  flex: 1;
  min-width: 0;
}

.services-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: var(--spacing-lg);
}

.services-modal-tags .tag,
.services-tags-inline .tag {
  padding: 8px 16px;
  border: 1px solid rgba(22, 21, 25, 0.08);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size);
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: border-color 0.15s ease, color 0.15s ease, opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.in-view .services-tags-inline .tag:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0ms; }
.in-view .services-tags-inline .tag:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 40ms; }
.in-view .services-tags-inline .tag:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 80ms; }
.in-view .services-tags-inline .tag:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 120ms; }
.in-view .services-tags-inline .tag:nth-child(5) { opacity: 1; transform: translateY(0); transition-delay: 160ms; }
.in-view .services-tags-inline .tag:nth-child(6) { opacity: 1; transform: translateY(0); transition-delay: 200ms; }
.in-view .services-tags-inline .tag:nth-child(7) { opacity: 1; transform: translateY(0); transition-delay: 240ms; }
.in-view .services-tags-inline .tag:nth-child(8) { opacity: 1; transform: translateY(0); transition-delay: 280ms; }
.in-view .services-tags-inline .tag:nth-child(9) { opacity: 1; transform: translateY(0); transition-delay: 320ms; }
.in-view .services-tags-inline .tag:nth-child(10) { opacity: 1; transform: translateY(0); transition-delay: 360ms; }

@media (hover: hover) and (pointer: fine) {
  .services-tags-inline .tag:hover {
    border-color: rgba(22, 21, 25, 0.25);
    color: rgba(22, 21, 25, 0.85);
  }
}

.services-tags-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--spacing-md);
}

/* ============================================
   Cursor Hover Effect
   ============================================ */
.cursor-text-bubble {
  position: fixed;
  left: 0;
  top: 0;
  background: rgba(22, 21, 25, 0.75);
  color: white;
  padding: 4.5px 18px;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.75);
  z-index: 9999;
  border-radius: var(--border-radius-full);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 34px -20px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  transition: opacity 0.15s var(--ease-out),
              transform 0.15s var(--ease-out);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.cursor-text-bubble.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ============================================
   Service Tag Image Preview
   ============================================ */
.service-preview-image {
  position: fixed;
  left: 0;
  top: 0;
  width: 256px;
  height: 160px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -102%) scale(0.75);
  z-index: 9999;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 34px -20px rgba(0, 0, 0, 0.25);
  transition: opacity 0.15s var(--ease-out),
              transform 0.15s var(--ease-out);
}

.service-preview-image.visible {
  opacity: 1;
  transform: translate(-50%, -102%) scale(1);
}

.service-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================
   Responsive
   ============================================ */
@media screen and (max-width: 991px) {
  .hero-grid,
  .faq-container,
  .case-study-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
  
  .project-metadata {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .hero-grid > div,
  .content-grid > div {
    max-width: 100%;
    width: 100%;
  }
  
  .hero-grid-content {
    max-width: 100%;
  }
  
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .bento-large,
  .bento-medium,
  .bento-small {
    grid-column: span 1;
    grid-row: span 1;
  }
}

@media screen and (max-width: 767px) {
  /* Services modal mobile */
  .services-modal {
    padding: 16px;
  }

  .services-modal-content {
    padding: 40px 24px;
    max-width: 100%;
  }

  .services-modal-close {
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
  }

  /* Prevent horizontal scroll */
  body,
  html {
    overflow-x: hidden;
    max-width: 100%;
  }
  
  main {
    overflow-x: hidden;
    max-width: 100%;
  }
  
  /* Content sections */
  .content-section {
    margin-top: 72px;
    margin-bottom: var(--spacing-md);
  }

  /* Add top padding for fixed header */
  main > section:first-of-type {
    padding-top: 80px;
  }

  main > section.blog-post-header {
    padding-top: 144px;
  }

  .content-grid > div.fade-in {
    margin-bottom: var(--spacing-md);
  }
  
  /* Typography adjustments */
  .hero-title,
  h1.hero-title {
    font-size: 28px;
    line-height: 115%;
  }
  
  .hero-grid-title {
    font-size: 28px;
    line-height: 115%;
  }
  
  .section-title {
    font-size: 24px;
  }
  
  /* Services and get started */
  .services-list,
  .get-started-grid {
    max-width: 100%;
  }

  .services-section .get-started-header {
    flex-wrap: wrap;
  }
  
  /* Project sections */
  .project-section {
    margin-bottom: var(--spacing-md);
  }

  .selected-work-section {
    margin-bottom: 0;
  }

  .project-carousel-wrapper,
  .project-carousel,
  .project-carousel-images {
    max-width: 100%;
    overflow: hidden;
  }
  
  .project-gallery {
    grid-template-columns: 1fr;
  }
  
  .project-gallery-item-big,
  .project-gallery-item-medium,
  .project-gallery-text {
    grid-column: 1 / -1;
  }
  
  /* FAQ */
  .faq-icon {
    width: 1.75rem;
    height: 1.75rem;
  }
  
  /* Footer — tighter gap on mobile */
  .footer-bottom {
    gap: var(--spacing-sm);
  }
  
  /* Text links and buttons */
  .text-link {
    font-size: 16px;
  }

  .cta-button {
    font-size: 16px;
    white-space: normal;
  }

  /* Available now badge */
  .available-now-badge {
    max-width: 100%;
    background: none;
    border: 1px solid var(--color-bg-light);
    animation: none;
  }

  .available-now-text {
    font-size: 12px;
    white-space: normal;
  }

  /* Hero title wrapper */
  .hero-title-wrapper {
    max-width: 100%;
  }

  /* Disable star border on mobile */
  .get-started-card,
  .services-section .service-item,
  .hero-grid > div {
    padding: 0;
    margin: 0;
    border: none;
  }

  .hero-grid {
    min-height: 0;
  }

  .hero-grid > div {
    min-height: 0;
    height: auto;
    justify-content: flex-start;
  }

  .hero-grid > div .cta-button {
    margin-top: 12px;
  }

  /* Tags */
  .tag-flex {
    flex-wrap: wrap;
    gap: 8px;
  }

  .tags {
    white-space: normal;
  }

  .service-preview-image {
    display: none;
  }

  /* Service items */
  .service-item {
    max-width: 100%;
  }

  .service-title-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Get started cards */
  .get-started-card {
    max-width: 100%;
  }
  
  .get-started-card h3 {
    font-size: 16px;
  }
  
  .get-started-card p {
    font-size: 16px;
    line-height: 150%;
  }

  /* Image lightbox */
  .image-lightbox {
    padding: var(--spacing-sm);
  }

  .image-lightbox-close {
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .image-lightbox img {
    max-height: 85vh;
  }
}

@media screen and (max-width: 479px) {
  /* Typography for very small screens */
  h1, h2 {
    font-size: 24px;
    line-height: 115%;
  }
  
  .hero-title,
  h1.hero-title {
    font-size: 24px;
    line-height: 115%;
  }
  
  .hero-grid-title {
    font-size: 24px;
  }
  
  .section-title {
    font-size: 20px;
  }
  
  body {
    font-size: 16px;
    line-height: 150%;
  }
  
  /* Carousel arrows */
  .carousel-arrow {
    width: 32px;
    height: 32px;
  }
  
  .carousel-arrow i {
    width: 16px;
    height: 16px;
  }
  
  .carousel-prev {
    left: 8px;
  }
  
  .carousel-next {
    right: 8px;
  }

  /* Blog */
  .blog-meta {
    gap: var(--spacing-sm);
    flex-direction: column;
  }

  /* Buttons */
  .btn,
  .cta-button {
    padding: 0.25rem 0.75rem;
    line-height: 1.4;
    font-size: 16px;
    white-space: normal;
  }
  
  /* Navigation */
  .nav-logo {
    font-size: 14px;
  }
  
  /* Available now badge */
  .available-now-text {
    font-size: 11px;
  }
  
  /* Tags */
  .tags {
    padding: 0 4px;
  }
  
  /* Service items */
  .service-title-row h3 {
    font-size: 16px;
  }

  .service-item p {
    font-size: 16px;
    line-height: 150%;
  }

  /* Get started cards */
  .get-started-card h3 {
    font-size: 16px;
  }

  .get-started-card p {
    font-size: 16px;
    line-height: 150%;
  }
}

/* ============================================
   Page Transition — White Overlay
   ============================================ */
@keyframes page-reveal {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-100%);
  }
}

.page-transition::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #ffffff;
  animation: page-reveal 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0.1s forwards;
  pointer-events: none;
}

/* ============================================
   Page Entrance — Content Slide Up
   ============================================ */
@keyframes slide-up-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes header-fade-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.page-transition main > section,
.page-transition main > article {
  opacity: 0;
  animation: slide-up-in 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.page-transition .main-header {
  opacity: 0;
  animation: header-fade-in 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.35s forwards;
}

.page-transition main > section:nth-child(1),
.page-transition main > article:nth-child(1) {
  animation-delay: 0.4s;
}

.page-transition main > section:nth-child(2),
.page-transition main > article:nth-child(2) {
  animation-delay: 0.5s;
}

.page-transition main > section:nth-child(3),
.page-transition main > article:nth-child(3) {
  animation-delay: 0.6s;
}

.page-transition main > section:nth-child(4),
.page-transition main > article:nth-child(4) {
  animation-delay: 0.7s;
}

.page-transition main > section:nth-child(n+5),
.page-transition main > article:nth-child(n+5) {
  animation-delay: 0.75s;
}

.page-transition .footer {
  opacity: 0;
  animation: slide-up-in 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.8s forwards;
}

/* ============================================
   Wide Container — Project Images
   ============================================ */
.container-wide {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
  padding-left: 16px;
  padding-right: 16px;
}
