/* ── Sarabun (self-hosted — drop the .woff2 files in assets/fonts/) ──
   Files expected:
     assets/fonts/Sarabun-Regular.woff2
     assets/fonts/Sarabun-Medium.woff2
     assets/fonts/Sarabun-SemiBold.woff2
     assets/fonts/Sarabun-Bold.woff2
     assets/fonts/Sarabun-Italic.woff2
   If they are absent the stack falls back to Leelawadee UI / system Thai. */

@font-face {
  font-family: "Sarabun";
  src: url("../assets/fonts/Sarabun-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sarabun";
  src: url("../assets/fonts/Sarabun-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Sarabun";
  src: url("../assets/fonts/Sarabun-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sarabun";
  src: url("../assets/fonts/Sarabun-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sarabun";
  src: url("../assets/fonts/Sarabun-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Art & Technology — student course site
   Theme: "alpine daylight" — pale blue field, floating white cards,
   serif display, one warm coral accent.
   Thai-primary · mobile-first · static deploy · no CDN fonts */

:root {
  --bg: #dfe9ef;
  --bg-2: #eef4f7;
  --surface-1: #ffffff;
  --surface-2: #f3f8fa;
  --surface-3: #e8f0f5;
  --line: #dde8ee;
  --line-strong: #c6d6e0;
  --text: #17252f;
  --text-soft: #33454f;
  --muted: #6b7f8c;
  --action: #ea5a38;
  --action-soft: #fdece7;
  --action-dark: #cf4527;
  --ink-blue: #3f6f8d;
  --brass: #b98432;
  --milestone: #ea5a38;
  --success: #3d9a6d;
  --warn: #c68a24;
  --danger: #ea5a38;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-sm: 12px;
  --font: "Sarabun", "Leelawadee UI", "Noto Sans Thai", "Segoe UI", Tahoma, sans-serif;
  --display: "Sarabun", "Leelawadee UI", Georgia, "Times New Roman", serif;
  --mono: "Cascadia Mono", "IBM Plex Mono", Consolas, monospace;
  --max: 760px;
  --max-wide: 1180px;
  --shadow-sm: 0 2px 8px -4px rgba(23, 37, 47, 0.18);
  --shadow: 0 18px 44px -28px rgba(23, 37, 47, 0.45);
  --shadow-lg: 0 32px 70px -40px rgba(23, 37, 47, 0.55);
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px var(--action);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-1: 0.2s;
  --dur-2: 0.4s;
  --dur-3: 0.7s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 6rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.06rem;
  line-height: 1.72;
  color: var(--text);
  background: var(--bg);
  background-image: linear-gradient(180deg, #d6e4ec 0%, var(--bg-2) 55%, #f6fafb 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ink-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--action);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100px;
  z-index: 100;
  background: var(--action);
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

/* ── Header: floating white bar ─────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.6rem 0 0;
  background: transparent;
  border: none;
}

.header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0.6rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  margin-left: max(1rem, env(safe-area-inset-left));
  margin-right: max(1rem, env(safe-area-inset-right));
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  text-decoration: none;
  color: var(--text);
  min-height: 44px;
  min-width: 0;
  flex: 0 1 auto;
  justify-content: center;
}

.brand strong {
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.brand span {
  font-size: 0.73rem;
  color: var(--muted);
  font-family: var(--display);
  letter-spacing: 0.01em;
}

.brand strong,
.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  flex: 0 0 auto;
  background: var(--text);
  border: none;
  color: #fff;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  min-height: 44px;
  min-width: 44px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  align-items: center;
}

.nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.7rem;
  min-height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-3);
}

.nav a[aria-current="page"] {
  color: #fff;
  background: var(--text);
  font-weight: 600;
}

.nav a[aria-current="page"]:hover {
  color: #fff;
  background: var(--text);
}

.main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.25rem max(1.25rem, env(safe-area-inset-left)) 4.5rem;
}

.main-wide {
  max-width: var(--max-wide);
}

.site-footer {
  max-width: var(--max-wide);
  margin: 0 auto;
  border-top: 1px solid var(--line-strong);
  padding: 2rem max(1.25rem, env(safe-area-inset-left))
    max(2.5rem, calc(1.5rem + env(safe-area-inset-bottom)));
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.site-footer p {
  margin: 0 0 0.4rem;
}

.site-footer .footer-note {
  font-size: 0.82rem;
  opacity: 0.9;
}

/* ── Typography ─────────────────────────────────────── */
h1,
h2,
h3,
h4 {
  line-height: 1.28;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--text);
  text-wrap: pretty;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.35rem;
  margin-top: 2.5rem;
  padding-bottom: 0;
  border: none;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.08rem;
  margin-top: 1.35rem;
  color: var(--text);
}

h4 {
  font-size: 0.95rem;
  margin-top: 1rem;
  color: var(--muted);
  font-weight: 700;
}

p {
  margin: 0 0 1rem;
}

.lead {
  font-size: 1.12rem;
  color: var(--text-soft);
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.mono {
  font-family: var(--mono);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--action);
  background: var(--action-soft);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

/* ── Hero ───────────────────────────────────────────── */
.hero {
  position: relative;
  background: var(--surface-1);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-video {
  position: relative;
  min-height: 420px;
  padding: 0;
  display: flex;
  align-items: center;
}

@media (prefers-reduced-motion: reduce) {
  .hero-media video {
    display: none;
  }
  .hero-media {
    background: center / cover no-repeat url("../assets/hero-still.jpg");
  }
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media video,
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* light scrim — the reference reads as daylight, not night */
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
      100deg,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(255, 255, 255, 0.92) 34%,
      rgba(240, 247, 250, 0.58) 68%,
      rgba(214, 231, 240, 0.42) 100%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 2.75rem 2.25rem;
  max-width: 40rem;
}

.hero h1 {
  margin-bottom: 0.65rem;
}

.hero h1 span {
  font-family: var(--display);
  font-weight: 500 !important;
  font-style: italic;
  letter-spacing: 0;
  letter-spacing: -0.01em;
  color: var(--muted) !important;
}

.hero-institution {
  max-width: 42rem;
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.hero-code {
  color: var(--action);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.hero-meta {
  max-width: 38rem;
}

.hero-meta .meta {
  margin-bottom: 0.45rem;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 0 0 0.8rem;
  padding: 0;
}

.hero-facts li {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.32rem 0.72rem;
  border: 1px solid rgba(23, 37, 47, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.25;
  box-shadow: 0 4px 14px -10px rgba(23, 37, 47, 0.42);
}

.principle {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 1.08rem;
  margin-bottom: 0.85rem;
  max-width: 32rem;
}

/* ── Buttons ────────────────────────────────────────── */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.35rem;
}

.btn-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.35rem;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1),
    box-shadow var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
  background: transparent;
  color: var(--text);
}

.btn-primary {
  background: var(--action);
  color: #fff;
  box-shadow: 0 10px 24px -14px rgba(234, 90, 56, 0.9);
}

.btn-primary:hover {
  background: var(--action-dark);
  color: #fff;
}

.btn-ghost {
  background: var(--surface-1);
  border-color: var(--line);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-danger-ghost {
  background: transparent;
  border-color: rgba(234, 90, 56, 0.4);
  color: var(--action);
  box-shadow: none;
}

.btn-submit {
  background: var(--action);
  color: #fff;
  box-shadow: 0 10px 24px -14px rgba(234, 90, 56, 0.9);
}

.btn-submit:hover {
  background: var(--action-dark);
  color: #fff;
}

.btn.copied {
  background: var(--success);
  color: #fff;
  border-color: transparent;
}

/* ── Cards ──────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .card-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
  }
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow-sm);
}

.card h3 {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
}

a.card.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color var(--dur-2), transform var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
}

a.card.card-link:hover {
  border-color: var(--line-strong);
  color: inherit;
  box-shadow: var(--shadow);
}

a.card.card-link:hover h3 {
  color: var(--action);
}

a.card.card-link:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}

/* ── Dashboard ──────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 800px) {
  .dash-grid {
    grid-template-columns: 1.25fr 1fr;
  }
  .dash-grid .dash-now {
    grid-row: span 2;
  }
}

.dash-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.dash-card h2 {
  margin-top: 0;
  border: none;
  padding: 0;
  font-size: 1.45rem;
}

.dash-now {
  border-color: rgba(234, 90, 56, 0.22);
  background: linear-gradient(165deg, #fff 55%, var(--action-soft));
  box-shadow: var(--shadow);
}

.dash-milestone {
  border-color: var(--line);
  background: linear-gradient(165deg, #fff 55%, var(--surface-3));
}

.milestone-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.milestone-list li {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.milestone-list a {
  text-decoration: none;
  color: var(--text);
  display: block;
  font-weight: 600;
}

.milestone-list a:hover {
  color: var(--action);
}

.milestone-list .meta {
  display: block;
  margin: 0.25rem 0 0;
}

.semester-arc h2 {
  margin-top: 0.5rem;
}

.arc-track {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1.25rem 0 2rem;
}

@media (min-width: 700px) {
  .arc-track {
    grid-template-columns: repeat(4, 1fr);
  }
}

.arc-step {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  border-top: none;
  position: relative;
}

.arc-label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.arc-weeks {
  display: block;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--action);
  font-weight: 600;
  margin: 0.2rem 0 0.45rem;
}

.arc-desc {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

.progress-panel {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.75rem 0;
  box-shadow: var(--shadow-sm);
}

.progress-panel h2 {
  margin-top: 0;
  border: none;
  padding: 0;
}

.date-status {
  font-size: 0.86rem;
}

/* ── Filters ────────────────────────────────────────── */
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.filter-chip {
  font-family: inherit;
  font-size: 0.86rem;
  padding: 0.45rem 0.95rem;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--text-soft);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.filter-chip[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}

.filter-chip:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.filter-count {
  margin: 0;
}

/* ── Week cards ─────────────────────────────────────── */
.week-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.week-card-wrap {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.55rem;
}

.week-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(234, 90, 56, 0.28);
  border-radius: 999px;
  background: var(--action-soft);
  color: var(--action-dark);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1), transform var(--dur-1) var(--ease-out);
}

.week-submit:hover {
  border-color: var(--action);
  background: var(--action);
  color: #fff;
  transform: translateY(-1px);
}

.week-submit:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}

@media (min-width: 560px) {
  .week-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .week-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.week-card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 11rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-2), transform var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
}

.week-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  color: inherit;
  box-shadow: var(--shadow);
}

.week-card:focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 2px;
}

.week-card .num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--action);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.week-card .date {
  font-size: 0.82rem;
  color: var(--muted);
}

.week-card h3 {
  margin: 0.2rem 0 0;
  font-size: 1.02rem;
  color: var(--text);
}

.week-card .week-deliv {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0.3rem 0 0;
  line-height: 1.5;
}

.week-card .week-status {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: 0.5rem;
}

.week-card.done {
  border-color: rgba(61, 154, 109, 0.45);
  background: linear-gradient(170deg, #fff 60%, rgba(61, 154, 109, 0.07));
}

.week-card.done .week-status {
  color: var(--success);
  font-weight: 600;
}

.week-card.done .num::after {
  content: " ✓";
  color: var(--success);
}

.week-card.type-build {
  border-left: 3px solid var(--brass);
}

.week-card.type-assessment,
.week-card.milestone {
  background: linear-gradient(170deg, #fff 55%, var(--action-soft));
  border-color: rgba(234, 90, 56, 0.28);
  border-left: 3px solid var(--milestone);
}

.week-card.milestone .num {
  color: var(--action);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 600;
}

.badge-type.badge-normal {
  border-color: rgba(63, 111, 141, 0.28);
  color: var(--ink-blue);
  background: #eef4f8;
}

.badge-type.badge-build {
  border-color: rgba(185, 132, 50, 0.35);
  color: var(--brass);
  background: #fbf4e6;
}

.badge-type.badge-assessment {
  border-color: rgba(234, 90, 56, 0.3);
  color: var(--action);
  background: var(--action-soft);
}

.badge-disclosure {
  border-color: rgba(61, 154, 109, 0.3);
  color: var(--success);
  background: #eaf6f0;
}

.badge-status.badge-primary {
  border-color: rgba(63, 111, 141, 0.3);
  color: var(--ink-blue);
  background: #eef4f8;
}

.badge-status.badge-optional {
  border-color: var(--line-strong);
  color: var(--muted);
}

.badge-status.badge-uncertain {
  border-color: rgba(185, 132, 50, 0.4);
  color: var(--brass);
  background: #fbf4e6;
}

/* ── Tags ───────────────────────────────────────────── */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0.5rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-soft);
  border: 1px solid transparent;
}

.tag.gold {
  background: var(--action-soft);
  color: var(--action);
  border-color: rgba(234, 90, 56, 0.2);
}

.tool-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
}

/* ── Action panel (week detail) ─────────────────────── */
.action-panel {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-left: 4px solid var(--action);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin: 1.5rem 0 1.75rem;
  box-shadow: var(--shadow-sm);
}

.homework-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.homework-submit .meta {
  flex: 1 1 18rem;
  margin: 0;
}

.action-panel h2 {
  margin-top: 0;
  border: none;
  padding: 0;
  font-size: 1.15rem;
}

.action-dl {
  margin: 0.85rem 0;
}

.action-dl > div {
  margin-bottom: 0.75rem;
}

.action-dl dt {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--action);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.action-dl dd {
  margin: 0.15rem 0 0;
}

.breadcrumb {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.breadcrumb a {
  text-decoration: none;
}

.callout-milestone {
  border-color: rgba(234, 90, 56, 0.3);
  background: var(--action-soft);
}

/* ── Long-form weekly chapter content ───────────────── */
.chapter-content {
  margin: 2.75rem 0 2rem;
  padding: clamp(1.15rem, 3vw, 2.5rem);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.chapter-kicker {
  margin: 0 0 1.5rem;
  color: var(--action);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chapter-content h1,
.chapter-content h2,
.chapter-content h3,
.chapter-content h4 {
  text-wrap: pretty;
}

.chapter-content h1 {
  margin-top: 0;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
}

.chapter-content h2 {
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.25rem, 2.6vw, 1.55rem);
}

.chapter-content h2.chapter-title {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
}

.chapter-content h3 {
  margin-top: 1.7rem;
  font-size: 1.08rem;
}

.chapter-content img {
  width: 100%;
  margin: 1.25rem 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.chapter-content table {
  width: 100%;
  margin: 1.1rem 0 1.5rem;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.chapter-content th,
.chapter-content td {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.chapter-content th {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 700;
}

.chapter-content blockquote {
  margin: 1.25rem 0;
  padding: 0.95rem 1.1rem;
  border-left: 4px solid var(--brass);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #fbf4e6;
  color: var(--text-soft);
}

.chapter-content blockquote p:last-child {
  margin-bottom: 0;
}

.chapter-content pre {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #17252f;
  color: #f3f8fa;
  font: 0.88rem/1.65 var(--mono);
  white-space: pre-wrap;
}

.chapter-content pre code {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.chapter-content .task-list {
  padding-left: 0;
  list-style: none;
}

.chapter-content .task-list li {
  margin-bottom: 0.55rem;
}

.chapter-content .task-list input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0 0.45rem 0 0;
  accent-color: var(--action);
  vertical-align: -0.1em;
}

.chapter-content hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* ── Week 2: local-AI lab cards ─────────────────────── */
.lesson-intro {
  max-width: 67ch;
  font-size: 1.08rem;
  color: var(--text-soft);
}

.lesson-rule {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(234, 90, 56, 0.32);
  border-left: 4px solid var(--action);
  border-radius: var(--radius-sm);
  background: var(--action-soft);
}

.lesson-rule p {
  margin: 0;
}

.teacher-demo {
  margin: 1.5rem 0;
  padding: 1.1rem;
  border: 1px solid rgba(63, 111, 141, 0.34);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #eef7fb, #fff);
}

.teacher-demo h3 {
  margin: 0.05rem 0 0.4rem;
}

.teacher-demo .copy-card:last-child {
  margin-bottom: 0;
}

.agent-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 0.65rem;
  margin: 1rem 0 1.35rem;
  overflow-x: auto;
  padding: 0.15rem 0.15rem 0.75rem;
  scroll-snap-type: inline mandatory;
}

.agent-flow article {
  min-width: 130px;
  scroll-snap-align: start;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.agent-flow span {
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font: 700 0.76rem var(--mono);
}

.agent-flow strong {
  display: block;
  margin-top: 0.55rem;
  color: var(--ink-blue);
  font-size: 0.88rem;
}

.agent-flow p {
  margin: 0.25rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.1rem 0 1.5rem;
}

.learning-card,
.copy-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 1rem;
}

.learning-card h3,
.copy-card h3 {
  margin: 0 0 0.38rem;
  font-size: 1rem;
}

.learning-card p:last-child,
.copy-card p:last-child {
  margin-bottom: 0;
}

.term-label,
.card-label {
  display: inline-block;
  margin-bottom: 0.4rem;
  color: var(--ink-blue);
  font-family: var(--mono);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.copy-card {
  margin: 1rem 0;
  padding: 0;
  overflow: hidden;
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
}

.copy-card.command-card {
  border-left: 4px solid var(--ink-blue);
}

.copy-card.prompt-card {
  border-left: 4px solid var(--brass);
}

.copy-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem 0.65rem;
}

.copy-card-top h3 {
  margin: 0.08rem 0 0;
}

.command-card .card-label {
  color: var(--ink-blue);
}

.prompt-card .card-label {
  color: #8b621e;
}

.copy-card-button {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  background: #fff;
  color: var(--text);
  font: 700 0.82rem var(--font);
  cursor: pointer;
}

.copy-card-button:hover {
  border-color: var(--action);
  color: var(--action-dark);
}

.copy-card pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: #17252f;
  color: #f3f8fa;
  font: 0.86rem/1.65 var(--mono);
  white-space: pre;
}

.prompt-card pre {
  background: #2b2924;
}

.copy-card .card-note {
  margin: 0;
  padding: 0.72rem 1rem 0.9rem;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.step-list {
  counter-reset: lab-step;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}

.step-list > li {
  position: relative;
  margin: 0 0 1rem;
  padding: 0.1rem 0 0 3.1rem;
}

.step-list > li::before {
  counter-increment: lab-step;
  content: counter(lab-step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.step-list h3 {
  margin: 0 0 0.25rem;
}

.model-rail {
  display: grid;
  grid-auto-columns: minmax(250px, 0.9fr);
  grid-auto-flow: column;
  grid-template-rows: 1fr;
  gap: 0.9rem;
  margin: 1rem calc(clamp(1.15rem, 3vw, 2.5rem) * -0.15) 1.45rem;
  padding: 0.15rem 0.25rem 0.9rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
}

.model-card {
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 1rem;
}

.model-card.recommended {
  border-color: rgba(61, 154, 109, 0.52);
  background: linear-gradient(150deg, #f5fcf8, var(--surface-1));
}

.model-card h3 {
  margin: 0.18rem 0 0.35rem;
  font-size: 1.04rem;
}

.model-meta {
  margin: 0.25rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.model-card .copy-card {
  margin: 0.8rem 0 0;
}

.model-card .copy-card pre {
  padding: 0.75rem;
  font-size: 0.77rem;
}

.model-card .copy-card-top {
  padding: 0.65rem 0.75rem 0.45rem;
}

.model-card .copy-card-button {
  min-height: 34px;
  padding: 0.3rem 0.6rem;
  font-size: 0.76rem;
}

.model-card .card-note {
  padding: 0.6rem 0.75rem 0.75rem;
  font-size: 0.82rem;
}

.comparison-table-wrap {
  margin: 1rem 0 1.4rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.comparison-table-wrap table {
  min-width: 680px;
  margin: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.1rem 0 1.5rem;
}

.project-grid .learning-card {
  background: var(--surface-1);
}

.check-panel {
  margin: 1rem 0;
  padding: 1.1rem;
  border-radius: var(--radius);
  background: #edf7f1;
  border: 1px solid rgba(61, 154, 109, 0.28);
}

.check-panel h3 {
  margin-top: 0;
}

.details-stack details {
  margin: 0.65rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.details-stack summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
}

.details-stack details > *:last-child {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .lesson-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .copy-card-top {
    align-items: center;
  }
}

@media (max-width: 560px) {
  .chapter-content {
    padding: 1rem;
    border-radius: var(--radius);
  }

  .chapter-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ── Lists & boxes ──────────────────────────────────── */
ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.4rem;
}

.check-list {
  list-style: none;
  padding-left: 0;
}

.check-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.6rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.85rem;
  height: 0.85rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface-1);
}

.callout {
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
  border: 1px solid var(--line);
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
}

.callout strong {
  display: block;
  margin-bottom: 0.35rem;
}

.callout-info {
  border-color: rgba(63, 111, 141, 0.25);
  background: #eef4f8;
}

.callout-warn {
  border-color: rgba(185, 132, 50, 0.3);
  background: #fbf4e6;
}

.callout-success {
  border-color: rgba(61, 154, 109, 0.3);
  background: #eaf6f0;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-1);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.table-wrap::after {
  content: "เลื่อนแนวนอนได้ →";
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.25rem 0.85rem 0.5rem;
}

@media (min-width: 640px) {
  .table-wrap::after {
    content: none;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.88em;
}

code {
  background: var(--surface-3);
  padding: 0.12em 0.45em;
  border-radius: 6px;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.prompt-box {
  background: var(--text);
  border: none;
  border-radius: var(--radius);
  padding: 1.25rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  white-space: pre-wrap;
  overflow-x: auto;
  color: #dfe9ef;
  margin: 0.85rem 0 1.25rem;
  line-height: 1.6;
  box-shadow: var(--shadow);
}

.prompt-toolbar {
  margin: 0.5rem 0;
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.link-list li {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.link-list li:last-child {
  border-bottom: none;
}

.link-list a {
  display: block;
  padding: 0.9rem 1.15rem;
  text-decoration: none;
  color: var(--text);
}

.link-list a:hover {
  color: var(--action);
  background: var(--surface-2);
}

.link-list .desc {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.ext-cue {
  font-size: 0.85em;
  opacity: 0.6;
  margin-left: 0.15em;
}

.week-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 2.5rem 0 1rem;
  flex-wrap: wrap;
}

.progress-bar {
  height: 10px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.85rem 0 1.25rem;
}

.progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--action), #f5a06a);
  width: 0%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar > span {
    transition: none;
  }
  .week-card:hover {
    transform: none;
  }
}

.done-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 1rem 0 0;
  font-size: 0.93rem;
  color: var(--muted);
  cursor: pointer;
}

.done-toggle input {
  width: 1.3rem;
  height: 1.3rem;
  min-width: 1.3rem;
  margin-top: 0.2rem;
  accent-color: var(--success);
}

/* ── Ethics tri-column ──────────────────────────────── */
.ethics-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (min-width: 700px) {
  .ethics-cols {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.ethics-col {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--line-strong);
}

.ethics-col h3 {
  margin-top: 0;
  font-size: 1rem;
}

.ethics-col.do {
  border-top-color: var(--success);
}

.ethics-col.disclose {
  border-top-color: var(--ink-blue);
}

.ethics-col.dont {
  border-top-color: var(--milestone);
}

.disclosure-print {
  background: var(--surface-1);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin: 1.25rem 0;
}

.disclosure-print pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text);
}

/* ── Projects ───────────────────────────────────────── */
.assess-strip {
  margin-bottom: 2.5rem;
}

.assess-strip h2 {
  margin-top: 0;
}

.assess-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (min-width: 700px) {
  .assess-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.assess-item {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: var(--shadow-sm);
}

.assess-weight {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--action);
  line-height: 1.1;
}

.assess-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.track-card h4 {
  margin-bottom: 0.35rem;
}

.tools-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.tool-card .tool-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.tool-card .tool-head a {
  text-decoration: none;
  color: var(--text);
}

.tool-card .tool-head a:hover {
  color: var(--action);
}

/* ── Mobile nav ─────────────────────────────────────── */
@media (max-width: 1020px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .header-inner {
    border-radius: var(--radius-lg);
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0 0.35rem;
    gap: 0.15rem;
  }

  .nav a {
    padding: 0.75rem 0.9rem;
    min-height: 46px;
    border-radius: var(--radius-sm);
  }

  .nav.is-open {
    display: flex;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .header-inner {
    flex-wrap: wrap;
  }
}

/* ── Small screens ──────────────────────────────────── */
p,
li,
dd,
td,
th,
h1,
h2,
h3,
h4,
.desc,
.meta,
.week-deliv {
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  body {
    font-size: 1rem;
    line-height: 1.65;
  }

  .main {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
  }

  .brand strong {
    font-size: 0.86rem;
  }

  .brand span {
    font-size: 0.7rem;
  }

  .hero-video {
    min-height: 340px;
  }

  .hero-content {
    padding: 1.75rem 1.35rem;
  }

  .hero-media::after {
    background: linear-gradient(
      170deg,
      rgba(255, 255, 255, 0.96) 0%,
      rgba(255, 255, 255, 0.9) 55%,
      rgba(224, 237, 244, 0.6) 100%
    );
  }

  .card,
  .dash-card,
  .progress-panel,
  .action-panel,
  .ethics-col,
  .callout,
  .week-card {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .btn-row .btn {
    flex: 1 1 100%;
  }

  .week-nav {
    flex-direction: column;
  }

  .week-nav .btn {
    width: 100%;
  }

  .filter-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.4rem;
    scrollbar-width: none;
    margin-inline: -0.25rem;
    padding-inline: 0.25rem;
  }

  .filter-group::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .filter-label {
    flex: 0 0 auto;
    position: sticky;
    left: 0;
    background: var(--bg-2);
    padding-right: 0.4rem;
    z-index: 1;
  }

  .filter-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 0.5rem;
  }

  .assess-grid {
    grid-template-columns: 1fr 1fr;
  }

  .prompt-box {
    font-size: 0.8rem;
    padding: 1rem;
  }

  .week-card {
    min-height: 0;
  }

  table {
    font-size: 0.88rem;
  }

  th,
  td {
    padding: 0.6rem 0.75rem;
  }

  h2 {
    font-size: 1.2rem;
    margin-top: 1.85rem;
  }
}

@media (max-width: 380px) {
  .assess-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 480px) and (orientation: landscape) {
  .hero-video {
    min-height: 260px;
  }
  .site-header {
    position: static;
  }
}

/* ══════════════════════════════════════════════════════
   MOTION LAYER — gated on html.motion (set by motion.js
   only when JS is on and reduced-motion is off).
   ══════════════════════════════════════════════════════ */

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: vt-out 0.22s var(--ease-soft) both;
}

::view-transition-new(root) {
  animation: vt-in 0.42s var(--ease-out) both;
}

@keyframes vt-out {
  to { opacity: 0; }
}

@keyframes vt-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.motion .rv {
  opacity: 0;
  transform: translateY(14px);
  will-change: opacity, transform;
}

.motion .rv.rv-in {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
  transition-delay: calc(var(--rvi, 0) * 55ms);
  will-change: auto;
}

.motion .header-inner {
  transition: padding var(--dur-2) var(--ease-soft), box-shadow var(--dur-2) var(--ease-soft),
    background var(--dur-2) var(--ease-soft);
}

.motion .site-header.is-scrolled .header-inner {
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.motion .brand strong {
  transition: color var(--dur-1) var(--ease-soft);
}

.motion .brand:hover strong {
  color: var(--action);
}

.motion .nav a {
  transition: color var(--dur-1) var(--ease-soft), background var(--dur-2) var(--ease-soft);
}

@media (max-width: 1020px) {
  .motion .nav.is-open {
    animation: nav-drop var(--dur-2) var(--ease-out) both;
  }
  .motion .nav.is-open a {
    animation: nav-item var(--dur-2) var(--ease-out) both;
  }
  .motion .nav.is-open a:nth-child(1) { animation-delay: 20ms; }
  .motion .nav.is-open a:nth-child(2) { animation-delay: 45ms; }
  .motion .nav.is-open a:nth-child(3) { animation-delay: 70ms; }
  .motion .nav.is-open a:nth-child(4) { animation-delay: 95ms; }
  .motion .nav.is-open a:nth-child(5) { animation-delay: 120ms; }
  .motion .nav.is-open a:nth-child(6) { animation-delay: 145ms; }
  .motion .nav.is-open a:nth-child(7) { animation-delay: 170ms; }
}

@keyframes nav-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@keyframes nav-item {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.motion .nav-toggle {
  transition: background var(--dur-1), transform var(--dur-1) var(--ease-out);
}

.motion .nav-toggle:hover {
  background: var(--action);
}

.motion .hero-media {
  will-change: transform;
}

.motion .hero-media video,
.motion .hero-media img {
  transform-origin: 58% 45%;
  animation: hero-drift 34s var(--ease-soft) infinite alternate;
}

@keyframes hero-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.13) translate3d(-1.2%, -1.4%, 0); }
}

.motion .hero-video::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(108deg, transparent 38%, rgba(255, 255, 255, 0.5) 50%, transparent 62%);
  transform: translateX(-60%);
  animation: hero-sweep 13s var(--ease-soft) 1.1s infinite;
}

@keyframes hero-sweep {
  0% { transform: translateX(-60%); opacity: 0; }
  8% { opacity: 1; }
  32% { transform: translateX(60%); opacity: 0; }
  100% { transform: translateX(60%); opacity: 0; }
}

.motion .hero-content > * {
  animation: hero-rise 0.85s var(--ease-out) both;
}

.motion .hero-content > .kicker { animation-delay: 0.05s; }
.motion .hero-content > h1 { animation-delay: 0.14s; }
.motion .hero-content > .principle { animation-delay: 0.24s; }
.motion .hero-content > [data-hero-meta] { animation-delay: 0.32s; }
.motion .hero-content > .btn-row { animation-delay: 0.42s; }

@keyframes hero-rise {
  from { opacity: 0; transform: translateY(16px); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}

.motion .btn:hover {
  transform: translateY(-1.5px);
}

.motion .btn-primary:hover {
  box-shadow: 0 16px 30px -14px rgba(234, 90, 56, 0.85);
}

.motion .btn-ghost:hover {
  box-shadow: var(--shadow);
}

.motion .btn.is-pressed {
  transform: translateY(0) scale(0.972);
  transition-duration: 0.09s;
}

.motion .btn.copied {
  animation: pop 0.34s var(--ease-out);
}

@keyframes pop {
  0% { transform: scale(1); }
  38% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.motion .week-card,
.motion a.card.card-link {
  position: relative;
}

.motion .week-card.is-pressed,
.motion a.card.card-link.is-pressed {
  transform: translateY(-1px) scale(0.993);
  transition-duration: 0.09s;
}

.motion .week-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--action), transparent 80%);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-3) var(--ease-out);
}

.motion .week-card:hover::after,
.motion .week-card:focus-visible::after {
  transform: scaleX(1);
}

.motion .week-card h3 {
  transition: color var(--dur-1) var(--ease-soft);
}

.motion .week-card:hover h3 {
  color: var(--action);
}

.motion .card,
.motion .dash-card,
.motion .arc-step,
.motion .assess-item,
.motion .ethics-col,
.motion .tool-card {
  transition: border-color var(--dur-2), box-shadow var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-out);
}

.motion .arc-step:hover,
.motion .assess-item:hover,
.motion .tool-card:hover,
.motion .ethics-col:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.motion .dash-now {
  position: relative;
  overflow: hidden;
}

.motion .dash-now::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 160%;
  background: radial-gradient(60% 50% at 20% 0%, rgba(234, 90, 56, 0.1), transparent 70%);
  pointer-events: none;
  animation: dash-breathe 9s ease-in-out infinite alternate;
}

@keyframes dash-breathe {
  from { opacity: 0.5; transform: translate3d(0, 0, 0); }
  to { opacity: 1; transform: translate3d(4%, 2%, 0); }
}

.motion .link-list a,
.motion .milestone-list a {
  transition: color var(--dur-1), padding-left var(--dur-2) var(--ease-out),
    background var(--dur-2);
}

.motion .link-list a:hover {
  padding-left: 1.5rem;
}

.motion .milestone-list a:hover {
  padding-left: 0.4rem;
}

.motion .ext-cue {
  display: inline-block;
  transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-1);
}

.motion a:hover .ext-cue {
  transform: translate(2px, -2px);
  opacity: 1;
}

.motion .filter-chip {
  transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1),
    box-shadow var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}

.motion .filter-chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.motion .filter-chip.is-pressed {
  transform: scale(0.955);
  transition-duration: 0.08s;
}

.motion .filter-chip[aria-pressed="true"] {
  transform: none;
}

.motion .progress-bar > span {
  position: relative;
  transition: width 0.9s var(--ease-out);
  overflow: hidden;
}

.motion .progress-bar > span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: bar-shine 3.6s var(--ease-soft) 1s infinite;
}

@keyframes bar-shine {
  0% { transform: translateX(-100%); }
  45%, 100% { transform: translateX(220%); }
}

.motion .done-toggle {
  transition: color var(--dur-1);
}

.motion .done-toggle:hover {
  color: var(--text);
}

.motion .week-card.done .num::after {
  display: inline-block;
  animation: pop 0.4s var(--ease-out);
}

.motion .action-panel {
  transition: border-color var(--dur-2), box-shadow var(--dur-2) var(--ease-out);
}

.motion .action-panel:hover {
  box-shadow: var(--shadow);
}

.motion tbody tr {
  transition: background var(--dur-1);
}

.motion tbody tr:hover {
  background: var(--surface-2);
}

.motion .badge,
.motion .tag {
  transition: border-color var(--dur-1), background var(--dur-1);
}

/* Touch: hover states stick after a tap — replace with press feedback */
@media (hover: none) {
  .motion .week-card:hover,
  .motion a.card.card-link:hover,
  .motion .arc-step:hover,
  .motion .assess-item:hover,
  .motion .tool-card:hover,
  .motion .ethics-col:hover,
  .motion .btn:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .motion .week-card:hover::after {
    transform: scaleX(0);
  }

  .motion .link-list a:hover,
  .motion .milestone-list a:hover {
    padding-left: 1.15rem;
    background: none;
  }

  .motion .week-card:active,
  .motion a.card.card-link:active {
    transform: scale(0.985);
  }

  .motion tbody tr:hover {
    background: none;
  }
}

@media (max-width: 560px) {
  /* Keep the first mobile viewport useful while the page hydrates. */
  .motion .main > .rv,
  .motion .main > .rv.rv-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .motion .rv {
    transform: translateY(10px);
  }
  .motion .rv.rv-in {
    transition-duration: 0.5s;
    transition-delay: calc(var(--rvi, 0) * 40ms);
  }
}

@media (prefers-reduced-motion: reduce) {
  .motion .rv {
    opacity: 1 !important;
    transform: none !important;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

/* ── Print ──────────────────────────────────────────── */
@media print {
  .site-header,
  .nav-toggle,
  .done-toggle,
  .week-nav,
  .site-footer,
  .skip-link,
  .filter-group,
  .filter-actions,
  .hero-media,
  .btn-row .btn-ghost,
  [data-clear-progress],
  .prompt-toolbar {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  a {
    color: #000;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #444;
    word-break: break-all;
  }

  .card,
  .hero,
  .callout,
  .week-card,
  .dash-card,
  .action-panel,
  .ethics-col,
  .assess-item,
  .progress-panel,
  .disclosure-print,
  .link-list,
  .table-wrap {
    border-color: #ccc;
    background: #fff;
    box-shadow: none;
    color: #111;
  }

  .prompt-box,
  .disclosure-print pre {
    background: #fff;
    color: #111;
    border: 1px solid #999;
  }

  .kicker,
  .badge,
  .tag,
  .arc-label {
    color: #333;
    background: none;
  }

  .main,
  .main-wide {
    max-width: 100%;
  }

  .disclosure-print {
    border-style: solid;
  }

  .motion .rv {
    opacity: 1 !important;
    transform: none !important;
  }

  .motion .hero-video::after,
  .motion .dash-now::before,
  .motion .progress-bar > span::after {
    display: none !important;
  }
}
