/* =====================================================================
   AI Vision homepage: glass cube edition.
   Loaded only by site/src/pages/index.html and scoped to body.home-v2,
   so shared pages (training, articles, AI Tools) never inherit it.
   ===================================================================== */

.home-v2 {
  --hv-bg: #eef0f2;
  --hv-ink: #0d0d0f;
  --hv-muted: #55585e;
  --hv-soft-muted: #7c8087;
  --hv-glass: linear-gradient(145deg, rgba(255, 255, 255, .76), rgba(255, 255, 255, .38));
  --hv-glass-border: rgba(255, 255, 255, .92);
  --hv-glass-shadow: 0 24px 60px rgba(18, 22, 30, .08), inset 0 1px 0 rgba(255, 255, 255, .95);
  --hv-lift-shadow: 0 32px 70px rgba(18, 22, 30, .14), inset 0 1px 0 #fff;
  --hv-radius: 26px;
  background: var(--hv-bg);
}

/* Frosted header. The blur lives on a pseudo-element: a backdrop-filter on
   .site-header itself would trap the fixed mobile menu (see site.css). */
.home-v2 .site-header { background: transparent; }
.home-v2 .site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(238, 240, 242, .68);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, .75);
}

/* --------------------------------------------------------------- Shared */
/* Glows sit behind all content (z-index -1) and may spill across section
   edges, so they never wash over text or end in a hard line. */
.hv-orb {
  position: absolute;
  z-index: -1;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
}
.hv-orb--red { width: min(64vw, 860px); right: -14%; top: -22%; background: radial-gradient(circle, rgba(226, 35, 26, .26), rgba(226, 35, 26, 0) 66%); }
.hv-orb--ink { width: min(50vw, 640px); left: 24%; bottom: -42%; background: radial-gradient(circle, rgba(16, 18, 22, .12), rgba(16, 18, 22, 0) 66%); }
.hv-orb--soft { width: min(70vw, 860px); left: -20%; top: -18%; background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 64%); }
.hv-orb--red-low { width: min(56vw, 720px); right: -12%; bottom: -36%; background: radial-gradient(circle, rgba(226, 35, 26, .14), rgba(226, 35, 26, 0) 66%); }
.hv-orb--red-contact { width: min(60vw, 760px); right: 4%; top: -18%; background: radial-gradient(circle, rgba(226, 35, 26, .2), rgba(226, 35, 26, 0) 66%); }

.hv-glass {
  background: var(--hv-glass);
  border: 1px solid var(--hv-glass-border);
  border-radius: var(--hv-radius);
  box-shadow: var(--hv-glass-shadow);
}
.hv-glass--blur {
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}

/* Cards that lift on hover. Keeps the .reveal fade from site.css. */
.hv-service,
.hv-activity,
.hv-article {
  color: var(--hv-ink);
  transition: opacity .9s var(--ease), transform .6s var(--ease), box-shadow .35s var(--ease);
}
.hv-service.is-visible:hover, .hv-service.is-visible:focus-visible,
.hv-activity.is-visible:hover, .hv-activity.is-visible:focus-visible,
.hv-article.is-visible:hover, .hv-article.is-visible:focus-visible {
  transform: translateY(-5px);
  box-shadow: var(--hv-lift-shadow);
  transition-delay: 0s;
  outline: none;
}

.home-v2 .hv-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin: 0 0 1.3rem;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--hv-soft-muted);
}
/* A single red cubelet instead of the usual rule line. */
.home-v2 .hv-eyebrow::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(226, 35, 26, .12);
}

.home-v2 .hv-h2 {
  max-width: 18ch;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.03;
  color: var(--hv-ink);
}
.hv-copy {
  max-width: 52ch;
  margin-top: 1.1rem;
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  line-height: 1.65;
  color: var(--hv-muted);
}

.hv-section {
  position: relative;
  overflow-x: clip;
  padding: clamp(4.5rem, 10vh, 8rem) 0;
}
.hv-section > .container { position: relative; z-index: 1; }
.hv-section--tint { background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .55) 35%, rgba(255, 255, 255, 0)); }

.hv-head { margin-bottom: clamp(2rem, 5vh, 3.25rem); }
.hv-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.hv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  margin-top: 2.2rem;
}
.home-v2 .hv-btn-glass {
  --btn-bg: rgba(255, 255, 255, .62);
  --btn-bd: rgba(13, 13, 15, .14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.hv-more {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: auto;
  padding-top: 1.3rem;
  font-size: .9rem;
  font-weight: 700;
  color: var(--hv-ink);
  transition: color .25s var(--ease);
}
.hv-more .hv-arrow { display: inline-block; transition: transform .3s var(--ease); }
a:hover .hv-more, a.hv-more:hover, a:focus-visible .hv-more { color: var(--accent); }
a:hover .hv-more .hv-arrow, a.hv-more:hover .hv-arrow { transform: translateX(4px); }
.hv-more--lg { margin: 0; padding: 0; font-size: 1rem; }

/* ----------------------------------------------------------------- Hero */
.hv-hero {
  position: relative;
  overflow-x: clip;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(620px, calc(100svh - var(--header-h)), 920px);
}
.hv-hero__stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
.hv-hero__stage.is-ready { opacity: 1; }
.hv-hero__stage canvas { display: block; width: 100%; height: 100%; }
.hv-hero__inner { position: relative; z-index: 1; }
.hv-hero__copy {
  max-width: 600px;
  padding-block: clamp(3rem, 8vh, 6rem);
}

.home-v2 .hv-title {
  font-size: clamp(3.1rem, 7.4vw, 6.4rem);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: .96;
  color: var(--hv-ink);
}
.hv-accent { color: var(--accent); }
.hv-lead {
  max-width: 44ch;
  margin-top: 1.6rem;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.6;
  color: var(--hv-muted);
}
.hv-proof {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.4rem;
  margin: 2.2rem 0 0;
  padding: 0;
  list-style: none;
  font-size: .85rem;
  font-weight: 600;
  color: var(--hv-soft-muted);
}
.hv-proof li { display: inline-flex; align-items: center; gap: .55rem; }
.hv-proof li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: rgba(13, 13, 15, .35);
}

/* Hero entrance, triggered by site.js adding body.is-loaded. */
.hv-hero__copy > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.is-loaded .hv-hero__copy > * { opacity: 1; transform: none; }
.is-loaded .hv-hero__copy > :nth-child(2) { transition-delay: .08s; }
.is-loaded .hv-hero__copy > :nth-child(3) { transition-delay: .18s; }
.is-loaded .hv-hero__copy > :nth-child(4) { transition-delay: .28s; }
.is-loaded .hv-hero__copy > :nth-child(5) { transition-delay: .38s; }

/* ------------------------------------------------------- Make it simple */
.hv-simple {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(1.75rem, 4vw, 3.5rem);
}
.hv-terms {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1.8rem;
}
.hv-term {
  appearance: none;
  padding: .62rem 1.05rem;
  border: 1px solid rgba(13, 13, 15, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--hv-ink);
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.hv-term:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.hv-term.is-active { background: var(--hv-ink); border-color: var(--hv-ink); color: #fff; }
.hv-term:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.hv-explain {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  border: 1px solid #fff;
  border-radius: 20px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 18px 44px rgba(18, 22, 30, .07);
}
.hv-explain__label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--hv-soft-muted);
}
.hv-explain__complex {
  margin-top: .7rem;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  font-size: .9rem;
  line-height: 1.65;
  color: #8a8d93;
  transition: opacity .25s ease, filter .25s ease;
}
.hv-explain.is-swapping .hv-explain__complex { opacity: 0; filter: blur(3px); }
.hv-explain__divider {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 1.6rem 0 1.1rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}
.hv-explain__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(226, 35, 26, .4), rgba(226, 35, 26, 0));
}
.hv-explain__cube { width: 11px; height: 11px; border-radius: 3px; background: var(--accent); }
.hv-explain__simple {
  font-size: clamp(1.3rem, 2.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.32;
  color: var(--hv-ink);
}
.hv-explain__simple .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(.4em);
  filter: blur(4px);
  transition: opacity .45s var(--ease-out), transform .45s var(--ease-out), filter .45s var(--ease-out);
}
.hv-explain__simple.is-in .w { opacity: 1; transform: none; filter: none; }

/* ------------------------------------------------------------- Services */
.hv-services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}
.hv-service {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 1.75rem 1.6rem 1.5rem;
}
.hv-cells { width: 34px; height: 34px; }
.hv-cells rect { fill: rgba(13, 13, 15, .1); transition: fill .3s var(--ease); }
.hv-cells rect.on { fill: var(--accent); }
.hv-service:hover .hv-cells rect:not(.on) { fill: rgba(13, 13, 15, .2); }
.hv-service__num {
  margin-top: 1.6rem;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--hv-soft-muted);
}
.home-v2 .hv-service h3 {
  margin-top: .4rem;
  font-size: 1.4rem;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.hv-service p {
  margin-top: .7rem;
  font-size: .98rem;
  line-height: 1.55;
  color: var(--hv-muted);
}

/* ------------------------------------------------------------- Training */
.hv-train {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hv-train__intro .btn { margin-top: 1.8rem; }
.hv-train__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.hv-activity {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 1.5rem;
}
.hv-tag {
  align-self: flex-start;
  padding: .32rem .7rem;
  border: 1px solid rgba(226, 35, 26, .18);
  border-radius: 999px;
  background: rgba(226, 35, 26, .07);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.home-v2 .hv-activity h3 {
  margin-top: 1.5rem;
  font-size: 1.2rem;
  letter-spacing: -.025em;
  line-height: 1.15;
}
.hv-activity p {
  margin-top: .45rem;
  font-size: .92rem;
  line-height: 1.5;
  color: var(--hv-muted);
}

/* --------------------------------------------------------------- Method */
.hv-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hv-steps::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 22px;
  right: 2%;
  height: 1px;
  background: linear-gradient(90deg, rgba(226, 35, 26, .55), rgba(13, 13, 15, .12));
}
.hv-step { position: relative; padding-top: 3.5rem; }
.hv-step__n {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #fff;
  border-radius: 12px;
  background: var(--hv-glass);
  box-shadow: var(--hv-glass-shadow);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--hv-ink);
}
.hv-step:first-child .hv-step__n { border-color: var(--accent); background: var(--accent); color: #fff; }
.home-v2 .hv-step h3 { font-size: 1.25rem; letter-spacing: -.03em; }
.hv-step p {
  max-width: 26ch;
  margin-top: .5rem;
  font-size: .95rem;
  line-height: 1.55;
  color: var(--hv-muted);
}

/* ------------------------------------------------------------- Articles */
.hv-articles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}
.hv-article {
  display: flex;
  flex-direction: column;
  padding: .7rem .7rem 1.4rem;
}
.hv-article img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 18px;
}
.hv-article__kicker {
  margin: 1.1rem .7rem 0;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.home-v2 .hv-article h3 {
  margin: .45rem .7rem 0;
  font-size: 1.2rem;
  letter-spacing: -.02em;
  line-height: 1.25;
}

/* -------------------------------------------------------------- Contact */
.hv-contact {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(1.75rem, 4.5vw, 4rem);
}
.hv-contact__lines {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  margin: 2.2rem 0 0;
}
.hv-contact__lines dt {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--hv-soft-muted);
}
.hv-contact__lines dd { margin: .3rem 0 0; font-weight: 700; }
.hv-contact__lines a { transition: color .25s var(--ease); }
.hv-contact__lines a:hover, .hv-contact__lines a:focus-visible { color: var(--accent); }

.hv-signature { justify-self: end; width: 100%; max-width: 300px; margin: 0; }
.hv-signature img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 6px solid rgba(255, 255, 255, .85);
  border-radius: 22px;
  box-shadow: 0 30px 60px rgba(18, 22, 30, .14);
}
.hv-signature figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .9rem;
  padding: 0 .3rem;
}
.hv-signature strong { font-size: 1.05rem; letter-spacing: -.02em; }
.hv-signature figcaption > span { font-size: .8rem; font-weight: 600; color: var(--hv-soft-muted); }

/* ----------------------------------------------------------- Responsive */
@media (max-width: 980px) {
  .hv-simple,
  .hv-train,
  .hv-contact { grid-template-columns: 1fr; }
  .hv-services,
  .hv-articles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hv-steps { grid-template-columns: 1fr; gap: 0; }
  .hv-steps::before {
    top: 22px;
    bottom: 22px;
    left: 22px;
    right: auto;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, rgba(226, 35, 26, .55), rgba(13, 13, 15, .12));
  }
  .hv-step { min-height: 44px; padding: .55rem 0 1.7rem 4.4rem; }
  .hv-step p { max-width: 46ch; }
  .hv-signature { justify-self: start; max-width: 220px; }
}

@media (max-width: 760px) {
  .hv-hero { flex-direction: column; align-items: stretch; min-height: 0; }
  .hv-hero__stage { position: relative; inset: auto; height: min(88vw, 400px); }
  .hv-hero__stage.is-unavailable { display: none; }
  .hv-hero__copy { padding-block: 0 3.5rem; }
  .hv-services,
  .hv-articles,
  .hv-train__grid { grid-template-columns: 1fr; }
  .hv-service { min-height: 0; }
  .hv-activity { min-height: 170px; }
  .hv-explain { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hv-hero__copy > *,
  .hv-explain__simple .w,
  .hv-explain__complex { opacity: 1; transform: none; filter: none; transition: none; }
  .hv-service, .hv-activity, .hv-article, .hv-term { transition: none; }
}

/* ------------------------------------------------------ Arabic / RTL */
/* The language button is shared with the training pages; show it here too. */
body.home-v2 .training-header-lang { display: inline-flex; }

.home-v2.lang-ar .site-main { font-family: "Noto Kufi Arabic", "Inter", sans-serif; }
/* Tracking breaks Arabic letter joins, and caps do nothing for Arabic. */
.home-v2.lang-ar .site-main *,
.home-v2.lang-ar .site-footer * { letter-spacing: 0 !important; }
.home-v2.lang-ar .hv-title { font-size: clamp(2.2rem, 4.2vw, 4rem); line-height: 1.35; }
.home-v2.lang-ar .hv-hero__copy { max-width: 640px; }
.home-v2.lang-ar .hv-h2 { font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1.45; max-width: 24ch; }
/* The textbook line is set in a monospace face, which has no Arabic glyphs. */
.home-v2.lang-ar .hv-explain__complex { font-family: "Noto Kufi Arabic", "Inter", sans-serif; }
.home-v2.lang-ar .hv-eyebrow { font-size: .82rem; }
.home-v2.lang-ar .hv-explain__complex,
.home-v2.lang-ar .hv-explain__simple { line-height: 1.85; }

/* Arrows point the way Arabic reads. */
.home-v2.lang-ar .btn__arrow,
.home-v2.lang-ar .hv-more .hv-arrow { transform: scaleX(-1); }
.home-v2.lang-ar .btn:hover .btn__arrow,
.home-v2.lang-ar a:hover .hv-more .hv-arrow,
.home-v2.lang-ar a.hv-more:hover .hv-arrow { transform: scaleX(-1) translateX(4px); }

/* The cube moves to the left (home.js), so its glow follows. */
.home-v2.lang-ar .hv-orb--red { right: auto; left: -14%; }
.home-v2.lang-ar .hv-orb--red-low { right: auto; left: -12%; }
.home-v2.lang-ar .hv-orb--red-contact { right: auto; left: 4%; }

/* Method timeline runs right to left. */
.home-v2.lang-ar .hv-steps::before {
  left: 2%;
  right: 22px;
  background: linear-gradient(270deg, rgba(226, 35, 26, .55), rgba(13, 13, 15, .12));
}
.home-v2.lang-ar .hv-step__n { left: auto; right: 0; }

@media (max-width: 980px) {
  .home-v2.lang-ar .hv-steps::before {
    left: auto;
    right: 22px;
    background: linear-gradient(180deg, rgba(226, 35, 26, .55), rgba(13, 13, 15, .12));
  }
  .home-v2.lang-ar .hv-step { padding: .55rem 4.4rem 1.7rem 0; }
}
