/* CraftForms — shared site styles (tokens, base, header, footer, shared parts) */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Martian Mono";
  src: url("../fonts/martian-mono-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 112.5%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Martian Mono";
  src: url("../fonts/martian-mono-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 112.5%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* brand */
  --green: oklch(0.639 0.131 152);
  --green-ink: oklch(0.44 0.105 152);
  --green-tint: oklch(0.93 0.04 152);
  --amber: oklch(0.772 0.204 65);
  --amber-hot: oklch(0.72 0.2 58);
  --amber-ink: oklch(0.52 0.14 55);

  /* sorting floor and label stock */
  --ink: oklch(0.22 0.03 152);
  --ink-2: oklch(0.4 0.025 152);
  --ink-3: oklch(0.52 0.02 152);
  --floor: oklch(0.952 0.011 150);
  --floor-2: oklch(0.915 0.014 150);
  --stock: oklch(0.995 0.002 150);
  --rule: oklch(0.84 0.014 150);
  --rule-strong: oklch(0.7 0.02 152);

  /* type */
  --font-sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --step--2: 0.6875rem;
  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  --step-3: clamp(2rem, 1.35rem + 2.4vw, 3.5rem);
  --step-4: clamp(2.75rem, 1.4rem + 4.4vw, 5.25rem);

  /* the label-stock module */
  --u: 8px;
  --die: 10px;
  --max: 1320px;
  --gutter: clamp(16px, 3.6vw, 48px);
  --rail-space: 28px;
  --rail-offset: 9px;
  --rail-x: calc(max(0px, (100% - var(--max)) / 2) + var(--gutter) + var(--rail-offset));

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-label: 0 1px 1px oklch(0.22 0.03 152 / 0.08), 0 6px 18px -8px oklch(0.22 0.03 152 / 0.22);
  --on-band: oklch(0.25 0.045 152);
  --code-ok: oklch(0.82 0.15 150);
  --on-ink: oklch(0.94 0.01 150);
  --on-ink-2: oklch(0.8 0.02 150);
  --on-ink-3: oklch(0.75 0.03 150);
  --rule-on-ink: oklch(0.45 0.03 152);
  --header-h: 68px;
  --section-pad: clamp(72px, 8.5vw, 128px);
}

@media (min-width: 960px) {
  :root {
    --rail-space: 80px;
    --rail-offset: 20px;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  scrollbar-color: var(--rule-strong) var(--floor);
}

body {
  margin: 0;
  background: var(--floor);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.55;
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}

::selection {
  background: var(--amber);
  color: var(--ink);
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 800;
  line-height: 1.02;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: var(--amber);
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 700;
  border-radius: var(--die);
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--rail {
  padding-left: calc(var(--gutter) + var(--rail-space));
}

.nowrap {
  white-space: nowrap;
}

.mono {
  font-family: var(--font-mono);
  font-stretch: 87.5%;
  font-variant-numeric: tabular-nums slashed-zero;
}

.label-caps {
  font-family: var(--font-sans);
  font-stretch: 72%;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.code-caps {
  font-stretch: 72%;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ---------- wordmark ---------- */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.375rem;
  line-height: 1;
  letter-spacing: -0.02em;
  font-stretch: 104%;
}

.wordmark svg {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--green);
}

.wordmark b {
  font-weight: 850;
}

.wordmark span {
  font-weight: 400;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid var(--ink);
  border-radius: var(--die);
  background: var(--stock);
  color: var(--ink);
  font-weight: 700;
  font-stretch: 96%;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.btn:hover {
  background: var(--floor-2);
}

.btn:active {
  transform: translateY(1px);
}

.btn--amber {
  background: var(--amber);
  border-color: var(--amber);
}

.btn--amber:hover {
  background: var(--amber-hot);
  border-color: var(--amber-hot);
}

.btn--ink {
  background: var(--ink);
  color: var(--stock);
}

.btn--ink:hover {
  background: oklch(0.32 0.04 152);
}

.btn--small {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.9375rem;
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
}

.link-arrow svg {
  width: 16px;
  height: 16px;
  transition: transform 180ms var(--ease-out);
}

.link-arrow:hover svg {
  transform: translateX(3px);
}

/* ---------- tags ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 780;
  font-stretch: 72%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.tag--free {
  background: var(--green-tint);
  color: var(--green-ink);
}

.tag--pro {
  border: 1.5px solid var(--ink);
  color: var(--ink);
}

/* ---------- barcode ---------- */

.barcode {
  display: block;
  height: 26px;
  color: var(--ink);
}

.barcode svg {
  width: 100%;
  height: 100%;
}

/* ---------- franking stamp ---------- */

.stamp {
  --stamp-color: var(--green-ink);
  display: inline-grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 16px 9px;
  border: 3px solid var(--stamp-color);
  border-radius: 12px;
  outline: 1.5px solid var(--stamp-color);
  outline-offset: -8px;
  color: var(--stamp-color);
  transform: rotate(-9deg);
  pointer-events: none;
}

.stamp__top,
.stamp__date {
  font-family: var(--font-mono);
  font-stretch: 80%;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.2;
}

.stamp__word {
  font-size: 2.5rem;
  font-weight: 900;
  font-stretch: 118%;
  letter-spacing: 0.04em;
  line-height: 0.9;
}

/* ---------- route rail ---------- */

.route {
  position: relative;
}

.route::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: var(--rail-x);
  top: var(--rail-top, 0px);
  height: var(--rail-length, 0px);
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  pointer-events: none;
}

.stop {
  position: absolute;
  z-index: 3;
  left: var(--rail-x);
  top: calc(var(--section-pad) + 4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
}

.stop::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--amber);
}

.stop span {
  display: none;
  padding: 10px 5px;
  border-radius: 6px;
  background: var(--stock);
  box-shadow: 0 0 0 2px var(--ink);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 780;
  font-stretch: 72%;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  white-space: nowrap;
}

@media (min-width: 960px) {
  .stop span {
    display: block;
  }
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklch, var(--floor) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease-out);
}

.site-header.is-stuck {
  border-bottom-color: var(--rule);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}

.site-nav {
  display: none;
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  gap: 4px;
}

.site-nav a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--floor-2);
}

.site-header__cta {
  margin-left: auto;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  border-radius: var(--die);
  background: var(--stock);
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
}

.menu-toggle [data-close] {
  display: none;
}

.menu-toggle[aria-expanded="true"] [data-open] {
  display: none;
}

.menu-toggle[aria-expanded="true"] [data-close] {
  display: block;
}

.mobile-nav {
  border-top: 1px solid var(--rule);
  padding-block: 12px 20px;
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav a {
  display: flex;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--rule);
  font-weight: 650;
  font-size: 1.125rem;
  text-decoration: none;
}

@media (min-width: 1240px) {
  .site-nav {
    display: block;
  }

  .site-header__cta {
    margin-left: 8px;
  }

  .menu-toggle,
  .mobile-nav {
    display: none !important;
  }
}

@media (max-width: 520px) {
  .site-header__bar {
    gap: 10px;
  }

  .site-header__cta {
    margin-left: auto;
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.875rem;
  }

  .site-header__cta svg {
    width: 18px;
    height: 18px;
  }

  .menu-toggle {
    margin-left: 0;
  }
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--ink);
  color: var(--on-ink);
  padding-block: 72px 32px;
}

.site-footer a {
  color: var(--on-ink);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
  text-decoration-color: var(--amber);
}

.site-footer .wordmark {
  color: var(--stock);
}

.site-footer .wordmark svg {
  color: var(--green);
}

.footer-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
}

.footer-brand p {
  margin-top: 14px;
  color: var(--on-ink-2);
  max-width: 30ch;
}

.footer-col h2,
.footer-col__title {
  margin-bottom: 14px;
  font-size: 0.8125rem;
  font-weight: 780;
  font-stretch: 72%;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-ink-3);
}

.footer-col li + li {
  margin-top: 8px;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px dashed var(--rule-on-ink);
  font-size: var(--step--1);
  color: var(--on-ink-3);
}

.footer-base .barcode {
  width: 180px;
  height: 22px;
  color: var(--on-ink-2);
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1080px) {
  .footer-grid {
    grid-template-columns: 1.4fr repeat(4, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* one amber action: while the page's own download label is visible, the header button steps back */
.site-header__cta.is-muted {
  background: var(--stock);
  border-color: var(--ink);
}

.site-header__cta.is-muted:hover {
  background: var(--floor-2);
}

@media (max-width: 520px) {
  .site-header__cta {
    white-space: nowrap;
    padding: 0 11px;
  }

  .site-header__cta svg {
    display: none;
  }
}

/* the owner's logo files: full logo on light in the header, on dark in the footer */
.wordmark img {
  display: block;
  width: auto;
  height: 28px;
}

.site-footer .wordmark img {
  height: 26px;
}

@media (max-width: 520px) {
  .site-header .wordmark img {
    height: 22px;
  }
}

/* ---------- download steps panel (non-modal, opens beside any download link) ---------- */
.dl-steps {
  position: fixed;
  inset: auto 16px 16px auto;
  z-index: 60;
  width: min(380px, calc(100vw - 32px));
  margin: 0;
  padding: 22px 22px 20px;
  border: 0;
  border-radius: var(--die, 10px);
  background: var(--stock, #fff);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--rule-strong), 0 24px 48px -20px oklch(0.22 0.05 152 / 0.55);
}

.dl-steps h2 {
  padding-right: 32px;
  font-size: 1.1875rem;
  font-weight: 800;
  letter-spacing: -0.012em;
  line-height: 1.2;
}

.dl-steps__meta {
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--ink-3);
}

.dl-steps ol {
  margin: 14px 0 0;
  padding-left: 1.3em;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.dl-steps li + li {
  margin-top: 6px;
}

.dl-steps__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  margin-top: 16px;
  font-size: 0.9375rem;
}

.dl-steps__actions a {
  font-weight: 650;
  color: var(--ink);
}

.dl-steps__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
}

.dl-steps__close:hover {
  background: var(--floor-2);
  color: var(--ink);
}

@media (max-width: 520px) {
  .dl-steps {
    inset: auto 12px 12px 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .dl-steps[open] {
    animation: dl-rise 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  @keyframes dl-rise {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
  }
}

/* account link: set apart from the page links by a hairline */
.site-nav__account {
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--rule);
}

/* room for one small icon tool (e.g. search) between the links and the download button */
.site-header__tool {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.site-header__tool:hover {
  background: var(--floor-2);
}

.site-header__tool svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 1239px) {
  .site-header__tool {
    margin-left: auto;
  }

  .site-header__tool + .site-header__cta {
    margin-left: 0;
  }
}

@media (max-width: 520px) {
  .site-header__tool {
    width: 36px;
    height: 36px;
  }

  .site-header__tool svg {
    width: 22px;
    height: 22px;
  }
}

/* header labels never break onto two lines */
.site-nav a,
.site-header__cta {
  white-space: nowrap;
}

@media (min-width: 1240px) and (max-width: 1359px) {
  .site-header__bar {
    gap: 16px;
  }

  .site-nav a {
    padding-inline: 8px;
  }
}
