/* Outfit Maker — one stylesheet, no framework, no external fonts. */

:root {
  --ink: #101318;
  --ink-2: #353c47;
  --muted: #646c7a;
  --line: #e3e6ec;
  --line-2: #eef0f4;
  --paper: #ffffff;
  --paper-2: #f7f8fa;
  --brand: #1b1f27;
  --accent: #c2603c;
  --accent-ink: #8f3f21;
  --ok: #1f7a53;
  --err: #b3261e;
  --err-bg: #fdf2f1;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 19, 24, .05), 0 8px 28px -18px rgba(16, 19, 24, .28);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --fs-body: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }

a { color: inherit; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 760px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 99;
}
.skip:focus { left: 0; }

/* ---------- top bar ---------- */
.topbar {
  border-bottom: 1px solid var(--line-2);
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(8px);
}
.topbar-in { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 650; letter-spacing: -.02em; text-decoration: none; font-size: 15px;
  color: var(--ink);
}
.brand svg { color: var(--accent); flex: none; }
.topnav { margin-left: auto; display: flex; gap: 22px; font-size: 14px; }
.topnav a { color: var(--muted); text-decoration: none; transition: color .16s var(--ease); }
.topnav a:hover, .topnav a:focus-visible { color: var(--ink); }

/* ---------- hero + board ---------- */
.hero { padding: 40px 0 8px; }
.hero-head { max-width: 720px; margin-bottom: 16px; }
h1 {
  font-size: clamp(25px, 2.9vw, 34px);
  font-weight: 660;
  letter-spacing: -.035em;
  margin-bottom: 6px;
}
.sub { margin: 0; color: var(--muted); font-size: 15px; max-width: 62ch; line-height: 1.5; }

.board {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, .86fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}

.pane {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.pane-head {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 14px; min-height: 26px;
}
.pane-head h2 { font-size: 15px; font-weight: 620; letter-spacing: -.01em; }
.stepn {
  display: inline-grid; place-items: center;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 11.5px; font-weight: 640; letter-spacing: 0;
  flex: none;
}
.pane-stat {
  margin-left: auto; font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px;
  white-space: nowrap;
}
.self-row { display: grid; gap: 8px; margin-bottom: 10px; }
.self-row .hint { margin: 0; }
.self-row .drop { margin: 0; }
.own-head { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.opt { font-weight: 400; font-size: 12px; color: var(--muted); letter-spacing: 0; }

/* drop zone */
.drop {
  position: relative;
  border: 1.5px dashed #cfd5df;
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .12s var(--ease);
  outline: none;
}
.drop:hover { border-color: #aab2c0; background: #f2f4f7; }
.drop:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(194, 96, 60, .18); }
.drop.over { border-color: var(--accent); background: #fdf6f2; transform: scale(.995); }
.drop.slim { padding: 15px; }
.drop-ico { width: 26px; height: 26px; color: #97a0af; margin-bottom: 6px; }
.drop-main { margin: 0 0 3px; font-weight: 570; font-size: 14.5px; }
.drop-sub { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pill-btn {
  display: inline-block; padding: 7px 15px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 560;
  transition: background .16s var(--ease);
}
.drop:hover .pill-btn { background: #000; }
.drop.slim .drop-main { margin: 0; font-size: 13.5px; color: var(--ink-2); font-weight: 520; }
.self-thumb { width: 100%; max-height: 118px; object-fit: cover; border-radius: 7px; display: block; }

.row-between {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  margin: 10px 2px 2px;
}
.hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.link-btn {
  background: none; border: 0; padding: 2px 0; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--accent-ink);
  border-bottom: 1px solid rgba(194, 96, 60, .35);
  white-space: nowrap;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.link-btn:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* closet grid */
.closet {
  list-style: none; margin: 12px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 9px;
}
.item {
  position: relative; margin: 0;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--paper);
  animation: pop .26s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
.item img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #f2f3f5; }
.item-meta {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 6px 6px; font-size: 10.5px; line-height: 1.25;
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }
.item-cat {
  appearance: none; -webkit-appearance: none;
  border: 0; background: transparent; padding: 0; margin: 0;
  font: inherit; font-size: 10.5px; color: var(--ink-2); font-weight: 540;
  cursor: pointer; max-width: 100%; text-overflow: ellipsis;
}
.item-cat:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
.item-del {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: rgba(16, 19, 24, .62); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .16s var(--ease);
}
.item:hover .item-del, .item:focus-within .item-del { opacity: 1; }
.item-del:focus-visible { opacity: 1; outline: 2px solid #fff; outline-offset: -2px; }
.empty-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.primary { margin-top: 14px; }
.empty-note[hidden] { display: none; }
.check-note {
  margin: 10px 0 0; padding: 8px 10px; border-radius: 8px;
  background: #fdf6f1; border: 1px solid #f0dccf;
  font-size: 11.5px; line-height: 1.45; color: #7a4a33;
}
.check-note[hidden] { display: none; }
.item.needs-check { outline: 1px solid #e8c4ab; outline-offset: -1px; }
.item.needs-check .item-cat { color: #a4562e; font-weight: 640; }

/* controls */
.controls { display: flex; flex-direction: column; }
.field { border: 0; margin: 0 0 15px; padding: 0; min-width: 0; }
.field legend, .lbl {
  display: block; padding: 0; margin-bottom: 7px;
  font-size: 11.5px; font-weight: 620; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip span {
  display: inline-block; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper);
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease), transform .1s var(--ease);
  user-select: none;
}
.chip:hover span { border-color: #c3c9d4; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip:active span { transform: scale(.97); }
.chips.small span { font-size: 12px; padding: 5px 9px; }

select {
  width: 100%; appearance: none;
  padding: 9px 32px 9px 11px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%236b7484' stroke-width='1.4' stroke-linecap='round'/></svg>") no-repeat right 11px center;
  font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer;
}
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.primary {
  margin-top: auto;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 13px 18px;
  border: 0; border-radius: 10px;
  background: var(--brand); color: #fff;
  font: inherit; font-size: 15px; font-weight: 580; letter-spacing: -.01em;
  cursor: pointer;
  transition: background .16s var(--ease), transform .1s var(--ease), box-shadow .16s var(--ease);
}
.primary:hover:not(:disabled) { background: #000; box-shadow: 0 6px 20px -10px rgba(16,19,24,.7); }
.primary:active:not(:disabled) { transform: translateY(1px) scale(.995); }
/* A disabled button should still read as a button, just not an active one. */
.primary:disabled { background: #eceff3; color: #a7aeba; cursor: not-allowed; box-shadow: inset 0 0 0 1px #dfe3e9; }
.primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary .spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  display: none; animation: spin .7s linear infinite;
}
.primary.busy .spin { display: block; }
.primary.busy .btn-label { opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }

.err {
  margin: 9px 0 0; padding: 9px 11px;
  background: var(--err-bg); border: 1px solid #f3c9c4; border-radius: 8px;
  color: var(--err); font-size: 12.5px; line-height: 1.45;
}
.err[hidden] { display: none; }

/* result */
.result { min-height: 340px; }
.result-tools { margin-left: auto; display: flex; gap: 6px; }
.result-tools[hidden] { display: none; }
.ghost-btn {
  border: 1px solid var(--line); background: var(--paper);
  border-radius: 7px; padding: 4px 10px;
  font: inherit; font-size: 12px; font-weight: 540; color: var(--ink-2);
  cursor: pointer; transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}
.ghost-btn:hover { background: var(--paper-2); border-color: #c8ceda; }
.ghost-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ghost-btn.done { color: var(--ok); border-color: #bfe0cf; background: #f2faf5; }

.placeholder { padding: 46px 10px; text-align: center; color: var(--muted); }
.placeholder[hidden] { display: none; }
.placeholder p { margin: 14px 0 0; font-size: 13.5px; }
.placeholder strong { color: var(--ink-2); font-weight: 600; }
.ph-stack { display: flex; justify-content: center; }
.ph-stack i {
  display: block; width: 54px; height: 66px;
  border: 1px dashed #d5dae2; border-radius: 8px;
  margin: 0 -9px; background: var(--paper-2);
  transform: rotate(-6deg);
}
.ph-stack i:nth-child(2) { transform: rotate(0) translateY(-6px); z-index: 2; background: #fff; }
.ph-stack i:nth-child(3) { transform: rotate(6deg); }

.result-body[hidden] { display: none; }
.look-grid {
  /* Two columns, always. An outfit is three to five pieces, and a fixed pair
     of columns keeps a four-piece look as a 2x2 block instead of stranding
     the last card on a line of its own. */
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.look-card { margin: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fafbfc; animation: pop .3s var(--ease) both; }
.look-card img { display: block; width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.look-card figcaption { padding: 6px 7px 7px; font-size: 10.5px; color: var(--ink-2); line-height: 1.3; }
.look-card figcaption b { display: block; font-weight: 600; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

.why { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }

.pieces { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line-2); }
.pieces li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; line-height: 1.45; animation: pop .3s var(--ease) both; }
.pieces .pc-n { color: var(--muted); font-size: 11px; width: 16px; flex: none; padding-top: 2px; }
.pieces .pc-t { color: var(--ink); font-weight: 560; }
.pieces .pc-r { color: var(--ink-2); }

.tryon { margin-top: 16px; }
.tryon[hidden] { display: none; }
.tryon h3 { font-size: 11.5px; font-weight: 620; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.tryon-stage { border-radius: 10px; overflow: hidden; background: linear-gradient(180deg,#fafbfc,#f2f4f7); border: 1px solid var(--line); display: grid; place-items: center; padding: 10px; }
#tryonCanvas { width: 100%; max-width: 300px; height: auto; display: block; border-radius: 6px; }
.tryon-note { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.4; }
.tiny { margin: 12px 0 0; font-size: 11px; color: var(--muted); line-height: 1.4; }

/* body copy */
.copy { padding: 56px 0; border-top: 1px solid var(--line-2); }
.copy.alt { background: var(--paper-2); }
.copy h2 { font-size: 21px; font-weight: 640; margin-bottom: 16px; }
.copy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.copy p { color: var(--ink-2); max-width: 68ch; }

.spec-list { margin: 0; }
.spec-list > div { padding: 11px 0; border-bottom: 1px solid var(--line); }
.spec-list > div:first-child { padding-top: 0; }
.spec-list dt { font-size: 13px; font-weight: 620; margin-bottom: 3px; }
.spec-list dd { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }

.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 10px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.steps strong { color: var(--ink); font-weight: 620; }
.aside { margin-top: 14px; font-size: 13px; color: var(--muted); border-left: 2px solid var(--accent); padding-left: 12px; }

.qa details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.qa details:first-of-type { border-top: 1px solid var(--line); }
.qa summary { cursor: pointer; font-size: 14px; font-weight: 570; list-style: none; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--muted); font-size: 16px; line-height: 1; flex: none; }
.qa details[open] summary::after { content: "–"; }
.qa summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.qa p { margin: 8px 0 2px; font-size: 13.5px; }

.foot { padding: 22px 0 34px; border-top: 1px solid var(--line-2); }
.foot-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.foot a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--line); }
.foot a:hover { border-bottom-color: var(--ink-2); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .board { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .pane.result { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .copy-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero { padding-top: 26px; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .board { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .topbar-in { height: 54px; }
  h1 { font-size: 25px; }
  .sub { font-size: 14.5px; }
  .pane { padding: 15px; }
  .drop { padding: 22px 14px; }
  .primary { margin-top: 4px; }
  .copy { padding: 40px 0; }
  .closet { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .look-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .look-card figcaption { font-size: 11.5px; }
  .look-card figcaption b { font-size: 11px; }
  #tryonCanvas { max-width: 260px; }
}

/* Touch targets. On a phone the controls are operated with a thumb, so the
   small ones (a 13px category dropdown, a 20px delete button, 31px chips) are
   grown to a comfortable size. Only the hit area grows — the type stays the
   same size so the layout does not shift. */
@media (max-width: 720px), (pointer: coarse) {
  .item-cat { padding: 9px 0; }
  .item-del { width: 30px; height: 30px; font-size: 17px; top: 2px; right: 2px; opacity: 1; }
  .chip span { padding: 11px 14px; }
  .chips.small span { padding: 10px 12px; }
  select { padding: 12px 32px 12px 12px; font-size: 14px; }
  .item-meta { padding: 6px 8px 8px; }
  .ghost-btn { padding: 10px 14px; }
  .link-btn { padding: 10px 0; }
}

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