@font-face {
  font-family: "Grundschrift";
  src: url("/assets/fonts/Grundschrift-Regular.otf") format("opentype");
  font-display: swap;
}

:root {
  --waldschule-green: #234c34;
  --waldschule-green-muted: #c1d0be;
  --waldschule-ink: #203025;
  --waldschule-paper: #ffffff;
  --waldschule-warm: #f4b860;
  --page: #f7f9f4;
  --line: #d9ded8;
  --muted: #5e6f5d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--waldschule-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 22px;
  background: var(--waldschule-paper);
  border-bottom: 1px solid var(--waldschule-green-muted);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--waldschule-green);
  font-weight: 750;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.home {
  display: grid;
  gap: 34px;
}

.intro,
.section-inner {
  width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
}

.intro {
  padding: 52px 0 8px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  color: var(--waldschule-green);
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro p:last-child {
  max-width: 680px;
  color: #3f4d42;
  font-size: 1.08rem;
  line-height: 1.55;
}

.material-band {
  padding: 28px 0 56px;
  background: var(--waldschule-paper);
  border-block: 1px solid var(--waldschule-green-muted);
}

.material-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  color: var(--waldschule-ink);
  text-decoration: none;
}

.material-item strong,
.material-item small {
  display: block;
}

.material-item small {
  margin-top: 5px;
  color: var(--muted);
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(420px, 1fr);
  gap: 24px;
  width: min(1220px, calc(100vw - 32px));
  margin: 24px auto 40px;
  align-items: start;
}

.tool-panel {
  padding: 22px;
  background: var(--waldschule-paper);
  border: 1px solid var(--waldschule-green-muted);
  border-radius: 8px;
}

.tool-heading {
  margin-bottom: 20px;
}

.tool-heading h1 {
  margin-bottom: 0;
  font-size: 2rem;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.lineature-choice {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 14px;
  background: #f4f7f0;
  border: 1px solid var(--waldschule-green-muted);
  border-radius: 6px;
}

.lineature-choice label {
  color: var(--waldschule-ink);
  font-size: 0.92rem;
  font-weight: 650;
}

.lineature-choice select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--waldschule-green-muted);
  border-radius: 6px;
  background: white;
  color: var(--waldschule-ink);
  font: inherit;
}

.lineature-choice p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 0.7fr 0.9fr;
  gap: 10px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--waldschule-green-muted);
  border-radius: 6px;
  color: var(--waldschule-ink);
  font: inherit;
  background: #fbfcf8;
}

input:focus {
  border-color: var(--waldschule-green);
  outline: 2px solid rgba(35, 76, 52, 0.15);
}

.sentence-list {
  display: grid;
  gap: 12px;
}

.tool-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--waldschule-green);
  border-radius: 6px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}

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

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

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.form-message {
  min-height: 22px;
  margin: 14px 0 0;
  color: #8a3b21;
  font-size: 0.9rem;
}

.preview-wrap {
  overflow-x: auto;
  padding-bottom: 12px;
}

.paper-preview {
  position: relative;
  width: min(100%, 760px);
  min-width: 560px;
  aspect-ratio: 210 / 297;
  padding: 38px 42px;
  background: var(--waldschule-paper);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(32, 48, 37, 0.12);
  --line-row-height: 5mm;
  --line-box-height: 15mm;
  --sample-top: 2.75mm;
  --sample-indent: 3mm;
  --sample-font-size: 1.78rem;
}

.paper-preview[data-lineature="2"] {
  --line-row-height: 4mm;
  --line-box-height: 12mm;
  --sample-top: 2.15mm;
  --sample-indent: 3mm;
  --sample-font-size: 1.68rem;
}

.preview-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: stretch;
  gap: 18px;
  margin-bottom: 18px;
}

.preview-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--waldschule-green-muted);
  border-radius: 6px;
  overflow: hidden;
}

.preview-field {
  display: grid;
  min-width: 0;
  padding: 8px 10px 7px;
  gap: 3px;
  border-right: 1px solid var(--waldschule-green-muted);
}

.preview-field:last-child {
  border-right: 0;
}

.preview-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.preview-field strong {
  min-height: 18px;
  color: var(--waldschule-ink);
  font-size: 0.92rem;
  font-weight: 400;
}

.preview-topbar img {
  width: 92px;
  height: 54px;
  object-fit: contain;
}

.preview-header {
  margin-bottom: 18px;
}

.preview-header h2 {
  margin-bottom: 4px;
  color: var(--waldschule-green);
  font-size: 2rem;
}

.preview-header p {
  color: var(--waldschule-ink);
}

.preview-sentences {
  display: grid;
  gap: 18px;
}

.preview-block strong {
  display: block;
  margin-bottom: 8px;
  color: var(--waldschule-green);
  font-size: 0.78rem;
}

.preview-text {
  margin: 0;
  font-family: "Grundschrift", "Comic Sans MS", cursive;
  font-weight: 700;
  font-size: var(--sample-font-size);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.writing-lines {
  height: var(--line-box-height);
  border: 1px solid var(--line);
  background:
    linear-gradient(
      to bottom,
      transparent 0 calc(var(--line-row-height) - 0.12mm),
      var(--line) calc(var(--line-row-height) - 0.12mm) calc(var(--line-row-height) + 0.12mm),
      transparent calc(var(--line-row-height) + 0.12mm) calc((var(--line-row-height) * 2) - 0.12mm),
      var(--waldschule-green-muted) calc((var(--line-row-height) * 2) - 0.12mm) calc((var(--line-row-height) * 2) + 0.12mm),
      transparent calc((var(--line-row-height) * 2) + 0.12mm)
    );
}

.sample-lines {
  position: relative;
  margin-bottom: 8px;
}

.sample-lines .preview-text {
  position: absolute;
  top: var(--sample-top);
  left: var(--sample-indent);
  right: 0;
}

@media (max-width: 860px) {
  .tool-shell {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .tool-actions {
    display: grid;
  }

  .preview-topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .preview-meta {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .paper-preview {
    min-width: 520px;
  }
}
