
/* =========================================================
   Infranetix â€” modern portfolio UI
   No backend dependencies. Works with the existing PHP hooks.
   ========================================================= */

:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-elevated: rgba(255,255,255,.78);
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #111827;
  --text-soft: #5b6472;
  --text-faint: #7a8493;
  --line: rgba(15,23,42,.10);
  --primary: #4bbfbd;
  --primary-strong: #159f9c;
  --accent: #fa9c74;
  --accent-2: #273556;
  --success: #36c98f;
  --danger: #e55f68;
  --nav-background: rgba(15, 23, 42, .78);
  --nav-shadow: 0 12px 40px rgba(15,23,42,.13);
  --placeholder-color: #8b95a5;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --container: 1180px;
  --section-pad: clamp(54px, 6.5vw, 82px);
  --shadow-sm: 0 8px 28px rgba(15,23,42,.07);
  --shadow: 0 18px 60px rgba(15,23,42,.10);
  --shadow-lg: 0 30px 90px rgba(15,23,42,.15);
  --ease: cubic-bezier(.2,.75,.25,1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080b12;
  --bg-elevated: rgba(17,24,39,.72);
  --surface: #101621;
  --surface-2: #151d2a;
  --text: #f5f7fb;
  --text-soft: #b3bdcc;
  --text-faint: #8994a5;
  --line: rgba(255,255,255,.10);
  --primary: #66d7d3;
  --primary-strong: #3cbcb7;
  --accent: #ffab83;
  --accent-2: #9eb4ff;
  --nav-background: rgba(5,8,14,.78);
  --nav-shadow: 0 18px 50px rgba(0,0,0,.34);
  --placeholder-color: #8994a5;
  --shadow-sm: 0 10px 35px rgba(0,0,0,.22);
  --shadow: 0 22px 70px rgba(0,0,0,.28);
  --shadow-lg: 0 30px 100px rgba(0,0,0,.38);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  margin: 0;
  min-height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  font-size: 16px;
  background: var(--bg);
}

body,
html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(75,191,189,.07), transparent 28rem),
    radial-gradient(circle at 85% 50%, rgba(250,156,116,.06), transparent 30rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}

body.menu-open { overflow: hidden; }

a { color: inherit; }

button,
input,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

img {
  max-width: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(75,191,189,.28);
  color: var(--text);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ---------- HERO ---------- */

#intro {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(5,9,18,.68), rgba(15,32,55,.36)),
    url("../imgs/background.webp") center / cover no-repeat;
}

#intro::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 42%, rgba(75,191,189,.20), transparent 26rem),
    linear-gradient(180deg, rgba(4,7,13,.18), rgba(4,7,13,.66));
}

.intro-container {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 110px 20px 80px;
}

.container-elements {
  width: min(900px, 100%);
  padding: clamp(28px, 5vw, 58px) !important;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: clamp(24px, 4vw, 38px);
  background: rgba(255,255,255,.08);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  backdrop-filter: blur(24px) saturate(135%);
  box-shadow: 0 30px 100px rgba(0,0,0,.24);
  text-align: center;
  animation: heroIn .9s var(--ease) both;
}

[data-theme="dark"] .container-elements {
  background: rgba(10,16,27,.30);
  border-color: rgba(255,255,255,.11);
}

.intro-title {
  margin: 0 !important;
  color: #fff;
}

.intro-title h2 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 5rem);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 800;
}

.intro-title h3 {
  margin: 20px auto 0;
  max-width: 760px;
  color: rgba(255,255,255,.80);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.8;
  font-weight: 450;
}

.hero-divider {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

hr {
  width: min(180px, 35%);
  height: 2px;
  margin: 0;
  border: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.cursor {
  display: inline-block;
  width: .55ch;
  height: 1.05em;
  margin-left: 4px;
  vertical-align: -.15em;
  background: currentColor;
  animation: blink 1s steps(1) infinite;
}

.center-btns {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

#btn-discovery-contact,
#btn-discovery-work {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 13px 20px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 750;
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
  transition: transform .25s var(--ease), box-shadow .25s ease, background .25s ease;
}

#btn-discovery-contact {
  background: linear-gradient(135deg, var(--accent), #ff825f);
}

#btn-discovery-work {
  background: rgba(39,53,86,.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

#btn-discovery-contact:hover,
#btn-discovery-work:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 35px rgba(0,0,0,.24);
}

/* ---------- NAVIGATION ---------- */

.nav-bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  padding: 12px 16px;
  pointer-events: none;
  transition: transform .3s ease;
}

.nav-shell {
  width: min(1220px, 100%);
  min-height: 62px;
  margin: 0 auto;
  padding: 8px 10px 8px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  pointer-events: auto;
  transition: background .3s ease, box-shadow .3s ease, border-color .3s ease, backdrop-filter .3s ease;
}

.nav-bar.is-scrolled .nav-shell,
body.is-scrolled .nav-shell {
  background: var(--nav-background);
  border-color: rgba(255,255,255,.09);
  box-shadow: var(--nav-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  color: #fff;
  font-size: .88rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-decoration: none;
}

.nav-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

#desktop-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0;
}

#desktop-nav li { list-style: none; }

#desktop-nav li a,
#desktop-nav .active {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 11px;
  color: rgba(255,255,255,.78);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 650;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

#desktop-nav li a:hover,
#desktop-nav li a.is-current {
  color: #fff;
  background: rgba(255,255,255,.10);
}

#desktop-nav li a.is-current::after {
  content: "";
  width: 4px;
  height: 4px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

#desktop-nav .active {
  margin: 0;
  margin-left: 5px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  box-shadow: 0 8px 20px rgba(75,191,189,.18);
}

.theme-control {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 11px;
  cursor: pointer;
  background: rgba(255,255,255,.08);
  color: #fff;
  overflow: hidden;
  transition: transform .22s var(--ease), background .2s ease, border-color .2s ease;
}

.theme-control img {
  display: block;
  width: 21px;
  height: 21px;
  max-width: none;
  object-fit: contain;
  filter: brightness(0) invert(1);
  pointer-events: none;
}

.theme-control:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.18);
  transform: translateY(-1px);
}

.theme-control:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.theme-control.theme-switching { transform: scale(.94); }

/* ---------- MOBILE NAV ---------- */

.nav-bar-phone {
  display: none;
  position: fixed;
  inset: 0 0 auto;
  z-index: 1002;
  min-height: 64px;
  padding: 10px 14px;
  align-items: center;
  justify-content: center;
  background: var(--nav-background);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--nav-shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.nav-bar-phone > div {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border-radius: 12px !important;
  color: #fff;
  font-weight: 850;
  letter-spacing: .10em;
  font-size: .78rem;
}

#logo-nav-phone {
  width: 30px;
  height: 30px;
  margin-right: 9px;
  object-fit: contain;
}

.menu-trigger,
.menu-close {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.menu-trigger {
  position: absolute;
  left: 14px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.menu-trigger img,
.menu-close img {
  width: 25px;
  height: 25px;
  filter: invert(1);
}

.menu-trigger:hover,
.menu-close:hover { background: rgba(255,255,255,.10); }

.nav-bar-phone .theme-control {
  position: absolute;
  right: 14px;
}

#modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: none;
  background: rgba(2,6,12,.55);
  opacity: 0;
  transition: opacity .25s ease;
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

#modal.is-open { display: block; opacity: 1; }

.modal-content {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1003;
  width: min(86vw, 360px);
  padding: 90px 22px 30px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: 20px 0 80px rgba(0,0,0,.22);
  transform: translateX(-105%);
  transition: transform .35s var(--ease);
}

.modal-content.is-open { transform: translateX(0); }

.menu-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

#phone-menu {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#phone-menu li { list-style: none; }

#phone-menu .btns {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 15px;
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  transition: background .2s ease, transform .2s ease;
}

#phone-menu .btns:hover {
  background: var(--surface-2);
  transform: translateX(4px);
}

/* ---------- SECTIONS ---------- */

.section-shell {
  position: relative;
  width: 100%;
  padding: var(--section-pad) max(20px, calc((100% - var(--container)) / 2));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.section-shell > h3,
.about > h3,
.contact > h3 {
  margin: 0 0 36px;
  color: var(--text);
  text-align: center;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -.045em;
  font-weight: 820;
}

#skills { background: var(--bg); }

#projects {
  background:
    linear-gradient(180deg, rgba(75,191,189,.025), transparent 25%),
    var(--surface);
}

.about {
  background: var(--bg);
  box-shadow: none;
}

#feedbacks {
  background: var(--surface);
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  background: var(--bg);
  box-shadow: none;
}

#small-text {
  max-width: 760px;
  margin: -10px auto 42px;
  color: var(--text-soft);
  text-align: center;
  font-size: 1.03rem;
}

/* ---------- SKILLS ---------- */

#skills > #content-of-project,
#skills > #content-of-projects {
  width: 100%;
}

#content-of-project,
#content-of-projects {
  position: relative;
  margin: 16px 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: .96rem;
  font-weight: 450;
  overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s ease, border-color .3s ease;
}

#content-of-project::before,
#content-of-projects::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

#content-of-project:hover,
#content-of-projects:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(75,191,189,.22);
}

.align-items-of-div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.align-items-of-div > img#project-logo {
  width: 34px;
  height: 34px;
  padding: 7px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--surface-2);
}

.align-items-of-div b {
  color: var(--primary-strong);
  font-size: 1.08rem;
}

#description-skills {
  margin: 20px 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

#content-of-project > #description-skills > span,
#content-of-projects > #description-skills > span {
  color: var(--text-soft);
  font-family: inherit;
  white-space: pre-wrap;
}

.see-more-link,
.hide-text-link,
#link-to-project {
  color: var(--primary-strong);
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  transition: color .2s ease;
}

#link-to-project:hover,
#link-to-project:focus,
.see-more-link:hover,
.hide-text-link:hover { color: var(--accent); }

#languages {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

#skills #languages { justify-content: flex-start; }

#language {
  width: 40px;
  height: 40px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: contain;
  background: var(--surface-2);
  cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s ease, box-shadow .2s ease;
}

#language:hover,
#language:focus {
  transform: translateY(-5px) scale(1.05);
  border-color: rgba(75,191,189,.42);
  box-shadow: 0 8px 20px rgba(75,191,189,.10);
}

/* ---------- PROJECTS ---------- */

.projects-grid,
#project-of {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.projects-grid > #content-of-projects {
  grid-column: span 6;
  margin: 0;
  height: 100%;
}

#content-of-projects {
  display: flex;
  flex-direction: column;
}

#content-of-projects #description-skills {
  flex: 1;
}

.project-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

#code-prev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 10px;
  background: var(--accent-2);
  color: #fff;
  font-size: .86rem;
  font-weight: 750;
  text-decoration: none;
  transition: transform .2s ease, opacity .2s ease, filter .2s ease;
}

#code-prev:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

#code-prev.disabled {
  pointer-events: none;
  opacity: .42;
}

.project-highlight {
  animation: projectPulse 1.2s ease;
}

/* ---------- ABOUT ---------- */

.flex-paragraphs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

#profile-picture {
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  border: 3px solid rgba(75,191,189,.40);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 15px 40px rgba(15,23,42,.12);
}

#about-me {
  margin: 0 !important;
  text-align: left !important;
}

#text-about {
  width: min(900px, 100%);
  margin: 34px auto 0;
  color: var(--text-soft);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.9;
}

/* ---------- FEEDBACK ---------- */

.feedback-slider,
.swiper-container {
  position: relative;
  width: 100%;
  padding: 4px 4px 55px;
  overflow: hidden;
}

.swiper-slide {
  height: auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.content-of-feedback .align-items-of-div {
  margin-bottom: 18px;
}

#feedback-logo {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(75,191,189,.35);
  border-radius: 50%;
  object-fit: cover;
}

#description-feedback > div {
  height: 145px !important;
  overflow-y: auto !important;
  padding: 2px 4px 2px 0;
  color: var(--text-soft);
  scrollbar-width: thin;
}

#description-feedback p {
  color: var(--text-soft);
}

.swiper-button-next,
.swiper-button-prev {
  width: 40px !important;
  height: 40px !important;
  margin-top: -4px !important;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 14px !important;
  font-weight: 900;
  color: var(--text);
}

.swiper-pagination-bullet {
  background: var(--text-faint);
  opacity: .45;
}

.swiper-pagination-bullet-active {
  background: var(--primary);
  opacity: 1;
}

/* ---------- CONTACT ---------- */

.contact > * {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.contact label {
  display: flex;
  align-items: center;
  margin: 14px auto 8px;
  color: var(--text);
  font-size: .93rem;
  font-weight: 750;
}

#email-logo {
  width: 19px;
  height: 19px;
  object-fit: contain;
}

.contact label span { color: var(--primary-strong); }

input:not([type="checkbox"]),
textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--text);
  background: var(--surface);
  box-shadow: none;
  font-size: .96rem;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

input:not([type="checkbox"]):focus,
textarea:focus {
  border-color: rgba(75,191,189,.75);
  box-shadow: 0 0 0 4px rgba(75,191,189,.11);
}

.gdpr-box {
  gap: 10px;
  margin-top: 14px;
  padding: 13px 0;
  align-items: flex-start !important;
  justify-content: flex-start !important;
}

.gdpr-box input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin: 3px 0 0;
  accent-color: var(--primary-strong);
  flex: 0 0 auto;
}

.gdpr-box label {
  display: block;
  margin: 0 !important;
  font-size: .86rem !important;
  line-height: 1.55;
  font-weight: 500;
}

.contact-email {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  color: var(--text-soft);
  text-align: center;
}

.submit {
  width: auto;
  min-width: 140px;
  min-height: 48px;
  margin: 0;
  padding: 10px 20px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  color: #062321;
  box-shadow: 0 12px 28px rgba(75,191,189,.18);
  font-weight: 850;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(75,191,189,.25);
}

.submit:disabled { opacity: .65; cursor: wait; }

#errs {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 1600;
  width: min(620px, calc(100% - 32px));
  transform: translate(-50%, 150px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 13px 12px 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: transform .35s var(--ease), opacity .35s ease;
}

#errs.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

#form-err {
  margin: 0;
  font-size: .9rem;
  font-weight: 650;
}

#button-errors {
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  padding: 8px 10px;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- FOOTER ---------- */

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between !important;
  gap: 24px;
  padding: 28px max(20px, calc((100% - var(--container)) / 2));
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  text-align: center;
}

#right-footer { margin-left: 0; }

.center-icons { text-align: center; }

.link-images {
  width: 34px;
  height: 34px;
  margin: 0 3px !important;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  object-fit: contain;
  transition: transform .2s var(--ease), border-color .2s ease, box-shadow .2s ease;
}

.link-images:hover {
  transform: translateY(-4px);
  border-color: rgba(75,191,189,.38);
  box-shadow: 0 8px 18px rgba(75,191,189,.10);
}

[data-theme="dark"] .link-images {
  filter: invert(1);
}

/* ---------- FLOATING / COOKIE ---------- */

.scrollToTop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 950;
  width: 48px;
  height: 48px;
  padding: 11px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s var(--ease), background .2s ease;
}

.scrollToTop.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scrollToTop img {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.scrollToTop:hover { transform: translateY(-3px); }

.cookie-banner {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 1700;
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .3s ease, transform .3s ease;
}

.cookie-banner.is-visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.cookie-inner {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-elevated);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow-lg);
}

.cookie-text strong {
  color: var(--text);
  font-size: .95rem;
}

.cookie-text p {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: .82rem;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}

.btn-cookie {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  background: var(--surface);
  font-size: .82rem;
  font-weight: 750;
}

.btn-cookie.accept {
  border-color: transparent;
  background: var(--primary);
  color: #062321;
}

.btn-cookie:hover { transform: translateY(-1px); }

/* ---------- SWEETALERT / LEGACY COMPATIBILITY ---------- */

.custom-file-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--primary-strong) !important;
  color: #fff !important;
  cursor: pointer;
}

.star {
  cursor: pointer;
  color: #f6c344;
  font-size: 28px;
  transition: transform .15s ease;
}
.star:hover { transform: scale(1.12); }
.star.selected { color: #f6c344; }

.swal2-popup {
  border-radius: 24px !important;
  background: var(--surface) !important;
  color: var(--text) !important;
}

[data-theme="dark"] .swal2-popup {
  box-shadow: 0 30px 100px rgba(0,0,0,.55) !important;
}

[data-theme="dark"] .swal2-input,
[data-theme="dark"] .swal2-textarea,
[data-theme="dark"] .swal2-select {
  color: #fff !important;
  background: var(--surface-2) !important;
  border-color: var(--line) !important;
}

/* ---------- REVEAL / MOTION ---------- */

.reveal-section,
#content-of-project,
#content-of-projects,
.content-of-feedback {
  animation: none;
}

.reveal-section.is-visible > *,
#content-of-project.is-visible,
#content-of-projects.is-visible,
.content-of-feedback.is-visible {
  animation: revealUp .65s var(--ease) both;
}

#content-of-project:nth-of-type(2) { animation-delay: .04s; }
#content-of-project:nth-of-type(3) { animation-delay: .08s; }
#content-of-project:nth-of-type(4) { animation-delay: .12s; }

@keyframes revealUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(20px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes projectPulse {
  0%, 100% { box-shadow: var(--shadow-sm); }
  45% { box-shadow: 0 0 0 5px rgba(75,191,189,.14), var(--shadow); }
}

/* ---------- HERO BACKGROUND MOTION / LAYOUT FIXES ---------- */
#intro {
  min-height: 100svh;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

#intro::after {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 24%, rgba(75,191,189,.16), transparent 22rem),
    radial-gradient(circle at 78% 68%, rgba(250,156,116,.08), transparent 20rem);
  animation: heroAmbient 12s ease-in-out infinite alternate;
  transform: translate3d(0,0,0);
}

#particles-js {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

#particles-js canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  opacity: .48;
}

.intro-container {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  padding-top: clamp(92px, 10vh, 128px);
  padding-bottom: clamp(52px, 8vh, 92px);
}

.container-elements {
  width: min(940px, calc(100vw - 32px));
  padding: clamp(30px, 5vw, 58px) !important;
  background: rgba(7, 12, 21, .30);
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 30px 100px rgba(0,0,0,.28);
  animation: none;
}

.container-elements::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.08), transparent 42%, rgba(75,191,189,.06));
}

.intro-title {
  position: relative;
  z-index: 1;
}

.intro-title h2 {
  text-wrap: balance;
}

#h3-not-styled {
  min-height: 3.6em;
}

@keyframes heroAmbient {
  from { transform: translate3d(-2%, -1%, 0) scale(1); opacity: .72; }
  to { transform: translate3d(2%, 1%, 0) scale(1.06); opacity: 1; }
}

/* ---------- CONTACT WIDTH / GRID FIX ---------- */
#contact > h3,
#contact > #small-text,
#contact > label,
#contact > input:not([type="checkbox"]),
#contact > textarea,
#contact > .gdpr-box,
#contact > .contact-email {
  width: min(760px, 100%);
  max-width: 760px;
  min-width: 0;
  justify-self: center;
}

#contact > input:not([type="checkbox"]),
#contact > textarea {
  display: block;
}

#contact > label {
  justify-content: center;
}

#contact > .gdpr-box {
  display: flex;
}

#contact > .contact-email {
  display: flex;
}

@media (max-width: 620px) {
  .intro-container {
    padding: 78px 12px 42px;
  }

  .container-elements {
    width: min(100%, 940px);
    padding: 28px 18px 24px !important;
  }

  #h3-not-styled {
    min-height: 5.1em;
  }
}


/* About heading: keep it clearly legible beside the portrait. */
.about-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

#about-me {
  margin: 0 !important;
  font-size: clamp(2.2rem, 4.5vw, 3.6rem) !important;
  line-height: 1.05;
}

.gdpr-box {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start !important;
  justify-content: initial !important;
  column-gap: 12px;
  text-align: left;
}

.gdpr-box input[type="checkbox"] {
  width: 18px !important;
  height: 18px;
  margin: 4px 0 0;
  padding: 0;
  box-shadow: none !important;
  accent-color: var(--primary-strong);
}

.gdpr-box label {
  margin: 0 !important;
  font-size: clamp(.9rem, 1.35vw, 1rem) !important;
  line-height: 1.55;
}

/* ---------- RESPONSIVE ---------- */

@media (min-width: 900px) {
  #skills > #content-of-project:nth-of-type(odd) {
    /* kept intentionally simple: cards remain full width for readable long descriptions */
  }
}

@media (max-width: 1020px) {
  .nav-shell { padding-left: 13px; }
  .nav-brand span { display: none; }
  #desktop-nav li a { padding-inline: 10px; }
  .projects-grid > #content-of-projects { grid-column: span 12; }
}

@media (max-width: 820px) {
  .nav-bar { display: none; }
  .nav-bar-phone { display: flex; }

  .section-shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  .projects-grid,
  #project-of { grid-template-columns: 1fr; }

  .projects-grid > #content-of-projects { grid-column: auto; }

  footer {
    justify-content: center !important;
    padding-inline: 18px;
  }
}

@media (max-width: 620px) {
  html { font-size: 15px; }

  .intro-container {
    padding: 88px 14px 54px;
  }

  .container-elements {
    padding: 28px 18px 24px !important;
    border-radius: 24px;
  }

  .intro-title h2 {
    font-size: clamp(2rem, 11vw, 3.2rem);
  }

  .intro-title h3 {
    font-size: .98rem;
    line-height: 1.7;
  }

  .center-btns {
    flex-direction: column;
    width: 100%;
  }

  #btn-discovery-contact,
  #btn-discovery-work {
    width: 100%;
    max-width: 320px;
  }

  .section-shell {
    padding-top: 54px;
    padding-bottom: 56px;
  }

  .section-shell > h3,
  .about > h3,
  .contact > h3 {
    margin-bottom: 28px;
  }

  #content-of-project,
  #content-of-projects {
    padding: 20px;
    border-radius: 18px;
  }

  #language {
    width: 36px;
    height: 36px;
  }

  .flex-paragraphs {
    align-items: flex-start;
  }

  #profile-picture {
    width: 70px;
    height: 70px;
  }

  #about-me {
    font-size: 2rem !important;
  }

  #text-about {
    margin-top: 24px;
    font-size: .98rem;
    line-height: 1.8;
  }

  .swiper-slide { padding: 20px; }

  .cookie-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
  }

  .cookie-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .btn-cookie { width: 100%; }

  .scrollToTop {
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 430px) {
  .nav-bar-phone { min-height: 60px; }
  .nav-bar-phone > div { font-size: .72rem; }
  #logo-nav-phone { width: 27px; height: 27px; }

  .menu-trigger,
  .theme-control {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .theme-control img {
    width: 20px;
    height: 20px;
  }

  .contact-email span { line-height: 1.55; }

  .cookie-actions { grid-template-columns: 1fr; }
}

/* Respect accessibility and battery-friendly motion preferences. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* =========================================================
   FINAL POLISH â€” CONTACT / FOOTER / SOCIAL ICONS
   ========================================================= */

/* Give the contact section real breathing room from the fixed header
   and from the footer. The form remains compact inside the section. */
.contact {
  padding-top: clamp(70px, 7vw, 92px) !important;
  padding-bottom: clamp(64px, 6vw, 82px) !important;
  min-height: auto;
}

.contact > h3 {
  margin-top: 0 !important;
  margin-bottom: 20px !important;
}

.contact > #small-text {
  margin-top: 0 !important;
  margin-bottom: clamp(30px, 4vw, 46px) !important;
}

.contact label {
  margin-top: 18px !important;
  margin-bottom: 9px !important;
}

.contact > input:not([type="checkbox"]),
.contact > textarea {
  margin-bottom: 8px;
}

.contact > .gdpr-box {
  margin-top: 18px !important;
  margin-bottom: 10px !important;
}

.contact-email {
  margin-top: 26px !important;
  gap: 13px !important;
  padding-top: 4px;
}

.contact-email > span {
  display: block;
  line-height: 1.7;
}

/* Footer gets its own vertical breathing room instead of sitting directly
   against the final contact line. */
.site-footer {
  min-height: 112px;
  padding: 30px max(20px, calc((100% - var(--container)) / 2)) 34px !important;
  gap: 22px 40px;
}

.site-footer .footer-copy,
.site-footer .footer-socials {
  margin: 0 !important;
}

.social-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
}

.site-footer .link-images {
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 !important;
  padding: 8px;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 12px;
  background: #ffffff;
  object-fit: contain;
  filter: none !important;
  opacity: 1;
  box-shadow: 0 5px 16px rgba(15,23,42,.08);
  transition: transform .22s var(--ease), border-color .22s ease,
              box-shadow .22s ease, background .22s ease;
}

.site-footer .link-images:hover,
.site-footer .link-images:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(75,191,189,.55);
  box-shadow: 0 10px 24px rgba(75,191,189,.16);
}

/* In dark mode keep the original brand colours of GitLab / LinkedIn / GitHub
   etc. instead of applying a blanket invert() filter. */
[data-theme="dark"] .site-footer .link-images {
  background: #f8fafc;
  border-color: rgba(255,255,255,.18);
  filter: none !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.32);
}

[data-theme="dark"] .site-footer .link-images:hover,
[data-theme="dark"] .site-footer .link-images:focus-visible {
  background: #ffffff;
  border-color: rgba(102,215,211,.72);
  box-shadow: 0 10px 26px rgba(0,0,0,.42), 0 0 0 3px rgba(102,215,211,.08);
}

/* The footer text must remain readable in both themes. */
[data-theme="dark"] .site-footer {
  background: #0d131d;
  border-top-color: rgba(255,255,255,.09);
}

@media (max-width: 820px) {
  .contact {
    padding-top: 68px !important;
    padding-bottom: 62px !important;
  }

  .site-footer {
    min-height: 0;
    padding: 28px 18px 32px !important;
  }
}

@media (max-width: 620px) {
  .gdpr-box {
    grid-template-columns: 19px minmax(0, 1fr);
    column-gap: 10px;
  }

  .contact {
    padding-top: 62px !important;
    padding-bottom: 58px !important;
  }

  .contact > #small-text {
    margin-bottom: 28px !important;
  }

  .contact-email {
    margin-top: 24px !important;
  }

  .site-footer {
    padding-top: 30px !important;
    padding-bottom: 34px !important;
  }

  .social-links {
    gap: 8px;
  }

  .site-footer .link-images {
    width: 38px;
    height: 38px;
    padding: 7px;
  }
}


/* =========================================================
   FINAL CONTACT POLISH â€” compact, aligned and modern
   ========================================================= */
.contact {
  padding-top: clamp(46px, 5vw, 62px) !important;
  padding-bottom: clamp(44px, 4.5vw, 58px) !important;
}

.contact > h3 {
  margin-bottom: 12px !important;
  font-size: clamp(2rem, 4vw, 2.65rem) !important;
}

.contact > #small-text {
  width: min(650px, 100%) !important;
  max-width: 650px !important;
  margin: 0 auto 24px !important;
  font-size: .91rem !important;
  line-height: 1.55;
}

#contact > label {
  width: min(650px, 100%) !important;
  max-width: 650px !important;
  margin: 10px auto 5px !important;
  min-height: 22px;
  font-size: .86rem !important;
}

#contact > input:not([type="checkbox"]),
#contact > textarea {
  width: min(650px, 100%) !important;
  max-width: 650px !important;
  margin-bottom: 5px !important;
  border-radius: 11px;
}

#contact > input:not([type="checkbox"]) {
  min-height: 45px;
  padding: 10px 13px;
  font-size: .9rem;
}

#contact > textarea {
  min-height: 118px;
  padding: 11px 13px;
  font-size: .9rem;
}

/* Modern GDPR control: the checkbox and the first text line share the same top edge. */
#contact > .gdpr-box {
  width: min(650px, 100%) !important;
  max-width: 650px !important;
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start !important;
  column-gap: 10px;
  margin: 13px auto 2px !important;
  padding: 2px 0 0 !important;
  text-align: left;
}

#contact > .gdpr-box input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px !important;
  height: 18px !important;
  margin: 1px 0 0 !important;
  padding: 0 !important;
  border: 1.5px solid #aeb8c7;
  border-radius: 5px;
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(15,23,42,.08) !important;
  cursor: pointer;
  position: relative;
  flex: none;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

#contact > .gdpr-box input[type="checkbox"]:hover {
  border-color: var(--primary-strong);
}

#contact > .gdpr-box input[type="checkbox"]:focus-visible {
  outline: none;
  border-color: var(--primary-strong);
  box-shadow: 0 0 0 4px rgba(75,191,189,.14) !important;
}

#contact > .gdpr-box input[type="checkbox"]:checked {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
  transform: translateY(-1px);
}

#contact > .gdpr-box input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

#contact > .gdpr-box label {
  display: block !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--text-soft);
  font-size: .78rem !important;
  font-weight: 500;
  line-height: 1.48;
  cursor: pointer;
}

#contact > .gdpr-box .gdpr-copy {
  display: block;
}

#contact > .gdpr-box a {
  font-weight: 750;
}

.contact-email {
  width: min(650px, 100%) !important;
  max-width: 650px !important;
  margin: 15px auto 0 !important;
  gap: 8px !important;
  padding: 0 !important;
}

.contact-email .submit {
  min-width: 132px;
  min-height: 43px;
  padding: 9px 20px;
  border-radius: 11px;
  font-size: .88rem;
}

.contact-email > span {
  font-size: .82rem;
  line-height: 1.45;
}

/* WhatsApp floating action */
.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 950;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 0;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 16px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(37,211,102,.28);
  opacity: 1;
  transform: none;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.whatsapp-icon {
  width: 30px;
  height: 30px;
  display: block;
  fill: #fff;
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(37,211,102,.36);
  filter: brightness(1.04);
}

.whatsapp-float:focus-visible {
  outline: 3px solid rgba(37,211,102,.35);
  outline-offset: 3px;
}

[data-theme="dark"] .whatsapp-float {
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 14px 34px rgba(0,0,0,.38), 0 0 0 1px rgba(37,211,102,.10);
}

@media (max-width: 620px) {
  .contact {
    padding-top: 42px !important;
    padding-bottom: 42px !important;
  }

  .contact > #small-text {
    margin-bottom: 20px !important;
    font-size: .84rem !important;
  }

  #contact > label {
    margin-top: 9px !important;
  }

  #contact > textarea {
    min-height: 105px;
  }

  #contact > .gdpr-box {
    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: 9px;
    margin-top: 11px !important;
  }

  #contact > .gdpr-box label {
    font-size: .75rem !important;
  }

  .contact-email {
    margin-top: 13px !important;
  }

  .whatsapp-float {
    right: 14px;
    bottom: 14px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    padding: 9px;
  }

  .whatsapp-icon {
    width: 27px;
    height: 27px;
  }
}

/* =========================================================
   FINAL MOBILE QA â€” alignment, menu close icon, contact gutters
   ========================================================= */

/* The contact form must never touch the viewport edges on phones. */
#contact.contact {
  padding-left: clamp(16px, 4.5vw, 34px) !important;
  padding-right: clamp(16px, 4.5vw, 34px) !important;
}

#contact > h3,
#contact > #small-text,
#contact > label,
#contact > input:not([type="checkbox"]),
#contact > textarea,
#contact > .gdpr-box,
#contact > .contact-email {
  width: min(650px, 100%) !important;
  max-width: 650px !important;
}

/* Keep the portrait and â€œAbout meâ€ on the same visual axis on mobile. */
@media (max-width: 620px) {
  .about-heading,
  .flex-paragraphs.about-heading {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    text-align: left !important;
  }

  .about-heading #profile-picture {
    width: 74px !important;
    height: 74px !important;
    margin: 0 !important;
  }

  .about-heading #about-me {
    margin: 0 !important;
    font-size: clamp(2rem, 9.5vw, 2.65rem) !important;
    line-height: 1 !important;
    text-align: left !important;
  }

  /* Keep a comfortable, symmetrical gutter around every contact control. */
  #contact.contact {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  #contact > input:not([type="checkbox"]),
  #contact > textarea,
  #contact > label,
  #contact > .gdpr-box,
  #contact > .contact-email {
    width: 100% !important;
    max-width: 650px !important;
  }
}

/* The light-theme off-canvas menu has a light surface, so its close icon
   must stay dark. The dark theme intentionally inverts the same asset. */
.menu-close img {
  filter: none !important;
}

[data-theme="dark"] .menu-close img {
  filter: invert(1) !important;
}

.menu-close {
  z-index: 2;
  color: var(--text);
}

[data-theme="dark"] .menu-close {
  color: #fff;
}

/* Prevent the close control from being clipped by the menu surface. */
.modal-content {
  overflow: visible;
}

/* Make the mobile menu links breathe consistently without changing their text. */
@media (max-width: 620px) {
  .modal-content {
    width: min(86vw, 360px);
    padding: 82px 20px 28px;
  }

  .menu-close {
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
  }
}