/* EduFusion360 — bright, flat, friendly: a violet illustrated sky meeting white clouds,
   Poppins type with light + bold headline pairs, and pill-shaped buttons. */

:root {
  --violet: #5b34d1;         /* hero sky, page headers, primary buttons */
  --violet-2: #7651e6;
  --violet-3: #9b80f3;
  --violet-ink: #4a27bd;     /* violet text on light backgrounds */
  --lavender: #f4f0ff;       /* soft section and chip background */
  --cloud: #ffffff;          /* the white cloud panels */
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #3d3b54;
  --muted: #72708a;
  --line: #e7e1f8;
  --yellow: #f7b731;
  --yellow-ink: #3a2300;
  --sky: #56c3ee;
  --green: #4f9d6b;
  --coral: #f0776b;
  --wa: #1f9d55;
  --shadow: 0 12px 30px rgba(74, 39, 189, .10);
  --shadow-sm: 0 4px 14px rgba(74, 39, 189, .08);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --violet: #4a28b8; --violet-ink: #b9a6ff; --lavender: #1d1739; --cloud: #141027; --bg: #141027; --surface: #1f1940;
    --text: #ece9ff; --muted: #a8a2cc; --line: #2e2659; --wa: #4cd083;
    --shadow: 0 12px 30px rgba(0, 0, 0, .35); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --violet: #4a28b8; --violet-ink: #b9a6ff; --lavender: #1d1739; --cloud: #141027; --bg: #141027; --surface: #1f1940;
  --text: #ece9ff; --muted: #a8a2cc; --line: #2e2659; --wa: #4cd083;
  --shadow: 0 12px 30px rgba(0, 0, 0, .35); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .3); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); font: 400 1rem/1.65 var(--font); -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: var(--violet-ink); }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; color: var(--text); font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* ---------- header: sits over the violet sky ---------- */
.site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 84px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.15rem; }
.brand img { width: 36px; height: 36px; border-radius: 11px; box-shadow: 0 0 0 2px #fff; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav a {
  color: #fff; text-decoration: none; font-size: .8rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  padding: 8px 12px; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: #fff; }
.theme-btn {
  width: 40px; height: 40px; margin-left: 6px; display: grid; place-items: center; cursor: pointer;
  border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); color: #fff;
}
.theme-btn:hover { background: rgba(255, 255, 255, .18); }
.theme-btn svg { width: 18px; height: 18px; }
@media (min-width: 861px) {
  body[data-page="home"] .brand { color: var(--text); }   /* brand stands on the white cloud on wide screens */
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px;
  border-radius: 999px; border: 2px solid var(--violet); background: var(--violet); color: #fff;
  font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(91, 52, 209, .28); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-line { background: transparent; color: var(--violet-ink); border-color: var(--line); }
.btn-line:hover { border-color: var(--violet-ink); box-shadow: none; }
.btn-sm { padding: 8px 16px; font-size: .88rem; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-cta { background: var(--yellow); border-color: var(--yellow); color: var(--yellow-ink); padding: 14px 32px; font-size: 1rem; box-shadow: 0 10px 22px rgba(247, 183, 49, .38); }
.btn-cta:hover { box-shadow: 0 12px 26px rgba(247, 183, 49, .5); }
.btn .wa-icon { color: var(--wa); }
.btn-white { background: #fff; border-color: #fff; color: var(--violet-ink); }
.btn-ghost-white { background: transparent; border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn-ghost-white .wa-icon { color: #fff; }

/* ---------- search pill ---------- */
.find {
  display: flex; align-items: center; gap: 10px; max-width: 460px; padding: 6px 6px 6px 18px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm);
}
.find:focus-within { border-color: var(--violet-3); }
.find svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.find input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 8px 0; font-size: .95rem; }
.find input::placeholder { color: var(--muted); }

/* ---------- home hero: violet sky + white cloud ---------- */
.hero { position: relative; overflow: hidden; background: var(--violet); display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); min-height: 600px; }
.hero-panel { position: relative; background: var(--cloud); display: flex; align-items: center; }
.hero-copy {
  position: relative; z-index: 2; width: 100%; max-width: 640px; margin-left: auto;
  padding: 130px 24px 90px max(24px, calc((100vw - var(--max)) / 2 + 24px));
}
.hero h1 { font-size: clamp(2.2rem, 4vw, 3.3rem); letter-spacing: -.01em; line-height: 1.12; }
.hero h1 .light { display: block; font-weight: 300; }
.hero h1 .bold { display: block; font-weight: 700; }
.hero .lead { margin-top: 18px; color: var(--muted); max-width: 36ch; }
.hero .cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 30px; }
.hero .find { margin-top: 26px; }
.bump { position: absolute; z-index: 1; border-radius: 50%; background: var(--cloud); }
.b1 { width: 280px; height: 280px; right: -140px; top: -90px; }
.b2 { width: 210px; height: 210px; right: -95px; top: 150px; }
.b3 { width: 320px; height: 320px; right: -170px; top: 300px; }
.b4 { width: 200px; height: 200px; right: -70px; bottom: -80px; }
.hero-art { position: relative; display: flex; align-items: center; justify-content: flex-end; padding: 96px 0 24px 70px; }
.hero-art img { width: 100%; height: auto; max-width: 700px; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-art { order: -1; padding: 84px 0 0; justify-content: center; }
  .hero-art img { max-width: 520px; }
  .hero-copy { max-width: none; margin: 0; padding: 40px 16px 56px; }
  .b1 { width: 170px; height: 170px; left: -40px; right: auto; top: -70px; }
  .b2 { width: 130px; height: 130px; left: 90px; right: auto; top: -45px; }
  .b3 { width: 190px; height: 190px; left: auto; right: -30px; top: -80px; }
  .b4 { width: 120px; height: 120px; left: auto; right: 120px; top: -40px; bottom: auto; }
}

/* ---------- sections ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--lavender); }
.section h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 28px; }
.section h2 .light { font-weight: 300; }
@media (max-width: 640px) { .section { padding: 52px 0; } }

/* ---------- class cards ---------- */
.class-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
@media (max-width: 960px) { .class-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .class-grid { grid-template-columns: 1fr 1fr; gap: 12px; } }
.class-card {
  --c: var(--violet); --c-ink: #fff;
  display: flex; flex-direction: column; gap: 14px; padding: 20px; text-decoration: none; color: var(--text);
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); border: 1.5px solid transparent;
  transition: transform .15s ease, border-color .15s ease;
}
.class-card:hover { transform: translateY(-3px); border-color: var(--c); }
.class-card .badge {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); color: var(--c-ink); font-weight: 700; font-size: 1.35rem;
}
.class-card h3 { font-size: 1.05rem; }
.class-card .count { font-size: .88rem; color: var(--muted); margin-top: 2px; }
.class-card.is-empty .badge { background: var(--lavender); color: var(--muted); }

/* ---------- assignment list ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.list li {
  display: flex; align-items: center; gap: 12px 20px; padding: 16px 18px 16px 20px;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-sm);
}
.list .t { flex: 1; min-width: 0; }
.list .t a { font-weight: 600; color: var(--text); text-decoration: none; }
.list .t a:hover { color: var(--violet-ink); }
.list .m { display: block; color: var(--muted); font-size: .86rem; margin-top: 2px; }
.list .acts { display: flex; gap: 8px; flex: none; }
@media (max-width: 560px) {
  .list li { flex-wrap: wrap; }
  .list .acts { width: 100%; }
  .list .acts .btn { flex: 1; }
  .wide { display: none; }
}
.new {
  display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px; vertical-align: 2px;
  background: var(--coral); color: #fff; font-size: .7rem; font-weight: 600; letter-spacing: .02em;
}

/* ---------- page header band (class & assignment pages) ---------- */
.page-head { position: relative; background: var(--violet); color: #fff; padding: 112px 0 76px; overflow: hidden; }
.page-head .scallop { position: absolute; left: 0; bottom: -1px; width: 100%; height: 36px; fill: var(--bg); }
.page-head .deco { position: absolute; right: -40px; top: 40px; width: 360px; opacity: .9; pointer-events: none; }
@media (max-width: 760px) { .page-head .deco { display: none; } }
.page-head h1 { color: #fff; font-size: clamp(2rem, 4.4vw, 3rem); max-width: 22ch; }
.page-head h1 .light { font-weight: 300; }
.page-head p { color: rgba(255, 255, 255, .82); margin-top: 8px; }
.crumbs { font-size: .85rem; color: rgba(255, 255, 255, .75); margin-bottom: 12px; }
.crumbs a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .45); }
.crumbs span[aria-hidden] { margin: 0 8px; }
.page-body { padding-top: 36px; padding-bottom: 72px; }

/* subject tabs as pills */
.filters { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.filters:empty { display: none; }
.filters .find { flex: 0 1 320px; }
@media (max-width: 560px) { .filters .find { flex: 1 1 100%; } }
.subject-tabs { display: flex; gap: 10px; margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; }
.subject-tabs::-webkit-scrollbar { display: none; }
.subject-tabs:empty { display: none; }
.subject-tabs button {
  flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; cursor: pointer;
  border-radius: 999px; border: 0; background: var(--lavender); color: var(--violet-ink); font-weight: 600; font-size: .92rem;
}
.subject-tabs button:hover { box-shadow: inset 0 0 0 1.5px var(--violet-3); }
.subject-tabs button[aria-selected="true"] { background: var(--violet); color: #fff; box-shadow: 0 6px 14px rgba(91, 52, 209, .3); }
.subject-tabs .c {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--surface); color: var(--violet-ink); font-size: .74rem; font-weight: 600;
}
.subject-tabs button[aria-selected="true"] .c { background: rgba(255, 255, 255, .22); color: #fff; }

.empty { padding: 28px; border-radius: 20px; background: var(--lavender); max-width: 560px; }
.empty h3 { font-size: 1.2rem; margin-bottom: 6px; }
.empty p { color: var(--muted); }
.empty .btn { margin-top: 16px; }

/* ---------- assignment view ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
@media (max-width: 560px) { .actions .btn { flex: 1; } }
.viewer { background: var(--lavender); border-radius: 22px; padding: 18px; display: grid; gap: 16px; justify-items: center; min-height: 240px; }
.viewer canvas { display: block; width: 100%; max-width: 900px; height: auto; background: #fff; border-radius: 6px; box-shadow: var(--shadow-sm); }
.viewer .status { align-self: center; color: var(--muted); text-align: center; max-width: 40ch; }
@media (max-width: 560px) { .viewer { padding: 8px; border-radius: 16px; gap: 8px; } }

/* ---------- footer ---------- */
.site-footer { background: var(--lavender); color: var(--muted); font-size: .9rem; padding: 28px 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.site-footer a { color: var(--violet-ink); }

.skip { position: absolute; left: -999px; top: 8px; z-index: 30; background: var(--yellow); color: var(--yellow-ink); padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 560px) {
  .nav .nav-home { display: none; }   /* the logo already links home */
  .brand { font-size: 1.05rem; }
}
