:root {
  --navy: #082e3e;
  --navy-deep: #061f2b;
  --navy-soft: #0d3d52;
  --teal: #149d91;
  --teal-dark: #0e7a71;
  --teal-soft: #e6f6f4;
  --gold: #d3a64f;
  --gold-soft: #f6ebd3;
  --cream: #f7f3e9;
  --paper: #fbf8f2;
  --ink: #102a36;
  --muted: #5a6e78;
  --line: #e4ddd0;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(8, 46, 62, 0.12);
  --radius: 18px;
  --max: 1240px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Cairo", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.8;
  direction: rtl;
  text-align: right;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; }

.container { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }

h1, h2, h3, h4, .logo-word, .kicker, .nav a, .btn, .type-kufi {
  font-family: "Noto Kufi Arabic", "Cairo", sans-serif;
}
.type-cairo { font-family: "Cairo", "Noto Naskh Arabic", sans-serif; }
.type-naskh { font-family: "Noto Naskh Arabic", "Cairo", serif; }

/* ========== TOPBAR ========== */
.topbar {
  background: var(--navy-deep);
  color: #d7e4ea;
  font-size: 13px;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 42px;
  flex-wrap: wrap;
}
.topbar span { opacity: .85; }
.topbar .meta { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar .live {
  display: flex; align-items: center; gap: 8px;
  color: var(--gold);
  font-weight: 700;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #e24b4b;
  box-shadow: 0 0 0 0 rgba(226,75,75,.7);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(226,75,75,0); }
}

/* ========== HEADER ========== */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,248,242,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 86px;
}
.brand {
  display: flex; align-items: center; gap: 14px;
}
.brand img.mark {
  width: 58px; height: 58px; border-radius: 14px;
}
.brand-text .name {
  font-family: "Noto Kufi Arabic", sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--navy);
  line-height: 1.3;
}
.brand-text .sub {
  font-size: 12px;
  color: var(--teal);
  letter-spacing: .2px;
}
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--navy);
  transition: .2s ease;
}
.nav a:hover, .nav a.active {
  background: var(--navy);
  color: var(--cream);
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.search-btn, .menu-btn {
  width: 42px; height: 42px; border: 1px solid var(--line);
  background: var(--white); border-radius: 12px;
  display: grid; place-items: center; color: var(--navy);
}
.menu-btn { display: none; }

/* ========== TICKER ========== */
.ticker {
  background: var(--navy);
  color: var(--cream);
  overflow: hidden;
  border-bottom: 3px solid var(--gold);
}
.ticker-inner {
  display: flex; align-items: center; gap: 18px;
  min-height: 46px;
}
.ticker-label {
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 6px;
  white-space: nowrap;
}
.ticker-track {
  flex: 1; overflow: hidden; white-space: nowrap;
}
.ticker-track p {
  display: inline-block;
  animation: marquee 28s linear infinite;
  font-size: 14.5px;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

/* ========== HERO ========== */
.hero {
  padding: 36px 0 20px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr .9fr;
  gap: 22px;
}
.hero-main {
  position: relative;
  min-height: 460px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--navy);
  box-shadow: var(--shadow);
}
.hero-main img {
  width: 100%; height: 100%; object-fit: cover;
  min-height: 460px;
  opacity: .78;
}
.hero-main::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,31,43,.15) 10%, rgba(6,31,43,.88) 100%);
}
.hero-copy {
  position: absolute; inset: auto 0 0 0;
  z-index: 2; padding: 32px;
  color: var(--cream);
}
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--teal);
  color: white;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hero-copy h1 {
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.35;
  margin-bottom: 10px;
}
.hero-copy p { opacity: .88; max-width: 680px; }
.hero-meta { margin-top: 16px; font-size: 13px; opacity: .8; display: flex; gap: 16px; }

.hero-side { display: flex; flex-direction: column; gap: 16px; }
.side-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  transition: .2s ease;
}
.side-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.side-card img {
  width: 110px; height: 90px; object-fit: cover; border-radius: 12px;
}
.side-card .cat { color: var(--teal); font-size: 12px; font-weight: 700; }
.side-card h3 { font-size: 16px; line-height: 1.55; color: var(--navy); }

/* ========== SECTIONS ========== */
section { padding: 28px 0; }
.section-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 22px; gap: 16px;
}
.section-head h2 {
  font-size: 28px; color: var(--navy);
  position: relative;
}
.section-head h2::after {
  content: "";
  display: block; width: 64px; height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  border-radius: 4px; margin-top: 8px;
}
.more {
  color: var(--teal-dark); font-weight: 700; font-size: 14px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  transition: .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-media { position: relative; height: 200px; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; top: 12px; right: 12px;
  background: var(--navy); color: var(--cream);
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
}
.card-body { padding: 18px 18px 20px; }
.card-body h3 { font-size: 18px; line-height: 1.55; color: var(--navy); margin: 6px 0 8px; }
.card-body p { color: var(--muted); font-size: 14.5px; }
.card-foot {
  display: flex; justify-content: space-between;
  margin-top: 14px; font-size: 12.5px; color: var(--muted);
}

/* ========== FEATURE STRIP ========== */
.feature-strip {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: var(--cream);
  border-radius: 28px;
  padding: 36px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.feature-strip::before {
  content: "";
  position: absolute; left: -40px; bottom: -50px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(20,157,145,.18);
}
.pixels {
  position: absolute; top: 24px; left: 28px;
  display: grid; grid-template-columns: 14px 10px; gap: 6px;
}
.pixels i { display: block; border-radius: 3px; }
.pixels i:nth-child(1) { width: 14px; height: 14px; background: var(--gold); }
.pixels i:nth-child(2) { width: 10px; height: 10px; background: var(--teal); margin-top: 2px; }
.pixels i:nth-child(3) { width: 10px; height: 10px; background: var(--teal); opacity: .75; }
.feature-strip h2 { font-size: 30px; margin: 10px 0 12px; }
.feature-strip p { opacity: .86; max-width: 520px; }
.stats { display: flex; gap: 28px; margin-top: 22px; }
.stat b { display: block; font-size: 26px; color: var(--gold); }
.stat span { font-size: 13px; opacity: .8; }
.feature-panel {
  background: rgba(247,243,233,.08);
  border: 1px solid rgba(211,166,79,.28);
  border-radius: 18px;
  padding: 22px;
}
.feature-panel li {
  display: flex; gap: 12px; align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(247,243,233,.08);
}
.feature-panel li:last-child { border: 0; }
.num {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--gold); color: var(--navy);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; flex: none;
}

/* ========== CATEGORIES ========== */
.cats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
}
.cat-tile {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  transition: .2s ease;
}
.cat-tile:hover { border-color: var(--teal); transform: translateY(-3px); }
.cat-tile .ico {
  width: 42px; height: 42px; margin: 0 auto 10px;
  border-radius: 12px; display: grid; place-items: center;
  background: var(--teal-soft); color: var(--teal-dark); font-size: 20px;
}
.cat-tile h3 { font-size: 16px; color: var(--navy); }
.cat-tile p { font-size: 12.5px; color: var(--muted); }

/* ========== ABOUT / LICENSE ========== */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center;
}
.about-copy h2 { font-size: 30px; color: var(--navy); margin-bottom: 12px; }
.about-copy p { color: var(--muted); margin-bottom: 14px; }
.license-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
}
.license-box h3 { color: var(--navy); margin-bottom: 14px; }
.row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
}
.row:last-child { border: 0; }
.row span { color: var(--muted); }
.row b { color: var(--navy); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--navy); color: var(--cream);
  padding: 10px 18px; border-radius: 999px;
  border: 0; font-size: 14px;
}
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.teal { background: var(--teal); color: white; }
.btn.ghost {
  background: transparent; color: var(--navy);
  border: 1px solid var(--line);
}

/* ========== FOOTER ========== */
.footer {
  margin-top: 40px;
  background: var(--navy-deep);
  color: #c9d7de;
  padding: 48px 0 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
}
.footer .brand-text .name { color: var(--cream); }
.footer p { font-size: 14px; opacity: .8; margin-top: 10px; max-width: 360px; }
.footer h4 { color: var(--cream); margin-bottom: 12px; font-size: 16px; }
.footer a { display: block; padding: 4px 0; opacity: .8; }
.footer a:hover { color: var(--gold); opacity: 1; }
.footer-bottom {
  margin-top: 28px; padding-top: 16px;
  border-top: 1px solid rgba(247,243,233,.1);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 13px;
}

/* ========== ARTICLE PAGE ========== */
.article-wrap { padding: 30px 0 60px; }
.article-hero { max-width: 860px; margin: 0 auto 28px; }
.article-hero img {
  width: 100%; height: 420px; object-fit: cover; border-radius: 24px;
}
.article-body {
  max-width: 760px; margin: 0 auto;
  font-size: 18px; color: #243841;
}
.article-body p { margin-bottom: 16px; }
.article-body h2 { color: var(--navy); font-size: 24px; margin: 26px 0 10px; }
.dropcap::first-letter {
  float: right; font-size: 56px; line-height: .85;
  padding: 6px 8px 0 10px;
  color: var(--teal);
  font-family: "Noto Kufi Arabic", sans-serif;
}

/* ========== CONTACT ========== */
.form {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 20px; padding: 24px;
  display: grid; gap: 12px;
}
.form input, .form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-family: inherit; font-size: 15px;
  background: var(--paper); color: var(--ink);
}
.form textarea { min-height: 140px; resize: vertical; }

/* ========== SEARCH OVERLAY ========== */
.search-overlay {
  position: fixed; inset: 0; background: rgba(6,31,43,.72);
  display: none; place-items: start center; padding-top: 12vh; z-index: 80;
}
.search-overlay.open { display: grid; }
.search-box {
  width: min(640px, calc(100% - 32px));
  background: var(--white); border-radius: 18px; padding: 18px;
}
.search-box input {
  width: 100%; border: 0; outline: 0; font-size: 20px;
  font-family: inherit; background: transparent;
}

/* ========== MOBILE ========== */
@media (max-width: 980px) {
  .hero-grid, .news-grid, .about-grid, .footer-grid, .feature-strip {
    grid-template-columns: 1fr;
  }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
  .menu-btn { display: grid; }
  .nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: 86px; right: 0; left: 0;
    background: var(--paper); padding: 12px;
    border-bottom: 1px solid var(--line);
  }
  .header { position: relative; }
  .header-inner { min-height: 74px; }
  .hero-main, .hero-main img, .article-hero img { min-height: 320px; height: 320px; }
}

@media (max-width: 560px) {
  .side-card { grid-template-columns: 1fr; }
  .side-card img { width: 100%; height: 140px; }
  .cats { grid-template-columns: 1fr 1fr; }
  .brand-text .name { font-size: 16px; }
}

/* ========== TYPOGRAPHY GUIDE ========== */
.type-hero {
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-soft) 55%, #0a4a4a 100%);
  color: var(--cream);
  border-radius: 28px;
  padding: 48px 40px;
  margin: 28px 0 36px;
  position: relative;
  overflow: hidden;
}
.type-hero::after {
  content: "ح";
  position: absolute;
  left: 24px; bottom: -28px;
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: 220px; line-height: 1;
  color: rgba(247,243,233,.06);
  pointer-events: none;
}
.type-hero .eyebrow {
  color: var(--gold);
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: 13px;
  letter-spacing: .4px;
}
.type-hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.3;
  margin: 10px 0 12px;
  color: var(--cream);
}
.type-hero p { max-width: 640px; opacity: .88; font-size: 17px; }

.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.type-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  min-height: 220px;
}
.type-card .label {
  font-size: 12px;
  color: var(--teal-dark);
  font-weight: 700;
  margin-bottom: 8px;
  font-family: "Noto Kufi Arabic", sans-serif;
}
.type-card .sample { color: var(--navy); margin-bottom: 14px; }
.type-meta {
  font-size: 13px;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  line-height: 1.7;
}
.type-meta code {
  background: var(--cream);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
}

.scale-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.scale-table th, .scale-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.scale-table th {
  background: var(--navy);
  color: var(--cream);
  font-family: "Noto Kufi Arabic", sans-serif;
  font-weight: 600;
  font-size: 14px;
}
.scale-table tr:last-child td { border-bottom: 0; }
.scale-table .role { color: var(--muted); font-size: 13px; white-space: nowrap; }
.scale-table .spec { color: var(--teal-dark); font-size: 13px; white-space: nowrap; }

.do-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.do-card, .dont-card {
  border-radius: 20px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--white);
}
.do-card { border-top: 4px solid var(--teal); }
.dont-card { border-top: 4px solid #c45b5b; }
.do-card h3, .dont-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}
.do-card li, .dont-card li {
  padding: 7px 0 7px 0;
  color: var(--muted);
  position: relative;
  padding-right: 18px;
}
.do-card li::before, .dont-card li::before {
  position: absolute;
  right: 0;
  top: 7px;
}
.do-card li::before { content: "✓"; color: var(--teal); }
.dont-card li::before { content: "×"; color: #c45b5b; }

.pair-box {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  align-items: start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 14px;
}
.pair-box .swatch {
  height: 120px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 48px;
  font-family: "Noto Kufi Arabic", sans-serif;
}
.color-on-type {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.color-on-type figure {
  border-radius: 16px;
  padding: 22px 16px;
  min-height: 130px;
}
.color-on-type figcaption {
  font-size: 12px;
  margin-top: 10px;
  opacity: .8;
}

.numeral-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.numeral-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
}
.numeral-box .big {
  font-size: 34px;
  color: var(--navy);
  margin: 8px 0 6px;
  letter-spacing: .5px;
}

@media (max-width: 980px) {
  .type-grid, .do-grid, .numeral-row, .color-on-type {
    grid-template-columns: 1fr 1fr;
  }
  .pair-box { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .type-grid, .do-grid, .numeral-row, .color-on-type {
    grid-template-columns: 1fr;
  }
  .type-hero { padding: 28px 20px; }
  .scale-table { display: block; overflow-x: auto; }
}
