:root {
  font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #34323e;
  background: #fff3f6;
  --muted: #625a66;
  --purple: #70508a;
  --line: #dfd3d0;
  --coral: #f2b4a4;
  --sage: #b9d2ba;
  --lavender-accent: #cbb7df;
  --rose-surface: #f3d0dc;
  --rose-accent: #dda6bb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 95% 5%, #fbe6ed 0, transparent 38%),
    radial-gradient(ellipse at 0 65%, #fcebf1 0, transparent 35%);
}

main {
  max-width: 1120px;
  min-height: 65vh;
  margin: 52px auto;
  padding: 0 24px;
}

h1, h2 {
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: #51405f;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

h1 { margin: 18px 0 22px; font-size: clamp(34px, 5vw, 54px); letter-spacing: -.035em; }
h2 { margin: 0 0 18px; font-size: clamp(24px, 3vw, 29px); letter-spacing: -.02em; }
p { line-height: 1.8; overflow-wrap: anywhere; }
.muted, small { color: var(--muted); }
small { font-size: 13px; }

.eyebrow {
  display: inline-block;
  margin: 14px 0 0;
  padding: 7px 13px;
  border-radius: 12px;
  background: #f9e8ad;
  color: #59472c;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.intro { max-width: none; }
.title-row, .module-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
}
.title-row h1 { min-width: 0; flex: 1 1 230px; }
.intro h1 {
  font-family: Baskerville, "Iowan Old Style", "Baskerville Old Face", "Times New Roman", serif;
  font-size: clamp(44px, 7vw, 76px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.035em;
}
.intro p { max-width: 610px; font-size: 17px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin-top: 36px; }

.card, .lesson, .panel {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fffcf8;
  box-shadow: 0 5px 20px #70504608;
}

.card {
  --accent: var(--rose-accent);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 218px;
  border: 1px solid var(--accent);
  border-top: 6px solid var(--accent);
  background: var(--rose-surface);
  color: #34323e;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
  overflow-wrap: anywhere;
}

.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 10px 26px #6c4c6018;
}

.number {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 9px;
  background: var(--accent);
  color: #34323e;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .1em;
}

.card h2 { margin: 1px 0 0; font-size: 25px; }
.card small:last-child { margin-top: auto; color: #51405f; font-weight: 650; }
.row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }

a { color: #604274; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

button, .button {
  display: inline-block;
  min-height: 46px;
  padding: 11px 19px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--purple);
  color: #fff;
  font: inherit;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease;
}

button:hover, .button:hover { background: #5d3e76; }
button.secondary, .button.secondary { color: #51405f; background: #ede4f5; border-color: #d7c7e4; }
button.secondary:hover, .button.secondary:hover { background: #e0d2ec; }
#logout { flex-shrink: 0; background: var(--rose-surface); border-color: var(--rose-accent); color: #51405f; }
#logout:hover { background: var(--rose-accent); }
.module-toolbar + .eyebrow { background: var(--rose-surface); border: 1px solid var(--rose-accent); color: #51405f; }
.module-text { margin-bottom: 24px; }
.video-description, .saved-module-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.video-upload-form { margin: 14px 0 20px; }
button.danger { background: #983f40; }
button.danger:hover { background: #813234; }
button:disabled { opacity: .6; cursor: wait; }

label { display: block; margin: 17px 0 8px; font-size: 14px; font-weight: 600; }
input, textarea, select {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 7px;
  padding: 12px 14px;
  border: 1px solid #a99aa9;
  border-radius: 12px;
  background: #fffefb;
  color: #34323e;
  font: inherit;
  font-weight: 400;
}

textarea { min-height: 110px; resize: vertical; }
input[type="file"] { padding: 10px; background: #f7f2fc; border-style: dashed; }
input::file-selector-button {
  margin-right: 12px;
  padding: 10px 14px;
  border: 1px solid #c2b0d0;
  border-radius: 9px;
  background: #e9def3;
  color: #51405f;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

input::file-selector-button:hover { background: #dccae9; }
.login { max-width: 465px; margin: 65px auto; padding: 36px; border-top: 6px solid var(--coral); }
.login h1 { font-size: clamp(32px, 5vw, 44px); }
.login button { width: 100%; margin-top: 24px; }
#login-error { color: #983f40; font-weight: 600; }
.lesson { margin: 24px 0; border-left: 5px solid var(--sage); }
.lesson p { white-space: pre-wrap; }
.material { margin-top: 22px; padding-top: 22px; border-top: 1px solid #e0d6e5; }
.material > a { font-weight: 650; overflow-wrap: anywhere; }
.material img, .material video { display: block; max-width: 100%; max-height: 480px; margin: 16px 0; border-radius: 16px; }
.editing { margin-top: 36px; padding-top: 20px; border-top: 1px solid #d8cbdc; }
details { margin-top: 18px; }
summary { min-height: 44px; padding: 9px 0; color: #604274; font-weight: 650; cursor: pointer; overflow-wrap: anywhere; }
form .row > * { flex: 1; }
form button { margin-top: 10px; }
nav.row { margin-top: 30px; gap: 16px; }
nav a { padding: 10px 0; }

#message {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 10;
  display: none;
  max-width: 90%;
  padding: 15px 24px;
  border-radius: 16px;
  background: #51405f;
  box-shadow: 0 8px 26px #51405f25;
  color: #fff;
  transform: translateX(-50%);
}

:is(button, a, summary, input, textarea, select):focus-visible { outline: 3px solid #51405f; outline-offset: 4px; }

@media (max-width: 700px) {
  main { margin: 32px auto; padding: 0 18px; }
  .grid { gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
  .card, .lesson, .panel { padding: 23px; border-radius: 20px; }
  .card { min-height: 205px; }
  .login { margin: 35px auto; }
  .row { gap: 12px; }
}

@media (max-width: 380px) {
  main { padding: 0 14px; }
  .card, .lesson, .panel { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, button, .button { transition: none; }
  .card:hover, .card:focus-visible { transform: none; }
}
