:root {
  --white: #f7f7f7;
  --quiet: #b7b7b7;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .53; }
button:focus-visible { outline: 1px dotted #eee; outline-offset: 4px; }

.field { cursor: crosshair; }
.field.entering canvas {
  transform-origin: var(--zoom-x, 50%) var(--zoom-y, 50%);
  animation: enter-field .61s cubic-bezier(.68,.02,.75,1) both;
}
@keyframes enter-field {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(5.3); opacity: .08; }
}

.experience {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(2.6rem, 8vh, 5.2rem) clamp(1.3rem, 7vw, 4.5rem);
  border: 0;
  background: transparent;
  color: var(--white);
  overflow: auto;
  overscroll-behavior: contain;
}
.experience[open] { display: flex; flex-direction: column; }
.experience::backdrop { background: radial-gradient(ellipse at center, #000b, #0004 80%); }
.experience[data-view=detail]::backdrop { background: radial-gradient(ellipse at center, #0008, #0001 79%); }

.experience > section {
  box-sizing: border-box;
  width: min(100%, 33rem);
  margin: auto;
}
.experience > [data-panel=detail] { width: min(100%, 57rem); text-align: center; }
.experience > [data-panel=choose] { width: min(100%, 42rem); }

.dismiss {
  position: fixed;
  inset: max(.8rem, env(safe-area-inset-top)) max(1.05rem, env(safe-area-inset-right)) auto auto;
  width: 2.4rem;
  height: 2.4rem;
  color: var(--quiet);
  background: none;
  border: 0;
  font-size: 1.75rem;
  line-height: 1;
}

.experience h2 {
  margin: 0 0 1.1rem;
  font-size: clamp(2.25rem, 5.2vw, 4.3rem);
  font-weight: 580;
  line-height: .96;
  letter-spacing: -.06em;
}
[data-panel=detail] h2 { font-size: clamp(1.3rem, 2.8vw, 2rem); margin: 0 0 .45rem; }
.choices { display: grid; gap: .45rem; justify-items: start; margin: 1.25rem 0 .8rem; }
.choice, .quiet, .button {
  background: transparent;
  border: 0;
  color: var(--white);
  padding: .45rem 0;
  text-align: left;
}
.choice { font-size: clamp(1.15rem, 2.8vw, 1.55rem); }
.choice:hover, .quiet:hover, .button:hover { text-decoration: underline; text-underline-offset: .3em; }
.quiet { color: var(--quiet); font-size: .88rem; }
.button { font-size: .92rem; }
.button.primary { font-weight: 700; }
form > .button[type=submit] { margin-top: .55rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }

.experience label:not(.check), .experience legend {
  display: block;
  margin: .55rem 0 .26rem;
  font-size: .9rem;
}
.experience small { color: var(--quiet); margin-inline-start: .2em; font-size: .78rem; }
.experience input:not([type=checkbox],[type=radio]), .experience textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: .36rem 0 .5rem;
  border: 0;
  border-bottom: 1px dotted #999;
  border-radius: 0;
  background: transparent;
  color: var(--white);
  caret-color: #fff;
}
.experience input:not([type=checkbox],[type=radio]):focus, .experience textarea:focus { outline: none; border-color: #fff; }
.experience textarea { resize: vertical; min-height: 3.4rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .46rem 1.1rem; margin-top: .53rem; }

.hint, .form-status { font-size: .84rem; line-height: 1.35; color: var(--quiet); }
.hint { margin: .8rem 0; }
.form-status { min-height: 1.15em; margin: .62rem 0 0; }
.form-status:empty { display: none; }
.check { display: inline-flex; gap: .5rem; align-items: center; margin: .27rem .85rem .27rem 0; font-size: .9rem; }
.check input {
  appearance: none;
  flex: none;
  width: .58rem;
  height: .58rem;
  margin: .15rem;
  border-radius: 50%;
  border: 1px solid #999;
  background: transparent;
}
.check input:checked { background: white; box-shadow: 0 0 6px #fff9; }
.check input:focus-visible { outline: 1px dotted #eee; outline-offset: 3px; }

.public-wish { padding-inline-start: .75rem; margin: .45rem 0 .65rem; }
fieldset { border: 0; padding: 0; margin: .45rem 0 0; }
.trap { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.camera { margin: .47rem 0 .75rem; }
.camera-view { margin: 0 0 .48rem; }
.camera-view video, .camera-view img { display: block; width: 100%; max-height: 34dvh; object-fit: contain; }
.camera-view video { filter: grayscale(1); }
.tones {
  display: grid;
  grid-template-columns: repeat(auto-fit, 3.2rem);
  gap: .45rem .68rem;
  margin: 1.15rem 0 .45rem;
}
.tone {
  position: relative;
  height: 3.1rem;
  width: 3.1rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--tone);
}
.tone[aria-pressed=true]:focus-visible { outline-color: currentColor; }
.tone::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 2%, currentColor 12%, transparent 65%);
  opacity: .8;
}
.tone[aria-pressed=true]::before { inset: 0; opacity: 1; }
.detail-color { width: min(60vw, 22rem); height: min(60vw, 22rem); margin: 0 auto; }
.drawn .tone::before { opacity: 0; }

.particle-space, .trace-nodes { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.particle-space { z-index: 1; }
.trace-nodes { z-index: 2; overflow: hidden; }
.signature { z-index: 3; }
.inside-cloud .field:not(.entering) { opacity: .14; transition: opacity .65s ease; }
.inside-cloud .signature, body:has(.experience[open]) .signature { opacity: 0; }

.tile {
  position: absolute;
  top: 0;
  left: 0;
  width: 42px;
  height: 42px;
  transform: translate(calc(var(--node-x, -80px) - 21px), calc(var(--node-y, -80px) - 21px));
  border: 0;
  border-radius: 50%;
  background: none;
  padding: 0;
  pointer-events: auto;
  touch-action: manipulation;
  color: #fff;
}
.nucleus {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--tone, white);
  box-shadow: 0 0 12px var(--tone, #fff);
}
.projected .nucleus { opacity: 0; }
.tile.focus-trace .nucleus { opacity: 1; animation: land-tile 1.35s ease-out both; }
@keyframes land-tile {
  from { box-shadow: 0 0 27px 9px var(--tone, #fff); }
  to { opacity: 0; box-shadow: 0 0 9px 1px var(--tone, #fff); }
}

.particle-letters {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 4;
  pointer-events: none;
  display: block;
}
.drawn :is(h1, h2, button, p, label, small, legend) { color: transparent !important; }
.drawn input:not([type=checkbox],[type=radio]), .drawn textarea { border-bottom-color: transparent !important; }
.drawn .rendered-value:not(:focus) { color: transparent !important; }
.drawn img { opacity: 0; }
.detail-meta { color: var(--quiet); font-size: .9rem; margin: .1rem 0 .75rem; }
.detail-message { white-space: pre-wrap; overflow-wrap: anywhere; font-size: clamp(1.18rem, 3.3vw, 2.25rem); }
.detail-photo { display: block; width: 100%; height: auto; max-height: 63dvh; object-fit: contain; }

@media (prefers-reduced-motion: reduce) {
  .field.entering canvas, .tile.focus-trace { animation: none; }
  .inside-cloud .field { transition: none; }
}
