:root {
  --bg: #0A0D18;
  --bg-raised: #10131F;
  --card: #12162480;
  --ink: #F5F6FA;
  --ink-dim: rgba(245, 246, 250, 0.6);
  --ink-faint: rgba(245, 246, 250, 0.38);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.05);
  --pill-bg: rgba(255, 255, 255, 0.08);
  --pill-border: rgba(255, 255, 255, 0.14);
  --accent: #C9A15C;
  --radius: 14px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Noto Naskh Arabic", system-ui, sans-serif;
  line-height: 1.55;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(201,161,92,0.05), transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(120,150,255,0.04), transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.035)' stroke-width='1'%3E%3Cpath d='M60 6 L74 44 L114 44 L82 66 L94 106 L60 82 L26 106 L38 66 L6 44 L46 44 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto, auto, 120px 120px;
}

h1, h2, h3 {
  font-family: "Inter", "Noto Naskh Arabic", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.08; }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 700; }
p { margin: 0 0 1em; color: var(--ink-dim); }
a { color: inherit; text-decoration: none; }

[dir="rtl"] { font-family: "Noto Naskh Arabic", serif; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}
.nav .brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.display, .brand-mark { font-weight: 800; letter-spacing: -0.01em; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 0.92rem; }
.nav-links a { color: var(--ink-dim); transition: color 0.15s ease; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.btn-primary { color: #0A0D18; }
.nav-links a.btn-primary:hover { color: #0A0D18; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: #fff; color: #0A0D18; }
.btn-primary:hover { opacity: 0.9; }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

.pill {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 20px;
}

.hero {
  position: relative;
  padding: 90px 0 70px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hero-inner { max-width: 640px; }
.hero p.lead { font-size: 1.05rem; max-width: 54ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

.accordion { border-top: 1px solid var(--line); margin-top: 12px; }
.accordion-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
}
.accordion-row svg { transition: transform 0.2s ease; flex-shrink: 0; }
.accordion-row.open svg { transform: rotate(180deg); }
.accordion-body { display: none; padding: 4px 0 24px; }
.accordion-body.open { display: block; }

.faculty-section { margin: 56px 0; }
.faculty-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.faculty-title { font-size: 1.4rem; margin-bottom: 20px; }

.subject-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.subject-card {
  position: relative;
  flex: 0 0 260px;
  height: 160px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  display: block;
}
.subject-card img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.75;
  transition: transform 0.3s ease, opacity 0.2s ease;
}
.subject-card:hover img { transform: scale(1.04); opacity: 0.9; }
.subject-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,13,24,0.95) 15%, rgba(10,13,24,0.15) 65%);
}
.subject-card-badge {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(10,13,24,0.75);
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-dim);
}
.subject-card-overlay {
  position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 2;
}
.subject-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 3px;
}
.subject-card-name { font-size: 1.02rem; font-weight: 700; color: #fff; }

footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
  font-size: 0.85rem;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 42px;
  width: 100%;
  max-width: 400px;
}
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 7px; color: var(--ink); }
.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-msg { font-size: 0.9rem; margin: -6px 0 16px; }
.form-msg.error { color: #E08A8A; }
.form-msg.success { color: #8FC9A8; }
.auth-switch { margin-top: 22px; font-size: 0.9rem; text-align: center; color: var(--ink-dim); }
.auth-switch a { color: var(--accent); font-weight: 600; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.filters { display: flex; gap: 10px; margin: 24px 0; }
.chip {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--ink-dim);
  font-size: 0.85rem;
  cursor: pointer;
}
.chip.active { background: #fff; color: #0A0D18; border-color: #fff; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-faint); }

.rosette-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 40px 0 24px;
  color: var(--accent);
}
.rosette-divider::before,
.rosette-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.player-wrap {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  margin-bottom: 28px;
  border: 1px solid var(--line);
}
.player-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.caption-toggle { display: flex; gap: 10px; margin-bottom: 20px; }
.resource-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 12px;
}
.comment { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment .author { font-weight: 700; font-size: 0.9rem; }
.comment-form { display: flex; gap: 10px; margin-top: 20px; }
.comment-form textarea {
  flex: 1;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  font-family: inherit;
  resize: vertical;
  min-height: 46px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  padding-bottom: 60px;
}
.feature-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.feature-card .label {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 10px; display: block;
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { margin: 0; font-size: 0.93rem; }

@media (max-width: 720px) {
  .hero { padding: 60px 0 40px; }
  .subject-card { flex-basis: 220px; height: 140px; }
}
