/* =========================================================
   AquaBlue House — Stylesheet
   Palette derived from logo.png (deep ocean blues)
   ========================================================= */

:root {
  /* Brand */
  --brand-900: #0a2540;
  --brand-800: #103a63;
  --brand-700: #154b80;
  --brand-600: #1d63a8;
  --brand-500: #2b7fc9;
  --brand-400: #5ba2dd;
  --brand-300: #9cc6ec;
  --brand-100: #e4f0fa;
  --brand-50:  #f3f8fd;
  --accent:    #1d63a8;

  /* Light theme tokens */
  --bg: #ffffff;
  --bg-alt: #f5f9fd;
  --surface: #ffffff;
  --surface-2: #f0f5fa;
  --border: #e1e8f0;
  --text: #0a2540;
  --text-muted: #4a6079;
  --text-soft: #6c7e92;
  --shadow-sm: 0 2px 8px rgba(10, 37, 64, 0.06);
  --shadow-md: 0 8px 24px rgba(10, 37, 64, 0.08);
  --shadow-lg: 0 18px 50px rgba(10, 37, 64, 0.12);
  --primary: var(--brand-700);
  --primary-hover: var(--brand-800);
  --on-primary: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.85);

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Amiri', serif;
  --font-body: 'Inter', 'Tajawal', system-ui, sans-serif;

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --container-max: 1200px;
  --header-h: 72px;
  --transition: 240ms cubic-bezier(.4,.0,.2,1);
}

[data-theme="dark"] {
  --bg: #0a1828;
  --bg-alt: #0e2034;
  --surface: #122a44;
  --surface-2: #16334f;
  --border: #1f3d5d;
  --text: #e6eef7;
  --text-muted: #a9bdd1;
  --text-soft: #8aa0b8;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
  --primary: var(--brand-500);
  --primary-hover: var(--brand-400);
  --on-primary: #ffffff;
  --nav-bg: rgba(10, 24, 40, 0.85);
}

/* RTL adjustments */
html[dir="rtl"] {
  --font-display: 'Amiri', 'Cormorant Garamond', serif;
  --font-body: 'Tajawal', 'Inter', system-ui, sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4 { letter-spacing: 0; }

ul { list-style: none; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm { padding: 10px 20px; font-size: 0.875rem; }

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--on-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background var(--transition), border var(--transition);
}

.nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 600;
}
.nav-logo img { height: 40px; width: auto; }
.nav-brand { font-family: var(--font-display); font-size: 1.25rem; }

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-link {
  position: relative;
  padding: 8px 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: var(--primary); background: var(--surface-2); }
.nav-link.active { color: var(--primary); }
.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-toggle, .theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}
.lang-toggle:hover, .theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.lang-toggle .flag { display: inline-flex; border-radius: 3px; overflow: hidden; }
.lang-toggle .flag-sa { display: none; }
.lang-toggle .flag-us { display: inline-flex; }
html[dir="rtl"] .lang-toggle .flag-sa { display: inline-flex; }
html[dir="rtl"] .lang-toggle .flag-us { display: none; }

.theme-toggle { padding: 8px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: all var(--transition);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 60px) 0 80px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.45) saturate(1.1);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(10, 37, 64, 0.75) 0%,
    rgba(21, 75, 128, 0.65) 50%,
    rgba(10, 37, 64, 0.8) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 880px;
  color: #fff;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-300);
  padding: 6px 14px;
  border: 1px solid rgba(156, 198, 236, 0.4);
  border-radius: 999px;
  margin-bottom: 24px;
}
html[dir="rtl"] .eyebrow { letter-spacing: 0; }
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 600;
  color: #fff;
  margin-bottom: 24px;
}
.hero-title .hero-sub {
  display: block;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 400;
  color: var(--brand-300);
  margin-top: 12px;
  font-family: var(--font-body);
}
.hero-desc {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 680px;
  margin: 0 auto 36px;
}
.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.hero-cta .btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.hero-cta .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.hero-pills {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.pill {
  padding: 8px 18px;
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

/* ---------- Sections ---------- */
.section {
  padding: 100px 0;
}
.section-alt { background: var(--bg-alt); }

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 64px;
}
.section-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 14px;
}
html[dir="rtl"] .section-tag { letter-spacing: 0; }
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 18px;
}
.section-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 auto;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  margin-bottom: 80px;
}
.about-text h3 {
  font-size: 1.5rem;
  margin: 24px 0 12px;
  color: var(--primary);
}
.about-text h3:first-child { margin-top: 0; }
.about-text p { color: var(--text-muted); margin-bottom: 8px; }

.check-list { margin-top: 12px; }
.check-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  color: var(--text);
}
html[dir="rtl"] .check-list li { padding-left: 0; padding-right: 28px; }
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 20px; height: 20px;
  background: var(--brand-100);
  color: var(--primary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
html[dir="rtl"] .check-list li::before { left: auto; right: 0; }
[data-theme="dark"] .check-list li::before { background: var(--brand-800); color: var(--brand-300); }

.about-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.about-visual img { width: 100%; height: 480px; object-fit: cover; }
.about-badge {
  position: absolute;
  bottom: 24px;
  left: 24px;
  background: var(--surface);
  color: var(--text);
  padding: 16px 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
html[dir="rtl"] .about-badge { left: auto; right: 24px; }
.about-badge strong {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--primary);
}
.about-badge span { font-size: 0.85rem; color: var(--text-muted); }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.stat { text-align: center; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.2rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.stat-num span {
  font-size: 1rem;
  color: var(--text-soft);
  font-weight: 400;
  margin-left: 4px;
}
.stat-label {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 80px;
}
.service-card {
  background: var(--surface);
  padding: 32px 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.service-icon {
  width: 52px; height: 52px;
  background: var(--brand-100);
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
[data-theme="dark"] .service-icon { background: var(--brand-800); color: var(--brand-300); }
.service-icon svg { width: 26px; height: 26px; }
.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}
.service-card p { color: var(--text-muted); font-size: 0.95rem; }

/* Performance */
.perf {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-sm);
}
.perf-title {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 32px;
  color: var(--primary);
}
.perf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.perf-block h4 {
  font-size: 1.1rem;
  margin-bottom: 14px;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand-100);
}
[data-theme="dark"] .perf-block h4 { border-color: var(--brand-800); }
.perf-block ul li {
  padding: 8px 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  border-bottom: 1px dashed var(--border);
}
.perf-block ul li:last-child { border-bottom: none; }

/* ---------- Portfolio ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.portfolio-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.portfolio-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.portfolio-item img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 500ms ease;
}
.portfolio-item:hover img { transform: scale(1.05); }
.portfolio-item figcaption { padding: 20px 22px; }
.portfolio-item h4 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}
.portfolio-item p { color: var(--text-muted); font-size: 0.9rem; }

.portfolio-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-900) 100%);
  color: #fff;
  min-height: 350px;
}
.portfolio-cta-inner {
  text-align: center;
  padding: 32px;
}
.portfolio-cta h4 { color: #fff; font-size: 1.5rem; margin-bottom: 12px; }
.portfolio-cta p { color: rgba(255, 255, 255, 0.85); margin-bottom: 20px; }

/* ---------- Testimonials ---------- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.testimonial {
  background: var(--surface);
  padding: 36px 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  position: relative;
}
.quote-mark {
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--brand-300);
  line-height: 0.5;
  margin-bottom: 12px;
}
.testimonial p {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 20px;
  font-style: italic;
}
.testimonial footer { border-top: 1px solid var(--border); padding-top: 14px; }
.testimonial footer strong { display: block; color: var(--primary); margin-bottom: 2px; }
.testimonial footer span { color: var(--text-soft); font-size: 0.875rem; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
  align-items: start;
}
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.contact-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.contact-icon {
  width: 44px; height: 44px;
  flex-shrink: 0;
  background: var(--brand-100);
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme="dark"] .contact-icon { background: var(--brand-800); color: var(--brand-300); }
.contact-icon svg { width: 20px; height: 20px; }
.contact-item h4 { font-size: 1rem; margin-bottom: 4px; }
.contact-item p, .contact-item a { color: var(--text-muted); font-size: 0.95rem; }
.contact-item a:hover { color: var(--primary); }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color var(--transition);
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 99, 168, 0.12);
}
.form-field textarea { resize: vertical; min-height: 110px; }
.form-status {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--primary);
  min-height: 1.2em;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--brand-900);
  color: #cbd9e7;
  padding: 56px 0 28px;
  margin-top: 40px;
}
.footer-container {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 32px;
  align-items: center;
}
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-brand img { height: 56px; width: auto; background: #fff; padding: 6px; border-radius: 8px; }
.footer-brand p { font-size: 0.85rem; color: var(--brand-300); }
.footer-links {
  display: flex;
  gap: 22px;
  justify-content: center;
  flex-wrap: wrap;
}
.footer-links a {
  color: #cbd9e7;
  font-size: 0.92rem;
  font-weight: 500;
}
.footer-links a:hover { color: #fff; }
.footer-copy {
  text-align: right;
  font-size: 0.85rem;
  color: var(--brand-300);
}
html[dir="rtl"] .footer-copy { text-align: left; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-visual img { height: 360px; }
  .services-grid,
  .portfolio-grid,
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .perf-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-container { grid-template-columns: 1fr; text-align: center; }
  .footer-brand { align-items: center; }
  .footer-copy { text-align: center; }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 4px;
    transform: translateY(-120%);
    transition: transform var(--transition);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-link { width: 100%; padding: 12px 16px; }
  .nav-link.active::after { display: none; }
  .hamburger { display: flex; }
  .nav-brand { font-size: 1.05rem; }

  .section { padding: 70px 0; }
  .section-head { margin-bottom: 44px; }

  .services-grid,
  .portfolio-grid,
  .testimonials-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; padding: 24px; }
  .perf { padding: 28px; }
  .form-row { grid-template-columns: 1fr; }
  .contact-form { padding: 24px; }
  .hero { min-height: 88vh; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
}
