/* Teaching page — light motion (tobiaswidmann.eu) */
:root {
  --tw-navy: #010048; --tw-navy-soft: #eef0fb; --tw-pink: #e64980; --tw-pink-soft: #fdeef4;
  --tw-ink: #111827; --tw-ink-2: #374151; --tw-muted: #6b7280; --tw-line: #e5e7eb; --tw-bg-soft: #f8f9fb;
  --c-methods: #010048; --c-comm: #e64980;
}
.tw-teach { color: var(--tw-ink); }
.tw-teach *, .tw-teach *::before, .tw-teach *::after { box-sizing: border-box; }
.tw-tlead { font-size: 1.05rem; color: var(--tw-ink-2); max-width: 70ch; margin: 0 0 1.25rem; animation: tw-fade-up .6s ease both; }
@keyframes tw-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.tw-teach .tw-label {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--tw-muted); margin: 0 0 0.8rem;
}
.tw-teach .tw-label::after { content: ""; flex: 1; height: 1px; background: var(--tw-line); }

/* reveal (fail-safe) */
.tw-teach.tw-js .tw-reveal { opacity: 0; transform: translateY(12px); transition: opacity .55s ease, transform .55s ease; }
.tw-teach.tw-js .tw-reveal.is-in { opacity: 1; transform: none; }

/* term grid */
.tw-tgrid-wrap { margin: 0 0 1rem; }
.tw-tgrid-scroll { overflow-x: auto; }
.tw-tgrid { display: grid; grid-template-columns: 270px repeat(var(--years, 7), 1fr); min-width: 600px; font-size: 0.82rem; border-top: 1px solid var(--tw-line); }
.tw-tgrid .th { padding: 0.45rem 0.3rem; text-align: center; font-weight: 600; color: var(--tw-muted); font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--tw-line); }
.tw-tgrid .th.is-label { text-align: left; padding-left: 0.4rem; }
.tw-tgrid .rl {
  padding: 0.42rem 0.4rem; border-bottom: 1px solid var(--tw-line); color: var(--tw-navy); font-weight: 500; cursor: pointer;
  line-height: 1.25; display: flex; align-items: center; gap: 0.4rem; transition: background .15s ease;
}
.tw-tgrid .rl span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tw-tgrid .rl::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--c); flex: none; }
.tw-tgrid .rl small { color: var(--tw-muted); font-weight: 400; }
.tw-tgrid .cell { position: relative; border-bottom: 1px solid var(--tw-line); border-left: 1px dashed #eef0f3; min-height: 34px; }
.tw-tgrid .row-hot .rl, .tw-tgrid .row-hot .cell { background: var(--tw-bg-soft); }
.tw-dot {
  position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: var(--c);
  transform: translate(-50%, -50%) scale(0); box-shadow: 0 0 0 2px #fff;
  transition: transform .35s cubic-bezier(.2,.9,.3,1.3);
  transition-delay: calc(var(--k, 0) * 45ms);
  cursor: default;
}
.tw-tgrid.is-in .tw-dot { transform: translate(-50%, -50%) scale(1); }
.tw-tgrid.is-in .row-hot .tw-dot { transform: translate(-50%, -50%) scale(1.35); }
.tw-tgrid .cell.is-now { background: linear-gradient(to bottom, rgba(230, 73, 128, 0.05), rgba(230, 73, 128, 0.05)); }
.tw-tlegend { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; margin: 0.6rem 0 0; padding: 0; list-style: none; font-size: 0.78rem; color: var(--tw-ink-2); }
.tw-tlegend li { display: inline-flex; align-items: center; gap: 0.35rem; }
.tw-tlegend li.is-methods::before, .tw-tlegend li.is-comm::before { content: ""; width: 9px; height: 9px; border-radius: 50%; }
.tw-tlegend li.is-methods::before { background: var(--c-methods); }
.tw-tlegend li.is-comm::before { background: var(--c-comm); }
.tw-tlegend li.is-note { color: var(--tw-muted); }
.tw-ttip {
  position: absolute; z-index: 5; pointer-events: none; background: var(--tw-navy); color: #fff; font-size: 12px;
  padding: 0.3rem 0.5rem; border-radius: 7px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -9px;
  opacity: 0; transition: opacity .12s ease;
}
.tw-ttip.is-on { opacity: 1; }

/* course cards */
.tw-courses { display: grid; gap: 0.8rem; }
.tw-course {
  position: relative; background: #fff; border: 1px solid var(--tw-line); border-radius: 12px; padding: 1rem 1.15rem 0.9rem 1.3rem;
  overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tw-course::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.tw-course.is-methods { --c: var(--c-methods); }
.tw-course.is-comm { --c: var(--c-comm); }
.tw-course:hover, .tw-course.is-hot { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(1, 0, 72, 0.08); border-color: color-mix(in srgb, var(--c) 40%, var(--tw-line)); }
.tw-course-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.2rem 1rem; }
.tw-course-head h3 { margin: 0; font-size: 1.08rem; color: var(--tw-navy); }
.tw-course-meta { font-size: 0.8rem; color: var(--tw-muted); }
.tw-course-desc { margin: 0.4rem 0 0.6rem; color: var(--tw-ink-2); font-size: 0.93rem; max-width: 78ch; }
.tw-course-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem; }
.tw-terms, .tw-syl { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tw-terms li { font-size: 0.74rem; font-weight: 600; padding: 0.22rem 0.55rem; border-radius: 999px; background: color-mix(in srgb, var(--c) 9%, white); color: var(--c); }
.tw-syl a {
  display: inline-block; font-size: 0.8rem; font-weight: 500; padding: 0.3rem 0.7rem; border-radius: 8px;
  border: 1px solid var(--tw-line); color: var(--tw-navy); background: #fff; text-decoration: none; transition: background .15s ease, border-color .15s ease;
}
.tw-syl a:hover, .tw-syl a:focus { background: var(--tw-navy-soft); border-color: var(--tw-navy); text-decoration: none; }
@supports not (color: color-mix(in srgb, red 10%, white)) {
  .tw-terms li { background: var(--tw-bg-soft); }
}

@media (max-width: 640px) {
  .tw-tgrid { grid-template-columns: 118px repeat(var(--years, 7), 1fr); min-width: 0; font-size: 0.72rem; }
  .tw-tgrid .rl { padding-left: 0.2rem; padding-right: 0.2rem; }
  .tw-tgrid .th { padding-left: 0.1rem; padding-right: 0.1rem; font-size: 0.68rem; }
  .tw-dot { width: 9px; height: 9px; }
  .tw-course-head { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .tw-tlead { animation: none; }
  .tw-teach.tw-js .tw-reveal { opacity: 1; transform: none; transition: none; }
  .tw-dot { transition: none; transform: translate(-50%, -50%) scale(1); }
  .tw-course, .tw-course:hover { transition: none; transform: none; }
}
