/* Engineerz app — base styles + responsive shell */
html, body { margin: 0; padding: 0; }

:root { font-size: 16px; }
@media (min-width: 640px)  { :root { font-size: 17px; } }
@media (min-width: 768px)  { :root { font-size: 18px; } }
@media (min-width: 1024px) { :root { font-size: 17px; } }

body {
  background: #efece6;
  font-family: Almarai, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior-y: contain;
}
a { color: #0c2436; text-decoration: none; }
a:hover { color: #F7A70B; }

/* phone-width app column — grows with root rem; widens at lg */
.app-shell {
  width: 100%;
  max-width: 25.125rem; /* 402px at 16px root */
  margin-inline: auto;
  background: #F7F6F3;
  min-height: 100dvh;
  box-shadow: 0 0 60px rgba(12, 36, 54, .09);
}
@media (min-width: 1024px) {
  .app-shell {
    max-width: 72rem;
  }
}

/* layout offset when left nav rail is visible */
.app-frame {
  min-height: 100dvh;
}
@media (min-width: 1024px) {
  .app-frame {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    max-width: 72rem;
    margin-inline: auto;
  }
  .app-frame > .app-shell {
    flex: 1;
    max-width: none;
    margin-inline: 0;
    box-shadow: none;
  }
}

/* safe-area insets: keep design spacing, grow on notched devices */
.pt-status {
  padding-top: max(3.125rem, calc(env(safe-area-inset-top, 0px) + 0.875rem));
}
.pb-home {
  padding-bottom: max(1.5rem, calc(env(safe-area-inset-bottom, 0px) + 0.5rem));
}

/* horizontal card rails: keep the native scroll, hide the bar */
.app-shell [class*="overflow-x-auto"] { scrollbar-width: none; }
.app-shell [class*="overflow-x-auto"]::-webkit-scrollbar { width: 0; height: 0; }

/* tablet+: card rails become auto-filling grids */
@media (min-width: 768px) {
  .rail {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(var(--rail-min, 7rem), 1fr));
    overflow-x: visible !important;
  }
  .rail > * {
    width: auto !important;
    flex: none;
  }
}

/* hero carousel: full-width slides on tablet+ */
@media (min-width: 768px) {
  .carousel > * {
    width: 100% !important;
    flex: 0 0 100%;
  }
}

@keyframes stepsPulse { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }

/* shimmer skeleton loading */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.shimmer {
  background: linear-gradient(100deg, #e8e4dc 8%, #f5f2eb 18%, #e8e4dc 33%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* skeleton state — put `.skeleton-loading` on a container to mask its real
   content with shimmer blocks, and drop the class once the data is in */
.skeleton-loading {
  pointer-events: none;
  user-select: none;
}
.skeleton-loading :is(h1, h2, h3, h4, h5, h6, p, li, a, button, span, i, strong, b, em, small, label, input, textarea, select, img, svg) {
  color: transparent !important;
  text-shadow: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transition: none !important;
  border-radius: 0.625rem !important;
  background: linear-gradient(100deg, #e8e4dc 8%, #f5f2eb 18%, #e8e4dc 33%) !important;
  background-size: 200% 100% !important;
  animation: shimmer 1.4s linear infinite !important;
}
/* each branch renders one clean block: descendants keep their space but stay hidden */
.skeleton-loading :is(h1, h2, h3, h4, h5, h6, p, li, a, button, span, i, strong, b, em, small, label, input, textarea, select, img, svg) * {
  visibility: hidden !important;
  background: none !important;
  animation: none !important;
}

/* content reveal after skeleton */
@keyframes homeFadeIn {
  from { opacity: 0; transform: translateY(0.375rem); }
  to { opacity: 1; transform: none; }
}
.home-fade-in { animation: homeFadeIn .45s ease both; }

/* ── onboarding (ported from steps-auth) ── */
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { width: 0; height: 0; }

.diamond {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  transform: rotate(45deg);
  background: #F7A70B;
  flex: none;
}

.stripe {
  background: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, .05) 0 12px,
    rgba(255, 255, 255, 0) 12px 24px
  );
}

@keyframes ringPulse {
  0% { transform: scale(.85); opacity: .5; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
.ring-pulse { animation: ringPulse 2.4s ease-out infinite; }
.ring-pulse-delay { animation: ringPulse 2.4s ease-out .8s infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}
.blink { animation: blink 1.2s ease-in-out infinite; }

.opt { background: #fff; border: 1px solid #EFEBE3; }
.opt:hover { border-color: #0c2436; }
.opt.is-on {
  background: #0c2436;
  border-color: #0c2436;
  box-shadow: 0 12px 26px rgba(12, 36, 54, .18);
}
.opt .opt-dot i { opacity: 0; }
.opt.is-on .opt-dot { background: #F7A70B; border-color: #F7A70B; }
.opt.is-on .opt-dot i { opacity: 1; }
.opt.is-on .opt-t { color: #fff; }
.opt.is-on .opt-s { color: #F7A70B; }

.pick { background: #fff; border: 1px solid #EFEBE3; }
.pick:hover { border-color: #0c2436; }
.pick.is-on {
  border-color: #1FA855;
  box-shadow: 0 10px 24px rgba(31, 168, 85, .12);
}
.pick .pick-check { display: none; }
.pick.is-on .pick-check { display: flex; }
.pick.is-on .pick-arrow { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ring-pulse,
  .ring-pulse-delay,
  .blink { animation: none; }
}
