:root {
  --ink: #17352e;
  --muted: #657b74;
  --line: rgba(23, 53, 46, 0.12);
  --surface: rgba(255, 255, 255, 0.82);
  --green: #0a8f68;
  --green-deep: #087052;
  --mint: #dff5ec;
  --lime: #d7f06d;
  --orange: #ff9d52;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(215, 240, 109, 0.18), transparent 28rem),
    linear-gradient(145deg, #f9fbfa 0%, #edf5f1 100%);
  font-family: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  width: 24rem;
  height: 24rem;
  top: -10rem;
  left: -8rem;
  background: rgba(10, 143, 104, 0.08);
}

.ambient-two {
  width: 18rem;
  height: 18rem;
  right: 22%;
  bottom: -10rem;
  background: rgba(215, 240, 109, 0.16);
}

.app-shell {
  width: min(1380px, calc(100% - 48px));
  min-height: 100vh;
  margin: auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 15px;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(10, 143, 104, 0.22);
}

.brand-mark svg { width: 26px; stroke: currentColor; stroke-width: 1.8; }
.brand strong { display: block; font-size: 17px; letter-spacing: -0.02em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  color: var(--green-deep);
  border: 1px solid rgba(10, 143, 104, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 700;
}

.status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(10, 143, 104, 0.12);
}

.main-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(620px, 1.55fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: center;
  padding: 54px 0 58px;
}

.intro { align-self: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 19px;
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 800;
}

.eyebrow span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 8px;
  background: var(--green);
}

.intro h1 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(46px, 5.2vw, 78px);
  line-height: 1.12;
  letter-spacing: -0.055em;
  font-weight: 850;
}

.intro h1 em {
  position: relative;
  color: var(--green);
  font-style: normal;
  white-space: nowrap;
}

.intro h1 em::after {
  content: "";
  position: absolute;
  inset-inline: 2% 0;
  bottom: -6px;
  height: 8px;
  border-radius: 999px;
  background: var(--lime);
  opacity: 0.65;
  transform: rotate(-1deg);
  z-index: -1;
}

.intro > p {
  max-width: 440px;
  margin: 28px 0 30px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.95;
}

.primary-action {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  gap: 26px;
  padding: 0 22px;
  color: white;
  border: 0;
  border-radius: 16px;
  background: var(--ink);
  box-shadow: 0 12px 28px rgba(23, 53, 46, 0.18);
  cursor: pointer;
  transition: transform 150ms var(--ease-out), background-color 180ms ease, box-shadow 180ms ease;
}

.primary-action span { font-weight: 800; font-size: 14px; }
.primary-action svg { width: 18px; stroke: currentColor; stroke-width: 2; }
.primary-action:active { transform: scale(0.97); }
.primary-action:focus-visible, .letter-card:focus-visible, .focus-link:focus-visible, .brand:focus-visible {
  outline: 3px solid rgba(10, 143, 104, 0.25);
  outline-offset: 4px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 34px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.trust-row span { display: inline-flex; align-items: center; gap: 7px; }
.trust-row svg { width: 15px; stroke: var(--green); stroke-width: 2; }

.safety-console {
  position: relative;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 30px 80px rgba(29, 74, 61, 0.11), inset 0 0 0 1px rgba(23, 53, 46, 0.04);
  backdrop-filter: blur(18px);
}

.console-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  padding: 2px 4px 18px;
}

.console-top > div:first-child { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.console-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.console-top strong { font-size: 12px; }
.progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: #e4ece8; }
.progress-track span { display: block; width: 16.666%; height: 100%; border-radius: inherit; background: var(--green); transition: width 240ms var(--ease-out); }

.focus-card {
  min-height: 300px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(135deg, #eff9f5 0%, #e1f4ec 100%);
}

.focus-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 36px;
}

.focus-kicker { color: var(--green); font-size: 11px; font-weight: 850; }
.focus-copy h2 { margin: 8px 0 9px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.04em; }
.focus-copy > p { max-width: 380px; min-height: 50px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }

.focus-tip {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 23px;
  padding: 9px 11px 9px 16px;
  border: 1px solid rgba(10, 143, 104, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.64);
}

.tip-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: var(--orange);
  border-radius: 10px;
  background: rgba(255, 157, 82, 0.12);
}

.tip-icon svg { width: 17px; stroke: currentColor; stroke-width: 1.8; }
.focus-tip small, .focus-tip b { display: block; }
.focus-tip small { color: var(--muted); font-size: 9px; }
.focus-tip b { margin-top: 1px; font-size: 10px; }

.focus-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  color: var(--green-deep);
  text-decoration: none;
  font-size: 11px;
  font-weight: 850;
  transition: transform 150ms var(--ease-out), color 180ms ease;
}

.focus-link svg { width: 15px; stroke: currentColor; stroke-width: 2.2; }
.focus-link:active { transform: scale(0.97); }

.letter-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
}

.letter-stage::before {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(10, 143, 104, 0.08), 0 18px 45px rgba(10, 143, 104, 0.09);
}

.stage-orbit { position: absolute; border: 1px solid rgba(10, 143, 104, 0.16); border-radius: 50%; }
.orbit-one { width: 232px; height: 232px; }
.orbit-two { width: 278px; height: 278px; border-style: dashed; opacity: 0.58; }

.letter-shield {
  position: relative;
  z-index: 2;
  width: 135px;
  height: 151px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 58px 58px 66px 66px / 40px 40px 92px 92px;
  background: linear-gradient(145deg, #12a47b, #087052);
  box-shadow: 0 24px 44px rgba(10, 143, 104, 0.27), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 220ms var(--ease-in-out), filter 180ms ease;
}

.letter-shield span { display: block; margin-top: -7px; font-size: 84px; line-height: 1; font-weight: 800; }
.letter-shield.is-changing { transform: scale(0.95); filter: blur(2px); }

.mini-badge {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 4px solid #e7f5ef;
  border-radius: 50%;
  box-shadow: 0 8px 16px rgba(23, 53, 46, 0.12);
}

.badge-check { width: 44px; height: 44px; top: 54px; right: 16%; color: white; background: var(--green); }
.badge-check svg { width: 21px; stroke: currentColor; stroke-width: 2.4; }
.badge-plus { width: 36px; height: 36px; bottom: 46px; left: 17%; color: var(--green-deep); background: var(--lime); font-size: 21px; font-weight: 500; }

.letter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.letter-card {
  min-width: 0;
  min-height: 74px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: inherit;
  text-align: right;
  text-decoration: none;
  border: 1px solid rgba(23, 53, 46, 0.09);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  transition: transform 150ms var(--ease-out), border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.letter-card:active { transform: scale(0.97); }
.card-letter { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: var(--green-deep); background: #eef6f2; font-size: 26px; font-weight: 800; transition: color 180ms ease, background-color 180ms ease; }
.card-meta { min-width: 0; }
.card-meta b, .card-meta small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-meta b { font-size: 12px; }
.card-meta small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.card-state { width: 22px; height: 22px; display: grid; place-items: center; color: #93a49e; border: 1px solid var(--line); border-radius: 50%; font-size: 9px; }

.letter-card.is-active {
  border-color: rgba(10, 143, 104, 0.22);
  background: white;
  box-shadow: 0 9px 24px rgba(23, 53, 46, 0.07);
}

.letter-card.is-active .card-letter { color: white; background: var(--green); }
.letter-card.is-active .card-state { color: white; border-color: var(--green); background: var(--green); }

footer {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.footer-code { direction: ltr; letter-spacing: 0.12em; font-weight: 800; }

@media (hover: hover) and (pointer: fine) {
  .primary-action:hover { background: var(--green-deep); box-shadow: 0 14px 32px rgba(10, 143, 104, 0.22); }
  .focus-link:hover { color: var(--green); transform: translateX(-3px); }
  .letter-card:hover:not(.is-active) { transform: translateY(-2px); border-color: rgba(10, 143, 104, 0.18); background: white; }
}

@media (max-width: 1080px) {
  .main-grid { grid-template-columns: 1fr; gap: 44px; padding-top: 42px; }
  .intro { text-align: center; }
  .intro > p { margin-inline: auto; }
  .intro h1 { margin-inline: auto; }
  .trust-row, .primary-action { justify-content: center; }
}

@media (max-width: 720px) {
  .app-shell { width: min(100% - 24px, 620px); }
  .topbar { min-height: 84px; }
  .brand small { display: none; }
  .system-status span:last-child { display: none; }
  .main-grid { padding: 34px 0 40px; }
  .intro h1 { font-size: clamp(42px, 13vw, 62px); }
  .safety-console { padding: 12px; border-radius: 24px; }
  .focus-card { grid-template-columns: 1fr; }
  .focus-copy { order: 2; padding: 26px; }
  .letter-stage { min-height: 250px; }
  .letter-stage::before { width: 164px; height: 164px; }
  .orbit-one { width: 200px; height: 200px; }
  .orbit-two { width: 230px; height: 230px; }
  .letter-shield { width: 116px; height: 132px; }
  .letter-shield span { font-size: 72px; }
  .badge-check { top: 42px; right: 20%; }
  .badge-plus { bottom: 34px; left: 20%; }
  .letter-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 430px) {
  .intro > p { font-size: 14px; }
  .primary-action { width: 100%; justify-content: space-between; }
  .console-top { grid-template-columns: 1fr; gap: 9px; }
  .letter-grid { grid-template-columns: 1fr; }
  .letter-card { min-height: 68px; }
  footer span:first-child { display: none; }
  footer { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .letter-shield, .letter-card, .primary-action { transition-property: opacity, color, background-color, border-color; }
}
