/* ============================================================================
   Artwork Studio
   Threads Embroidery & Print Ltd

   Sits on top of the site stylesheet. Everything here is namespaced .aw- and
   pulls its colours from the tokens already declared in public/css/styles.css
   so the page looks like the rest of the site rather than a bolted on tool.
   ========================================================================= */

.aw-wrap {
  --aw-gap: 1.25rem;
}

/* The page hides and shows panels with the hidden attribute. Several of the
   blocks below set their own display, which would beat the browser default
   for [hidden], so this has to win outright. */
.aw-wrap [hidden],
[id^="aw"][hidden] {
  display: none !important;
}

.aw-lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
  margin: 0 0 1.5rem;
}

.aw-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.aw-panel + .aw-panel {
  margin-top: var(--aw-gap);
}

.aw-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.aw-panel-title {
  font-family: var(--font-display), sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -.01em;
}

.aw-panel-note {
  margin: 0;
  font-size: .85rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------- upload */

.aw-drop {
  border: 2px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 2.75rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.aw-drop:hover,
.aw-drop:focus-visible,
.aw-drop.is-over {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: none;
}

.aw-drop-icon {
  font-size: 2.1rem;
  color: var(--brand);
  line-height: 1;
}

.aw-drop-title {
  font-family: var(--font-display), sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: .65rem 0 .3rem;
}

.aw-drop-sub {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .88rem;
}

.aw-drop-btn {
  display: inline-block;
  cursor: pointer;
}

.aw-drop-legal {
  margin: 1rem 0 0;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.5;
}

.aw-file-meta {
  margin: 1rem 0 0;
  font-size: .85rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* -------------------------------------------------------------- progress */

.aw-progress {
  margin-top: 1.25rem;
}

.aw-progress-label {
  margin: 0 0 .5rem;
  font-size: .9rem;
  font-weight: 600;
}

.aw-progress-track {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.aw-progress-bar {
  height: 100%;
  width: 6%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand-hi));
  transition: width .35s ease;
}

/* ----------------------------------------------------------------- error */

.aw-alert {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-top: 1.25rem;
  background: rgba(239, 83, 80, .12);
  border: 1px solid rgba(239, 83, 80, .38);
}

.aw-alert i { color: var(--danger); font-size: 1.1rem; line-height: 1.4; }
.aw-alert p { margin: 0; font-size: .92rem; line-height: 1.6; }

.aw-alert-close {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 .2rem;
}

/* --------------------------------------------------------------- verdict */

.aw-verdict-head {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
  margin-bottom: .6rem;
}

.aw-verdict-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  padding: .35rem .85rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.aw-verdict-badge.is-ready { background: rgba(56, 201, 138, .16); color: var(--ok); border: 1px solid rgba(56, 201, 138, .4); }
.aw-verdict-badge.is-clean { background: rgba(240, 180, 41, .14); color: var(--warn); border: 1px solid rgba(240, 180, 41, .4); }
.aw-verdict-badge.is-redraw { background: rgba(239, 83, 80, .14); color: var(--danger); border: 1px solid rgba(239, 83, 80, .4); }

.aw-verdict-title {
  font-family: var(--font-display), sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -.02em;
}

.aw-verdict-summary {
  margin: 0 0 1.25rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 60ch;
}

.aw-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .6rem;
}

.aw-check {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: 12px;
  padding: .85rem 1rem;
}

.aw-check.is-pass { border-left-color: var(--ok); }
.aw-check.is-warn { border-left-color: var(--warn); }
.aw-check.is-fail { border-left-color: var(--danger); }

.aw-check-icon { font-size: 1rem; line-height: 1.45; }
.aw-check.is-pass .aw-check-icon { color: var(--ok); }
.aw-check.is-warn .aw-check-icon { color: var(--warn); }
.aw-check.is-fail .aw-check-icon { color: var(--danger); }

.aw-check-body { min-width: 0; flex: 1; }

.aw-check-head {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  justify-content: space-between;
  margin: 0 0 .15rem;
}

.aw-check-label { font-weight: 700; font-size: .95rem; }

.aw-check-state {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  flex: 0 0 auto;
}

.aw-check-value {
  margin: 0 0 .25rem;
  font-size: .86rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.aw-check-note {
  margin: 0;
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.55;
}

/* --------------------------------------------------------------- compare */

.aw-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--aw-gap);
}

.aw-compare-cell {
  min-width: 0;
}

.aw-compare-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin: 0 0 .5rem;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.aw-art-frame {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, #ececec 25%, transparent 25%),
    linear-gradient(-45deg, #ececec 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ececec 75%),
    linear-gradient(-45deg, transparent 75%, #ececec 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.aw-art-frame img,
.aw-art-frame svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.aw-art-meta {
  margin: .5rem 0 0;
  font-size: .8rem;
  color: var(--muted);
}

/* --------------------------------------------------------------- threads */

.aw-threads {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .6rem;
}

.aw-thread {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem .85rem;
}

.aw-thread-chip {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}

.aw-thread-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.aw-thread-name { font-weight: 700; font-size: .9rem; }
.aw-thread-code { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.aw-thread-share {
  margin-left: auto;
  text-align: right;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.aw-thread-near {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--warn);
}

/* ----------------------------------------------------------------- chest */

.aw-chest {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: var(--aw-gap);
  align-items: start;
}

.aw-chest-stage {
  background: #f5f3f0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  /* On a narrow phone 90mm is wider than the column. The badge keeps its real
     width and this box scrolls, rather than the badge being quietly shrunk
     and the caption then telling the customer a size that is not true. */
  overflow-x: auto;
}

/* Width only. The badge is 90mm across and whatever tall the artwork makes
   it, so forcing a height here would draw a square that is not the truth. */
.aw-chest-rule {
  position: relative;
  width: 90mm;
  min-height: 12mm;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(12, 12, 14, .28);
  border-radius: 6px;
  background: #ffffff;
  /* content-box with no padding, so the 90mm is the artwork itself and not
     the artwork minus a border and some padding. */
  padding: 0;
  box-sizing: content-box;
}

.aw-chest-art {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aw-chest-art svg { max-width: 100%; height: auto; }

.aw-chest-caption {
  margin: .65rem 0 0;
  text-align: center;
  font-size: .78rem;
  color: #55524d;
  line-height: 1.5;
}

.aw-chest-dims {
  font-weight: 700;
  color: #0c0c0e;
  display: block;
}

.aw-chest-copy p { font-size: .92rem; line-height: 1.65; }
.aw-chest-copy p:first-child { margin-top: 0; }

/* ----------------------------------------------------------------- exits */

.aw-exits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--aw-gap);
}

.aw-exit {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
}

.aw-exit h3 {
  font-family: var(--font-display), sans-serif;
  font-size: 1.1rem;
  margin: 0 0 .5rem;
}

.aw-exit p {
  margin: 0 0 1.1rem;
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.aw-downloads {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* -------------------------------------------------------------- packages */

.aw-packages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .85rem;
  margin: 0 0 1.5rem;
}

.aw-pkg { position: relative; display: block; }

.aw-pkg-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.aw-pkg-card {
  display: block;
  height: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 1.1rem;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.aw-pkg-input:checked + .aw-pkg-card {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.aw-pkg-input:focus-visible + .aw-pkg-card {
  outline: 2px solid var(--brand-hi);
  outline-offset: 2px;
}

.aw-pkg-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .4rem;
}

.aw-pkg-name { font-weight: 700; font-size: 1rem; }
.aw-pkg-price { font-family: var(--font-display), sans-serif; font-weight: 800; font-size: 1.15rem; }
.aw-pkg-blurb { margin: 0 0 .6rem; font-size: .85rem; color: var(--muted); line-height: 1.55; }

.aw-pkg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .3rem;
}

.aw-pkg-list li {
  font-size: .82rem;
  color: var(--muted);
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.5;
}

.aw-pkg-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .5em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

.aw-pkg-flag {
  position: absolute;
  top: -.6rem;
  right: .9rem;
  background: var(--brand);
  color: #fff;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .2rem .5rem;
  border-radius: 99px;
}

/* ------------------------------------------------------------------ form */

.aw-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.aw-field { display: flex; flex-direction: column; gap: .35rem; }
.aw-field--wide { grid-column: 1 / -1; }

.aw-label { font-size: .82rem; font-weight: 700; letter-spacing: .02em; }
.aw-label span { color: var(--muted); font-weight: 400; }

.aw-input,
.aw-textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: .7rem .85rem;
  color: var(--text);
  font: inherit;
  font-size: .92rem;
}

.aw-input:focus,
.aw-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.aw-textarea { min-height: 110px; resize: vertical; }

.aw-form-foot {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.aw-form-small {
  margin: 0;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 48ch;
}

.aw-thanks {
  background: rgba(56, 201, 138, .1);
  border: 1px solid rgba(56, 201, 138, .38);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.aw-thanks h3 { margin: 0 0 .5rem; font-family: var(--font-display), sans-serif; }
.aw-thanks p { margin: 0 0 .5rem; font-size: .95rem; line-height: 1.65; }
.aw-thanks p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------- controls */

.aw-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.aw-control { display: flex; align-items: center; gap: .6rem; font-size: .85rem; }
.aw-control input[type="range"] { accent-color: var(--brand); width: 130px; }
.aw-control output { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 1.5rem; }

/* ----------------------------------------------------------------- notes */

.aw-honest {
  margin: 1rem 0 0;
  padding: .9rem 1rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.6;
}

.aw-honest strong { color: var(--text); }

/* ----------------------------------------------------------------- doors */

.aw-doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: var(--aw-gap);
}

.aw-door {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.aw-door:hover { border-color: var(--brand); }
.aw-door:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.aw-door.is-active { border-color: var(--brand); background: var(--brand-soft); }

.aw-door-tag {
  align-self: flex-start;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand);
}

.aw-door-title { font-family: var(--font-display), sans-serif; font-size: 1.15rem; font-weight: 700; }
.aw-door-sub { font-size: .88rem; color: var(--muted); line-height: 1.55; }

.aw-view > * + * { margin-top: var(--aw-gap); }

/* ------------------------------------------------------------- mockups */

.aw-mocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.aw-mock {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.aw-mock-frame {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  aspect-ratio: 886 / 1024;
  max-width: 100%;
}
.aw-mock-garment { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.aw-mock-art { position: absolute; transform: translate(-50%, -50%); line-height: 0; display: block; }
.aw-mock-art img { width: 100%; display: block; }

.aw-mock figcaption {
  position: absolute;
  left: .5rem;
  bottom: .5rem;
  background: rgba(18, 18, 22, .8);
  color: #fff;
  font-size: .72rem;
  padding: .2rem .5rem;
  border-radius: 6px;
}

/* ---------------------------------------------------------------- brief */

.aw-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--aw-gap);
  align-items: start;
}

.aw-brief-step {
  margin: 1.5rem 0 .75rem;
  font-size: .95rem;
  font-weight: 700;
}

.aw-brief-step span { color: var(--muted); font-weight: 400; font-size: .85rem; }
.aw-brief-more { margin-top: 1.5rem; }

.aw-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.aw-chip { position: relative; cursor: pointer; }
.aw-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.aw-chip span {
  display: inline-block;
  padding: .45rem .9rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: .85rem;
}

.aw-chip input:checked + span { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.aw-chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.aw-summary { position: sticky; top: 1rem; }
.aw-brief > .aw-panel + .aw-panel { margin-top: 0; }
.aw-summary-list { margin: 1rem 0 0; display: grid; gap: .7rem; }
.aw-summary-list div { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; }
.aw-summary-list dt { color: var(--muted); }
.aw-summary-list dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }

.aw-summary-note {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Honeypot: off screen, never shown to a person. */
.aw-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------- modal */

.aw-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.aw-modal-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 12, .6); }

.aw-modal-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.aw-modal-close {
  position: absolute;
  top: .6rem;
  right: .75rem;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.aw-modal-lede { margin: .5rem 0 1.25rem; font-size: .92rem; color: var(--muted); line-height: 1.6; }
body.aw-modal-open { overflow: hidden; }

/* ---------------------------------------------------------------- mobile */

@media (max-width: 860px) {
  .aw-chest { grid-template-columns: minmax(0, 1fr); }
  .aw-brief { grid-template-columns: minmax(0, 1fr); }
  .aw-summary { position: static; }
}

@media (max-width: 640px) {
  .aw-panel { padding: 1.15rem; }
  .aw-compare { grid-template-columns: minmax(0, 1fr); }
  .aw-verdict-title { font-size: 1.3rem; }
  .aw-drop { padding: 2rem 1rem; }
  .aw-check-head { flex-wrap: wrap; }
  .aw-controls { align-items: flex-start; flex-direction: column; gap: .75rem; }
  .aw-control input[type="range"] { width: 100%; }
  .aw-control { width: 100%; }
}

@media (max-width: 400px) {
  .aw-mock figcaption { font-size: .62rem; padding: .15rem .4rem; left: .35rem; bottom: .35rem; }
  .aw-panel { padding: 1rem; border-radius: 12px; }
  .aw-threads { grid-template-columns: minmax(0, 1fr); }
  .aw-packages { grid-template-columns: minmax(0, 1fr); }
  .aw-chest-stage { padding: .85rem; }
  .aw-modal-card { padding: 1.1rem; }
  .aw-mocks { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
