/* Mahd Technologies — Coming Soon */

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("../fonts/cairo-arabic.woff2") format("woff2-variations"),
       url("../fonts/cairo-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("../fonts/cairo-latin.woff2") format("woff2-variations"),
       url("../fonts/cairo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --purple: #2f3193;
  --teal: #03737e;
  --purple-tint: color-mix(in srgb, var(--purple) 10%, white);
  --teal-tint: color-mix(in srgb, var(--teal) 8%, white);
  --purple-soft: color-mix(in srgb, var(--purple) 14%, white);
  --teal-soft: color-mix(in srgb, var(--teal) 12%, white);
  --ink: #1a1b2e;
  --muted: #4a4d63;
  --surface: #ffffff;
  --border: color-mix(in srgb, var(--purple) 18%, white);
  --shadow: 0 12px 40px color-mix(in srgb, var(--purple) 12%, transparent);
  --shadow-lift: 0 18px 48px color-mix(in srgb, var(--teal) 18%, transparent);
  --radius: 16px;
  --font: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
  --focus: 0 0 0 3px color-mix(in srgb, var(--teal) 55%, white);
  --max: 72rem;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-weight: 450;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background:
    linear-gradient(
      165deg,
      #ffffff 0%,
      color-mix(in srgb, var(--teal) 5%, white) 48%,
      color-mix(in srgb, var(--purple) 4%, white) 100%
    );
  text-align: start;
  overflow-x: clip;
  -webkit-tap-highlight-color: color-mix(in srgb, var(--teal) 22%, transparent);
}

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

button,
.btn,
.lang-switch,
.contact-link {
  touch-action: manipulation;
}

a {
  color: var(--teal);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--purple);
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--surface);
  color: var(--purple);
  border-radius: 8px;
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

#net {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.page {
  position: relative;
  z-index: 1;
  width: min(100%, var(--max));
  margin-inline: auto;
  padding-block-start: calc(1.25rem + env(safe-area-inset-top, 0px));
  padding-block-end: calc(3rem + env(safe-area-inset-bottom, 0px));
  padding-inline: max(1rem, env(safe-area-inset-left, 0px)) max(1rem, env(safe-area-inset-right, 0px));
}

.site-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 2.75rem;
  margin-block-end: 1.5rem;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--purple);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--purple) 8%, transparent);
}


.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.logo-panel {
  width: min(100%, 340px);
  background: #ffffff;
  border-radius: 20px;
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  margin-block-end: 0.5rem;
}

.logo-panel img {
  width: 100%;
  height: auto;
}

.status-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin-block: 0.35rem 0.15rem;
  padding: 0.55rem 1.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 14%, white);
  color: var(--teal);
  font-weight: 800;
  font-size: clamp(1.35rem, 4.5vw, 2.15rem);
  letter-spacing: 0.04em;
  line-height: 1.2;
  box-shadow:
    0 8px 24px color-mix(in srgb, var(--teal) 14%, transparent),
    0 0 0 1px color-mix(in srgb, var(--teal) 18%, white);
  overflow: hidden;
  isolation: isolate;
}

.status-chip-text {
  position: relative;
  z-index: 1;
  background: linear-gradient(
    110deg,
    var(--teal) 0%,
    var(--purple) 35%,
    #5ec8d4 50%,
    var(--purple) 65%,
    var(--teal) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--teal);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .status-chip-text {
    color: transparent;
  }
}

.status-chip::before,
.status-chip::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle, #ffffff 0%, transparent 70%);
  opacity: 0.85;
}

.status-chip::before {
  width: 0.45rem;
  height: 0.45rem;
  inset-inline-start: 18%;
  top: 28%;
}

.status-chip::after {
  width: 0.32rem;
  height: 0.32rem;
  inset-inline-end: 22%;
  bottom: 30%;
}

@media (prefers-reduced-motion: no-preference) {
  .status-chip-text {
    animation: chipShine 2.8s ease-in-out infinite;
  }

  .status-chip {
    animation: chipGlow 2.8s ease-in-out infinite;
  }

  .status-chip::before {
    animation: sparkleA 2.2s ease-in-out infinite;
  }

  .status-chip::after {
    animation: sparkleB 2.6s ease-in-out infinite 0.4s;
  }
}

@keyframes chipShine {
  0%,
  100% {
    background-position: 100% 50%;
  }
  50% {
    background-position: 0% 50%;
  }
}

@keyframes chipGlow {
  0%,
  100% {
    box-shadow:
      0 8px 24px color-mix(in srgb, var(--teal) 14%, transparent),
      0 0 0 1px color-mix(in srgb, var(--teal) 18%, white);
  }
  50% {
    box-shadow:
      0 10px 32px color-mix(in srgb, var(--teal) 28%, transparent),
      0 0 18px color-mix(in srgb, var(--purple) 22%, transparent),
      0 0 0 1px color-mix(in srgb, var(--teal) 28%, white);
  }
}

@keyframes sparkleA {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(0.6);
  }
  40% {
    opacity: 1;
    transform: scale(1.25);
  }
}

@keyframes sparkleB {
  0%,
  100% {
    opacity: 0.1;
    transform: scale(0.5);
  }
  55% {
    opacity: 0.95;
    transform: scale(1.35);
  }
}

.hero h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--purple);
  background: linear-gradient(120deg, var(--purple), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 {
    color: transparent;
  }
}

.tagline {
  margin: 0;
  font-size: clamp(1.1rem, 2.4vw, 1.35rem);
  font-weight: 600;
  color: var(--ink);
  max-width: 36ch;
}

.intro {
  margin: 0.25rem 0 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.services {
  margin-block-start: 3rem;
}

.services h2 {
  margin: 0 0 1.25rem;
  text-align: center;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--purple);
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.2rem 1.3rem;
  text-align: start;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--purple) 6%, transparent);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset-inline-start: 1.2rem;
  top: 0;
  width: 2.5rem;
  height: 3px;
  border-radius: 999px;
  background: var(--teal);
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.card-icon {
  width: 2rem;
  height: 2rem;
  margin-block-end: 0.75rem;
  color: var(--teal);
}

.card-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 750;
  color: var(--purple);
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

.contact {
  margin-block-start: 2.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(120deg, var(--purple), var(--teal));
  color: #ffffff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--teal) 25%, transparent);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    color: #ffffff;
    filter: brightness(1.05);
  }

  .btn-secondary:hover {
    color: var(--teal);
    border-color: var(--teal);
    filter: none;
  }

  .lang-switch:hover {
    border-color: var(--teal);
    color: var(--teal);
  }

  .contact-link:hover {
    color: var(--teal);
  }
}

.btn-secondary {
  background: var(--surface);
  color: var(--purple);
  border: 1px solid var(--border);
  box-shadow: none;
}

.contact-revealed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
  justify-content: center;
  width: min(100%, 26rem);
  margin-inline: auto;
  text-align: start;
}

.contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 48px;
  min-width: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--purple);
  text-decoration: none;
  direction: ltr;
  unicode-bidi: isolate;
  justify-self: stretch;
}

.contact-link-text {
  overflow-wrap: anywhere;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.contact-row .btn-secondary {
  width: 100%;
  min-width: 0;
  padding-inline: 0.75rem;
}

.contact-row-spacer {
  display: block;
  width: 100%;
  min-height: 48px;
  visibility: hidden;
  pointer-events: none;
}

.contact-icon {
  display: inline-flex;
  width: 1.45rem;
  height: 1.45rem;
  flex-shrink: 0;
  color: var(--teal);
}

.contact-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-wa .contact-icon {
  color: #128c7e;
}

.live-status {
  min-height: 1.4em;
  color: var(--teal);
  font-weight: 600;
  font-size: 0.95rem;
}

.site-footer {
  margin-block-start: 3rem;
  padding-block-start: 1.5rem;
  border-block-start: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0;
}

/* Fade-up on load — keyframes only (no opacity:0 base), so content stays
   readable if animations are disabled while reduced-motion still says "no-preference". */
@media (prefers-reduced-motion: no-preference) {
  .fade-up {
    animation: fadeUp 0.7s ease;
  }

  .fade-up-delay-1 { animation-delay: 0.08s; }
  .fade-up-delay-2 { animation-delay: 0.16s; }
  .fade-up-delay-3 { animation-delay: 0.24s; }
  .fade-up-delay-4 { animation-delay: 0.32s; }
  .fade-up-delay-5 { animation-delay: 0.4s; }
}

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

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

  .card {
    transition: none;
  }

  .card:hover,
  .card:focus-within {
    transform: none;
  }
}

/* 404 */
.page-404 {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
}

.page-404 h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.2rem);
  color: var(--purple);
}

.page-404 p {
  margin: 0;
  color: var(--muted);
  max-width: 40ch;
}

.page-404 .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.copy-helper {
  position: fixed;
  inset-inline-start: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* Skeleton loader (slow connections) */
#page-skeleton {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem 1rem 2rem;
  background:
    linear-gradient(
      165deg,
      #ffffff 0%,
      color-mix(in srgb, var(--teal) 5%, white) 48%,
      color-mix(in srgb, var(--purple) 4%, white) 100%
    );
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

html.is-ready #page-skeleton {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (scripting: none) {
  #page-skeleton {
    display: none !important;
  }
}

.skeleton-inner {
  width: min(100%, 42rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-block-start: 3.5rem;
}

.sk {
  display: block;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--purple) 8%, #e8e9f2) 0%,
    color-mix(in srgb, var(--teal) 10%, #f4f6fb) 50%,
    color-mix(in srgb, var(--purple) 8%, #e8e9f2) 100%
  );
  background-size: 200% 100%;
}

.sk-logo {
  width: min(100%, 340px);
  height: 9.5rem;
  border-radius: 20px;
}

.sk-chip {
  width: 8rem;
  height: 2.75rem;
  border-radius: 999px;
}

.sk-title {
  width: min(100%, 22rem);
  height: 2.8rem;
}

.sk-line {
  width: min(100%, 28rem);
  height: 1rem;
}

.sk-line.short {
  width: min(100%, 18rem);
}

.sk-cards {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-block-start: 1.5rem;
}

@media (min-width: 640px) {
  .sk-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.sk-card {
  height: 8.5rem;
  border-radius: 16px;
}

@media (prefers-reduced-motion: no-preference) {
  .sk {
    animation: skeletonPulse 1.35s ease-in-out infinite;
  }
}

@keyframes skeletonPulse {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-chip,
  .status-chip-text,
  .status-chip::before,
  .status-chip::after,
  .sk {
    animation: none;
  }

  .status-chip-text {
    color: var(--teal);
    background: none;
  }
}

/* Mobile refinements (phones ~320–480px) */
@media (max-width: 480px) {
  body {
    font-size: 1rem;
  }

  .page {
    padding-inline: max(0.85rem, env(safe-area-inset-left, 0px)) max(0.85rem, env(safe-area-inset-right, 0px));
  }

  .logo-panel {
    padding: 1rem 1.1rem;
    border-radius: 16px;
  }

  .hero {
    gap: 0.85rem;
  }

  .hero h1 {
    max-width: 14ch;
  }

  .intro {
    max-width: 100%;
    font-size: 0.98rem;
  }

  .status-chip {
    min-height: 48px;
    padding: 0.45rem 1.25rem;
  }

  .card {
    padding: 1.1rem 1rem 1.15rem;
  }

  .contact-revealed {
    width: 100%;
  }

  .contact-row {
    grid-template-columns: minmax(0, 1fr) 4.75rem;
    gap: 0.5rem;
  }

  .contact-link {
    font-size: 0.95rem;
    gap: 0.5rem;
  }

  .btn {
    width: min(100%, 20rem);
  }

  .contact-row .btn-secondary {
    font-size: 0.92rem;
  }

  #page-skeleton {
    padding-inline: 0.85rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sk-logo {
    height: 9rem;
  }
}

@media (max-width: 360px) {
  .contact-row {
    grid-template-columns: 1fr;
  }

  .contact-row-spacer {
    display: none;
  }

  .contact-row .btn-secondary {
    width: 100%;
  }
}

@media (hover: none) {
  .card:hover {
    transform: none;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--purple) 6%, transparent);
  }
}
