:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #0a0a0a;
  --soft: #f4f4f1;
  --line: #d9d9d4;
  --muted: #666660;
  --quiet: #8b8b84;
  --danger: #9f1d16;
  --success: #17633a;
  --display: "Bodoni 72", Didot, "Iowan Old Style", Baskerville, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

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

button,
summary,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
label:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 68px;
  padding: 0 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .97);
}

.wordmark {
  justify-self: start;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .16em;
  text-decoration: none;
}

.wordmark i {
  margin-left: .25em;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .04em;
}

.journey ol {
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: color .2s ease;
}

.journey li span {
  font-size: 9px;
  letter-spacing: .04em;
}

.journey li[data-state="active"],
.journey li[data-state="complete"] {
  color: var(--ink);
}

.journey li[data-state="complete"] span::after {
  content: " /";
}

.studio-label {
  justify-self: end;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

main {
  width: 100%;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, .6fr);
  gap: 60px;
  align-items: end;
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 72px 40px 54px;
}

.hero h1 {
  max-width: 920px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(58px, 6.3vw, 96px);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .92;
}

.hero p {
  max-width: 350px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, .83fr) minmax(0, 1.17fr);
  gap: clamp(44px, 5.5vw, 88px);
  align-items: start;
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 0 40px 112px;
}

.preview-panel {
  position: sticky;
  top: 98px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  min-height: 44px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}

.section-heading > div {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.step-index {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
}

.step-state {
  color: var(--muted);
  font-size: 11px;
}

.step-state.complete {
  color: var(--success);
}

.photo-drop {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: min(50vh, 420px);
  height: clamp(280px, calc(100svh - 370px), 500px);
  overflow: hidden;
  border: 1px solid transparent;
  background: var(--soft);
  cursor: pointer;
}

.photo-drop:hover {
  border-color: var(--ink);
}

.photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 260px;
  padding: 32px;
  text-align: center;
}

.photo-empty strong {
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
}

.photo-empty > span:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.upload-mark {
  position: relative;
  width: 42px;
  height: 42px;
  margin-bottom: 24px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.upload-mark::before,
.upload-mark::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 1px;
  background: var(--ink);
  content: "";
  transform: translate(-50%, -50%);
}

.upload-mark::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.photo-drop > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.photo-drop.has-photo {
  --photo-inset: 18px;
}

.photo-drop.has-photo > img {
  position: absolute;
  inset: var(--photo-inset);
  width: calc(100% - (var(--photo-inset) * 2));
  height: calc(100% - (var(--photo-inset) * 2));
  object-fit: contain;
}

.change-photo {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 10px 14px;
  background: var(--paper);
  box-shadow: 0 2px 18px rgba(0, 0, 0, .08);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.privacy-note {
  margin: 12px 0 0;
  color: var(--quiet);
  font-size: 11px;
  line-height: 1.5;
}

.stylist-panel {
  min-width: 0;
}

.category-tabs {
  position: relative;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  margin: 0 0 26px;
  padding: 0 0 1px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  position: relative;
  flex: 0 0 auto;
  padding: 0 0 13px;
  border: 0;
  background: transparent;
  color: var(--quiet);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
}

.category-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

.category-tab[aria-selected="true"] {
  color: var(--ink);
}

.category-tab[aria-selected="true"]::after {
  background: var(--ink);
}

.catalog-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.catalog-meta h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
}

.catalog-meta span {
  color: var(--muted);
  font-size: 11px;
}

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

.product-card {
  position: relative;
  min-width: 0;
}

.product-select {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.product-media {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px solid transparent;
  background: var(--soft);
  transition: border-color .18s ease, transform .18s ease;
}

.product-select:hover .product-media {
  border-color: #a9a9a2;
}

.product-select:active .product-media {
  transform: scale(.985);
}

.product-select[aria-pressed="true"] .product-media {
  border-color: var(--ink);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.selection-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  opacity: 0;
  transform: scale(.75);
  transition: opacity .18s ease, transform .18s ease;
}

.product-select[aria-pressed="true"] .selection-mark {
  opacity: 1;
  transform: scale(1);
}

.product-copy {
  display: block;
  padding-top: 10px;
}

.product-name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.delete-product {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--danger);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.manage-mode .delete-product {
  display: grid;
  place-items: center;
}

.load-more {
  width: 100%;
  margin-top: 28px;
  padding: 14px;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.catalog-empty {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 40px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.look-summary {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--ink);
}

.summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.summary-heading h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 400;
}

.text-button {
  padding: 5px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.chosen-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-height: 74px;
  margin-top: 18px;
}

.empty-look {
  grid-column: 1 / -1;
  align-self: center;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.chosen-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 32px;
  align-items: center;
  min-width: 0;
  min-height: 66px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.chosen-item img {
  width: 54px;
  height: 64px;
  background: var(--soft);
  object-fit: contain;
  mix-blend-mode: multiply;
}

.chosen-copy {
  min-width: 0;
  padding: 8px 10px;
}

.chosen-copy span,
.chosen-copy strong {
  display: block;
}

.chosen-copy span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chosen-copy strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-chosen {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.automatic-fitting-note {
  margin: 18px 0 0;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.action-step {
  margin-top: 46px;
}

.action-heading {
  border-color: var(--line);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 24px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .07em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background .18s ease, color .18s ease;
}

.primary-action {
  width: 100%;
}

.primary-action:hover:not(:disabled),
.secondary-action.dark:hover {
  background: #2a2a2a;
}

.primary-action:disabled {
  border-color: #cfcfca;
  background: #cfcfca;
  color: #777771;
  cursor: not-allowed;
}

.status {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.status.err {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}

.result-section {
  grid-template-columns: minmax(280px, .55fr) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: center;
  width: min(100% - 80px, 1360px);
  margin: 0 auto 112px;
  padding: 64px;
  background: var(--soft);
}

.result-section:not([hidden]) {
  display: grid;
}

.result-section h2 {
  margin: 12px 0 14px;
  font-family: var(--display);
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: .98;
}

.result-section p {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
}

.result-section img {
  width: 100%;
  max-height: 760px;
  object-fit: contain;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-action {
  width: auto;
  min-height: 48px;
  background: transparent;
  color: var(--ink);
}

.secondary-action:hover {
  background: var(--ink);
  color: var(--paper);
}

.secondary-action.dark {
  background: var(--ink);
  color: var(--paper);
}

.catalog-tools {
  width: min(100% - 80px, 1360px);
  margin: 0 auto 96px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.catalog-tools > summary {
  padding: 22px 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  list-style: none;
  text-transform: uppercase;
}

.catalog-tools > summary::after {
  float: right;
  content: "+";
  font-size: 20px;
  font-weight: 300;
}

.catalog-tools[open] > summary::after {
  content: "−";
}

.catalog-tools > summary::-webkit-details-marker {
  display: none;
}

.tools-panel {
  padding: 18px 0 32px;
}

.tools-copy {
  display: grid;
  grid-template-columns: .5fr 1fr;
  gap: 40px;
  margin-bottom: 28px;
}

.tools-copy h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 400;
}

.tools-copy p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.add-form {
  display: grid;
  grid-template-columns:
    minmax(130px, .8fr)
    minmax(180px, 1fr)
    minmax(260px, 1.5fr)
    auto;
  gap: 12px;
  align-items: end;
}

.add-form label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.add-form input,
.add-form select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  font-size: 12px;
  text-transform: none;
}

.add-form input[type="file"] {
  padding: 11px 8px;
  font-size: 10px;
}

.add-form .secondary-action {
  justify-self: start;
  min-height: 46px;
  white-space: nowrap;
}

.form-help {
  margin: 12px 0 0;
  color: var(--quiet);
  font-size: 10px;
  line-height: 1.5;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.floating-action {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 70;
  width: min(680px, calc(100% - 40px));
  transform: translateX(-50%);
  animation: floating-action-in .24s ease-out both;
}

.floating-action .primary-action {
  min-height: 72px;
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .26);
  font-size: 14px;
  letter-spacing: .09em;
}

body.floating-ready main {
  padding-bottom: 108px;
}

@keyframes floating-action-in {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(10, 10, 10, .82);
}

.modal.open {
  display: grid;
}

.modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(920px, 94vw);
  height: min(760px, 90vh);
  background: var(--paper);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
}

.modal-header {
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 400;
}

.modal-close {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.modal-image {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  padding: 16px;
  background: var(--soft);
}

.modal-image::before {
  position: absolute;
  color: var(--muted);
  content: "Caricamento del look…";
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.modal-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .2s ease;
}

.modal-image.ready::before {
  display: none;
}

.modal-image.ready img {
  opacity: 1;
}

.modal-footer {
  border-top: 1px solid var(--line);
}

.modal-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.link-action {
  width: auto;
  min-height: 46px;
}

@media (max-width: 1100px) {
  .studio-label {
    display: none;
  }

  .site-header {
    grid-template-columns: 1fr auto;
  }

  .journey {
    justify-self: end;
  }

  .workspace {
    grid-template-columns: minmax(300px, .75fr) minmax(0, 1.25fr);
    gap: 40px;
  }

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

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

  .add-form .secondary-action {
    grid-column: auto;
    justify-self: stretch;
  }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero p {
    max-width: 500px;
  }

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

  .preview-panel {
    position: static;
  }

  .photo-drop {
    max-height: 680px;
  }
}

@media (max-width: 720px) {
  .site-header {
    min-height: 58px;
    padding: 0 20px;
  }

  .journey {
    display: none;
  }

  .hero {
    gap: 18px;
    padding: 40px 20px 38px;
  }

  .hero h1 {
    max-width: 350px;
    font-size: clamp(46px, 14vw, 62px);
    line-height: .94;
  }

  .hero p {
    max-width: 330px;
    font-size: 14px;
  }

  .workspace {
    gap: 52px;
    padding: 0 20px 138px;
  }

  .section-heading {
    margin-bottom: 14px;
  }

  .photo-drop {
    height: min(42vh, 360px);
    height: clamp(180px, calc(100svh - 390px), 360px);
  }

  .photo-drop.has-photo {
    --photo-inset: 12px;
  }

  .category-tabs {
    position: sticky;
    top: 58px;
    z-index: 20;
    gap: 22px;
    margin-right: -20px;
    margin-left: -20px;
    padding: 13px 20px 0;
    background: var(--paper);
  }

  .catalog-meta h3 {
    font-size: 25px;
  }

  .product-grid {
    gap: 22px 10px;
  }

  .product-name {
    font-size: 11px;
  }

  .look-summary {
    margin-top: 52px;
  }

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

  .action-step {
    display: none;
  }

  .result-section {
    grid-template-columns: 1fr;
    width: calc(100% - 40px);
    margin-bottom: 72px;
    padding: 28px 20px;
  }

  .result-section > div {
    order: 2;
  }

  .catalog-tools {
    width: calc(100% - 40px);
    margin-bottom: 72px;
  }

  .tools-copy {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .add-form {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
    padding: 28px 20px;
  }

  .floating-action {
    bottom: max(14px, env(safe-area-inset-bottom));
    width: calc(100% - 28px);
  }

  .floating-action .primary-action {
    min-height: 66px;
    padding: 0 20px;
    font-size: 12px;
  }

  .modal {
    padding: 0;
    background: var(--paper);
  }

  .modal-card {
    width: 100vw;
    height: 100dvh;
  }

  .modal-header,
  .modal-footer {
    padding: 14px 18px;
  }

  .modal-footer p {
    display: none;
  }

  .modal-footer .primary-action {
    width: 100%;
  }
}

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

  .floating-action {
    animation: none;
  }
}
