:root {
  --green: #205C4D;
  --green-dark: #17483D;
  --green-soft: #EAF4EF;
  --yellow: #F4C95D;
  --blue: #B9DDE5;
  --paper: #FFFDF8;
  --ink: #26332F;
  --muted: #66716D;
  --line: #DDE5E1;
  --white: #FFFFFF;
  --radius: 14px;
  --shadow: 0 4px 14px rgba(38, 51, 47, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Nunito Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button, input { font: inherit; }

button {
  cursor: pointer;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 253, 248, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.header-inner,
.container {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  font-family: "Nunito", Arial, sans-serif;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -.5px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--paper);
  background: var(--green);
  font-size: 18px;
}

.menu { position: static; }

.menu-button {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--green);
  background: var(--white);
  font-size: 22px;
  cursor: pointer;
  list-style: none;
}

.menu-button::-webkit-details-marker { display: none; }

.menu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 8px 16px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.menu-panel a {
  display: block;
  padding: 11px 0;
  color: var(--green-dark);
  font-weight: 700;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 58px 0 52px;
  background: var(--green-soft);
}

.hero::after {
  content: "";
  position: absolute;
  right: 7%;
  top: 28px;
  width: 86px;
  height: 44px;
  opacity: .45;
  background-image: radial-gradient(var(--yellow) 2px, transparent 2px);
  background-size: 14px 14px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(210px, .7fr);
  align-items: center;
  gap: 42px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-weight: 800;
  letter-spacing: .3px;
}

h1, h2, h3 {
  margin: 0;
  color: var(--green-dark);
  font-family: "Nunito", Arial, sans-serif;
  line-height: 1.15;
}

h1 {
  max-width: 620px;
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 900;
  letter-spacing: -1px;
}

h2 {
  font-size: clamp(25px, 4vw, 32px);
  font-weight: 900;
}

h3 {
  font-size: 20px;
  font-weight: 800;
}

.hero-copy {
  max-width: 610px;
  margin: 18px 0 0;
  font-size: 18px;
  color: var(--muted);
}

.hero-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 25px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  transition: background .2s ease, transform .2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: var(--white);
  background: var(--green);
}

.button-primary:hover { background: var(--green-dark); }

.button-secondary {
  color: var(--green);
  background: var(--white);
  border: 1px solid var(--green);
}

.button-secondary:hover { background: var(--green-soft); }

.button-full { width: 100%; }

.paper-stack {
  position: relative;
  width: min(220px, 80%);
  aspect-ratio: .78;
  margin: auto;
}

.sheet {
  position: absolute;
  inset: 0;
  padding: 25px 20px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--white);
  box-shadow: 8px 8px 0 var(--yellow);
  transform: rotate(6deg);
}

.sheet-back {
  transform: rotate(-7deg) translate(-12px, 10px);
  background: #f5faf7;
  opacity: .9;
}

.sheet-content {
  position: relative;
  z-index: 1;
  transform: rotate(6deg);
}

.sheet-title {
  margin-bottom: 20px;
  font-family: "Nunito", Arial, sans-serif;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.sheet-line {
  height: 18px;
  margin: 13px 0;
  border-bottom: 2px solid var(--ink);
}

/* Sections, cards */
.section {
  padding: 62px 0;
}

.section-heading {
  max-width: 660px;
  margin-bottom: 25px;
}

.section-heading p {
  margin: 10px 0 0;
  color: var(--muted);
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.activity-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.activity-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.activity-card:nth-child(2) .thumbnail { background: var(--blue); }
.activity-card:nth-child(3) .thumbnail { background: #F8E8B8; }
.activity-card:nth-child(4) .thumbnail { background: var(--green-soft); }

.thumbnail {
  min-height: 155px;
  display: grid;
  place-items: center;
  padding: 15px;
  background: #EAF4EF;
}

.thumbnail svg {
  width: 100%;
  max-width: 122px;
  height: 145px;
  filter: drop-shadow(3px 4px 0 rgba(38, 51, 47, .12));
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 17px;
}

.card-body h3 { margin-bottom: 7px; }

.card-body p {
  flex: 1;
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 15px;
}

.labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.label {
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 13px;
  font-weight: 800;
}

.generator-section {
  background: var(--green-soft);
}

.generator-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.generator-choice {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border: 2px solid var(--white);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}

.generator-choice:hover {
  border-color: var(--green);
}

.choice-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  border-radius: 12px;
  color: var(--green-dark);
  background: var(--yellow);
  font-size: 24px;
  font-weight: 900;
}

.generator-choice:nth-child(2) .choice-icon { background: var(--blue); }

.generator-choice p {
  margin: 8px 0 0;
  color: var(--muted);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.step-number {
  flex: 0 0 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--green);
  font-family: "Nunito", Arial, sans-serif;
  font-size: 19px;
  font-weight: 900;
}

.step p {
  margin: 2px 0 0;
  color: var(--muted);
}

.benefits {
  padding-top: 20px;
}

.benefit-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 25px 0 0;
  padding: 0;
  list-style: none;
}

.benefit-list li {
  padding: 17px;
  border-left: 4px solid var(--yellow);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.site-footer {
  padding: 40px 0;
  color: var(--white);
  background: var(--green-dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 28px;
}

.site-footer h3,
.site-footer .brand { color: var(--white); }

.site-footer p {
  margin: 10px 0 0;
  color: #D8E8E2;
}

.footer-links {
  display: grid;
  gap: 7px;
  margin-top: 9px;
  color: #D8E8E2;
}

.footer-links a:hover { color: var(--yellow); }

.back-link {
  display: inline-flex;
  margin-bottom: 22px;
  color: var(--green);
  font-weight: 800;
}

.breadcrumb {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.breadcrumb a { color: var(--green); }

.info-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin: 23px 0;
  padding: 0;
  list-style: none;
}

.info-list li {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--green-soft);
  font-size: 14px;
}

.print-note {
  margin: 20px 0 0;
  padding: 15px;
  border-left: 4px solid var(--yellow);
  background: #FFF8DE;
  color: var(--ink);
  font-size: 15px;
}

.sheet-meta-line {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

/* Generator pages */
.generator-card {
  max-width: 700px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.form-group {
  margin: 22px 0;
}

.form-group label,
.form-label {
  display: block;
  margin-bottom: 9px;
  color: var(--green-dark);
  font-weight: 800;
}

input[type="text"] {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper);
  font-size: 17px;
}

input[type="text"]:focus {
  outline: 3px solid rgba(32, 92, 77, .18);
  border-color: var(--green);
}

.error-message {
  min-height: 24px;
  margin: 6px 0 0;
  color: #A43D30;
  font-size: 14px;
  font-weight: 700;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.option-grid.two { grid-template-columns: repeat(2, 1fr); }

.option {
  position: relative;
}

.option input {
  position: absolute;
  opacity: 0;
}

.option label {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper);
  text-align: center;
  font-weight: 700;
  line-height: 1.3;
}

.option small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.option input:checked + label {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px var(--green);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 26px;
}

.result-box {
  display: none;
  margin-top: 24px;
  padding: 20px;
  border: 2px solid var(--green);
  border-radius: var(--radius);
  background: var(--green-soft);
}

.result-box.visible { display: block; }

.result-box h3 {
  margin-bottom: 8px;
  font-size: 22px;
}

.result-box p { margin: 0; }

.result-paper {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--white);
  color: #000;
}

.result-paper h4 {
  margin: 0 0 16px;
  color: #000;
  font-family: "Nunito", Arial, sans-serif;
  font-size: 22px;
  text-align: center;
}

.name-practice {
  margin: 17px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #000;
  font-family: "Nunito", Arial, sans-serif;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 3px;
}

.name-practice.trace {
  color: #AEB8B4;
  text-shadow: 1px 1px 0 #000;
}

.name-practice.copy {
  color: #000;
  letter-spacing: 5px;
}

.name-practice.free {
  color: transparent;
  border-bottom: 2px solid #000;
}

.question-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 17px 30px;
  font-size: 19px;
  font-weight: 700;
}

.question-item {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

/* Sheet pages */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(240px, .8fr);
  gap: 28px;
  align-items: start;
}

.detail-side .info-list {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.sheet-wrap {
  display: flex;
  justify-content: center;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--green-soft);
}

.worksheet {
  width: min(100%, 680px);
  padding: 28px 26px 32px;
  border: 2px solid #000;
  background: #fff;
  box-shadow: var(--shadow);
  color: #000;
}

.sheet-head h2 {
  color: #000;
  font-size: 24px;
  text-align: center;
}

.name-row {
  display: flex;
  gap: 24px;
  margin: 18px 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.name-row span {
  flex: 1;
  padding-bottom: 4px;
  border-bottom: 1.5px solid #000;
}

.sheet-instruction {
  margin: 16px 0 20px;
  font-size: 16px;
  font-weight: 700;
}

.trace-block { margin: 0 0 6px; }

.trace-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 2px solid #000;
}

.trace-model {
  min-width: 52px;
  color: #000;
  font-family: "Nunito", Arial, sans-serif;
  font-size: 34px;
  font-weight: 900;
  text-align: center;
}

.trace-letters {
  color: #B7C0BC;
  font-family: "Nunito", Arial, sans-serif;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 14px;
}

.trace-letters.small {
  font-size: 30px;
  letter-spacing: 10px;
}

.write-row {
  height: 50px;
  border-bottom: 2px solid #000;
}

.worksheet .question-list {
  color: #000;
  font-size: 20px;
}

.worksheet .question-item {
  border-bottom: 1px solid #000;
}

.count-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1.5px solid #000;
}

.count-label {
  min-width: 92px;
  font-weight: 800;
}

.count-objects {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.count-objects svg {
  width: 30px;
  height: 30px;
}

.count-options {
  display: flex;
  gap: 8px;
}

.count-options span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 2px solid #000;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 800;
}

.match-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
}

.match-col {
  display: grid;
  gap: 14px;
  align-content: start;
}

.match-item {
  padding: 12px;
  border: 2px solid #000;
  border-radius: 10px;
  font-family: "Nunito", Arial, sans-serif;
  font-size: 26px;
  font-weight: 900;
  text-align: center;
}

.match-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border: 2px solid #000;
  border-radius: 10px;
}

.match-group svg {
  width: 26px;
  height: 26px;
}

.pattern-rule {
  margin: 18px 0 4px;
  font-weight: 700;
}

.pattern-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 20px;
}

.pattern-box {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 2px solid #000;
  border-radius: 8px;
}

.pattern-box svg {
  width: 36px;
  height: 36px;
}

.pattern-box.empty {
  border-style: dashed;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.color-cell {
  padding: 16px;
  border: 2px solid #000;
  border-radius: 10px;
  text-align: center;
}

.color-cell svg {
  width: 110px;
  height: 110px;
}

.color-cell p {
  margin: 10px 0 0;
  font-weight: 800;
}

.related { margin-top: 44px; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.related-card {
  display: block;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.related-card h3 { margin-bottom: 6px; }

.related-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}

/* Responsive */
@media (max-width: 900px) {
  .activity-grid { grid-template-columns: repeat(2, 1fr); }
  .activity-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { gap: 20px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side .info-list { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .header-inner,
  .container { width: min(100% - 24px, 1120px); }
  .hero { padding: 40px 0; }
  .hero-grid { grid-template-columns: 1fr; }
  .paper-stack { width: 150px; }
  .hero-copy { font-size: 16px; }
  .hero-actions,
  .action-row,
  .form-actions { flex-direction: column; }
  .button { width: 100%; }
  .section { padding: 44px 0; }
  .activity-grid,
  .activity-grid.cols-3,
  .generator-box,
  .steps,
  .benefit-list,
  .footer-grid,
  .related-grid { grid-template-columns: 1fr; }
  .generator-choice { min-height: 0; }
  .option-grid,
  .option-grid.two { grid-template-columns: 1fr; }
  .info-list { grid-template-columns: 1fr; }
  .generator-card { padding: 20px; }
  .sheet-wrap { padding: 14px; }
  .worksheet { padding: 20px 16px 24px; }
  .trace-model,
  .trace-letters { font-size: 28px; }
  .trace-letters { letter-spacing: 8px; }
  .trace-letters.small { font-size: 24px; }
  .match-wrap { gap: 0 20px; }
  .match-item { font-size: 22px; }
  .count-row { flex-wrap: wrap; }
  .count-label { min-width: 0; }
  .question-list { grid-template-columns: 1fr; }
}

/* Print: the on-screen sheet IS the print sheet (same DOM).
   Pages with a printable sheet use body.has-sheet; only the
   .sheet-print element prints, in black and white. */
@media print {
  @page { size: A4; margin: 12mm; }

  body {
    background: #fff;
    color: #000;
    font-family: Arial, sans-serif;
  }

  .site-header,
  .site-footer { display: none !important; }

  body.has-sheet * { visibility: hidden; }

  body.has-sheet .sheet-print,
  body.has-sheet .sheet-print * { visibility: visible; }

  body.has-sheet .sheet-print {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    box-shadow: none;
  }

  body.has-sheet .worksheet {
    border: 2px solid #000;
  }

  body.has-sheet .result-paper {
    padding: 0;
    border: 0;
  }
}
