:root {
  --bg-main: #0b1220;
  --bg-elev-1: #111a2d;
  --bg-elev-2: #18233a;
  --text-main: #e7edf7;
  --text-muted: #9fb0cc;
  --accent: #1f736c;
  --accent-strong: #135171;
  --accent-warm: #3d1988;
  --border: rgba(147, 177, 216, 0.22);
  --shadow-soft: 0 12px 30px rgba(4, 10, 22, 0.35);
  --shadow-accent: 0 16px 40px rgba(54, 209, 196, 0.22);
}

body.light-mode {
  --bg-main: #f2f6fb;
  --bg-elev-1: #ffffff;
  --bg-elev-2: #edf3fb;
  --text-main: #162033;
  --text-muted: #5f718f;
  --accent: #caf6f2;
  --accent-strong: #a9d5d0;
  --accent-warm: #efc9b0;
  --border: rgba(17, 26, 45, 0.12);
  --shadow-soft: 0 10px 25px rgba(17, 26, 45, 0.12);
  --shadow-accent: 0 14px 34px rgba(15, 143, 131, 0.18);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% -10%, rgba(54, 209, 196, 0.12), transparent 38%),
    radial-gradient(circle at 100% 0%, rgba(255, 138, 91, 0.12), transparent 32%),
    url("../img/bg.png") center/cover no-repeat;
  opacity: 0.16;
  pointer-events: none;
  z-index: -1;
}

body.light-mode::before {
  opacity: 0.09;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Orbitron', sans-serif;
  color: var(--text-main);
}

p, .text-secondary, .text-muted {
  color: var(--text-muted) !important;
}

a {
  text-decoration: none;
  color: var(--accent);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--text-muted);
}

section {
  padding: 60px 0;
  position: relative;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
}

.navbar {
  background: rgba(11, 18, 32, 0.84) !important;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 22px rgba(7, 12, 24, 0.22);
}

body.light-mode .navbar {
  background: rgba(255, 255, 255, 0.85) !important;
}

.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-toggler {
  color: var(--text-main) !important;
}

.navbar .nav-link {
  opacity: 0.9;
  border-radius: 8px;
  padding: 0.4rem 0.7rem !important;
}

.navbar .nav-link:hover {
  opacity: 1;
  background: rgba(54, 209, 196, 0.14);
}

.navbar-toggler {
  border-color: var(--border) !important;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.18rem rgba(54, 209, 196, 0.3);
}

.language-flag {
  display: inline-block;
  background-size: cover;
  margin-right: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: filter 0.25s ease, transform 0.2s ease, border-color 0.2s ease;
}

.flag-active {
  filter: none;
  transform: scale(1.08);
  border-color: var(--accent);
}

.flag-inactive {
  filter: grayscale(100%) brightness(68%);
}

.hero-cta {
  border: 1px solid #8e8e8e !important;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: #478a8a;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding-inline: 1.45rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.hero-cta:hover,
.hero-cta:focus {
  color: #081320;
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
  filter: saturate(1.08);
}

#services,
.services-section {
  background: linear-gradient(180deg, rgba(24, 35, 58, 0.58), rgba(17, 26, 45, 0.62));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding-left: 25px;
  padding-right: 25px;
  text-align: justify;
  margin-bottom: 20px;
}

body.light-mode #services,
body.light-mode .services-section {
  background: linear-gradient(180deg, rgba(237, 243, 251, 0.92), rgba(255, 255, 255, 0.95));
}

.card,
.service-card,
.portfolio-card,
.quick-contact-item {
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev-1));
  border: 1px solid var(--border);
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
}

.card-title,
.card-text,
.card-footer {
  color: inherit;
}

.service-card,
.portfolio-card {
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.service-card:hover,
.portfolio-card:hover,
.quick-contact-item:hover {
  transform: none;
  border-color: rgba(54, 209, 196, 0.44);
  box-shadow: var(--shadow-accent);
}

.service-card .card-body,
.portfolio-card .card-body {
  position: relative;
  transition: transform 0.22s ease;
}

.service-card-link {
  z-index: 3;
}

.service-card:hover .card-body,
.portfolio-card:hover .card-body {
  transform: none;
}

.service-card .card-body::before,
.portfolio-card .card-body::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0.5rem;
  background: linear-gradient(120deg, rgba(54, 209, 196, 0.08), transparent 45%, rgba(255, 138, 91, 0.08));
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.service-card:hover .card-body::before,
.portfolio-card:hover .card-body::before {
  opacity: 1;
}

.portfolio-card .card-img-top {
  transition: transform 0.35s ease, filter 0.35s ease;
}

.offer-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.portfolio-card:hover .card-img-top {
  transform: scale(1.03);
  filter: saturate(1.05);
}

.quick-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.quick-contact-item {
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.quick-contact-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.quick-contact-label {
  color: var(--text-main);
  font-weight: 600;
}

.quick-contact-detail {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.quick-contact-item > span {
  color: var(--text-main);
  font-weight: 600;
}

.contact-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.btn-tech,
.portfolio-card .btn-primary {
  background: var(--accent);
  border: 1px solid transparent;
  color: #081320;
  font-weight: 700;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-tech:hover,
.portfolio-card .btn-primary:hover {
  background: var(--accent-strong);
  color: #f8feff;
  transform: none;
  box-shadow: var(--shadow-soft);
}

form input,
form textarea {
  background: var(--bg-elev-1) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-main) !important;
  padding: 10px;
  border-radius: 8px;
}

form input:focus,
form textarea:focus {
  border-color: var(--accent) !important;
  outline: none;
  box-shadow: 0 0 0 0.18rem rgba(54, 209, 196, 0.22) !important;
}

footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

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

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text-main);
}

.footer-sep {
  opacity: 0.6;
}
#tech-stack {
  padding-top: 44px;
}

.tech-stack-wrap {
  max-width: 1050px;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 20px;
}

.tech-card {
  background: linear-gradient(165deg, rgba(24, 35, 58, 0.86), rgba(17, 26, 45, 0.96));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow-soft);
  min-height: 160px;
}

body.light-mode .tech-card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(237, 243, 251, 0.94));
}

.tech-card-title {
  font-size: 1rem;
  margin: 0 0 10px;
  letter-spacing: 0.2px;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-tag {
  border: 1px solid rgba(54, 209, 196, 0.33);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.82rem;
  color: var(--text-main);
  background: rgba(31, 115, 108, 0.14);
  line-height: 1.3;
}

body.light-mode .tech-tag {
  background: rgba(31, 115, 108, 0.08);
}

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

  .tech-card {
    min-height: 0;
  }
}

@media (max-width: 500px) {
  .tech-grid {
    grid-template-columns: 1fr;
  }
}
.portfolio-grid.has-expanded .portfolio-item.is-expanded {
  order: -1;
  flex: 0 0 100%;
  max-width: 100%;
}

.portfolio-image-wrap {
  position: relative;
}

.portfolio-preview {
  cursor: zoom-in;
}

.portfolio-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.85);
  color: #ffffff;
  font-weight: 700;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.portfolio-grid.has-expanded .portfolio-item.is-expanded .portfolio-close {
  display: inline-flex;
}

.portfolio-grid.has-expanded .portfolio-item.is-expanded .portfolio-preview {
  width: auto;
  max-width: min(100%, 1600px);
  max-height: 80vh;
  margin: 0 auto;
  display: block;
  object-fit: contain;
  cursor: default;
}

.portfolio-grid.has-expanded .portfolio-item.is-expanded .portfolio-image-wrap {
  background: rgba(8, 19, 32, 0.45);
  padding: 14px;
}

@media (max-width: 991px) {
  .portfolio-grid.has-expanded .portfolio-item.is-expanded .portfolio-preview {
    max-height: 70vh;
  }
}

.portfolio-grid.has-expanded .portfolio-item.is-expanded .portfolio-card:hover {
  transform: none;
}
body.portfolio-expanded::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.62);
  z-index: 1000;
  pointer-events: none;
}

.portfolio-grid {
  position: relative;
  z-index: 1001;
}

.portfolio-grid.has-expanded .portfolio-item.is-expanded {
  position: relative;
  z-index: 1002;
}

.reference-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 10, 20, 0.84);
  display: none;
}

.reference-modal.is-open {
  display: block;
}

.reference-modal-stage {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 26px 20px 20px;
}

.reference-modal-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0 auto;
  background: #ffffff;
}

.reference-modal-close {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.92);
  color: #ffffff;
  font-weight: 700;
  z-index: 2001;
}

body.reference-modal-open {
  overflow: hidden;
}

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2100;
  display: none;
}

.cookie-banner.is-visible {
  display: block;
}

.cookie-banner.is-hidden {
  display: none;
}

.cookie-banner__inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev-1));
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cookie-banner__text {
  margin: 0;
}

.cookie-banner__link {
  margin-left: 8px;
  color: var(--text-main);
  text-decoration: underline;
}

.cookie-banner__btn {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner__btn {
    width: 100%;
  }
}
