/* ==========================================================================
   Added chapters: cybersecurity, training academy, two more projects, insights.
   Uses the tokens from styles.css and leaves the existing sections as they are.
   ========================================================================== */

/* Two more links in the navigation: keep them on one line on smaller laptops. */
@media (min-width: 861px) and (max-width: 1180px) {
  .nav { gap: 10px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 8px 9px; font-size: .86rem; white-space: nowrap; }
}
@media (min-width: 861px) and (max-width: 990px) {
  .nav { gap: 6px; padding-inline-start: 16px; }
  .nav-logo img { height: 28px; }
  .nav-links a { padding: 8px 6px; font-size: .8rem; }
  .nav-actions .btn { padding: 0 12px; font-size: .8rem; }
  .lang-btn { min-width: 44px; padding: 0 8px; }
}

/* Service cards that lead to their own chapter */
.card-link { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; margin-top: 16px;
  font-weight: 600; font-size: .9rem; color: var(--brand-ink); }
.card-link::after { content: '→'; transition: transform .25s ease; }
html[dir='rtl'] .card-link::after { content: '←'; }
.card-link:hover::after { transform: translateX(4px); }
html[dir='rtl'] .card-link:hover::after { transform: translateX(-4px); }
.card-link:focus-visible, .course-chip:focus-visible, .filters button:focus-visible, .course-open:focus-visible, .post:focus-visible {
  outline: 2px solid var(--tech); outline-offset: 3px; }

/* ---------- Cybersecurity ---------- */
.cyber-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(28px, 5vw, 64px); align-items: center; margin-bottom: 28px; }
.cyber-copy p { color: var(--ink-2); }
.cyber-copy .btn-row { margin-top: 22px; }

.console { position: relative; overflow: hidden; border-radius: var(--radius); color: #dfe7f5;
  background: linear-gradient(160deg, #15203a 0%, #0f1728 55%, #131f38 100%);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 40px 80px -40px rgba(15, 23, 40, .75), inset 0 1px 0 rgba(255, 255, 255, .08); }
.console::before { content: ''; position: absolute; width: 320px; height: 320px; inset-inline-end: -120px; top: -150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(248, 152, 24, .28), transparent 70%); pointer-events: none; }
.console-bar { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, .07); font-size: .84rem; }
.console-dots { display: inline-flex; gap: 5px; }
.console-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.console-dots i:first-child { background: var(--brand); }
.console-title { font-family: var(--font-display); font-weight: 600; letter-spacing: .03em; }
html[lang='ar'] .console-title { letter-spacing: 0; }
.console-tag { margin-inline-start: auto; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #9fb0cc; font-size: .72rem; }
.console-body { position: relative; display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 24px; padding: 26px 22px 22px; align-items: center; }

.radar { position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background:
    linear-gradient(rgba(63, 216, 255, .14), rgba(63, 216, 255, .14)) center / 100% 1px no-repeat,
    linear-gradient(rgba(63, 216, 255, .14), rgba(63, 216, 255, .14)) center / 1px 100% no-repeat,
    repeating-radial-gradient(circle closest-side, transparent 0 calc(33.33% - 1px), rgba(63, 216, 255, .2) calc(33.33% - 1px) 33.33%),
    radial-gradient(circle, rgba(32, 182, 232, .2), rgba(32, 182, 232, .03) 70%);
  box-shadow: inset 0 0 0 1px rgba(63, 216, 255, .3), 0 0 40px -10px rgba(63, 216, 255, .35); }
.radar-sweep { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(63, 216, 255, 0) 0 72%, rgba(63, 216, 255, .5) 100%); animation: radar-sweep 4.8s linear infinite; }
.radar-core { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; display: grid; place-items: center;
  background: #0f1728; box-shadow: 0 0 0 1px rgba(63, 216, 255, .5), 0 0 18px rgba(63, 216, 255, .5); }
.radar-core svg { width: 18px; height: 18px; fill: none; stroke: #7fe6ff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.blip { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #3fd8ff; opacity: .25;
  animation: radar-blip 4.8s linear infinite; }
.blip.b1 { left: 72%; top: 27%; background: #ffad3b; animation-delay: .55s; }
.blip.b2 { left: 78%; top: 66%; animation-delay: 1.75s; }
.blip.b3 { left: 30%; top: 76%; animation-delay: 2.9s; }
.blip.b4 { left: 22%; top: 36%; animation-delay: 3.95s; }
@keyframes radar-sweep { to { transform: rotate(360deg); } }
@keyframes radar-blip {
  0% { opacity: 1; box-shadow: 0 0 0 0 currentColor; transform: scale(1.35); }
  25% { box-shadow: 0 0 0 9px rgba(63, 216, 255, 0); transform: scale(1); }
  60%, 100% { opacity: .25; box-shadow: 0 0 0 0 rgba(63, 216, 255, 0); }
}

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feed li { --c: 63, 216, 255; display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px; font-size: .88rem;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); animation: feed-on 8s ease-in-out infinite; }
.feed .f1 { --c: 255, 173, 59; }
.feed .f2 { --c: 63, 216, 255; animation-delay: 2s; }
.feed .f3 { --c: 169, 176, 255; animation-delay: 4s; }
.feed .f4 { --c: 73, 214, 140; animation-delay: 6s; }
.feed-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--c)); box-shadow: 0 0 10px rgba(var(--c), .8); }
.feed-name { min-width: 0; }
.feed-state { margin-inline-start: auto; flex: none; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600;
  color: rgb(var(--c)); background: rgba(var(--c), .14); }
@keyframes feed-on {
  0%, 24%, 100% { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .07); }
  4%, 18% { background: rgba(var(--c), .13); border-color: rgba(var(--c), .5); }
}

.console-foot { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 22px 18px; border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: .78rem; color: #9fb0cc; }
.bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 26px; flex: none; }
.bars i { width: 4px; height: 40%; border-radius: 2px; background: linear-gradient(#7fe6ff, #20b6e8); transform-origin: bottom; animation: bar-move 2.2s ease-in-out infinite alternate; }
.bars i:nth-child(3n) { height: 70%; animation-delay: -.6s; }
.bars i:nth-child(3n + 1) { height: 52%; animation-delay: -1.2s; }
.bars i:nth-child(5n) { height: 34%; animation-delay: -1.7s; }
.bars i:nth-child(13) { height: 100%; background: linear-gradient(#ffd08a, var(--brand)); animation: none; }
@keyframes bar-move { to { transform: scaleY(.55); } }

.caps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.caps .card { padding: 24px; }
.caps .card h3 { font-size: 1.15rem; margin: 16px 0 8px; }
.caps .card p { font-size: .93rem; }

.cyber-train { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; margin-top: 18px; padding: 20px 24px; border-radius: var(--radius); }
.cyber-train p { margin: 0; color: var(--ink-2); }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.course-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 16px; border-radius: 999px; cursor: pointer; text-align: start;
  border: 1px solid rgba(15, 23, 40, .1); background: rgba(255, 255, 255, .85); color: var(--ink); font: 600 .9rem var(--font-body);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.course-chip::after { content: '+'; display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-ink); font: 600 .9rem/1 var(--font-body); }
.course-chip:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 12px 26px -16px rgba(248, 152, 24, .8); }

/* ---------- Training academy ---------- */
.academy .section-head { max-width: 780px; }
.academy .section-head .pill-list { margin-top: 18px; }
.top-courses { margin-bottom: clamp(36px, 5vw, 56px); }
.top-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 10px; }
.top-course { margin: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); transition: transform .35s ease, box-shadow .35s ease; }
.top-course:hover { transform: translateY(-5px); box-shadow: var(--glass-shadow), 0 30px 60px -30px rgba(24, 45, 90, .4); }
.top-course img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.top-course figcaption { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 16px; }
.top-course strong { font-family: var(--font-display); font-size: 1rem; line-height: 1.3; }
.top-course .btn { flex: none; }

.catalog-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 18px; }
.catalog-title { font-size: clamp(1.3rem, 2vw, 1.6rem); }
.filters { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 6px; border-radius: 999px; }
.filters button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  font: 500 .9rem var(--font-body); color: var(--ink-2); transition: background .25s, color .25s; }
.filters button[aria-pressed='true'] { background: var(--ink); color: #fff; }
.filters .n { font-size: .78em; opacity: .65; }

.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.course { --tc: var(--brand); position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 196px; padding: 22px 22px 18px; border-radius: var(--radius);
  transition: transform .35s ease, box-shadow .35s ease; }
.course[data-track='cyber'] { --tc: var(--violet); }
.course[data-track='code'] { --tc: var(--tech); }
.course[data-track='stem'] { --tc: #2fbf71; }
.course::before { content: ''; position: absolute; inset-inline-start: 0; top: 22px; width: 3px; height: 34px; border-radius: 3px; background: var(--tc); }
.course:hover { transform: translateY(-5px); box-shadow: var(--glass-shadow), 0 30px 60px -30px rgba(24, 45, 90, .4); }
.course-track { display: inline-flex; align-items: center; gap: 8px; font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
html[lang='ar'] .course-track { letter-spacing: 0; font-size: .82rem; }
.course-track::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--tc); }
.course h4 { margin: 0; font-family: var(--font-display); font-size: 1.16rem; line-height: 1.25; letter-spacing: -.01em; }
html[lang='ar'] .course h4 { letter-spacing: 0; line-height: 1.45; }
.course-open { all: unset; cursor: pointer; }
.course-open::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }   /* the whole card is the button */
.course-open:focus-visible::after { outline: 2px solid var(--tech); outline-offset: 3px; }
.course p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.course-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .82rem; color: var(--muted); }
.course-foot b { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-ink); font-weight: 600; }
.course-foot b::after { content: '→'; transition: transform .25s ease; }
html[dir='rtl'] .course-foot b::after { content: '←'; }
.course:hover .course-foot b::after { transform: translateX(4px); }
html[dir='rtl'] .course:hover .course-foot b::after { transform: translateX(-4px); }
.catalog-note { margin: 18px 0 0; }

/* Course details */
.cd { width: min(780px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--glass-border); border-radius: calc(var(--radius) + 4px);
  background: rgba(250, 252, 255, .98); color: var(--ink); overflow: auto; box-shadow: 0 40px 100px -30px rgba(15, 23, 40, .55); }
.cd:focus { outline: 0; }
.cd[open] { animation: cd-in .3s ease both; }
.cd::backdrop { background: rgba(15, 23, 40, .42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes cd-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.cd-head { padding: 30px 64px 24px 30px; background: linear-gradient(160deg, #fff, var(--brand-soft)); }
html[dir='rtl'] .cd-head { padding: 30px 30px 24px 64px; }
.cd-head h3 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 12px 0 10px; line-height: 1.2; }
.cd-head p { margin: 0; color: var(--ink-2); }
.cd-cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; padding: 24px 30px 8px; }
.cd-cols h4 { margin: 0 0 12px; font: 600 .78rem var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
html[lang='ar'] .cd-cols h4 { letter-spacing: 0; font-size: .88rem; }
.cd-topics { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: topic; }
.cd-topics li { counter-increment: topic; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: .95rem; }
.cd-topics li::before { content: counter(topic); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-ink); font: 600 .78rem var(--font-body); }
.cd-aud { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cd-aud li { font-size: .85rem; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid rgba(15, 23, 40, .08); }
.cd-cert { margin: 18px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(32, 182, 232, .1); color: var(--ink-2); font-size: .88rem; }
.cd-cert strong { display: block; color: var(--ink); margin-bottom: 2px; }
.cd-foot { padding: 14px 30px 26px; }
.cd-foot .pd-note { margin: 14px 0 0; }

/* ---------- Two more projects ---------- */
.more-projects { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.mini-project { display: grid; grid-template-columns: 148px 1fr; gap: 22px; align-items: center; padding: 16px; border-radius: var(--radius); }
.mini-project img, .mini-media { width: 148px; height: 148px; border-radius: var(--radius-sm); }
.mini-project img { object-fit: cover; object-position: center 30%; }
.mini-media { display: grid; place-items: center; background: linear-gradient(135deg, #fff, var(--brand-soft)); box-shadow: inset 0 0 0 1px rgba(248, 152, 24, .25); }
.mini-media svg { width: 58px; height: 58px; fill: none; stroke: var(--brand-ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.mini-project h3 { font-size: 1.3rem; margin: 10px 0 6px; }
.mini-project p { margin: 0; color: var(--ink-2); font-size: .95rem; }

/* ---------- Insights ---------- */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.post { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); transition: transform .35s ease, box-shadow .35s ease; }
.post:hover { transform: translateY(-6px); box-shadow: var(--glass-shadow), 0 30px 60px -30px rgba(24, 45, 90, .4); }
.post-cover { position: relative; height: 150px; display: grid; place-items: center; overflow: hidden; }
.post-cover::before { content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .22) 1px, transparent 1px); background-size: 28px 28px;
  mask-image: radial-gradient(circle at 70% 30%, #000, transparent 75%); -webkit-mask-image: radial-gradient(circle at 70% 30%, #000, transparent 75%); }
.post-cover::after { content: ''; position: absolute; width: 190px; height: 190px; inset-inline-end: -60px; bottom: -90px; border-radius: 50%; background: rgba(255, 255, 255, .28); }
.post-cover svg { position: relative; z-index: 1; width: 58px; height: 58px; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 6px 14px rgba(15, 23, 40, .25)); transition: transform .4s ease; }
.post:hover .post-cover svg { transform: scale(1.1) translateY(-3px); }
.post-cover.c1 { background: linear-gradient(135deg, #ffbf62, #f08a0c); }
.post-cover.c2 { background: linear-gradient(135deg, #5fd0f5, #1795c8); }
.post-cover.c3 { background: linear-gradient(135deg, #a9b0ff, #6a73e6); }
.post-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px 24px 24px; }
.post-title { font-family: var(--font-display); font-size: 1.22rem; line-height: 1.3; letter-spacing: -.01em; }
html[lang='ar'] .post-title { letter-spacing: 0; line-height: 1.5; }
.post-text { color: var(--ink-2); font-size: .94rem; }
.post-more { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--brand-ink); }
.post-more::after { content: '↗'; }
html[dir='rtl'] .post-more::after { content: '↖'; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .caps { grid-template-columns: repeat(2, 1fr); }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .cyber-grid { grid-template-columns: 1fr; }
  .more-projects { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  /* Banners and articles become a swipeable row. */
  .top-row, .posts { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 16px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .top-row::-webkit-scrollbar, .posts::-webkit-scrollbar { display: none; }
  .top-course, .post { flex: 0 0 min(82%, 340px); scroll-snap-align: center; }
  .top-course figcaption { flex-direction: column; align-items: flex-start; }
  .filters { border-radius: var(--radius); }
  .filters button { padding: 9px 13px; font-size: .86rem; }
}

@media (max-width: 560px) {
  .console-body { grid-template-columns: 1fr; gap: 18px; padding: 20px 16px 16px; }
  .radar { width: min(190px, 62%); margin-inline: auto; }
  .console-foot { padding: 12px 16px 16px; }
  .caps { grid-template-columns: 1fr; }
  .cyber-train { padding: 18px; }
  .course-chip { width: 100%; justify-content: space-between; }
  .course-grid { grid-template-columns: 1fr; gap: 12px; }
  .course { min-height: 0; padding: 18px 18px 14px; }
  .mini-project { grid-template-columns: 96px 1fr; gap: 16px; padding: 14px; }
  .mini-project img, .mini-media { width: 96px; height: 96px; }
  .mini-media svg { width: 42px; height: 42px; }
  .mini-project h3 { font-size: 1.15rem; }
  .cd-head { padding: 24px 56px 20px 20px; }
  html[dir='rtl'] .cd-head { padding: 24px 20px 20px 56px; }
  .cd-cols { grid-template-columns: 1fr; gap: 20px; padding: 20px 20px 4px; }
  .cd-foot { padding: 14px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .radar-sweep, .blip, .feed li, .bars i, .cd[open] { animation: none !important; }
  .blip { opacity: .9; }
}
