/* صفحة الترحيب + صفحة 404 */

.welcome {
  display: flex;
  flex-direction: column;
  color: var(--paper);
  background:
    radial-gradient(60rem 40rem at 50% -10%, rgb(242 178 51 / 0.14), transparent 60%),
    radial-gradient(50rem 50rem at 110% 110%, rgb(30 58 138 / 0.9), transparent 70%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 55%, var(--navy-ink) 100%);
  background-attachment: fixed;
  padding:
    max(var(--space-6), env(safe-area-inset-top))
    max(var(--space-4), env(safe-area-inset-right))
    max(var(--space-5), env(safe-area-inset-bottom))
    max(var(--space-4), env(safe-area-inset-left));
}

.welcome--center {
  align-items: center;
  justify-content: center;
}

.welcome__main {
  flex: 1;
  inline-size: 100%;
  max-inline-size: 68rem;
  margin-inline: auto;
}

/* ---------- Hero ---------- */

.welcome__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-block: var(--space-5) var(--space-7);
}

.welcome__hero > * {
  animation: rise 700ms var(--ease-out) both;
}
.welcome__hero > :nth-child(2) { animation-delay: 80ms; }
.welcome__hero > :nth-child(3) { animation-delay: 160ms; }
.welcome__hero > :nth-child(4) { animation-delay: 240ms; }

.welcome__title {
  margin-block-start: var(--space-5);
  font-size: clamp(2.75rem, 9vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.welcome__tagline {
  margin-block-start: var(--space-4);
  font-size: clamp(1.25rem, 3.6vw, 1.9rem);
  font-weight: 600;
  color: var(--gold-bright);
}

.welcome__description {
  max-inline-size: 36rem;
  margin-block-start: var(--space-3);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: rgb(255 255 255 / 0.78);
}

/* ---------- Hourglass (الأساس بـ hourglass.css) ---------- */

.welcome .hourglass {
  inline-size: clamp(6rem, 22vw, 9rem);
}

/* ---------- Templates ---------- */

.templates__title {
  margin-block-end: var(--space-4);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgb(255 255 255 / 0.6);
  text-align: center;
}

.templates__grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.template-card {
  position: relative;
  padding: var(--space-5);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.06);
  border: 1px solid rgb(255 255 255 / 0.12);
  backdrop-filter: blur(6px);
  animation: rise 700ms var(--ease-out) both;
  transition: transform 220ms var(--ease-out), border-color 220ms var(--ease-out), background 220ms var(--ease-out);
}
.template-card:nth-child(1) { animation-delay: 320ms; }
.template-card:nth-child(2) { animation-delay: 400ms; }
.template-card:nth-child(3) { animation-delay: 480ms; }
.template-card:nth-child(4) { animation-delay: 560ms; }

@media (hover: hover) {
  .template-card:hover {
    transform: translateY(-4px);
    border-color: rgb(212 144 10 / 0.6);
    background: rgb(255 255 255 / 0.09);
  }
}

.template-card__icon {
  display: grid;
  place-items: center;
  inline-size: 3rem;
  block-size: 3rem;
  border-radius: 14px;
  background: var(--gold-light);
  color: var(--navy);
}

.template-card__icon svg {
  inline-size: 1.6rem;
  block-size: 1.6rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.template-card__name {
  margin-block-start: var(--space-4);
  font-size: 1.35rem;
  font-weight: 700;
}

.template-card__summary {
  margin-block-start: var(--space-1);
  color: rgb(255 255 255 / 0.72);
}

/* ---------- Footer ---------- */

.welcome__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  inline-size: 100%;
  max-inline-size: 68rem;
  margin: var(--space-7) auto 0;
  padding-block-start: var(--space-5);
  border-block-start: 1px solid rgb(255 255 255 / 0.12);
  font-size: 0.95rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  border-radius: 999px;
  background: rgb(212 144 10 / 0.14);
  color: var(--gold-light);
}

.status-pill__dot {
  inline-size: 0.55rem;
  block-size: 0.55rem;
  border-radius: 50%;
  background: var(--gold-bright);
  animation: pulse 1.8s ease-in-out infinite;
}

.welcome__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: rgb(255 255 255 / 0.8);
}

/* ---------- 404 ---------- */

.notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  max-inline-size: 28rem;
  text-align: center;
  animation: rise 600ms var(--ease-out) both;
}

.notice__mark {
  margin-block-end: var(--space-3);
}

.notice__title {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 700;
}

.notice__body {
  margin-block-end: var(--space-4);
  color: rgb(255 255 255 / 0.75);
}

/* ---------- Shared keyframes ---------- */

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.8); }
}
