/* AAG Saudi — Tesla-minimal
   Brand blue #013592 | Neutrals #FFFFFF #F5F7FA | Text #0B1220 #5B6478 */

:root {
  --aag-blue: #013592;
  --aag-blue-hover: #012a74;
  --aag-bg: #ffffff;
  --aag-bg-soft: #f5f7fa;
  --aag-text: #0b1220;
  --aag-muted: #5b6478;
  --aag-line: #e6eaf0;
  --aag-dark: #0b1220;
  --aag-radius: 2px;
  --aag-max: 1120px;
  --aag-space: clamp(4rem, 8vw, 7.5rem);
  --aag-font: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--aag-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--aag-text);
  background: var(--aag-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

.aag-container {
  width: min(100% - 2.5rem, var(--aag-max));
  margin-inline: auto;
}

.aag-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ——— Header ——— */
.aag-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 72px;
  display: flex;
  align-items: center;
  background: transparent;
  transition: background 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease;
}

.aag-header.is-scrolled,
.aag-header.is-solid {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--aag-line);
}

.aag-header__inner {
  width: min(100% - 2.5rem, var(--aag-max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.aag-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.aag-logo img {
  height: 36px;
  width: auto;
}

.aag-logo__lockup {
  display: none;
  height: 32px;
}

.aag-logo__mark {
  display: block;
  height: 36px;
}

.aag-header:not(.is-scrolled):not(.is-solid) .aag-logo__lockup {
  display: block;
}

.aag-header:not(.is-scrolled):not(.is-solid) .aag-logo__mark {
  display: none;
}

.aag-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.aag-nav__list {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.aag-nav__list a {
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--aag-text);
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.aag-header:not(.is-scrolled):not(.is-solid) .aag-nav__list a {
  color: #fff;
}

.aag-nav__list a:hover {
  opacity: 1;
}

.aag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  border-radius: var(--aag-radius);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.aag-btn--primary {
  background: var(--aag-blue);
  color: #fff;
}

.aag-btn--primary:hover {
  background: var(--aag-blue-hover);
}

.aag-btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.aag-btn--ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.aag-btn--outline {
  background: transparent;
  color: var(--aag-text);
  border-color: var(--aag-line);
}

.aag-btn--outline:hover {
  border-color: var(--aag-text);
}

.aag-header .aag-btn--primary {
  padding: 0.55rem 1.15rem;
  min-height: 40px;
}

.aag-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.aag-nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  margin: 5px auto;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.aag-header:not(.is-scrolled):not(.is-solid) .aag-nav-toggle {
  color: #fff;
}

.aag-header.is-scrolled .aag-nav-toggle,
.aag-header.is-solid .aag-nav-toggle {
  color: var(--aag-text);
}

/* ——— Hero ——— */
.aag-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: 8rem 0 5rem;
  background: var(--aag-dark);
  color: #fff;
  overflow: hidden;
}

.aag-hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(1, 53, 146, 0.35), transparent 55%),
    linear-gradient(160deg, #0b1220 0%, #0e1a33 45%, #0b1220 100%);
}

.aag-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 18, 32, 0.85) 0%, transparent 45%);
}

.aag-hero__content {
  position: relative;
  z-index: 1;
  width: min(100% - 2.5rem, var(--aag-max));
  margin-inline: auto;
  max-width: 720px;
}

.aag-hero__eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.aag-hero h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.aag-hero__sub {
  margin: 0 0 2.5rem;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  max-width: 28em;
}

.aag-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
}

.aag-hero__scroll {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

/* ——— Sections ——— */
.aag-section {
  padding: var(--aag-space) 0;
}

.aag-section--soft {
  background: var(--aag-bg-soft);
}

.aag-section__head {
  max-width: 36rem;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.aag-section__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--aag-muted);
}

.aag-section h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.aag-section__lead {
  margin: 0;
  color: var(--aag-muted);
  font-size: 1.0625rem;
}

/* ——— Value pillars ——— */
.aag-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--aag-line);
  border: 1px solid var(--aag-line);
}

.aag-pillar {
  padding: 2rem 1.5rem;
  background: var(--aag-bg);
}

.aag-pillar__index {
  display: block;
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--aag-blue);
  font-weight: 500;
}

.aag-pillar h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 500;
}

.aag-pillar p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--aag-muted);
  line-height: 1.55;
}

/* ——— Products ——— */
.aag-products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

a.aag-product {
  color: inherit;
  text-decoration: none;
}

.aag-product {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.75rem;
  background: var(--aag-bg);
  border: 1px solid var(--aag-line);
  transition: border-color 0.2s ease;
}

.aag-product:hover {
  border-color: #c5cede;
}

.aag-product__num {
  margin-bottom: 2.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--aag-muted);
}

.aag-product h3 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 500;
}

.aag-product p {
  margin: 0;
  flex: 1;
  font-size: 0.9375rem;
  color: var(--aag-muted);
}

.aag-product__link {
  margin-top: 1.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--aag-blue);
}

.aag-product:nth-child(4),
.aag-product:nth-child(5) {
  /* span look on large screens still fine in 3-col */
}

/* ——— Mid CTA ——— */
.aag-cta {
  padding: var(--aag-space) 0;
  background: var(--aag-dark);
  color: #fff;
  text-align: center;
}

.aag-cta h2 {
  margin: 0 auto 1rem;
  max-width: 18em;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.aag-cta p {
  margin: 0 auto 2rem;
  max-width: 32em;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.0625rem;
}

.aag-cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.875rem;
}

/* ——— About ——— */
.aag-about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.aag-about__visual {
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(145deg, #0b1220 0%, #013592 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.aag-about__visual img {
  width: min(70%, 280px);
  height: auto;
  opacity: 0.95;
}

.aag-about__body h2 {
  margin: 0 0 1rem;
}

.aag-about__body .aag-section__eyebrow {
  margin-bottom: 0.75rem;
}

.aag-about__body p {
  margin: 0 0 1rem;
  color: var(--aag-muted);
  font-size: 1.0625rem;
}

.aag-about__body p:last-of-type {
  margin-bottom: 1.75rem;
}

.aag-about__name {
  margin: 0 0 0.35rem !important;
  color: var(--aag-text) !important;
  font-weight: 500;
}

.aag-about__en {
  font-size: 0.875rem !important;
  letter-spacing: 0.02em;
}

/* ——— Service ——— */
.aag-services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.aag-service {
  padding: 0;
}

.aag-service h3 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 500;
}

.aag-service p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--aag-muted);
}

/* ——— Contact ——— */
.aag-contact {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.aag-contact__note {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--aag-bg-soft);
  border-left: 2px solid var(--aag-blue);
  font-size: 0.9375rem;
  color: var(--aag-muted);
}

.aag-contact__note strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--aag-text);
  font-weight: 500;
}

.aag-contact__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--aag-line);
}

.aag-contact__list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--aag-line);
  font-size: 0.9375rem;
}

.aag-contact__list span:first-child {
  color: var(--aag-muted);
}

.aag-contact__list span:last-child {
  color: var(--aag-text);
  text-align: right;
}

/* ——— Footer ——— */
.aag-footer {
  padding: 3rem 0 2rem;
  background: var(--aag-dark);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8125rem;
}

.aag-footer__inner {
  width: min(100% - 2.5rem, var(--aag-max));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.aag-footer__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.aag-footer__brand img {
  height: 28px;
  width: auto;
  opacity: 0.9;
}

.aag-footer__meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.aag-footer a:hover {
  color: #fff;
}

/* ——— Page fallback ——— */
.aag-page {
  padding: 8rem 0 var(--aag-space);
}

.aag-page h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 500;
}

.aag-page .entry-content {
  max-width: 40rem;
  color: var(--aag-muted);
}

/* ——— Responsive ——— */
@media (max-width: 960px) {
  .aag-pillars {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .aag-about,
  .aag-contact {
    grid-template-columns: 1fr;
  }

  .aag-services {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

@media (max-width: 768px) {
  .aag-nav-toggle {
    display: block;
  }

  .aag-nav {
    position: fixed;
    inset: 72px 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1.25rem 1.25rem 1.75rem;
    background: #fff;
    border-bottom: 1px solid var(--aag-line);
    box-shadow: 0 12px 24px rgba(11, 18, 32, 0.06);
  }

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

  .aag-nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .aag-nav__list li {
    width: 100%;
  }

  .aag-nav__list a {
    display: block;
    padding: 0.85rem 0;
    color: var(--aag-text) !important;
    font-size: 1rem;
    border-bottom: 1px solid var(--aag-line);
  }

  .aag-nav .aag-btn {
    width: 100%;
    margin-top: 1rem;
  }

  .aag-header:not(.is-scrolled):not(.is-solid) .aag-logo__lockup {
    display: none;
  }

  .aag-header:not(.is-scrolled):not(.is-solid) .aag-logo__mark {
    display: none;
  }

  /* On mobile dark hero: use inverted mark via filter on a dedicated white-friendly approach —
     show lockup always on mobile when over hero by forcing white lockup visibility */
  .aag-header:not(.is-scrolled):not(.is-solid) .aag-logo__lockup {
    display: block;
    height: 28px;
  }

  .aag-hero {
    align-items: center;
    padding: 7rem 0 4rem;
    text-align: left;
  }

  .aag-pillars,
  .aag-products {
    grid-template-columns: 1fr;
  }

  .aag-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* ——— Inner pages ——— */
.aag-header.is-inner .aag-logo__lockup {
  display: none;
}

.aag-header.is-inner .aag-logo__mark {
  display: block;
}

.aag-breadcrumb {
  margin: 0 0 1.5rem;
  font-size: 0.8125rem;
  color: var(--aag-muted);
}

.aag-breadcrumb a:hover {
  color: var(--aag-text);
}

.aag-breadcrumb__sep {
  margin: 0 0.4rem;
  opacity: 0.5;
}

.aag-page__header {
  margin-bottom: 1.5rem;
}

.aag-page__header h1 {
  margin: 0;
}

.entry-content {
  max-width: 46rem;
  color: var(--aag-text);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content .aag-lead {
  margin: 0 0 2rem;
  font-size: 1.125rem;
  color: var(--aag-muted);
  max-width: 38rem;
}

.entry-content .aag-subhead {
  margin: 0 0 1.5rem;
  font-size: 1.0625rem;
  color: var(--aag-muted);
  max-width: 40rem;
}

.entry-content h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.entry-content h3 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.0625rem;
  font-weight: 500;
}

.entry-content p {
  margin: 0 0 1rem;
  color: var(--aag-muted);
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  color: var(--aag-muted);
}

.entry-content li {
  margin-bottom: 0.35rem;
}

.entry-content .aag-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  max-width: none;
}

.entry-content .aag-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--aag-line);
  background: var(--aag-bg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease;
}

.entry-content a.aag-card:hover {
  border-color: #c5cede;
}

.entry-content .aag-card h3 {
  margin: 0 0 0.5rem;
  color: var(--aag-text);
}

.entry-content .aag-card p {
  margin: 0;
  flex: 1;
  font-size: 0.9375rem;
}

.entry-content .aag-card__more {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--aag-blue);
}

.entry-content .aag-params {
  width: 100%;
  max-width: 40rem;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
}

.entry-content .aag-params th,
.entry-content .aag-params td {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--aag-line);
  text-align: left;
  vertical-align: top;
}

.entry-content .aag-params th {
  width: 40%;
  font-weight: 500;
  color: var(--aag-text);
}

.entry-content .aag-params td {
  color: var(--aag-muted);
}

.entry-content .aag-note {
  margin: 1.5rem 0;
  padding: 1.15rem 1.25rem;
  background: var(--aag-bg-soft);
  border-left: 2px solid var(--aag-blue);
  font-size: 0.9375rem;
  color: var(--aag-muted);
}

.entry-content .aag-note strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--aag-text);
  font-weight: 500;
}

.entry-content .aag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
}

.entry-content .aag-filter {
  display: inline-flex;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--aag-line);
  font-size: 0.8125rem;
  color: var(--aag-muted);
  background: var(--aag-bg);
}

.entry-content .aag-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 0;
}

.entry-content .aag-placeholder-banner {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  background: #fff6e8;
  border: 1px solid #f0d9a8;
  color: #7a5a18;
  font-size: 0.875rem;
  font-weight: 500;
}

.entry-content .aag-wide {
  max-width: none;
}

@media (max-width: 768px) {
  .entry-content {
    max-width: none;
  }
}


/* ——— Case gallery ——— */
.entry-content .aag-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin: 1.25rem 0 2rem;
  max-width: none;
}
.entry-content .aag-gallery a {
  display: block;
  overflow: hidden;
  background: var(--aag-bg-soft);
  aspect-ratio: 4 / 3;
}
.entry-content .aag-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.entry-content .aag-case-cover {
  margin: 0 0 1.75rem;
  max-width: none;
  overflow: hidden;
  background: var(--aag-bg-soft);
}
.entry-content .aag-case-cover img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}
.entry-content .aag-case-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  margin: 0 0 1rem;
  background: var(--aag-bg-soft);
}
@media (max-width: 768px) {
  .entry-content .aag-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}
