@font-face {
  font-family: "Suisse Intl";
  src: url("/assets/fonts/SuisseIntl-Book.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Suisse Intl";
  src: url("/assets/fonts/SuisseIntl-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Suisse Intl";
  src: url("/assets/fonts/SuisseIntl-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Suisse Intl Mono";
  src: url("/assets/fonts/SuisseIntlMono-Regular-WebXL.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #101511;
  --panel: #182228;
  --panel-soft: #223039;
  --paper: #f7f8f5;
  --paper-muted: #e7eceb;
  --line: rgb(255 255 255 / .14);
  --blue: #9bd5f4;
  --green: #d1f362;
  --coral: #ff5d4f;
  --text: #fbfbfb;
  --muted: rgb(251 251 251 / .68);
  --shadow: 0 24px 70px rgb(7 11 13 / .24);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --font-sans: "Suisse Intl", Arial, sans-serif;
  --font-mono: "Suisse Intl Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--blue);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at 18% 18%, #c2e8fb 0 14%, transparent 30%),
    linear-gradient(135deg, #8fd0f5 0%, #bbdff0 42%, #a6c7d0 100%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 1320px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 28px 14px calc(24px + env(safe-area-inset-bottom, 0px));
}

.intro {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.eyebrow,
.section-label,
.inventory__count,
.speed-control,
.shirt-card__label,
.sequence-card__index,
.sequence-card__remove,
.icon-button {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  line-height: 1;
}

.eyebrow {
  color: rgb(255 255 255 / .8);
  margin: 0;
}

h1 {
  max-width: 790px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: clamp(42px, 11vw, 112px);
  font-weight: 600;
  line-height: .82;
}

.builder {
  display: grid;
  gap: 14px;
}

.inventory {
  min-width: 0;
}

.inventory__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.section-label,
.inventory__count,
.speed-control {
  color: rgb(16 21 17 / .72);
  margin: 0;
}

.stage .section-label,
.stage .speed-control {
  color: var(--green);
}

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

.shirt-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(116px, 1fr) auto;
  gap: 10px;
  min-width: 0;
  min-height: 176px;
  padding: 8px;
  color: #3a4850;
  cursor: pointer;
  background: rgb(251 251 251 / .88);
  border: 1px solid rgb(58 72 80 / .13);
  border-radius: 8px;
  overflow: hidden;
  transition:
    transform .18s var(--ease-out),
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}

.shirt-card:hover {
  transform: translateY(-2px);
  border-color: rgb(16 21 17 / .28);
}

.shirt-card:focus-visible,
.icon-button:focus-visible,
.download-button:focus-visible,
.share-button:focus-visible,
.sequence-card__remove:focus-visible,
.speed-control input:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
}

.shirt-card[aria-pressed="true"] {
  background: #f8ffe4;
  border-color: var(--green);
  box-shadow: 0 10px 26px rgb(18 31 38 / .14);
}

.shirt-card__media {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border-radius: 6px;
  background-color: var(--paper);
  background-image:
    linear-gradient(45deg, var(--paper-muted) 25%, transparent 25%),
    linear-gradient(-45deg, var(--paper-muted) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--paper-muted) 75%),
    linear-gradient(-45deg, transparent 75%, var(--paper-muted) 75%);
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-size: 18px 18px;
}

.shirt-card__media img {
  width: auto;
  height: min(120px, 28vw);
  max-height: 156px;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgb(16 21 17 / .14));
}

.shirt-card__label {
  color: #43525b;
  text-align: center;
}

.shirt-card__badge {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--green);
  background: var(--ink);
  border: 1px solid var(--green);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
}

.stage {
  order: -1;
  align-self: start;
  background: rgb(16 21 17 / .9);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stage__canvas-wrap {
  background: #080b0c;
  padding: 10px;
}

.stage__canvas {
  width: 100%;
  aspect-ratio: 9 / 16;
  height: auto;
  background: #fff;
  border-radius: 6px;
}

.stage__controls {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding: 12px 12px 0;
}

.stage__status {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.icon-button,
.sequence-card__remove {
  min-height: 36px;
  color: rgb(255 255 255 / .72);
  cursor: pointer;
  background: transparent;
  border: 1px solid rgb(255 255 255 / .16);
  border-radius: 4px;
  padding: 8px 10px;
}

.icon-button:hover:not(:disabled),
.sequence-card__remove:hover {
  border-color: rgb(255 255 255 / .36);
}

.icon-button:disabled,
.download-button:disabled,
.share-button:disabled {
  cursor: not-allowed;
  opacity: .44;
}

.sequence-list {
  display: grid;
  gap: 6px;
  max-height: 230px;
  margin: 12px;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.sequence-card {
  display: grid;
  grid-template-columns: 28px 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 6px;
  background: rgb(255 255 255 / .08);
  border: 1px solid rgb(255 255 255 / .08);
  border-radius: 6px;
}

.sequence-card__index {
  color: var(--green);
  text-align: center;
}

.sequence-card--text {
  grid-template-columns: 64px minmax(0, 1fr);
}

.sequence-card--text .sequence-card__index {
  text-align: left;
  padding-left: 6px;
}

.sequence-card__thumb {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--paper);
  border-radius: 4px;
}

.sequence-card__thumb img {
  width: auto;
  max-width: 40px;
  max-height: 38px;
  object-fit: contain;
}

.sequence-card__title {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.sequence-card__remove {
  border: none;
}

.export-row {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.speed-control {
  display: grid;
  gap: 8px;
}

.speed-control input {
  width: 100%;
  accent-color: var(--green);
}

.download-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 12px 14px;
  color: var(--ink);
  cursor: pointer;
  background: var(--green);
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  transition: transform .18s var(--ease-out), opacity .18s ease;
}

.download-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 14px;
  color: var(--text);
  cursor: pointer;
  background: rgb(255 255 255 / .08);
  border: 1px solid rgb(255 255 255 / .18);
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  transition: transform .18s var(--ease-out), border-color .18s ease, background .18s ease;
}

.share-button:hover:not(:disabled) {
  background: rgb(255 255 255 / .12);
  border-color: rgb(255 255 255 / .34);
  transform: translateY(-1px);
}

@media (min-width: 700px) {
  .app-shell {
    padding: 34px 24px 36px;
  }

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

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

  .shirt-card__media img {
    height: 142px;
  }
}

@media (min-width: 1080px) {
  .app-shell {
    padding: 40px 30px;
  }

  .intro {
    margin-bottom: 16px;
  }

  .builder {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
    align-items: start;
  }

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

  .stage {
    order: 0;
    position: sticky;
    top: 24px;
  }
}

@media (min-width: 1280px) {
  .shirt-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

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