/* Prepnol — Material 3 tokens & base */

/* Fonts — variable woff2, weights 400–900 */
@font-face {
  font-family: Roboto;
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/roboto-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Noto Serif Bengali";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/noto-serif-bengali.woff2") format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+200C-200D, U+20B9, U+25CC;
}

:root {
  color-scheme: light;

  /* Color — M3 scheme generated from seed #1e6b54 with
     @material/material-color-utilities; primary kept as the exact brand hex */
  --md-sys-color-primary: #1e6b54;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #82f8cf;
  --md-sys-color-on-primary-container: #002117;
  --md-sys-color-secondary-container: #cee9dc;
  --md-sys-color-on-secondary-container: #082018;
  --md-sys-color-surface: #fbfdf9;
  --md-sys-color-on-surface: #191c1b;
  --md-sys-color-on-surface-variant: #404944;
  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f2f7f2;
  --md-sys-color-surface-container: #e6efe9;
  --md-sys-color-surface-container-high: #dbe9e0;
  --md-sys-color-outline-variant: #bfc9c3;

  /* Shape */
  --md-sys-shape-corner-full: 9999px;

  /* Layout */
  --gutter: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

[id] {
  scroll-margin-top: 56px; /* keep anchor targets clear of the sticky top bar */
}

body {
  margin: 0;
  padding-bottom: 68px; /* clears the fixed bottom nav */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: Roboto, "Noto Serif Bengali", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
}

/* Top app bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 var(--gutter);
  background: var(--md-sys-color-surface);
  transition: background-color 200ms cubic-bezier(0.2, 0, 0, 1);
}

.scrolled .topbar {
  background: var(--md-sys-color-surface-container);
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.25px;
  color: var(--md-sys-color-primary);
  text-decoration: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font: inherit;
  font-weight: 500;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

/* Hero */
.hero {
  margin: 4px var(--gutter) 0;
  padding: 28px 20px 24px;
  border-radius: 28px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.hero small {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--md-sys-color-primary-container);
}

.hero h1 {
  margin: 12px 0 8px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
}

.hero p {
  margin: 0;
  max-width: 36ch;
  font-size: 14px;
  line-height: 1.55;
  color: rgb(255 255 255 / 0.86);
}

.hero .btn {
  margin-top: 20px;
  height: 44px;
  padding: 0 24px;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.hero > * {
  animation: rise 500ms cubic-bezier(0.05, 0.7, 0.1, 1) backwards;
}

.hero small { animation-delay: 60ms; }
.hero h1 { animation-delay: 120ms; }
.hero p { animation-delay: 180ms; }
.hero .btn { animation-delay: 240ms; }

/* Sections — shared header rhythm */
section {
  padding: 20px var(--gutter);
}

section h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.15px;
}

section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

hgroup {
  margin: 0;
}

hgroup p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
}

section header a {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  text-decoration: none;
}

section header a:hover {
  text-decoration: underline;
}

section header a:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}


/* Class picker */

.classes ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}

/* Board-exam years (10 and 12) get a wider card, only when the
   auto-fill grid resolves to exactly 3 columns (344–455px viewport) */
@media (min-width: 344px) and (max-width: 455.98px) {
  .classes li:nth-child(5),
  .classes li:nth-child(7) {
    grid-column: span 2;
  }
}

.classes a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 84px;
  border-radius: 16px;
  background: var(--md-sys-color-surface-container);
  text-decoration: none;
  transition: background-color 150ms cubic-bezier(0.2, 0, 0, 1),
    transform 150ms cubic-bezier(0.2, 0, 0, 1);
}

.classes a:hover {
  background: var(--md-sys-color-surface-container-high);
}

/* Tonal fill marks the board-exam years */
.classes li:nth-child(5) a,
.classes li:nth-child(7) a {
  background: var(--md-sys-color-secondary-container);
}

.classes li:nth-child(5) small,
.classes li:nth-child(7) small {
  color: var(--md-sys-color-on-secondary-container);
}

.classes li:nth-child(5) a:hover,
.classes li:nth-child(7) a:hover {
  background: var(--md-sys-color-primary-container);
}

.classes b {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--md-sys-color-primary);
}

.classes small {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
}

.classes a:active {
  background: var(--md-sys-color-primary-container);
  transform: scale(0.97);
}

.classes a:active b {
  color: var(--md-sys-color-on-primary-container);
}

.classes a:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

/* Featured notes */
.notes ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.notes li {
  border-radius: 20px;
  background: var(--md-sys-color-surface-container-low);
  overflow: hidden;
}

.notes a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  text-decoration: none;
  transition: background-color 150ms cubic-bezier(0.2, 0, 0, 1);
}

.notes a:hover {
  background: var(--md-sys-color-surface-container);
}

.notes a:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: -2px;
}

.notes img {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 2px;
}

.notes h3 {
  margin: 0;
  padding-left: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.notes data {
  padding-right: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
}

/* About */
.about b {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 600;
  color: var(--md-sys-color-primary);
}

.about p {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--md-sys-color-on-surface-variant);
  max-width: 60ch;
}

/* Footer */
footer {
  padding: 20px var(--gutter) 32px;
  background: var(--md-sys-color-surface-container);
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

footer a {
  font-size: 13px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
}

footer a:hover {
  color: var(--md-sys-color-primary);
  text-decoration: underline;
}

footer a:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

footer small {
  display: block;
  margin-top: 16px;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}

/* Bottom navigation bar */
.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--md-sys-color-surface-container);
}

.bottomnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.25px;
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
}

.bottomnav svg {
  width: 54px;
  height: 28px;
  padding: 3px 16px;
  border-radius: var(--md-sys-shape-corner-full);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: background-color 150ms cubic-bezier(0.2, 0, 0, 1);
}

/* M3 state layers: 8% hover, 10% press over on-surface */
.bottomnav a:hover svg {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}

.bottomnav a:active svg {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);
}

.bottomnav a[aria-current] {
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.bottomnav a[aria-current] svg {
  background: var(--md-sys-color-secondary-container);
  stroke: var(--md-sys-color-on-secondary-container);
}

.bottomnav a[aria-current]:hover svg {
  background: color-mix(in srgb, var(--md-sys-color-on-secondary-container) 8%, var(--md-sys-color-secondary-container));
}

.bottomnav a:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: -2px;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero > * {
    animation: none;
  }

  .classes a {
    transition: none;
  }

  .classes a:active {
    transform: none;
  }
}
