:root {
  color-scheme: dark;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #f4f4f7;
  background-color: #07070a;
  --bg: #07070a;
  --surface: rgba(16, 17, 24, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --muted: #b2b2bb;
  --text: #f4f4f7;
  --accent: #9a5cff;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  /* Fluid spacing scale */
  --space-xl: clamp(32px, 3.2vw, 64px);
  --space-lg: clamp(24px, 2.6vw, 40px);
  --space-md: clamp(16px, 1.8vw, 28px);
  --space-sm: clamp(10px, 1.2vw, 18px);
  --space-xs: clamp(6px, 0.8vw, 12px);
  /* Fluid type scale (use with clamp where needed) */
  --type-lg: clamp(2rem, 3.6vw, 3.5rem);
  --type-md: clamp(1.1rem, 1.8vw, 1.35rem);
  --type-base: clamp(0.95rem, 1.4vw, 1rem);
  /* Container max widths per breakpoint */
  --container-max: 1400px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(154, 92, 255, 0.08), transparent 25%),
    radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.06), transparent 18%),
    #07070a;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

.container {
  width: min(var(--container-max), calc(100% - 2rem));
  margin: 0 auto;
}

/* Prevent horizontal overflow introduced by large visuals */
html, body { overflow-x: hidden; }

.page-shell {
  position: relative;
}

.site-header {
  position: relative;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(22px);
  background: rgba(7, 7, 10, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
  transition: padding 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 900px) {
  .page-shell {
    padding-top: 92px;
  }

  .site-header {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
  }
}

.site-header.scrolling {
  background: rgba(7, 7, 10, 0.95);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.site-header.scrolling .header-inner {
  padding: 0.75rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
}

.brand-logo {
  display: block;
  max-height: 35px;
  width: auto;
}

.site-nav {
  display: flex;
  gap: 0.6rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  position: relative;
  color: rgba(244, 244, 247, 0.78);
  font-size: 0.95rem;
  padding: 0.35rem 0.1rem;
  transition: color 0.24s ease, transform 0.24s ease;
}

.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(135deg, #9a5cff, #6e51ff);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s ease;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: #ffffff;
  transform: translateY(-1px);
}

.nav-list a:hover::after,
.nav-list a:focus-visible::after {
  transform: scaleX(1);
}

.nav-list a.active::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.lang-divider {
  color: rgba(244, 244, 247, 0.32);
}

.lang-button {
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: transparent;
  color: #f4f4f7;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.lang-button:hover,
.lang-button:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Keep language buttons visually compact but accessible (min touch area) */
.lang-button { min-width: 44px; min-height: 44px; padding-left: 0.6rem; padding-right: 0.6rem; }

/* Disable translate hover to avoid visual jump on small elements */
.lang-button:hover { transform: none; }

.lang-button:focus-visible { outline: 2px solid rgba(154,92,255,0.35); outline-offset: 3px; }

.lang-button.active {
  background: rgba(154, 92, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(154, 92, 255, 0.35);
}

/* Flag SVG styling for language buttons */
.lang-flag { width: 20px; height: 14px; display: block; }
.mobile-lang-button .lang-flag { width: 22px; height: 16px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.95rem 1.6rem;
  font-weight: 600;
  transition: transform 0.24s ease, background-color 0.24s ease, border-color 0.24s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 2px solid rgba(154, 92, 255, 0.45);
  outline-offset: 4px;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, #9a5cff, #6e51ff);
  box-shadow: 0 18px 40px rgba(154, 92, 255, 0.22);
}

.button-secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.menu-toggle {
  display: none;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  flex-direction: column;
  justify-content: space-between;
  padding: 0.35rem;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

/* Ensure touch targets meet minimum sizes */
.menu-toggle,
.lang-button,
.button,
.filter-button,
.contact-link { min-height: 44px; }

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #f4f4f7;
  border-radius: 999px;
}

.mobile-menu {
  display: none;
  padding: 1rem 0 1.5rem;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: rgba(7,7,10,0.98);
  border-top: 1px solid rgba(255,255,255,0.04);
  max-height: 70vh;
  overflow-y: auto;
}

.mobile-nav-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  list-style: none;
  padding: 0;
}

.mobile-nav-list a {
  color: #f4f4f7;
  font-size: 1rem;
}

/* Ensure mobile nav links are large enough for touch */
.mobile-nav-list a { padding: 0.8rem 1rem; display: block; }

.mobile-language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0 1rem;
}

.hero-section {
  min-height: auto;
  display: grid;
  align-items: center;
  padding: var(--space-lg) 0 var(--space-md);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.hero-section.in-view {
  opacity: 1;
  transform: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: center;
}

/* Ensure hero columns align vertically and center their content */
.hero-copy,
.hero-visual {
  align-self: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-copy { gap: 0.6rem; }
.hero-copy .hero-actions { margin-top: 1.1rem; }

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: #9a5cff;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.5rem);
  letter-spacing: -0.04em;
  line-height: 1.06;
  max-width: 32ch; /* keep hero title to multiple lines instead of spanning full width */
  overflow-wrap: normal;
  word-break: normal;
  -webkit-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

/* Prevent headings and long words from causing horizontal overflow */
h1, h2, h3, p, .brand-link {
  /* Prefer breaking at word boundaries only; avoid mid-word breaks and hyphenation */
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
  -webkit-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

.hero-lead {
  margin: 1rem 0 0.8rem;
  font-size: var(--type-md);
  max-width: min(48rem, 80%);
  color: #f7f7fb;
}

.hero-text {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-visual {
  position: relative;
}

.visual-card {
  position: relative;
  min-height: clamp(260px, 32vh, 520px);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(28, 26, 44, 0.9), rgba(15, 11, 30, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 8, 14, 0.05) 0%, rgba(8, 8, 14, 0.55) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-carousel-track {
  --carousel-direction: 1;
  position: absolute;
  inset: 0;
  isolation: isolate;
}

.hero-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  transform: scale(1.05) translate3d(calc(var(--carousel-direction) * 4%), 0, 0);
  filter: blur(10px);
  transition:
    opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.4s cubic-bezier(0.22, 1, 0.36, 1),
    filter 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform, filter;
}

.hero-carousel-slide.is-active:not(.is-entering):not(.is-leaving) {
  opacity: 1;
  z-index: 2;
  transform: scale(1) translate3d(0, 0, 0);
  filter: blur(0);
}

.hero-carousel-slide.is-leaving {
  opacity: 0;
  z-index: 1;
  transform: scale(0.985) translate3d(calc(var(--carousel-direction) * -3.5%), 0, 0);
  filter: blur(8px);
  transition:
    opacity 1.1s cubic-bezier(0.55, 0, 0.45, 1),
    transform 1.4s cubic-bezier(0.55, 0, 0.45, 1),
    filter 1s cubic-bezier(0.55, 0, 0.45, 1);
}

.hero-carousel-slide.is-entering {
  z-index: 2;
  opacity: 0;
  animation: hero-carousel-enter 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: none;
}

@keyframes hero-carousel-enter {
  from {
    opacity: 0;
    transform: scale(1.06) translate3d(calc(var(--carousel-direction) * 5%), 0, 0);
    filter: blur(12px);
  }

  to {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
    filter: blur(0);
  }
}

.hero-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.08);
  transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-carousel-slide.is-active:not(.is-leaving):not(.is-entering) img {
  animation: hero-carousel-ken-burns 6.5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.hero-carousel-slide.is-entering img {
  animation: hero-carousel-ken-burns 6.5s cubic-bezier(0.25, 0.1, 0.25, 1) 1.4s forwards;
}

.hero-carousel-slide.is-leaving img {
  animation: none;
  transform: scale(1.02);
}

.hero-carousel.is-transitioning .visual-overlay {
  animation: hero-carousel-overlay 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes hero-carousel-overlay {
  0% { opacity: 1; }
  35% { opacity: 0.72; }
  100% { opacity: 1; }
}

@keyframes hero-carousel-ken-burns {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

.hero-carousel-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  z-index: 3;
  pointer-events: none;
}

.hero-carousel-arrow {
  pointer-events: auto;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(8, 8, 14, 0.55);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.65;
  transform: translateY(0);
  transition: opacity 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  backdrop-filter: blur(8px);
}

.hero-carousel:hover .hero-carousel-arrow,
.hero-carousel:focus-within .hero-carousel-arrow {
  opacity: 1;
}

.hero-carousel-arrow:hover {
  background: rgba(154, 92, 255, 0.35);
  border-color: rgba(154, 92, 255, 0.5);
}

.hero-carousel-arrow:focus-visible {
  opacity: 1;
  transform: translateY(0);
  outline: 2px solid rgba(154, 92, 255, 0.6);
  outline-offset: 3px;
}

.hero-carousel-dots {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  z-index: 2;
}

.hero-carousel-dot {
  position: relative;
  overflow: hidden;
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1), background 0.45s ease;
}

.hero-carousel-dot.is-active {
  width: 2rem;
  background: rgba(255, 255, 255, 0.22);
}

.hero-carousel-dot.is-active::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #fff;
  transform-origin: left center;
  transform: scaleX(0);
  animation: hero-carousel-progress 6.5s linear forwards;
}

@keyframes hero-carousel-progress {
  to { transform: scaleX(1); }
}

.hero-carousel-dot:focus-visible {
  outline: 2px solid rgba(154, 92, 255, 0.6);
  outline-offset: 3px;
}

.visual-label {
  position: absolute;
  left: 2rem;
  bottom: 2rem;
  z-index: 2;
  margin: 0;
  color: #f4f4f7;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: min(240px, calc(100% - 5rem));
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.visual-label.is-changing {
  opacity: 0;
  transform: translate3d(calc(var(--carousel-direction, 1) * 12px), 8px, 0);
}

@media (max-width: 680px) {
  .visual-label {
    max-width: calc(100% - 3rem);
    left: 1rem;
    bottom: 1rem;
    font-size: 0.85rem;
  }

  .hero-carousel-dots {
    right: 1rem;
    bottom: 1rem;
  }

  .hero-carousel-arrow {
    opacity: 1;
    transform: none;
    width: 2rem;
    height: 2rem;
    font-size: 1.25rem;
  }

  .hero-carousel-controls {
    padding: 0 0.4rem;
  }
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: start;
  padding: var(--space-lg) 0;
}

.section-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.about-section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.about-section.in-view {
  opacity: 1;
  transform: none;
}

.about-section h2,
.section-header h2,
.contact-section h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 3rem);
  line-height: 1.12;
  max-width: 24ch; /* prefer multiple lines for headings to improve readability */
}

.about-section p,
.contact-section p {
  color: var(--muted);
  max-width: 44rem;
}

.skills-panel {
  padding: 2.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.skills-title {
  margin: 0 0 1.4rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.skills-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
  list-style: none;
  padding: 0;
  margin: 0;
}

.skills-list li {
  color: #e3e3ee;
}

.portfolio-section {
  padding: var(--space-lg) 0;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.portfolio-section.in-view {
  opacity: 1;
  transform: none;
}

.section-header {
  margin-bottom: 2.4rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.filter-button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.8rem 1.3rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  transition: background-color 0.25s ease, color 0.25s ease;
  cursor: pointer;
}

.filter-button.active,
.filter-button:hover,
.filter-button:focus-visible {
  background: linear-gradient(135deg, rgba(154, 92, 255, 0.22), rgba(110, 81, 255, 0.16));
  color: #fff;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.project-card {
  position: relative;
  display: grid;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.6s cubic-bezier(0.2, 0.9, 0.2, 1),
    transform 0.6s cubic-bezier(0.2, 0.9, 0.2, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  cursor: pointer;
}

.project-card.in-view {
  opacity: 1;
  transform: none;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
  border-color: rgba(154, 92, 255, 0.35);
}

.project-card.in-view:hover,
.project-card.in-view:focus-visible {
  transform: translateY(-4px);
}

.project-card:focus-visible {
  outline: 2px solid rgba(154, 92, 255, 0.4);
  outline-offset: 4px;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: 22px;
  object-fit: cover;
  object-position: center center;
}

.project-info {
  display: grid;
  gap: 0.6rem;
}

.project-category {
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
}

.project-card h3 {
  margin: 0;
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  line-height: 1.12;
  max-width: 30ch;
  overflow-wrap: normal;
  word-break: normal;
  -webkit-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

.project-card p {
  margin: 0;
  color: var(--muted);
}

.services-section {
  padding: 4rem 0;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.services-section.in-view {
  opacity: 1;
  transform: none;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.service-card {
  padding: 2rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 0.24s ease, border-color 0.24s ease;
}

.service-card:hover,
.service-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(154, 92, 255, 0.25);
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  background: rgba(154, 92, 255, 0.15);
  margin-bottom: 1.2rem;
}

.service-icon img {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
}

.service-card h3 {
  margin: 0 0 0.75rem;
}

.service-card p {
  margin: 0;
  color: var(--muted);
}

.contact-section {
  padding: var(--space-lg) 0 var(--space-md);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.contact-section.in-view {
  opacity: 1;
  transform: none;
}

.contact-list {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 760px) {
  .contact-links {
    grid-template-columns: 1fr;
  }
}

.contact-link {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f4f4f7;
  text-decoration: none;
  transition: transform 0.24s ease, border-color 0.24s ease, background-color 0.24s ease;
}

.contact-link:hover,
.contact-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(154, 92, 255, 0.25);
  background: rgba(154, 92, 255, 0.1);
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  background: rgba(154, 92, 255, 0.18);
  color: #fff;
  font-size: 1.1rem;
}

.contact-icon img {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}

.contact-link strong {
  display: block;
  font-size: 0.95rem;
}

.contact-link span:last-child {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact-panel {
  padding: 1.5rem 0 0;
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2.5rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  justify-items: center;
  align-items: center;
  text-align: center;
}

.brand-footer {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.footer-copy {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
  word-break: break-word;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(7, 7, 10, 0.92);
  backdrop-filter: blur(16px);
  z-index: 30;
}

.modal-overlay.active {
  display: flex;
}

.modal-panel {
  width: min(1140px, 100%);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  border-radius: 32px;
  background: #0f1017;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

/* Mobile modal safe area and padding */
@media (max-width: 680px) {
  .modal-panel { width: calc(100% - 1.5rem); margin: 0.75rem; border-radius: 20px; }
  .modal-content { padding: 1rem; }
  .modal-hero { aspect-ratio: 16 / 9; }
  .modal-gallery { grid-template-columns: 1fr; }
  .modal-actions { justify-content: stretch; }
  .modal-actions .button { flex: 1 1 auto; }
}

.modal-close {
  position: sticky;
  top: 0;
  right: 0;
  margin: 1rem;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.4rem;
  align-self: flex-end;
}

.modal-content {
  display: grid;
  gap: 1.8rem;
  padding: 1.5rem 1.5rem 2rem;
}

.modal-hero {
  border-radius: 28px;
  overflow: hidden;
  position: relative;
}

.modal-hero-media {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
}

.modal-hero-media:focus-visible {
  outline: 2px solid rgba(154, 92, 255, 0.45);
  outline-offset: 4px;
}

.modal-hero img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

.modal-hero-label {
  position: absolute;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 2;
  background: rgba(13, 11, 19, 0.78);
  padding: 0.8rem 1rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.9rem;
  pointer-events: none;
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-top: 0.25rem;
}

.modal-gallery-item {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 22px;
  overflow: hidden;
  cursor: zoom-in;
}

.modal-gallery-item:focus-visible {
  outline: 2px solid rgba(154, 92, 255, 0.45);
  outline-offset: 4px;
}

.modal-gallery img {
  width: 100%;
  height: auto;
  border-radius: 22px;
  object-fit: contain;
  aspect-ratio: 4 / 3;
  background: rgba(255, 255, 255, 0.02);
  transition: transform 0.24s ease, filter 0.24s ease;
}

.modal-gallery-item:hover img,
.modal-gallery-item:focus-visible img {
  transform: scale(1.02);
  filter: brightness(1.05);
}

.modal-copy {
  display: grid;
  gap: 1.4rem;
}

.modal-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.modal-copy p {
  color: var(--muted);
}

.modal-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.modal-details h3 {
  margin: 0 0 0.5rem;
}

.case-study-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.case-study-grid article {
  padding: 1.4rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.case-study-grid span {
  display: block;
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  visibility: hidden;
  pointer-events: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(7, 7, 10, 0.96);
  backdrop-filter: blur(14px);
}

.image-lightbox.active {
  display: flex;
  visibility: visible;
  pointer-events: auto;
}

.image-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  pointer-events: auto;
}

.image-lightbox-nav {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.image-lightbox-arrow {
  pointer-events: auto;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(8, 8, 14, 0.72);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.image-lightbox-arrow:hover,
.image-lightbox-arrow:focus-visible {
  background: rgba(154, 92, 255, 0.35);
  border-color: rgba(154, 92, 255, 0.5);
}

.image-lightbox-arrow[hidden] {
  display: none;
}

.image-lightbox-counter {
  pointer-events: none;
  min-width: 4.5rem;
  text-align: center;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(8, 8, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f4f4f7;
  font-size: 0.9rem;
  font-weight: 600;
}

.image-lightbox-counter[hidden] {
  display: none;
}

.image-lightbox-toolbar {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(8, 8, 14, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transform: translateX(-50%);
  pointer-events: auto;
}

.image-lightbox-control {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
}

.image-lightbox-control:hover,
.image-lightbox-control:focus-visible {
  background: rgba(154, 92, 255, 0.28);
  border-color: rgba(154, 92, 255, 0.45);
}

.image-lightbox-level {
  min-width: 3.5rem;
  text-align: center;
  color: #f4f4f7;
  font-size: 0.9rem;
  font-weight: 600;
}

.image-lightbox-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  pointer-events: none;
}

.image-lightbox-frame {
  transform-origin: center center;
  transition: transform 0.18s ease;
  pointer-events: auto;
  will-change: transform;
}

.image-lightbox-stage.is-dragging {
  cursor: grabbing;
}

.image-lightbox-stage img {
  display: block;
  max-width: min(calc(100vw - 3rem), 1200px);
  max-height: calc(100vh - 8rem);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  cursor: zoom-in;
}

.image-lightbox-stage.is-dragging img {
  cursor: grabbing;
}

@media (max-width: 680px) {
  .image-lightbox-toolbar {
    bottom: 0.85rem;
    gap: 0.5rem;
  }

  .image-lightbox-stage img {
    max-height: calc(100vh - 6.5rem);
  }
}

/* Ensure filter buttons do not create horizontal overflow */
.filter-group { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }

/* Reduce excessive padding on very small devices */
@media (max-width: 360px) {
  .container { width: calc(100% - 1rem); }
  .header-inner { padding: 0.5rem 0; }
  .hero-lead { font-size: 1rem; }
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-end;
}

/* Hero content subtle entrance */
.hero-copy,
.visual-card,
.services-grid > article,
.contact-panel {
  transition: opacity 0.6s ease, transform 0.6s ease;
  opacity: 0;
  transform: translateY(8px);
}
.hero-section.in-view .hero-copy,
.hero-section.in-view .visual-card,
.services-section.in-view .services-grid > article,
.contact-section.in-view .contact-panel {
  opacity: 1;
  transform: none;
}

.hero-section.in-view .visual-card {
  transition: opacity 0.6s ease;
}

/* Buttons and language buttons micro interactions */
.button,
.lang-button,
.filter-button { transition: transform 180ms ease, box-shadow 220ms ease; }
.button:hover,
.filter-button:hover { transform: translateY(-3px); }

/* Modal fade/scale */
.modal-overlay { transition: opacity 260ms ease; }
.modal-panel { transform-origin: center top; transition: transform 260ms ease, opacity 260ms ease; }
.modal-overlay.active .modal-panel { transform: translateY(0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
  }

  .hero-carousel-slide.is-entering {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .hero-carousel-slide.is-leaving {
    transition: none !important;
    opacity: 0 !important;
    transform: none !important;
    filter: none !important;
  }

  .hero-carousel-slide img,
  .hero-carousel.is-transitioning .visual-overlay,
  .hero-carousel-dot,
  .hero-carousel-dot::before,
  .hero-carousel-arrow,
  .visual-label,
  .project-card,
  .hero-copy,
  .visual-card,
  .services-grid > article,
  .contact-panel,
  .nav-list a::after,
  .button,
  .lang-button,
  .filter-button,
  .modal-panel {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  .image-lightbox-frame {
    transition: none !important;
  }
}

@media (max-width: 1100px) {
  .hero-grid,
  .section-grid,
  .modal-details,
  .case-study-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .header-inner {
    gap: 0.5rem;
  }

  .site-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .mobile-menu {
    display: none;
    position: relative;
    padding: 1rem 0 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mobile-menu.active {
    display: block;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero-section {
    min-height: auto;
  }

  .hero-grid {
    gap: 2rem;
  }

  .visual-card {
    min-height: 360px;
  }
}

@media (max-width: 767px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  .portfolio-section .section-header {
    margin-bottom: 1.75rem;
  }

  .filter-group {
    gap: 0.65rem;
    margin-bottom: 1.5rem;
  }

  .filter-button {
    padding: 0.72rem 1.1rem;
    font-size: 0.92rem;
  }

  .project-card {
    gap: 1.1rem;
    padding: 1.15rem;
    border-radius: 24px;
  }

  .project-card img {
    aspect-ratio: 16 / 10;
    border-radius: 20px;
  }

  .project-info {
    gap: 0.75rem;
    padding: 0 0.15rem 0.2rem;
  }

  .project-card h3 {
    max-width: none;
    font-size: 1.12rem;
    line-height: 1.25;
  }

  .project-card p {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .project-category {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
  }
}

@media (max-width: 680px) {
  .container {
    width: min(100%, calc(100% - 1.5rem));
  }

  .header-inner {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .skills-panel,
  .service-card {
    padding: 1.5rem;
  }

  .hero-copy h1 {
    font-size: clamp(2.8rem, 10vw, 4rem);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive breakpoints: mobile-first -> larger screens */
@media (min-width: 480px) {
  /* mobile landscape: services can use two columns */
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-copy h1 { font-size: clamp(2.2rem, 9vw, 4.2rem); }
}

@media (min-width: 768px) {
  /* tablet portrait: comfortable spacing, two-column sections */
  .section-grid { grid-template-columns: 1fr 420px; }
  /* make hero visual column visible and avoid it collapsing to text width */
  .hero-grid { grid-template-columns: 1fr 0.95fr; align-items: center; }
  .portfolio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  /* tablet landscape / small desktop */
  .hero-section { min-height: calc(100vh - 88px); }
  .hero-grid { grid-template-columns: 1.15fr 0.95fr; gap: var(--space-lg); align-items: center; }
  .section-grid { grid-template-columns: minmax(0, 1.2fr) 360px; }
  .portfolio-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md); }
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-study-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  /* laptop */
  .container { width: min(1180px, calc(100% - 4rem)); }
  .portfolio-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .services-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-copy h1 { font-size: clamp(2.8rem, 6vw, 5rem); }
}

@media (min-width: 1440px) {
  /* desktop */
  .container { width: min(1280px, calc(100% - 6rem)); }
  .portfolio-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
  .visual-card { min-height: 420px; }
}

/* Ensure hero visual doesn't shrink and keeps a comfortable min width */
.hero-visual { display: flex; align-items: center; justify-content: center; }
.visual-card { width: 100%; min-width: 320px; max-width: 760px; }
@media (max-width: 760px) {
  .visual-card { min-width: 260px; }
}

@media (min-width: 1920px) {
  /* large desktop */
  :root { --container-max: 1600px; }
  .container { width: min(var(--container-max), calc(100% - 8rem)); }
  .portfolio-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px; }
  .hero-copy h1 { font-size: clamp(3.2rem, 4.5vw, 6rem); }
}
