:root {
  --bg: #fbf7ff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(214, 203, 236, 0.72);
  --text: #7b679f;
  --muted: #aa9ac3;
  --pill-text: #8d79b0;
  --accent: #d7b8ef;
  --accent-strong: #c39ae8;
  --shadow: 0 20px 48px rgba(208, 191, 232, 0.2);
  --shadow-soft: 0 10px 26px rgba(211, 196, 234, 0.16);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 223, 242, 0.72), transparent 26%),
    radial-gradient(circle at top right, rgba(255, 241, 214, 0.56), transparent 24%),
    radial-gradient(circle at center, rgba(229, 220, 247, 0.3), transparent 50%),
    linear-gradient(180deg, #fffefd 0%, #f8f4ff 46%, #f6f0ff 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 42px;
  padding: 18px 24px;
  border: 1px solid rgba(222, 213, 242, 0.86);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd7ee, #ead5ff);
  box-shadow: 0 10px 24px rgba(224, 193, 235, 0.3);
  overflow: hidden;
}

.brand-icon {
  width: 30px;
  height: 30px;
  display: block;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong,
.topbar-link,
h1,
.pill,
.card-chip {
  font-family: "Quicksand", sans-serif;
}

.brand-copy strong {
  font-size: 1.45rem;
  font-weight: 700;
  color: #8d77b0;
}

.brand-copy span {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--muted);
}

.topbar-links {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-link {
  border: 0;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  color: #9a88bb;
  background: transparent;
  font-size: 1rem;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.topbar-link-active {
  color: #a274d4;
  background: linear-gradient(180deg, #f7e9ff, #f2dfff);
  box-shadow: 0 10px 22px rgba(220, 197, 245, 0.4);
}

.library-page {
  position: relative;
  padding: 16px 0 24px;
}

.coming-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 260px);
  padding: 28px 0 18px;
}

.coming-card {
  width: min(100%, 720px);
  padding: 48px 36px;
  border: 1px solid rgba(222, 213, 242, 0.9);
  border-radius: 34px;
  background:
    radial-gradient(circle at top right, rgba(255, 233, 244, 0.62), transparent 28%),
    radial-gradient(circle at bottom left, rgba(229, 220, 247, 0.44), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 243, 255, 0.94));
  box-shadow: 0 24px 54px rgba(191, 173, 219, 0.18);
  text-align: center;
}

.library-page::before,
.library-page::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(8px);
}

.library-page::before {
  top: -18px;
  right: 24px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 230, 214, 0.58), transparent 65%);
}

.library-page::after {
  top: 120px;
  left: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(227, 215, 255, 0.46), transparent 66%);
}

.hero-copy {
  text-align: center;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #b8a7d6;
  font-size: 0.95rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.7rem, 5vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #7560a5;
}

h2 {
  margin: 0;
  font-family: "Quicksand", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #7560a5;
}

.library-toolbar {
  display: grid;
  justify-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.search-field {
  width: min(100%, 420px);
}

.search-field input {
  width: 100%;
  min-height: 58px;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(214, 203, 236, 0.9);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), var(--shadow-soft);
}

.search-field input::placeholder {
  color: #c8b9de;
}

.search-field input:focus-visible {
  outline: 2px solid rgba(195, 154, 232, 0.42);
  outline-offset: 3px;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.pill {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(215, 202, 239, 0.95);
  background: rgba(255, 255, 255, 0.74);
  color: var(--pill-text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.pill:hover,
.pill:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.pill.active {
  color: #9c6dd3;
  background: linear-gradient(180deg, #efd9ff, #e7c9ff);
  box-shadow: 0 10px 22px rgba(214, 187, 244, 0.38);
}

.pill[data-tone="happy"].active {
  color: #b4873c;
  background: linear-gradient(180deg, #fff6bc, #ffea8f);
  box-shadow: 0 10px 22px rgba(245, 219, 126, 0.34);
}

.pill[data-tone="sad"].active {
  color: #5b78ba;
  background: linear-gradient(180deg, #dde9ff, #cddcff);
  box-shadow: 0 10px 22px rgba(181, 200, 242, 0.34);
}

.library-total {
  width: 100%;
  margin: 0;
  color: #b39fce;
  font-size: 0.92rem;
  text-align: left;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.kaomoji-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 98px;
  padding: 18px 14px 14px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: 0 8px 18px rgba(223, 212, 244, 0.1);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.kaomoji-card:hover,
.kaomoji-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(209, 193, 234, 0.18);
  filter: saturate(1.04);
}

.kaomoji-card:focus-visible {
  outline: 2px solid rgba(160, 130, 204, 0.34);
  outline-offset: 3px;
}

.kaomoji-card[data-tone="happy"],
.kaomoji-card[data-tone="embarrassed"] {
  background: linear-gradient(180deg, #fff8bf, #fff0a8);
}

.kaomoji-card[data-tone="sad"],
.kaomoji-card[data-tone="surprised"] {
  background: linear-gradient(180deg, #d9e8ff, #cfdcff);
}

.kaomoji-card[data-tone="love"] {
  background: linear-gradient(180deg, #ffe1f1, #ffd7ed);
}

.kaomoji-card[data-tone="angry"] {
  background: linear-gradient(180deg, #ffdede, #ffd3d3);
}

.kaomoji-card[data-tone="nervous"] {
  background: linear-gradient(180deg, #ffeecf, #ffe4b6);
}

.kaomoji-card[data-tone="sleepy"],
.kaomoji-card[data-tone="smug"],
.kaomoji-card[data-tone="waving"],
.kaomoji-card[data-tone="cat"],
.kaomoji-card[data-tone="confused"] {
  background: linear-gradient(180deg, #efe7ff, #e5ddff);
}

.card-expression {
  display: grid;
  place-items: center;
  min-height: 44px;
  color: #92633c;
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.kaomoji-card[data-tone="sad"] .card-expression,
.kaomoji-card[data-tone="surprised"] .card-expression,
.kaomoji-card[data-tone="sleepy"] .card-expression,
.kaomoji-card[data-tone="smug"] .card-expression,
.kaomoji-card[data-tone="waving"] .card-expression,
.kaomoji-card[data-tone="cat"] .card-expression,
.kaomoji-card[data-tone="confused"] .card-expression {
  color: #5d78be;
}

.kaomoji-card[data-tone="love"] .card-expression {
  color: #db5f97;
}

.kaomoji-card[data-tone="angry"] .card-expression {
  color: #d7624e;
}

.kaomoji-card[data-tone="nervous"] .card-expression {
  color: #c3813f;
}

.card-chip {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.58);
  color: rgba(148, 125, 116, 0.9);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kaomoji-card[data-tone="sad"] .card-chip,
.kaomoji-card[data-tone="surprised"] .card-chip,
.kaomoji-card[data-tone="sleepy"] .card-chip,
.kaomoji-card[data-tone="smug"] .card-chip,
.kaomoji-card[data-tone="waving"] .card-chip,
.kaomoji-card[data-tone="cat"] .card-chip,
.kaomoji-card[data-tone="confused"] .card-chip {
  color: #7088c7;
}

.kaomoji-card[data-tone="love"] .card-chip {
  color: #d9659b;
}

.kaomoji-card[data-tone="angry"] .card-chip {
  color: #d46b5e;
}

.kaomoji-card[data-tone="nervous"] .card-chip {
  color: #d08a45;
}

.gallery-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(214, 203, 236, 0.92);
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: flex;
  justify-content: center;
  padding: 28px 0 10px;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid rgba(221, 204, 231, 0.7);
  background:
    radial-gradient(circle at top left, rgba(255, 227, 239, 0.42), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 241, 255, 0.92));
  box-shadow: 0 18px 36px rgba(197, 177, 223, 0.18);
}

.footer-badge-image {
  display: block;
  width: 88px;
  height: 31px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(76, 45, 88, 0.12);
  flex: 0 0 auto;
}

.footer-badge-copy {
  display: grid;
  gap: 2px;
  line-height: 1.15;
  justify-items: center;
  text-align: center;
}

.footer-badge-kicker,
.footer-badge-copy span,
.footer-badge-copy strong {
  font-family: "Quicksand", sans-serif;
}

.footer-badge-kicker,
.footer-badge-copy span {
  color: #9d8ab8;
}

.footer-badge-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.footer-badge-copy strong {
  color: #6e5a97;
  font-size: 1.2rem;
  font-weight: 700;
}

.footer-badge-copy span:last-child {
  font-size: 0.95rem;
}

.button-primary,
.button-secondary {
  border: 0;
  cursor: pointer;
}

.button-primary {
  color: #fff;
  background: linear-gradient(180deg, #d3aef2, #bc8fe9);
  box-shadow: 0 10px 22px rgba(198, 161, 237, 0.38);
}

.button-secondary {
  color: #917aae;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 0 0 1px rgba(214, 203, 236, 0.95);
}

.modal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-family: "Quicksand", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}

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

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(114, 93, 154, 0.2);
  backdrop-filter: blur(8px);
}

.submit-modal {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  padding: 28px;
  border: 1px solid rgba(222, 213, 242, 0.95);
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(255, 235, 245, 0.84), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(249, 244, 255, 0.97));
  box-shadow: 0 30px 60px rgba(172, 149, 209, 0.22);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #9e88c4;
  font-size: 1.6rem;
  cursor: pointer;
}

.modal-copy {
  margin-bottom: 18px;
}

.modal-eyebrow {
  margin: 0 0 8px;
  color: #b8a7d6;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.coming-eyebrow {
  margin: 0 0 10px;
  color: #b8a7d6;
  font-family: "Quicksand", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.coming-text {
  width: min(100%, 54ch);
  margin: 16px auto 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1rem;
}

.coming-actions {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.modal-text {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.submit-form {
  display: grid;
  gap: 14px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field span {
  color: #8f7aad;
  font-family: "Quicksand", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid rgba(214, 203, 236, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  padding: 14px 16px;
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.form-field textarea {
  min-height: 104px;
}

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: 2px solid rgba(195, 154, 232, 0.42);
  outline-offset: 3px;
}

.form-turnstile {
  padding: 16px 18px;
  border: 1px dashed rgba(214, 203, 236, 0.98);
  border-radius: 20px;
  background: rgba(251, 248, 255, 0.95);
}

.form-turnstile span {
  display: block;
  margin-bottom: 6px;
  color: #8f7aad;
  font-family: "Quicksand", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
}

.form-turnstile p,
.form-feedback {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.form-feedback {
  min-height: 24px;
  font-size: 0.95rem;
}

.form-feedback.is-error {
  color: #c66c7d;
}

.form-feedback.is-success {
  color: #7b8c45;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1180px) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 14px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 28px;
  }

  .library-total {
    text-align: center;
  }

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

  .submit-modal {
    padding: 22px;
  }

  .footer-badge {
    width: min(100%, 520px);
  }

  .coming-card {
    padding: 40px 28px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 16px;
  }

  .topbar-links {
    width: 100%;
  }

  .topbar-link {
    flex: 1 1 0;
    text-align: center;
  }

  .search-field {
    width: 100%;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .submit-modal {
    padding: 20px 16px 16px;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .modal-button {
    width: 100%;
  }

  .footer-badge {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 16px;
    gap: 12px;
  }

  .footer-badge-image {
    width: 88px;
    height: 31px;
  }

  .footer-badge-copy {
    min-width: 0;
    flex: 1 1 220px;
  }

  .footer-badge-copy strong {
    font-size: 1.05rem;
    line-height: 1.2;
    text-wrap: balance;
  }

  .footer-badge-copy span:last-child {
    font-size: 0.9rem;
  }

  .coming-card {
    padding: 30px 18px;
  }
}
