/* 038 · Foundation Epoch (حقبة الأساس) — 1:1 Reference-Faithful Bespoke Stylesheet */
:root {
  --ep-bg: #f9fafb;
  --ep-white: #ffffff;
  --ep-ink: #111827;
  --ep-body: #4b5563;
  --ep-muted: #6b7280;
  --ep-border: #e5e7eb;
  --ep-blue: #2563eb;
  --ep-term: #0b1120;
}

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

html {
  scroll-behavior: smooth;
  background: var(--ep-bg);
  color: var(--ep-ink);
}

body {
  margin: 0;
  background: var(--ep-bg);
  color: var(--ep-ink);
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  line-height: 1.7;
  letter-spacing: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, a, button, span, label, input, textarea {
  letter-spacing: 0;
}

[dir="ltr"] {
  font-family: 'JetBrains Mono', 'Readex Pro', monospace;
}

/* Section 1: Framed Rounded-[44px] 3D Glass-Tile Hero */
.ep-hero-wrap {
  padding: 28px clamp(16px, 2.8vw, 34px) 16px;
}

.ep-hero-card {
  position: relative;
  max-width: 1400px;
  min-height: 590px;
  margin: 0 auto;
  border-radius: 44px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 4.5vw, 56px);
  box-shadow: 0 22px 50px rgba(17, 24, 39, 0.1);
}

.ep-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.ep-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ep-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(11, 17, 32, 0.78) 0%, rgba(11, 17, 32, 0.34) 48%, rgba(11, 17, 32, 0.12) 100%);
}

.ep-hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.ep-hero-eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.ep-hero-content h1 {
  margin: 0 0 22px;
  font-family: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;
  font-size: clamp(2.15rem, 4.4vw, 3.65rem);
  font-weight: 700;
  line-height: 1.12;
  color: #ffffff;
}

.ep-pill-white {
  height: 46px;
  padding: 0 26px;
  border-radius: 999px;
  border: 0;
  background: #ffffff;
  color: var(--ep-ink);
  font-family: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.ep-pill-white:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

.ep-pill-dark {
  height: 44px;
  padding: 0 24px;
  border-radius: 999px;
  border: 0;
  background: var(--ep-ink);
  color: #ffffff;
  font-family: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ep-pill-dark:hover {
  background: #1f2937;
}

.ep-pill-outline {
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--ep-ink);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: border-color 0.2s ease;
}

.ep-pill-outline:hover {
  border-color: var(--ep-ink);
}

/* Section 2: Trusted Partners Marquee */
.ep-marquee-sec {
  padding: 46px 20px;
  text-align: center;
}

.ep-eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ep-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.ep-marquee-mask {
  max-width: 1200px;
  margin: 20px auto 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.ep-marquee-track {
  display: flex;
  width: max-content;
  gap: 48px;
  animation: epSlide 28s linear infinite;
}

.ep-marquee-mask:hover .ep-marquee-track {
  animation-play-state: paused;
}

@keyframes epSlide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ep-marquee-track span {
  font-size: 1.02rem;
  font-weight: 700;
  color: #6b7280;
  white-space: nowrap;
}

/* Shared Section Layout */
.ep-sec {
  scroll-margin-top: 32px;
  padding: clamp(72px, 8vw, 104px) clamp(20px, 3.8vw, 48px);
}

.ep-sec.is-white {
  background: var(--ep-white);
}

.ep-container {
  max-width: 1360px;
  margin: 0 auto;
}

.ep-h2 {
  margin: 8px 0 14px;
  font-family: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
}

.ep-lead {
  margin: 0;
  max-width: 600px;
  color: var(--ep-body);
  font-size: 1rem;
}

/* Section 3: 4-Column Features Grid */
.ep-grid-4 {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.ep-card-white {
  background: var(--ep-white);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 4px 16px rgba(17, 24, 39, 0.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ep-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #f3f4f6;
  color: #1f2937;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.ep-card-white h3 {
  margin: 4px 0 0;
  font-family: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;
  font-size: 1.1rem;
}

.ep-card-white p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ep-body);
}

/* Section 4: Ecosystem 2-Column Split + 3 Metric Stack */
.ep-split-2 {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: end;
}

.ep-metric-stack {
  display: grid;
  gap: 14px;
}

.ep-metric-row {
  background: var(--ep-bg);
  border: 1px solid #f3f4f6;
  border-radius: 24px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.ep-metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.05);
  color: var(--ep-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ep-metric-row strong {
  display: block;
  font-family: 'Readex Pro', sans-serif;
  font-size: 1.55rem;
  color: var(--ep-ink);
  line-height: 1.15;
}

/* Section 5: Documentation 3-Col + Dark CLI Terminal Block */
.ep-docs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 40px;
}

.ep-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.ep-terminal {
  margin-top: 24px;
  background: var(--ep-term);
  color: #e2e8f0;
  border-radius: 24px;
  padding: 24px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 20px 44px rgba(11, 17, 32, 0.16);
}

.ep-terminal code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  color: #86efac;
}

/* Section 6: Contact 2-Col Split */
.ep-contact-card {
  background: var(--ep-bg);
  border: 1px solid var(--ep-border);
  border-radius: 26px;
  padding: 32px;
  display: grid;
  gap: 14px;
}

.ep-field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.ep-field input,
.ep-field textarea {
  width: 100%;
  padding: 12px 15px;
  border-radius: 14px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--ep-ink);
  font-family: inherit;
  font-size: 0.92rem;
}

/* Dedicated #/about Route View */
.ep-about-view {
  display: none;
  padding: 72px clamp(20px, 4vw, 48px) 150px;
}

body.is-about-route .ep-about-view {
  display: block;
}

body.is-about-route .ep-home-view {
  display: none;
}

/* Showcase Prev/Next Bar */
.ep-showcase-bar {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--ep-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--ep-muted);
}

/* Signature Fixed Bottom-Center Smoked-Glass Dock (High-Contrast on Light & Dark!) */
.ep-dock-wrap {
  position: fixed;
  bottom: 22px;
  inset-inline: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.ep-dock {
  pointer-events: auto;
  border-radius: 999px;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.84);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.24);
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}

.ep-dock a {
  padding: 7px 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.ep-dock a:hover,
.ep-dock a.is-active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

@media (max-width: 960px) {
  .ep-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .ep-grid-4,
  .ep-grid-3,
  .ep-split-2 {
    grid-template-columns: 1fr;
  }
}
