/**
 * Insaat theme — reusable UI system (tokens, sections, motion).
 * Depends on main.css variables: --primary-color, --secondary-color, --card-bg, etc.
 */

/* -------------------------------------------------------------------------
   Design tokens (spacing, motion, elevation)
   ------------------------------------------------------------------------- */
:root {
  --ui-space-1: 0.25rem;
  --ui-space-2: 0.5rem;
  --ui-space-3: 0.75rem;
  --ui-space-4: 1rem;
  --ui-space-5: 1.25rem;
  --ui-space-6: 1.5rem;
  /* Standard spacing scale (requested): section=80px, element=20px, small=10px */
  --ui-space-sm: 0.625rem; /* 10px */
  --ui-space-md: 1.25rem; /* 20px */
  --ui-space-section: 5rem; /* 80px */
  --ui-space-8: 2rem;
  --ui-space-10: 2.5rem;
  --ui-space-12: 3rem;
  --ui-radius-sm: 0.5rem;
  --ui-radius-md: 0.75rem;
  --ui-radius-lg: 1rem;
  --ui-radius-xl: 1.25rem;
  --ui-shadow-sm: var(--shadow-soft);
  --ui-shadow-md: var(--shadow-medium);
  --ui-shadow-lg: var(--shadow-strong);
  --ui-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  /* Motion: 200–400ms for UI; reveal slightly slower for legibility */
  --ui-motion-fast: 0.2s;
  --ui-motion-base: 0.28s;
  --ui-motion-slow: 0.36s;
  --ui-duration: 0.45s;
  --ui-duration-fast: var(--ui-motion-fast);
  --ui-font-display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
}

@media (hover: none), (max-width: 768px) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--ui-font-display);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* -------------------------------------------------------------------------
   Typography defaults (readability + consistency)
   ------------------------------------------------------------------------- */
p {
  line-height: 1.6;
}

.inner-prose h1,
.inner-prose h2,
.inner-prose h3 {
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  color: color-mix(in srgb, var(--color-text) 86%, var(--color-primary));
}

.inner-prose hr {
  border: 0;
  margin: 2.25rem 0;
  height: 0;
  border-top: 1px solid var(--border-color);
}

@supports (color: color-mix(in srgb, red, blue)) {
  .inner-prose hr {
    height: 1px;
    border-top: 0;
    background: linear-gradient(
      90deg,
      transparent,
      color-mix(in srgb, var(--color-primary) 44%, var(--border-color)),
      transparent
    );
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* -------------------------------------------------------------------------
   Scroll reveal — fade-up (default), fade-in, slide-in + [data-ui-reveal]
   ------------------------------------------------------------------------- */
.ui-reveal,
[data-ui-reveal] {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity var(--ui-motion-slow) var(--ui-ease-out),
    transform var(--ui-motion-slow) var(--ui-ease-out);
  transition-delay: calc(var(--ui-reveal-order, 0) * 40ms);
}

.ui-reveal.ui-reveal--fade-in,
[data-ui-reveal][data-ui-variant="fade"] {
  transform: none;
}

.ui-reveal.ui-reveal--slide-in,
[data-ui-reveal][data-ui-variant="slide"] {
  transform: translate3d(22px, 0, 0);
}

.ui-reveal.is-inview,
[data-ui-reveal].is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .ui-reveal,
  [data-ui-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* -------------------------------------------------------------------------
   Buttons — outline + refined hovers (extends .btn from main.css)
   ------------------------------------------------------------------------- */
.btn {
  border-radius: clamp(12px, 1.1vw, 14px);
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  transition:
    transform 280ms ease,
    box-shadow 280ms ease,
    background-color 280ms ease,
    border-color 280ms ease,
    color 280ms ease,
    background-image 280ms ease;
}

.btn:hover {
  transform: translate3d(0, -2px, 0);
}

.btn:active {
  transform: translate3d(0, 0, 0);
}

.btn--outline {
  background: transparent;
  color: var(--primary-color);
  border-color: color-mix(in srgb, var(--primary-color) 55%, transparent);
  box-shadow: none;
}

.btn--outline:hover {
  background: color-mix(in srgb, var(--primary-color) 12%, transparent);
  transform: translate3d(0, -2px, 0);
  border-color: var(--primary-color);
  filter: brightness(1.02);
}

/* Fallback when color-mix unsupported */
@supports not (color: color-mix(in srgb, red, blue)) {
  .btn--outline {
    border-color: var(--primary-color);
  }

  .btn--outline:hover {
    background: rgba(15, 23, 42, 0.06);
  }
}

.service-card .btn--outline,
.project-card .btn--outline {
  color: var(--text-color);
  border-color: var(--border-color);
}

/* -------------------------------------------------------------------------
   Header polish — desktop micro-interactions (no behavior changes)
   ------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .site-branding__link:hover {
    transform: translateY(-1px);
    opacity: 0.92;
  }

  .site-branding__link:hover .site-logo {
    transform: scale(1.05);
  }

  .primary-nav__item a:hover {
    opacity: 0.8;
    transform: none;
  }

  .primary-nav__item a.active,
  .primary-nav__item.current-menu-item a {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 2px;
  }
}

/* -------------------------------------------------------------------------
   Section system
   ------------------------------------------------------------------------- */
.ui-section {
  position: relative;
}

.ui-section__inner {
  position: relative;
  z-index: 1;
}

.ui-section--hero .home-hero__inner,
.ui-section--hero .ui-project-hero__inner {
  position: relative;
  z-index: 2;
}

.home-section.ui-section .home-section__intro {
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  max-width: 42rem;
}

/* -------------------------------------------------------------------------
   Cards — service & project (premium hover)
   ------------------------------------------------------------------------- */
.service-card.ui-reveal,
.project-card.ui-reveal {
  transition:
    transform var(--ui-motion-base) var(--ui-ease-out),
    box-shadow var(--ui-motion-base) var(--ui-ease-out),
    border-color var(--ui-motion-base) var(--ui-ease-out),
    opacity var(--ui-motion-slow) var(--ui-ease-out);
}

.service-card {
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-sm);
  overflow: hidden;
}

.service-card.ui-reveal.is-inview:hover,
.service-card.ui-reveal.is-inview:focus-within {
  transform: translate3d(0, -4px, 0) scale(1.02);
  box-shadow:
    var(--ui-shadow-md),
    0 0 0 1px color-mix(in srgb, var(--color-primary) 12%, transparent),
    0 14px 38px color-mix(in srgb, var(--color-primary) 10%, transparent);
  border-color: color-mix(in srgb, var(--primary-color) 22%, var(--border-color));
}

.project-card {
  border-radius: var(--ui-radius-xl);
  box-shadow: var(--ui-shadow-sm);
}

.project-card--type-before_after.ui-reveal.is-inview:hover,
.project-card--type-before_after.ui-reveal.is-inview:focus-within,
.project-card--type-single.ui-reveal.is-inview:hover,
.project-card--type-single.ui-reveal.is-inview:focus-within,
.project-card--type-gallery.ui-reveal.is-inview:hover,
.project-card--type-gallery.ui-reveal.is-inview:focus-within {
  transform: translate3d(0, -5px, 0) scale(1.03);
  box-shadow:
    var(--ui-shadow-lg),
    0 0 0 1px color-mix(in srgb, var(--color-primary) 14%, transparent),
    0 17px 44px color-mix(in srgb, var(--color-primary) 9%, transparent);
  border-color: color-mix(in srgb, var(--primary-color) 25%, var(--border-color));
}

@supports not (color: color-mix(in srgb, red, blue)) {
  .service-card:hover,
  .project-card--type-before_after:hover,
  .project-card--type-single:hover,
  .project-card--type-gallery:hover {
    border-color: var(--primary-color);
  }
}

/* -------------------------------------------------------------------------
   Home hero (construction premium)
   ------------------------------------------------------------------------- */
.home-hero.ui-section--hero {
  min-height: min(72vh, 38rem);
  display: flex;
  align-items: stretch;
}

.home-hero.ui-section--hero .home-hero__overlay {
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--secondary-color) 88%, transparent) 0%,
    color-mix(in srgb, var(--secondary-color) 45%, transparent) 45%,
    color-mix(in srgb, var(--primary-color) 35%, transparent) 100%
  );
}

@supports not (color: color-mix(in srgb, red, blue)) {
  .home-hero.ui-section--hero .home-hero__overlay {
    background: linear-gradient(120deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.55) 50%, rgba(100, 116, 139, 0.4) 100%);
  }
}

.home-hero.ui-section--hero .home-hero__title {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  max-width: 20ch;
}

.home-hero.ui-section--hero .home-hero__lead {
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  max-width: 36rem;
  line-height: 1.65;
}

.home-hero.ui-section--hero .home-hero__actions .btn {
  border-radius: var(--ui-radius-md);
}

/* -------------------------------------------------------------------------
   Project single — large hero
   ------------------------------------------------------------------------- */
.ui-project-hero {
  position: relative;
  min-height: min(52vh, 28rem);
  display: flex;
  align-items: flex-end;
  background-color: var(--secondary-color);
  background-image: var(
    --ui-project-hero-image,
    linear-gradient(145deg, var(--secondary-color) 0%, color-mix(in srgb, var(--secondary-color) 70%, var(--primary-color)) 100%)
  );
  background-size: cover;
  background-position: center;
}

.ui-project-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--secondary-color) 25%, transparent) 0%,
    color-mix(in srgb, var(--secondary-color) 78%, transparent) 55%,
    color-mix(in srgb, var(--secondary-color) 92%, transparent) 100%
  );
  pointer-events: none;
}

@supports not (color: color-mix(in srgb, red, blue)) {
  .ui-project-hero__overlay {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.75) 100%);
  }
}

.ui-project-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--ui-space-10) var(--ui-space-4) var(--ui-space-8);
}

.ui-project-hero__breadcrumb {
  margin: 0 0 var(--ui-space-4);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--home-hero-title-color) 85%, transparent);
}

.ui-project-hero__crumb {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--ui-duration-fast) var(--ui-ease-out), color var(--ui-duration-fast) var(--ui-ease-out);
}

.ui-project-hero__crumb:hover {
  color: var(--home-hero-title-color);
  border-bottom-color: color-mix(in srgb, var(--home-hero-title-color) 50%, transparent);
}

.ui-project-hero__crumb--current {
  color: var(--home-hero-title-color);
  font-weight: 700;
  max-width: 100%;
  display: inline-block;
  vertical-align: bottom;
}

.ui-project-hero__crumb-sep {
  margin: 0 0.35rem;
  opacity: 0.55;
}

.ui-project-hero__title {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(1.85rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--home-hero-title-color);
  text-shadow: 0 2px 24px color-mix(in srgb, var(--color-text) 35%, transparent);
}

.ui-section--project-body {
  padding-top: var(--ui-space-10);
  padding-bottom: var(--ui-space-12);
}

/* -------------------------------------------------------------------------
   Project content blocks (layout polish)
   ------------------------------------------------------------------------- */
.project-blocks--ui {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-8);
}

.project-blocks--ui .project-block-wrap {
  margin: 0;
}

.project-blocks--ui .project-block--heading {
  margin: 0;
  padding-bottom: var(--ui-space-2);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-color);
  border-bottom: 2px solid color-mix(in srgb, var(--primary-color) 55%, transparent);
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
}

.project-blocks--ui .project-block--text .project-block__text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.project-blocks--ui .project-block--media {
  border-radius: var(--ui-radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--ui-shadow-md);
  background: var(--card-bg);
}

.project-blocks--ui .project-block--image .project-block__img {
  width: 100%;
  display: block;
  max-height: min(70vh, 520px);
  object-fit: cover;
}

.project-blocks--ui .project-block--gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--ui-space-3);
  padding: var(--ui-space-3);
  border: none;
}

.project-blocks--ui .project-block--gallery .project-block__gallery-item {
  margin: 0;
  border-radius: var(--ui-radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.project-blocks--ui .project-block--gallery .project-block__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--ui-duration) var(--ui-ease-out);
}

.project-blocks--ui .project-block--gallery .project-block__gallery-item:hover .project-block__img {
  transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
  .project-blocks--ui .project-block--gallery .project-block__img {
    transition: none;
  }

  .project-blocks--ui .project-block--gallery .project-block__gallery-item:hover .project-block__img {
    transform: none;
  }
}

/* Before / after — comparison strip */
.project-blocks--ui .project-block--compare {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  border: none;
  box-shadow: var(--ui-shadow-lg);
}

@media (min-width: 640px) {
  .project-blocks--ui .project-block--compare {
    grid-template-columns: 1fr 1fr;
  }
}

.project-blocks--ui .project-block--compare .project-block__shot {
  margin: 0;
  position: relative;
}

.project-blocks--ui .project-block--compare .project-block__shot--before {
  border-right: 3px solid var(--primary-color);
}

.project-blocks--ui .project-block--compare .project-block__img {
  width: 100%;
  height: 100%;
  min-height: 200px;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.project-blocks--ui .project-block--compare .project-block__caption {
  position: absolute;
  left: var(--ui-space-3);
  bottom: var(--ui-space-3);
  margin: 0;
  padding: var(--ui-space-2) var(--ui-space-3);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: color-mix(in srgb, var(--color-text) 82%, transparent);
  color: var(--home-hero-title-color);
  border-radius: var(--ui-radius-sm);
}

.project-blocks--ui .project-block--video {
  padding: var(--ui-space-3);
}

.project-blocks--ui .project-block__video--embed iframe {
  border-radius: var(--ui-radius-md);
}

.project-blocks--ui .project-block--list {
  padding: var(--ui-space-4) var(--ui-space-5);
  background: color-mix(in srgb, var(--card-bg) 92%, var(--primary-color));
  border-radius: var(--ui-radius-lg);
  border: 1px solid var(--border-color);
}

@supports not (color: color-mix(in srgb, red, blue)) {
  .project-blocks--ui .project-block--list {
    background: var(--card-bg);
  }
}

/* CTA band on project page */
.ui-page-project .home-cta-band.cta-surface.ui-section--cta {
  margin-top: 0;
}

/* Inner pages — hero titles */
.inner-hero.ui-section .inner-hero__title {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.inner-hero.ui-section .inner-hero__lead {
  font-size: clamp(0.98rem, 2.2vw, 1.08rem);
  line-height: 1.6;
  max-width: 36rem;
}

/* -------------------------------------------------------------------------
   Grids — extra breathing room
   ------------------------------------------------------------------------- */
.home-services__grid {
  gap: var(--ui-space-5);
}

@media (min-width: 640px) {
  .home-services__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .home-services__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.home-projects__grid {
  gap: var(--ui-space-6);
}

@media (min-width: 640px) {
  .home-projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* -------------------------------------------------------------------------
   Layout shells (home + inner pages)
   ------------------------------------------------------------------------- */
.layout-home,
.layout-inner {
  width: 100%;
}

/* -------------------------------------------------------------------------
   Home — about preview
   ------------------------------------------------------------------------- */
.home-about-preview__inner {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.home-about-preview__title {
  margin: 0 0 var(--ui-space-4);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--secondary-color);
  color: color-mix(in srgb, var(--color-text) 78%, var(--color-secondary));
}

.home-about-preview__lead {
  margin: 0 0 var(--ui-space-4);
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  line-height: 1.6;
  color: var(--text-color);
  font-weight: 600;
}

.home-about-preview__excerpt {
  margin: 0 0 var(--ui-space-6);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  line-height: 1.65;
  color: var(--text-muted);
}

.home-about-preview__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-3);
}

/* -------------------------------------------------------------------------
   Footer navigation
   ------------------------------------------------------------------------- */
.site-footer__nav {
  margin: var(--ui-space-6) 0 0;
  padding-top: var(--ui-space-5);
  border-top: 1px solid var(--border-color);
}

.site-footer__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ui-space-2) var(--ui-space-5);
}

.site-footer__menu a {
  color: var(--secondary-color);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition:
    background-size var(--ui-motion-base) var(--ui-ease-out),
    color var(--ui-motion-base) var(--ui-ease-out);
}

.site-footer__menu a:hover,
.site-footer__menu a:focus-visible {
  color: var(--primary-color);
  background-size: 100% 1px;
}

/* -------------------------------------------------------------------------
   Motion polish — imagery, links, layout rhythm (front-end)
   ------------------------------------------------------------------------- */

/* Section rhythm */
.home-section.ui-section {
  /* Standardize toward 80px section spacing while remaining responsive. */
  padding-block: clamp(3.5rem, 6vw, var(--ui-space-section));
  padding-inline: clamp(1rem, 4vw, 1.5rem);
}

.home-section.ui-section .home-section__title {
  margin-bottom: var(--ui-space-4);
  font-size: clamp(1.35rem, 3.2vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-main);
  color: color-mix(in srgb, var(--color-text) 82%, var(--color-primary));
}

.home-section.ui-section .home-section__title:not(.screen-reader-text)::after {
  content: "";
  display: block;
  width: min(4.25rem, 20%);
  height: 3px;
  margin-top: 0.5rem;
  border-radius: 999px;
  background: var(--primary-gradient);
  opacity: 0.9;
}

.home-section.ui-section .home-section__intro {
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  line-height: 1.65;
}

/* Service / project card media — zoom + gradient veil */
.service-card__media {
  position: relative;
  isolation: isolate;
}

/* Generic cards (shared across pages) */
.card,
.contact-card {
  border-radius: var(--ui-radius-xl);
  box-shadow: var(--ui-shadow-sm);
  transition:
    transform var(--ui-motion-slow) var(--ui-ease-out),
    box-shadow var(--ui-motion-slow) var(--ui-ease-out),
    border-color var(--ui-motion-slow) var(--ui-ease-out);
}

.card:hover,
.contact-card:hover {
  transform: translateY(-5px);
  box-shadow:
    var(--ui-shadow-lg),
    0 0 0 1px color-mix(in srgb, var(--color-primary) 11%, transparent),
    0 20px 50px color-mix(in srgb, var(--color-primary) 7%, transparent);
}

@supports (color: color-mix(in srgb, red, blue)) {
  .card:hover,
  .contact-card:hover {
    border-color: color-mix(in srgb, var(--color-primary) 18%, var(--border-color));
  }
}

.card img,
.contact-card img {
  transition: transform var(--ui-motion-slow) var(--ui-ease-out);
  will-change: transform;
}

.card:hover img,
.contact-card:hover img {
  transform: scale(1.05);
}

.service-card__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(
    195deg,
    transparent 40%,
    color-mix(in srgb, var(--secondary-color) 45%, transparent) 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ui-motion-base) var(--ui-ease-out);
}

.service-card:hover .service-card__media::before,
.service-card:focus-within .service-card__media::before {
  opacity: 1;
}

.service-card__img {
  transition: transform calc(var(--ui-motion-slow) + 0.04s) var(--ui-ease-out);
  transform-origin: center center;
}

.service-card:hover .service-card__img,
.service-card:focus-within .service-card__img {
  transform: scale(1.05);
}

.project-card__shot,
.project-card__single {
  position: relative;
  overflow: hidden;
  border-radius: var(--ui-radius-md);
}

.project-card__caption {
  z-index: 2;
}

.project-card__shot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    transparent 50%,
    color-mix(in srgb, var(--secondary-color) 55%, transparent) 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ui-motion-base) var(--ui-ease-out);
}

.project-card.ui-reveal.is-inview:hover .project-card__shot::after {
  opacity: 1;
}

/* Single + gallery: gradient veil on ::before; diagonal shine uses ::after (.theme-shine-effect). */
.project-card__single .project-card-image-wrapper::before,
.project-gallery .project-card-image-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    transparent 50%,
    color-mix(in srgb, var(--secondary-color) 55%, transparent) 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ui-motion-base) var(--ui-ease-out);
}

.project-card--type-single.ui-reveal.is-inview:hover .project-card-image-wrapper::before,
.project-card--type-gallery.ui-reveal.is-inview:hover .project-card-image-wrapper::before {
  opacity: 1;
}

.project-card__img {
  transform-origin: center center;
}

/* Before/after: shot overlay + image motion in main.css. Single/gallery: same overlay on .project-card-image-wrapper + same image motion on wrapper:hover. */

@supports not (color: color-mix(in srgb, red, blue)) {
  .service-card__media::before {
    background: linear-gradient(195deg, transparent 40%, rgba(15, 23, 42, 0.5) 100%);
  }

  .project-card__shot::after,
  .project-card__single .project-card-image-wrapper::before,
  .project-gallery .project-card-image-wrapper::before {
    background: linear-gradient(180deg, transparent 50%, rgba(15, 23, 42, 0.55) 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-card__img,
  .project-card__img {
    transition: none;
  }

  .service-card:hover .service-card__img,
  .service-card:focus-within .service-card__img,
  .project-card--type-before_after:hover .project-card__shot .project-card__img,
  .project-card--type-single:hover .project-card-image-wrapper img,
  .project-card--type-single:hover .project-card-image-wrapper picture img,
  .project-card--type-gallery:hover .project-card-image-wrapper img,
  .project-card--type-gallery:hover .project-card-image-wrapper picture img {
    transform: none;
    filter: none;
  }

  .service-card__media::before,
  .project-card__shot::after,
  .project-card__single .project-card-image-wrapper::before,
  .project-gallery .project-card-image-wrapper::before {
    transition: none;
    opacity: 0;
  }

  .theme-shine-effect:not(.btn)::after {
    transition: none !important;
    transform: none !important;
    opacity: 0 !important;
  }
}

/* -------------------------------------------------------------------------
   Premium shine — diagonal glint (::after). Image gradient veils use ::before.
   ------------------------------------------------------------------------- */
.theme-shine-effect:not(.btn)::after {
  content: "";
  position: absolute;
  top: -18%;
  left: -55%;
  width: 42%;
  height: 136%;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    118deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.07) 40%,
    rgba(255, 255, 255, 0.26) 50%,
    rgba(255, 255, 255, 0.07) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translate3d(-165%, 0, 0) skewX(-18deg);
  opacity: 0;
  transition:
    transform 0.55s var(--ui-ease-out),
    opacity 0.35s ease;
}

.theme-shine-effect:not(.btn):hover::after,
.theme-shine-effect:not(.btn):focus-visible::after,
.blog-card:hover .blog-card__media.theme-shine-effect::after,
.blog-card:focus-visible .blog-card__media.theme-shine-effect::after,
.service-card:hover .service-card__media.theme-shine-effect::after,
.service-card:focus-within .service-card__media.theme-shine-effect::after,
.project-card--type-single.ui-reveal.is-inview:hover .project-card-image-wrapper.theme-shine-effect::after,
.project-card--type-single.ui-reveal.is-inview:focus-within .project-card-image-wrapper.theme-shine-effect::after,
.project-card--type-gallery.ui-reveal.is-inview:hover .project-card-image-wrapper.theme-shine-effect::after,
.project-card--type-gallery.ui-reveal.is-inview:focus-within .project-card-image-wrapper.theme-shine-effect::after {
  transform: translate3d(310%, 0, 0) skewX(-18deg);
  opacity: 1;
}

/* Prose & card links — default reads as body text; hover picks up primary + underline */
.inner-prose a:not(.btn),
.service-card__title-link,
.project-card__title a,
.project-card__detail-link {
  color: var(--color-text);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition:
    background-size var(--ui-motion-base) var(--ui-ease-out),
    color var(--ui-motion-base) var(--ui-ease-out);
}

.inner-prose a:not(.btn):hover,
.inner-prose a:not(.btn):focus-visible,
.service-card__title-link:hover,
.service-card__title-link:focus-visible,
.project-card__title a:hover,
.project-card__title a:focus-visible,
.project-card__detail-link:hover,
.project-card__detail-link:focus-visible {
  color: var(--color-primary);
  background-size: 100% 1px;
  text-decoration: none;
}

.inner-prose a:not(.btn):focus-visible {
  outline: none;
  border-radius: 0.15em;
  box-shadow: var(--focus-ring);
}

@supports (color: color-mix(in srgb, red, blue)) {
  .service-card__icon-wrap {
    color: color-mix(in srgb, var(--color-primary) 90%, var(--color-text));
  }
}

/* Primary nav (desktop): underline slides in */
@media (min-width: 992px) {
  .primary-nav__item:not(.current-menu-item) a:not(.active) {
    background-image: linear-gradient(var(--primary-color), var(--primary-color));
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    padding-bottom: 2px;
    transition:
      background-size var(--ui-motion-base) var(--ui-ease-out),
      color var(--ui-motion-base) var(--ui-ease-out),
      transform var(--ui-motion-fast) var(--ui-ease-out);
  }

  .primary-nav__item:not(.current-menu-item) a:not(.active):hover,
  .primary-nav__item:not(.current-menu-item) a:not(.active):focus-visible {
    background-size: 100% 2px;
  }
}

/* Header CTA — icon nudge (lift/shine: main.css shared with .btn--primary) */
.header-cta__icon {
  transition: transform 200ms ease;
}

.header-cta:hover .header-cta__icon,
.header-cta:focus-visible .header-cta__icon {
  transform: translateX(3px);
}

/* Testimonials */
.testimonial-card.ui-reveal {
  border-radius: var(--ui-radius-lg);
  transition:
    transform var(--ui-motion-base) var(--ui-ease-out),
    box-shadow var(--ui-motion-base) var(--ui-ease-out),
    border-color var(--ui-motion-base) var(--ui-ease-out),
    opacity var(--ui-motion-slow) var(--ui-ease-out);
}

.testimonial-card.ui-reveal.is-inview:hover {
  box-shadow: var(--ui-shadow-md);
  transform: translateY(-3px) scale(1.01);
}

/* Project detail blocks — image hover polish */
.project-blocks--ui figure.project-block--image.project-block--media {
  position: relative;
}

.project-blocks--ui figure.project-block--image .project-block__img {
  transition: transform var(--ui-motion-slow) var(--ui-ease-out);
}

.project-blocks--ui figure.project-block--image:hover .project-block__img {
  transform: scale(1.03);
}

.project-blocks--ui figure.project-block--image.project-block--media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--ui-motion-base) var(--ui-ease-out);
  background: linear-gradient(180deg, transparent 50%, color-mix(in srgb, var(--secondary-color) 40%, transparent));
  border-radius: inherit;
}

.project-blocks--ui figure.project-block--image.project-block--media:hover::after {
  opacity: 1;
}

@supports not (color: color-mix(in srgb, red, blue)) {
  .project-blocks--ui figure.project-block--image.project-block--media::after {
    background: linear-gradient(180deg, transparent 50%, rgba(15, 23, 42, 0.45));
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-cta:hover .header-cta__icon,
  .header-cta:focus-visible .header-cta__icon {
    transform: none;
  }

  .testimonial-card.ui-reveal.is-inview:hover {
    transform: none;
  }

  .project-blocks--ui figure.project-block--image:hover .project-block__img {
    transform: none;
  }

  .inner-prose a:not(.btn),
  .site-footer__menu a,
  .primary-nav__item a {
    transition: none;
  }
}

/* -------------------------------------------------------------------------
   <picture> wrappers (WebP + fallback)
   ------------------------------------------------------------------------- */
.service-card__media picture,
.project-card__single picture,
.project-card__gallery-swiper picture,
.project-card__gallery-wrap picture,
.project-blocks--ui .project-block--image picture,
.project-blocks--ui .project-block__gallery-item picture {
  display: block;
  width: 100%;
}

/* -------------------------------------------------------------------------
   Blog UI (listing + detail + FAQ accordion)
   ------------------------------------------------------------------------- */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ui-space-6);
}

@media (min-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.blog-card {
  border-radius: var(--ui-radius-md);
  overflow: hidden;
  transition:
    transform var(--ui-motion-slow) var(--ui-ease-out),
    box-shadow var(--ui-motion-slow) var(--ui-ease-out),
    border-color var(--ui-motion-slow) var(--ui-ease-out);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  box-shadow: var(--ui-shadow-sm);
}

.blog-card:hover,
.blog-card:focus-visible {
  transform: translateY(-6px);
}

.blog-card:hover {
  box-shadow:
    var(--ui-shadow-md),
    0 0 0 1px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

.blog-card:focus-visible {
  outline: none;
  box-shadow:
    var(--ui-shadow-md),
    0 0 0 1px color-mix(in srgb, var(--color-primary) 14%, transparent),
    var(--focus-ring);
}

.blog-card__media {
  display: block;
  line-height: 0;
  position: relative;
  overflow: hidden;
  border-radius: var(--ui-radius-md) var(--ui-radius-md) 0 0;
}

.blog-card__img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.blog-card__content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 var(--ui-space-md) var(--ui-space-md);
}

.blog-card__header {
  padding-top: var(--ui-space-md);
}

.blog-card__excerpt {
  padding-top: var(--ui-space-sm);
}

.blog-card__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  color: color-mix(in srgb, var(--color-text) 88%, var(--color-primary));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__excerpt p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__cta {
  margin-top: auto;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding-top: var(--ui-space-sm);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  color: color-mix(in srgb, var(--text-muted) 88%, transparent);
  transition: color 0.22s var(--ui-ease-out);
}

.blog-card__cta-arrow {
  display: inline-block;
  transition: transform 0.22s var(--ui-ease-out);
}

.blog-card:hover .blog-card__cta,
.blog-card:focus-visible .blog-card__cta {
  color: var(--primary-color);
}

.blog-card:hover .blog-card__cta-arrow,
.blog-card:focus-visible .blog-card__cta-arrow {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .blog-card:hover .blog-card__cta-arrow,
  .blog-card:focus-visible .blog-card__cta-arrow {
    transform: none;
  }
}

@supports not (color: color-mix(in srgb, red, blue)) {
  .blog-card__cta {
    color: var(--text-muted);
  }
}

/* --- Blog detail (premium layout) --- */
body.blog-detail {
  background: color-mix(in srgb, var(--color-bg) 92%, var(--color-primary) 8%);
}

.blog-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 30px;
  border-radius: 16px;
  box-sizing: border-box;
  background: var(--card-bg, var(--bg-card));
  color: var(--text-color);
  border: 1px solid var(--border-color);
  box-shadow: var(--ui-shadow-md);
}

@supports (color: color-mix(in srgb, red, blue)) {
  .blog-container {
    border-color: color-mix(in srgb, var(--color-primary) 8%, var(--border-color));
  }
}

.blog-container > h1 {
  margin: 0 0 15px;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--text-color);
  color: color-mix(in srgb, var(--color-text) 86%, var(--color-primary));
}

.blog-container .blog-excerpt {
  margin: 0 0 20px;
  max-width: 100%;
  font-size: 1.08rem;
  line-height: 1.68;
  color: var(--text-muted);
}

.blog-container .blog-detail-meta {
  margin-top: 0;
  margin-bottom: var(--ui-space-4);
}

.blog-container .blog-content {
  max-width: 100%;
  margin-inline: 0;
  line-height: 1.7;
}

.blog-container .blog-content p {
  line-height: 1.7;
}

.blog-container .blog-detail__hero-media {
  margin: 0 0 var(--ui-space-5);
}

@media (max-width: 767px) {
  .blog-container {
    margin: 24px clamp(0.75rem, 3vw, 1rem);
    padding: clamp(15px, 4vw, 20px);
  }
}

.blog-detail-page .home-section.ui-section {
  padding-top: clamp(2rem, 5vw, 3.5rem);
}

.blog-detail {
  margin-top: 0;
  max-width: none;
}

.blog-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-top: var(--ui-space-4);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.blog-detail-meta__sep {
  opacity: 0.72;
  user-select: none;
  color: var(--text-muted);
}

@supports (color: color-mix(in srgb, red, blue)) {
  .blog-detail-meta__sep {
    color: color-mix(in srgb, var(--color-primary) 28%, var(--text-muted));
  }
}

.blog-detail-meta__item--cat {
  font-weight: 600;
  color: color-mix(in srgb, var(--text-color) 72%, var(--text-muted));
}

.blog-detail__hero-media {
  margin: clamp(1.25rem, 3vw, 2rem) auto 0;
  max-width: min(100%, 56rem);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 18px 40px color-mix(in srgb, var(--text-color) 12%, transparent),
    0 2px 8px color-mix(in srgb, var(--text-color) 8%, transparent);
}

.blog-detail__hero-img {
  width: 100%;
  max-height: 520px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.blog-content {
  max-width: 52rem;
  margin-inline: auto;
}

.blog-content > * + * {
  margin-top: 1.15rem;
}

.blog-content p {
  line-height: 1.7;
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.blog-content p:last-child {
  margin-bottom: 0;
}

.blog-content h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: clamp(1.35rem, 2.8vw, 1.65rem);
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.blog-content h2:first-child {
  margin-top: 0;
}

.blog-content h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: clamp(1.15rem, 2.2vw, 1.3rem);
  line-height: 1.32;
  font-weight: 700;
}

.blog-content ul,
.blog-content ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
  line-height: 1.7;
}

.blog-detail-cta {
  margin-top: var(--ui-space-8);
  max-width: 52rem;
  margin-inline: auto;
  padding: clamp(1.35rem, 3vw, 2rem);
  border-radius: var(--ui-radius-xl);
  background: color-mix(in srgb, var(--primary-color) 8%, var(--bg-color));
  border: 1px solid color-mix(in srgb, var(--text-color) 10%, transparent);
  box-shadow: var(--ui-shadow-sm);
  background-clip: padding-box;
  background-origin: padding-box;
  overflow: hidden;
}

.blog-detail-cta__lead {
  margin: 0 0 var(--ui-space-4);
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--text-color);
}

.blog-detail-cta__actions {
  margin: 0;
}

.blog-detail-managed-cta {
  margin-top: var(--ui-space-8);
  max-width: 52rem;
  margin-inline: auto;
  text-align: center;
}

.blog-detail-managed-cta__inner {
  max-width: 38rem;
  margin-inline: auto;
}

.blog-detail-managed-cta__title {
  margin: 0 0 var(--ui-space-3);
  font-size: clamp(1.25rem, 2.8vw, 1.55rem);
  font-weight: 800;
  line-height: 1.25;
  color: inherit;
}

.blog-detail-managed-cta__text {
  margin: 0 0 var(--ui-space-5);
  font-size: 1.05rem;
  line-height: 1.68;
}

.blog-detail-managed-cta__actions {
  margin: 0;
}

.blog-detail-quote-cta {
  margin-top: var(--ui-space-8);
}

.blog-detail-quote-cta__inner {
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
}

.blog-detail-quote-cta__title {
  margin: 0 0 var(--ui-space-3);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  color: inherit;
}

.blog-detail-quote-cta__lead {
  margin: 0 0 var(--ui-space-5);
  font-size: 1.05rem;
  line-height: 1.65;
}

.blog-detail-quote-cta__actions {
  margin: 0;
}

.blog-faq {
  margin-top: var(--ui-space-8);
  max-width: 52rem;
  margin-inline: auto;
}

.blog-related {
  margin-top: var(--ui-space-8);
}

.blog-grid--related {
  margin-top: var(--ui-space-md);
  gap: var(--ui-space-lg);
}

.blog-card--related {
  box-shadow: var(--ui-shadow-sm);
}

.blog-card--related:hover,
.blog-card--related:focus-visible {
  transform: translateY(-8px);
  box-shadow: var(--ui-shadow-md);
}

.blog-card--related .blog-card__img {
  height: 170px;
}

.blog-final-cta {
  margin-top: var(--ui-space-8);
}

.home-cta-band__actions--stack-sm {
  flex-direction: column;
  align-items: stretch;
}

@media (min-width: 769px) {
  .home-cta-band__actions--stack-sm {
    flex-direction: row;
    align-items: center;
  }
}

.faq-list {
  border-top: 1px solid color-mix(in srgb, var(--text-color) 10%, transparent);
}

.faq-item {
  border-bottom: 1px solid color-mix(in srgb, var(--text-color) 10%, transparent);
  padding: 0.35rem 0;
}

.faq-item__q {
  margin: 0;
}

.faq-item__toggle {
  width: 100%;
  appearance: none;
  background: transparent;
  border: 0;
  text-align: left;
  padding: 0.85rem 0;
  font: inherit;
  font-weight: 700;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-4);
}

.faq-item__q-text {
  flex: 1 1 auto;
  min-width: 0;
}

.faq-item__icon {
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--color-primary) 16%, var(--border-color));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  transition:
    transform 0.3s var(--ui-ease-out),
    border-color 0.25s ease,
    background-color 0.25s ease;
}

.faq-item__icon::before {
  content: "+";
  display: block;
  transition: transform 0.3s var(--ui-ease-out);
}

.faq-item.is-open .faq-item__icon {
  border-color: color-mix(in srgb, var(--primary-color) 55%, transparent);
  background: color-mix(in srgb, var(--primary-color) 12%, transparent);
}

.faq-item.is-open .faq-item__icon::before {
  content: "−";
  transform: rotate(0deg);
}

.faq-item__a {
  display: grid;
  grid-template-rows: 0fr;
  transition:
    grid-template-rows 0.38s var(--ui-ease-out),
    opacity 0.28s ease;
  opacity: 0;
}

.faq-item.is-open .faq-item__a {
  grid-template-rows: 1fr;
  opacity: 1;
}

.faq-item__a-inner {
  min-height: 0;
  overflow: hidden;
}

.faq-item__a p {
  margin: 0 0 1rem;
  padding-top: 0.15rem;
  color: var(--text-muted);
  line-height: 1.68;
  font-size: 1rem;
}

.faq-item.is-open .faq-item__a p {
  padding-bottom: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
  .faq-item__a,
  .faq-item__icon,
  .faq-item__icon::before {
    transition: none;
  }

  .faq-item__a {
    grid-template-rows: none;
  }

  .faq-item:not(.is-open) .faq-item__a {
    display: none;
  }

  .faq-item.is-open .faq-item__a {
    display: block;
    opacity: 1;
  }
}

@media (max-width: 767px) {
  .blog-card__img {
    height: 200px;
  }

  .blog-container > h1 {
    font-size: 1.45rem;
  }

  .blog-detail__hero-media {
    border-radius: 12px;
  }

  .blog-detail-managed-cta__btn {
    width: 100%;
    justify-content: center;
  }

  .blog-detail-cta__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .blog-card--related .blog-card__img {
    height: 180px;
  }
}

/* -------------------------------------------------------------------------
   Performance — touch / coarse pointers: skip hover-only shine work;
   fine pointers: hint compositor for sweep transforms only.
   ------------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  .btn--primary::before,
  .header-cta::before,
  .home-hero__cta::before,
  .btn--wa::before,
  .btn--wa-dark::before,
  .btn--wa-light::before,
  .btn--wa-cta::before {
    will-change: transform;
  }
}

@media (hover: none) {
  .btn--primary::before,
  .header-cta::before,
  .home-hero__cta::before,
  .btn--wa::before,
  .btn--wa-dark::before,
  .btn--wa-light::before,
  .btn--wa-cta::before {
    transition: none;
    transform: none;
    opacity: 0;
  }

  .cta-surface:hover {
    transform: none;
    filter: none;
  }

  .theme-shine-effect:not(.btn)::after {
    transition: none;
    transform: none;
    opacity: 0;
  }
}
