:root {
  --bg: #fbfaf7;
  --paper: #f7efe0;
  --paper-strong: #efe2cc;
  --ink: #11100d;
  --muted: #686157;
  --line: #ded3c2;
  --gold: #b98a34;
  --gold-strong: #94661d;
  --sage: #657063;
  --danger: #2c2925;
  --white: #ffffff;
  --shadow: 0 26px 70px rgba(18, 16, 12, 0.16);
  --soft-shadow: 0 18px 48px rgba(18, 16, 12, 0.11);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(101, 112, 99, 0.08), transparent 25%, transparent 75%, rgba(185, 138, 52, 0.08)),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

a {
  color: inherit;
}

.app-shell {
  width: min(100%, 1120px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.topbar,
.swipe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  position: relative;
  z-index: 5;
}

.brand {
  --brand-tracking: 0.34em;

  display: inline-flex;
  align-items: baseline;
  gap: 0;
  color: var(--ink);
  font-family: "Poppins", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: var(--brand-tracking);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.brand strong {
  font-size: 1em;
  font-weight: 800;
}

.brand span:last-child {
  border-bottom: 0;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(17, 16, 13, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 12px 28px rgba(17, 16, 13, 0.07);
  cursor: pointer;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    border-color 160ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(17, 16, 13, 0.3);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.34;
  transform: none;
}

.icon-button svg,
.decision-button svg,
.success-mark svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.screens {
  display: grid;
  min-height: calc(100svh - 82px);
  place-items: center;
}

.screen {
  display: none;
  width: 100%;
}

.screen.is-active {
  display: grid;
}

.screen-onboarding {
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  align-content: center;
  justify-items: center;
  padding: 48px 0 18px;
  text-align: center;
}

.intro-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 680px);
}

.primary-action--start {
  margin-top: 28px;
  min-height: 60px;
  padding: 0 36px;
  font-size: 0.95rem;
}

.intro-copy .intro-subtitle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(185, 138, 52, 0.25);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(185, 138, 52, 0.12));
  backdrop-filter: blur(8px);
  color: #94661d;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(185, 138, 52, 0.08);
  max-width: 90%;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3rem;
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: 0;
}

.screen-swipe h1 {
  font-size: 1.25rem;
}

.intro-copy p,
.summary-copy p,
.screen-success p {
  max-width: 620px;
  margin: 18px auto 0;
  color: #312d26;
  font-size: 1rem;
  line-height: 1.6;
}

.intro-preview {
  display: grid;
  width: min(84vw, 420px);
  gap: 14px;
  justify-items: center;
  padding: 16px 14px 18px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.96), rgba(247, 239, 224, 0.56) 74%),
    var(--paper);
  box-shadow: 0 24px 70px rgba(18, 16, 12, 0.12);
}

.preview-swipe-head {
  display: grid;
  width: min(100%, 290px);
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.preview-swipe-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  font-weight: 500;
  line-height: 1;
}

.preview-swipe-head strong {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.preview-swipe-head span {
  width: 100%;
  height: 7px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold) 0 14%, rgba(17, 16, 13, 0.13) 14% 100%);
}

.preview-shirt-card {
  display: grid;
  width: min(100%, 330px);
  overflow: hidden;
  border: 1px solid rgba(17, 16, 13, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--soft-shadow);
}

.preview-shirt-image {
  display: grid;
  min-height: 0;
  place-items: center;
  padding: 14px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.96), rgba(247, 239, 224, 0.5) 72%),
    var(--paper);
}

.preview-shirt-image img {
  width: 100%;
  max-height: 310px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 14px 18px rgba(20, 18, 15, 0.12));
}

.preview-shirt-meta {
  display: grid;
  gap: 4px;
  padding: 13px 16px 15px;
  border-top: 1px solid rgba(17, 16, 13, 0.1);
  background: rgba(255, 255, 255, 0.9);
}

.preview-shirt-meta strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-weight: 500;
}

.preview-shirt-meta span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.32;
}

.preview-decision-row {
  display: grid;
  width: min(100%, 330px);
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.preview-decision-row span {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 16, 13, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 26px rgba(17, 16, 13, 0.08);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-decision-row span:first-child {
  color: var(--danger);
}

.preview-decision-row span:last-child {
  color: var(--gold-strong);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border: 1px solid #25221d;
  border-radius: var(--radius);
  background: #11100d;
  color: #f4d48b;
  box-shadow: inset 0 -10px 18px rgba(185, 138, 52, 0.14);
  font-size: 0.88rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 -10px 18px rgba(185, 138, 52, 0.18),
    0 14px 30px rgba(17, 16, 13, 0.12);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.64;
  transform: none;
}

.screen-swipe {
  max-width: 780px;
  gap: 14px;
  align-content: center;
  justify-self: center;
  padding: 16px 0 8px;
}

.swipe-head {
  width: 100%;
}

.swipe-head > div {
  min-width: 0;
  text-align: center;
}

.swipe-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 750;
}

.progress-track {
  width: min(280px, 62vw);
  height: 7px;
  justify-self: center;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 16, 13, 0.12);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), #d8bd82);
  transition: width 240ms ease;
}

.deck-area {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 520px;
  touch-action: pan-y;
}

.card-stack {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 520px;
  place-items: center;
}

.shirt-card {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(100%, 460px);
  min-height: 500px;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(17, 16, 13, 0.13);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  cursor: grab;
  transform: translate3d(0, 0, 0) rotate(0deg);
  transition:
    box-shadow 160ms ease,
    border-color 160ms ease,
    transform 180ms ease;
  user-select: none;
  will-change: transform;
}

.shirt-card:focus-visible {
  outline: 3px solid rgba(185, 138, 52, 0.45);
  outline-offset: 4px;
}

.shirt-card.is-dragging {
  cursor: grabbing;
  transition: none;
}

.shirt-card.exit-left {
  transform: translate3d(-140%, 14px, 0) rotate(-12deg);
  opacity: 0;
}

.shirt-card.exit-right {
  transform: translate3d(140%, 14px, 0) rotate(12deg);
  opacity: 0;
}

.app-shell.intent-like .shirt-card {
  border-color: rgba(185, 138, 52, 0.55);
  box-shadow:
    var(--shadow),
    0 0 0 5px rgba(185, 138, 52, 0.14);
}

.app-shell.intent-dislike .shirt-card {
  border-color: rgba(44, 41, 37, 0.34);
  box-shadow:
    var(--shadow),
    0 0 0 5px rgba(44, 41, 37, 0.1);
}

.next-card {
  position: absolute;
  z-index: 1;
  min-height: 478px;
  pointer-events: none;
  transform: translateY(18px) scale(0.94);
  opacity: 0.42;
  filter: saturate(0.85);
}

.shirt-image-frame {
  display: grid;
  min-height: 0;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.96), rgba(247, 239, 224, 0.52) 72%),
    var(--paper);
}

.shirt-image-frame img {
  width: 100%;
  max-height: 398px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 18px 24px rgba(20, 18, 15, 0.13));
  pointer-events: none;
}

.shirt-meta {
  display: grid;
  gap: 4px;
  padding: 15px 18px 17px;
  border-top: 1px solid rgba(17, 16, 13, 0.1);
  background: rgba(255, 255, 255, 0.88);
}

.shirt-meta strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 500;
}

.shirt-meta span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.swipe-rail {
  display: grid;
  min-height: 398px;
  align-items: center;
  justify-items: center;
  opacity: 0.34;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.swipe-rail span {
  writing-mode: vertical-rl;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 14px 8px;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.swipe-rail-no {
  color: var(--danger);
}

.swipe-rail-yes {
  color: var(--gold-strong);
}

.app-shell.intent-dislike .swipe-rail-no,
.app-shell.intent-like .swipe-rail-yes {
  opacity: 1;
  transform: scale(1.04);
}

.gesture-hint {
  justify-self: center;
  max-width: 420px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.decision-controls {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.decision-button {
  display: inline-flex;
  min-width: 116px;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 1px solid rgba(17, 16, 13, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 32px rgba(17, 16, 13, 0.09);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 850;
  text-transform: uppercase;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.decision-button:hover {
  transform: translateY(-2px);
}

.decision-no {
  color: var(--danger);
}

.decision-yes {
  color: var(--gold-strong);
}

.app-shell.intent-dislike .decision-no,
.decision-no:active {
  background: #2c2925;
  color: #fff8ea;
}

.app-shell.intent-like .decision-yes,
.decision-yes:active {
  border-color: var(--gold);
  background: #c89b45;
  color: #17130d;
}

.choice-toast,
.form-status {
  display: block;
  min-height: 22px;
  color: var(--sage);
  font-size: 0.92rem;
  font-weight: 720;
  text-align: center;
}

.screen-summary {
  max-width: 880px;
  gap: 22px;
  align-content: center;
  padding: 24px 0;
}

.summary-copy {
  text-align: center;
}

.summary-copy h1,
.screen-success h1 {
  font-size: 2.7rem;
}

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

.summary-column {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.summary-column h2 {
  margin-bottom: 10px;
  color: #26221c;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thumb-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-height: 86px;
}

.thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid rgba(17, 16, 13, 0.11);
  border-radius: var(--radius);
  background: var(--paper);
}

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

.empty {
  display: grid;
  min-height: 86px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9rem;
}

.tryon-teaser {
  display: grid;
  width: min(100%, 680px);
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  justify-self: center;
  padding: 15px;
  border: 1px solid rgba(185, 138, 52, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(185, 138, 52, 0.13), rgba(255, 255, 255, 0.7)),
    rgba(255, 255, 255, 0.66);
  box-shadow: 0 12px 32px rgba(17, 16, 13, 0.06);
}

.tryon-teaser-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: #11100d;
  color: #f4d48b;
}

.tryon-teaser-mark svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tryon-teaser h2 {
  color: #26221c;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
}

.tryon-teaser p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.48;
}

.signup-form {
  display: grid;
  gap: 10px;
  width: min(100%, 680px);
  justify-self: center;
}

.signup-form label {
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signup-form .consent-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 520;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
}

.consent-check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--gold);
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.form-row input {
  min-width: 0;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(17, 16, 13, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 28px rgba(17, 16, 13, 0.06);
  color: var(--ink);
  font-size: 1rem;
}

.form-row input:focus {
  border-color: var(--gold);
  outline: 3px solid rgba(185, 138, 52, 0.2);
}

.form-note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.screen-success {
  max-width: 640px;
  gap: 18px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.success-mark {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 50%;
  background: #11100d;
  color: #f4d48b;
  box-shadow: var(--soft-shadow);
}

.success-mark svg {
  width: 34px;
  height: 34px;
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.secondary-action {
  min-height: 48px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  box-shadow: none;
}

@media (min-width: 760px) {
  .app-shell {
    padding: 28px 34px;
  }

  .screen-onboarding {
    grid-template-columns: minmax(0, 0.92fr) minmax(280px, 0.58fr);
    justify-items: start;
    text-align: left;
    padding-top: 64px;
  }

  .intro-copy {
    align-items: flex-start;
  }

  .intro-copy p {
    margin-left: 0;
  }

  .intro-preview {
    justify-self: end;
  }

  h1 {
    font-size: 4.1rem;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  h1 {
    font-size: 2.55rem;
  }

  .summary-copy h1,
  .screen-success h1 {
    font-size: 2.25rem;
  }

  .deck-area {
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    gap: 6px;
    min-height: 470px;
  }

  .card-stack {
    min-height: 470px;
  }

  .shirt-card {
    min-height: 450px;
  }

  .shirt-image-frame {
    padding: 10px;
  }

  .shirt-image-frame img {
    max-height: 350px;
  }

  .swipe-rail {
    min-height: 320px;
  }

  .swipe-rail span {
    padding: 10px 6px;
    font-size: 0.68rem;
  }

  .decision-controls {
    gap: 10px;
  }

  .decision-button {
    min-width: 0;
    flex: 1 1 0;
  }

  .summary-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .tryon-teaser {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 380px) {
  .deck-area {
    grid-template-columns: 22px minmax(0, 1fr) 22px;
  }

  .brand {
    --brand-tracking: 0.24em;

    font-size: 1.15rem;
  }

  .topbar .icon-button {
    width: 40px;
    height: 40px;
  }
}

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