/* Blueprint. Change the colors here. */
:root {
  --blue: #1d4e89;
  --blue-deep: #163d6c;
  --grid-minor: rgb(255 255 255 / 0.07);
  --grid-major: rgb(255 255 255 / 0.15);
  --line: #f4f8ff;
  --soft: #b9cff0;
  --note: #ffe9a6;
  --hand: "Segoe Print", "Bradley Hand", "Comic Neue", "Chalkboard SE", "Marker Felt", cursive;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: clamp(10px, 2vw, 24px);
  background:
    linear-gradient(var(--grid-major) 1px, transparent 1px) 0 0 / 100px 100px,
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px) 0 0 / 100px 100px,
    linear-gradient(var(--grid-minor) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--blue);
  color: var(--line);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--note); }
:focus-visible { outline: 2px dashed var(--note); outline-offset: 3px; }

.sheet { min-height: calc(100vh - 2 * clamp(10px, 2vw, 24px)); display: flex; flex-direction: column; border: 2px solid var(--line); outline: 1px solid var(--soft); outline-offset: 6px; }

.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--soft); font-family: var(--mono); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; }
.head p { margin: 0; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.logo svg { width: 20px; height: 20px; }
.sheet-no { color: var(--soft); }

.layout { flex: 1; display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(24px, 4vw, 56px); }

.stamp { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; padding: 6px 12px; border: 2px solid var(--note); color: var(--note); font-family: var(--mono); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; transform: rotate(-3deg); }
.stamp svg { width: 18px; height: 18px; }
h1 { margin: 0 0 18px; font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.lead { max-width: 460px; margin: 0 0 28px; color: var(--soft); font-size: 1.05rem; }

.notice { max-width: 440px; padding: 16px; border: 1px dashed var(--soft); }
.notice label { display: block; margin-bottom: 8px; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--soft); }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; height: 48px; padding: 0 12px; border: 1px solid var(--line); background: var(--blue-deep); color: var(--line); font: inherit; }
.row input::placeholder { color: var(--soft); }
.row input:focus-visible { outline-offset: 0; }
.row button { padding: 0 20px; border: 0; background: var(--line); color: var(--blue); font: 700 0.85rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.row button:hover { background: var(--note); }
.note { min-height: 1.6em; margin: 10px 0 0; color: var(--note); font-family: var(--hand); }

.drawing { margin: 0; }
.drawing svg { display: block; width: 100%; height: auto; overflow: visible; }
.draw path { fill: none; stroke: var(--line); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s ease-out forwards; animation-delay: var(--d, 0s); }
.draw .thin { stroke-width: 1.2; }
.draw .dash { stroke-width: 1; stroke: var(--soft); }
.dims, .notes { opacity: 0; animation: appear 0.8s ease-out forwards 3.2s; }
.dims path { fill: none; stroke: var(--soft); stroke-width: 1.2; }
.dims .arrow { fill: var(--soft); stroke: none; }
.dims text { fill: var(--soft); font: 13px var(--mono); text-anchor: middle; }
.notes .leader { fill: none; stroke: var(--note); stroke-width: 1.5; stroke-dasharray: 4 4; }
.notes text { fill: var(--note); font: 17px var(--hand); }
.notes .ring { fill: none; stroke: var(--note); stroke-width: 2; }
.notes { animation-delay: 3.8s; }

.title-block { margin: 18px 0 0 auto; border-collapse: collapse; font-family: var(--mono); font-size: 0.78rem; }
.title-block th, .title-block td { padding: 5px 10px; border: 1px solid var(--soft); text-align: left; }
.title-block th { color: var(--soft); font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; }
.title-block td { color: var(--line); }

.foot { padding: 10px 20px; border-top: 1px solid var(--soft); font-family: var(--mono); font-size: 0.78rem; color: var(--soft); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .title-block { margin-left: 0; }
}
@media (max-width: 480px) {
  .row { flex-direction: column; }
  .row input { flex: none; }           /* keep its 48px height when stacked */
  .row button { height: 46px; }
  .title-block { width: 100%; font-size: 0.7rem; }
  .title-block th, .title-block td { padding: 4px 6px; }
  .sheet-no { display: none; }
}

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

/* Reduced motion: show the finished drawing straight away. */
@media (prefers-reduced-motion: reduce) {
  .draw path { animation: none; stroke-dashoffset: 0; }
  .dims, .notes { animation: none; opacity: 1; }
}
