/* =====================================================================
   CS Career. Flat, no gradients.
   Tokens follow the shadcn/ui model (semantic variables, one radius).
   Palette: navy, blue, light blue, on a white page.
   ===================================================================== */

:root {
  --background: #ffffff;
  --foreground: #0a1f44;          /* navy */
  --muted: #f3f7ff;               /* very light blue panel */
  --muted-2: #e4eeff;             /* light blue, hover and chips */
  --muted-foreground: #4f628a;
  --border: #dbe6f8;
  --primary: #1f5fd8;             /* blue: logo, buttons, sections (same in light and dark) */
  --link: #1f5fd8;                /* blue for text and icons on page surfaces */
  --hover-line: #8db8ff;          /* light blue: navbar hover underline (the active page uses the main blue) */
  --primary-foreground: #ffffff;
  --navy: #0a1f44;
  --ring: #1f5fd8;
  --section: var(--primary);               /* same blue as the logo and icon backgrounds */
  --on-section: var(--primary-foreground);
  --radius: 12px;
  --shadow: 0 8px 24px rgba(10, 31, 68, .10);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="dark"] {
  --background: #07142b;
  --foreground: #e9f0ff;
  --muted: #0d2147;
  --muted-2: #153066;
  --muted-foreground: #9db2d6;
  --border: #1b3668;
  --primary: #1f5fd8;
  --link: #7db2ff;
  --hover-line: #e9f0ff;
  --primary-foreground: #ffffff;
  --navy: #040d1f;
  --ring: #5b9bff;
  --shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
html[dir="rtl"] { --font: "Noto Sans Arabic", "Geist", system-ui, sans-serif; }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font); line-height: 1.65; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--link); }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.wrap.narrow { width: min(760px, 100% - 32px); }
.muted { color: var(--muted-foreground); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 6px; }
.ti { font-size: 1.15em; line-height: 1; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
h3 { font-size: 1.1rem; line-height: 1.3; font-weight: 600; }
.h3 { margin-bottom: 10px; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { letter-spacing: 0; line-height: 1.35; }
.lead { margin-top: 18px; font-size: 1.1rem; color: var(--muted-foreground); max-width: 56ch; }
.sub { margin: 8px 0 22px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: var(--radius); border: 1px solid transparent; font: 600 .95rem var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: var(--primary-foreground); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--foreground); }
.btn.ghost:hover { background: var(--muted); }
.btn.invert { background: #fff; color: var(--navy); }
.btn.invert:hover { background: var(--muted-2); }
.btn.outline-light { background: transparent; border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn.outline-light:hover { background: rgba(255, 255, 255, .12); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--background); border-bottom: 1px solid var(--border); }
.bar { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--foreground); font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: var(--primary-foreground); font: 700 .78rem ui-monospace, Consolas, monospace; direction: ltr; }
.nav { margin-inline-start: auto; }
.nav ul { display: flex; align-items: center; gap: 2px; }
.nav a, .dd-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; color: var(--muted-foreground); text-decoration: none; padding: 8px 12px; border-radius: 8px; font: 500 .95rem var(--font); background: none; border: 0; cursor: pointer; transition: color .2s; }
.nav a:hover, .nav a.on, .dd-btn:hover, .has-dd.on > .dd-btn, .has-dd.open > .dd-btn { color: var(--foreground); }
/* underline that slides in from the start side on hover and stays on the active link */
.nav > ul > li > a::after, .dd-btn::after { content: ""; position: absolute; inset-inline: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--hover-line); transform: scaleX(0); transform-origin: right center; transition: transform .3s ease, background-color .2s; }
html[dir="rtl"] .nav > ul > li > a::after, html[dir="rtl"] .dd-btn::after { transform-origin: left center; }
/* the page you are on, and an open dropdown, keep the main blue underline (hover colour does not override it) */
.nav > ul > li > a.on::after, .has-dd.on > .dd-btn::after, .has-dd.open > .dd-btn::after { background: var(--link); }
.nav > ul > li > a:hover::after, .nav > ul > li > a.on::after, .dd-btn:hover::after, .has-dd.on > .dd-btn::after, .has-dd.open > .dd-btn::after { transform: scaleX(1); transform-origin: left center; }
html[dir="rtl"] .nav > ul > li > a:hover::after, html[dir="rtl"] .nav > ul > li > a.on::after, html[dir="rtl"] .dd-btn:hover::after, html[dir="rtl"] .has-dd.on > .dd-btn::after, html[dir="rtl"] .has-dd.open > .dd-btn::after { transform-origin: right center; }
.has-dd { position: relative; }
.dd-btn .ti { font-size: .9em; transition: transform .15s; }
.has-dd.open .dd-btn .ti { transform: rotate(180deg); }
.dd-menu { display: none; position: absolute; inset-inline-start: 0; top: 100%; min-width: 270px; padding: 6px; margin-top: 6px; background: var(--background); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 60; }
.has-dd.open .dd-menu { display: grid; }
.dd-menu a { gap: 12px; color: var(--foreground); padding: 10px 12px; }
.dd-menu a .ti { font-size: 1.25rem; color: var(--link); }
.dd-menu a:hover, .dd-menu a[aria-current="page"] { color: var(--link); }
.dd-menu a[aria-current="page"] { font-weight: 600; }
.tools { display: flex; align-items: center; gap: 8px; }
.lang-dd { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--muted); color: var(--foreground); font: 600 .85rem var(--font); cursor: pointer; }
.lang-btn:hover, .lang-dd.open .lang-btn { background: var(--muted-2); }
.lang-btn .ti { font-size: .9em; color: var(--muted-foreground); transition: transform .15s; }
.lang-dd.open .lang-btn .ti { transform: rotate(180deg); }
.flag { width: 20px; height: 15px; border-radius: 3px; background-size: cover; flex: none; box-shadow: 0 0 0 1px rgba(10, 31, 68, .15); }
.lang-list { display: none; position: absolute; inset-inline-end: 0; top: 100%; min-width: 170px; margin-top: 6px; padding: 6px; background: var(--background); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 60; }
.lang-dd.open .lang-list { display: grid; gap: 2px; }
.lang-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; color: var(--foreground); border-radius: 8px; font: 500 .92rem var(--font); cursor: pointer; text-align: start; }
.lang-list button:hover { background: var(--muted); }
.lang-list button[aria-selected="true"] { background: var(--muted-2); font-weight: 600; }
@media (max-width: 520px) { .lang-name { display: none; } }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; background: var(--muted); color: var(--foreground); border-radius: 8px; cursor: pointer; font-size: 1.1rem; }
.icon-btn:hover { background: var(--muted-2); }
.menu-btn { display: none; }
.nav-head, .nav-overlay { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: grid; }
  /* side drawer: slides in from the start side (left; right in Arabic) */
  .nav { display: block; position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 55; width: min(360px, 100%); margin: 0; padding: 0 20px 28px; background: var(--background); box-shadow: var(--shadow); overflow-y: auto; transform: translateX(-100%); visibility: hidden; transition: transform .3s ease, visibility 0s linear .3s; }
  html[dir="rtl"] .nav { transform: translateX(100%); }
  .nav.open { transform: none; visibility: visible; transition: transform .3s ease, visibility 0s; }
  .nav-head { display: flex; align-items: center; justify-content: space-between; height: 64px; margin-bottom: 8px; }
  .nav-overlay { display: block; position: fixed; inset: 0; z-index: 54; background: rgba(7, 22, 52, .55); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }
  .nav-overlay.open { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s; }
  html.nav-open { overflow: hidden; }
  .nav ul { flex-direction: column; align-items: stretch; }
  .nav a, .dd-btn { width: 100%; padding: 14px 12px; font-size: 1.05rem; }
  .dd-btn { justify-content: space-between; }
  .dd-menu { position: static; min-width: 0; margin: 0 0 4px; box-shadow: none; background: var(--muted); }
  .tools { margin-inline-start: auto; }
}
@media (max-width: 520px) { .nav { width: 100%; } }

/* ---------- Hero (flat navy, art on the right) ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; background: #dbe6f5; color: #0a1f44; display: flex; align-items: center; height: clamp(410px, 41.5vw, 900px); padding: 36px 0; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 42%); }
.hero > .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, min(420px, 31vw)) 1fr; gap: 40px; align-items: center; }
html[dir="rtl"] .hero-grid { direction: ltr; }
html[dir="rtl"] .hero-copy { direction: rtl; }
.hero-copy { max-width: min(420px, 31vw); }
.hero h1 { font-size: clamp(2rem, 3.6vw, 3.2rem); color: #0a1f44; }
.hero .lead { color: #2c4468; }
.hero .btn.invert { background: #1f5fd8; color: #fff; }
.hero .btn.invert:hover { background: #174cb0; }
.hero .btn.outline-light { border-color: rgba(10, 31, 68, .35); color: #0a1f44; }
.hero .btn.outline-light:hover { background: rgba(10, 31, 68, .08); }
@media (max-width: 980px) { .hero-art { display: none; } .hero-grid { grid-template-columns: 1fr; } .hero { height: auto; padding: 64px 0; background: linear-gradient(135deg, #e8f0fb, #cfdff5); } }

/* ---------- Sections ---------- */
.sec { padding: clamp(48px, 7vw, 88px) 0; }
.sec.tint { background: var(--section); color: var(--on-section); }
.sec.tint h2, .sec.tint h3 { color: var(--on-section); }
.sec.tint .sec-head p, .sec.tint .muted, .sec.tint .res small, .sec.tint .pay span, .sec.tint .habits li { color: color-mix(in srgb, var(--on-section) 88%, transparent); }
.sec.tint .dcard h3 { color: var(--foreground); }
.sec.tint .res a { color: var(--on-section); }
.sec.tint .res a:hover > span:first-child { color: var(--on-section); }
.sec.tint .pill.free { background: var(--on-section); color: var(--section); }
.sec.tint .pill.paid { background: var(--navy); color: #fff; }
.sec.tint .pay li::before, .sec.tint .habits li::before { background: var(--on-section); color: var(--section); }
.sec-head { max-width: 62ch; margin-bottom: 32px; }
.sec-head p { margin-top: 10px; color: var(--muted-foreground); font-size: 1.05rem; }

.cols3 { display: grid; gap: 32px; grid-template-columns: repeat(3, 1fr); }
.cols3 h3 { margin-bottom: 8px; }
.cols3 p { color: var(--muted-foreground); }
@media (max-width: 860px) { .cols3 { grid-template-columns: 1fr; gap: 24px; } }

.tips { margin-top: 48px; }
.tips ol { margin-top: 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: t; }
.tips li { counter-increment: t; color: var(--muted-foreground); font-size: .95rem; }
.tips li::before { content: counter(t); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--muted-2); color: var(--link); font-weight: 700; font-size: .85rem; margin-bottom: 8px; }
@media (max-width: 860px) { .tips ol { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .tips ol { grid-template-columns: 1fr; } }

/* ---------- Department cards (the only boxed element on the home page) ---------- */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.dcard { display: flex; flex-direction: column; gap: 8px; background: var(--background); border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--foreground); transition: background .15s; }
.badge { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); background: var(--muted-2); color: var(--link); font-size: 1.4rem; }
.dcard h3 { margin-top: 10px; font-size: 1.15rem; }
.dcard .tag { color: var(--muted-foreground); font-size: .95rem; flex: 1; }
.dcard .go { color: var(--link); font-weight: 600; font-size: .92rem; margin-top: 6px; }
html[dir="ltr"] .dcard .go::after { content: " \2192"; }
html[dir="rtl"] .dcard .go::after { content: " \2190"; }

/* ---------- Quiz ---------- */
.q-top { font-size: .9rem; color: var(--muted-foreground); margin-bottom: 10px; }
.bar-track { height: 4px; background: var(--muted-2); border-radius: 99px; overflow: hidden; margin-bottom: 24px; }
.bar-fill { height: 100%; background: var(--primary); transition: width .3s; }
.q-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 18px; line-height: 1.3; }
.opts { display: grid; gap: 10px; }
.opt { text-align: start; font: 500 1rem var(--font); color: var(--foreground); background: var(--muted); border: 0; border-radius: var(--radius); padding: 14px 18px; cursor: pointer; transition: background .15s; }
.opt:hover { background: var(--muted-2); }
.q-back { margin-top: 16px; background: none; border: 0; color: var(--muted-foreground); font: 600 .9rem var(--font); cursor: pointer; padding: 6px 0; }
.res-item { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--radius); margin-top: 12px; background: var(--muted); }
.res-item.top { background: var(--muted-2); }
.res-item .grow { flex: 1; min-width: 0; }
.res-item small { color: var(--muted-foreground); }
.res-item h4 { font-size: 1.05rem; }
.q-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Learn ---------- */
.res { display: grid; gap: 0 40px; grid-template-columns: repeat(2, 1fr); margin-top: 8px; }
.res a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; color: var(--foreground); text-decoration: none; font-weight: 500; }
.res a:hover > span:first-child { color: var(--link); text-decoration: underline; }
.res .meta { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.res small { color: var(--muted-foreground); font-weight: 400; }
.pill { font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.pill.free { background: var(--muted-2); color: var(--link); }
.pill.paid { background: var(--navy); color: #fff; }
:root[data-theme="dark"] .pill.paid { background: #fff; color: var(--navy); }
.res-group { margin-top: 26px; }
@media (max-width: 760px) { .res { grid-template-columns: 1fr; } }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 52px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 36px; } }
.pay { display: grid; gap: 18px; counter-reset: p; }
.pay li { counter-increment: p; position: relative; padding-inline-start: 44px; }
.pay li::before { content: counter(p); position: absolute; inset-inline-start: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--primary-foreground); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.pay b { display: block; }
.pay span { color: var(--muted-foreground); font-size: .95rem; }
.habits { display: grid; gap: 14px; }
.habits li { padding-inline-start: 18px; position: relative; color: var(--muted-foreground); }
.habits li::before { content: ""; position: absolute; inset-inline-start: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

/* ---------- Department page ---------- */
.detail-hero { padding: 36px 0 40px; background: var(--section); color: var(--on-section); }
.detail-hero .lead, .detail-hero .tagline, .detail-hero .crumbs, .detail-hero .crumbs a { color: color-mix(in srgb, var(--on-section) 88%, transparent); }
.detail-hero .crumbs a:hover { color: var(--on-section); }
.detail-hero h1 { color: var(--on-section); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .9rem; color: var(--muted-foreground); margin-bottom: 22px; }
.crumbs a { color: var(--muted-foreground); text-decoration: none; }
.crumbs a:hover { color: var(--link); }
.detail-title { display: flex; align-items: center; gap: 18px; }
.detail-title .badge { width: 64px; height: 64px; font-size: 2rem; background: var(--background); flex: none; }
.tagline { color: var(--muted-foreground); font-size: 1rem; margin-bottom: 2px; }
.detail-title h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
.detail-body { padding: 48px 0 72px; display: block; }
.detail-body section { scroll-margin-top: 80px; }
/* each section ends with a hairline so it is clear where the next one starts */
.detail-body > section:not(.cta-band) { padding-block: 52px; }
.detail-body > section:first-child { padding-top: 0; }
.detail-body > section + section:not(.cta-band) { border-top: 2px solid var(--border); }
.detail-body > .cta-band { margin-top: 28px; }
.detail-body > .pn { margin-top: 36px; padding-top: 24px; border-top: 2px solid var(--border); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; gap: 32px; } }
.plain ul { display: grid; gap: 8px; margin-top: 10px; }
.plain li { padding-inline-start: 18px; position: relative; }
.plain li::before { content: ""; position: absolute; inset-inline-start: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

.fields { display: grid; gap: 28px 40px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.field { display: flex; gap: 14px; }
.field .fn { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--muted-2); color: var(--link); font-weight: 700; font-size: .85rem; }
.field h3 { font-size: 1.02rem; margin-bottom: 4px; }
.field p { color: var(--muted-foreground); font-size: .95rem; }

.subjects { display: grid; gap: 24px 40px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 10px; }
.subjects h3 { font-size: 1rem; margin-bottom: 4px; }
.subjects p { color: var(--muted-foreground); font-size: .93rem; }
.mt-s { margin-top: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.chip { padding: 8px 16px; border-radius: 999px; background: var(--muted-2); font-weight: 500; font-size: .93rem; }
.note { margin-top: 26px; padding: 16px 18px; border-radius: var(--radius); background: var(--muted); font-weight: 500; }

.road { display: grid; gap: 22px; margin-top: 8px; }
.road li { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 16px; }
.road li::after { content: ""; position: absolute; inset-inline-start: 19px; top: 42px; bottom: -22px; width: 2px; background: var(--muted-2); }
.road li:last-child::after { display: none; }
.road .n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: var(--primary-foreground); font-weight: 700; z-index: 1; }
.road h4 { font-size: 1.05rem; margin: 6px 0 2px; }
.road p { color: var(--muted-foreground); font-size: .95rem; }

.cta-band { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; padding: clamp(24px, 4vw, 36px); border-radius: var(--radius); background: var(--navy); color: #fff; }
.cta-band h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); color: #fff; }
.cta-band p { color: #bcd0f0; margin-top: 6px; max-width: 50ch; }
.cta-band .cta { margin-top: 0; }
:root[data-theme="dark"] .cta-band { background: var(--muted); }

.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pn a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--foreground); padding: 8px 0; }
.pn small { color: var(--muted-foreground); }
.pn b { font-size: 1.05rem; }
.pn a:hover b { color: var(--link); }
.pn-next { text-align: end; }

/* ---------- Contact page ---------- */
.page-head { padding: 36px 0 40px; background: var(--section); color: var(--on-section); }
.page-head h1 { color: var(--on-section); }
.page-head .lead, .page-head .crumbs, .page-head .crumbs a { color: color-mix(in srgb, var(--on-section) 88%, transparent); }
.page-head .crumbs a:hover { color: var(--on-section); }
.page-head h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
main > .wrap.sec { padding-top: 48px; padding-bottom: 72px; }
.contact { margin-top: 0; align-items: start; }
.who { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; margin-top: 2px; }
.links { display: grid; gap: 4px; margin-top: 18px; }
.links a { display: flex; align-items: baseline; gap: 14px; text-decoration: none; color: var(--foreground); padding: 8px 0; word-break: break-all; }
.links a:hover .v { color: var(--link); text-decoration: underline; }
.links .k { flex: none; min-width: 96px; font-size: .85rem; color: var(--muted-foreground); }
.links .v { direction: ltr; unicode-bidi: plaintext; font-weight: 500; }
.mt { margin-top: 36px; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 16px 0 6px; }
input, textarea { width: 100%; font: 400 1rem var(--font); color: var(--foreground); background: var(--background); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
input:focus, textarea:focus { outline: 2px solid var(--ring); outline-offset: 0; border-color: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted-foreground); }
.err { color: #c0392b; margin-top: 10px; font-size: .9rem; }

/* ---------- Footer ---------- */
.footer { background: var(--navy); padding: 28px 0 40px; color: #bcd0f0; font-size: .9rem; }
.footer a { color: #fff; }
.foot { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.foot p { max-width: 70ch; }
.foot .copy { color: #fff; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.foot .foot-note { font-size: .85rem; opacity: .85; }

@media print { .topbar, .cta, .footer, #quiz { display: none; } }

/* ---------- Theme switch (sun / moon) ---------- */
.theme-switch { position: relative; display: inline-flex; align-items: center; justify-content: space-between; width: 62px; height: 34px; padding: 0 8px; border: 0; border-radius: 999px; background: var(--muted-2); cursor: pointer; }
.theme-switch .ti { position: relative; z-index: 1; font-size: 1.05rem; color: var(--muted-foreground); transition: color .2s; }
.theme-switch .knob { position: absolute; top: 3px; inset-inline-start: 3px; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); transition: inset-inline-start .2s ease; }
:root:not([data-theme="dark"]) .theme-switch .ti-sun, :root[data-theme="dark"] .theme-switch .ti-moon { color: var(--primary-foreground); }
:root[data-theme="dark"] .theme-switch .knob { inset-inline-start: calc(100% - 31px); }

/* ---------- Roadmap steps: numbered tiles you can tick off ---------- */
.rm-progress { margin: 4px 0 22px; max-width: 420px; }
.rm-progress .bar-track { margin-bottom: 8px; height: 6px; }
.rm { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; counter-reset: none; }
.rm li { position: relative; padding: 22px 24px 24px; border-radius: var(--radius); background: var(--muted); overflow: hidden; transition: background .2s, color .2s; }
.rm li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.rm-num { display: block; font-size: clamp(2.6rem, 5vw, 3.6rem); line-height: 1; font-weight: 800; letter-spacing: -.04em; color: var(--muted-2); margin-bottom: 14px; font-variant-numeric: tabular-nums; direction: ltr; text-align: start; }
.rm h4 { font-size: 1.1rem; margin-bottom: 4px; padding-inline-end: 48px; }
.rm p { color: var(--muted-foreground); font-size: .95rem; }
.rm-check { position: absolute; top: 18px; inset-inline-end: 18px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--muted-2); background: var(--background); color: transparent; font-size: 1.1rem; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.rm-check:hover { border-color: var(--primary); }
.rm-check:active { transform: scale(.92); }
.rm li.is-done { background: var(--primary); color: var(--primary-foreground); }
.rm li.is-done .rm-num { color: rgba(255, 255, 255, .28); }
.rm li.is-done p { color: rgba(255, 255, 255, .88); }
.rm li.is-done .rm-check { background: #fff; border-color: #fff; color: var(--primary); }
@media (max-width: 700px) { .rm { grid-template-columns: 1fr; } }

/* ---------- Hero: full-width photo of a student at the department wall ---------- */
.hero-art { position: absolute; inset: 0; z-index: -2; container-type: size; }
.scene { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: max(100cqw, calc(100cqh * 1941 / 808)); aspect-ratio: 1941 / 808; container-type: inline-size; }
.scene-img { display: block; width: 100%; height: 100%; }
.wall-tiles { position: absolute; inset: 0; }
.wt { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); border-radius: 6%; transition: background .15s, box-shadow .15s; }
.wt:hover, .wt:focus-visible { background: rgba(31, 95, 216, .12); box-shadow: 0 0 0 2px rgba(31, 95, 216, .55); outline: none; }
.wt .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Department page header: illustration on the right ---------- */
.dh-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 32px; align-items: center; }
.dh-art { width: 100%; height: auto; display: block; }
.detail-hero { padding-bottom: 28px; }
@media (max-width: 860px) { .dh-grid { grid-template-columns: 1fr; } .dh-art { display: none; } }

/* ---------- Back to top (fixed) ---------- */
.top-sentinel { position: absolute; top: 480px; left: 0; width: 1px; height: 1px; pointer-events: none; }
.back-top { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 40; display: grid; place-items: center; width: 50px; height: 50px; border: 3px solid var(--background); border-radius: 50%; background: var(--primary); color: var(--primary-foreground); font-size: 1.3rem; cursor: pointer; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s, background-color .15s, color .15s; }
.back-top.show { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .25s ease, visibility 0s; }
.back-top:hover { background: var(--navy); }
:root[data-theme="dark"] .back-top:hover { background: #fff; color: var(--navy); }
.back-top:active { transform: scale(.94); }
@media print { .back-top { display: none; } }

/* ---------- Logo: "CS career" wordmark with a cursor bar ---------- */
.logo { display: inline-flex; align-items: flex-end; direction: ltr; font-size: 1.5rem; line-height: 1; letter-spacing: -.04em; font-weight: 500; color: var(--foreground); }
.logo b { font-weight: 800; color: var(--link); margin-right: .26em; }
.logo .cursor { display: inline-block; width: .15em; height: .86em; margin-left: .16em; margin-bottom: .03em; background: var(--link); }

/* ---------- Department cards: fill grows from the top-right corner on hover ---------- */
.dcard { position: relative; overflow: hidden; isolation: isolate; transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.dcard::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--navy); clip-path: circle(0% at 100% 0%); transition: clip-path .55s cubic-bezier(.65, 0, .25, 1); }
:root[data-theme="dark"] .dcard::before { background: var(--muted-2); }
.dcard:hover::before, .dcard:focus-visible::before { clip-path: circle(150% at 100% 0%); }
.dcard h3, .dcard .tag, .dcard .go, .dcard .badge { transition: color .35s ease .08s, background-color .35s ease .08s, transform .35s ease; }
.dcard:hover, .dcard:focus-visible { transform: translateY(-3px); }
.sec.tint .dcard:hover h3, .sec.tint .dcard:focus-visible h3 { color: #fff; }
.dcard:hover .tag, .dcard:focus-visible .tag { color: #bcd0f0; }
.dcard:hover .go, .dcard:focus-visible .go { color: #fff; transform: translateX(4px); }
html[dir="rtl"] .dcard:hover .go, html[dir="rtl"] .dcard:focus-visible .go { transform: translateX(-4px); }
.dcard:hover .badge, .dcard:focus-visible .badge { background: rgba(255, 255, 255, .14); color: #fff; }
.dcard .go { display: inline-block; align-self: flex-start; }

input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #c0392b; }
input[aria-invalid="true"]:focus, textarea[aria-invalid="true"]:focus { outline-color: #c0392b; }

/* button icons sit before the label, on its left */
.btn .ti { font-size: 1.3em; }
#sendWa .ti { color: #25d366; }

/* contact form: the two buttons sit on the right side; icons stay on the left of each label (also in Arabic) */
#contactForm .cta { justify-content: flex-end; }
html[dir="rtl"] #contactForm .cta { justify-content: flex-start; }
html[dir="rtl"] #sendMail, html[dir="rtl"] #sendWa { flex-direction: row-reverse; }

/* ---------- Quiz: compact banner on the home page + the Quiz page ---------- */
.btn.big { padding: 15px 34px; font-size: 1.05rem; border-radius: var(--radius); }
.quiz-band { background: var(--muted); padding: 30px 0; }
.band-row { display: flex; align-items: center; justify-content: space-between; gap: 20px 40px; flex-wrap: wrap; }
.band-copy { max-width: 60ch; }
.band-copy h2 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); }
.band-copy p { margin-top: 6px; color: var(--muted-foreground); }
.q-start { display: flex; justify-content: center; padding: 8px 0; }
.q-start .btn.big { padding: 20px 56px; font-size: 1.2rem; }

/* ---------- Quiz page: stable box, small loader, success message, small drawing ---------- */
.quiz-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 250px); }
.quiz-grid .dh-art { max-width: 250px; justify-self: end; }
.quiz-wrap { padding-top: 36px; padding-bottom: 56px; }
.quiz-box.fixed { min-height: 460px; }
.q-status { min-height: 400px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.q-status p { color: var(--muted-foreground); font-weight: 500; }
.logo-load { font-size: 2.6rem; }
.logo-load .cursor { animation: qblink 1s steps(1) infinite; }
@keyframes qblink { 50% { opacity: 0; } }
.q-success { display: flex; align-items: center; gap: 14px; max-width: 420px; padding: 18px 22px; border-radius: var(--radius); background: var(--muted-2); animation: qfade .35s ease both; }
.q-success .ti { flex: none; font-size: 2.1rem; color: var(--link); }
.q-success p { color: var(--foreground); font-weight: 600; text-align: start; }
@keyframes qfade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { .quiz-grid { grid-template-columns: 1fr; } }
