:root {
  --ink: #0d1117;
  --paper: #f2f1ec;
  --muted: #a8afb7;
  --cyan: #83e6eb;
  --warm: #e8a96c;
  --line: rgba(131, 230, 235, 0.2);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dolphin-cursor: url("dolphin-cursor.svg") 25 14;
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(38, 92, 108, 0.13), transparent 34rem),
    linear-gradient(160deg, #0e131a 0%, var(--ink) 55%, #101218 100%);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  cursor: var(--dolphin-cursor), auto;
}

button, textarea { font: inherit; }

button,
label,
input[type="checkbox"] {
  cursor: var(--dolphin-cursor), pointer;
}

textarea { cursor: text; }

button:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.signal-line {
  position: absolute;
  top: 53%;
  left: -45vw;
  width: 40vw;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), var(--cyan), transparent);
  filter: drop-shadow(0 0 8px rgba(131, 230, 235, 0.35));
  animation: signal 11s linear 5s infinite;
}

.warmth {
  position: absolute;
  right: -9rem;
  bottom: -12rem;
  width: 27rem;
  height: 27rem;
  border-radius: 50%;
  background: rgba(232, 169, 108, 0.035);
  filter: blur(55px);
}

main { width: 100%; }

.intro,
.response {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 3rem 1.5rem;
}

.intro-copy,
.response-inner {
  width: min(100%, 42rem);
}

.intro-copy { text-align: center; }

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 11vw, 7.75rem);
  font-weight: 680;
  letter-spacing: 0.025em;
  line-height: 0.9;
  text-shadow: 0 0 45px rgba(131, 230, 235, 0.08);
  animation: arrive 1.1s var(--ease) both;
}

.outcome {
  margin: 2.2rem 0 0;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  letter-spacing: -0.018em;
}

.machinery {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
}

.reveal {
  opacity: 0;
  transform: translateY(9px);
  animation: reveal 0.9s var(--ease) forwards;
}

.reveal-one { animation-delay: 0.65s; }
.reveal-two { animation-delay: 1.15s; }
.reveal-three { animation-delay: 1.8s; }

.primary,
.secondary,
.share-action {
  border: 0;
  color: var(--paper);
  cursor: var(--dolphin-cursor), pointer;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
}

.primary {
  position: relative;
  margin-top: 3.25rem;
  padding: 0.8rem 0.15rem;
  background: transparent;
}

.primary::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.35rem;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0.36);
  transition: transform 0.45s var(--ease), box-shadow 0.45s ease;
}

.primary:hover::after,
.primary:focus-visible::after {
  transform: scaleX(1);
  box-shadow: 0 0 11px rgba(131, 230, 235, 0.6);
}

.intro.is-leaving {
  animation: depart 0.7s var(--ease) forwards;
  pointer-events: none;
}

.response[hidden] { display: none; }

.response {
  opacity: 0;
  transform: translateY(18px);
}

.response.is-visible { animation: responseIn 0.9s var(--ease) forwards; }

.response-inner { text-align: left; }

h2 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(2.4rem, 8vw, 5.6rem);
  font-weight: 560;
  letter-spacing: -0.052em;
  line-height: 0.98;
}

.taking-shape {
  margin: 2rem 0 4.5rem;
  color: var(--cyan);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

form { max-width: 31rem; }

label {
  display: block;
  margin-bottom: 0.8rem;
  color: var(--paper);
  font-size: 1rem;
}

textarea {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 5.6rem;
  border: 0;
  border-bottom: 1px solid rgba(242, 241, 236, 0.34);
  border-radius: 0;
  padding: 0.75rem 0;
  background: transparent;
  color: var(--paper);
  line-height: 1.5;
  transition: border-color 0.25s ease;
}

textarea:hover,
textarea:focus { border-color: var(--cyan); }

.storage-note {
  margin: 0.75rem 0 0;
  color: #858d96;
  font-size: 0.72rem;
}

.secondary {
  margin-top: 1.7rem;
  padding: 0.82rem 1rem;
  border: 1px solid rgba(131, 230, 235, 0.58);
  border-radius: 999px;
  background: rgba(131, 230, 235, 0.04);
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.signal-actions {
  margin-top: 1.7rem;
}

.private-action { margin-top: 0; }

.share-option {
  margin-top: 1.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(242, 241, 236, 0.1);
}

.share-label {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0;
  color: var(--muted);
  cursor: var(--dolphin-cursor), pointer;
  font-size: 0.82rem;
  line-height: 1.4;
}

.share-label input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--cyan);
}

.share-label input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

.share-action {
  display: block;
  margin-top: 1.1rem;
  padding: 0.65rem 0;
  border: 0;
  border-bottom: 1px solid rgba(232, 169, 108, 0.6);
  background: transparent;
  color: var(--warm);
  cursor: var(--dolphin-cursor), pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.share-action[aria-busy="true"] {
  opacity: 0.58;
  cursor: wait;
}

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

.share-action:hover,
.share-action:focus-visible {
  color: var(--paper);
  border-color: var(--paper);
}

.validation-message {
  margin: 0.7rem 0 0;
  color: var(--warm);
  font-size: 0.78rem;
}

.validation-message[hidden] { display: none; }

.secondary:hover,
.secondary:focus-visible {
  background: var(--cyan);
  color: var(--ink);
  box-shadow: 0 0 24px rgba(131, 230, 235, 0.16);
}

.confirmation {
  margin: 2.4rem 0 0;
  font-size: clamp(1.15rem, 3.5vw, 1.65rem);
  line-height: 1.3;
  animation: reveal 0.8s var(--ease) both;
}

.typed-response {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  z-index: 3;
  margin: 0;
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(131, 230, 235, 0.15);
  border-radius: 999px;
  background: rgba(13, 17, 23, 0.82);
  color: var(--cyan);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  backdrop-filter: blur(8px);
}

.typed-response.show { animation: whisper 2.2s var(--ease) both; }

.dolphin {
  position: fixed;
  left: -4rem;
  bottom: 0.45rem;
  z-index: 2;
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  filter: grayscale(1) brightness(1.6) sepia(0.15) hue-rotate(135deg);
}

.dolphin.glide { animation: dolphin 7s var(--ease) both; }

@keyframes arrive {
  from { opacity: 0; transform: translateY(12px); letter-spacing: 0.09em; }
  to { opacity: 1; transform: translateY(0); letter-spacing: 0.025em; }
}

@keyframes reveal { to { opacity: 1; transform: translateY(0); } }
@keyframes depart { to { opacity: 0; transform: translateY(-18px); } }
@keyframes responseIn { to { opacity: 1; transform: translateY(0); } }
@keyframes signal { from { transform: translateX(0); } to { transform: translateX(190vw); } }

@keyframes whisper {
  0%, 100% { opacity: 0; transform: translate(-50%, 10px); }
  18%, 75% { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes dolphin {
  0% { left: -4rem; opacity: 0; transform: translateY(4px) rotate(-7deg); }
  12%, 80% { opacity: 0.28; }
  48% { transform: translateY(-5px) rotate(5deg); }
  100% { left: calc(100vw + 4rem); opacity: 0; transform: translateY(2px) rotate(-4deg); }
}

@media (min-width: 720px) {
  .intro, .response { padding: 5rem; }
  .response-inner { margin-left: 8vw; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .signal-line, .dolphin { display: none; }
}
