:root {
  --ink: #283248;
  --muted: #6c7487;
  --paper: #fffdf8;
  --line: #e8e5dc;
  --yellow: #f5c84b;
  --yellow-soft: #fff4c9;
  --blue: #579bd7;
  --blue-soft: #eaf6ff;
  --purple: #7151a8;
  --green: #55a878;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 10% 0%, #fff7dd 0, transparent 34rem), var(--paper); }
a { color: inherit; text-decoration: none; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem clamp(1rem, 4vw, 4rem); border-bottom: 1px solid var(--line); background: rgba(255,253,248,.92); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(10px); }
.brand { font-weight: 900; font-size: 1.25rem; letter-spacing: -.03em; }
.brand span { color: var(--purple); font-size: .8em; }
.main-nav { display: flex; gap: .65rem; flex-wrap: wrap; justify-content: flex-end; }
.main-nav a, .breadcrumbs a { color: var(--muted); font-weight: 700; }
.main-nav a { padding: .55rem .8rem; border-radius: 999px; }
.main-nav a:hover, .main-nav a:focus-visible { background: var(--yellow-soft); color: var(--ink); }
.page-shell { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.5rem, 5vw, 4.5rem) 0; }
.hero-panel { text-align: center; padding: clamp(1rem, 4vw, 3rem) 0 2rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; color: var(--purple); font-size: .75rem; font-weight: 900; margin: 0 0 .6rem; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 4rem); line-height: 1.03; letter-spacing: -.05em; margin-bottom: .7rem; }
h2 { letter-spacing: -.03em; }
.lead { color: var(--muted); font-size: 1.05rem; }
.arabic { font-family: "Noto Sans Arabic", "Segoe UI", sans-serif; line-height: 1.7; }
.welcome .arabic { font-size: 1.25rem; color: var(--purple); margin-bottom: .8rem; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; max-width: 820px; margin: 0 auto; }
.profile-card { display: flex; align-items: center; gap: 1rem; padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 2rem; min-height: 220px; box-shadow: 0 12px 40px rgba(40,50,72,.07); transition: transform .2s, box-shadow .2s; }
.profile-card:hover, .profile-card:focus-visible, .subject-card:hover, .type-card:hover, .document-card:hover { transform: translateY(-3px); box-shadow: 0 16px 42px rgba(40,50,72,.12); }
.profile-card img { width: clamp(110px, 22vw, 170px); height: clamp(110px, 22vw, 170px); }
.profile-card h2 { font-size: 1.8rem; margin-bottom: .1rem; }
.profile-lyna { background: linear-gradient(135deg, #fff7dd, #fff); }
.profile-othmane { background: linear-gradient(135deg, #eaf7ff, #fff); }
.profile-abdelkader { background: linear-gradient(135deg, #eefbe9, #fff); }
.profile-card .arabic { color: var(--muted); margin-bottom: 1.1rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .75rem 1rem; border-radius: 999px; background: var(--yellow); font-weight: 900; border: 0; cursor: pointer; }
.button-accent { background: var(--blue-soft); color: #25649a; }
.button-primary { background: var(--purple); color: #fff; font-size: 1.05rem; padding: 1rem 1.3rem; }
.profile-hero { display: flex; align-items: center; gap: 1.4rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: 1.6rem; background: #fff; margin-bottom: 3rem; }
.profile-hero .avatar { width: 120px; height: 120px; }
.profile-hero h1 { font-size: clamp(1.75rem, 4vw, 3rem); margin-bottom: .2rem; }
.profile-hero h1 .arabic { font-size: .5em; color: var(--purple); white-space: nowrap; }
.profile-hero .button { margin-left: auto; flex-shrink: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 2rem 0 1rem; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > a { color: var(--purple); font-weight: 900; }
.subject-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.subject-card, .type-card, .summary-row { border: 1px solid var(--line); background: #fff; border-radius: 1rem; }
.subject-card { display: flex; align-items: center; gap: .75rem; padding: 1rem; min-height: 82px; transition: transform .2s, box-shadow .2s; }
.subject-card strong, .subject-card small { display: block; }
.subject-card small { color: var(--muted); font-size: .84rem; margin-top: .2rem; }
.subject-emoji { font-size: 1.65rem; width: 2rem; text-align: center; }
.count { margin-left: auto; color: var(--muted); font-weight: 900; }
.split-section { margin-top: 2.8rem; }
.document-mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.document-mini { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; border: 1px solid var(--line); background: #fff; border-radius: 1rem; min-height: 130px; }
.document-mini strong { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.document-mini small { color: var(--muted); margin-top: auto; }
.tag, .metadata span { color: var(--purple); font-size: .78rem; font-weight: 900; }
.breadcrumbs { display: flex; gap: .55rem; flex-wrap: wrap; color: var(--muted); margin-bottom: 1.7rem; font-size: .9rem; }
.page-title { margin-bottom: 2rem; }
.page-title h1 { margin-bottom: .3rem; }
.page-title .arabic { color: var(--purple); font-size: 1.1rem; }
.type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.type-card { padding: 1.3rem; display: flex; flex-direction: column; gap: .35rem; min-height: 170px; transition: transform .2s, box-shadow .2s; }
.type-card .type-icon { font-size: 2rem; }
.type-card .arabic { color: var(--muted); }
.type-card small { color: var(--muted); margin-top: auto; }
.document-list { display: grid; gap: .75rem; }
.document-card { display: flex; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--line); background: #fff; border-radius: 1.1rem; transition: transform .2s, box-shadow .2s; }
.document-card-icon { display: grid; place-items: center; width: 3rem; height: 3rem; flex: 0 0 3rem; background: var(--yellow-soft); border-radius: .9rem; font-size: 1.4rem; }
.document-card-body { min-width: 0; flex: 1; }
.document-card h2 { font-size: 1rem; margin-bottom: .5rem; overflow-wrap: anywhere; }
.metadata { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.metadata span { color: var(--muted); font-weight: 700; }
.metadata .solution { color: var(--green); }
.arrow { font-size: 1.3rem; color: var(--purple); }
.detail-card { max-width: 860px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 1.5rem; padding: clamp(1.1rem, 4vw, 2.4rem); box-shadow: 0 14px 50px rgba(40,50,72,.08); }
.detail-heading { display: flex; gap: 1rem; align-items: flex-start; padding-bottom: 1.3rem; border-bottom: 1px solid var(--line); }
.detail-heading h1 { font-size: clamp(1.5rem, 4vw, 2.4rem); overflow-wrap: anywhere; }
.detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0 0 1.6rem; }
.detail-fields div { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.detail-fields dt { color: var(--muted); font-size: .82rem; font-weight: 800; margin-bottom: .3rem; }
.detail-fields dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.detail-fields dd .arabic { display: block; color: var(--purple); font-weight: 500; }
.open-pdf { width: 100%; }
.unavailable { padding: 1rem; border-radius: .9rem; color: #8a5e26; background: #fff4da; text-align: center; font-weight: 700; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.stat-card { background: var(--yellow-soft); border-radius: 1.2rem; padding: 1.4rem; }
.stat-card strong, .stat-card span { display: block; }
.stat-card strong { font-size: 2.3rem; }
.stat-card span { color: var(--muted); }
.summary-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-bottom: 3rem; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem; }
.summary-row strong, .summary-row span { display: block; }
.summary-row .arabic { color: var(--muted); font-size: .85rem; }
.summary-row > span { font-size: 1.35rem; font-weight: 900; color: var(--purple); }
.empty-state { padding: 2rem; border: 1px dashed #d7d2c7; border-radius: 1rem; color: var(--muted); text-align: center; }
.error-page { max-width: 600px; margin: 4rem auto; }
.error-icon { font-size: 3rem; margin-bottom: 1rem; }
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 1rem 2.5rem; color: var(--muted); text-align: center; font-size: .86rem; }
@media (max-width: 760px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .main-nav { width: 100%; justify-content: flex-start; }
  .profile-grid, .subject-grid, .type-grid, .document-mini-grid { grid-template-columns: 1fr; }
  .profile-card { min-height: 170px; }
  .profile-hero { flex-wrap: wrap; }
  .profile-hero .avatar { width: 88px; height: 88px; }
  .profile-hero > div { flex: 1; min-width: 200px; }
  .profile-hero .button { width: 100%; margin-left: 0; }
  .detail-fields, .summary-list, .stats-grid { grid-template-columns: 1fr; }
}
@media (min-width: 761px) and (max-width: 980px) {
  .subject-grid, .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
