:root {
  --paper: #efe4d0;
  --sheet: #f7f0e2;
  --ink: #1a1713;
  --muted: #6e6458;
  --line: #d3c4ae;
  --stamp: #c1121f;
  --stamp-ink: #f7f0e2;
  --ok: #215c3a;
  --shadow: 0 18px 50px rgba(40, 28, 12, 0.12);
  --serif: "Source Serif 4", "Noto Serif", Georgia, serif;
  --sans: "Be Vietnam Pro", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #f4e7c8 0%, transparent 55%),
    radial-gradient(900px 400px at 110% 0%, #e7d3b4 0%, transparent 50%),
    var(--paper);
  line-height: 1.45;
}

.rule {
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 16px);
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.stamp {
  width: 54px;
  height: 54px;
  border: 2.5px solid var(--stamp);
  border-radius: 50%;
  color: var(--stamp);
  display: grid;
  place-items: center;
  transform: rotate(-11deg);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: center;
  background: rgba(247, 240, 226, 0.7);
}

.brand b { display: block; font-size: 18px; letter-spacing: -0.02em; }
.brand span { color: var(--muted); font-size: 13px; }

.top a.quiet {
  color: var(--muted);
  font-size: 13px;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 36px;
  align-items: start;
}

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
}

.lede {
  font-size: 17px;
  color: #3f382f;
  max-width: 38ch;
  margin: 0 0 22px;
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 0;
  margin: 0 0 8px;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}
.steps li { display: flex; gap: 8px; align-items: baseline; }
.steps i {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--stamp);
}

.sheet {
  background: var(--sheet);
  border: 1px solid #e2d4bd;
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
  position: relative;
}
.sheet:before {
  content: "";
  position: absolute;
  inset: 10px auto auto 10px;
  right: 10px;
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--stamp) 0 18px, transparent 18px 28px);
  opacity: 0.85;
}

label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 0 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  background: transparent;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  padding: 8px 0 10px;
  color: var(--ink);
  outline: none;
}
textarea:focus { border-bottom-color: var(--stamp); }

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

button, .btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--sheet);
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-ok { background: var(--ok); color: #f3fff6; }
.btn-stamp { background: var(--stamp); color: var(--stamp-ink); }

.hint { font-size: 12px; color: var(--muted); }

.progress {
  margin-top: 18px;
  display: none;
}
.progress.on { display: block; }
.bar {
  height: 8px;
  background: #e5d8c3;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--stamp);
  transition: width 0.25s ease;
}
.prog-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}

.result {
  display: none;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.result.on { display: block; }
.result h2 {
  font-family: var(--serif);
  font-size: 26px;
  margin: 0 0 8px;
  line-height: 1.15;
}
.meta { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.linkbox {
  font-family: var(--mono);
  font-size: 12px;
  background: #efe6d4;
  padding: 10px 12px;
  word-break: break-all;
  margin: 12px 0;
}

.err {
  display: none;
  margin-top: 14px;
  color: var(--stamp);
  font-size: 14px;
}
.err.on { display: block; }

.foot {
  margin-top: 48px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 22px; }
  h1 { font-size: 46px; }
  .top { margin-bottom: 22px; }
}
