html { scroll-padding-top: 3.5rem; }

.header-slot {
  --header-logo-width: clamp(6rem, 11vw, 9rem);
  position: sticky;
  top: 0;
  z-index: 4;
  /* Reserve the expanded height so changing the bar does not move the page. */
  height: calc(var(--header-logo-width) * .483 + 1.6rem + 2px);
  pointer-events: none;
}
.header-slot .nav { pointer-events: auto; }
.header-slot .wordmark { width: var(--header-logo-width); }
.header-slot.is-compact .nav {
  padding-block: .2rem;
  border-bottom: 0;
}
.header-slot.is-compact .wordmark { width: 4.35rem; }
.header-slot.is-compact .bag-button {
  position: relative;
  isolation: isolate;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  gap: .35rem;
  padding: 0 .6rem;
  border: 0;
  background: transparent;
  font-size: .875rem;
}
.header-slot.is-compact .bag-button::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 6px 0;
  border-radius: inherit;
  background: var(--lime);
}
.header-slot.is-compact .bag-button:focus-visible {
  outline-color: var(--lime);
  outline-offset: -1px;
}
.header-slot.is-compact .bag-button svg { width: 16px; height: 18px; }

.nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  background: var(--ink);
  color: var(--cream);
  border-color: #fff5df26;
}
.nav > .wordmark { justify-self: center; }
.nav > .bag-button { justify-self: end; }

@media (max-width: 440px) {
  .nav { column-gap: .5rem; }
  .nav nav { gap: .5rem; font-size: .875rem; }
}

.wordmark {
  display: inline-block;
  width: clamp(6rem, 11vw, 9rem);
  padding: 0;
  transform: none;
}
.wordmark img {
  width: 100%;
  height: auto;
  display: block;
}
.bag-button {
  color: var(--ink);
  border-radius: 100px;
  box-shadow: none;
}
.campaign-hero {
  color: var(--cream);
  background:
    radial-gradient(ellipse at 74% 50%, #472366 0%, transparent 56%),
    #15101e;
}
.campaign-hero .hero-inner {
  grid-template-columns: 1fr 1.12fr;
  gap: 1.2rem;
  padding-block: clamp(2.75rem, 5vw, 4.75rem);
}
.campaign-hero h1 { font-size: clamp(3.7rem, 8vw, 8.2rem); }
.campaign-hero h1 em {
  color: var(--lime);
  -webkit-text-stroke: 0;
  text-shadow: 2px 3px #a1ad24, 4px 6px #3a410a;
}
.campaign-hero .button { background: var(--lime); color: var(--ink); }
.campaign-hero .hero-photo {
  aspect-ratio: 1;
  border-color: var(--cream);
  box-shadow: 9px 9px var(--purple);
}
.strip {
  background: var(--lime);
  color: var(--ink);
  border-block: 2px solid var(--ink);
}
.strip span { color: var(--ink); }
.product-art { perspective: 650px; }
.product-art svg {
  transform: translateZ(0) rotate(-12deg);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), filter .28s ease;
}
.product:hover .product-art svg,
.product:focus-within .product-art svg {
  transform: translateZ(38px) rotate(-6deg) rotateY(-13deg);
  filter: drop-shadow(8px 12px 0 #15151540);
}
@media (max-width: 720px) {
  .campaign-hero .hero-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .campaign-hero h1 { font-size: clamp(3.55rem, 13vw, 6rem); }
}
@media (prefers-reduced-motion: reduce) {
  .product:hover .product-art svg,
  .product:focus-within .product-art svg { transform: rotate(-12deg); }
}

.shop-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .8rem 1rem;
  margin-bottom: 1.3rem;
}

#shop-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

#shop-filters button {
  min-height: 44px;
  padding: .45rem .8rem;
  border: 2px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#shop-filters button:hover { background: #e4ff3880; }
#shop-filters button[aria-pressed="true"] {
  background: var(--lime);
  box-shadow: 2px 2px var(--ink);
}

#shop-filter-status {
  margin: 0;
  font: inherit;
  font-size: .875rem;
}

#catalog .product[hidden] { display: none; }

.product-info h3 a, .stash-item-info h3 a { color: inherit; text-decoration: none; }
.product-info h3 a:hover, .stash-item-info h3 a:hover { text-decoration: underline; }
.quick-view-button {
  align-self: end;
  min-height: 40px;
  padding: .35rem .6rem;
  border: 2px solid var(--ink);
  background: var(--lime);
  color: var(--ink);
  font: 700 .875rem/1.05 var(--copy);
  cursor: pointer;
}
.quick-view-button:hover, #continue-shopping:hover { background: #f5ff9c; }

.product-page { padding-block: clamp(2rem, 6vw, 6rem); }
.back-shop { display: inline-block; margin-bottom: 1.2rem; font-weight: 700; }
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 4rem);
  align-items: center;
}
.detail-art {
  display: grid;
  place-items: center;
  aspect-ratio: 1.1;
  background: var(--tile);
  border: 2px solid var(--ink);
  box-shadow: 5px 5px var(--ink);
}
.detail-art svg {
  display: block;
  width: min(65%, 21rem);
  max-height: 92%;
  transform: rotate(-9deg);
  filter: drop-shadow(4px 5px 0 #15151535);
}
.detail-copy h1, .detail-copy h2 {
  margin: .4rem 0;
  font: 800 clamp(2.2rem, 5vw, 5.5rem)/.95 var(--display);
  letter-spacing: -.055em;
}
.detail-collection {
  width: fit-content;
  margin: 0;
  padding: .3rem .55rem;
  border: 1px solid var(--ink);
  background: var(--lime);
  font-size: .875rem;
  font-weight: 700;
}
.detail-price { margin: 1rem 0; font-size: 1.4rem; font-weight: 700; }
.detail-price small { font-size: .875rem; font-weight: 500; }
.detail-fit {
  padding-block: .75rem;
  border-top: 1px solid var(--ink);
  font-size: .9rem;
  line-height: 1.5;
}
.detail-link { display: inline-block; margin-top: .9rem; font-weight: 700; }

#quick-view {
  inset: 0;
  box-sizing: border-box;
  width: min(760px, calc(100% - 2rem));
  height: fit-content;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: clamp(1rem, 3vw, 1.8rem);
  border: 2px solid var(--ink);
  box-shadow: 7px 7px var(--ink);
  overflow: auto;
}
.quick-close { display: flex; justify-content: end; margin: 0 0 .5rem; }
#quick-view h2 { font-size: clamp(2rem, 4.5vw, 3.5rem); }
#quick-view .detail-link { display: block; }
#quick-view-status { margin: .7rem 0 0; font-weight: 700; }
#quick-view-status:empty { display: none; }

#bag {
  box-sizing: border-box;
  width: min(100%, 470px);
  height: 100dvh;
  padding: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
#bag[open] { display: grid; }
#bag .drawer-head {
  padding: 1.1rem 1.25rem;
  background: var(--ink);
  color: var(--cream);
}
#bag .drawer-head .close { color: var(--cream); }
#bag-summary { margin: .4rem 0 0; color: var(--lime); font-size: .875rem; }
#bag-items { overflow: auto; padding-inline: 1.25rem; }
.stash-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: .85rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--ink);
}
.stash-art {
  display: flex;
  align-self: start;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px var(--ink);
}
.stash-art span { display: grid; flex: 1; min-width: 0; place-items: center; background: var(--tile); }
.stash-art svg { width: 78%; max-height: 67px; }
.stash-item h3 { margin: 0 0 .3rem; font-size: 1rem; }
.stash-item strong { font-size: .95rem; }
.stash-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .8rem; margin-top: .5rem; }
.quantity { display: inline-flex; align-items: center; border: 1px solid var(--ink); }
.quantity span { min-width: 28px; text-align: center; }
.quantity button, .remove-line {
  min-width: 40px;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.quantity button:not(:disabled):hover { background: var(--lime); }
.quantity button:disabled { opacity: .4; cursor: default; }
.remove-line { padding-inline: .2rem; font-size: .85rem; text-decoration: underline; }
.stash-empty { padding: clamp(1rem, 12vh, 6rem) 0; text-align: center; font-weight: 700; }
.stash-empty span { font-size: 2.25rem; color: var(--purple); }
.drawer-footer {
  padding: .9rem 1.25rem max(1.1rem, env(safe-area-inset-bottom));
  border-top: 2px solid var(--ink);
  background: var(--cream);
}
.drawer-footer .drawer-total { margin-top: 0; font-size: 1.15rem; }
.drawer-footer .demo-note { margin: .5rem 0 .8rem; }
#continue-shopping { width: 100%; background: var(--lime); color: var(--ink); }

@media (max-width: 620px) {
  .product-info:has(.quick-view-button) { grid-template-columns: 1fr; }
  .quick-view-button { justify-self: start; }
  .detail-layout { grid-template-columns: 1fr; }
  #quick-view .detail-art { aspect-ratio: 1.45; }
  #quick-view .detail-art svg { width: 38%; }
}

.header-actions {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: .3rem;
}
.account-trigger {
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
}
.account-trigger[hidden], #account-dialog [hidden] { display: none; }
.account-trigger:hover { color: var(--lime); }
#account-dialog {
  inset: 0;
  width: min(28rem, calc(100% - 2rem));
  height: fit-content;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 1.25rem;
  border: 2px solid var(--ink);
  color: var(--ink);
  box-shadow: 6px 6px var(--purple);
}
.account-heading { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.account-heading h2 { margin: 0; font: 800 clamp(1.9rem, 5vw, 2.5rem)/1 var(--display); }
.account-switch { display: flex; gap: .5rem; margin: .9rem 0 1rem; }
.account-switch button {
  min-height: 44px;
  padding: .45rem .8rem;
  border: 2px solid var(--ink);
  background: var(--cream);
  font: 700 1rem var(--copy);
  color: var(--ink);
  cursor: pointer;
}
.account-switch button[aria-pressed="true"] { background: var(--lime); }
.account-form { display: grid; gap: .8rem; }
.account-form label { display: grid; gap: .3rem; font-weight: 700; }
.account-form input {
  min-height: 44px;
  min-width: 0;
  padding: .5rem;
  border: 2px solid var(--ink);
  background: white;
  font: 1rem var(--copy);
}
.account-form .button { justify-self: start; margin-top: .15rem; }
#account-status { margin: .85rem 0 0; overflow-wrap: anywhere; }
#account-status:empty { display: none; }
#account-email { overflow-wrap: anywhere; }
@media (max-width: 390px) {
  .header-actions { gap: 0; }
  .account-trigger { width: 28px; }
  .header-actions .bag-button { gap: .25rem; padding-inline: .4rem; }
}

.signup-fieldset {
  min-width: 0;
  margin: .3rem 0 0;
  padding: .8rem 0 0;
  display: grid;
  gap: .65rem;
  border: 0;
  border-top: 1px solid var(--ink);
}
.signup-fieldset legend { padding: 0 .4rem 0 0; font-weight: 800; }
.signup-fieldset .optional-label { display: inline; font-size: .875rem; font-weight: 400; }
.signup-fieldset label:has(.optional-label) { display: block; }
.signup-fieldset label:has(.optional-label) input { display: block; width: 100%; margin-top: .3rem; }
.location-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.location-grid input { width: 100%; }

.avatar-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.account-form .avatar-option { position: relative; cursor: pointer; }
.avatar-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  opacity: 0;
}
.avatar-card {
  display: grid;
  grid-template-rows: 44px 2.3em;
  align-items: center;
  justify-items: center;
  gap: .25rem;
  padding: .25rem;
  border: 2px solid var(--ink);
  background: var(--avatar-tile);
  text-align: center;
  font-size: .75rem;
  line-height: 1.1;
}
.avatar-card svg { height: 100%; width: auto; }
.avatar-option input:checked + .avatar-card { box-shadow: inset 0 0 0 2px var(--cream), 2px 2px var(--ink); }
.avatar-option input:focus-visible + .avatar-card { outline: 3px solid var(--ink); outline-offset: 2px; }
.header-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}
.header-avatar[hidden] { display: none; }
.header-avatar svg { height: 83%; width: auto; }
.account-identity { display: flex; align-items: center; gap: .65rem; }
.account-identity .header-avatar { width: 42px; height: 42px; }

@property --lens-radius {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.lens-filter { position: absolute; pointer-events: none; }
.product-art { position: relative; overflow: hidden; isolation: isolate; }
.product-worn-photo {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

@media (any-hover: hover) and (any-pointer: fine) {
  .product-worn-photo {
    display: block;
    opacity: 0;
    filter: url(#sock-lens-distortion);
    mask-image: radial-gradient(
      circle var(--lens-radius) at var(--lens-x, 50%) var(--lens-y, 50%),
      #000 0 76%, #000d 87%, transparent 100%
    );
    transition: --lens-radius 440ms cubic-bezier(.2,.75,.23,1), opacity 260ms ease;
  }
  .product-art.is-revealing .product-worn-photo {
    --lens-radius: clamp(115px, 11vw, 175px);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .product-worn-photo { transition: none; filter: none; }
}

@media (prefers-reduced-motion: no-preference) {
  #quick-view {
    opacity: 0;
    transform: translateY(16px) scale(.965);
    transition: opacity 220ms ease, transform 380ms cubic-bezier(.16, 1, .3, 1),
      display 380ms allow-discrete, overlay 380ms allow-discrete;
  }
  #quick-view[open] { opacity: 1; transform: translateY(0) scale(1); }
  #quick-view::backdrop {
    background: transparent;
    transition: background 270ms ease, display 380ms allow-discrete, overlay 380ms allow-discrete;
  }
  #quick-view[open]::backdrop { background: #151515a8; }

  @starting-style {
    #quick-view[open] { opacity: 0; transform: translateY(16px) scale(.965); }
    #quick-view[open]::backdrop { background: transparent; }
  }
}

.product-gallery { min-width: 0; }
.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border: 2px solid var(--ink);
  box-shadow: 5px 5px var(--ink);
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track > .detail-art {
  box-sizing: border-box;
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  border: 0;
  box-shadow: none;
  overflow: hidden;
}
.gallery-photo { position: relative; background: var(--cream); }
.gallery-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gallery-options { display: flex; gap: .45rem; margin-top: .8rem; }
.gallery-options button {
  min-height: 44px;
  border: 2px solid var(--ink);
  padding: .4rem .65rem;
  background: var(--cream);
  color: var(--ink);
  font: 700 .875rem var(--copy);
  cursor: pointer;
}
.gallery-options button[aria-pressed="true"] { background: var(--lime); }
