:root {
  --ink: #172033;
  --muted: #5d6b7e;
  --line: #d9e1ec;
  --blue: #0f5fa8;
  --cyan: #14b7d8;
  --green: #0b8f6a;
  --amber: #b86f00;
  --red: #b8342f;
  --bg: #f5f8fc;
  --panel: #fff;
  --soft: #edf4fb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

body * {
  max-width: 100%;
}

.site-nav {
  background: #172033;
  padding: 12px 22px;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.site-nav a {
  color: #c8d8ec;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 650;
}

.site-nav .nav-home {
  color: #59d5ff;
  font-weight: 850;
  font-size: 1rem;
}

.site-nav a:hover { color: #fff; }

.page-shell {
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 22px 56px;
  min-width: 0;
  overflow-x: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 18px;
  width: 100%;
}

.hero > *,
.layout > *,
.panel,
.task,
.image-frame {
  min-width: 0;
}

.kicker {
  margin: 0 0 10px;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 850;
  color: var(--green);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 3.2vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.lead {
  margin: 12px 0 0;
  max-width: 650px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #39506c;
  font-size: .82rem;
  font-weight: 750;
}

.image-frame {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(28, 49, 80, .12);
}

.image-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.image-frame figcaption {
  padding: 12px 14px;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.45;
  border-top: 1px solid var(--line);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
  width: 100%;
}

.stack { display: grid; gap: 16px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(28, 49, 80, .055);
}

.panel.pad { padding: 18px; }

h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  line-height: 1.3;
}

h3 {
  margin: 0 0 8px;
  font-size: .96rem;
  line-height: 1.35;
}

p, li {
  color: var(--muted);
  line-height: 1.62;
  overflow-wrap: break-word;
}

p { margin: 0 0 10px; }
ul, ol { margin: 8px 0 0; padding-left: 22px; }
li + li { margin-top: 5px; }

.task-list {
  counter-reset: task;
  display: grid;
  gap: 8px;
}

.task {
  position: relative;
  padding: 11px 14px 11px 46px;
  background: var(--soft);
  border: 1px solid #dce8f4;
  border-radius: 7px;
  color: #243850;
  line-height: 1.55;
}

.task::before {
  counter-increment: task;
  content: counter(task);
  position: absolute;
  left: 14px;
  top: 13px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-size: .78rem;
  font-weight: 850;
}

.writing-box {
  display: grid;
  gap: 10px;
}

textarea {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 14px 15px;
  font: 1rem/1.55 inherit;
  color: var(--ink);
  background: #fbfdff;
}

textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(15, 95, 168, .12);
}

.writing-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.counter {
  font-size: .86rem;
  color: var(--muted);
  font-weight: 700;
}

.counter.good { color: var(--green); }
.counter.warn { color: var(--amber); }

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  font: 800 .9rem/1 inherit;
  cursor: pointer;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-secondary { background: #e8eef6; color: var(--ink); }
.btn-green { background: var(--green); color: #fff; }

.check-grid {
  display: grid;
  gap: 8px;
}

.check-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.check-item input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.check-item span {
  color: #32465f;
  line-height: 1.45;
  font-size: .93rem;
}

.self-score {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #eefaf5;
  color: #075b3d;
  font-weight: 800;
  display: none;
}

.self-score.visible { display: block; }

.rubric {
  display: grid;
  gap: 10px;
}

.rubric-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.points {
  font-weight: 900;
  color: var(--blue);
}

.sample {
  display: none;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.sample.visible { display: block; }

.sample-text {
  color: #243850;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  line-height: 1.7;
}

.marked {
  color: var(--blue);
  font-weight: 850;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.word {
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef6ff;
  color: #24496e;
  font-size: .84rem;
  font-weight: 700;
}

.side-note {
  border-left: 4px solid var(--cyan);
  background: #eafaff;
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
  color: #1d5363;
  line-height: 1.55;
  font-size: .9rem;
}

.mistake {
  border-left: 4px solid var(--amber);
  background: #fff8e6;
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
  color: #5a3c00;
  line-height: 1.55;
  font-size: .9rem;
}

.site-footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px 22px 42px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  font-size: .85rem;
  color: #8a9ab0;
}

.site-footer a { color: var(--muted); }

@media (max-width: 860px) {
  .hero, .layout { grid-template-columns: 1fr; }
  .page-shell { padding: 22px 16px 42px; }
  .rubric-row { grid-template-columns: 1fr; gap: 4px; }
  .image-frame img { aspect-ratio: 1 / 1; }
}

@media (max-width: 520px) {
  .site-nav {
    gap: 14px;
    padding: 12px 16px;
  }

  .site-nav a {
    font-size: .86rem;
  }

  h1 {
    font-size: 1.75rem;
    line-height: 1.12;
  }

  .lead {
    font-size: 1rem;
  }

  .task {
    padding-right: 12px;
  }

  textarea {
    min-height: 230px;
  }
}
