:root {
  --primary-dark: #1e3a5f;
  --primary-blue: #8aaad0;
  --accent-purple: #6c5ce7;
  --accent-red: #ff7675;
  --accent-yellow: #fdcb6e;
  --bg-light: #f4f7fb;
  --bg-section: #eef3f8;
  --text-dark: #2d3436;
  --text-muted: #636e72;
  --white: #fff;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text-dark);
  background: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

html[lang="ar"] body {
  font-family: Tahoma, Arial, sans-serif;
}

.site-shell,
.section-inner {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
}

/* Shared header */
.site-header {
  position: relative;
  z-index: 10;
  display: block;
  padding: 0;
  background: var(--white);
  border-bottom: 1px solid transparent;
}

.legal-page .site-header {
  border-bottom-color: rgba(30, 58, 95, 0.08);
}

.site-header-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  color: var(--primary-dark);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-brand img {
  width: 80px;
  height: 80px;
  display: block;
  object-fit: contain;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 25px;
}

.site-nav a {
  color: var(--primary-dark);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--primary-dark);
}

.language-switch {
  display: inline-flex;
  width: auto;
  min-width: 42px;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px;
  border: 0;
  border-radius: 8px;
  color: var(--primary-dark);
  background: var(--white);
  text-decoration: none;
}

.language-switch span {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
}

.language-switch img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(20%) sepia(26%) saturate(1457%)
    hue-rotate(171deg) brightness(87%) contrast(91%);
}

.language-switch:focus-visible {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 38px;
  padding: 8px;
  border: 1px solid rgba(30, 58, 95, 0.25);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: var(--primary-dark);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Landing page */
.landing-page {
  line-height: 1.6;
}

.landing-page .hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding-top: 60px;
  padding-bottom: 60px;
}

.landing-page .hero-content h1 {
  margin: 0 0 20px;
  color: var(--primary-dark);
  font-size: 2.5rem;
  line-height: 1.2;
}

.landing-page .hero-content p {
  margin: 0 0 20px;
  font-size: 0.95rem;
}

.btn-demo-hero {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  color: var(--white);
  background: var(--primary-blue);
  font-weight: 600;
  text-decoration: none;
}

.illustration-frame {
  display: flex;
  align-items: center;
  justify-content: center;
}

.illustration-frame img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.hero-visual {
  min-height: 360px;
}

.community-section {
  padding-top: 20px;
  padding-bottom: 60px;
}

.community-section h2 {
  margin: 0 0 15px;
  color: var(--primary-dark);
  font-size: 1.5rem;
}

.community-section p {
  max-width: 800px;
  margin: 0;
}

.section-title {
  margin: 0 0 40px;
  color: var(--primary-dark);
  font-size: 1.8rem;
}

.why-hassala {
  padding: 64px 0 72px !important;
  background: var(--bg-section);
}

.why-hassala .section-title,
.use-cases .section-title {
  text-align: center;
}

.why-hassala .section-title {
  margin-bottom: 36px;
}

.features-grid,
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  min-height: 180px;
  padding: 28px 24px 22px;
  border: 1px solid rgba(30, 58, 95, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 10px 24px rgba(30, 58, 95, 0.04);
}

.feature-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.feature-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(30, 58, 95, 0.05);
}

.feature-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(20%) sepia(26%) saturate(1457%)
    hue-rotate(171deg) brightness(87%) contrast(91%);
}

.feature-card h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 1.2rem;
}

.feature-card p {
  margin: 8px 0 0;
  font-size: 0.94rem;
  line-height: 1.7;
}

.use-cases {
  padding-top: 80px;
  padding-bottom: 60px;
}

.use-cases-visual {
  min-height: 260px;
  margin-bottom: 50px;
}

.use-case-card {
  position: relative;
  overflow: hidden;
  padding: 25px 20px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  background: var(--white);
}

.use-case-card::before {
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 6px;
  content: "";
}

.card-purple::before { background: var(--accent-purple); }
.card-red::before { background: var(--accent-red); }
.card-yellow::before { background: var(--accent-yellow); }

.use-case-card h3 {
  margin: 5px 0 12px;
  color: var(--primary-dark);
  font-size: 1.1rem;
}

.use-case-card p {
  margin: 0;
  font-size: 0.88rem;
}

/* Legal pages */
.legal-page {
  line-height: 1.7;
}

.legal-content {
  width: 100%;
  max-width: 920px;
  margin-inline: auto;
  padding: 48px 22px 80px;
}

.legal-content h1,
.legal-content h2 {
  color: var(--primary-dark);
  line-height: 1.25;
}

.legal-content h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.legal-content h2 {
  margin: 28px 0 10px;
  font-size: 1.25rem;
}

.legal-content p,
.legal-content li {
  font-size: 1rem;
}

.legal-content ul {
  padding-inline-start: 20px;
}

.meta {
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.back-link {
  display: inline-block;
  margin-top: 26px;
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

/* Shared footer: landing page is the visual reference. */
.contact-footer {
  padding: 50px 0 30px !important;
  background: var(--bg-light);
}

.contact-footer .section-title {
  margin: 0 0 20px;
  text-align: start;
}

.contact-info {
  margin: 0 0 40px;
  color: var(--primary-dark);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: start;
}

.footer-email {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

.footer-email:hover,
.footer-email:focus-visible {
  text-decoration: underline;
}

.footer-address {
  display: block;
  margin-top: 4px;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid #e5e9f0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a,
.copyright-row {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links a {
  font-weight: 500;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--primary-dark);
}

[dir="ltr"] {
  unicode-bidi: isolate;
}

@media (min-width: 769px) {
  .landing-page .site-header-inner {
    min-height: 70px;
  }

  .landing-page .hero {
    gap: 32px;
    padding-top: 28px;
    padding-bottom: 24px;
  }

  .landing-page .hero-visual {
    min-height: 0;
    height: 315px;
    align-items: flex-start;
    overflow: hidden;
  }

  .landing-page .hero-visual img {
    width: 100%;
    height: 390px;
  }

  .landing-page .community-section {
    padding-top: 0;
    padding-bottom: 40px;
  }

  .landing-page .why-hassala {
    padding-top: 48px !important;
    padding-bottom: 56px !important;
  }

  .landing-page .why-hassala .section-title {
    margin-bottom: 28px;
  }

  .landing-page .use-cases {
    padding-top: 56px;
    padding-bottom: 48px;
  }

  .landing-page .use-cases-visual {
    min-height: 0;
    margin-bottom: 32px;
  }

  .landing-page .use-cases-visual img {
    width: 100%;
  }

  .landing-page .use-cases .section-title {
    margin-bottom: 28px;
  }
}

@media (max-width: 768px) {
  .site-shell,
  .section-inner {
    padding-inline: 22px;
  }

  .site-header-inner {
    min-height: 72px;
    gap: 12px;
  }

  .site-brand {
    font-size: 1.08rem;
    letter-spacing: 0.5px;
  }

  .site-brand img {
    width: 60px;
    height: 60px;
  }

  .header-controls {
    gap: 8px;
  }

  .language-switch {
    width: auto;
    min-width: 40px;
    height: 36px;
    padding: 7px;
  }

  .language-switch span {
    font-size: 0.78rem;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 22px 14px;
    border-bottom: 1px solid rgba(30, 58, 95, 0.1);
    background: var(--white);
    box-shadow: 0 12px 24px rgba(30, 58, 95, 0.08);
  }

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

  .site-nav a {
    padding: 11px 0;
    font-size: 0.9rem;
    text-align: start;
  }

  .landing-page .hero,
  .landing-page .community-section,
  .landing-page .use-cases {
    padding-inline: 22px !important;
  }

  .landing-page .hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 32px !important;
    padding-bottom: 24px !important;
  }

  .landing-page .hero-content h1 {
    margin-bottom: 14px;
    font-size: 2rem;
  }

  .landing-page .hero-content p {
    margin-bottom: 18px;
    font-size: 0.9rem;
  }

  .hero-visual {
    min-height: 0;
    height: 290px;
    align-items: flex-start;
    overflow: hidden;
  }

  .hero-visual img {
    height: 360px;
    max-height: none;
    object-fit: contain;
  }

  .community-section {
    padding-top: 0 !important;
    padding-bottom: 44px !important;
  }

  .community-section h2 {
    margin-bottom: 10px;
    font-size: 1.3rem;
  }

  .community-section p {
    font-size: 0.92rem;
  }

  .why-hassala {
    padding: 48px 0 52px !important;
  }

  .why-hassala .section-title {
    margin-bottom: 24px;
  }

  .features-grid,
  .use-cases-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .feature-card {
    min-height: 0;
    padding: 22px 18px 18px;
  }

  .use-cases {
    padding-top: 52px !important;
    padding-bottom: 48px !important;
  }

  .use-cases-visual {
    min-height: 0;
    margin-bottom: 28px;
  }

  .use-cases-visual img {
    max-height: 260px;
  }

  .use-cases .section-title {
    margin: 0 0 24px;
  }

  .contact-footer {
    padding: 38px 0 30px !important;
  }

  .contact-info {
    margin-bottom: 32px;
    font-size: 0.87rem;
    line-height: 1.6;
  }

  .footer-links {
    gap: 10px 16px;
  }

  .legal-content {
    padding: 40px 22px 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
