/* Template pages (/vorlagen/<slug>/): one template to fill in on paper, copy, or keep as a shortcut.
   Builds on site.css (paper, keys, .form slip, memos, faq); only the layout of the first screen lives here. */

/* on very wide screens the page keeps a readable width: the edges grow instead of the slip and the gaps */
.top, section, footer.site { padding-inline: max(var(--pad), calc((100% - 1440px) / 2)); }

.tpl { padding-top: clamp(104px, 14vh, 148px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto auto auto auto 1fr; column-gap: clamp(28px, 5vw, 80px); align-items: start; }
.tpl > .tag, .tpl__title, .tpl__lead, .tones { grid-column: 1; }
.tpl__title { margin-top: 14px; font: 400 clamp(42px, 4.4vw, 66px)/.95 var(--note); letter-spacing: -.035em; text-wrap: balance; hyphens: auto; }
.tpl__lead { margin-top: 18px; max-width: 40ch; color: var(--muted); font-size: 18px; }
.tones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.tones .key { font-size: 15px; }
.tpl__desk { grid-column: 2; grid-row: 1 / span 5; } /* the last row takes the slack, so title, lead and tones stay together */

/* the slip is a tool here, not a picture: it is there at once and does not drift while you type (site.js animates .form) */
.anim .tpl__slip.rv { opacity: 1; animation: none !important; translate: none; }
.tpl__slip { transform: rotate(-.8deg); font-size: clamp(20px, 1.9vw, 29px); line-height: 1.55; }
.tpl__slip > .key { font-size: 15px; }
.tpl__slip p + p { margin-top: .7em; }
.tpl__slip .nb { white-space: nowrap; }
.tpl__slip input { width: auto; min-width: 3ch; font-size: .94em; line-height: 1.2; }
/* the placeholder is the label: the accent family, dark enough on the field's tint (5.2:1) and on its focused tint (4.6:1) */
.tpl__slip input::placeholder { color: #a54a0a; opacity: 1; }
/* touch: the <label> around the field is the line (about 31 px) plus 3 px above and below and passes the tap on; more would overlap the fields of the next line and send taps to the wrong one */
.tpl__slip .fld { display: inline-block; }
@media (pointer: coarse), (max-width: 700px) { .tpl__slip .fld { padding: 3px 0; margin: -3px 0; } }

.tpl__do { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 34px; }

/* what Snipmunk would do instead: a band in the warm tint of the keys and fields, text on the left, the app under the slip.
   Light enough to sit on the paper, coloured enough to be seen as the offer (the dark ink as a surface read as brown). */
/* it starts right under the copy button, so on a desktop its top already shows on the first screen */
.tpl__next { grid-column: 1 / -1; grid-row: 6; margin-top: clamp(48px, 6vw, 84px); padding: clamp(28px, 4vw, 56px); border-radius: 22px; background: var(--tint);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(28px, 5vw, 80px); row-gap: 18px;
  grid-template-rows: 1fr auto auto auto 1fr; grid-template-areas: ". app" "title app" "how app" "get app" ". app"; }
.tpl__next > .app { grid-area: app; }
.tpl__nexttitle { grid-area: title; max-width: 18ch; font: 400 clamp(30px, 3.2vw, 48px)/1.08 var(--note); letter-spacing: -.025em; text-wrap: balance; }
.tpl__next .key { background: var(--paper); box-shadow: 0 1px 0 var(--keyedge); }
.tpl__nexttitle .key { font-size: .7em; vertical-align: .12em; }
.tpl__how { grid-area: how; max-width: 46ch; font-size: 17px; line-height: 1.55; color: var(--muted); }
.tpl__how .key { font-size: 14px; }

/* the app over a chat: colours and shapes from design/DIRECTION.md and the Android slip sheet (SlipSheet.kt) */
.app { --g: #f7f6f3; --p: #fff; --i: #1e1b18; --m: #6b645c; --l: #e8e5df; --a: #c2570c; --t: #fdeedd; --mt: #a04608;
  position: relative; width: 100%; max-width: 330px; height: 462px; margin: 0 auto; overflow: hidden; border: 7px solid #120b06; border-radius: 30px;
  background: #ebe6de; color: var(--i); font: 400 13px/1.4 var(--ui); user-select: none; }
.app svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.app__head { display: flex; align-items: center; gap: 9px; height: 48px; padding: 0 12px; background: var(--p); border-bottom: 1px solid var(--l); font-weight: 500; }
.app__head b { font-weight: 500; border-radius: 4px; padding: 0 3px; transition: background .3s; }
.app__head.is-linked b, .app__slip .m.is-linked { background: #fbdfc0; }
.app__slip .m { transition: background .3s; }
.app__head i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #d9cfc2; font: 500 11px/1 var(--ui); font-style: normal; color: var(--m); }
.app__msgs { display: grid; gap: 8px; align-content: start; padding: 12px; }
.app__in, .app__out { max-width: 84%; padding: 7px 10px; border-radius: 12px; background: var(--p); box-shadow: 0 1px 1px rgb(0 0 0 / .08); }
.app__in { border-top-left-radius: 3px; }
.app__out { justify-self: end; border-top-right-radius: 3px; background: #f1e3cf; white-space: pre-line; }
.app__compose { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: flex-end; min-height: 38px; max-height: 150px; overflow: hidden; padding: 9px 14px; border-radius: 19px; background: var(--p); box-shadow: 0 1px 2px rgb(0 0 0 / .1); white-space: pre-line; }
.app__compose span:first-child { font: inherit; }
.app__compose.is-key span:first-child { font: 500 13px/1.4 var(--mono); }
.app__caret { flex: none; width: 1.5px; height: 16px; margin-left: 1px; background: var(--a); animation: blink 1s steps(1) infinite; }

.app__sheet { position: absolute; inset: auto 0 0 0; padding: 10px 12px 12px; border-radius: 18px 18px 0 0; background: var(--g); box-shadow: 0 -10px 26px rgb(0 0 0 / .2);
  transform: translateY(104%); transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.app__sheet.is-up { transform: none; }
.app__hero { display: flex; align-items: center; gap: 8px; }
.app__hero > div { flex: 1; }
.app__title { display: flex; align-items: center; gap: 8px; font: 400 12.5px/1.3 var(--note); color: var(--m); }
.app__title i { width: 30px; height: 1px; background: var(--l); }
.app__key { font: 500 19px/1.25 var(--mono); letter-spacing: -.03em; }
.app__icon { color: var(--m); }
.app__entry { margin: 8px 0 2px; }
.app__which { font: 500 11.5px/1.3 var(--ui); color: var(--m); }
.app__which b { font-weight: 500; border-radius: 4px; padding: 0 2px; transition: background .3s; }
.app__chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
/* SlipChip: 9dp corners, accent outline when open, the mark tint once chosen, a grey hairline for "Andere …" */
.app__chip { display: inline-flex; align-items: center; height: 27px; padding: 0 6px; border-radius: 8px; box-shadow: inset 0 0 0 1.25px var(--a); color: var(--mt); font: 500 11px/1 var(--ui); white-space: nowrap; transition: background .3s; }
.app__chip--done { background: var(--t); box-shadow: none; }
.app__chip--quiet { box-shadow: inset 0 0 0 1px var(--l); color: var(--i); }
.app__which b.is-linked, .app__chip.is-linked { background: #fbdfc0; }
.app__slot { height: 6px; margin-top: 4px; border-radius: 3px; background: var(--i); }
.app__slip { --t: 5px; margin: -3px 6px 0; padding: 9px 11px 15px; background: var(--p); font: 400 14px/1.75 var(--note); white-space: pre-line; }
.app__slip .m { border-radius: 4px; padding: 1px 4px; margin: 0 1px; color: var(--mt); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.app__slip .m--open { box-shadow: inset 0 0 0 1.25px var(--a); }
.app__slip .m--done { background: var(--t); }
.app__slip .m--active { background: var(--t); box-shadow: inset 0 0 0 2px var(--a); }
.app__slip .m--active.is-empty { background: rgb(255 255 255 / .6); color: rgb(160 70 8 / .45); }
.app__slip .cr { display: inline-block; width: 1.5px; height: 1em; margin: 0 1px 0 2px; vertical-align: -.12em; background: var(--a); animation: blink 1s steps(1) infinite; }
.app__slip .is-empty .cr { margin: 0 3px 0 0; }
.app__answer { display: flex; align-items: center; gap: 10px; min-height: 34px; margin-top: 6px; padding: 0 2px; font: 500 12.5px/1 var(--ui); color: var(--m); }
.app__answer span { flex: 1; }
.app__actions { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.app__insert { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 19px; background: var(--a); color: #fff; font: 500 13.5px/1 var(--ui); transition: transform .1s, filter .1s; }
.app__insert.is-press { transform: scale(.96); filter: brightness(.9); }
.app__round { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--l); color: var(--m); }
.app__tap { position: absolute; z-index: 3; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: rgb(30 27 24 / .16); box-shadow: inset 0 0 0 2px rgb(30 27 24 / .32); opacity: 0; pointer-events: none; }
.app__tap.is-on { animation: tap .55s ease-out; }
@keyframes tap { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.35); } }
/* the loop starts over: a short dim with a note, so the replay does not read as a second message */
.app::after { content: "↻ Noch einmal"; position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgb(30 27 24 / .38);
  color: #fff; font: 500 13px/1 var(--ui); letter-spacing: .01em; opacity: 0; pointer-events: none; transition: opacity .3s; }
.app.is-again::after { opacity: 1; }
.app__head span { margin-left: auto; color: var(--m); font-size: 11.5px; font-weight: 400; }
.tpl__get { grid-area: get; margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 4px; font-size: 14px; color: var(--muted); }
.tpl__get a:not(.cta) { color: inherit; text-underline-offset: 3px; }
.tpl__next.is-nudge > .app { animation: nudge .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes nudge { 35% { transform: translateY(-4px) rotate(-.6deg); } }

/* what Snipmunk is, and next to it four related templates as slips (the .cards of the pack pages) */
.tpl__about { align-items: start; }
.tpl__about .cta { margin-top: 28px; }
.tpl__more { font: 400 clamp(24px, 2.2vw, 32px)/1.15 var(--note); letter-spacing: -.02em; }
.tpl__about .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 22px; }
.tpl__about .cards li { position: relative; min-height: 0; }
.tpl__about .cards .key::after { content: ""; position: absolute; inset: 0; } /* the whole slip is the link */
.tpl__about .cards span.t { font-size: 15px; }

/* the overview /vorlagen/: every template page as a slip, the whole slip is the link */
.tpl-all { padding-top: clamp(104px, 14vh, 148px); }
.tpl-all .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(32px, 5vh, 56px); }
.tpl-all .cards li { position: relative; min-height: 0; }
.tpl-all .cards .key::after { content: ""; position: absolute; inset: 0; }

@media (max-width: 900px) {
  .tpl-all .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpl { grid-template-columns: minmax(0, 1fr); }
  .tpl__desk { grid-column: 1; grid-row: auto; margin-top: 34px; }
  .tpl__slip { transform: none; }
  .tpl { grid-template-rows: none; }
  .tpl__next { grid-row: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "title" "app" "how" "get"; }
}
@media (max-width: 700px) {
  .tpl__about .cards, .tpl-all .cards { grid-template-columns: minmax(0, 1fr); } .tpl__about .cards span.t, .tpl-all .cards span.t { display: block; }
  .tpl__do .cta { flex: 1 1 100%; }
  .tpl__get .cta { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .tpl__next.is-nudge > .app { animation: none; } .app__sheet { transition: none; } .app__caret, .app__slip .cr { animation: none; } }
