:root {
  color-scheme: light;
  --canvas: #f6f5ef;
  --surface: #fffefa;
  --ink: #172c26;
  --muted: #4c6056;
  --line: #d3dbd0;
  --input-line: #758679;
  --forest: #183e33;
  --forest-hover: #285447;
  --focus: #246c54;
  --wash: #e9efe2;
  --lime: #dbeaa8;
  --danger: #8f292b;
  --radius: 18px;
  --shadow: 0 14px 40px rgba(23, 44, 38, .07);
  --display: Georgia, Cambria, "Times New Roman", serif;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  min-block-size: 100vh;
  min-block-size: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0;
  line-height: 1.55;
}

a { color: var(--forest); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
img, video { display: block; max-inline-size: 100%; }
input, textarea, select, button { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.15; }
h1 {
  font-family: var(--display);
  font-size: clamp(2.05rem, 1.6rem + 2vw, 3.65rem);
  font-weight: 500;
  letter-spacing: -.035em;
}
h2 { font-size: clamp(1.22rem, 1.12rem + .55vw, 1.6rem); letter-spacing: -.025em; }
h3 { font-size: 1.05rem; }
p + p { margin-block-start: .7rem; }

.shell { inline-size: min(100% - 2.5rem, 72rem); margin-inline: auto; }
main.shell { flex: 1; min-inline-size: 0; padding-block: clamp(1.7rem, 1.25rem + 2vw, 3.25rem) 4.5rem; }
main.shell > * + * { margin-block-start: 1.5rem; }

.site-header { border-block-end: 1px solid var(--line); background: var(--surface); }
.header-inner {
  min-block-size: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .4rem 1.4rem;
  padding-block: .5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-block-size: 44px;
  min-inline-size: 0;
  color: var(--ink);
  font-weight: 720;
  letter-spacing: -.035em;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.brand img, .brand svg { flex: none; inline-size: 36px; block-size: 36px; }
.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .2rem .35rem;
  min-inline-size: 0;
}
.nav form { margin: 0; }
.nav a, .nav button:not(.button) {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding: .35rem .65rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--forest);
  font-size: .9rem;
  font-weight: 640;
  text-decoration: none;
  cursor: pointer;
}
.nav a:hover, .nav a[aria-current="page"], .nav button:not(.button):hover { background: var(--wash); }
.nav .muted { margin-inline: .45rem; overflow-wrap: anywhere; }

.site-footer { border-block-start: 1px solid var(--line); }
.site-footer > .shell { padding-block: 1.2rem; color: var(--muted); font-size: .85rem; }
.skip-link, .skip {
  position: absolute;
  z-index: 10;
  inset: .5rem auto auto .5rem;
  padding: .65rem .8rem;
  background: var(--surface);
  transform: translateY(-150%);
}
.skip-link:focus, .skip:focus { transform: none; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-content: center;
  gap: .8rem;
  padding: clamp(1.55rem, 1.15rem + 3vw, 3.6rem);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(114deg, #e9efe3 12%, #f0f2e5 60%, #e0e9d5);
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -5rem -12rem auto;
  inline-size: 23rem;
  aspect-ratio: 1;
  border: 1px solid rgba(24, 62, 51, .15);
  border-radius: 50%;
  box-shadow: 0 0 0 1.5rem rgba(24, 62, 51, .04), 0 0 0 3.5rem rgba(24, 62, 51, .035);
  pointer-events: none;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--forest);
  font-size: .74rem;
  font-weight: 760;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; inline-size: 1.25rem; block-size: 2px; background: var(--forest); }
.hero p:not(.eyebrow), .intro p { max-inline-size: 61ch; color: var(--muted); }
.intro > * + * { margin-block-start: .45rem; }

.grid, .split { display: grid; gap: 1rem; }
.grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.split { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.stack { display: grid; gap: .9rem; }
.stack > *, .split > *, .grid > * { min-inline-size: 0; }

.panel, .card, .module, .empty {
  min-inline-size: 0;
  padding: clamp(1.15rem, 1rem + .8vw, 1.7rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.panel { box-shadow: var(--shadow); }
.panel > * + *, .module > * + *, .empty > * + * { margin-block-start: .75rem; }
.card { display: flex; flex-direction: column; align-items: flex-start; gap: .65rem; }
.card > p { color: var(--muted); }
.card > .button { margin-block-start: auto; }
.card > .actions { margin-block-start: auto; }
.badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: .16rem .6rem;
  border-radius: 999px;
  background: var(--lime);
  color: var(--forest);
  font-size: .76rem;
  font-weight: 740;
}
.empty { border-style: dashed; color: var(--muted); }
.empty h2, .empty h3 { color: var(--ink); }
.auth-shell { inline-size: min(100%, 33rem); margin-inline: auto; }
.auth-shell > * + * { margin-block-start: 1rem; }
.auth-shell > .hero { padding: clamp(1.3rem, 1.05rem + 1.6vw, 2.3rem); }
.auth-shell .hero::after { inset-inline-end: -10rem; }

.field { display: grid; gap: .35rem; min-inline-size: 0; }
label { color: var(--ink); font-weight: 670; }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), select, textarea {
  inline-size: 100%;
  min-block-size: 46px;
  padding: .58rem .74rem;
  border: 1px solid var(--input-line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--forest); }
input::placeholder, textarea::placeholder { color: #5c7065; }
textarea { min-block-size: 7.5rem; resize: vertical; }
.field small, .muted { color: var(--muted); }
.field small { font-size: .88rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.actions form { margin: 0; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 44px;
  max-inline-size: 100%;
  padding: .53rem .85rem;
  border: 1px solid var(--forest);
  border-radius: 9px;
  background: var(--forest);
  color: #fff;
  font-weight: 690;
  line-height: 1.28;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.button:hover { border-color: var(--forest-hover); background: var(--forest-hover); color: #fff; }
.button.secondary { border-color: var(--input-line); background: var(--surface); color: var(--forest); }
.button.secondary:hover { border-color: var(--focus); background: var(--wash); color: var(--forest); }
.button.danger { border-color: #bb8582; background: #fff5f3; color: var(--danger); }
.button.danger:hover { border-color: var(--danger); background: #f8e4e0; color: var(--danger); }
.button:disabled { opacity: .55; cursor: not-allowed; }

.alert, .notice {
  padding: .72rem .9rem;
  border: 1px solid #9aaf9d;
  border-inline-start: 4px solid var(--focus);
  border-radius: 8px;
  background: #ebf2e7;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.alert.error {
  border-color: #bb8582;
  border-inline-start-color: var(--danger);
  background: #fff2ee;
  color: var(--danger);
}
.notice code { color: var(--forest); font-size: .95em; overflow-wrap: anywhere; }

.table-wrap { max-inline-size: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
table { inline-size: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: .6rem .75rem; text-align: start; vertical-align: middle; overflow-wrap: anywhere; }
th { background: var(--wash); color: var(--forest); font-size: .86rem; font-weight: 740; }
tbody tr + tr { border-block-start: 1px solid var(--line); }
td .actions { min-inline-size: max-content; }
td .button { font-size: .87rem; }

.lesson-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.lesson-list > li { padding-block: .45rem; border-block-start: 1px solid var(--line); overflow-wrap: anywhere; }
.lesson-list a {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  font-weight: 650;
}
.lesson-content { max-inline-size: 74ch; overflow-wrap: anywhere; }
.lesson-content > * + * { margin-block-start: .9rem; }
.lesson-content pre { max-inline-size: 100%; overflow-x: auto; }
video.lesson-video {
  inline-size: 100%;
  max-block-size: 72vh;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #111d19;
  object-fit: contain;
}

@media (max-width: 650px) {
  .shell { inline-size: calc(100% - 1.5rem); }
  main.shell { padding-block-end: 3rem; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .header-inner { gap: .2rem .75rem; }
  .nav a, .nav button:not(.button) { padding-inline: .48rem; }
  .hero::after { inset-inline-end: -12rem; opacity: .65; }
}

.checkbox { display: flex; align-items: baseline; gap: .55rem; }
.course-cover { inline-size: 100%; aspect-ratio: 16 / 9; block-size: auto; object-fit: cover; border-radius: 12px; }
.lesson-content p { white-space: pre-wrap; }
.course-hero { inline-size: 100%; aspect-ratio: 2061 / 763; block-size: auto; object-fit: contain; border-radius: 18px; background: var(--forest); }
