:root {
  --ink: #14213D;
  --ink-soft: #46536E;
  --paper: #FFFFFF;
  --mist: #E9EEF2;
  --teal: #0E7C86;
  --teal-dark: #0A5D65;
  --kraft: #B98B5E;
  --kraft-dark: #9C7148;
  --tape: #F2B705;
  --error: #B42318;
  --radius: 6px;
  --wide: "Archivo", system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--wide);
  font-stretch: 100%;
  font-size: 1.0625rem;
  line-height: 1.55;
}

a { color: var(--teal-dark); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.top {
  display: flex; align-items: center; gap: 24px;
  max-width: 1200px; margin: 0 auto; padding: 18px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 26px; height: 26px; border: 3px solid var(--ink); border-radius: 3px; position: relative;
}
.brand-mark::after { content: ""; position: absolute; left: -3px; right: -3px; top: 7px; height: 3px; background: var(--ink); }
.brand-name { font-weight: 800; font-stretch: 112%; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-region { font-weight: 700; font-size: 0.8rem; background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 3px; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.nav a:hover { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 4px; }
.phone { font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1fr minmax(0, 520px); gap: 56px; align-items: start;
  max-width: 1200px; margin: 0 auto; padding: 40px 24px 88px;
}
.hero-copy { padding-top: 32px; }
h1 {
  font-stretch: 118%; font-weight: 850; font-size: clamp(2.4rem, 5.4vw, 4.4rem);
  line-height: 1.02; letter-spacing: -0.025em; margin: 0 0 24px; max-width: 13ch;
}
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 40ch; margin: 0 0 32px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 44ch; }
.facts li { padding-left: 22px; position: relative; color: var(--ink-soft); }
.facts li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 10px; height: 10px; background: var(--teal); border-radius: 2px; }
.facts strong { color: var(--ink); }

/* The label: a 4x6 thermal shipping label stuck on a kraft box */
.label {
  position: relative; background: var(--paper); border: 3px solid var(--ink); border-radius: 4px;
  padding: 0 0 20px; margin: 18px 0 0;
  box-shadow: 0 0 0 18px var(--kraft), 0 0 0 19px var(--kraft-dark);
  transform: rotate(-0.8deg);
}
.label::before {
  /* packing tape across the top edge */
  content: ""; position: absolute; top: -26px; left: 50%; width: 46%; height: 38px; transform: translateX(-50%) rotate(1.4deg);
  background: color-mix(in srgb, var(--tape) 78%, transparent); border-left: 2px dashed rgba(0,0,0,.08); border-right: 2px dashed rgba(0,0,0,.08);
}
.label-head {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--ink); color: #fff; padding: 12px 18px;
}
.label-logo { font-weight: 850; font-stretch: 120%; letter-spacing: -0.01em; }
.label-title { font-weight: 600; font-size: 0.9rem; opacity: .85; }

.label-row {
  border: 0; margin: 0; padding: 14px 18px 16px 118px; position: relative;
  border-bottom: 2px solid var(--ink); display: flex; flex-wrap: wrap; gap: 12px 14px; min-width: 0;
}
.label-row legend {
  position: absolute; left: 18px; top: 16px; width: 88px; padding: 0;
  font-weight: 850; font-stretch: 120%; font-size: 1rem; line-height: 1.15;
}
.field { display: grid; gap: 4px; flex: 1 1 140px; min-width: 0; }
.field-weight { flex: 0 1 120px; }
.field-wide { flex-basis: 100%; }
.field > span:first-child { font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); }
.field em { font-style: normal; font-weight: 500; }
.label input {
  width: 100%; min-width: 0; font: inherit; font-size: 1rem; color: var(--ink);
  border: 0; border-bottom: 2px solid #C5CED9; border-radius: 0; background: transparent; padding: 6px 2px;
}
.label input::placeholder { color: #9AA6B8; }
.label input:focus { outline: none; border-bottom-color: var(--teal); background: #F3F8F9; }
.label input[aria-invalid="true"] { border-bottom-color: var(--error); }
.unit { display: flex; align-items: center; gap: 6px; }
.unit b { font-weight: 700; }
.dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.label-foot { display: flex; align-items: center; gap: 16px; padding: 16px 18px 4px; }
.barcode {
  flex: 1; height: 54px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 7px, transparent 7px 9px, var(--ink) 9px 10px, transparent 10px 13px);
  opacity: .9;
}
.request-no { margin: 0; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.95rem; min-width: 0; }

.form-error { color: var(--error); font-weight: 600; margin: 8px 18px 0; min-height: 0; }
.form-error:empty { display: none; }

.primary {
  font: inherit; font-weight: 800; font-stretch: 110%; font-size: 1.05rem;
  background: var(--teal); color: #fff; border: 0; border-radius: var(--radius);
  padding: 14px 22px; cursor: pointer;
}
.primary:hover { background: var(--teal-dark); }
.primary:disabled { opacity: .6; cursor: progress; }
.label .primary, .label .secondary-btn { display: block; width: calc(100% - 36px); margin: 16px 18px 0; }
.secondary-btn {
  font: inherit; font-weight: 700; font-size: 1rem; background: #fff; color: var(--teal-dark);
  border: 2px solid var(--teal); border-radius: var(--radius); padding: 12px 20px; cursor: pointer;
}
.label .secondary-btn { margin-top: 10px; }
.secondary-btn:hover { background: #F3F8F9; }
.secondary-btn:disabled { opacity: .6; cursor: progress; }

.stamp {
  position: absolute; right: 26px; top: 120px; padding: 6px 16px;
  border: 4px solid var(--teal); color: var(--teal); border-radius: 6px;
  font-weight: 900; font-stretch: 125%; font-size: 1.6rem; text-transform: uppercase; letter-spacing: .04em;
  transform: rotate(-12deg) scale(1.6); opacity: 0; pointer-events: none;
}
.label.is-sent .stamp { animation: stamp .45s cubic-bezier(.2,.9,.3,1.3) forwards; }
.label.is-sent input { color: var(--ink-soft); }
.sent-note { margin: 12px 18px 0; font-weight: 600; color: var(--teal-dark); }
@keyframes stamp { to { opacity: .92; transform: rotate(-12deg) scale(1); } }

/* How it works */
.how, .sellers, .track { max-width: 1200px; margin: 0 auto; padding: 72px 24px; }
h2 { font-stretch: 115%; font-weight: 850; font-size: clamp(1.8rem, 3.2vw, 2.6rem); letter-spacing: -0.02em; line-height: 1.08; margin: 0 0 32px; }
.how { border-top: 2px solid var(--ink); }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step); display: block; font-weight: 900; font-stretch: 125%; font-size: 3.2rem; line-height: 1; color: var(--teal); margin-bottom: 14px;
}
.steps h3 { font-size: 1.25rem; font-stretch: 110%; margin: 0 0 8px; }
.steps p { margin: 0; color: var(--ink-soft); max-width: 34ch; }

/* Sellers */
.sellers {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center;
  background: var(--ink); color: #fff; border-radius: 8px; padding: 56px;
}
.sellers h2 { color: #fff; margin-bottom: 16px; }
.sellers p { color: #C9D2E0; max-width: 52ch; margin: 0 0 28px; }
.secondary {
  display: inline-block; font-weight: 800; color: var(--ink); background: var(--tape); text-decoration: none;
  padding: 13px 20px; border-radius: var(--radius);
}
.secondary:hover { filter: brightness(.95); }
.platforms { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: #2C3B5C; border: 2px solid #2C3B5C; border-radius: 6px; overflow: hidden; }
.platforms li { background: var(--ink); padding: 22px; font-weight: 800; font-stretch: 112%; font-size: 1.15rem; }

/* Track */
.track-form { max-width: 620px; }
.track-form label { display: block; font-weight: 700; margin-bottom: 8px; }
.track-row { display: flex; gap: 10px; }
.track-row input {
  flex: 1; min-width: 0; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 1.1rem;
  padding: 13px 14px; border: 2px solid var(--ink); border-radius: var(--radius); background: #fff; color: var(--ink);
}
.track .form-error { margin: 10px 0 0; }

.foot { max-width: 1200px; margin: 0 auto; padding: 40px 24px 120px; border-top: 2px solid var(--ink); display: flex; flex-wrap: wrap; gap: 8px 32px; color: var(--ink-soft); font-size: .95rem; }
.foot p { margin: 0; }
.foot a { margin-right: 16px; }

/* Chat */
.chat-open {
  position: fixed; right: 20px; bottom: 20px; z-index: 5;
  font: inherit; font-weight: 800; background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: 14px 22px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(20,33,61,.28);
}
.chat {
  position: fixed; right: 20px; bottom: 20px; z-index: 6; width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100vh - 40px));
  display: flex; flex-direction: column; background: #fff; border: 3px solid var(--ink); border-radius: 8px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(20,33,61,.3);
}
.chat[hidden] { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; background: var(--ink); color: #fff; padding: 14px 16px; }
.chat-head h2 { font-size: 1.1rem; margin: 0; color: #fff; letter-spacing: 0; }
.chat-head p { margin: 2px 0 0; font-size: .8rem; color: #C9D2E0; }
.chat-head button { font: inherit; font-size: .85rem; font-weight: 700; background: transparent; color: #fff; border: 2px solid #fff; border-radius: 4px; padding: 4px 10px; cursor: pointer; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--mist); }
.msg { max-width: 85%; padding: 10px 13px; border-radius: 10px; white-space: pre-wrap; font-size: .97rem; line-height: 1.45; }
.msg.assistant { background: #fff; border: 1px solid #D3DBE5; align-self: flex-start; border-bottom-left-radius: 2px; }
.msg.user { background: var(--teal); color: #fff; align-self: flex-end; border-bottom-right-radius: 2px; }
.msg.note { align-self: center; background: transparent; color: var(--teal-dark); font-weight: 700; font-size: .85rem; }
.msg.typing { color: var(--ink-soft); font-style: italic; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 2px solid var(--ink); }
.chat-form input { flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: 10px 12px; border: 2px solid #C5CED9; border-radius: 6px; }
.chat-form input:focus { outline: none; border-color: var(--teal); }
.chat-form button { font: inherit; font-weight: 800; background: var(--teal); color: #fff; border: 0; border-radius: 6px; padding: 0 16px; cursor: pointer; }

/* Phone */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-bottom: 64px; }
  .hero-copy { padding-top: 8px; }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .sellers { grid-template-columns: 1fr; padding: 36px 24px; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .top { padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 18px; overflow-x: auto; }
  .phone { margin-left: auto; font-size: .9rem; }
  .hero, .how, .track, .foot { padding-left: 16px; padding-right: 16px; }
  .sellers { margin: 0 16px; }
  .how, .track { padding-top: 56px; padding-bottom: 56px; }
  .label { transform: none; box-shadow: 0 0 0 10px var(--kraft), 0 0 0 11px var(--kraft-dark); margin: 26px 11px 0; }
  .label-row { padding: 14px; }
  .label-row legend { position: static; width: auto; margin-bottom: -4px; flex-basis: 100%; }
  .label-head, .label-foot { padding-left: 14px; padding-right: 14px; }
  .label .primary { width: calc(100% - 28px); margin: 14px 14px 0; }
  .stamp { top: 90px; right: 14px; font-size: 1.3rem; }
  .chat { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 16px); }
}
