/* ============================================================
   كروت نت (KrutNet) — Presentation Stylesheet
   Light theme, aligned with the tokens used by /index.html
   ============================================================ */

:root {
  /* Brand Palette — mirrors :root in wwwroot/index.html */
  --brand-cyan: #0e7490;       /* accent */
  --brand-cyan-dark: #155e75;
  --brand-cyan-bright: #22d3ee;
  --brand-orange: #ea580c;
  --brand-orange-dark: #c2410c;

  /* Light Neutrals */
  --c0: #ffffff;               /* page background */
  --c1: #f6f8fb;               /* soft background */
  --c2: #ffffff;               /* surface / card */
  --c3: #e3e8ef;               /* border */
  --c5: #64748b;               /* muted subtext */
  --c7: #3d4c63;               /* secondary text */
  --w: #15243a;                /* primary text */

  /* Semantics (darkened for contrast on light surfaces) */
  --ok: #059669;
  --warn: #b45309;
  --err: #dc2626;
  --info: #2563eb;

  /* Spacing, radii, elevation */
  --gap: clamp(0.7rem, 1.8vw, 1.25rem);
  --pad: clamp(1.25rem, 4.5vw, 3.2rem) clamp(1rem, 5.5vw, 4.8rem);
  --r: 12px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-md: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-lg: 0 12px 36px rgba(15, 23, 42, .14);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--c0);
  color: var(--w);
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
  user-select: none;
  -webkit-user-select: none;
  direction: rtl;
}

/* ── Top Progress Bar ────────────────────────────────────────── */
#pbar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: rgba(21, 36, 58, 0.08);
  width: 100%;
  z-index: 1000;
}

#pbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-orange));
  width: 0%;
  transition: width 0.15s linear;
}

/* ── Auto-Play Countdown Ring ───────────────────────────────── */
/* Lives inside #nav, next to the play button, so it never collides
   with the home link or the slide dots. */
#cdwrap {
  display: none;
  align-items: center;
  justify-content: center;
}

#cdwrap.visible {
  display: flex;
}

svg#ring {
  width: 38px;
  height: 38px;
  transform: rotate(-90deg);
  position: relative;
}

#ring-bg {
  fill: none;
  stroke: rgba(21, 36, 58, 0.12);
  stroke-width: 3;
}

#ring-fill {
  fill: none;
  stroke: var(--brand-cyan);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100.53;
  stroke-dashoffset: 0;
}

#ring-num {
  position: absolute;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--brand-orange);
  font-weight: 600;
}

/* ── Floating Pill (keyboard hint + home link) ──────────────── */
#kh,
#home {
  position: fixed;
  top: 1.15rem;
  z-index: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  color: var(--c5);
  background: rgba(255, 255, 255, 0.88);
  padding: 0.4rem 0.85rem;
  border-radius: 30px;
  border: 1px solid var(--c3);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.5s ease, color .2s ease, border-color .2s ease, background .2s ease;
}

#kh {
  right: 1.5rem;
  font-family: 'IBM Plex Mono', monospace;
  pointer-events: none;
}

#home {
  left: 1.4rem;
  font-family: 'Tajawal', sans-serif;
  font-weight: 700;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

#home:hover {
  color: var(--brand-cyan);
  border-color: rgba(14, 116, 144, 0.45);
  background: rgba(14, 116, 144, 0.08);
}

/* ── Slide Indicator Dots ───────────────────────────────────── */
#dots {
  position: fixed;
  left: clamp(0.6rem, 1.8vw, 1.4rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  z-index: 500;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(21, 36, 58, 0.18);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dot:hover {
  background: rgba(21, 36, 58, 0.4);
}

.dot.on {
  background: var(--brand-cyan);
  box-shadow: 0 0 10px rgba(14, 116, 144, 0.5);
  transform: scale(1.6);
}

/* ── Navigation Bar ─────────────────────────────────────────── */
#nav {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  z-index: 500;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(14, 116, 144, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.45rem 1rem;
  border-radius: 100px;
  box-shadow: var(--shadow-lg);
}

#nav button {
  background: transparent;
  border: 1px solid var(--c3);
  color: var(--w);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

#nav button:hover {
  background: rgba(14, 116, 144, 0.08);
  border-color: var(--brand-cyan);
  color: var(--brand-cyan);
}

#nav button:active {
  transform: scale(0.94);
}

#btn-play {
  border-color: rgba(234, 88, 12, 0.4) !important;
  color: var(--brand-orange) !important;
}

#btn-play.playing {
  background: rgba(234, 88, 12, 0.12) !important;
  border-color: var(--brand-orange) !important;
  box-shadow: 0 0 12px rgba(234, 88, 12, 0.3);
}

#ctr {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  color: var(--c5);
  min-width: 58px;
  text-align: center;
  letter-spacing: 0.05em;
}

/* ── Deck & Slides ──────────────────────────────────────────── */
.deck {
  height: 100dvh;
  width: 100vw;
  position: relative;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--pad);
  padding-bottom: calc(clamp(1.25rem, 4.5vw, 3.2rem) + 4.2rem);
  background: var(--c0);
  opacity: 0;
  transform: translateY(28px) scale(0.99);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  overflow: hidden;
  overflow-y: auto;
}

.slide.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.slide.exit {
  opacity: 0;
  transform: translateY(-28px) scale(0.99);
}

/* Slide Background Variants */
.s-alt {
  background: radial-gradient(circle at 50% 15%, #eaf4f8 0%, var(--c0) 75%);
}

.s-soft {
  background: radial-gradient(circle at 80% 25%, var(--c1) 0%, var(--c0) 85%);
}

.gbg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(14, 116, 144, 0.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(14, 116, 144, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.slide > *:not(.gbg):not(.ctl):not(.cbr):not(.sf) {
  position: relative;
  z-index: 1;
}

.ctl, .cbr {
  position: absolute;
  width: 75px;
  height: 75px;
  border-color: rgba(14, 116, 144, 0.25);
  border-style: solid;
  pointer-events: none;
}

.ctl {
  top: 1.2rem;
  right: 1.2rem;
  border-width: 2px 2px 0 0;
  border-top-right-radius: 8px;
}

.cbr {
  bottom: 4.5rem;
  left: 1.2rem;
  border-width: 0 0 2px 2px;
  border-bottom-left-radius: 8px;
}

/* Slide Footers */
.sf {
  position: absolute;
  bottom: 1.2rem;
  right: 2rem;
  left: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: rgba(21, 36, 58, 0.45);
  pointer-events: none;
  z-index: 2;
}

/* ── Typography & Headers ───────────────────────────────────── */
.cc {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.cr {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  width: 100%;
  max-width: min(1080px, 100%);
}

.lbl {
  font-size: clamp(0.62rem, 0.9vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand-orange);
  margin-bottom: clamp(0.4rem, 1.2vw, 0.8rem);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.lbl::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-orange);
  box-shadow: 0 0 8px rgba(234, 88, 12, 0.5);
}

.lbl-cyan {
  color: var(--brand-cyan) !important;
}

.lbl-cyan::before {
  background: var(--brand-cyan) !important;
  box-shadow: 0 0 8px rgba(14, 116, 144, 0.5) !important;
}

.lbl-w {
  color: var(--c5);
}
.lbl-w::before {
  background: var(--brand-cyan);
}

h1.hero {
  font-size: clamp(1.8rem, 4.2vw, 3.6rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.015em;
  text-align: center;
  max-width: min(920px, 100%);
  background: linear-gradient(180deg, var(--w) 35%, var(--brand-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2.st {
  font-size: clamp(1.25rem, 2.8vw, 2.3rem);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  color: var(--w);
}

.st-gradient {
  background: linear-gradient(90deg, var(--w) 30%, var(--brand-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub {
  font-size: clamp(0.82rem, 1.5vw, 1.05rem);
  color: var(--c5);
  max-width: min(720px, 100%);
  line-height: 1.85;
  margin-top: 0.5rem;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(0.68rem, 1vw, 0.78rem);
  color: var(--c5);
  letter-spacing: 0.04em;
}

.div {
  width: 54px;
  height: 3px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-orange));
  margin: clamp(0.8rem, 2vw, 1.3rem) auto;
}

.brand-hero-logo {
  max-width: clamp(110px, 16vw, 160px);
  height: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(0 8px 18px rgba(14, 116, 144, 0.22));
}

/* ── Grids & Card Layouts ───────────────────────────────────── */
.cg {
  display: grid;
  gap: var(--gap);
  width: 100%;
  max-width: min(1080px, 100%);
}

.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 860px) {
  .g3, .g4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--c2);
  border: 1px solid var(--c3);
  border-radius: var(--r);
  padding: clamp(0.85rem, 1.8vw, 1.35rem);
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: rgba(14, 116, 144, 0.45);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card h3 {
  font-size: clamp(0.84rem, 1.4vw, 1rem);
  font-weight: 700;
  margin-bottom: 0.35rem;
  line-height: 1.4;
  color: var(--w);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card p {
  font-size: clamp(0.74rem, 1.2vw, 0.82rem);
  color: var(--c5);
  line-height: 1.75;
}

.ci {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background: rgba(14, 116, 144, 0.1);
  color: var(--brand-cyan);
  border: 1px solid rgba(14, 116, 144, 0.25);
  flex-shrink: 0;
}

.ci svg {
  width: 18px;
  height: 18px;
}

/* Card Variations */
.cp {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.04);
}
.cp .ci {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.3);
  color: var(--err);
}

.cs {
  border-color: rgba(14, 116, 144, 0.28);
  background: rgba(14, 116, 144, 0.04);
}
.cs .ci {
  background: rgba(14, 116, 144, 0.14);
  border-color: rgba(14, 116, 144, 0.35);
  color: var(--brand-cyan);
}

.co {
  border-color: rgba(234, 88, 12, 0.28);
  background: rgba(234, 88, 12, 0.04);
}
.co .ci {
  background: rgba(234, 88, 12, 0.14);
  border-color: rgba(234, 88, 12, 0.35);
  color: var(--brand-orange);
}

.cg-highlight {
  border-color: rgba(5, 150, 105, 0.3);
  background: rgba(5, 150, 105, 0.04);
}
.cg-highlight .ci {
  background: rgba(5, 150, 105, 0.14);
  border-color: rgba(5, 150, 105, 0.35);
  color: var(--ok);
}

/* ── Badges & Pills ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid var(--c3);
  background: rgba(21, 36, 58, 0.04);
  color: var(--c7);
  width: fit-content;
  margin-bottom: 0.6rem;
}
.badge-cyan {
  border-color: rgba(14, 116, 144, 0.4);
  background: rgba(14, 116, 144, 0.1);
  color: var(--brand-cyan);
}
.badge-orange {
  border-color: rgba(234, 88, 12, 0.4);
  background: rgba(234, 88, 12, 0.1);
  color: var(--brand-orange);
}
.badge-gold {
  border-color: rgba(180, 83, 9, 0.4);
  background: rgba(180, 83, 9, 0.1);
  color: var(--warn);
}

/* ── Step-by-Step Flow ──────────────────────────────────────── */
.flow-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  width: 100%;
  max-width: min(1080px, 100%);
  position: relative;
}

@media (max-width: 860px) {
  .flow-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .flow-row { grid-template-columns: 1fr; }
}

.step-card {
  background: var(--c2);
  border: 1px solid rgba(14, 116, 144, 0.25);
  border-radius: var(--r);
  padding: 1.1rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.step-num {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-cyan);
  background: rgba(14, 116, 144, 0.12);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(14, 116, 144, 0.3);
}

/* ── KPI Blocks ─────────────────────────────────────────────── */
.kr {
  display: flex;
  gap: clamp(0.6rem, 1.8vw, 1.4rem);
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: min(1080px, 100%);
}

.kpi {
  text-align: center;
  padding: clamp(0.85rem, 1.8vw, 1.25rem) clamp(0.9rem, 2vw, 1.5rem);
  border: 1px solid var(--c3);
  border-radius: var(--r);
  background: var(--c2);
  min-width: clamp(120px, 18vw, 155px);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.kpi:hover {
  border-color: var(--brand-cyan);
  transform: translateY(-2px);
}

.kv {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(1.4rem, 3.2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
  direction: ltr;
  display: block;
  color: var(--w);
}

.kv-cyan { color: var(--brand-cyan); }
.kv-orange { color: var(--brand-orange); }
.kv-green { color: var(--ok); }
.kv-gold { color: var(--warn); }

.kl {
  font-size: clamp(0.68rem, 1.1vw, 0.76rem);
  color: var(--c5);
  margin-top: 0.4rem;
  line-height: 1.4;
}

/* ── Comparison Table ───────────────────────────────────────── */
.tbl-wrap {
  width: 100%;
  max-width: min(1040px, 100%);
  overflow-x: auto;
  border: 1px solid var(--c3);
  border-radius: var(--r);
  background: var(--c2);
  box-shadow: var(--shadow-sm);
}

table.comp-tbl {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: clamp(0.72rem, 1.2vw, 0.82rem);
}

table.comp-tbl th, table.comp-tbl td {
  padding: clamp(0.55rem, 1vw, 0.85rem) clamp(0.75rem, 1.4vw, 1.2rem);
  border-bottom: 1px solid var(--c3);
}

table.comp-tbl th {
  background: var(--c1);
  font-weight: 700;
  color: var(--c7);
  font-size: clamp(0.75rem, 1.2vw, 0.86rem);
}

table.comp-tbl tr:last-child td {
  border-bottom: none;
}

table.comp-tbl td.axis {
  font-weight: 700;
  color: var(--w);
  white-space: nowrap;
}

table.comp-tbl td.old {
  color: var(--err);
  background: rgba(220, 38, 38, 0.04);
}

table.comp-tbl td.new {
  color: var(--brand-cyan);
  font-weight: 500;
  background: rgba(14, 116, 144, 0.05);
}

/* ── Call To Action Buttons ─────────────────────────────────── */
.cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.6rem;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-cta-primary {
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-cyan-dark));
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 20px rgba(14, 116, 144, 0.3);
}

.btn-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(14, 116, 144, 0.42);
}

.btn-cta-secondary {
  background: var(--c2);
  color: var(--w);
  border: 1px solid var(--c3);
}

.btn-cta-secondary:hover {
  background: var(--c1);
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}
