/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --color-primary: #4a7c9e;
  --color-primary-dark: #3a5f7e;
  --color-primary-light: #7a9fb5;
  --color-accent: #7a9fb5;
  --color-bg: #0f1419;
  --color-bg-alt: #1a2330;
  --color-text: #f0f2f5;
  --color-text-muted: #b0b8c4;
  --color-border: #2d3a48;
  --color-success: #6ba587;
  --color-error: #d97777;

  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --radius: 1.2rem;
  --shadow-sm: 0 8px 32px rgba(74, 124, 158, 0.12);
  --shadow-md: 0 8px 32px rgba(74, 124, 158, 0.16);
  --shadow-lg: 0 20px 60px rgba(74, 124, 158, 0.2);
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

section[id] {
  scroll-margin-top: 5rem;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  overflow-x: hidden;
  background-image:
    radial-gradient(
      circle at 20% 50%,
      rgba(74, 124, 158, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(122, 159, 181, 0.08) 0%,
      transparent 50%
    );
  background-attachment: fixed;
  animation: gradientShift 15s ease infinite;
}

body,
main,
section {
  width: 100%;
  max-width: 100%;
}

body.nav-open {
  overflow: hidden;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 10% 10%;
  }
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--color-primary-dark);
}

:focus-visible {
  outline: 3px solid rgba(74, 124, 158, 0.55);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 200;
  background: rgba(74, 124, 158, 0.15);
  color: var(--color-accent);
  border: 2px solid var(--color-primary);
  border-radius: 0.5rem;
  padding: 0.65rem 0.9rem;
  font-weight: 600;
}

.skip-link:focus-visible {
  top: 0.8rem;
}

img,
svg {
  display: block;
  max-width: 100%;
}
.nav__logo-icon {
  width: clamp(48px, 9vw, 72px);
  height: auto;
  margin-right: 0.5rem;
  border-radius: 0.6rem;
  background: rgba(0, 0, 0, 0.9);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  display: block;
}
ul {
  list-style: none;
}

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 6rem 0;
}
.section--alt {
  background: var(--color-bg-alt);
}

.section__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.section__subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 3.5rem;
  font-size: 1.05rem;
}

.section__note {
  max-width: 760px;
  margin: -2rem auto 2.5rem;
  padding: 0.95rem 1.2rem;
  border-left: 4px solid var(--color-primary);
  border-radius: 0.9rem;
  background: rgba(74, 124, 158, 0.06);
  color: var(--color-text);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.projects .section__note {
  margin-top: -1.5rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  padding: 1rem 1.75rem;
  min-height: 44px;
  min-width: 220px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition:
    background var(--transition),
    color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
  text-align: center;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.btn--primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn--outline:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
}

.btn--full {
  width: 100%;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(4, 20, 35, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(219, 227, 236, 0.9);
  transition: box-shadow var(--transition);
}
.header.scrolled {
  box-shadow: var(--shadow-md);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  min-width: 0;
}
/* 
.nav__logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  letter-spacing: -0.5px;
} */

.nav__list {
  display: flex;
  gap: 0.25rem;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  font-weight: 500;
  color: var(--color-text);
  transition:
    background var(--transition),
    color var(--transition);
}
.nav__link:hover,
.nav__link.active {
  background: rgba(74, 124, 158, 0.1);
  color: var(--color-primary-dark);
}

/* Hamburger button */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.5rem;
}

/* Nav right-side wrapper */
.nav__end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

/* Language toggle button */
.lang-toggle {
  padding: 0.3rem 0.75rem;
  min-height: 44px;
  border-radius: 0.5rem;
  border: 1.5px solid var(--color-primary-dark);
  background: transparent;
  color: var(--color-primary-dark);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--transition),
    color var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
.lang-toggle:hover {
  background: var(--color-primary);
  color: #fff;
}
.nav__toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition:
    transform var(--transition),
    opacity var(--transition);
}
.nav__toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav__toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    #0f1419 0%,
    #1a2330 35%,
    #2d3a48 70%,
    #0f1419 100%
  );
  background-size: 200% 200%;
  animation: gradientFlow 15s ease infinite;
  padding-top: 5rem;
  position: relative;
  border-bottom: 1px solid rgba(219, 227, 236, 0.9);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 3rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  min-height: auto;
}

.hero__avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  grid-column: 2;
  justify-self: end;
  box-sizing: border-box;
  align-self: center;
}

.hero__avatar {
  width: 200px;
  height: 200px;
  background: #2d3a48;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--color-primary-dark);
  box-shadow: var(--shadow-lg);
}
.hero__role {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding: 0.4rem 0.7rem;
}

@keyframes gradientFlow {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.hero__content {
  max-width: 100%;
  text-align: left;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  padding-right: 1.25rem;
}

.hero__greeting {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.75rem;
}

/* Ensure consistent side-by-side layout on wider screens using flex */
@media (min-width: 601px) {
  .hero__grid {
    display: flex;
    align-items: center;
    gap: 2.25rem;
  }

  .hero__content {
    flex: 1 1 auto;
    order: 1;
    padding-right: 1.5rem;
  }

  .hero__avatar-wrap {
    width: 340px;
    flex: 0 0 340px;
    order: 2;
    justify-content: center;
    align-items: center;
  }
}

.hero__name {
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -2px;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.hero__tagline {
  display: inline-flex;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}
.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--color-text-muted);
  margin-bottom: 2.25rem;
  justify-content: center;
}

.hero__badge {
  content: attr(data-i18n);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  padding: 0.3rem 0.5rem;
  border-radius: 15px;
  background: rgba(74, 124, 158, 0.08);
  border: 1px solid rgba(74, 124, 158, 0.2);
  color: white;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  width: 500px;
  white-space: nowrap;
  line-height: 1.15;
}

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero__scroll-line {
  width: 2px;
  height: 3.5rem;
  background: linear-gradient(to bottom, transparent, var(--color-primary));
  border-radius: 2px;
  animation: scrollPulse 1.8s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(0.6);
  }
}

/* ============================================================
   OFFER / METHOD
   ============================================================ */
.section__title--compact {
  margin-top: 2.5rem;
}

.offer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.offer-card,
.process-card {
  background: rgba(10, 20, 50, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(74, 124, 158, 0.15);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition),
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.offer-card:hover,
.process-card:hover {
  transform: translateY(-6px);
  border-color: rgba(122, 159, 181, 0.3);
  background: rgba(10, 20, 50, 0.6);
  box-shadow: var(--shadow-md);
}

.offer-card {
  padding: 1.6rem 1.5rem;
}

.offer-card__title {
  margin-bottom: 0.65rem;
  font-size: 1.08rem;
  color: var(--color-text);
}

.offer-card p {
  color: var(--color-text-muted);
  line-height: 1.65;
}

.process-block {
  margin-top: 1.75rem;
}

.process-card {
  padding: 1.5rem;
}

.process-card__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: rgba(74, 124, 158, 0.1);
  color: var(--color-primary-dark);
  font-weight: 700;
}

.process-card h4 {
  font-size: 1.02rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.process-card p {
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
  align-items: start;
  margin: 0 auto 4rem;
  max-width: 800px;
}

.about__avatar-wrap {
  display: flex;
  justify-content: center;
}

.about__avatar {
  width: 220px;
  height: 220px;
  background: #2d3a48;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--color-primary-dark);
  box-shadow: var(--shadow-lg);
}
.about__avatar svg {
  width: 100%;
  height: 100%;
}

.about__text p {
  color: var(--color-text-muted);
  margin-bottom: 1.1rem;
  text-align: center;
}

.about__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.skill-tag {
  background: rgba(74, 124, 158, 0.08);
  color: var(--color-primary-dark);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(74, 124, 158, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition);
}
.skill-tag:hover {
  background: rgba(74, 124, 158, 0.15);
  border-color: rgba(74, 124, 158, 0.3);
  transform: translateY(-2px);
}

.about__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.stat-card {
  background: rgba(10, 20, 50, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(74, 124, 158, 0.15);
  border-radius: var(--radius);
  padding: 1.75rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition:
    box-shadow var(--transition),
    transform var(--transition),
    border-color var(--transition),
    background var(--transition);
  height: 100%;
}
.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(122, 159, 181, 0.3);
  background: rgba(10, 20, 50, 0.6);
}

.stat-card__number {
  display: block;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}
.stat-card__label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.75rem;
  align-items: start;
}

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

@media (max-width: 700px) {
  .projects__grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  background: rgba(10, 20, 50, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(74, 124, 158, 0.15);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--transition),
    transform var(--transition),
    border-color var(--transition),
    background var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px);
  border-color: rgba(122, 159, 181, 0.3);
  background: rgba(10, 20, 50, 0.6);
}

.project-card__header {
  margin-bottom: 1rem;
}

.project-card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: var(--color-text);
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  background: rgba(74, 124, 158, 0.08);
  color: var(--color-primary-dark);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid rgba(74, 124, 158, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition);
}
.tag:hover {
  background: rgba(74, 124, 158, 0.15);
  border-color: rgba(74, 124, 158, 0.3);
  transform: scale(1.05);
}

.project-card__desc {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  flex-grow: 1;
  overflow-wrap: anywhere;
}

.project-card__links {
  display: flex;
  gap: 1rem;
}

.project-card__links a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: transform var(--transition);
}
.project-card__links a:hover {
  transform: translateX(3px);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3.5rem;
  align-items: start;
}

.contact__info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-info-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: rgba(10, 20, 50, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(74, 124, 158, 0.15);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.contact-info-card:hover {
  background: rgba(10, 20, 50, 0.6);
  border-color: rgba(122, 159, 181, 0.3);
  transform: translateY(-4px);
}

.contact-info-card__icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  color: var(--color-primary);
}
.contact-info-card__icon svg {
  width: 100%;
  height: 100%;
}

.contact-info-card strong {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.contact-info-card a,
.contact-info-card span {
  font-size: 0.92rem;
  color: var(--color-text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Form */
.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: rgba(10, 20, 50, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(74, 124, 158, 0.15);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form__group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
}
.form__group label span {
  color: var(--color-primary);
}

.form__group input,
.form__group textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid rgba(74, 124, 158, 0.2);
  border-radius: 0.5rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  background: rgba(10, 20, 50, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
  resize: vertical;
}
.form__group input:focus,
.form__group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 124, 158, 0.2);
  background: rgba(10, 20, 50, 0.7);
}
.form__group input.invalid,
.form__group textarea.invalid {
  border-color: var(--color-error);
}

.form__error {
  font-size: 0.82rem;
  color: var(--color-error);
  min-height: 1.1rem;
}

.form__success {
  text-align: center;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-success);
  min-height: 1.5rem;
}

.form__success.is-error {
  color: var(--color-error);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: rgba(4, 20, 35, 0.82);
  color: #94a3b8;
  padding: 2rem 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer p {
  font-size: 0.88rem;
}

.footer__links {
  display: flex;
  gap: 1.25rem;
}

.footer__links a {
  font-size: 0.88rem;
  color: #94a3b8;
  transition: color var(--transition);
}
.footer__links a:hover {
  color: #fff;
}

.footer__social {
  display: flex;
  gap: 1.25rem;
}

.footer__social a {
  font-size: 0.88rem;
  color: #94a3b8;
  transition: color var(--transition);
}
.footer__social a:hover {
  color: #fff;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 2rem;
  width: 3rem;
  height: 3rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity var(--transition),
    transform var(--transition);
  z-index: 99;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

/* ============================================================
   FADE-IN ANIMATION (Intersection Observer)
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) and (min-width: 769px) {
  .hero__avatar-wrap {
    width: 220px;
    flex: 0 0 220px;
  }

  .hero__avatar {
    width: 190px;
    height: 190px;
  }

  .hero__content {
    padding-right: 1rem;
  }
}

@media (max-width: 900px) {
  .hero__grid {
    gap: 2rem;
  }

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

  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about__grid {
    grid-template-columns: 1fr;
  }
  .about__avatar-wrap {
    justify-content: center;
  }
  .about__stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  body {
    background-attachment: scroll;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 4.75rem 0;
  }

  .container {
    padding: 0 1rem;
  }

  .hero {
    min-height: 100svh;
    padding-top: 4.5rem;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Mobile: stack content first, avatar below, center everything for visibility */
  .hero__grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }

  .hero__content {
    order: 1;
    text-align: center;
    padding-right: 0;
  }

  .hero__avatar-wrap {
    order: 2;
    align-items: center;
    justify-content: center;
    width: auto;
  }

  .hero__avatar {
    width: 140px;
    height: 140px;
  }

  .hero__title img {
    max-width: 160px;
    height: auto;
    display: block;
    margin: 0 auto;
  }

  .hero__name {
    font-size: clamp(2.2rem, 7.5vw, 7rem);
  }

  /* make badges more legible on small screens */
  .hero__badge {
    background: rgba(74, 124, 158, 0.12);
    border-color: rgba(74, 124, 158, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }

  .hero__cta {
    justify-content: center;
  }

  .hero__cta .btn {
    width: 100%;
    max-width: 100%;
  }
  .nav__list {
    display: none; /* initially hidden */
    flex-direction: column; /* stack items vertically */
    position: absolute; /* dropdown under nav */
    top: 100%; /* directly under the nav */
    left: 0; /* align to nav left */
    right: 0; /* align to nav right */
    background: var(--color-bg); /* background color */
    padding: 0.35rem 0.5rem; /* compact padding */
    border: 1px solid var(--color-border);
    border-radius: 0.6rem;
    gap: 0.4rem; /* spacing between items */
    max-height: 55vh; /* keep dropdown limited, scroll inside if needed */
    overflow-y: auto; /* scroll inside dropdown */
    -webkit-overflow-scrolling: touch; /* momentum on iOS */
    padding-bottom: calc(env(safe-area-inset-bottom) + 0.5rem);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
    z-index: 1200; /* above header and toggle */
  }
  .nav__list.open {
    display: flex;
  }

  .nav__link {
    width: 100%;
    padding: 0.65rem 0.85rem;
  }

  .nav__toggle {
    display: flex;
    z-index: 1300; /* ensure toggle stays above menu */
  }

  .lang-toggle {
    padding: 0.3rem 0.6rem;
  }

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

  /* Make links clearly visible and block-level for mobile */
  .projects__grid {
    grid-template-columns: 1fr;
  }

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

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .container {
    padding: 0 0.85rem;
  }

  .nav {
    gap: 0.4rem;
  }

  /* .nav__logo-icon {
    width: 44px;
    margin-right: 0.25rem;
    box-shadow: 0 6px 20px rgba(14, 35, 84, 0.08);
  } */

  .lang-toggle {
    font-size: 0.78rem;
    padding: 0.25rem 0.45rem;
  }

  .project-card,
  .contact-info-card,
  .contact__form,
  .offer-card,
  .process-card,
  .stat-card {
    min-width: 0;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* iPad mini specific adjustment */
@media (max-width: 768px) and (min-width: 601px) {
  .hero__avatar-wrap {
    width: 200px;
    flex: 0 0 200px;
  }

  .hero__avatar {
    width: 180px;
    height: 180px;
  }

  .hero__content {
    padding-right: 1rem;
  }
}
