:root {
  color-scheme: light;
  --ink: #171313;
  --muted: #6d6461;
  --paper: #fffdfb;
  --blush: #f7eee8;
  --blush-deep: #ead5cf;
  --pink: #e7a6aa;
  --pink-dark: #a84f5b;
  --green: #375f4a;
  --line: #d9cfca;
  --danger: #a63232;
  --shadow: 0 14px 36px rgb(54 35 28 / 10%);
  --radius: 1.25rem;
  --content: 1180px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--blush);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 14%, rgb(255 255 255 / 65%), transparent 25rem),
    var(--blush);
}

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

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

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  transform: translateY(-150%);
  border-radius: 0.5rem;
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 2rem), var(--content));
  min-height: 5.25rem;
  margin: auto;
  border-bottom: 1px solid rgb(23 19 19 / 12%);
}

.brand {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--blush);
  font-family: sans-serif;
  font-size: 1rem;
}

.site-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.site-nav .email {
  max-width: 13rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  min-height: calc(100vh - 5.25rem);
}

.shell {
  width: min(calc(100% - 2rem), var(--content));
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.narrow {
  width: min(calc(100% - 2rem), 560px);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--pink-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

h1 {
  max-width: 850px;
  margin-bottom: 1rem;
  font-size: clamp(2.7rem, 8vw, 6.7rem);
  font-weight: 500;
}

h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  font-weight: 500;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1.45rem;
}

.lede {
  max-width: 680px;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 4rem;
  align-items: end;
  min-height: calc(100vh - 11rem);
}

.hero-art {
  position: relative;
  min-height: 430px;
}

.hero-card {
  position: absolute;
  overflow: hidden;
  width: min(75%, 290px);
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-card:first-child {
  top: 1rem;
  right: 0;
  transform: rotate(4deg);
}

.hero-card:last-child {
  bottom: 1rem;
  left: 0;
  transform: rotate(-5deg);
}

.hero-card-visual {
  display: grid;
  height: 210px;
  place-items: center;
  border-radius: 0.9rem;
  background: linear-gradient(140deg, #f1b7ad, #f9e1bd);
  font-size: 5rem;
}

.hero-card:last-child .hero-card-visual {
  background: linear-gradient(140deg, #b7d7c2, #e5ead0);
}

.hero-card p {
  margin: 0.8rem 0 0.2rem;
  font-family: Georgia, serif;
  font-size: 1.15rem;
}

.actions,
.toolbar,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  min-height: 2.75rem;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.05rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgb(23 19 19 / 12%);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible,
.icon-btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(168 79 91 / 40%);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--ink);
  color: white;
}

.btn-pink {
  border-color: var(--pink-dark);
  background: var(--pink);
  color: #32171b;
}

.btn-ghost {
  border-color: transparent;
}

.btn-danger {
  border-color: rgb(166 50 50 / 30%);
  color: var(--danger);
}

.btn-small {
  min-height: 2.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
}

.btn[disabled],
.icon-btn[disabled] {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 0.6fr);
  gap: 4rem;
  align-items: center;
  min-height: calc(100vh - 11rem);
}

.panel,
.auth-card,
.modal,
.empty-state {
  border: 1px solid rgb(23 19 19 / 13%);
  border-radius: var(--radius);
  background: rgb(255 253 251 / 84%);
  box-shadow: var(--shadow);
}

.auth-card,
.panel {
  padding: clamp(1.3rem, 4vw, 2.2rem);
}

.auth-card .muted {
  margin-bottom: 1.5rem;
}

.auth-switch {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--pink-dark);
  font-weight: 750;
  text-decoration: underline;
  cursor: pointer;
}

.field {
  display: grid;
  gap: 0.42rem;
  margin-bottom: 1rem;
}

.field > span,
.field-label {
  font-size: 0.8rem;
  font-weight: 800;
}

.field-hint,
.muted {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

input,
textarea,
select {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: white;
}

textarea {
  min-height: 7.5rem;
  resize: vertical;
}

input[type="checkbox"] {
  width: 1.1rem;
  min-height: 1.1rem;
  accent-color: var(--ink);
}

.checkbox-field {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-height: 3rem;
}

.form-error {
  padding: 0.7rem 0.85rem;
  border-left: 3px solid var(--danger);
  border-radius: 0.4rem;
  background: rgb(166 50 50 / 8%);
  color: var(--danger);
  font-size: 0.9rem;
}

.dashboard-head,
.public-head,
.editor-head {
  display: flex;
  gap: 2rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.dashboard-head h1,
.public-head h1,
.editor-head h1 {
  max-width: 800px;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5rem);
}

.dashboard-head p,
.public-head p {
  margin-bottom: 0;
}

.list-grid,
.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.list-card,
.gift-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgb(23 19 19 / 13%);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 8px 22px rgb(54 35 28 / 7%);
}

.list-card {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.35rem;
  background:
    linear-gradient(145deg, transparent 63%, rgb(231 166 170 / 22%)),
    var(--paper);
}

.list-card h3 {
  font-size: 1.75rem;
}

.list-card p {
  overflow: hidden;
  color: var(--muted);
  line-height: 1.5;
  text-overflow: ellipsis;
}

.list-card .card-actions {
  margin-top: 1.5rem;
}

.badge,
.price,
.priority {
  display: inline-flex;
  width: fit-content;
  min-height: 1.7rem;
  align-items: center;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: #eee8e4;
  color: #514945;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-live {
  background: #dbe9df;
  color: var(--green);
}

.badge-reserved {
  background: #f0d8dd;
  color: #6d2631;
}

.dashboard-stats {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: clamp(2rem, 8vw, 5rem) 1.5rem;
  text-align: center;
}

.empty-symbol {
  display: grid;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.2rem;
  place-items: center;
  border-radius: 50%;
  background: var(--blush-deep);
  font-size: 1.8rem;
}

.empty-state p {
  max-width: 480px;
  margin-right: auto;
  margin-left: auto;
  color: var(--muted);
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

.editor-layout .panel {
  position: sticky;
  top: 1rem;
}

.section-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.section-head h2 {
  margin: 0;
  font-size: 2.1rem;
}

.item-list {
  display: grid;
  gap: 0.7rem;
}

.item-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: white;
}

.item-thumb {
  display: grid;
  width: 72px;
  height: 72px;
  overflow: hidden;
  place-items: center;
  border-radius: 0.7rem;
  background: var(--blush);
  color: var(--muted);
  font-size: 1.5rem;
}

.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-row h3 {
  margin: 0 0 0.25rem;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0;
}

.item-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.row-actions {
  display: flex;
  gap: 0.25rem;
}

.icon-btn {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.icon-btn:hover {
  border-color: var(--line);
  background: var(--blush);
}

.public-shell {
  width: min(calc(100% - 2rem), 1280px);
  margin: 0 auto;
  padding: 3rem 0 6rem;
}

.public-head {
  align-items: start;
}

.public-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.5rem;
  margin-top: 1.2rem;
  color: var(--muted);
}

.public-description {
  max-width: 650px;
  color: var(--muted);
  line-height: 1.65;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(160px, 0.3fr));
  gap: 0.75rem;
  margin-bottom: 1.4rem;
  padding: 0.8rem;
  border: 1px solid rgb(23 19 19 / 12%);
  border-radius: 1rem;
  background: rgb(255 253 251 / 70%);
}

.search-wrap {
  position: relative;
}

.search-wrap span {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-wrap input {
  padding-left: 2.5rem;
}

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

.gift-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.gift-image {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  place-items: center;
  background:
    linear-gradient(145deg, rgb(231 166 170 / 25%), transparent),
    #f4ebe6;
  color: var(--muted);
  font-size: 2.2rem;
}

.gift-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.gift-card:hover .gift-image img {
  transform: scale(1.025);
}

.gift-image .badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.gift-content {
  display: flex;
  min-height: 220px;
  flex: 1;
  flex-direction: column;
  padding: 1rem;
}

.gift-content h2 {
  margin-bottom: 0.5rem;
  font-size: 1.45rem;
}

.gift-content .note {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.gift-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.gift-content .card-actions {
  margin-top: auto;
}

.store-link {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.reserved-own {
  border-color: rgb(55 95 74 / 35%);
}

.privacy-note {
  max-width: 350px;
  padding: 1rem;
  border: 1px solid rgb(55 95 74 / 20%);
  border-radius: 1rem;
  background: rgb(219 233 223 / 48%);
  color: var(--green);
  font-size: 0.85rem;
  line-height: 1.5;
}

.page-state {
  display: grid;
  min-height: 60vh;
  place-content: center;
  color: var(--muted);
  text-align: center;
}

.spinner {
  width: 2rem;
  height: 2rem;
  margin: 0 auto 0.8rem;
  animation: spin 700ms linear infinite;
  border: 3px solid var(--blush-deep);
  border-top-color: var(--pink-dark);
  border-radius: 50%;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  overflow-y: auto;
  padding: 1rem;
  place-items: center;
  background: rgb(23 19 19 / 42%);
  backdrop-filter: blur(5px);
}

.modal {
  width: min(100%, 650px);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: clamp(1.2rem, 4vw, 2rem);
}

.modal-head {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 1.3rem;
}

.modal-head h2 {
  margin: 0;
  font-size: 2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 0.8rem;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  width: min(calc(100% - 2rem), 360px);
  gap: 0.5rem;
}

.toast {
  padding: 0.85rem 1rem;
  animation: toast-in 180ms ease both;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 0.8rem;
  background: var(--ink);
  box-shadow: var(--shadow);
  color: white;
  font-size: 0.9rem;
}

.toast-error {
  background: #752828;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}

@media (max-width: 980px) {
  .gift-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .hero {
    gap: 1.5rem;
  }

  .editor-layout {
    grid-template-columns: 1fr;
  }

  .editor-layout .panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .site-header {
    min-height: 4.5rem;
  }

  .site-nav .email {
    display: none;
  }

  .shell,
  .public-shell {
    padding-top: 2rem;
  }

  .hero,
  .auth-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-art {
    min-height: 390px;
  }

  .dashboard-head,
  .public-head,
  .editor-head {
    align-items: start;
    flex-direction: column;
  }

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

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .filter-bar .search-wrap {
    grid-column: 1 / -1;
  }

  .privacy-note {
    max-width: none;
  }
}

@media (max-width: 520px) {
  .site-header {
    width: min(calc(100% - 1.2rem), var(--content));
  }

  .brand {
    font-size: 1.25rem;
  }

  .brand-mark {
    width: 1.7rem;
    height: 1.7rem;
  }

  .site-nav .btn:first-of-type:not(:last-child) {
    display: none;
  }

  .shell,
  .public-shell {
    width: min(calc(100% - 1.2rem), var(--content));
  }

  .list-grid,
  .gift-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar .search-wrap,
  .form-grid .wide {
    grid-column: auto;
  }

  .item-row {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .item-thumb {
    width: 56px;
    height: 56px;
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    padding-top: 0.5rem;
  }

  .gift-content {
    min-height: auto;
  }
}

@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;
  }
}
