:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #20232f;
  background: #f1f2f7;
  font-synthesis: none;
  --paper: #fff;
  --ink: #20232f;
  --muted: #565f73;
  --line: #e5e8f0;
  --action: #ffda45;
  --blue: #294ba8;
  --blue-tint: #edf2ff;
  --press: 150ms cubic-bezier(.2, .7, .25, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top right, #e9edfc, transparent 49rem);
}

:root[data-view="general"] .brand-icon {
  color: #fff;
  background: var(--blue);
}

button, input { font: inherit; }
button { color: inherit; }
button:enabled, .file-picker input:enabled { cursor: pointer; }

:focus-visible {
  outline: 3px solid #335dc4;
  outline-offset: 4px;
}

.wrap {
  width: min(100% - 64px, 1120px);
  margin-inline: auto;
}

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

.header-inner, .brand, .mode {
  display: flex;
  align-items: center;
}

.header-inner {
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
}

.brand {
  gap: 11px;
  font-size: 1.19rem;
  font-weight: 800;
  letter-spacing: -.04em;
}

.brand-icon {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: #222018;
  background: var(--action);
}

.brand-icon i {
  position: relative;
  width: 15px;
  height: 19px;
  border: 2px solid currentColor;
  border-radius: 3px;
  transform: translateY(-2px) rotate(-9deg);
}

.brand-icon i::before {
  position: absolute;
  inset: 4px 2px auto;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 0 4px currentColor;
  content: "";
}

.brand-icon::after {
  position: absolute;
  inset: auto 9px 8px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  content: "";
}

.mode {
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f1f3f9;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 650;
  line-height: 1.25;
}

.mode::before {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4b64aa;
  content: "";
}

.mode[data-state="offline"]::before { background: #b44736; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.47fr) minmax(0, 1fr);
  grid-template-areas: "carousel order";
  align-items: start;
  gap: clamp(16px, 2.1vw, 28px);
  padding-block: clamp(28px, 6vw, 82px) 40px;
}

.carousel {
  grid-area: carousel;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: clamp(320px, 37vw, 432px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(21px, 3.4vw, 43px);
  border-radius: 30px;
  color: white;
  background: #6c201f;
  box-shadow: 0 14px 36px rgb(34 41 66 / 12%);
  touch-action: pan-y pinch-zoom;
}

[data-view="general"] .carousel { background: #102d56; }

.carousel-photos,
.carousel-photos::after,
.carousel-photos img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.carousel-photos {
  z-index: -1;
  pointer-events: none;
}

.carousel-photos img {
  display: block;
  object-fit: cover;
  object-position: 52% 46%;
  opacity: 0;
  transition: opacity 570ms ease;
}

.carousel-photos img.is-outgoing { opacity: 1; z-index: 1; }
.carousel-photos img.is-current { opacity: 1; z-index: 2; }

.carousel-photos::after {
  z-index: 3;
  background:
    linear-gradient(90deg, rgb(15 12 23 / 59%), rgb(15 12 23 / 51%) 51%, transparent 84%),
    linear-gradient(0deg, rgb(15 12 23 / 57%), transparent 35%);
  content: "";
}

.carousel h2 {
  max-width: 9ch;
  margin: 0;
  font-size: clamp(2.8rem, 5.7vw, 4.6rem);
  font-weight: 820;
  line-height: .97;
  letter-spacing: -.065em;
  text-wrap: balance;
  text-shadow: 0 2px 16px rgb(14 11 17 / 18%);
}

[data-view="general"] .carousel h2 {
  max-width: 11ch;
  font-size: clamp(2.4rem, 5.25vw, 4.25rem);
}

.carousel-controls,
.carousel-dots {
  display: flex;
  align-items: center;
}

.carousel-controls {
  justify-content: space-between;
  margin: 14px -4px -8px;
}

.carousel-dots {
  gap: 1px;
  width: max-content;
  border-radius: 100px;
  background: rgb(18 18 27 / 55%);
}

.carousel-dots button,
.carousel-play {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: white;
  background: transparent;
  transition: background-color var(--press), transform var(--press);
}

.carousel-dots button span {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: rgb(255 255 255 / 62%);
  transition: width var(--press), background-color var(--press);
}

.carousel-dots button[aria-pressed="true"] span {
  width: 18px;
  background: #fff;
}

.carousel-dots button:focus-visible,
.carousel-play:focus-visible {
  outline-color: #fff;
  outline-offset: -3px;
}

.carousel-dots button:active,
.carousel-play:active {
  transform: scale(.9);
}

.carousel-play {
  border: 1px solid rgb(255 255 255 / 45%);
  background: rgb(18 18 27 / 58%);
}

.carousel-play span {
  width: 10px;
  height: 13px;
  border-inline: 3px solid currentColor;
  border-radius: 1px;
}

.carousel-play[data-paused="true"] span {
  width: 0;
  height: 0;
  margin-left: 2px;
  border: solid transparent;
  border-width: 7px 0 7px 11px;
  border-left-color: currentColor;
}

.print-card {
  grid-area: order;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid rgb(38 50 86 / 6%);
  border-radius: 29px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgb(34 41 66 / 7%);
}

.print-heading { display: grid; gap: 13px; }

.print-heading h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3.1vw, 2.4rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.055em;
}

.offer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.35;
}

.offer strong {
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--blue-tint);
  color: var(--blue);
  font-weight: 730;
  white-space: nowrap;
}

.upload,
.order,
.access-group {
  display: grid;
  gap: 10px;
}

.access-group {
  gap: 6px;
  margin-bottom: 3px;
  font-size: .9rem;
  font-weight: 650;
}

.access-group input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cdd4e5;
  border-radius: 12px;
  padding: 9px 12px;
  color: var(--ink);
  background: var(--paper);
  font-size: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  width: 100%;
  min-height: 53px;
  border: 1px solid transparent;
  border-radius: 15px;
  padding: 10px 14px;
  text-align: center;
  font-weight: 760;
  line-height: 1.25;
  transition: background-color var(--press), transform var(--press), box-shadow var(--press);
}

.button-primary {
  color: #211b0e;
  background: var(--action);
  box-shadow: 0 2px 0 #d7ae23;
}

.button-secondary {
  color: var(--blue);
  background: var(--blue-tint);
}

.button:active:not(:disabled),
.file-picker:has(input:enabled):active {
  transform: translateY(2px) scale(.985);
  box-shadow: none;
}

.button:disabled,
.file-picker:has(input:disabled) {
  cursor: default;
  opacity: .62;
  box-shadow: none;
}

.file-picker:has(input:disabled):active { transform: none; }

.file-picker:focus-within {
  outline: 3px solid #335dc4;
  outline-offset: 4px;
}

.file-picker input {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
}

.add-icon {
  flex: none;
  width: 18px;
  height: 18px;
  background:
    linear-gradient(currentColor, currentColor) center / 2px 15px no-repeat,
    linear-gradient(currentColor, currentColor) center / 15px 2px no-repeat;
}

.file-limit,
.message,
.error,
.order-summary {
  margin: 0;
  font-size: .83rem;
  line-height: 1.4;
}

.file-limit {
  color: var(--muted);
  text-align: center;
}

.message { color: var(--blue); }
.error { color: #a52f35; }

.file-selection {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: 15px;
  background: #f5f7fc;
}

.document-icon {
  flex: none;
  width: 17px;
  height: 22px;
  margin-left: 4px;
  border: 2px solid #4d64a3;
  border-radius: 3px;
  background:
    linear-gradient(#4d64a3, #4d64a3) center 6px / 8px 1px no-repeat,
    linear-gradient(#4d64a3, #4d64a3) center 11px / 8px 1px no-repeat;
}

.file-info {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
  font-size: .87rem;
  overflow-wrap: anywhere;
}

.file-info span { color: var(--muted); }

.stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.stepper button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 44px;
  padding: 0;
  border: 1px solid #dce4f5;
  border-radius: 11px;
  color: var(--blue);
  background: var(--paper);
  font-size: 1.35rem;
  line-height: 1;
  transition: transform var(--press), background-color var(--press);
}

.stepper button:enabled:active { transform: scale(.9); }
.stepper button:disabled { opacity: .48; }
.stepper output { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }

.order {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.order-summary { color: var(--muted); }

.job-state {
  padding: 12px 14px;
  border-radius: 13px;
  background: #edf2ff;
  color: #24418a;
}

.job-state[data-status="simulated"] {
  background: #edf6ee;
  color: #25583b;
}

.job-state:is([data-status="uncertain"], [data-status="failed"], [data-status="expired"]) {
  background: #fff0e9;
  color: #8d4231;
}

.job-state p {
  margin: 3px 0 0;
  font-size: .86rem;
  line-height: 1.4;
}

.print-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap-reverse;
  gap: 0 10px;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.sample-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--blue);
  font-size: .875rem;
  font-weight: 670;
  text-decoration: none;
  text-underline-offset: 3px;
}

.sample-link:hover { text-decoration: underline; }

.download-icon {
  width: 14px;
  height: 15px;
  background: currentColor;
  clip-path: polygon(43% 0, 57% 0, 57% 50%, 76% 30%, 87% 41%, 50% 77%, 13% 41%, 24% 30%, 43% 50%, 43% 0, 0 0, 0 89%, 100% 89%, 100% 100%, 0 100%, 0 0);
}

@media (hover: hover) {
  .button-primary:enabled:hover, .file-picker:has(input:enabled):hover { background: #ffcf23; }
  .button-secondary:enabled:hover, .stepper button:enabled:hover { background: #e3eaff; }
  .carousel-dots button:hover, .carousel-play:hover { background-color: rgb(15 15 24 / 78%); }
}

@media (max-width: 740px) {
  .wrap { width: min(100% - 32px, 540px); }
  .header-inner { min-height: 64px; }
  .brand-icon { width: 35px; height: 35px; border-radius: 10px; }
  .brand-icon::after { inset: auto 7px 6px; }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "carousel" "order";
    gap: 14px;
    padding-block: 16px 24px;
  }
  .carousel {
    min-height: clamp(172px, 47vw, 245px);
    border-radius: 23px;
    padding: 19px;
  }
  .carousel h2, [data-view="general"] .carousel h2 { font-size: clamp(2.15rem, 7.8vw, 3.4rem); }
  .carousel-controls { margin: 7px -4px -7px; }
  .print-card { gap: 15px; padding: 17px; border-radius: 23px; }
  .print-heading { gap: 9px; }
}

@media (max-width: 350px) {
  .wrap { width: calc(100% - 24px); }
  .brand { gap: 7px; font-size: 1.05rem; }
  .mode { font-size: .68rem; }
  .carousel h2, [data-view="general"] .carousel h2 { font-size: 2.1rem; }
  .print-card { padding-inline: 14px; }
  .stepper button { width: 37px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
