/* The contact page (views/contact.templ, contact.js): the form on bare paper in the middle of a watercolour. The demo
   page's sky across the top with handsets hanging from the top of the page on fine curly cords, receding towards the
   upper middle; the newsletter's valley along the bottom with a payphone on the roadside. Sending rings them, then the
   thank-you takes the form's place. The art was picked on demos/contact. */
html, body { background: var(--db-bg); }

/* the bar (the redrawn pages' own, swiss.css) sits on the sky instead of on its own strip of paper */
.sw-bar {
  position: absolute;
  top: var(--um-launch-h, 0px);
  left: 0;
  right: 0;
}

/* no mono here either (the owner, 2026-11-25): the eyebrow in the main face, set apart by weight */
.ct-eyebrow {
  font-family: var(--sw-sans);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none;
}

.ct {
  position: relative;
  min-height: max(100svh, 960px);
  overflow: hidden;
}
.ct-sky {
  position: absolute;
  inset: 0 0 auto;
  height: 40%;
  background-position: center top;
  background-size: auto 100%;
  background-repeat: repeat-x;
}

/* ------------------------------------------------ the handsets in the sky: each picture starts at its cord's top, so
   a smaller one hangs higher; --w (vw) and the side come from the template, each sways from the top of its cord */
/* the cords fade in below the top bar, so they don't run behind its words */
.ct-hangs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mask-image: linear-gradient(transparent 24px, #000 76px);
}
.ct-hang {
  --ww: min(calc(var(--w) * 1vw), calc(var(--w) * 15px));
  position: absolute;
  top: 0;
  width: var(--ww);
  transform-origin: 50% 0;
  pointer-events: none;
  animation: ct-sway var(--d) ease-in-out var(--delay) infinite alternate;
}
.ct-hang > img { display: block; width: 100%; height: auto; transform-origin: 50% 0; user-select: none; }
.ct-hang .ct-rings { left: 50%; bottom: 2%; width: 190%; transform: translateX(-50%); }
@keyframes ct-sway { from { transform: rotate(var(--r0)); } to { transform: rotate(var(--r1)); } }

/* ------------------------------------------------ the valley and the payphone */
.ct-land {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: max(100%, 1300px);
  aspect-ratio: 2400 / 1018;
  transform: translateX(-50%);
  --booth-x: 20.5%;
}
/* the meadow under the path fades into the paper above the footer */
.ct-valley {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  mask-image: linear-gradient(#000 88%, transparent);
  pointer-events: none;
  user-select: none;
}
/* the payphone on the roadside just behind the path, on the open stretch on the left between two trees, about 1.3 times
   a person's height there, so the trees behind it read as further away; its rings sit on the phone itself */
.ct-booth { position: absolute; left: var(--booth-x); bottom: 17.2%; width: 6%; }
.ct-booth > img { display: block; width: 100%; height: auto; user-select: none; }
.ct-booth .ct-rings { left: 40%; top: 31%; width: 150%; transform: translate(-50%, -50%); }

/* ------------------------------------------------ ringing: the phone rattles and two pairs of pencil arcs draw out
   from it and fade (contact.js adds .is-ringing) */
.ct-rings { position: absolute; height: auto; overflow: visible; pointer-events: none; }
.ct-rings path {
  fill: none;
  stroke: var(--db-fg);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  opacity: 0;
}
.is-ringing > img { animation: ct-rattle .9s ease-in-out; }
.is-ringing .ct-rings path { animation: ct-wave 1s ease-out forwards; }
.is-ringing .ct-rings .ct-far { animation-delay: .14s; }
@keyframes ct-rattle {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(8deg); }
  20% { transform: rotate(-7deg); }
  30% { transform: rotate(6deg); }
  40% { transform: rotate(-5deg); }
  50% { transform: rotate(4deg); }
  60% { transform: rotate(-3deg); }
  70% { transform: rotate(2deg); }
  80% { transform: rotate(-1deg); }
}
@keyframes ct-wave {
  0% { stroke-dashoffset: 60; opacity: 0; }
  20% { opacity: .7; }
  60% { stroke-dashoffset: 0; opacity: .7; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* ------------------------------------------------ the form and the thank-you share one place, on a soft, uneven patch
   of paper so the sky and the land run right up to the words */
.ct-box {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  width: min(100vw - 32px, 34rem);
  padding: 32px 0 24px;
  text-align: center;
  isolation: isolate;
}
.ct-box::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -70px -130px -80px;
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--db-bg) 96%, transparent) 0%,
    color-mix(in srgb, var(--db-bg) 92%, transparent) 60%,
    color-mix(in srgb, var(--db-bg) 55%, transparent) 82%,
    transparent 100%);
  filter: url(#ct-wash);
}
.ct-defs { position: absolute; }
.ct-stage { display: grid; }
.ct-stage > * {
  grid-area: 1 / 1;
  transition: opacity .45s ease, transform .55s cubic-bezier(.2, .7, .2, 1), visibility 0s linear 0s;
}
.ct-write { align-self: center; }
.ct-done {
  align-self: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition-delay: 0s, 0s, .55s;
}
.is-leaving .ct-write { opacity: 0; transform: translateY(-14px); pointer-events: none; }
.is-sent .ct-write { opacity: 0; visibility: hidden; transition-delay: 0s, 0s, .45s; }
.is-sent .ct-done { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.ct-eyebrow { margin: 0 0 14px; color: var(--db-fg-3); }
.ct-title { margin: 0 0 12px; }
.ct-line { margin: 0 auto 20px; max-width: 28rem; text-wrap: balance; }

.ct-form { display: grid; gap: 8px; margin: 0; text-align: left; }
.ct-form .db-input, .ct-form .db-textarea { background: color-mix(in srgb, var(--db-raised) 72%, transparent); }
.ct-message { min-height: 112px; resize: vertical; }
.ct-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* why they write: three chips in a row */
.ct-why {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
}
.ct-opt { position: relative; cursor: pointer; }
.ct-opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.ct-opt span {
  display: block;
  padding: 7px 14px;
  border-radius: var(--radius-db-full);
  background: color-mix(in srgb, var(--db-raised) 72%, transparent);
  box-shadow: inset 0 0 0 1px var(--db-edge-2);
  color: var(--db-fg-2);
  font: 450 var(--db-size-body)/1.3 var(--font-db);
  letter-spacing: -0.01em;
  transition: background-color var(--duration-db) var(--ease-db), color var(--duration-db) var(--ease-db);
}
.ct-opt:hover span { color: var(--db-fg); }
.ct-opt input:checked + span { background: var(--db-field); color: var(--db-field-ink); box-shadow: none; }
.ct-opt input:focus-visible + span { outline: 2px solid var(--db-focus); outline-offset: 2px; }

.ct-send { justify-self: center; margin-top: 4px; min-width: 8rem; justify-content: center; }
.ct-send[aria-busy="true"] { opacity: .7; cursor: progress; }
.ct-problem {
  margin: 4px 0 0;
  text-align: center;
  color: var(--db-c-critical-text);
  font: 500 var(--db-size-body)/1.4 var(--font-db);
}
.ct-problem[hidden] { display: none; }
.ct-ways { margin: 16px 0 0; color: var(--db-fg-3); }
.ct-ways a { color: var(--db-fg-2); text-underline-offset: 3px; }
.ct-ways span { margin: 0 6px; }

.ct-acts { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 20px; }
.ct-again { color: var(--db-fg-2); text-underline-offset: 3px; }

/* the field for robots, out of sight for people */
.ct-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .ct-hang { animation: none; transform: rotate(var(--r0)); }
  .is-ringing > img { animation: none; }
  .ct-stage > * { transform: none !important; }
}

@media (max-width: 700px) {
  .ct { min-height: max(100svh, 1180px); }
  .ct-box { top: 43%; }
  .ct-box::before { inset: -50px -40px -60px; }
  .ct-two { grid-template-columns: minmax(0, 1fr); }
  /* the handsets: one pair fewer, the rest about twice as big, or they read as specks */
  .ct-hang { --ww: calc(var(--w) * 1.9vw); }
  .ct-hang[data-pair="3"] { display: none; }
  /* a narrow window shows the right of the valley: the payphone, the bridge and the edge of the village */
  .ct-land {
    width: min(267vw, 1460px);
    left: calc(min(267vw, 1460px) * -0.48);
    transform: none;
    --booth-x: 53%;
  }
  .ct-booth { width: 8%; }
}
