/* ===========================================
   COLART LINKS
   links.colartdigitalmarketingagency.com
   Built on the Colart brand tokens (style.css)
=========================================== */

/* 1. TOKENS & RESET ======================= */
:root {
  --purple:     #642878;
  --purple-dk:  #4a1d59;
  --magenta:    #c81478;
  --magenta-lt: #e64497;
  --teal:       #50a0b4;
  --mint:       #64a08c;
  --lime:       #8cb43c;
  --yellow:     #dcdc3c;

  --ink:      #1a1424;
  --bg:       #ffffff;
  --bg-soft:  #faf8fb;
  --tint:     #f5eef7;
  --line:     rgba(26, 20, 36, .12);
  --muted:    rgba(26, 20, 36, .62);

  --font: 'Lato', 'Noto Kufi Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --wrap: 1240px;
  --gutter: clamp(20px, 5vw, 36px);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; border-radius: 6px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* 2. HEADER =============================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: auto; transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand-name { font-size: 18px; letter-spacing: -.01em; line-height: 1; color: var(--purple); }
.brand-name b { font-weight: 900; }
.brand-name span { font-weight: 300; color: var(--ink); }

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
  transition: background .3s, color .3s, border-color .3s;
}
.header-link:hover { background: var(--purple); border-color: var(--purple); color: #fff; }
.header-link svg { width: 14px; height: 14px; }
@media (max-width: 480px) { .header-link .long { display: none; } }

/* 3. HERO ================================= */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(44px, 8vw, 96px) 0 clamp(36px, 6vw, 72px);
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(200, 20, 120, .07) 0%, transparent 60%),
    radial-gradient(50% 70% at 0% 100%, rgba(80, 160, 180, .08) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-soft) 0%, #fff 100%);
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}
@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: 1.1fr 1fr; gap: 56px; }
}

.hero-title {
  font-weight: 300;
  font-size: clamp(40px, 7.4vw, 88px);
  line-height: .98;
  letter-spacing: -.035em;
  color: var(--purple-dk);
}
.hero-title span { display: block; }
.hero-title strong { font-weight: 900; color: var(--purple); display: block; }
.hero-sub {
  margin-top: 22px;
  font-size: clamp(17px, 2.1vw, 20px);
  line-height: 1.5;
  color: var(--muted);
  max-width: 34ch;
}

/* Search */
.search {
  position: relative;
  margin-top: 32px;
  max-width: 480px;
}
.search svg {
  position: absolute;
  left: 20px; top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  color: var(--purple);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 58px;
  padding: 0 56px 0 52px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 16px;
  box-shadow: 0 10px 30px -12px rgba(100, 40, 120, .25);
  transition: border-color .3s, box-shadow .3s;
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: rgba(26, 20, 36, .45); }
.search input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(100, 40, 120, .12); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  font: 700 12px/1 var(--font);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  background: var(--bg-soft);
}
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }
@media (hover: none) { .search kbd { display: none; } .search input { padding-right: 20px; } }

.hero-count { margin-top: 16px; font-size: 14px; color: var(--muted); }
.hero-count b { color: var(--ink); }

/* Ecosystem visual (desktop only — keeps mobile light and fast) */
.eco { display: none; }
@media (min-width: 900px) {
  .eco { display: block; width: 100%; max-width: 560px; justify-self: end; }
}
.eco svg { width: 100%; height: auto; overflow: visible; }
.eco .eco-line { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.eco .eco-dot { stroke: none; }
.eco .eco-node circle { fill: #fff; stroke-width: 3; transition: transform .4s var(--ease); }
.eco .eco-node text { font: 900 17px var(--font); text-anchor: middle; dominant-baseline: central; }
.eco .eco-node { cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform .4s var(--ease); }
.eco .eco-node:hover { transform: scale(1.12); }

@media (prefers-reduced-motion: no-preference) {
  .eco .eco-line { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw .9s var(--ease) forwards; animation-delay: var(--d); }
  .eco .eco-dot, .eco .eco-node { opacity: 0; animation: pop .5s var(--ease) forwards; animation-delay: calc(var(--d) + .55s); }
  .eco .eco-mark { animation: markIn 1s var(--ease) both; transform-origin: center; transform-box: fill-box; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop  { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes markIn { from { opacity: 0; transform: rotate(-12deg) scale(.92); } to { opacity: 1; transform: none; } }

/* 4. DIRECTORY ============================ */
.directory { padding: clamp(36px, 6vw, 64px) 0 clamp(64px, 9vw, 110px); }
.dir-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 24px;
}
.dir-head h2 {
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--purple-dk);
}

/* Category filters — generated from data */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1);
  padding: 4px var(--gutter);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%);
}
.filters::-webkit-scrollbar { display: none; }
@media (min-width: 760px) {
  .filters { margin: 0; padding: 4px 0; flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
}
.chip {
  flex: none;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background .25s, color .25s, border-color .25s;
}
.chip:hover { color: var(--purple); border-color: rgba(100, 40, 120, .35); }
.chip[aria-pressed="true"] { background: var(--purple); border-color: var(--purple); color: #fff; }

/* Grid */
.grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 600px)  { .grid { grid-template-columns: repeat(2, 1fr); gap: 18px; } }
@media (min-width: 980px)  { .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }

/* Card — horizontal on mobile, stacked on larger screens */
.card {
  --accent: var(--purple);
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 16px 18px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line);
  transition: border-color .35s, transform .35s var(--ease), box-shadow .35s;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -22px var(--accent);
}
.card:focus-visible { outline-offset: 4px; border-radius: 22px; }

/* Connector motif from the Colart mark */
.card-node {
  position: absolute;
  top: 18px; right: 18px;
  display: none;
  align-items: center;
  gap: 0;
}
.card-node i { display: block; border-radius: 50%; background: var(--accent); }
.card-node i:nth-child(1) { width: 7px; height: 7px; }
.card-node i:nth-child(2) { width: 22px; height: 2px; border-radius: 2px; transform-origin: left; transition: width .4s var(--ease); }
.card-node i:nth-child(3) { width: 11px; height: 11px; }
.card:hover .card-node i:nth-child(2) { width: 34px; }

.avatar {
  position: relative;
  display: block;
  width: 64px; height: 64px;
  flex: none;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 200deg, var(--accent), color-mix(in srgb, var(--accent) 35%, #fff), var(--accent));
}
.avatar-in {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--accent);
  color: var(--accent-ink, #fff);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -.02em;
}
.avatar-in.has-img { background: #fff; }
.avatar-in img { width: 100%; height: 100%; object-fit: cover; }
.avatar-in img.contain { width: 78%; height: 78%; object-fit: contain; }

.card-body { min-width: 0; }
.card-name, .card-cat { display: block; }
.card-name {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--ink);
}
.card-name-ar {
  display: table;
  margin-top: 2px;
  font-family: 'Noto Kufi Arabic', var(--font);
  font-weight: 700;
  font-size: 15px;
  color: var(--purple);
}
.card-cat { margin-top: 4px; font-size: 14px; color: var(--muted); }

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--purple);
  white-space: nowrap;
}
.card-cta svg { width: 16px; height: 16px; transition: transform .35s var(--ease); }
.card:hover .card-cta { color: var(--magenta); }
.card:hover .card-cta svg { transform: translateX(4px); }
.card-cta .lbl { display: none; }
.card-cta .arrow-wrap {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tint);
  transition: background .3s, color .3s;
}
.card:hover .arrow-wrap { background: var(--purple); color: #fff; }

@media (min-width: 600px) {
  .card {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 18px;
    padding: 26px 24px 22px;
  }
  .card-node { display: inline-flex; }
  .avatar { width: 84px; height: 84px; }
  .avatar-in { font-size: 26px; }
  .card-name { font-size: 20px; }
  .card-cta { margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line); width: 100%; justify-content: space-between; }
  .card-cta .lbl { display: inline; }
  .card-cta .arrow-wrap { width: 34px; height: 34px; }
}

/* Empty state */
.empty {
  display: none;
  text-align: center;
  padding: 56px 20px;
  border: 1.5px dashed rgba(100, 40, 120, .25);
  border-radius: 22px;
  background: var(--bg-soft);
}
.empty.show { display: block; }
.empty p { font-size: 17px; color: var(--ink); }
.empty p + p { margin-top: 6px; font-size: 15px; color: var(--muted); }
.empty button {
  margin-top: 20px;
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background .3s;
}
.empty button:hover { background: var(--magenta); }

/* 5. FOOTER =============================== */
.site-footer {
  background: linear-gradient(135deg, #f5eef7 0%, #faf5fa 50%, #f7eef3 100%);
  padding: 36px 0;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand img { width: 30px; }
.foot-brand p { font-size: 14px; color: var(--muted); line-height: 1.4; }
.foot-brand p b { display: block; font-size: 15px; font-weight: 900; color: var(--purple); }
.foot-brand a { color: var(--ink); font-weight: 700; border-bottom: 1px solid rgba(100, 40, 120, .3); transition: color .3s, border-color .3s; }
.foot-brand a:hover { color: var(--magenta); border-color: var(--magenta); }
.foot-copy { font-size: 13px; color: var(--muted); }

/* 6. 404 PAGE ============================ */
.notfound {
  display: grid;
  place-items: center;
  padding: clamp(48px, 10vw, 110px) var(--gutter);
  background: var(--bg-soft);
  text-align: center;
}
.notfound h1 { margin-top: 22px; font-size: clamp(26px, 6vw, 34px); font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
.notfound p { margin-top: 8px; color: var(--muted); }
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  font-size: 14px;
  font-weight: 700;
  color: var(--purple);
}
.back svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.back:hover { color: var(--magenta); }
.back:hover svg { transform: translateX(-4px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
