:root { --hand: "Bradley Hand", "Segoe Print", "Noteworthy", "Segoe Script", cursive; --pen: #1E2B4F; --night: #111110; --night-hi: #23221F; }

/* Cartolina dello Studio, condivisa dalle due pagine. */

.hello { padding-top: clamp(28px, 4vw, 48px); }
.hello__title { margin: 0; font-size: clamp(30px, 4vw, 52px); font-weight: 500; letter-spacing: -.04em; line-height: 1.05; text-align: center; }
.hello__sub { max-width: 32em; margin: 14px auto clamp(28px, 4vw, 44px); font-size: 17px; line-height: 1.5; color: var(--ink-2); text-align: center; }
.scene {
  display: grid;
  justify-items: center;
  perspective: 2200px;
}
.postcard {
  position: relative;
  width: min(800px, 100%);
  display: grid;
  transform-style: preserve-3d;
  transition: transform 1.1s var(--ease-io), opacity .7s ease;
}
.pc-face {
  grid-area: 1 / 1;
  border-radius: 10px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, .04),
    0 30px 70px -30px rgba(0, 0, 0, .32),
    0 8px 18px -10px rgba(0, 0, 0, .1);
}
.pc-back {
  display: grid;
  grid-template-columns: 1.25fr 1px 1fr;
  gap: clamp(20px, 3vw, 32px);
  min-height: 460px;
  padding: clamp(22px, 3.4vw, 36px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)),
    #F7F4EC;
}
.pc-write { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pc-write textarea {
  border-radius: 0;
  flex: 1;
  width: 100%;
  min-height: 252px;
  resize: none;
  border: 0;
  
  padding: 2px 0 0;
  font-family: var(--hand);
  font-size: 27px;
  line-height: 36px;
  color: var(--pen);
  background: repeating-linear-gradient(to bottom, transparent 0 35px, rgba(30, 30, 30, .13) 35px 36px);
  background-attachment: local;
}
.pc-write textarea::placeholder, .pc-sign input::placeholder { color: rgba(30, 43, 79, .38); }
.pc-sign {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid rgba(30, 30, 30, .2);
}
.pc-sign label, .pc-to__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pc-sign input {
  flex: 1;
  min-width: 0;
  border: 0;
  
  background: transparent;
  padding: 4px 0 2px;
  font-family: var(--hand);
  font-size: 27px;
  color: var(--pen);
}
.pc-rule { background: rgba(30, 30, 30, .14); }
.pc-addr {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 300px;
}

.stamp {
  position: absolute;
  top: 0; right: 0;
  width: 90px; height: 110px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .16));
  transform: rotate(3deg);
}
.stamp__paper {
  width: 100%; height: 100%;
  padding: 7px;
  background: #fff;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    radial-gradient(circle at center, transparent 3px, #000 3.5px) -5px -5px / 10px 10px;
  mask:
    linear-gradient(#000 0 0) content-box,
    radial-gradient(circle at center, transparent 3px, #000 3.5px) -5px -5px / 10px 10px;
}
.stamp__in {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  background: radial-gradient(120% 90% at 30% 15%, var(--night-hi), var(--night));
  color: var(--bg);
}
.stamp__in svg { width: 40px; height: 36px; }
.stamp__in span { font-size: 9px; font-weight: 600; letter-spacing: .24em; opacity: .7; }

.postmark {
  position: absolute;
  top: 34px;
  right: 18px;
  width: 200px;
  fill: none;
  stroke: rgba(28, 28, 32, .55);
  stroke-width: 1.6;
  opacity: 0;
  transform: scale(1.35) rotate(-14deg);
  transition: opacity .25s ease, transform .45s cubic-bezier(.3, 1.6, .5, 1);
  pointer-events: none;
}
.postmark text { fill: rgba(28, 28, 32, .62); stroke: none; font-family: var(--font); font-size: 9.5px; font-weight: 600; letter-spacing: .16em; }
.postmark .pm-date { font-size: 12px; letter-spacing: .06em; }
.is-stamped .postmark { opacity: 1; transform: scale(1) rotate(-14deg); }

.pc-to { display: grid; }
.pc-to__line {
  padding: 12px 0 8px;
  border-bottom: 1px solid rgba(30, 30, 30, .2);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.pc-to__label { margin-bottom: 2px; }

.pc-front {
  position: relative;
  overflow: hidden;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  transform: rotateY(180deg);
  background: radial-gradient(120% 95% at 22% 12%, var(--bg-hi) 0%, var(--bg) 52%, #C9C9C9 100%);
}
.pc-front__small { font-family: var(--hand); font-size: 36px; color: var(--ink-2); }
.pc-front__big { width: clamp(200px, 52vw, 440px); height: auto; aspect-ratio: 1176 / 241; color: var(--ink); }
.pc-front__dots { display: flex; gap: 10px; margin-top: 22px; }
.pc-front__dots span { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.pc-front__mark {
  position: absolute;
  right: -6%; bottom: -14%;
  width: 46%; height: auto;
  aspect-ratio: 239 / 215;
  color: rgba(0, 0, 0, .05);
}

.postcard.is-flipped { transform: rotateY(180deg); }
.postcard.is-sent { transform: translateY(-70px) rotateY(180deg) rotateZ(5deg) scale(.86); opacity: 0; }

.pc-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
}
.pc-error { text-align: center; min-height: 20px; font-size: 14px; color: #A3361B; }
.pc-privacy { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.pc-privacy a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.pc-error:empty { min-height: 0; }
.pc-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 26px 0 28px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  box-shadow: 0 18px 34px -18px rgba(0, 0, 0, .55);
  transition: transform .4s var(--ease), box-shadow .4s;
}
.pc-btn:hover { transform: translateY(-2px); box-shadow: 0 22px 40px -18px rgba(0, 0, 0, .6); }
.pc-btn:hover svg { transform: translateX(3px); }
.pc-btn svg { transition: transform .4s var(--ease); }
.pc-btn:active { transform: translateY(0) scale(.98); }

.pc-done {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 460px;
  margin-top: 8px;
  padding: 48px 0 8px;
  text-align: center;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  animation: rise .9s var(--ease);
}
.pc-done[hidden] { display: none; }
.pc-done__title { font-size: 30px; font-weight: 600; letter-spacing: -.03em; color: var(--ink); }
.link-btn { margin-top: 6px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.direct {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin-top: 64px;
  font-size: 16px;
  color: var(--ink-2);
  text-align: center;
}
.direct a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .5);
  font-size: 13px;
  font-weight: 600;
  transition: background .3s;
}
.chip:hover { background: #fff; }

.pc-front { background: radial-gradient(120% 95% at 22% 12%, #FBFAF6 0%, var(--paper) 52%, #D9D4C8 100%); }
.stamp__in { color: var(--paper); }
.pc-btn { border: 0; font-family: var(--sans); font-weight: 500; }
.pc-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .pc-btn svg { transform: scaleX(-1); }
.pc-error { margin: 0; }
.pc-privacy, .pc-done p { margin: 0; }
.direct { margin-top: 48px; }
@media (max-width: 760px) {
  .pc-back { grid-template-columns: 1fr; grid-template-rows: auto auto; min-height: 0; }
  .pc-rule { height: 1px; }
  .pc-write textarea { min-height: 216px; font-size: 25px; }
  .pc-addr { min-height: 210px; }
  .stamp { width: 70px; height: 90px; }
  .stamp__in svg { width: 30px; height: 27px; }
}


.hello { min-width: 0; }
.hello__title { margin-bottom: 32px; }
.pc-btn:disabled { cursor: wait; opacity: .65; }
.pc-sign input[type="email"] { direction: ltr; text-align: start; }
.pc-front { pointer-events: none; }
.chat {
  inset-block: calc(env(safe-area-inset-top) + 76px) auto;
  inset-inline-end: max(16px, env(safe-area-inset-right));
  width: min(420px, calc(100vw - 32px));
  height: min(620px, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 92px));
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 92px);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border-radius: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.chat__who, .chat__log { min-height: 0; }
.chat__head > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.chat__form textarea { min-width: 0; }
.chat__foot { flex-wrap: wrap; }
.chat__status { grid-row: 2 / 4; display: grid; align-content: center; justify-items: start; gap: 16px; padding: 20px; color: var(--ink-2); font-size: 15px; line-height: 1.5; overflow: auto; }
.chat__status a { text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.chat__retry { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); }
@media (max-width: 560px) {
  .chat { inset-inline: 12px; width: auto; }
  .pc-sign { flex-wrap: wrap; gap: 2px 10px; }
  .pc-sign input { width: 100%; flex-basis: 100%; }
}
