@layer base {
  html,
  body {
    width: 100%;
    margin: 0;
    padding: 0;
    color-scheme: light;
  }

  body {
    overscroll-behavior-y: none;
    min-height: max(884px, 100dvh);
  text-transform: uppercase;
  font-family: "Outfit", sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  }

h1,
h2,
h3,
h4,
strong,
button,
.font-headline-sm,
.font-headline-md,
.font-headline-lg-mobile,
.font-title-md,
.font-label-md,
.font-label-lg {
  font-weight: 700 !important;
}

.font-body-sm,
.font-body-md,
.font-body-lg {
  font-weight: 400 !important;
}

/* Apply CAPSLOCK globally without changing icon ligatures. */
input,
textarea,
button,
select,
option {
  text-transform: uppercase;
}

.material-symbols-outlined,
svg {
  text-transform: none;
}

  .pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .pt-safe {
    padding-top: env(safe-area-inset-top, 0px);
  }
}

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

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.denim-card {
  border: 1px solid #e5e7eb;
  content-visibility: auto;
  contain-intrinsic-size: 280px 360px;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.denim-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(11, 27, 58, 0.06);
  border-color: rgba(11, 27, 58, 0.25);
}

.modal-backdrop {
  transition: opacity 240ms ease;
}

.modal-sheet {
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
}

.tab-panel {
  animation: fadeSlideIn 180ms ease-out;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Lightweight motion and an explicit light canvas for browsers that force dark mode. */
html,
body {
  background-color: #fcf9f8 !important;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  html,
  body {
    background-color: #fcf9f8 !important;
    color-scheme: light;
  }
}

body {
  animation: pageReveal 420ms ease-out both;
}

header,
nav {
  animation: chromeReveal 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.denim-card {
  animation: cardReveal 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.denim-card:nth-child(2) { animation-delay: 35ms; }
.denim-card:nth-child(3) { animation-delay: 70ms; }
.denim-card:nth-child(4) { animation-delay: 105ms; }
.denim-card:nth-child(5) { animation-delay: 140ms; }
.denim-card:nth-child(6) { animation-delay: 175ms; }

button,
a,
.filter-pill {
  transition: transform 180ms ease, opacity 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

button:hover,
a:hover {
  transform: translateY(-1px);
}

button:active,
a:active {
  transform: translateY(0) scale(0.98);
}

@keyframes pageReveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes chromeReveal {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.denim-shelf {
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
  perspective: 900px;
}

.denim-shelf .denim-card {
  width: min(58vw, 220px);
  min-height: 100%;
  transition: transform 360ms cubic-bezier(.22, 1, .36, 1), box-shadow 360ms ease, opacity 240ms ease;
}

/* Archive cards stay compact; the detail view remains large when opened. */
.denim-shelf .denim-card > div:first-child > img {
  width: 68%;
  height: 68%;
  object-fit: contain;
}

.denim-shelf .denim-card > div:last-child {
  padding: 0.7rem;
}

.denim-shelf .denim-card:hover {
  transform: translateY(-6px) rotateY(-1deg);
  box-shadow: 0 18px 32px rgba(11, 27, 58, .12);
}

.article-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid #d6dde8;
  border-radius: 999px;
  color: #536174;
  background: #f5f7fa;
}
.article-accent-hemp {
  color: #2f704a;
  border-color: #a8d0b2;
  background: #edf8ef;
  animation: hempSway 2.8s ease-in-out infinite;
}
@keyframes hempSway {
  0%, 100% { transform: rotate(-5deg) translateY(0); }
  50% { transform: rotate(6deg) translateY(-2px); }
}

.delete-denim-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #e1caca;
  border-radius: 8px;
  color: #9b3e3e;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 4px 12px rgba(11, 27, 58, .1);
}
.delete-denim-btn:hover { color: #fff; background: #9b3e3e; border-color: #9b3e3e; }

.hover-preview {
  width: 150px;
  overflow: hidden;
  border: 1px solid rgba(11, 27, 58, .14);
  border-radius: 10px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 16px 36px rgba(11, 27, 58, .16);
  transform: translate3d(0,0,0);
  transition: opacity 140ms ease;
}

.hover-preview img { display: block; width: 100%; height: 112px; object-fit: contain; background: #f7f8fa; }
.hover-preview span { display: block; padding: 7px 9px; color: #0b1b3a; font: 600 9px/1.3 Outfit, sans-serif; letter-spacing: .06em; text-transform: uppercase; }

.archive-hotspot {
  position: absolute;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 999px;
  background: rgba(11,27,58,.7);
  box-shadow: 0 0 0 0 rgba(11,27,58,.35);
  animation: hotspotPulse 2.2s ease-out infinite;
}

.archive-hotspot span { display: block; width: 5px; height: 5px; margin: auto; border-radius: 999px; background: #fff; }
.archive-hotspot:hover { background: #0b1b3a; transform: translate(-50%, -50%) scale(1.14); }

.compare-divider { width: 2px; background: #0b1b3a; box-shadow: 0 0 0 1px rgba(255,255,255,.8); transform: translateX(-1px); pointer-events: none; }
.archive-compare input[type="range"] { accent-color: #0b1b3a; }

.wash-settings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #d9dee7;
  border-radius: 12px;
  background: #fff;
}

.wash-settings-copy { min-width: 0; }
.wash-settings-copy p { margin-top: 4px; }
.wash-settings-controls { display: flex; align-items: end; gap: 8px; flex-shrink: 0; }
.wash-target-field { display: flex; flex-direction: column; gap: 5px; color: #536174; font: 700 10px/1 Outfit, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.wash-target-field input { width: 88px; height: 36px; padding: 0 10px; border: 1px solid #cbd3df; border-radius: 8px; color: #0b1b3a; background: #f8fafc; font: 700 14px/1 Outfit, sans-serif; }
.wash-target-field input:focus { outline: 2px solid rgba(11, 27, 58, .18); border-color: #0b1b3a; }
.wash-save-btn { height: 36px; padding: 0 14px; border: 0; border-radius: 8px; color: #fff; background: #0b1b3a; font: 700 10px/1 Outfit, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.delete-log-btn { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 4px 7px; border: 1px solid #e1caca; border-radius: 7px; color: #9b3e3e; background: #fff7f7; font: 700 9px/1 Outfit, sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.delete-log-btn:hover { color: #fff; background: #9b3e3e; border-color: #9b3e3e; }

.edit-photo-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px dashed #b8c1cf;
  border-radius: 10px;
  color: #0b1b3a;
  background: #f8fafc;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.edit-photo-upload:hover { border-color: #0b1b3a; background: #f1f5f9; transform: translateY(-1px); }
.edit-photo-upload-copy { display: flex; flex-direction: column; gap: 3px; }
.edit-photo-upload-copy strong { font: 700 11px/1.2 Outfit, sans-serif; letter-spacing: .07em; text-transform: uppercase; }
.edit-photo-upload-copy small { color: #667085; font: 400 11px/1.2 Outfit, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.ai-generate-btn { padding: 8px 10px; border: 1px solid #0b1b3a; border-radius: 8px; color: #0b1b3a; background: #fff; font: 700 10px/1 Outfit, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.ai-generate-btn:hover { color: #fff; background: #0b1b3a; }
.ai-generate-btn:disabled { opacity: .55; cursor: wait; }
.ai-status { color: #667085; font: 400 9px/1.3 Outfit, sans-serif; letter-spacing: .04em; text-align: right; }

@media (max-width: 560px) {
  .denim-shelf .denim-card { width: min(42vw, 170px); }
  .denim-shelf .denim-card > div:first-child > img { width: 58%; height: 58%; }
  .wash-settings-card { align-items: stretch; flex-direction: column; }
  .wash-settings-controls { justify-content: space-between; }
  .wash-target-field { flex: 1; }
  .wash-target-field input { width: 100%; }
  .wash-save-btn { min-width: 105px; }
  .ai-status { max-width: 150px; }
}

.lightbox { background: rgba(5, 11, 25, .88); backdrop-filter: blur(12px); animation: lightboxIn 220ms ease-out both; }
.lightbox img { animation: lightboxImageIn 300ms cubic-bezier(.22,1,.36,1) both; }

@keyframes hotspotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(11,27,58,.32); }
  55% { box-shadow: 0 0 0 8px rgba(11,27,58,0); }
}

@keyframes lightboxIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lightboxImageIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
