/* ============================================================
   Hakim Malki — hakimmalki.com
   Mobile-first, premium light theme: beige, navy, light blue, off-white.
   Subtle Islamic geometric lattice: CSS-only, no external assets.
   ============================================================ */

:root {
  --bg: #f4efe4;
  --bg-2: #e9e0c9;
  --card: #fffdf7;
  --accent: #243066;
  --sky: #4e86bd;
  --accent-dim: rgba(36, 48, 102, 0.16);
  --text: #232f5e;
  --muted: #66718f;
  --line: rgba(36, 48, 102, 0.12);
  --radius: 14px;
  --max: 1080px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: #ffffff;
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* never allow accidental horizontal bleed */
}

/* Subtle geometric lattice overlay (8-point star suggestion) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(36, 48, 102, 0.05) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(-45deg, rgba(36, 48, 102, 0.05) 0 1px, transparent 1px 26px);
}

main, header.site, footer.site { position: relative; z-index: 1; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem; /* generous gutters so text never kisses the screen edge */
}

/* ---------- Header / Nav ---------- */
header.site {
  position: sticky;
  top: 0;
  background: rgba(244, 239, 228, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-decoration: none;
}

.brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  color: var(--muted);
  text-transform: uppercase;
}

.nav-links { display: flex; gap: 1.1rem; list-style: none; margin: 0; padding: 0; }

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--sky);
  border-bottom-color: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 4.5rem 0 3rem;
}

.hero .kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.2;
  margin: 0 auto 1rem;
  max-width: 20ch; /* keep the headline in a calm, centered measure */
  text-wrap: balance; /* avoid a lone word stranded at the edge */
  overflow-wrap: break-word;
  color: var(--text);
}

.hero h1 em { color: var(--sky); font-style: normal; }

.hero p.lede {
  max-width: 46ch; /* narrower measure reads calmer on phones */
  margin: 0 auto 2rem;
  padding: 0 0.5rem;
  color: var(--muted);
  font-size: 1.08rem;
  text-wrap: pretty;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

/* ---------- Hero bleed: photo melts in from the right ---------- */
section.hero-bleed {
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: 0;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url('../img/hero-hakim.jpg') no-repeat 70% 22% / cover;
  -webkit-mask-image: linear-gradient(to right, transparent 12%, #000 58%);
  mask-image: linear-gradient(to right, transparent 12%, #000 58%);
}
.hero-bleed::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--bg) 22%, rgba(244,239,228,0.78) 52%, rgba(36,48,102,0.14) 100%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding: 5.5rem 0;
  max-width: 620px;
}
.hero-bleed h1 { margin-left: 0; margin-right: 0; max-width: 15ch; }
.hero-bleed p.lede { margin-left: 0; margin-right: 0; }
.hero-bleed .cta-row { justify-content: flex-start; }

@media (max-width: 720px) {
  .hero-bg {
    position: relative;
    height: 230px;
    background-position: center 22%;
    -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  }
  .hero-inner { text-align: center; padding: 2rem 0 3rem; max-width: none; }
  .hero-bleed h1 { margin-left: auto; margin-right: auto; }
  .hero-bleed p.lede { margin-left: auto; margin-right: auto; }
  .hero-bleed .cta-row { justify-content: center; }
}

/* ---------- About portrait ---------- */
.about-portrait { margin: 0 auto 2.5rem; max-width: 760px; }
.about-portrait img {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(36,48,102,0.16);
}
.about-portrait figcaption {
  margin-top: 0.7rem; color: var(--muted);
  font-size: 0.92rem; text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
}

.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(36, 48, 102, 0.30); }

.btn-ghost {
  border-color: var(--accent-dim);
  color: var(--accent);
  background: transparent;
}

.btn-ghost:hover { border-color: var(--accent); }

button.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------- Global kicker (eyebrow label, usable outside the hero) ---------- */
.kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  margin: 0 0 0.6rem;
}

/* ---------- Sections ---------- */
section.block { padding: 2.75rem 0; }

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 0.4rem;
  color: var(--text);
  text-wrap: balance;
}

.section-sub { color: var(--muted); margin: 0 0 1.8rem; max-width: 60ch; }

.divider {
  width: 64px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin: 0 0 1.5rem;
}

/* ---------- Video embed ---------- */
.video {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  margin-bottom: 1.5rem;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Song cards ---------- */
.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
}

.song-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.song-card:hover { transform: translateY(-3px); border-color: var(--accent); }

.song-card .ar {
  font-size: 1.7rem;
  color: var(--sky);
  margin-bottom: 0.4rem;
}

.song-card h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }

.song-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.song-card .go { color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-top: 0.8rem; display: inline-block; }

/* ---------- Story / lyrics ---------- */
.prose { max-width: 720px; }
.prose p { color: var(--muted); }
.prose p strong, .prose strong { color: var(--text); }

.lyrics {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.lyrics h3 { color: var(--accent); margin: 1.4rem 0 0.6rem; font-size: 1.05rem; }
.lyrics h3:first-of-type { margin-top: 0; }
.lyrics p { margin: 0; color: var(--text); white-space: pre-line; }
.lyrics [dir="rtl"] { text-align: right; }

.placeholder-note {
  border-left: 3px solid var(--accent);
  background: rgba(36, 48, 102, 0.06);
  padding: 0.7rem 1rem;
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

/* ---------- Social / stream rows ---------- */
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* ---------- Email signup ---------- */
.signup {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.signup h2 { font-family: var(--font-display); font-weight: 400; margin: 0 0 0.5rem; }
.signup p { color: var(--muted); margin: 0 0 1.3rem; }

.signup form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.signup input[type="email"] {
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-size: 1rem;
  width: 100%;
}

.signup input[type="email"]:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

@media (min-width: 560px) {
  .signup form { flex-direction: row; }
  .signup input[type="email"] { flex: 1; }
}

/* ---------- Featured signup panel (bold navy, high-contrast) ---------- */
.signup-featured {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffdf7;
  padding: 2.75rem 1.75rem;
}

.signup-featured .kicker { color: #fffdf7; opacity: 0.7; }
.signup-featured h2 { color: #ffffff; }
.signup-featured p { color: rgba(255, 253, 247, 0.82); }
.signup-featured p strong { color: #ffffff; }
.signup-featured input[type="email"] { border-color: transparent; }
.signup-featured .btn-accent { background: #fffdf7; color: var(--accent); }
.signup-featured .btn-accent:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28); }

/* ---------- Footer ---------- */
footer.site {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 2.2rem 0 2.5rem;
  text-align: center;
}

footer.site .link-row { justify-content: center; margin-bottom: 1.2rem; }

footer.site nav { margin-bottom: 1.2rem; }
footer.site nav a { color: var(--muted); text-decoration: none; margin: 0 0.7rem; font-size: 0.92rem; }
footer.site nav a:hover { color: var(--sky); }

.copy { color: var(--muted); font-size: 0.85rem; margin: 0; }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.breadcrumb { font-size: 0.88rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--sky); text-decoration: none; }

.page-head { padding: 2.5rem 0 1rem; text-align: center; }
.page-head .ar-title { font-size: clamp(2.4rem, 8vw, 3.8rem); color: var(--sky); margin: 0 0 0.3rem; }
.page-head h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 0.6rem; }
.page-head p { color: var(--muted); max-width: 620px; margin: 0 auto; }

.two-col { display: grid; gap: 2rem; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1.2fr 1fr; align-items: start; } }

/* ---------- Small-phone tuning ---------- */
@media (max-width: 560px) {
  .nav { padding: 0.8rem 0; }
  .brand { font-size: 1.15rem; }
  .brand small { letter-spacing: 0.2em; }
  .nav-links { gap: 0.8rem; }
  .nav-links a { font-size: 0.9rem; }
  .hero { padding: 3.5rem 0 2.5rem; }
  section.block { padding: 2.25rem 0; }
}

/* ---------- Song carousel (swipeable, scalable discovery) ---------- */
.carousel { position: relative; }
.carousel-track {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0.15rem 1rem;
  margin: 0 -0.15rem;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }

/* Fancy song card with cover art */
.song-card-art {
  flex: 0 0 clamp(238px, 70vw, 300px);
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.song-card-art:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(36, 48, 102, 0.16);
}
.card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-2);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}
.song-card-art:hover .card-media img { transform: scale(1.06); }
.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 26, 60, 0.6), transparent 55%);
}
.card-ar {
  position: absolute;
  z-index: 1;
  bottom: 0.55rem;
  right: 0.8rem;
  left: 0.8rem;
  text-align: right;
  color: #fff;
  font-size: 1.45rem;
  line-height: 1.3;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.card-body { display: flex; flex-direction: column; gap: 0.35rem; padding: 1rem 1.1rem 1.15rem; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.12rem; }
.card-body p { margin: 0; color: var(--muted); font-size: 0.9rem; flex: 1; }
.card-body .go { color: var(--accent); font-weight: 600; font-size: 0.9rem; margin-top: 0.55rem; }

/* Carousel controls */
.carousel-nav { display: flex; align-items: center; gap: 0.9rem; margin-top: 0.2rem; }
.car-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.car-btn:hover { background: var(--accent); color: #fff; transform: scale(1.06); }
.car-dots { display: flex; gap: 0.45rem; align-items: center; }
.car-dots button {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--accent-dim);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.car-dots button.active { background: var(--accent); transform: scale(1.3); }

/* ---------- Prev / next song browsing ---------- */
.song-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.song-nav a { text-decoration: none; }
.song-nav .next { margin-inline-start: auto; text-align: end; }

/* ---------- Scroll reveal (added by JS only) ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .song-card-art:hover { transform: none; }
  .song-card-art:hover .card-media img { transform: none; }
}

@media (max-width: 560px) {
  .song-nav { flex-direction: column; }
  .song-nav .next { margin-inline-start: 0; text-align: start; }
}

/* ---------- Signup track picker ---------- */
.signup select {
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-size: 1rem;
  width: 100%;
}
.signup select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.signup .form-row { display: flex; flex-direction: column; gap: 0.7rem; }
@media (min-width: 560px) {
  .signup form { flex-direction: column; }
  .signup .form-row { flex-direction: row; }
  .signup .form-row input[type="email"] { flex: 1; }
}

/* ---------- Thank-you download list ---------- */
.download-list { display: flex; flex-direction: column; gap: 0.7rem; margin: 0 0 1.3rem; text-align: start; }
.download-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(255, 253, 247, 0.08);
  border: 1px solid rgba(255, 253, 247, 0.28);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #fffdf7;
  transition: background 0.15s ease;
}
.download-row:hover { background: rgba(255, 253, 247, 0.18); }
.dl-titles { display: flex; flex-direction: column; line-height: 1.35; }
.dl-titles [lang="ar"] { font-size: 1.15rem; }
.dl-titles span:last-child { font-size: 0.85rem; opacity: 0.75; }
.dl-titles span.dl-badge {
  align-self: flex-start;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #243066;
  background: #f4efe4;
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  opacity: 1;
}
.cover-note {
  margin-top: 1rem;
  background: rgba(78, 134, 189, 0.12);
  border: 1px solid rgba(78, 134, 189, 0.45);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
}
.cover-note a { color: var(--accent); font-weight: 700; }
.dl-btn {
  background: #fffdf7;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  white-space: nowrap;
}
