:root {
  color-scheme: light;
  --ivory: #fbf3e9;
  --card: #fffdf9;
  --ink: #4a3b32;
  --ink-soft: #93816f;
  --rose: #e4949b;
  --rose-deep: #d97c86;
  --stripe-rose: #f2bfc4;
  --stripe-yellow: #f5dfa0;
  --stripe-mint: #bfe3c7;
  --stripe-blue: #bfd6ea;
  --stripe-violet: #e3c9ee;
  font-family: "Gowun Dodum", "Apple SD Gothic Neo", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ivory);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--ivory);
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--stripe-rose);
}

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

.blob {
  position: absolute;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  filter: blur(30px);
  opacity: 0.55;
}

.blob--mint {
  top: -2.5rem;
  left: -4rem;
  background: var(--stripe-mint);
}

.blob--rose {
  top: 10rem;
  right: -5rem;
  background: var(--stripe-rose);
}

.blob--blue {
  bottom: 0;
  left: 2.5rem;
  background: var(--stripe-blue);
}

.app-shell {
  position: relative;
  width: min(100%, 448px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--ivory);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.06);
}

.tteok-stripe {
  display: flex;
  width: 100%;
  height: 8px;
  overflow: hidden;
}

.tteok-stripe span {
  flex: 1;
}

.tteok-stripe--small {
  height: 7px;
  border-radius: 999px;
}

.stripe-rose {
  background: var(--stripe-rose);
}

.stripe-yellow {
  background: var(--stripe-yellow);
}

.stripe-mint {
  background: var(--stripe-mint);
}

.stripe-blue {
  background: var(--stripe-blue);
}

.stripe-violet {
  background: var(--stripe-violet);
}

.site-header {
  position: relative;
  padding: 2.25rem 1.5rem 1.5rem;
  text-align: center;
}

.header-icons {
  margin-bottom: 0.5rem;
  font-size: 1.875rem;
}

.site-header h1 {
  margin: 0;
  color: var(--ink);
  font-family: "Gowun Batang", "AppleMyungjo", serif;
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.38;
}

.site-header p {
  margin: 1rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.72;
}

.utility-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.utility-button {
  display: inline-flex;
  min-height: 2.4rem;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  color: var(--rose-deep);
  border: 1px solid var(--rose);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  transition:
    background-color 160ms ease,
    transform 100ms ease;
}

.utility-button:hover {
  background: white;
}

.utility-button:active {
  transform: scale(0.96);
}

.form-section,
.feed-section {
  padding: 0 1.25rem;
}

.guest-form {
  position: relative;
  padding: 1.25rem;
  border: 1px solid #f2e7d8;
  border-radius: 1.5rem;
  background: var(--card);
  box-shadow: 0 2px 5px rgba(74, 59, 50, 0.045);
}

.guest-form label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 500;
}

.message-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.message-label-row span {
  color: #b5a492;
  font-size: 0.7rem;
}

input,
textarea {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid #eee1cf;
  border-radius: 0.75rem;
  outline: 0;
  background: white;
  font-size: 0.9375rem;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

input {
  min-height: 2.75rem;
  margin-bottom: 1rem;
}

textarea {
  min-height: 7rem;
  margin-bottom: 0.85rem;
  line-height: 1.55;
  resize: none;
}

input::placeholder,
textarea::placeholder {
  color: #c9b8a6;
}

input:focus,
textarea:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(228, 148, 155, 0.35);
}

.website-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.submit-button {
  display: flex;
  width: 100%;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1rem;
  color: white;
  border: 0;
  border-radius: 999px;
  background: var(--rose-deep);
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  transition:
    filter 150ms ease,
    opacity 150ms ease,
    transform 100ms ease;
}

.submit-button:hover:not(:disabled) {
  filter: brightness(0.97);
}

.submit-button:active:not(:disabled) {
  transform: scale(0.98);
}

.submit-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.form-status {
  min-height: 1rem;
  margin: 0.55rem 0 -0.25rem;
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: center;
}

.form-status--error {
  color: #bd5360;
}

.feed-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem;
  margin: 2.25rem 0 1rem;
}

.feed-divider > div {
  flex: 1;
}

.feed-divider > span {
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.feed-section {
  padding-bottom: 2.5rem;
}

.message-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-card {
  border: 1px solid #f2e7d8;
  border-radius: 1rem;
  background: var(--card);
  box-shadow: 0 2px 5px rgba(74, 59, 50, 0.045);
  overflow: hidden;
  overflow-wrap: anywhere;
}

.message-card__stripe {
  width: 100%;
  height: 6px;
}

.message-card__body {
  padding: 1rem;
}

.message-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.message-card__name {
  font-size: 0.875rem;
}

.message-card__time {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 0.6875rem;
}

.message-card__message {
  margin: 0;
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.message-card--new {
  animation: card-in 500ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.loading-state,
.empty-state {
  min-height: 9.5rem;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.loading-state {
  display: grid;
  color: var(--ink-soft);
}

.loading-state[hidden],
.empty-state[hidden] {
  display: none;
}

.loading-state > div {
  display: flex;
  gap: 0.35rem;
}

.loading-state span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--rose);
  animation: pulse 800ms ease-in-out infinite alternate;
}

.loading-state span:nth-child(2) {
  background: var(--stripe-yellow);
  animation-delay: 130ms;
}

.loading-state span:nth-child(3) {
  background: var(--stripe-mint);
  animation-delay: 260ms;
}

.loading-state p,
.empty-state p {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.65;
}

.empty-state {
  display: grid;
  padding: 1.5rem;
  border: 1px dashed #e7d6c1;
  border-radius: 1rem;
}

.empty-state > div {
  font-size: 1.875rem;
}

footer {
  padding: 0.5rem 1rem 2rem;
  text-align: center;
}

footer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.toast {
  position: fixed;
  z-index: 50;
  min-width: 12rem;
  max-width: calc(100% - 2rem);
  bottom: 2rem;
  left: 50%;
  padding: 0.65rem 1.25rem;
  color: white;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 8px 22px rgba(74, 59, 50, 0.25);
  font-size: 0.8125rem;
  text-align: center;
  transform: translateX(-50%);
  animation: toast-in 250ms ease both;
}

.toast[hidden] {
  display: none;
}

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

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

@keyframes pulse {
  to {
    opacity: 0.3;
    transform: translateY(-5px);
  }
}

@media (max-width: 370px) {
  .site-header {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .site-header h1 {
    font-size: 1.5rem;
  }

  .site-header p {
    font-size: 0.855rem;
  }

  .utility-button {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }
}

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