:root {
  --ink: #202c39;
  --cream: #f8f3e8;
  --paper: #fffdf7;
  --blue: #1768ac;
  --blue-dark: #0f4f87;
  --coral: #ef6a52;
  --yellow: #ffd768;
  --green: #a9d8b5;
  --pink: #f3b8c4;
  --lavender: #c8bee8;
  --line: rgba(32, 44, 57, 0.18);
  --shadow: 0 14px 34px rgba(39, 48, 56, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(239, 106, 82, 0.08), transparent 24rem),
    radial-gradient(circle at 92% 20%, rgba(23, 104, 172, 0.09), transparent 27rem),
    var(--cream);
  font-family: "Gowun Dodum", sans-serif;
  font-size: 16px;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.24;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

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

.science-tool {
  --tool-size: 3rem;
  --float-x: 55px;
  --float-y: -80px;
  position: absolute;
  display: grid;
  width: calc(var(--tool-size) * 1.65);
  height: calc(var(--tool-size) * 1.65);
  border: 1px solid rgba(32, 44, 57, 0.12);
  border-radius: 28% 72% 63% 37% / 43% 34% 66% 57%;
  opacity: 0.2;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 12px 30px rgba(24, 47, 70, 0.08);
  font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
  font-size: var(--tool-size);
  filter: saturate(0.8);
  place-items: center;
  animation: tool-flight var(--flight-time, 17s) ease-in-out infinite alternate;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.2s, filter 0.2s;
}

.science-tool:hover,
.science-tool:focus-visible {
  opacity: 0.65;
  filter: saturate(1.2);
  outline: 3px solid rgba(23, 104, 172, 0.25);
  outline-offset: 4px;
}

.science-tool.is-poked {
  z-index: 4;
  opacity: 0.9;
  animation: tool-pop 0.75s cubic-bezier(0.2, 0.8, 0.25, 1.25);
}

.tool-atom { top: 7%; left: 2%; --flight-time: 15s; --float-x: 75px; --float-y: 100px; }
.tool-magnet { top: 19%; right: 2%; --tool-size: 2.5rem; --flight-time: 19s; --float-x: -85px; --float-y: 65px; }
.tool-telescope { top: 48%; left: 1%; --tool-size: 2.7rem; --flight-time: 21s; --float-x: 65px; --float-y: -105px; }
.tool-flask { top: 72%; right: 3%; --tool-size: 2.8rem; --flight-time: 18s; --float-x: -75px; --float-y: -80px; }
.tool-ruler { top: 88%; left: 9%; --tool-size: 2.4rem; --flight-time: 22s; --float-x: 100px; --float-y: -75px; }
.tool-gear { top: 39%; right: 12%; --tool-size: 2.2rem; --flight-time: 14s; --float-x: -65px; --float-y: 95px; }
.tool-bulb { top: 64%; left: 13%; --tool-size: 2.35rem; --flight-time: 20s; --float-x: 75px; --float-y: 80px; }
.tool-planet { top: 4%; right: 23%; --tool-size: 2.6rem; --flight-time: 23s; --float-x: -95px; --float-y: 85px; }

.science-hint {
  position: fixed;
  z-index: 5;
  right: 18px;
  bottom: 18px;
  margin: 0;
  padding: 9px 14px;
  border: 1px solid rgba(32, 44, 57, 0.12);
  border-radius: 999px;
  color: #51606d;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: 0 7px 20px rgba(32, 44, 57, 0.1);
  font-size: 0.75rem;
  pointer-events: none;
}

.science-toast {
  position: fixed;
  z-index: 80;
  bottom: 66px;
  left: 50%;
  max-width: calc(100% - 40px);
  padding: 13px 19px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  opacity: 0;
  color: white;
  background: var(--blue);
  box-shadow: 5px 6px 0 rgba(32, 44, 57, 0.18);
  font-weight: 700;
  text-align: center;
  transform: translate(-50%, 20px) scale(0.9);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

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

.science-particle {
  position: fixed;
  z-index: 6;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--particle-color, var(--yellow));
  pointer-events: none;
  animation: science-spark 0.8s ease-out forwards;
}

.welcome-celebration {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  overflow: hidden;
  background: rgba(17, 31, 49, 0.28);
  backdrop-filter: blur(4px);
  place-items: center;
  transition: visibility 0.45s, opacity 0.45s;
}

.welcome-celebration.is-closing {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.welcome-celebration[hidden] {
  display: none;
}

.edit-modal {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  padding: 20px;
  background: rgba(22, 35, 51, 0.5);
  backdrop-filter: blur(5px);
  place-items: center;
}

.edit-modal[hidden] {
  display: none;
}

.edit-dialog {
  position: relative;
  width: min(520px, 100%);
  padding: 38px;
  border: 4px solid var(--ink);
  border-radius: 7px;
  background:
    linear-gradient(rgba(255, 253, 247, 0.92), rgba(255, 253, 247, 0.92)),
    url("note-artwork.png") 70% 40% / cover;
  box-shadow: 14px 17px 0 rgba(32, 44, 57, 0.22);
  animation: edit-open 0.3s ease-out both;
}

.edit-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: white;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.edit-kicker {
  margin-bottom: 5px;
  color: var(--coral);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.edit-dialog h2 {
  margin-bottom: 22px;
  font-family: "Jua", sans-serif;
  font-size: 2rem;
  font-weight: 400;
}

.edit-dialog form {
  display: grid;
  gap: 17px;
}

.edit-dialog textarea {
  min-height: 130px;
}

.edit-status {
  min-height: 22px;
  margin: -5px 0 0;
  color: #b9382b;
  font-size: 0.85rem;
  font-weight: 700;
}

.edit-buttons {
  display: grid;
  grid-template-columns: 0.65fr 1.35fr;
  gap: 10px;
}

.edit-buttons button {
  min-height: 52px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  font-weight: 700;
  cursor: pointer;
}

.edit-cancel {
  color: var(--ink);
  background: white;
}

.edit-save {
  color: white;
  background: var(--blue);
}

.edit-buttons button:disabled {
  opacity: 0.55;
  cursor: wait;
}

#fireworks-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.welcome-pop {
  position: relative;
  display: grid;
  width: min(430px, calc(100% - 42px));
  min-height: 310px;
  padding: 48px 38px 38px;
  border: 4px solid var(--ink);
  border-radius: 48% 52% 46% 54% / 56% 42% 58% 44%;
  background:
    linear-gradient(rgba(255, 253, 247, 0.87), rgba(255, 253, 247, 0.87)),
    url("note-artwork.png") center / cover;
  box-shadow: 16px 20px 0 rgba(32, 44, 57, 0.2);
  text-align: center;
  place-items: center;
  animation: welcome-boom 0.72s cubic-bezier(0.17, 0.89, 0.25, 1.35) both;
}

.welcome-pop::before,
.welcome-pop::after {
  position: absolute;
  z-index: -1;
  width: 90px;
  height: 90px;
  background: var(--yellow);
  content: "";
  transform: rotate(18deg);
}

.welcome-pop::before { top: -28px; left: -26px; }
.welcome-pop::after { right: -22px; bottom: -25px; background: var(--coral); transform: rotate(35deg); }

.welcome-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: var(--paper);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.welcome-emoji {
  font-size: 3.8rem;
  animation: emoji-bounce 0.8s 0.45s both;
}

.welcome-pop strong {
  color: var(--coral);
  font-family: "Jua", sans-serif;
  font-size: clamp(3rem, 11vw, 5.2rem);
  font-weight: 400;
  line-height: 0.95;
  text-shadow: 3px 3px 0 var(--yellow);
}

.welcome-pop p {
  margin: 10px 0 0;
  color: #465462;
  font-weight: 700;
  line-height: 1.7;
}

.welcome-spark {
  position: absolute;
  color: var(--blue);
  font-size: 2rem;
  animation: spark-spin 1.2s infinite alternate;
}

.spark-a { top: 25%; left: 8%; }
.spark-b { right: 8%; bottom: 21%; color: var(--coral); animation-delay: -0.5s; }

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  align-items: center;
  min-height: 430px;
  padding: 72px 5% 55px;
  border-bottom: 2px solid var(--ink);
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.eyebrow span {
  display: inline-block;
  margin-right: 8px;
  color: var(--coral);
  animation: pulse 1.8s infinite;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-family: "Jua", sans-serif;
  font-size: clamp(3.5rem, 8vw, 6.8rem);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: -0.035em;
}

h1 em {
  color: var(--coral);
  font-style: normal;
}

.hero-description {
  margin-bottom: 0;
  color: #53606d;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.8;
}

.hero-doodle {
  position: relative;
  display: grid;
  min-height: 260px;
  place-items: center;
}

.sample-note {
  position: relative;
  width: 235px;
  min-height: 220px;
  padding: 60px 24px 24px;
  transform: rotate(5deg);
  border: 4px solid white;
  background:
    linear-gradient(rgba(255, 249, 222, 0.7), rgba(255, 249, 222, 0.7)),
    url("note-artwork.png") 28% 34% / 330% auto;
  box-shadow: 9px 12px 0 rgba(32, 44, 57, 0.12);
  text-align: center;
}

.sample-note::after {
  position: absolute;
  right: 0;
  bottom: 0;
  border-width: 0 0 28px 28px;
  border-style: solid;
  border-color: transparent transparent var(--cream) transparent;
  filter: drop-shadow(-3px -2px 1px rgba(0, 0, 0, 0.06));
  content: "";
}

.sample-note p {
  font-family: "Jua", sans-serif;
  font-size: 1.48rem;
  line-height: 1.45;
}

.pin {
  position: absolute;
  top: 18px;
  left: 50%;
  color: var(--coral);
  font-size: 1.5rem;
  text-shadow: 2px 3px 0 rgba(0, 0, 0, 0.13);
  transform: translateX(-50%);
}

.smile {
  color: var(--blue);
  font-size: 1.8rem;
  font-weight: 700;
}

.tape {
  position: absolute;
  z-index: 2;
  top: 28px;
  width: 90px;
  height: 28px;
  transform: rotate(-4deg);
  background: rgba(255, 255, 255, 0.58);
}

.spark {
  position: absolute;
  color: var(--blue);
  font-size: 2rem;
}

.spark-one {
  top: 15%;
  right: 3%;
}

.spark-two {
  bottom: 8%;
  left: 6%;
  color: var(--coral);
  font-size: 1.35rem;
}

main {
  padding: 68px 5% 90px;
}

.write-section {
  max-width: 900px;
  margin: 0 auto 90px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin-bottom: 3px;
  font-family: "Jua", sans-serif;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 400;
}

.section-heading p {
  margin-bottom: 0;
  color: #6f7880;
}

.step-number {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-family: "Jua", sans-serif;
  place-items: center;
}

.step-number.coral {
  background: var(--coral);
}

.message-form {
  display: grid;
  grid-template-columns: 0.55fr 1.45fr auto;
  align-items: end;
  gap: 16px;
  padding: 26px;
  border: 1px solid rgba(32, 44, 57, 0.12);
  border-radius: 6px;
  background:
    linear-gradient(rgba(255, 253, 247, 0.93), rgba(255, 253, 247, 0.93)),
    url("note-artwork.png") center / cover;
  box-shadow: var(--shadow);
}

.field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 0.88rem;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1.5px solid #c9c8c2;
  border-radius: 3px;
  outline: none;
  color: var(--ink);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input {
  height: 54px;
  padding: 0 15px;
}

.field textarea {
  height: 90px;
  padding: 14px 55px 14px 15px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 104, 172, 0.12);
}

.char-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: #8b9196;
  font-size: 0.76rem;
}

.submit-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 175px;
  height: 90px;
  padding: 0 18px;
  border: 0;
  border-radius: 3px;
  color: white;
  background: var(--blue);
  font-family: "Jua", sans-serif;
  font-size: 1.04rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.submit-button:hover {
  transform: translateY(-2px);
  background: var(--blue-dark);
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.button-arrow {
  font-size: 1.5rem;
}

.status-message {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--blue-dark);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.status-message.error {
  color: #b9382b;
}

.wall-section {
  min-height: 360px;
}

.wall-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #66717a;
  font-size: 0.85rem;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #35a65b;
  box-shadow: 0 0 0 4px rgba(53, 166, 91, 0.12);
  animation: pulse 1.8s infinite;
}

.message-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 27px 23px;
}

.note-card {
  --note-color: var(--yellow);
  --art-position: 50% 50%;
  position: relative;
  display: flex;
  min-height: 225px;
  flex-direction: column;
  padding: 44px 24px 22px;
  border: 6px solid rgba(255, 253, 247, 0.96);
  transform: rotate(var(--rotation, 0deg));
  background:
    linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)),
    url("note-artwork.png") var(--art-position) / 285% auto;
  box-shadow: 7px 9px 0 rgba(32, 44, 57, 0.13), 0 18px 35px rgba(32, 44, 57, 0.16);
  animation: stick 0.4s both;
}

.note-card.shape-rounded {
  border-radius: 48px 12px 55px 20px;
}

.note-card.shape-circle {
  min-height: 285px;
  aspect-ratio: 1;
  justify-content: center;
  padding: 60px 37px 42px;
  border-radius: 50%;
}

.note-card.shape-hexagon {
  min-height: 270px;
  padding: 55px 38px 38px;
  clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
}

.note-card.shape-star {
  min-height: 340px;
  justify-content: center;
  padding: 112px 47px 62px;
  clip-path: polygon(50% 0%, 61% 31%, 96% 20%, 70% 48%, 98% 68%, 63% 68%, 50% 100%, 37% 68%, 2% 68%, 30% 48%, 4% 20%, 39% 31%);
}

.note-card.shape-star .note-message {
  max-height: 120px;
  overflow: auto;
  padding: 12px;
  font-size: 0.94rem;
  line-height: 1.45;
}

.note-card.shape-star .note-footer {
  padding: 7px 9px;
  font-size: 0.82rem;
}

.note-card.shape-blob {
  min-height: 275px;
  padding: 55px 34px 40px;
  border-radius: 34% 66% 45% 55% / 52% 35% 65% 48%;
}

.note-card:not(.shape-classic)::after {
  display: none;
}

.note-card.shape-star::before,
.note-card.shape-hexagon::before {
  top: 31px;
}

.note-actions {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
}

.shape-circle .note-actions,
.shape-blob .note-actions {
  top: 28px;
  right: 28px;
}

.shape-star .note-actions {
  top: 73px;
  right: 70px;
}

.shape-hexagon .note-actions {
  top: 32px;
  right: 34px;
}

.note-action {
  display: grid;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 2px 3px 0 rgba(32, 44, 57, 0.16);
  font-size: 0.82rem;
  cursor: pointer;
  place-items: center;
  transition: transform 0.18s, background 0.18s;
}

.note-action:hover,
.note-action:focus-visible {
  transform: translateY(-2px) scale(1.08);
  background: var(--yellow);
}

.note-delete:hover,
.note-delete:focus-visible {
  color: white;
  background: var(--coral);
}

.note-card.is-busy {
  opacity: 0.58;
  pointer-events: none;
}

.note-card::before {
  position: absolute;
  top: 17px;
  left: 50%;
  width: 72px;
  height: 22px;
  border-radius: 0;
  background: rgba(255, 248, 222, 0.72);
  box-shadow: none;
  content: "";
  transform: translateX(-50%);
}

.note-card::after {
  position: absolute;
  right: 0;
  bottom: 0;
  border-width: 0 0 22px 22px;
  border-style: solid;
  border-color: transparent transparent var(--cream) transparent;
  content: "";
}

.note-message {
  flex: 1;
  margin-bottom: 15px;
  padding: 18px 17px;
  border: 1px solid rgba(32, 44, 57, 0.08);
  border-radius: 3px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: 0 5px 16px rgba(27, 37, 48, 0.11);
  overflow-wrap: anywhere;
  font-size: 1.08rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.note-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(32, 44, 57, 0.09);
  border-radius: 3px;
  padding: 10px 12px;
  background: rgba(255, 253, 247, 0.86);
}

.note-author {
  overflow: hidden;
  font-family: "Jua", sans-serif;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-time {
  flex: 0 0 auto;
  color: rgba(32, 44, 57, 0.64);
  font-size: 0.72rem;
}

.error-box {
  margin: 0 0 28px;
  padding: 18px 20px;
  border: 1px solid #e8a39b;
  border-radius: 4px;
  color: #8a2f24;
  background: #fff1ef;
  font-weight: 700;
  line-height: 1.6;
}

.loading-state,
.empty-state {
  padding: 70px 20px;
  color: #778089;
  text-align: center;
}

.loading-note {
  display: inline-block;
  width: 45px;
  height: 45px;
  margin-bottom: 15px;
  background: var(--yellow);
  animation: loading 1.1s ease-in-out infinite;
}

.empty-paper {
  display: grid;
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  transform: rotate(-5deg);
  color: var(--blue);
  background: var(--yellow);
  font-size: 2rem;
  place-items: center;
}

.empty-state h3 {
  margin-bottom: 7px;
  color: var(--ink);
  font-family: "Jua", sans-serif;
  font-size: 1.4rem;
  font-weight: 400;
}

.empty-state p {
  margin-bottom: 0;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 30px 20px 42px;
  border-top: 2px solid var(--ink);
  color: #6f7880;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

@keyframes stick {
  from { opacity: 0; transform: translateY(-14px) rotate(var(--rotation, 0deg)) scale(0.96); }
  to { opacity: 1; transform: translateY(0) rotate(var(--rotation, 0deg)) scale(1); }
}

@keyframes loading {
  50% { transform: rotate(10deg) scale(0.85); opacity: 0.55; }
}

@keyframes tool-flight {
  0% { transform: translate3d(0, 0, 0) rotate(-12deg); }
  45% { transform: translate3d(var(--float-x), var(--float-y), 0) rotate(19deg); }
  100% { transform: translate3d(-24px, 38px, 0) rotate(-23deg); }
}

@keyframes welcome-boom {
  0% { opacity: 0; transform: scale(0.05) rotate(-14deg); }
  65% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes emoji-bounce {
  0% { opacity: 0; transform: translateY(-30px) scale(0.5); }
  70% { transform: translateY(7px) scale(1.15); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes spark-spin {
  to { transform: rotate(55deg) scale(1.3); }
}

@keyframes tool-pop {
  0% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.45) rotate(22deg); }
  70% { transform: scale(0.82) rotate(-16deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes science-spark {
  from { opacity: 1; transform: translate(0, 0) scale(1); }
  to { opacity: 0; transform: translate(var(--spark-x), var(--spark-y)) scale(0.2); }
}

@keyframes edit-open {
  from { opacity: 0; transform: translateY(25px) scale(0.94) rotate(-2deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@media (max-width: 850px) {
  .hero {
    grid-template-columns: 1fr 0.6fr;
    padding-inline: 2%;
  }

  .sample-note {
    width: 190px;
    min-height: 185px;
    padding-top: 52px;
  }

  .sample-note p {
    font-size: 1.2rem;
  }

  main {
    padding-inline: 2%;
  }

  .message-form {
    grid-template-columns: 1fr 1.5fr;
  }

  .submit-button {
    grid-column: 1 / -1;
    width: 100%;
    height: 58px;
  }

  .message-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .page-shell {
    width: min(100% - 24px, 520px);
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 54px 2% 40px;
  }

  h1 {
    font-size: clamp(3.25rem, 18vw, 5rem);
  }

  .hero-doodle {
    display: none;
  }

  main {
    padding: 46px 1% 68px;
  }

  .write-section {
    margin-bottom: 65px;
  }

  .message-form {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .field textarea {
    height: 120px;
  }

  .submit-button {
    grid-column: auto;
  }

  .wall-heading {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 17px;
  }

  .wall-heading .section-heading {
    margin-bottom: 0;
  }

  .live-indicator {
    align-self: flex-end;
  }

  .message-wall {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .note-card {
    min-height: 200px;
  }

  .note-card.shape-circle,
  .note-card.shape-hexagon,
  .note-card.shape-star,
  .note-card.shape-blob {
    min-height: 300px;
  }

  .science-hint {
    right: 10px;
    bottom: 10px;
  }

  .edit-dialog {
    padding: 34px 22px 24px;
  }

  footer {
    flex-wrap: wrap;
  }

  .science-tool {
    opacity: 0.12;
  }

  .welcome-pop {
    min-height: 280px;
    padding-inline: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
