/* ======================================================
   GLOBAL SITE CSS — PREMIUM, MOBILE-FIRST:
index, about, portfolio, testimonials,
          contact, thank-you
====================================================== */

/* ================= DESIGN TOKENS ================= */
:root {
  --color-primary: #0a2540;
  --color-accent: #00c9a7;
  --color-bg: #f8fafb;
  --color-text: #1f2933;
  --color-muted: #444;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 4px 10px rgba(0,0,0,0.08);
  --shadow-md: 0 10px 28px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 36px rgba(0,0,0,0.12);
}

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

html {
  scroll-behavior: smooth;
}

html[dir="rtl"] {
  direction: rtl;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* JS-enhanced fade-in */
.js-enabled body {
  animation: fadeInPage 0.8s ease forwards;
}

/* ================= GLOBAL IMAGE FIX ================= */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ================= CONTAINER ================= */
.container {
  max-width: 1100px;
  margin-inline: auto;
  padding: 1rem;
}

/* ================= HEADER / NAV ================= */
header {
  background: var(--color-primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  transform: translateY(-100%);
  animation: slideDown 0.45s ease forwards 0.25s;
  will-change: transform;
}

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

/* ================= LOGO ================= */
.logo {
  font-size: 1.3rem;
  font-weight: 800;
  user-select: none;
  transition: transform 0.3s ease, color 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
  color: var(--color-accent);
}

/* ================= HAMBURGER ================= */
[data-hamburger] {
  font-size: 1.9rem;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
}

[data-hamburger]:hover,
[data-hamburger]:focus-visible {
  color: var(--color-accent);
  transform: scale(1.1);
  outline-offset: 3px;
}

/* ================= NAV MENU ================= */
[data-nav-menu] {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
  background: var(--color-primary);
  padding: 1rem;
  border-radius: var(--radius-lg);

  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    max-height 0.35s ease,
    opacity 0.35s ease,
    transform 0.35s ease;
}

/* ✅ IMPROVED MOBILE SAFETY */
[data-nav-menu].show {
  max-height: 80vh;
  overflow-y: auto;
  opacity: 1;
  transform: translateY(0);
}

[data-nav-menu] a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 0.55rem 0.8rem;
  min-height: 44px; /* better tap target */
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    transform 0.2s ease;
}

[data-nav-menu] a:hover,
[data-nav-menu] a.active {
  color: var(--color-accent);
  background: rgba(0,201,167,0.15);
  transform: translateX(4px);
}

/* ================= LANGUAGE SELECT ================= */
[data-lang-select] {
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
}

[data-lang-select]:focus {
  outline: none;
  box-shadow: 0 0 8px rgba(0,201,167,0.5);
}

/* ================= SECTIONS ================= */
.section {
  padding: 3rem 0;
}

.section h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ================= HERO ================= */
.hero {
  text-align: center;
  padding: 3rem 0;
  animation: fadeUp 0.7s ease forwards 0.4s;
  will-change: transform, opacity;
}

.hero-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-inline: auto;
}

.hero-img:hover {
  transform: scale(1.05);
  box-shadow: 0 14px 32px rgba(0,201,167,0.45);
}

/* ================= CARDS ================= */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.card:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.3s ease;
}

.btn:hover,
.btn:focus {
  background: #003f5c;
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0,63,92,0.45);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--color-accent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #009e80;
}

/* ================= PROJECT GRID ================= */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.project-card img {
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
}

.project-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.project-card p {
  color: var(--color-muted);
  margin-bottom: 1rem;
}

/* ================= CONTACT CTA ================= */
.contact-cta {
  background: var(--color-primary);
  color: #fff;
  padding: 3rem 1rem;
  text-align: center;
}

/* ================= FOOTER ================= */
footer {
  background: var(--color-primary);
  color: #fff;
  text-align: center;
  padding: 1.2rem;
  font-size: 0.9rem;
  margin-top: 3rem;
}

/* ================= DESKTOP ================= */
@media (min-width: 768px) {
  [data-hamburger] {
    display: none;
  }

  [data-nav-menu] {
    flex-direction: row;
    background: none;
    padding: 0;
    max-height: none;
    opacity: 1;
    transform: none;
  }

  .hero {
    padding: 4rem 0;
  }

  .hero-img {
    width: 200px;
    height: 200px;
  }

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

@media (min-width: 1200px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ================= ACCESSIBILITY ================= */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ================= ANIMATIONS ================= */
@keyframes fadeInPage {
  to { opacity: 1; }
}

@keyframes slideDown {
  to { transform: translateY(0); }
}

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