/* =========================
   RESET & BASIS
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.65;
  color: var(--primary-dark);
  background: linear-gradient(180deg, #f8f4ed 0%, #f2ece3 100%);
  background-attachment: scroll;
}

@media (min-width: 769px) {
  body {
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E"),
      radial-gradient(circle at 15% 8%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 52%),
      repeating-linear-gradient(45deg, rgba(31, 79, 120, 0.03) 0 2px, rgba(215, 122, 36, 0.02) 2px 4px),
      radial-gradient(circle at 12% 2%, rgba(255, 246, 232, 0.95) 0%, rgba(255, 246, 232, 0.32) 36%, transparent 58%),
      radial-gradient(circle at 88% 10%, rgba(206, 227, 244, 0.35) 0%, rgba(206, 227, 244, 0.05) 38%, transparent 62%),
      linear-gradient(180deg, #f8f4ed 0%, #f2ece3 100%);
    background-size: 180px 180px, auto, 8px 8px, auto, auto, auto;
    background-attachment: fixed;
  }
}

/* =========================
   CSS VARIABLES
========================= */
:root {
  --primary-light: #f6f2ea;
  --primary-medium: #dcc8ad;
  --primary-dark: #2a2118;
  
  --accent-blue: #1f4f78;
  --accent-orange: #d77a24;
  
  --white: #ffffff;
  --gray-light: #f3f4f6;
  --gray-medium: #5f6673;
  --gray-dark: #2f3642;
  
  --shadow-sm: 0 2px 8px rgba(21, 32, 48, 0.08);
  --shadow-md: 0 8px 24px rgba(21, 32, 48, 0.12);
  --shadow-lg: 0 14px 36px rgba(21, 32, 48, 0.16);
  --shadow-xl: 0 26px 54px rgba(21, 32, 48, 0.24);
  
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 18px;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.4s ease;
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fade-up-soft {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-glow {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-8px, -10px) scale(1.04);
  }
}

@keyframes soft-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(242, 162, 79, 0.22);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(242, 162, 79, 0);
  }
}

/* =========================
   TYPOGRAPHY
========================= */
h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1.1rem;
  max-width: 760px;
  color: var(--gray-dark);
}

/* =========================
   LAYOUT
========================= */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

main {
  max-width: 1100px;
  margin: 56px auto;
  padding: 0 1.25rem;
}

section {
  margin-bottom: 5rem;
}

.section {
  padding: 1rem 0;
}

@supports (content-visibility: auto) {
  .cv-auto {
    content-visibility: auto;
    contain-intrinsic-size: 1px 900px;
  }
}

main h2 {
  margin-bottom: 1.4rem;
  color: var(--accent-blue);
}

main h2::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin-top: 0.55rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-orange), #f2a24f);
}

/* =========================
   HEADER & NAVIGATION
========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.8rem 0;
  background: rgba(17, 28, 43, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-sm);
}

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

.logo a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: var(--transition-fast);
}

.logo-mark {
  width: auto;
  height: 54px;
  display: block;
  object-fit: contain;
  background: transparent !important;
  opacity: 1;
  filter: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.logo a:hover .logo-mark {
  opacity: 1;
  transform: translateY(-1px);
}

.main-nav {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-fast);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
}

.main-nav .cta {
  background: linear-gradient(135deg, #d47a2a, #f29a41);
  color: #1f1913;
  margin-left: 0.4rem;
}

.main-nav .cta:hover,
.main-nav .cta.active {
  background: linear-gradient(135deg, #e58a34, #ffc177);
  color: #1f1913;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  width: 44px;
  height: 40px;
  padding: 8px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: var(--transition-fast);
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================
   HERO SECTION
========================= */
.hero {
  background: linear-gradient(128deg, rgba(18, 41, 66, 0.93), rgba(22, 58, 91, 0.78));
  color: var(--white);
  padding: 7.4rem 2.6rem;
  min-height: clamp(540px, 74vh, 760px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: var(--border-radius-lg);
  margin-bottom: 4rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 769px) {
  .hero {
    background: linear-gradient(128deg, rgba(18, 41, 66, 0.93), rgba(22, 58, 91, 0.78)),
                url('/images/hero.jpg') center/cover no-repeat;
  }
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 162, 79, 0.35), rgba(242, 162, 79, 0));
  animation: float-glow 9s ease-in-out infinite;
}

.hero::after {
  content: "";
  position: absolute;
  inset: -40% auto auto -30%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.hero-content {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  animation: fade-up-soft 0.85s var(--ease-smooth) both;
}

.hero h1 {
  font-size: clamp(2.7rem, 5vw, 4.2rem);
  margin-bottom: 1.2rem;
  letter-spacing: -0.03em;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
  font-size: clamp(1.12rem, 1.5vw, 1.35rem);
  margin-bottom: 2.35rem;
  opacity: 0.95;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  color: rgba(255, 255, 255, 0.95);
}

.hero-cta {
  text-align: center;
  margin: 1.1rem 0 3rem;
}

/* =========================
   BUTTONS & LINKS
========================= */
a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--accent-orange);
}

.button,
button,
input[type="submit"] {
  display: inline-block;
  background: linear-gradient(135deg, #1f4f78, #2d6a98);
  color: var(--white);
  padding: 0.85rem 1.7rem;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.button {
  position: relative;
  overflow: hidden;
}

.button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.26) 48%, transparent 100%);
  transform: translateX(-130%);
  transition: transform 0.8s var(--ease-smooth);
}

.button:hover::after {
  transform: translateX(130%);
}

.button:hover,
button:hover,
input[type="submit"]:hover {
  background: linear-gradient(135deg, #205e8f, #3a7fb0);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.button:active,
button:active,
input[type="submit"]:active {
  transform: translateY(0);
}

/* =========================
   USP GRID
========================= */
.usp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.usp {
  background: var(--white);
  padding: 1.8rem 1.6rem;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
  font-weight: 600;
  transition: var(--transition-normal);
  border-top: 4px solid var(--accent-orange);
  animation: fade-up-soft 0.6s var(--ease-smooth) both;
}

.usp:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* =========================
   PORTFOLIO & GALLERY
========================= */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.portfolio-item {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  border: 1px solid rgba(31, 79, 120, 0.08);
  animation: fade-up-soft 0.7s var(--ease-smooth) both;
}

.portfolio-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.portfolio-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.65s var(--ease-smooth), filter 0.5s ease;
}

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

.portfolio-item .info {
  padding: 1.7rem;
}

.portfolio-item h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.portfolio-item p {
  margin-bottom: 1rem;
  color: var(--gray-medium);
}

/* Masonry Gallery */
.masonry {
  column-count: 3;
  column-gap: 1.5rem;
  max-width: 1200px;
  margin: 2rem auto;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

.masonry-card {
  position: relative;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  cursor: pointer;
  background: var(--white);
  border: 1px solid rgba(31, 79, 120, 0.1);
}

.masonry-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(12, 18, 28, 0.86) 0%,
    rgba(12, 18, 28, 0.66) 45%,
    rgba(12, 18, 28, 0.1) 100%
  );
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: 1;
}

.masonry-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.masonry-card img {
  width: 100%;
  display: block;
  border-radius: var(--border-radius-lg);
  transition: transform 0.6s var(--ease-smooth), filter 0.4s ease;
}

.masonry-card:hover img {
  transform: scale(1.025);
  filter: saturate(1.03) brightness(0.82);
}

.overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.15rem 1.15rem 1.1rem;
  background: linear-gradient(to top, rgba(9, 14, 22, 0.92), rgba(9, 14, 22, 0.15));
  color: var(--white);
  opacity: 0;
  transition: var(--transition-normal);
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.masonry-card:hover::before,
.project-link:focus-visible .masonry-card::before {
  opacity: 1;
}

.masonry-card:hover .overlay,
.project-link:focus-visible .overlay {
  opacity: 1;
}

.overlay h3 {
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
  color: #ffffff;
}

.overlay p {
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.96);
  margin-bottom: 0;
  max-width: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-link {
  display: block;
  color: inherit;
}

.project-link:focus-visible {
  outline: 3px solid #ffd18f;
  outline-offset: 4px;
  border-radius: var(--border-radius-lg);
}

@media (hover: none) {
  .masonry-card::before,
  .overlay {
    opacity: 1;
  }
}

/* Gallery Grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), outline-color var(--transition-fast);
  cursor: pointer;
}

.gallery img:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.gallery img.is-active {
  outline: 3px solid var(--accent-orange);
  outline-offset: 2px;
}

/* =========================
   FORMS
========================= */
form {
  background: var(--white);
  padding: 2.3rem;
  border-radius: var(--border-radius-lg);
  max-width: 700px;
  box-shadow: var(--shadow-md);
  margin: 0 auto 1rem;
  border: 1px solid rgba(31, 79, 120, 0.12);
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--primary-dark);
}

input,
textarea,
select {
  font-family: inherit;
  width: 100%;
  padding: 0.85rem 0.9rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  transition: var(--transition-fast);
  background: var(--white);
}

input::placeholder,
textarea::placeholder {
  font-family: inherit;
  color: #8a94a3;
}

.contact-form input[type="tel"]::placeholder {
  font-family: inherit;
  color: #8a94a3;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(44, 111, 170, 0.1);
}

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

/* =========================
   ADMIN SECTION
========================= */
.admin-container {
  max-width: 1100px;
  margin: 3.5rem auto;
  padding: 2.25rem;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(31, 79, 120, 0.08);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.8rem;
  background: var(--white);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(31, 79, 120, 0.1);
}

.admin-table th,
.admin-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.admin-table th {
  background: linear-gradient(135deg, #edf4fa, #e4eef8);
  color: var(--accent-blue);
  font-weight: 600;
  border-bottom: 2px solid rgba(215, 122, 36, 0.35);
}

.admin-table tr:hover {
  background: var(--gray-light);
}

.admin-table a {
  color: var(--accent-blue);
  font-weight: 500;
  margin-right: 1rem;
}

.admin-table a:hover {
  color: var(--accent-orange);
}

.admin-actions {
  white-space: nowrap;
}

.danger-link {
  color: #dc2626;
  font-weight: 600;
  text-decoration: none;
}

.danger-link:hover {
  color: #ef4444;
  text-decoration: underline;
}

/* Admin Gallery */
.gallery-admin {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-admin-item {
  background: var(--white);
  padding: 1.15rem;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(31, 79, 120, 0.12);
}

.gallery-admin-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  margin-bottom: 0.75rem;
}

.main-photo-box {
  margin-top: 1rem;
}

.main-photo {
  width: 100%;
  max-width: 520px;
  height: 280px;
  object-fit: cover;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
}

.muted {
  opacity: 0.75;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

/* Admin Bar */
.admin-bar {
  background: #111;
  color: var(--white);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.admin-bar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-links a {
  color: var(--accent-orange);
  margin-left: 1.25rem;
  text-decoration: none;
  font-weight: 600;
}

.admin-links a:hover {
  color: var(--accent-blue);
}

/* =========================
   PROJECT DETAIL PAGE
========================= */
.project-detail {
  max-width: 1100px;
  margin: 1.4rem auto 2rem;
  padding: 0 1.25rem;
}

.project-container {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 1rem;
  align-items: start;
}

.project-image {
  min-width: 0;
  position: sticky;
  top: 90px;
}

#mainProjectImage {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
}

.project-thumbs-wrap {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 0.55rem;
  align-items: center;
}

.thumb-scroll-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(31, 79, 120, 0.2);
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent-blue);
  font-size: 1.15rem;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  justify-self: center;
  box-shadow: var(--shadow-sm);
}

.thumb-scroll-btn:hover:not(:disabled) {
  background: #ffffff;
}

.thumb-scroll-btn:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

.project-thumbs {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.1rem 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

.project-thumbs::-webkit-scrollbar {
  display: none;
}

.project-thumb {
  width: 88px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  flex: 0 0 auto;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.project-thumb:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project-thumb.is-active {
  border-color: var(--accent-orange);
}

@media (max-width: 640px) {
  .thumb-scroll-btn {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }
}

.project-content {
  min-width: 0;
  background: var(--white);
  border: 1px solid rgba(31, 79, 120, 0.12);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.1rem;
}

.project-content h2 {
  margin-bottom: 0.6rem;
  color: var(--primary-dark);
}

.project-content p {
  margin-bottom: 0.85rem;
  line-height: 1.55;
  color: var(--gray-dark);
}

/* =========================
   ABOUT PAGE
========================= */
.about-hero {
  background: linear-gradient(135deg, #1f2937, #111827);
  color: var(--white);
  padding: 6rem 2rem;
  text-align: center;
}

.about-hero h1 {
  font-size: 3rem;
  margin-bottom: 1.25rem;
}

.about-hero p {
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.25rem;
  opacity: 0.9;
}

.about-section {
  padding: 5.5rem 2rem;
}

.about-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 3rem;
  align-items: center;
  flex-wrap: wrap;
}

.about-text {
  flex: 1;
  min-width: 300px;
}

.about-text h2 {
  margin-bottom: 1.25rem;
  color: var(--primary-dark);
}

.about-text p {
  margin-bottom: 1.25rem;
  line-height: 1.7;
  color: var(--gray-dark);
}

.about-image {
  flex: 1;
  min-width: 300px;
}

.about-image img {
  width: 100%;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Values Section */
.about-values {
  background: var(--gray-light);
  padding: 5rem 2rem;
}

.values-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.value-card {
  flex: 1;
  min-width: 280px;
  background: var(--white);
  padding: 2.25rem 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  border-top: 4px solid var(--accent-blue);
  animation: fade-up-soft 0.75s var(--ease-smooth) both;
}

.value-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.value-card h3 {
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

/* CTA Section */
.about-cta {
  text-align: center;
  padding: 5rem 2rem;
}

.about-cta h2 {
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.about-cta p {
  margin-bottom: 1.5rem;
  color: var(--gray-dark);
}

/* =========================
   FOOTER
========================= */
.site-footer {
  background: linear-gradient(140deg, #15253a, #1e334e);
  color: #e8edf4;
  padding: 4.4rem 2rem 1.25rem;
  margin-top: 6rem;
  border-top: 4px solid var(--accent-orange);
}

.site-footer a {
  color: #ffd39f;
  text-decoration: none;
  font-weight: 600;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: #fff2de;
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.8rem;
  max-width: 1200px;
  margin: 0 auto;
}

.site-footer h3 {
  color: #ffffff;
  margin-bottom: 0.8rem;
  font-size: 1.15rem;
}

.site-footer p {
  color: #e8edf4;
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.footer-bottom {
  text-align: center;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: #dbe4ef;
  font-size: 0.95rem;
}

.whatsapp-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto;
  box-shadow: 0 12px 30px rgba(14, 74, 43, 0.35);
  z-index: 1400;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.whatsapp-float:hover {
  transform: translateY(-2px) scale(1.03);
  background: #1fb857;
  box-shadow: 0 16px 32px rgba(14, 74, 43, 0.45);
}

.whatsapp-float:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

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

/* =========================
   RESPONSIVE DESIGN
========================= */
@media (max-width: 1024px) {
  .masonry {
    column-count: 2;
  }
  
  .project-container {
    grid-template-columns: 1fr;
  }

  .project-image {
    position: static;
    top: auto;
  }

  #mainProjectImage {
    max-height: none;
  }

  .project-content {
    max-height: none;
    overflow: visible;
  }
  
  .about-container {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .site-header {
    backdrop-filter: none;
    background: rgba(17, 28, 43, 0.98);
  }

  .logo-mark {
    height: 50px;
    background: transparent !important;
    opacity: 1;
    filter: none !important;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  
  .hero {
    padding: 4rem 1.5rem;
    min-height: 56vh;
    box-shadow: var(--shadow-sm);
  }
  
  .hero h1 {
    font-size: 2.25rem;
  }

  .hero-content {
    animation: none;
  }

  .hero::before,
  .hero::after {
    display: none;
  }
  
  .menu-toggle {
    display: inline-block;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 1rem;
    right: 1rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    background: rgba(17, 28, 43, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 0.7rem;
    box-shadow: var(--shadow-lg);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a,
  .main-nav .cta {
    width: 100%;
    margin: 0;
    text-align: center;
  }

  .nav-container {
    position: relative;
  }
  
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
  
  .usp-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  
  .values-container {
    flex-direction: column;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
    text-align: center;
  }

  .whatsapp-float {
    width: 56px;
    height: 56px;
    right: 1rem;
    bottom: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }

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

  .admin-container {
    padding: 1.15rem;
  }

  .admin-container h1 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
  }

  .admin-container > .button {
    width: 100%;
    text-align: center;
  }

  .admin-table {
    border: 0;
    box-shadow: none;
    background: transparent;
    margin-top: 1.2rem;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table tr {
    background: var(--white);
    border: 1px solid rgba(31, 79, 120, 0.1);
    border-radius: var(--border-radius-md);
    margin-bottom: 0.9rem;
    padding: 0.8rem 0.9rem;
    box-shadow: var(--shadow-sm);
  }

  .admin-table td {
    border-bottom: 1px dashed #e5e7eb;
    padding: 0.6rem 0;
    text-align: right;
    font-size: 0.95rem;
  }

  .admin-table td:last-child {
    border-bottom: 0;
  }

  .admin-table td::before {
    content: attr(data-label);
    float: left;
    font-weight: 700;
    color: var(--accent-blue);
    margin-right: 0.75rem;
  }

  .admin-table td.admin-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.9rem;
  }

  .admin-table td.admin-actions::before {
    margin-right: auto;
  }

  .admin-table td.admin-actions a {
    margin-right: 0;
  }

  .hero .button {
    animation: none;
  }
}

@media (max-width: 480px) {
  .container {
    width: 95%;
  }
  
  .hero h1 {
    font-size: 1.875rem;
  }
  
  .hero p {
    font-size: 1rem;
  }

  .hero {
    min-height: 48vh;
  }
  
  .masonry {
    column-count: 1;
  }
  
  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  
  .form {
    padding: 1.5rem;
  }
  
  .admin-container {
    padding: 1rem;
  }
  
  .admin-table {
    font-size: 0.875rem;
  }
  
  .admin-table th,
  .admin-table td {
    padding: 0.75rem 0.5rem;
  }
}

/* =========================
   ACCESSIBILITY & UTILITIES
========================= */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Focus styles for better accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus,
a:focus {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* =========================
   CONTACT PAGE STYLES
========================= */
.contact-section {
  max-width: 1120px;
  margin: 0 auto;
}

.contact-main {
  margin-top: 48px;
}

/* Prevent overlap with reCAPTCHA badge on the contact page */
.contact-page .whatsapp-float {
  bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
}

.contact-page .contact-section h1 {
  text-align: center;
  margin-bottom: 1rem;
}

.contact-intro {
  font-size: 1.125rem;
  color: var(--gray-dark);
  margin: 0 auto 2rem;
  max-width: 760px;
  text-align: center;
  line-height: 1.7;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.contact-primary {
  min-width: 0;
}

.contact-form {
  background: var(--white);
  padding: 2.8rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  margin: 0;
  border: 1px solid rgba(31, 79, 120, 0.12);
  max-width: none;
}

.contact-form-note {
  margin: 0.9rem 0 0;
  font-size: 0.9rem;
  color: var(--gray-medium);
}

.contact-form-note a {
  color: var(--accent-blue);
  text-decoration: underline;
}

.success-message {
  background: #10b981;
  color: var(--white);
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  margin-bottom: 2rem;
  text-align: center;
}

.success-message h3 {
  margin-bottom: 0.5rem;
  color: var(--white);
}

.error-message {
  background: #ef4444;
  color: var(--white);
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  margin-bottom: 2rem;
}

.error-message h3 {
  margin-bottom: 1rem;
  color: var(--white);
}

.error-message ul {
  margin: 0;
  padding-left: 1.5rem;
}

.error-message li {
  margin-bottom: 0.5rem;
}

.contact-info {
  background: var(--gray-light);
  padding: 2.8rem;
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(31, 79, 120, 0.08);
  height: 100%;
}

.contact-info h2 {
  text-align: center;
  margin-bottom: 1.65rem;
  color: var(--primary-dark);
}

.contact-info h2::after {
  margin-left: auto;
  margin-right: auto;
}

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

.contact-method {
  background: var(--white);
  padding: 1.45rem;
  border-radius: var(--border-radius-sm);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  border-left: 4px solid var(--accent-orange);
  animation: fade-up-soft 0.75s var(--ease-smooth) both;
}

.hero .button {
  animation: soft-pulse 2.8s ease-in-out infinite;
}

.contact-method:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.contact-method h3 {
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.contact-method p {
  margin: 0 auto 1.1rem;
  color: var(--gray-medium);
  font-size: 0.95rem;
  max-width: 36ch;
}

.contact-method .button {
  width: 100%;
  max-width: 320px;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* =========================
   LEGAL PAGES
========================= */
.legal-page {
  max-width: 900px;
}

.legal-page article {
  background: var(--white);
  border: 1px solid rgba(31, 79, 120, 0.12);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.legal-page h1 {
  margin-bottom: 0.75rem;
}

.legal-page .legal-meta {
  color: var(--gray-medium);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.legal-page h2 {
  margin-top: 1.8rem;
}

.legal-page ul {
  padding-left: 1.25rem;
}

.legal-page li {
  margin-bottom: 0.5rem;
}

@media (max-width: 980px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-info {
    padding: 2rem;
  }
}

@media (max-width: 640px) {
  .contact-page .whatsapp-float {
    bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  }

  .contact-form {
    padding: 1.5rem;
  }

  .contact-info {
    padding: 1.5rem;
  }

  .legal-page article {
    padding: 1.25rem;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
