/* poster.valentinesings.com — the poster tool. Tokens and fonts come from /assets/css/site.css. */

@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 700; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-700-normal.woff2") format("woff2"); }

body.poster-page { background: var(--paper); color: var(--black); min-height: 100svh; }

.tool { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0; min-height: 100svh; }
.tool__form { padding: 5svh 4vw 6svh 5vw; border-right: 1px solid var(--black); }
.tool__preview { position: sticky; top: 0; align-self: start; display: grid; grid-template-rows: 1fr auto; align-content: center; gap: 16px; padding: 5svh 4vw; min-height: 100svh; }

.brand { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 4svh; }
.brand h1 { margin: 0; font-size: var(--size-nav); font-weight: 500; letter-spacing: -0.025em; }
.brand h1 em { font-style: normal; color: var(--pink); }
.brand a { font-size: var(--size-small); text-decoration: none; opacity: .7; }
.brand a:hover { opacity: 1; color: var(--pink); }

/* the form — the contact form's grid language */
.grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--black); border-left: 1px solid var(--black); }
.grid .field--half { grid-column: auto; }
.grid .field { display: flex; flex-direction: column; min-height: 76px; padding: 12px 16px 12px; border-right: 1px solid var(--black); border-bottom: 1px solid var(--black); }
.grid .field--full { grid-column: 1 / -1; }
.field label { font-size: var(--size-small); font-weight: 500; letter-spacing: .01em; display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
.field label .hint { opacity: .45; font-weight: 400; white-space: normal; text-align: right; overflow-wrap: normal; }
.field input, .field textarea { width: 100%; margin-top: 4px; padding: 2px 0; border: 0; border-radius: 0; background: transparent; font-size: clamp(16px, 1.25vw, 22px); line-height: 1.3; outline: none; resize: none; }
.field textarea { min-height: 2.6em; field-sizing: content; }
.field:focus-within label { color: var(--pink); }

.section { margin-top: 3.2svh; }
.section > p { font-size: var(--size-small); font-weight: 500; letter-spacing: .01em; margin-bottom: 10px; display: flex; justify-content: space-between; }
.section > p span { color: var(--pink); font-weight: 400; }

.tones { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; }
.section--row { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: var(--size-small); font-weight: 500; cursor: pointer; padding-bottom: 2px; white-space: nowrap; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__box { width: 22px; height: 22px; border: 1px solid var(--black); background: transparent; position: relative; transition: background-color .15s ease, border-color .15s ease; }
.toggle input:checked + .toggle__box { background: var(--pink); border-color: var(--pink); }
.toggle input:checked + .toggle__box::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border-right: 2px solid var(--paper); border-bottom: 2px solid var(--paper); transform: rotate(45deg); }
.toggle input:focus-visible + .toggle__box { outline: 2px solid var(--pink); outline-offset: 3px; }
.tone { aspect-ratio: 1; border: 1px solid transparent; border-radius: 0; background: var(--tone); cursor: pointer; padding: 0; transition: transform .25s var(--ease-out); }
.tone:hover { transform: translateY(-2px); }
.tone[aria-pressed="true"] { outline: 2px solid var(--black); outline-offset: 2px; }

.formats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--black); }
.formats button { display: grid; gap: 2px; min-height: 52px; padding: 8px 6px; border: 0; border-left: 1px solid var(--black); border-radius: 0; background: transparent; font-size: var(--size-small); font-weight: 500; cursor: pointer; }
.formats button:first-child { border-left: 0; }
.formats button small { font-weight: 400; opacity: .55; font-size: .85em; }
.formats button[aria-pressed="true"] { color: var(--pink); }

.actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.download { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1.1em; border: 0; border-radius: 0; background: var(--pink); color: var(--paper); font-size: var(--size-caption); font-weight: 500; letter-spacing: -0.015em; cursor: pointer; box-shadow: 0 3px 0 var(--black); transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out); }
.download:hover { transform: translateY(-1px) rotate(-1.5deg); box-shadow: 0 4px 0 var(--black); }
.download:active { transform: translateY(3px); box-shadow: 0 0 0 var(--black); }
.download:disabled { opacity: .6; cursor: progress; transform: none; }
.reset { border: 0; background: none; padding: 0; font-size: var(--size-small); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; opacity: .7; }
.reset:hover { opacity: 1; color: var(--pink); }
.status { font-size: var(--size-small); opacity: .7; min-height: 1.4em; }

.preview-wrap { display: grid; place-items: center; }
canvas[data-preview] { width: min(100%, calc((100svh - 14svh - 60px) * .72)); max-width: 460px; height: auto; display: block; border: 1px solid var(--black); background: var(--paper); }
.preview-note { font-size: var(--size-small); opacity: .55; text-align: center; }

@media (max-width: 900px) {
  .tool { grid-template-columns: 1fr; }
  .tool__form { border-right: 0; order: 2; padding: 4svh 6vw 8svh; }
  .tool__preview { position: static; order: 1; min-height: 0; padding: 4svh 6vw 0; gap: 14px; }
  canvas[data-preview] { width: min(100%, 62vh * .75, 420px); }
  .tones { grid-template-columns: repeat(12, 1fr); }
  .section--row { grid-template-columns: 1fr; align-items: start; }
  .grid { grid-template-columns: 1fr; }
  .grid .field--half { grid-column: 1 / -1; }
  .field input, .field textarea { font-size: 16px; }
}
