/* 045 · Morpho (مورفو الإبداعي) — 1:1 Reference-Faithful Generative Studio Stylesheet */
:root {
  --mp-bg: #050507;
  --mp-fg: #eaf2ff;
  --mp-muted: rgba(234, 242, 255, 0.62);
  --mp-line: rgba(234, 242, 255, 0.12);
  --mp-teal: #5fe3d6;
  --mp-violet: #8f7cff;
  --mp-pink: #ff6fb5;
  --mp-iri: linear-gradient(100deg, #5fe3d6, #8f7cff 55%, #ff6fb5);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--mp-bg); color: var(--mp-fg); }

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

h1, h2, h3, p, a, button, span, input { letter-spacing: 0; }
[dir="ltr"] { font-family: 'JetBrains Mono', monospace; }

.mp-iri-text {
  background: var(--mp-iri);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Fixed Floating Glass Pill Header */
.mp-nav-wrap {
  position: fixed;
  top: 12px;
  inset-inline: 0;
  z-index: 55;
  padding: 0 14px;
  pointer-events: none;
}

.mp-pill-nav {
  pointer-events: auto;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 10px 8px 18px;
  padding-inline: 18px 10px;
  border-radius: 999px;
  background: rgba(10, 10, 16, 0.62);
  backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--mp-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mp-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--mp-fg);
  text-decoration: none;
  font-family: 'Amiri', Georgia, serif;
  font-style: italic;
  font-size: 1.35rem;
  white-space: nowrap;
}

.mp-links { display: flex; align-items: center; gap: 18px; }
.mp-links a { color: var(--mp-muted); text-decoration: none; font-size: 0.84rem; white-space: nowrap; }
.mp-links a:hover { color: var(--mp-fg); }

.mp-pill-ice {
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  background: var(--mp-fg);
  color: #07070b;
  font-family: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  cursor: pointer;
}

.mp-pill-ghost {
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(234, 242, 255, 0.2);
  background: rgba(14, 14, 22, 0.6);
  color: var(--mp-fg);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  cursor: pointer;
}

/* Section 1: Crystal Butterfly Hero + Watermark + Prompt Chip */
.mp-hero {
  position: relative;
  min-height: 100dvh;
  padding: 112px clamp(20px, 4vw, 56px) 38px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--mp-line);
}

.mp-hero-bg { position: absolute; inset: 0; z-index: 0; }
.mp-hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.88; }

.mp-watermark {
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  font-family: 'Amiri', Georgia, serif;
  font-size: clamp(5.5rem, 18vw, 17rem);
  line-height: 0.82;
  background: linear-gradient(180deg, rgba(234, 242, 255, 0.26) 0%, rgba(143, 124, 255, 0.14) 60%, rgba(255, 111, 181, 0.06) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  pointer-events: none;
  user-select: none;
}

.mp-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(60% 55% at 75% 75%, rgba(5, 5, 7, 0.88) 0%, rgba(5, 5, 7, 0.3) 65%, transparent 100%),
    linear-gradient(180deg, rgba(5, 5, 7, 0.35) 0%, rgba(5, 5, 7, 0.15) 45%, rgba(5, 5, 7, 0.92) 100%);
}

.mp-hero-bot {
  position: relative;
  z-index: 5;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.mp-h1 {
  margin: 0 0 16px;
  max-width: 620px;
  font-family: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;
  font-size: clamp(2.45rem, 4.7vw, 4.3rem);
  font-weight: 500;
  line-height: 1.08;
}

.mp-h1 em, .mp-h2 em {
  font-family: 'Amiri', Georgia, serif;
  font-style: italic;
  font-size: 1.08em;
}

.mp-prompt-chip {
  width: min(350px, 100%);
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(14, 14, 22, 0.65);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(234, 242, 255, 0.2);
  box-shadow: 0 24px 60px -20px rgba(95, 227, 214, 0.28);
  text-decoration: none;
  color: var(--mp-fg);
  display: block;
}

/* Shared Section */
.mp-sec {
  scroll-margin-top: 80px;
  border-bottom: 1px solid var(--mp-line);
  padding: clamp(72px, 8vw, 108px) clamp(20px, 4vw, 56px);
}

.mp-wrap { max-width: 1320px; margin: 0 auto; }

.mp-eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  color: var(--mp-teal);
  letter-spacing: 0.16em;
  margin-bottom: 10px;
}

.mp-h2 {
  margin: 0 0 14px;
  font-family: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;
  font-size: clamp(1.9rem, 3.5vw, 3rem);
  font-weight: 500;
  line-height: 1.15;
}

/* #tools 3-Col Bento Suite */
.mp-grid-3 {
  margin-top: 38px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.mp-card {
  background: linear-gradient(180deg, rgba(234, 242, 255, 0.045), rgba(234, 242, 255, 0.014));
  border: 1px solid var(--mp-line);
  border-radius: 26px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Interactive Before/After Wipe Box */
.mp-compare {
  position: relative;
  height: 168px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--mp-line);
  cursor: ew-resize;
}

.mp-compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp-compare-gray { filter: grayscale(1) brightness(0.75); }
.mp-compare-col { clip-path: inset(0 0 0 50%); }

.mp-compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--mp-teal);
  pointer-events: none;
}

/* #try Live Procedural Generator */
.mp-try-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 28px;
  align-items: center;
}

.mp-imagine-bar {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(234, 242, 255, 0.22);
  background: rgba(14, 14, 22, 0.8);
}

.mp-imagine-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 14px;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
}

.mp-imagine-bar input:focus { outline: none; }

.mp-gen-stage {
  border-radius: 26px;
  border: 1px solid rgba(234, 242, 255, 0.18);
  background: #09090f;
  overflow: hidden;
  padding: 18px;
}

.mp-gen-canvas {
  width: 100%;
  height: 310px;
  border-radius: 18px;
  display: block;
}

/* #gallery 4-Col Dense Masonry */
.mp-masonry {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 150px;
  gap: 14px;
}

.mp-tile {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--mp-line);
  padding: 16px;
  display: flex;
  align-items: flex-end;
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.mp-tile:hover {
  border-color: var(--mp-teal);
  transform: translateY(-2px);
}

.mp-tile.is-wide { grid-column: span 2; }
.mp-tile.is-tall { grid-row: span 2; }

/* Featured Conic-Border Pricing Card */
.mp-card.is-conic {
  border: 1.5px solid var(--mp-violet);
  box-shadow: 0 30px 90px -40px rgba(143, 124, 255, 0.65);
}

.mp-footer { padding: 40px clamp(20px, 4vw, 56px); background: #040406; }

@media (max-width: 720px) {
  .mp-links { display: none; }
  .mp-grid-3, .mp-try-grid, .mp-masonry { grid-template-columns: 1fr; }
  .mp-tile.is-wide, .mp-tile.is-tall { grid-column: span 1; grid-row: span 1; }
}
