@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Gowun+Dodum&display=swap');

:root {
  color-scheme: light;
  --paper: #f4f3ee;
  --ink: #242a28;
  --muted: #747b76;
  --line: #d9dbd3;
  --teal: #28766d;
  --coral: #df6a52;
  --yellow: #f2d87a;
  --mint: #b8ded0;
  --blue: #bdd9e3;
  --lilac: #d8c9df;
  --white: #fffefa;
  font-family: 'DM Sans', 'Gowun Dodum', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--paper);
  background-image: radial-gradient(#d1d2ca 0.7px, transparent 0.7px);
  background-size: 18px 18px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.page-shell {
  width: min(100% - 48px, 1080px);
  margin: 0 auto;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.wordmark-mark {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  color: var(--white);
  background: var(--teal);
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 15px;
}

.topbar-note,
.heading-aside {
  color: var(--muted);
  font-size: 12px;
}

.intro {
  min-height: 310px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 7.5% 43px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
}

.intro .eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0;
  font-size: 12px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgb(223 106 82 / 13%);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 43px;
  font-weight: 400;
  line-height: 1.28;
}

h1 span {
  color: var(--coral);
}

.intro-description {
  margin-bottom: 0;
  color: #626a65;
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 14px;
  line-height: 1.9;
}

.intro-stamp {
  width: 126px;
  height: 126px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #a9c9bd;
  border-radius: 50%;
  color: var(--teal);
  transform: rotate(9deg);
}

.intro-stamp span {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.8px;
}

.intro-stamp strong {
  margin: 3px 0;
  font-family: Georgia, serif;
  font-size: 21px;
  font-weight: 400;
  line-height: 1.05;
  text-align: center;
}

.compose-section {
  padding: 39px 7.5% 34px;
  border-bottom: 1px solid var(--line);
}

.section-heading,
.wall-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.section-heading h2,
.wall-heading h2 {
  margin: 0;
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 21px;
  font-weight: 400;
}

.section-heading .eyebrow,
.wall-heading .eyebrow {
  margin-bottom: 6px;
}

.note-form {
  margin-top: 20px;
  padding: 19px 20px 14px;
  border: 1px solid #d8dbd2;
  background: rgb(255 254 250 / 88%);
  box-shadow: 3px 4px 0 rgb(36 42 40 / 6%);
}

.note-form textarea {
  display: block;
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 15px;
  line-height: 1.8;
}

.note-form textarea::placeholder,
.name-field input::placeholder {
  color: #a0a49d;
}

.note-form textarea:focus-visible {
  outline: 2px solid #8fb9ac;
  outline-offset: 4px;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid #ecece6;
}

.form-meta,
.name-field,
.submit-group {
  display: flex;
  align-items: center;
}

.form-meta {
  gap: 12px;
}

.name-field {
  gap: 7px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

.name-field input {
  width: 132px;
  padding: 5px 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 400;
}

.name-field input:focus-visible {
  outline: 2px solid #8fb9ac;
  outline-offset: 3px;
}

.field-hint,
.char-count {
  color: #969b94;
  font-size: 10px;
}

.submit-group {
  gap: 14px;
}

.submit-button {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border: 0;
  color: white;
  background: var(--teal);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 160ms ease, transform 160ms ease;
}

.submit-button:hover:not(:disabled) {
  background: #1e625a;
  transform: translateY(-1px);
}

.submit-button:disabled,
.refresh-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.notice {
  margin-top: 14px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.notice-error {
  border-left: 3px solid var(--coral);
  color: #813b2e;
  background: #fae7e0;
}

.form-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--teal);
  font-size: 11px;
}

.wall-section {
  padding: 37px 7.5% 52px;
}

.note-count {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  margin-left: 3px;
  padding: 0 6px;
  border-radius: 50%;
  color: var(--teal);
  background: #dcebe4;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  vertical-align: 2px;
}

.refresh-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: transform 180ms ease, border-color 180ms ease;
}

.refresh-button:hover:not(:disabled) {
  border-color: var(--teal);
  transform: rotate(35deg);
}

.wall-status {
  margin: 16px 0 13px;
  color: var(--muted);
  font-size: 11px;
}

.note-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.note-card {
  position: relative;
  min-height: 174px;
  display: flex;
  flex-direction: column;
  padding: 25px 21px 17px;
  box-shadow: 2px 5px 10px rgb(36 42 40 / 9%);
  animation: note-arrive 360ms both;
}

.note-card::before {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 37px;
  height: 9px;
  background: rgb(255 255 255 / 56%);
  content: '';
  transform: translateX(-50%) rotate(-2deg);
}

.note-card:nth-child(3n + 1) {
  background: var(--yellow);
  transform: rotate(-1deg);
}

.note-card:nth-child(3n + 2) {
  background: var(--mint);
  transform: rotate(1.2deg);
}

.note-card:nth-child(3n) {
  background: var(--blue);
  transform: rotate(-0.5deg);
}

.note-card:nth-child(4n) {
  background: var(--lilac);
}

.note-card:nth-child(5n) {
  background: #f1c4b6;
}

.note-card-message {
  margin: 0 0 20px;
  color: #303936;
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.note-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgb(36 42 40 / 12%);
  color: #535c57;
  font-size: 10px;
}

.note-card-author {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 45px 12px;
  color: var(--muted);
  text-align: center;
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 13px;
  line-height: 1.8;
}

.empty-mark {
  display: block;
  margin-bottom: 10px;
  color: var(--coral);
  font-size: 25px;
}

.empty-state p {
  margin: 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 7.5% 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@keyframes note-arrive {
  from {
    opacity: 0;
    translate: 0 8px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 32px, 580px);
  }

  .intro,
  .compose-section,
  .wall-section,
  .site-footer {
    padding-right: 3%;
    padding-left: 3%;
  }

  .intro {
    min-height: 290px;
  }

  h1 {
    font-size: 37px;
  }

  .intro-stamp {
    width: 104px;
    height: 104px;
  }

  .note-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 24px, 420px);
  }

  .topbar {
    height: 63px;
  }

  .topbar-note {
    font-size: 10px;
  }

  .intro {
    min-height: 272px;
    padding-top: 36px;
    padding-bottom: 36px;
  }

  h1 {
    font-size: 33px;
  }

  .intro-description {
    max-width: 260px;
    font-size: 12px;
  }

  .desktop-break {
    display: none;
  }

  .intro-stamp {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
  }

  .intro-stamp strong {
    font-size: 15px;
  }

  .intro-stamp span {
    font-size: 6px;
    letter-spacing: 1px;
  }

  .compose-section,
  .wall-section {
    padding-top: 30px;
    padding-bottom: 29px;
  }

  .heading-aside {
    max-width: 120px;
    text-align: right;
  }

  .note-form {
    padding: 15px 14px 12px;
  }

  .form-footer {
    align-items: flex-end;
  }

  .form-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .field-hint {
    padding-left: 18px;
    font-size: 9px;
  }

  .submit-group {
    gap: 8px;
  }

  .submit-button {
    min-height: 36px;
    gap: 8px;
    padding: 0 10px;
    font-size: 11px;
  }

  .char-count {
    font-size: 9px;
  }

  .note-wall {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 5px;
  }

  .note-card {
    min-height: 145px;
  }

  .site-footer {
    flex-direction: column;
    gap: 6px;
  }
}

@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;
  }
}
