/* =========================================================
   Where are you going? (Grey)
   CHANGED (landing page): the "wayg" Figma design. A gradient hero with an
   inline composer, a grid of recent notes, and a share screen after posting.
   Replaces the infinite wall.
   ========================================================= */

/* Aeonik: licensed, served as our own files (not Google Fonts). Only the three weights the
   design actually uses (see --font-sans below); the full family's source files live in
   fonts-source/, outside public/, so only these are ever shipped to visitors. */
@font-face {
  font-family: "Aeonik";
  src: url("fonts/aeonik/aeonik-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Aeonik";
  src: url("fonts/aeonik/aeonik-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Aeonik";
  src: url("fonts/aeonik/aeonik-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Design tokens from the Figma file */
  --grey-900: #040506;
  /* gr/dark-grey/900: page background */
  --grey-800: #14181f;
  /* gr/dark-grey/800: card borders */
  --card-bg: #0b0f16;
  --text-default: #1b1f28;
  /* text/default */
  --text-softer: #8592ad;
  /* text/softer: composer placeholder and extras */
  --text-soft: #49546c;
  /* the composer's icons */
  --white-80: rgba(255, 255, 255, .8);
  --scrim: rgba(20, 24, 31, .75);
  --danger: #ff8fa3;
  --focus: #86b9f8;

  /* Kept for the signature pad (see "Bencho's design tokens" below): light paper, dark ink */
  --paper: #ffffff;
  --ink: #121212;

  /* Aeonik (licensed) is loaded above via @font-face, in the three weights this file actually
     uses. Figtree (Google Fonts, see index.astro) is the fallback if that somehow fails to load. */
  --font-sans: "Aeonik", "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--grey-900);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: #fff;
  background: var(--grey-900);
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

img {
  max-width: none;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: #fff;
  color: #000;
  padding: .6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -.16px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}

.btn:disabled {
  opacity: .6;
  cursor: progress;
}

.btn-light {
  background: #fff;
  color: var(--text-default);
}

.btn-light:hover:not(:disabled) {
  background: #e7eaf0;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: #fff;
}

.btn-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, .08);
}

.btn-wide {
  width: 100%;
}

.btn img {
  display: block;
  width: 16px;
  height: 16px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: inherit;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, .1);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.link-btn {
  align-self: center;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, .7);
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: 6px;
}

.link-btn:hover {
  color: #fff;
}

/* ---------- Header ---------- */
.site-header {
  position: absolute;
  z-index: 10;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, calc(100% - 32px));
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  border-radius: 6px;
}

.brand img {
  display: block;
  width: 93px;
  height: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 34px;
}

.header-login {
  color: #fff;
  font-size: 14px;
  line-height: 14px;
  text-decoration: none;
  border-radius: 4px;
}

.header-login:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  height: 54px;
  padding: 0 20px;
  border-radius: 12px;
  background: #fff;
  color: #000;
  font-size: 14px;
  line-height: 14px;
  text-decoration: none;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, .3), inset 0 -1px 2px rgba(26, 26, 26, .1);
}

.btn-start:hover {
  background: #e7eaf0;
}

@media (max-width: 600px) {
  .header-actions {
    gap: 18px;
  }

  .btn-start {
    height: 44px;
    padding: 0 14px;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: #fff;
  min-height: 987px;
  padding: 206px 16px 120px;
}

/* The design's 1728px frame, centered, so the glows keep their layout on any screen width */
.hero-glow {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1728px;
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
}

.glow {
  position: absolute;
  display: block;
}

.glow-1 {
  left: -786px;
  top: -519px;
  width: 3299px;
  height: 1568px;
}

.glow-2 {
  left: -506px;
  top: -547px;
  width: 2739px;
  height: 1342px;
}

.glow-3 {
  left: -96px;
  top: -506px;
  width: 1919px;
  height: 1012px;
}

/* The plane: Figma's 12s loop, sampled every 10% (the path is a gentle curve, so this is
   indistinguishable from the 120-point original) */
.plane {
  position: absolute;
  left: 84.94%;
  top: 248.7px;
  z-index: 1;
  width: 89px;
  height: 26px;
  pointer-events: none;
  rotate: -6.08deg;
  animation: plane-fly 12s linear infinite, plane-tilt 12s infinite;
}

.plane img {
  display: block;
  width: 89px;
  height: 26px;
  transform: skewX(-4.8deg);
}

@keyframes plane-fly {
  0% {
    translate: -1580.66px 152.02px;
  }

  10% {
    translate: -1392.39px 122.18px;
  }

  20% {
    translate: -1203.85px 95.71px;
  }

  30% {
    translate: -1014.51px 72.11px;
  }

  40% {
    translate: -824.76px 51.53px;
  }

  50% {
    translate: -634.77px 34.27px;
  }

  60% {
    translate: -444.46px 20.76px;
  }

  70% {
    translate: -253.92px 11.67px;
  }

  80% {
    translate: -63.25px 7.93px;
  }

  90% {
    translate: 127.59px 10.99px;
  }

  100% {
    translate: 317.72px 23.09px;
  }
}

@keyframes plane-tilt {
  0% {
    rotate: -6.083deg;
    animation-timing-function: cubic-bezier(.5, 0, .5, 1);
  }

  54.547% {
    rotate: 0.893deg;
    animation-timing-function: cubic-bezier(.5, 0, .5, 1);
  }

  76.889% {
    rotate: 8.102deg;
    animation-timing-function: cubic-bezier(.5, 0, .5, 1);
  }

  100% {
    rotate: 1.999deg;
  }
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  width: 100%;
  text-align: center;
}

.hero-titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  width: 100%;
}

/* "13 people just added where they are going  [View notes]" */
.pulse {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  /* height: 38px; */
  margin: 0;
  padding: 2px 2px 2px 20px;
  max-width: 100%;
  border: .5px solid rgba(255, 255, 255, .15);
  border-radius: 24px;
  background: rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.pulse[hidden] {
  display: none;
}

.pulse-text {
  font-size: 16px;
  line-height: 18px;
  color: #fff;
  opacity: .8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pulse-link {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 16px 16px;
  border-radius: 999px;
  background: var(--grey-900);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.pulse-link span {
  position: relative;
}

.pulse-link:hover span {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pulse-glow {
  position: absolute;
  display: block;
  pointer-events: none;
}

.pulse-glow-green {
  left: 3px;
  top: -22px;
  width: 119px;
  height: 83px;
}

.pulse-glow-blue {
  left: 3px;
  top: -54px;
  width: 170px;
  height: 148px;
}

/* Sharp on the left, blurring out to the right: a crisp copy fading out over a blurred copy fading in */
.hero-title {
  position: relative;
  margin: 0;
  width: 499px;
  max-width: 100%;
  font-size: 94px;
  font-weight: 500;
  line-height: 85px;
  letter-spacing: -1.88px;
  color: #fff;
}

/* The padding lets the masks cover the descenders ("g", "?"); the negative margin cancels it out */
.hero-title-sharp,
.hero-title-soft {
  padding: .1em 0 .25em;
  margin: -.1em 0 -.25em;
}

.hero-title-sharp {
  display: block;
  -webkit-mask-image: linear-gradient(90deg, #000 52%, transparent 82%);
  mask-image: linear-gradient(90deg, #000 52%, transparent 82%);
}

.hero-title-soft {
  position: absolute;
  inset: 0;
  filter: blur(4px);
  -webkit-mask-image: linear-gradient(90deg, transparent 52%, #000 82%);
  mask-image: linear-gradient(90deg, transparent 52%, #000 82%);
}

.hero-sub {
  margin: 0;
  width: 529px;
  max-width: 100%;
  font-size: 24px;
  line-height: 28px;
  letter-spacing: -.24px;
  color: var(--white-80);
}

/* ---------- Composer (inline) ---------- */
.composer {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 631px;
  max-width: 100%;
  height: 171px;
  padding: 20px 11px 12px 20px;
  border-radius: 20px;
  background: #fff;
  color: var(--text-default);
  box-shadow: 0 20px 50px rgba(4, 5, 6, .12);
}

/* NEW: an empty post shakes the box side to side */
.composer.is-shaking {
  animation: composer-shake .42s cubic-bezier(.36, .07, .19, .97);
}

@keyframes composer-shake {

  10%,
  90% {
    translate: -2px 0;
  }

  20%,
  80% {
    translate: 4px 0;
  }

  30%,
  50%,
  70% {
    translate: -8px 0;
  }

  40%,
  60% {
    translate: 8px 0;
  }
}

.composer:focus-within {
  box-shadow: 0 0 0 3px var(--focus), 0 20px 50px rgba(4, 5, 6, .12);
}

.composer textarea {
  flex: 1;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 9px 0 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text-default);
  font-size: var(--compose-size, 21px);
  line-height: 1.2;
}

/* The native placeholder can't blur or fade, so it's hidden and drawn by .composer-ph instead.
   The placeholder attribute still changes with it, so screen readers hear the same example. */
.composer textarea::placeholder {
  color: transparent;
  opacity: 1;
}

/* NEW (landing page): the rotating example, laid exactly over the empty textarea */
.composer-ph {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  margin: 0;
  font-size: var(--compose-size, 21px);
  line-height: 1.2;
  color: #a6afc0;
  pointer-events: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  transition: opacity .45s linear, filter .45s linear;
}

/* Softly out: fade, blur and drift up a touch, then back in with the next example */
.composer-ph.is-out {
  opacity: 0;
  filter: blur(6px);
  transform: none;
}

/* Gone as soon as there's text in the box */
.composer textarea:not(:placeholder-shown)~.composer-ph {
  opacity: 0;
  transition-duration: 0s;
}

.composer-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.composer-extras {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 0 0 2px .5px;
  flex-wrap: wrap;
  row-gap: 6px;
}

.extra {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -.13px;
  color: var(--text-softer);
  cursor: pointer;
  border-radius: 6px;
}

.extra img {
  display: block;
  flex: none;
}

.extra:hover,
.extra-name:focus-within {
  color: var(--text-default);
}

.extra[data-signed] {
  color: var(--text-default);
}

.extra-name input {
  width: auto;
  min-width: 0;
  max-width: 16rem;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -.13px;
  color: var(--text-default);
}

.extra-name input::placeholder {
  color: var(--text-softer);
  opacity: 1;
}

.extra-name:focus-within {
  outline: 0px solid var(--focus);
  outline-offset: 3px;
}

.send {
  position: relative;
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 10px;
  border: 0;
  border-radius: 100px;
  background: #000;
  cursor: pointer;
}

.send::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset -1px 1px 2px rgba(255, 255, 255, .2);
  pointer-events: none;
}

.send:disabled {
  cursor: progress;
  opacity: .7;
}

.send-glow {
  position: absolute;
  display: block;
  pointer-events: none;
}

.send-glow-blue {
  left: -6px;
  top: -18px;
  width: 110px;
  height: 88px;
}

.send-glow-green {
  left: -29px;
  top: 2px;
  width: 119px;
  height: 83px;
}

.send-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
}

.composer-notes {
  width: 631px;
  max-width: 100%;
  margin-top: -28px;
  min-height: 1.5rem;
  text-align: center;
}

.composer-notes p {
  margin: 0 0 4px;
  font-size: 14px;
}

.char-count:empty,
.form-error:empty {
  display: none;
}

.char-count {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.form-error {
  color: #b42343;
  font-weight: 600;
}

.public-notice {
  color: var(--white-80);
}

@media (max-width: 700px) {
  .hero {
    min-height: 0;
    padding: 140px 16px 96px;
  }

  .hero-title {
    font-size: clamp(52px, 15vw, 94px);
    line-height: .92;
    letter-spacing: -.02em;
  }

  .hero-sub {
    font-size: 19px;
    line-height: 24px;
  }

  .pulse-text {
    font-size: 13px;
  }

  .composer {
    height: auto;
    min-height: 171px;
  }

  .composer {
    --compose-size: 19px;
  }

  .composer textarea {
    min-height: 96px;
  }

  .composer-extras {
    gap: 20px;
  }

  .plane {
    top: 96px;
  }

  /* On phones the gradient reaches below the composer, so these notes switch to light text */
  .composer-notes p {
    color: rgba(255, 255, 255, .9);
  }

  .form-error {
    color: #fff;
  }
}

/* ---------- Recent updates ---------- */
.recent {
  width: min(1207px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 52px;
  outline: none;
}

.recent-heading {
  margin: 0 0 40px;
  font-size: 20px;
  font-weight: 500;
  line-height: normal;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.wall-status:empty {
  display: none;
}

.wall-status {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, .7);
}

.wall-status.is-empty {
  font-size: 20px;
  color: #fff;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 12px;
}

@media (max-width: 1000px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

.cards>li {
  position: relative;
}

.cards>li.is-raised {
  z-index: 20;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  height: 200px;
  padding: 20px;
  border: 1px solid var(--grey-800);
  border-radius: 20px;
  background: var(--card-bg);
  color: #fff;
  transition: border-color .2s ease;
}

.card:hover,
.card:focus-within {
  border-color: #232a36;
}

.card:focus-visible {
  outline-offset: 4px;
}

@media (max-width: 560px) {
  .card {
    height: 240px;
  }
}

/* Every card is the same height, so a long note shrinks to fit (app.js picks the size) */
.card-message {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  font-size: var(--msg-size, 18px);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.card-who {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.card-name {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.16px;
  overflow-wrap: anywhere;
}

.card-signature {
  display: block;
  width: 48px;
  height: 22px;
  color: #fff;
  overflow: visible;
}

.card-badge {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--white-80);
  background: rgba(255, 255, 255, .08);
  padding: 2px 8px;
  border-radius: 999px;
}

.card-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.card .icon-btn {
  width: 36px;
  height: 36px;
  color: var(--white-80);
}

.card .icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Share menu (owners only) */
.share-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  min-width: 13rem;
  padding: .35rem;
  background: #fff;
  color: var(--text-default);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .5);
  display: grid;
  gap: 2px;
  z-index: 30;
  --focus: #2467e3;
}

.share-menu[hidden] {
  display: none;
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 40px;
  padding: .5rem .75rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: .92rem;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: #eef1f6;
}

.menu-item:focus-visible {
  outline-offset: 0;
}

/* A new note slides in */
.card.is-new {
  animation: card-in .5s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.recent-footer {
  display: flex;
  justify-content: center;
  padding-top: 40px;
}

/* ---------- Footer: the big Grey mark, cropped at the bottom like the design ---------- */
.site-footer {
  margin-top: 160px;
  overflow: hidden;
}

.footer-mark {
  width: min(1207px, calc(100% - 32px));
  margin: 0 auto;
  aspect-ratio: 1207 / 241;
  overflow: hidden;
}

.footer-mark img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Dialogs ---------- */
.dialog {
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 0;
  border: 0;
  color: #fff;
}

.dialog::backdrop {
  background: var(--scrim);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dialog-head h2 {
  margin: .4rem 0 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}

.hint {
  margin: .5rem 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, .7);
}

.field-label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  margin: 0 0 6px;
}

/* Signature sheet */
.sheet {
  width: min(400px, calc(100% - 32px));
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--grey-800);
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 20px 24px;
}

.sheet .hint {
  margin: -8px 0 0;
}

.sheet .sig-slot {
  align-self: center;
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Share panel (Figma 49-19594) */
.share-panel {
  position: fixed;
  width: min(484px, calc(100% - 32px));
  padding: 40px;
  border-radius: 20px;
  background: var(--grey-900);
}

.share-panel[open] {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.share-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.share-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.share-card-slot {
  width: 100%;
  max-width: 300px;
  container-type: inline-size;
}

.share-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.share-copy h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
  line-height: normal;
}

.share-text {
  margin: 0;
  width: 307px;
  max-width: 100%;
  font-size: 16px;
  line-height: 21px;
  letter-spacing: -.16px;
  color: var(--white-80);
}

.share-text:empty {
  display: none;
}

.share-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.share-actions[hidden] {
  display: none;
}

.share-row {
  display: flex;
  gap: 12px;
}

.share-row .btn {
  flex: 1 0 0;
  min-width: 0;
}

.recovery[hidden] {
  display: none;
}

.recovery-row {
  display: flex;
  gap: 8px;
}

.recovery input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--grey-800);
  border-radius: 12px;
  background: var(--card-bg);
  color: #fff;
  font-size: 14px;
}

@media (max-width: 480px) {
  .share-panel {
    padding: 40px 20px 24px;
  }

  .share-panel[open] {
    gap: 28px;
  }
}

/* The share card ("share-template"): a 300px design. Every size is in --u, 1/300 of the
   card's width, so it scales down on small screens and matches the downloaded image. */
.share-card {
  --u: calc(100cqw / 300);
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .03);
  border-radius: calc(20 * var(--u));
  background: var(--grey-900);
  color: #fff;
}

.sc-glow {
  position: absolute;
  left: calc(-280 * var(--u));
  top: calc(-387 * var(--u));
  width: calc(1040 * var(--u));
  height: calc(658 * var(--u));
  display: block;
}

.sc-title {
  position: absolute;
  left: calc(27 * var(--u));
  top: calc(18 * var(--u));
  width: calc(130.4 * var(--u));
  margin: 0;
  font-size: calc(24.837 * var(--u));
  font-weight: 500;
  line-height: 1;
}

.sc-arrow {
  position: absolute;
  left: calc(191.64 * var(--u));
  top: calc(12 * var(--u));
  width: calc(95 * var(--u));
  height: calc(95 * var(--u));
  display: block;
}

.sc-note {
  position: absolute;
  left: calc(50% - 1.68 * var(--u));
  top: calc(50% + 6.75 * var(--u));
  width: calc(220.957 * var(--u));
  height: calc(143.775 * var(--u));
  transform: translate(-50%, -50%) rotate(-1.5deg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: calc(6 * var(--u));
  padding: calc(15.095 * var(--u));
  border: calc(.755 * var(--u)) solid var(--grey-800);
  border-radius: calc(15.095 * var(--u));
  background: var(--card-bg);
}

.sc-message {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  font-size: calc(var(--msg, 15.109) * var(--u));
  line-height: 1.3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sc-who {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(5 * var(--u));
}

.sc-signature {
  display: block;
  width: calc(36.229 * var(--u));
  height: calc(16.8 * var(--u));
  color: #fff;
  overflow: visible;
}

.sc-name {
  font-size: calc(12.076 * var(--u));
  font-weight: 500;
  line-height: 1;
  letter-spacing: calc(-.1208 * var(--u));
}

.sc-foot {
  position: absolute;
  left: calc(25 * var(--u));
  top: calc(266 * var(--u));
  width: calc(251 * var(--u));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.sc-logo {
  display: block;
  width: calc(46 * var(--u));
  height: auto;
}

.sc-cta {
  display: flex;
  flex-direction: column;
  gap: calc(1 * var(--u));
  width: calc(93 * var(--u));
  font-weight: 500;
  line-height: 1;
}

.sc-cta span:first-child {
  font-size: calc(6 * var(--u));
  letter-spacing: calc(.3 * var(--u));
  color: #7b7b7b;
}

.sc-cta span:last-child {
  font-size: calc(7.679 * var(--u));
  text-align: center;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translate(-50%, -1rem);
  max-width: calc(100% - 2rem);
  padding: .7rem 1.1rem;
  border-radius: 12px;
  background: #fff;
  color: var(--text-default);
  font-weight: 500;
  font-size: .95rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 1000;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =========================================================
   NEW (signatures)
   ========================================================= */

/* The pad is a fixed 320x180 block. The slot takes the room the form has (never more than
   320px wide) and app.js sets --sig-scale = slot width / 320, so the pad shrinks on narrow
   phones without horizontal scrolling. The slot's height follows the same ratio. */
.sig-slot {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 320 / 180;
}

.sig-slot>.sig-frame {
  transform: scale(var(--sig-scale, 1));
  transform-origin: 0 0;
}

/* ---------- Bencho's design tokens, mapped to wayg's own ----------
   Set on the component's root (.sig-frame) so nothing leaks into the page.
     --ink        not set: wayg's --ink (#2a211b, dark text on every note) already
                  does the same job, and .sig only uses it as a fallback for --fill-on.
     --card       the paper. --paper in light mode. In dark mode wayg's --paper turns
                  dark brown, and the pad must stay a light paper slip so the dark ink shows,
                  so dark mode sets a local light value (there is no global equivalent).
     --fill-slab  the pad's surface: the same paper as --card.
     --fill-on    the ink on that paper: --ink, which never flips in dark mode.
     --font-ui    --font-sans (Figtree), the sans-serif used for names and dates.
     --pane-edge  the form fields' subtle border recipe (22% of the text color), mixed from
                  the pad's own ink so it still shows on the light pad in dark mode.
     --signal     --focus, wayg's focus-ring color.
   No Bencho token here ends in -rgb, so there are no bare-number triplets to supply. */
.sig-frame {
  --card: var(--paper);
  --fill-slab: #262626;
  --fill-on: #ffffff;
  --font-ui: var(--font-sans);
  --pane-edge: color-mix(in srgb, var(--ink) 22%, transparent);
  --signal: var(--focus);
}

@media (prefers-color-scheme: dark) {
  .sig-frame {
    --card: #f7f1e6;
  }

  /* Clear's focus ring is drawn ON the light pad, where dark mode's pale --focus would
     vanish, so it uses the light-mode focus blue. The pill's ring falls outside the pad,
     on the dark dialog, and keeps --focus. */
  .sig-frame .sig-clear {
    --signal: #1d4ed8;
  }
}

/* ══ Signature pad ════════════════════════════════════════ */
.sig-frame {
  display: grid;
  place-items: center;
}

.sig {
  position: relative;
  flex: none;
  /* folding into the pill, and opening back out: one long
     quint-out glide, no overshoot — a card this size bouncing
     read as a jolt, not a landing */
  transition:
    width 720ms cubic-bezier(0.22, 1, 0.36, 1),
    height 720ms cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 720ms cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--fill-slab, var(--card));
  color: var(--fill-on, var(--ink));
  font-family: var(--font-ui);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}

/* Was [data-stroke="on"] .sig. wayg's form fields always have a border, so the pad
   always has its edge in the composer, plus a little lift so it reads as a paper slip. */
.composer .sig {
  box-shadow: inset 0 0 0 1px var(--pane-edge), 0 1px 2px rgba(60, 35, 10, .18);
}

.sig-ink {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.sig[data-ink="Blue"] .sig-ink {
  color: #2446d8;
}

/* [data-fill="dark"] .sig[data-ink="Blue"] removed: on wayg the pad stays light
   paper in dark mode too, so the light-paper blue above is the right ink in both. */

.sig-line {
  position: absolute;
  height: 1px;
  background: currentColor;
  opacity: 0.16;
  pointer-events: none;
}

.sig-hint {
  position: absolute;
  top: 140px;
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
}

.sig-hint {
  left: 0;
  right: 0;
  text-align: center;
  opacity: 0.38;
  transition: opacity 200ms ease;
}

.sig[data-inked] .sig-hint {
  opacity: 0;
}

/* signed: the signature shrinks WITH the card, on the same
   curve, into the middle of the pill — and fades as it goes, so
   by the time it would be too small to read it is gone */
.sig[data-signed] {
  cursor: default;
}

.sig-face {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 320px;
  height: 180px;
  translate: -50% -50%;
  transition: scale 720ms cubic-bezier(0.22, 1, 0.36, 1), opacity 320ms ease 200ms;
}

.sig[data-signed] .sig-face {
  scale: 0.35;
  opacity: 0;
  transition: scale 720ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease 120ms;
}

.sig[data-signed] :is(.sig-clear, .sig-hint) {
  opacity: 0;
  transition: opacity 140ms ease;
}

.sig-said {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.sig-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  width: 100%;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  /* in once the pill has nearly arrived */
  animation: sig-said 320ms ease 420ms both;
}

.sig-pill:focus-visible {
  outline: 2px solid var(--signal, #2231dd);
  outline-offset: 2px;
  border-radius: 999px;
}

.sig-check {
  color: #30a46c;
  animation: sig-check 420ms cubic-bezier(0.3, 1.6, 0.4, 1) 460ms both;
}

.sig-clear {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--inner);
  background: color-mix(in srgb, currentColor 7%, transparent);
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  scale: 0.9;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 180ms ease, scale 220ms cubic-bezier(0.3, 1.4, 0.4, 1), background 160ms ease;
}

.sig[data-inked] .sig-clear {
  opacity: 1;
  scale: 1;
  pointer-events: auto;
}

.sig-clear:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.sig-clear:active {
  scale: 0.94;
}

.sig-clear:focus-visible {
  outline: 2px solid var(--signal, #2231dd);
  outline-offset: 2px;
}

@keyframes sig-said {
  from {
    opacity: 0;
  }
}

@keyframes sig-check {
  from {
    opacity: 0;
    scale: 0.3;
    rotate: -20deg;
  }
}

/* Draw-in, enlarged single-note view only (signature-pad.js sets each piece's delay). */
.sig-drawn path {
  stroke-dasharray: 1 2;
  animation: sig-draw linear both;
}

.sig-drawn circle {
  animation: sig-dot 1ms linear both;
}

@keyframes sig-draw {
  from {
    stroke-dashoffset: 1;
    opacity: 0;
  }

  1% {
    opacity: 1;
  }

  to {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes sig-dot {
  from {
    opacity: 0;
  }
}

/* The toast is a popover, so it shows above open dialogs too */
.toast[popover] {
  inset: auto;
  top: 24px;
  left: 50%;
  margin: 0;
  border: 0;
  overflow: visible;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  /* The plane stays parked where the design shows it */
  .plane {
    animation: none !important;
    translate: none;
    rotate: -6.08deg;
  }

  /* NEW (signatures): the pad folds, the pill appears and Clear empties at once (no waiting
     on delays), and signatures never draw in. */
  .sig,
  .sig *,
  .sig-drawn * {
    animation-delay: 0s !important;
    transition-delay: 0s !important;
  }

  .sig-drawn path,
  .sig-drawn circle {
    animation: none !important;
    stroke-dasharray: none;
  }
}