/* Admission Tracker Calendar - hulkenstein.study
   Phone first: every rule below is written for a 375px screen and only widens
   at the breakpoints near the bottom. Most visitors are on a phone. */

:root {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #eef2ef;
  --ink: #12211a;
  --ink-2: #4d6058;
  --ink-3: #74867e;
  --line: #d9e2dc;
  --brand: #1f7a4d;
  --brand-ink: #ffffff;
  --brand-soft: #e3f2ea;
  --accent: #b8860b;
  --danger: #a8443a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 33, 26, .06), 0 8px 24px rgba(18, 33, 26, .06);
}

:root:not([data-theme="light"]) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1411;
    --surface: #141d19;
    --surface-2: #1b2621;
    --ink: #e8f0ea;
    --ink-2: #a8bcb1;
    --ink-3: #7d9187;
    --line: #26332c;
    --brand: #35a96c;
    --brand-ink: #06100b;
    --brand-soft: #14291e;
    --accent: #d4a53a;
    --danger: #e0796c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d1411;
  --surface: #141d19;
  --surface-2: #1b2621;
  --ink: #e8f0ea;
  --ink-2: #a8bcb1;
  --ink-3: #7d9187;
  --line: #26332c;
  --brand: #35a96c;
  --brand-ink: #06100b;
  --brand-soft: #14291e;
  --accent: #d4a53a;
  --danger: #e0796c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  /* Bengali needs a real face on Windows, Android/ChromeOS and Linux. Fallback
     is per-glyph, so Latin still renders in the system UI font. No webfont is
     downloaded. */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto,
    "Noto Sans Bengali", "Hind Siliguri", "Nirmala UI", "Shonar Bangla", Vrinda,
    sans-serif;
  line-height: 1.55;
  padding:
    env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.wrap { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 14px; }

/* ---------- header ---------- */

header {
  background: var(--brand);
  color: var(--brand-ink);
  padding: 18px 0 20px;
}
header .wrap { display: flex; flex-direction: column; gap: 4px; }
.hub-link {
  color: var(--brand-ink);
  opacity: .85;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  align-self: flex-start;
  padding: 6px 0;
  min-height: 24px;
}
.hub-link:hover, .hub-link:focus-visible { opacity: 1; text-decoration: underline; }
h1 { margin: 2px 0 0; font-size: 21px; line-height: 1.25; font-weight: 700; }
.session { font-size: 14px; opacity: .9; }

/* ---------- controls ---------- */

.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 10px;
}
.month-name { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }
.navbtn {
  min-width: 44px; min-height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 12px;
  font-size: 18px;
  cursor: pointer;
}
.navbtn:disabled { opacity: .35; cursor: default; }
.navbtn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- calendar grid ---------- */

.dow, .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow { margin-bottom: 4px; }
.dow span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.day {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 44px;            /* touch target */
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 11px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  cursor: default;
}
.day.blank { border: 0; background: transparent; }
.day.has-exam {
  cursor: pointer;
  border-color: var(--brand);
  background: var(--brand-soft);
  font-weight: 700;
}
.day.has-exam:hover { border-width: 2px; }
.day:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.day.today { box-shadow: inset 0 0 0 2px var(--accent); }

.dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.day .count {
  font-size: 10px;
  font-weight: 700;
  color: var(--brand);
}

/* ---------- legend + notice ---------- */

.legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin: 14px 0 0; font-size: 12px; color: var(--ink-2);
}
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
.legend .k-exam { background: var(--brand-soft); border: 1px solid var(--brand); }
.legend .k-today { background: transparent; border: 2px solid var(--accent); }

.notice {
  margin: 16px 0 24px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-2);
}
.notice strong { color: var(--ink); }

/* ---------- upcoming list ---------- */

h2 { font-size: 16px; margin: 22px 0 10px; }
.upcoming { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 8px; }
.upcoming li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
}
.upcoming button {
  width: 100%;
  min-height: 44px;
  display: flex; align-items: center; gap: 12px;
  background: none; border: 0; color: inherit; font: inherit;
  padding: 11px 13px; text-align: left; cursor: pointer;
  border-radius: var(--radius);
}
.upcoming button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.datechip {
  flex: 0 0 auto;
  min-width: 52px;
  text-align: center;
  background: var(--brand-soft);
  border: 1px solid var(--brand);
  border-radius: 10px;
  padding: 5px 6px;
  line-height: 1.1;
}
.datechip b { display: block; font-size: 17px; }
.datechip span { font-size: 10px; color: var(--ink-2); }
.uni { font-weight: 700; font-size: 14px; }
.unit { font-size: 13px; color: var(--ink-2); }
.days-left { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }

/* ---------- sheet ---------- */

.scrim {
  position: fixed; inset: 0;
  background: rgba(8, 16, 12, .5);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
  z-index: 40;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow);
  max-height: 86vh;
  overflow-y: auto;
  transform: translateY(101%);
  transition: transform .22s ease;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.sheet.open { transform: translateY(0); }
.sheet-head {
  position: sticky; top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px 12px;
  display: flex; align-items: flex-start; gap: 10px;
}
.sheet-head h3 { margin: 0; font-size: 16px; flex: 1; }
.closebtn {
  min-width: 44px; min-height: 44px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); border-radius: 12px; font-size: 17px; cursor: pointer;
}
.closebtn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sheet-body { padding: 4px 16px 8px; }

.exam-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
  margin: 12px 0;
  background: var(--surface-2);
}
.exam-card .uni { font-size: 15px; }
.meta { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.meta b { color: var(--ink); font-weight: 600; }

.promo { margin-top: 11px; display: grid; gap: 8px; }
.promo a {
  display: block;
  background: var(--brand);
  color: var(--brand-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 14px;
  min-height: 44px;
  border-radius: 12px;
  text-align: center;
}
.promo a:hover { filter: brightness(1.06); }
.promo a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.promo .kind { display: block; font-size: 11px; font-weight: 600; opacity: .85; }
.promo .pitch { font-size: 12.5px; color: var(--ink-2); }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 18px 0 26px;
  font-size: 12.5px;
  color: var(--ink-3);
}
footer a { color: var(--brand); }

/* ---------- wider screens ---------- */

@media (min-width: 560px) {
  h1 { font-size: 25px; }
  .day { font-size: 15px; }
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(560px, 92vw);
    transform: translate(-50%, -46%) scale(.98);
    border-radius: 18px;
    opacity: 0;
    transition: opacity .16s ease, transform .16s ease;
  }
  .sheet.open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@media (min-width: 860px) {
  .day { font-size: 16px; }
  h1 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .scrim { transition: none; }
}

.coupon {
  margin-top: 2px;
  padding: 9px 11px;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: center;
  line-height: 1.5;
}
