/* 2026 Summer — calm, minimal. One bold thing (the changing splash hero);
   everything else quiet. JSON-driven; per-course accent via --accent. */

:root {
  --ink:    #0a0f1a;
  --panel:  rgba(255, 255, 255, 0.035);
  --fg:     #f1f4f9;
  --muted:  #97a3b6;
  --faint:  #5a6678;
  --line:   rgba(255, 255, 255, 0.09);

  --accent: #9aa6ff;        /* home default; pages override */
  --maxw: 960px;
}

[data-accent="amber"] { --accent: #f3b545; }
[data-accent="cyan"]  { --accent: #4fd4df; }
[data-accent="violet"]{ --accent: #8b7dff; }
[data-accent="lime"]  { --accent: #b6e25e; }
[data-accent="rose"]  { --accent: #ff7a93; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
:is(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

/* ---------- hero with changing splash ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: flex-end; }
.hero--home { min-height: clamp(460px, 72vh, 760px); }
.hero--course { min-height: clamp(320px, 50vh, 520px); }
.hero__media { position: absolute; inset: 0; z-index: -2; background: #0d1322; }
.splash-layer {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: brightness(0.82) contrast(1.04) saturate(1.05);
  opacity: 0; transition: opacity 1.6s ease; transform: scale(1.04);
}
.splash-layer.is-active { opacity: 1; animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.04); } to { transform: scale(1.12); } }

/* keep the photo readable up top, fade hard into the page at the bottom so it bleeds down */
.hero__veil {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(80% 60% at 50% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(10,15,26,0.18) 0%, rgba(10,15,26,0.10) 38%, rgba(10,15,26,0.62) 78%, var(--ink) 100%);
}

.hero__inner { position: relative; width: 100%; }
.hero--home .hero__inner { padding: 0 0 clamp(120px, 16vw, 184px); }
.hero--course .hero__inner { padding: 0 0 clamp(64px, 9vw, 100px); }

/* home: eyebrow reads as a plain line of one header, not an uppercase caption */
.hero--home .eyebrow {
  text-transform: none; letter-spacing: 0.01em;
  font-size: 0.98rem; color: var(--fg); opacity: 0.82; margin-bottom: 6px;
}

/* course: class code + name on one line, e.g. "IT 244  Database Fundamentals" */
.course-head { display: flex; align-items: baseline; gap: clamp(10px, 2vw, 18px); flex-wrap: wrap; }
.hero--course .eyebrow {
  margin: 0; font-size: clamp(0.95rem, 2.4vw, 1.2rem); color: var(--accent);
}

.eyebrow {
  margin: 0 0 18px; font-size: 0.74rem; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--muted);
}

.display {
  margin: 0; font-family: "Space Grotesk", sans-serif; font-weight: 500;
  letter-spacing: -0.02em; line-height: 1.0; color: var(--fg);
  overflow-wrap: break-word;
}
.hero--home .display { font-size: clamp(2.9rem, 11vw, 5rem); }
.hero--course .display { font-size: clamp(2.2rem, 8vw, 3.4rem); }

.lede { margin: 20px 0 0; max-width: 42ch; color: var(--muted); font-size: 1.05rem; }
.lede[lang="ar"] { direction: rtl; text-align: left; margin-top: 12px; }

.back {
  display: inline-block; margin: 0 0 26px; color: var(--muted); font-size: 0.92rem;
  transition: color 0.2s ease;
}
.back:hover { color: var(--fg); }
.back span { color: var(--accent); }

/* ---------- home: course list ---------- */
.courses { padding: 8px 0 0; }

.course {
  position: relative; display: block;
  padding: clamp(26px, 6vw, 38px) 44px clamp(26px, 6vw, 38px) 0;
  border-top: 1px solid var(--line);
  transition: padding-left 0.28s ease;
}
.courses .course:last-child { border-bottom: 1px solid var(--line); }
.course__code {
  font-family: "IBM Plex Mono", monospace; font-size: 0.8rem; letter-spacing: 0.14em;
  color: var(--accent); margin: 0 0 8px;
}
.course__name {
  margin: 0; font-family: "Space Grotesk", sans-serif; font-weight: 500;
  font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.08; letter-spacing: -0.01em;
  transition: color 0.2s ease;
}
.course__ar { margin: 6px 0 0; color: var(--muted); direction: rtl; font-size: 1.05rem; }
.course__go {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 1.5rem; opacity: 0.55;
  transition: transform 0.28s ease, opacity 0.2s ease;
}
.course:hover { padding-left: 14px; }
.course:hover .course__name { color: var(--accent); }
.course:hover .course__go { opacity: 1; transform: translate(6px, -50%); }

/* ---------- course page: grouped resources ---------- */
main { padding-bottom: clamp(64px, 14vw, 110px); }

.group { margin-top: clamp(40px, 9vw, 64px); }
.group__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.group__ar { color: var(--muted); font-size: 1.02rem; direction: rtl; }
.group__title {
  margin: 0 0 4px; font-family: "Space Grotesk", sans-serif; font-weight: 500;
  font-size: 1.18rem; letter-spacing: -0.01em; color: var(--fg);
}
.group__title::after {
  content: ""; display: block; width: 30px; height: 2px; margin-top: 12px;
  background: var(--accent); opacity: 0.8;
}

.res {
  position: relative; display: flex; align-items: baseline; gap: 14px;
  padding: 18px 40px 18px 0; border-bottom: 1px solid var(--line);
  transition: padding-left 0.24s ease;
}
.group .res:first-of-type { border-top: 1px solid var(--line); margin-top: 18px; }
.res__title { font-size: 1.08rem; font-weight: 500; }
.res__ar {
  margin-left: auto; padding-left: 16px; text-align: right;
  color: var(--muted); font-size: 0.98rem; direction: rtl;
}
.res__go {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  color: var(--accent); opacity: 0.5; font-size: 1.15rem;
  transition: transform 0.24s ease, opacity 0.2s ease;
}
.res:hover { padding-left: 10px; }
.res:hover .res__go { opacity: 1; transform: translate(5px, -50%); }

/* ---------- error + credit ---------- */
.loaderr { margin: 64px 0; padding: 28px; border: 1px solid var(--line); border-radius: 4px; }
.loaderr h2 { margin: 0 0 8px; font-family: "Space Grotesk", sans-serif; font-weight: 500; }
.loaderr p { margin: 0; color: var(--muted); }

#credit-footer {
  text-align: center; padding: 28px 16px; opacity: 0.1;
  font-size: 0.64rem; font-family: "IBM Plex Mono", monospace; transition: opacity 0.3s;
}
#credit-footer:hover { opacity: 0.38; }

@media (max-width: 540px) {
  .res { flex-wrap: wrap; gap: 2px 12px; }
  .res__ar { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .splash-layer.is-active { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
