/* 1257end - two columns: logo, contact form and loader on the left, the framed scene on the right; the per-style look lives in themes.css */
html, body { margin: 0; height: 100%; }
body { font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
.stage {
  display: grid; box-sizing: border-box; width: 100%; min-height: 100vh; min-height: 100dvh;
  grid-template-columns: clamp(320px, 28vw, 440px) minmax(0, 1fr);
  /* the middle row grows with the form when the window is short, so nothing ever overlaps the logo (the page scrolls instead) */
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "head frame" "form frame" "loader frame";
  gap: 28px 44px; padding: 36px 40px 32px;
  transition: background 0.6s ease;
}
.side { display: contents; }
.cp-head { grid-area: head; }
.cp-contact { grid-area: form; align-self: center; min-width: 0; }
.cp-loader { grid-area: loader; justify-self: start; }
.frame { grid-area: frame; position: relative; min-height: 0; min-width: 0; overflow: hidden; }
.frame canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }

.cp-brand { min-width: 0; --space-6: 16px; --space-4: 12px; color: var(--ink); font-synthesis: none; }
.cp-brand .logo-link { color: inherit; text-decoration: none; display: inline-flex; }
.cp-brand .logo-link:focus-visible { outline: 2px solid var(--signal-red); outline-offset: 6px; }

/* claim and contact form, in each style's card, line, radius and type */
/* the claim always sets in two lines: site.js sizes it per style so its longer line fills the column (up to a cap) */
.cp-claim { margin: 0 0 26px; font-family: var(--font-display); font-weight: var(--w-display, 700); font-size: var(--claim-size, calc(26px * var(--ds, 1))); line-height: 1.12; color: var(--ink); }
.cp-claim > span { display: block; width: max-content; max-width: 100%; white-space: nowrap; }
.cp-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.cp-form__title { margin: 0 0 2px; font: 600 16px/1.35 var(--font-sans); color: var(--ink); text-wrap: balance; }
.cp-field { display: flex; flex-direction: column; gap: 6px; font: 600 13px/1.2 var(--font-sans); color: var(--ink); }
.cp-field input, .cp-field textarea {
  box-sizing: border-box; width: 100%; margin: 0; padding: 10px 12px;
  font: 400 15px/1.4 var(--font-sans); color: var(--ink); background: var(--white);
  border: max(1px, var(--stroke-fine)) solid color-mix(in srgb, var(--ink) 38%, transparent); border-radius: var(--radius-md);
}
.cp-field textarea { min-height: 120px; resize: vertical; }
.cp-field input:focus-visible, .cp-field textarea:focus-visible { outline: 2px solid var(--signal-red); outline-offset: 2px; }
.cp-field [aria-invalid="true"] { border-color: var(--signal-red); }
.cp-form .e-btn { align-self: flex-start; font-family: var(--font-display); font-weight: var(--w-display, 700); font-size: calc(16px * clamp(.8, var(--ds, 1), 1.25)); }
.cp-form__note { margin: 0; min-height: 1.35em; font: 400 13px/1.35 var(--font-sans); color: var(--ink); }

.cp-loader { display: flex; align-items: center; gap: 10px; min-height: 44px; box-sizing: border-box; padding: 0 0 0 14px; line-height: 1; max-width: 100%; }
.cp-track { display: block; flex: none; width: 72px; overflow: hidden; }
.cp-track > span { display: block; width: 100%; height: 100%; transform-origin: 0 50%; transform: scaleX(0); }
.cp-label, .cp-seed { white-space: nowrap; }
.cp-seed { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.cp-next { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.cp-next > span { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; box-sizing: border-box; }
.cp-next:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 1100px) { .cp-seed { display: none; } }
/* narrow screens: logo and loader on top, the scene, then the form; the page scrolls */
@media (max-width: 820px) {
  .stage {
    height: auto; min-height: 100dvh;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(300px, 64svh) auto;
    grid-template-areas: "head loader" "frame frame" "form form";
    gap: 16px 12px; padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .cp-head { align-self: center; }
  .cp-loader { justify-self: end; align-self: center; }
  .cp-contact { align-self: start; max-width: none; padding-top: 6px; }
  .cp-claim { margin-bottom: 18px; }
}
@media (max-width: 560px) {
  .cp-brand .e-logo { font-size: 26px !important; }
  .cp-brand .e-btn { min-height: 40px !important; padding: 0 18px !important; font-size: 15px !important; line-height: 18px !important; }
  .cp-track { width: 44px; }
  .cp-label, .cp-seed { display: none; }
  .cp-field input, .cp-field textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .stage { transition: none; } }
