/* Palette taken from the logo: charcoal outlines, greys, coral, lavender and yellow. */
:root {
  --bg: #f8f6f3;
  --surface: #ffffff;
  --ink: #26232b;
  --ink-soft: #67626f;
  --line: #e8e4ec;

  --coral: #ff9e8e;
  --coral-soft: #ffe7e1;
  --coral-ink: #b4473a;
  --lavender: #c7b5ff;
  --lavender-soft: #eee8ff;
  --lavender-ink: #5a45a6;
  --yellow: #fff1a1;
  --yellow-soft: #fff8d6;
  --yellow-ink: #7a6410;

  --whatsapp: #1fa855;
  --whatsapp-dark: #178a45;

  --radius: 18px;
  --radius-lg: 24px;
  --shadow: 0 1px 2px rgba(38, 35, 43, 0.05), 0 6px 20px rgba(38, 35, 43, 0.06);
  --shadow-hover: 0 2px 4px rgba(38, 35, 43, 0.06), 0 14px 30px rgba(38, 35, 43, 0.11);
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

a {
  color: inherit;
}

.container {
  width: min(1160px, 100% - 2.5rem);
  margin-inline: auto;
}

.muted {
  color: var(--ink-soft);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--lavender);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.button:hover {
  background: #000;
  border-color: #000;
}

.button--ghost {
  background: transparent;
  color: var(--ink);
}

.button--ghost:hover {
  background: var(--ink);
  color: #fff;
}

.button--small {
  padding: 0.45rem 1rem;
  font-size: 0.92rem;
}

.button--whatsapp {
  background: var(--whatsapp);
  border-color: var(--whatsapp);
}

.button--whatsapp:hover {
  background: var(--whatsapp-dark);
  border-color: var(--whatsapp-dark);
}

.button--block {
  width: 100%;
}

.link-button {
  font: inherit;
  font-weight: 700;
  background: none;
  border: 0;
  padding: 0;
  color: var(--lavender-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 246, 243, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}

/* ---------- Navigation ---------- */
.nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  margin-right: 1rem;
}

.nav a {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  color: var(--ink-soft);
  transition: background 0.15s, color 0.15s;
}

.nav a:hover {
  color: var(--ink);
  background: var(--line);
}

.nav a[aria-current='page'] {
  color: var(--ink);
  background: var(--lavender-soft);
}

/* ---------- Hero and category cards ---------- */
.hero {
  padding: 1.75rem 0 0.5rem;
}

.hero h1 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.hero__lead {
  color: var(--ink-soft);
  font-size: 1.02rem;
  margin: 0.3rem 0 0;
}

.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

/* Compact tiles, used when there are many categories. */
.category-cards--compact {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
}

.category-tile {
  --card-bg: var(--coral-soft);
  --card-ink: var(--coral-ink);
  --card-accent: var(--coral);
  display: flex;
  flex-direction: column;
  padding: 0 0 0.75rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.category-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.category-tile.is-active {
  border-color: var(--card-ink);
}

.category-tile__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--card-accent);
  margin-bottom: 0.6rem;
}

.category-tile__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-tile__title {
  padding: 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.2;
}

.category-tile__count {
  padding: 0.15rem 0.85rem 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--card-ink);
}

.category-card {
  --card-bg: var(--coral-soft);
  --card-ink: var(--coral-ink);
  --card-accent: var(--coral);
  display: grid;
  grid-template-columns: 1fr 42%;
  align-items: stretch;
  min-height: 170px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.category-card--lavender,
.category-tile.category-card--lavender {
  --card-bg: var(--lavender-soft);
  --card-ink: var(--lavender-ink);
  --card-accent: var(--lavender);
}

.category-card--yellow,
.category-tile.category-card--yellow {
  --card-bg: var(--yellow-soft);
  --card-ink: var(--yellow-ink);
  --card-accent: var(--yellow);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.category-card.is-active {
  border-color: var(--card-ink);
}

.category-card__text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1.1rem 1.25rem 1.4rem;
}

.category-card__count {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--card-ink);
}

.category-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.2;
}

.category-card__description {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.category-card__cta {
  margin-top: auto;
  padding-top: 0.5rem;
  font-weight: 800;
  color: var(--card-ink);
}

.category-card__media {
  position: relative;
  background: var(--card-accent);
}

.category-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Toolbar and filters ---------- */
.catalog {
  padding: 1.25rem 0 5rem;
  scroll-margin-top: 80px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filters--sub {
  margin-top: 0.85rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--lavender);
}

.chip {
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.chip:hover {
  border-color: var(--ink-soft);
}

.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.chip--small {
  padding: 0.35rem 0.85rem;
  font-size: 0.92rem;
}

.chip--small.is-active {
  background: var(--lavender-soft);
  border-color: var(--lavender-ink);
  color: var(--lavender-ink);
}

.search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  min-width: min(260px, 100%);
}

.search:focus-within {
  border-color: var(--lavender-ink);
}

.search svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 2;
  stroke-linecap: round;
}

.search input {
  flex: 1;
  border: 0;
  outline: 0;
  font: inherit;
  padding: 0.6rem 0;
  background: transparent;
  color: var(--ink);
}

.result-count {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: 1.5rem 0 0.75rem;
}

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card__media {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(100deg, var(--lavender-soft) 40%, #f7f4ff 50%, var(--lavender-soft) 60%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

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

.card__badge {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  background: rgba(38, 35, 43, 0.75);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.quick-add {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(38, 35, 43, 0.15);
  transition: transform 0.15s, background 0.15s;
}

.quick-add:hover {
  transform: scale(1.08);
}

.quick-add.is-added {
  background: var(--yellow);
}

.quick-add svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card__body {
  padding: 1rem 1.1rem 1.2rem;
}

.card__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--coral-ink);
}

.card__title {
  font-size: 1.12rem;
  margin-top: 0.25rem;
}

.card__price {
  margin: 0.35rem 0 0;
  font-weight: 800;
  font-size: 1.05rem;
}

.card__text {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.93rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty,
.error {
  text-align: center;
  color: var(--ink-soft);
  padding: 3rem 0;
}

/* Images fade in once loaded; until then the media box shows a soft shimmer. */
.card__media img,
.detail__main,
.category-card__media img {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.card__media img.is-loaded,
.detail__main.is-loaded,
.category-card__media img.is-loaded {
  opacity: 1;
}

img.is-broken {
  visibility: hidden;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ---------- Product dialog ---------- */
.dialog {
  width: min(940px, 100% - 2rem);
  max-height: calc(100% - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.dialog::backdrop,
.drawer::backdrop {
  background: rgba(38, 35, 43, 0.45);
}

.dialog__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}

.dialog__close--static {
  position: static;
  background: var(--bg);
}

.detail {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.detail__gallery {
  background: var(--bg);
}

.detail__main {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.detail__thumbs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  overflow-x: auto;
}

.thumb {
  flex: 0 0 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: none;
}

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

.thumb.is-active {
  border-color: var(--ink);
}

.detail__info {
  display: flex;
  flex-direction: column;
  padding: 2.25rem 2rem 2rem;
}

.detail__info h2 {
  font-size: 1.7rem;
  margin: 0.3rem 0 0.5rem;
}

.detail__info p {
  color: var(--ink-soft);
  margin: 0;
}

.detail__info .detail__price {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.9rem;
}

.detail__list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  border-top: 1px solid var(--line);
}

.detail__list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.tag {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--lavender-soft);
  color: var(--lavender-ink);
}

.detail__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: auto;
  padding-top: 1.75rem;
}

.detail__in-list {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: var(--yellow-soft);
}

/* ---------- Interest list ---------- */
.list-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1rem 0.8rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(38, 35, 43, 0.3);
  animation: pop-in 0.25s ease;
}

.list-fab svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.list-fab__count {
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.85rem;
}

.drawer {
  margin: 0 0 0 auto;
  width: min(440px, 100%);
  height: 100%;
  max-height: 100%;
  padding: 0;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  flex-direction: column;
}

.drawer[open] {
  display: flex;
  animation: slide-in 0.25s ease;
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.drawer__header h2 {
  font-size: 1.4rem;
}

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1.25rem;
}

.drawer__footer {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.list-empty {
  text-align: center;
  padding: 3rem 1rem;
}

.list-empty p {
  margin: 0.25rem 0;
}

.list-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-item {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.list-item__media {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--lavender-soft);
}

.list-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-item__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.list-item__name {
  font-weight: 700;
  line-height: 1.3;
}

.list-item__price {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.stepper button {
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink);
}

.stepper span {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 800;
}

.list-item__remove {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  color: var(--ink-soft);
}

.list-item__remove:hover {
  background: var(--coral-soft);
  color: var(--coral-ink);
}

.list-item__remove svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.list-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 1.05rem;
}

.list-note {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

.drawer__footer .button {
  margin-top: 1rem;
}

.list-clear {
  display: block;
  margin: 0.85rem auto 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 5.5rem;
  z-index: 30;
  transform: translate(-50%, 1rem);
  max-width: calc(100% - 2rem);
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

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

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 6rem;
  font-size: 0.95rem;
}

.footer p {
  margin: 0;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 700;
}

.footer__contact a {
  text-decoration: none;
}

.footer__contact a:hover {
  text-decoration: underline;
}

.footer__legal {
  margin-top: 1.5rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* ---------- Portfolio ---------- */
.hero--page {
  padding-bottom: 1rem;
}

.portfolio {
  padding-bottom: 3rem;
}

.portfolio .filters {
  margin-bottom: 1.25rem;
}

/* Masonry with CSS columns: photos keep their own proportions, which suits mixed work. */
.masonry {
  columns: 3 280px;
  column-gap: 1.25rem;
}

.work {
  break-inside: avoid;
  margin: 0 0 1.25rem;
}

.work__button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--lavender-soft);
  cursor: zoom-in;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.work__button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.work__button img {
  width: 100%;
  height: auto;
  min-height: 120px;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.work__button img.is-loaded {
  opacity: 1;
}

.work__caption {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.25rem 0;
}

.work__title {
  font-weight: 800;
  line-height: 1.3;
}

.work__category {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.quote {
  padding-bottom: 4rem;
}

.quote__box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--yellow-soft);
}

.quote__box h2 {
  font-size: 1.5rem;
}

.quote__box p {
  margin: 0.35rem 0 0;
  max-width: 52ch;
}

/* ---------- Image viewer (lightbox) ---------- */
.viewer {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #141217;
  color: #fff;
  flex-direction: column;
}

.viewer[open] {
  display: flex;
}

.viewer::backdrop {
  background: rgba(20, 18, 23, 0.96);
}

.viewer__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  touch-action: pan-y;
}

/* Absolutely positioned so any photo proportion fits the stage without pushing the caption. */
.viewer__image {
  position: absolute;
  inset: 3.5rem 4.5rem 1rem;
  width: calc(100% - 9rem);
  height: calc(100% - 4.5rem);
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.25s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.viewer__image.is-loaded {
  opacity: 1;
}

.viewer__nav,
.viewer__close {
  position: absolute;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.viewer__nav:hover,
.viewer__close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.viewer__nav {
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
}

.viewer__nav--prev {
  left: 1rem;
}

.viewer__nav--next {
  right: 1rem;
}

.viewer__nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.viewer__close {
  top: 0.75rem;
  right: 0.75rem;
  width: 44px;
  height: 44px;
  font-size: 1.8rem;
  line-height: 1;
}

.viewer__caption {
  padding: 0.75rem 1.5rem 1.5rem;
  text-align: center;
}

.viewer__title {
  font-size: 1.2rem;
}

.viewer__meta {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
}

.viewer__description {
  margin: 0.5rem auto 0;
  max-width: 60ch;
  color: rgba(255, 255, 255, 0.85);
}

@keyframes pop-in {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
}

@keyframes slide-in {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .hero {
    padding: 1.1rem 0 0.25rem;
  }

  .hero h1 {
    font-size: 1.4rem;
  }

  .hero__lead {
    font-size: 0.95rem;
  }

  .category-cards {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-top: 0.9rem;
  }

  .category-card {
    min-height: 104px;
    grid-template-columns: 1fr 30%;
  }

  .category-card__text {
    gap: 0.15rem;
    padding: 0.85rem 0.9rem 0.85rem 1.1rem;
  }

  .category-card__title {
    font-size: 1.08rem;
  }

  .category-card__cta {
    padding-top: 0.35rem;
    font-size: 0.92rem;
  }

  /* Compact tiles become one swipeable row so the hero height stays constant. */
  .category-cards--compact {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: -1.25rem;
    padding: 0.25rem 1.25rem 0.5rem;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 1.25rem;
  }

  .category-cards--compact::-webkit-scrollbar {
    display: none;
  }

  .category-tile {
    flex: 0 0 132px;
    scroll-snap-align: start;
  }

  .category-tile__title {
    font-size: 0.95rem;
  }

  .category-card__description {
    display: none;
  }

  /* nowrap matters: a wrapping column flexbox sizes its line to the widest item (the chip row). */
  .toolbar {
    flex-direction: column-reverse;
    flex-wrap: nowrap;
    align-items: stretch;
  }

  /* One swipeable row instead of stacked chips; bleeds to the screen edges. */
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: -1.25rem;
    padding-inline: 1.25rem;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filters--sub {
    margin-left: -1.25rem;
    padding-left: 1.25rem;
    border-left: 0;
  }

  .chip {
    flex: none;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .card__body {
    padding: 0.75rem 0.8rem 0.9rem;
  }

  .card__title {
    font-size: 1rem;
  }

  .card__text {
    display: none;
  }

  .quick-add {
    width: 38px;
    height: 38px;
  }

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

  .detail__info {
    padding: 1.5rem 1.25rem;
  }

  .drawer {
    width: 100%;
  }

  .nav {
    margin-right: 0;
  }

  .nav a {
    padding: 0.4rem 0.65rem;
    font-size: 0.92rem;
  }

  .masonry {
    columns: 2;
    column-gap: 0.75rem;
  }

  .work {
    margin-bottom: 0.9rem;
  }

  .work__title {
    font-size: 0.92rem;
  }

  .work__category {
    font-size: 0.78rem;
  }

  .quote__box {
    padding: 1.5rem 1.25rem;
  }

  .quote__box .button {
    width: 100%;
  }

  .viewer__image {
    inset: 3.5rem 0.5rem 0.5rem;
    width: calc(100% - 1rem);
    height: calc(100% - 4rem);
  }

  .viewer__nav {
    top: auto;
    bottom: -3.25rem;
    transform: none;
    width: 42px;
    height: 42px;
  }
}

/* Header contact moves to the footer on small phones so the navigation fits. */
@media (max-width: 520px) {
  .header__contact {
    display: none;
  }

  .brand span {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
