/*
 * Honest Robin: QR. A cutting mat with a ruler, in honestrobin.com's greens; the code is a sticker
 * with a dashed cut line; the text field is drawn like the robin, standing on its two legs. The
 * robin's orange is kept for live moments, never for text. One theme: the mat stays light.
 */
@font-face {
  font-family: "Archivo Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(fonts/archivo-latin-ext-wdth-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(fonts/archivo-latin-wdth-normal.woff2) format("woff2-variations");
  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;
}

:root {
  color-scheme: light;

  --mat: #eaf1ec;
  --grid: #c6d7cb;
  --grid-fine: #dbe7df;
  --surface: #ffffff;
  --ink: #1c2b25;
  --ink-soft: #46554e;
  --rule-strong: #7fa08c;
  --action: #1f5c45;
  --action-hover: #17493a;
  --action-ink: #f3f5f0;
  --warn: #6b4410;
  --warn-tint: #f6ecd9;
  --focus: #2f6fd6;

  /* The robin's own colours, for the field it lends its look to. */
  --robin: #f26a2e;
  --beak: #f7b733;
  --belly: #fbeedb;
  --wing: #7b4f36;
  --outline: #2a1a12;

  --font: "Archivo Variable", "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sticker: min(360px, 76vw);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: var(--font);
  color: var(--ink);
  /* The mat: a line every 28 px, and a stronger one every 140 px, under the ruler's numbers. */
  background-color: var(--mat);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-fine) 1px, transparent 1px);
  background-size: 140px 140px, 140px 140px, 28px 28px, 28px 28px;
  background-position: -1px -1px;
}

a {
  color: var(--action);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--action-hover);
}
button,
input {
  font: inherit;
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input[type="checkbox"]:focus-visible,
.chip-input:focus-visible + label {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- The ruler along the top ---- */
.ruler {
  height: 30px;
  overflow: hidden;
  display: flex;
  background: repeating-linear-gradient(90deg, var(--rule-strong) 0 1px, transparent 1px 28px) left bottom / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, var(--ink-soft) 0 1.5px, transparent 1.5px 140px) left bottom / 100% 14px no-repeat;
}
.ruler span {
  flex: none;
  width: 140px;
  padding: 4px 0 0 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* ---- The page ---- */
.page {
  flex: 1;
  padding: 18px clamp(16px, 4vw, 48px) 26px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.masthead,
.desk,
.foot {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- The language picker: a speech bubble drawn like the text field, with no flags ---- */
.picker {
  position: relative;
  letter-spacing: normal;
  text-transform: none;
}
.tongue {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--outline);
  background: var(--belly);
  border: 3px solid var(--outline);
  border-radius: 18px;
  cursor: pointer;
}
.tongue::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 6px;
  width: 26px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0.85;
  transform: rotate(-7deg);
}
.tongue span {
  position: relative;
}
.tongue .chevron {
  position: relative;
  fill: none;
  stroke: var(--outline);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tongue[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}
.tongue .tail {
  position: absolute;
  left: 16px;
  bottom: -14px;
  width: 18px;
  height: 15px;
  overflow: visible;
}
.tail-fill {
  fill: var(--belly);
}
.tail-line {
  fill: none;
  stroke: var(--outline);
  stroke-width: 3;
  stroke-linejoin: round;
}
.tongue:focus-visible,
.language-list .item:focus-visible,
.also a:focus-visible,
.also-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--robin);
}
.language-list {
  position: absolute;
  right: 0;
  top: 62px;
  z-index: 2;
  width: 250px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--belly);
  border: 3px solid var(--outline);
  border-radius: 20px;
  animation: open 0.2s cubic-bezier(0.3, 1.5, 0.5, 1) both;
  transform-origin: top right;
}
@keyframes open {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.language-list .item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 400;
  color: var(--outline);
  text-decoration: none;
  border-radius: 12px;
}
.language-list .item:hover {
  background: #f6dfc6;
}
.language-list .dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.language-list .item[aria-current="page"] .dot {
  background: var(--robin);
}

/* The one line that offers the page in the wanted language. */
.also {
  width: 100%;
  max-width: 1120px;
  margin: -12px auto 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}
.also a {
  font-weight: 650;
}
.also-close {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.desk {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 44px 64px;
}
.make {
  flex: 1 1 440px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* Level with the sticker, and still when "Colours and image" opens below it. */
  padding-top: clamp(0px, 6vw, 72px);
}
.make h1 {
  margin: 0;
  max-width: 9em;
  font-size: clamp(46px, 6.2vw, 80px);
  line-height: 0.98;
  font-weight: 800;
  font-stretch: 78%;
  letter-spacing: -0.015em;
}
/* Japanese and Korean break lines between phrases, not inside a word. */
:lang(ja) .make h1 {
  word-break: auto-phrase;
}
:lang(ko) .make h1,
:lang(ko) .lede {
  word-break: keep-all;
}
.lede {
  margin: 0;
  max-width: 30em;
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---- The field, drawn like the robin: its outline, its belly, its beak and its legs ---- */
.field {
  position: relative;
  margin-top: 16px;
  padding-bottom: 26px;
}
.field-box {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 24px;
  background: var(--belly);
  border: 3px solid var(--outline);
  border-radius: 28px;
  transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1);
}
/* The shine on the robin's belly. */
.field-box::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 8px;
  width: 46px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0.85;
  transform: rotate(-7deg);
  pointer-events: none;
}
.field-box:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 0 0 4px var(--robin);
}
.field-box input {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 14px 0;
  font-size: 22px;
  font-weight: 650;
  color: var(--outline);
  caret-color: var(--robin);
  background: transparent;
  border: 0;
  outline: none;
}
.field-box input::placeholder {
  color: var(--wing);
  opacity: 1;
}
.field-box input::selection {
  background: #f9c3a5;
}
.paste {
  position: relative;
  flex: none;
  min-height: 50px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 750;
  color: var(--outline);
  background: var(--beak);
  border: 3px solid var(--outline);
  border-radius: 20px;
  cursor: pointer;
}
.paste:active {
  transform: translateY(2px);
}
.legs {
  position: absolute;
  right: 64px;
  bottom: -25px;
  width: 60px;
  height: 22px;
  fill: none;
  stroke: var(--outline);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.ground {
  position: absolute;
  right: 58px;
  bottom: 1px;
  width: 72px;
  height: 8px;
  border-radius: 50%;
  background: rgb(42 26 18 / 0.16);
  pointer-events: none;
}

/* ---- What's in the code, and what might be a mistake ---- */
.says {
  min-height: 50px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 16px;
  line-height: 1.5;
}
.says strong {
  font-weight: 650;
  overflow-wrap: anywhere;
}
.offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.offer.warn {
  padding: 10px 14px;
  background: var(--warn-tint);
  border-radius: 8px;
  color: var(--warn);
}
.fix {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 10px;
  cursor: pointer;
}

/* ---- The sheet: the sticker, its size, the check and the buttons ---- */
.sheet {
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-top: 16px;
}
.sticker {
  position: relative;
  width: var(--sticker);
  aspect-ratio: 1;
  padding: 18px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 1px 0 rgb(28 43 37 / 0.1), 0 16px 30px -14px rgb(28 43 37 / 0.35);
  outline: 2px dashed var(--rule-strong);
  outline-offset: 13px;
}
.sticker svg.code,
.sticker svg.empty {
  display: block;
  width: 100%;
  height: 100%;
}
.sticker svg.code {
  border-radius: 8px;
}
.sticker svg.empty path {
  fill: var(--ink);
  fill-opacity: 0.1;
  fill-rule: evenodd;
}
/* A see-through background shows as the usual checks. */
.see-through {
  background: repeating-conic-gradient(#d3ddd6 0 25%, #ffffff 0 50%) 0 0 / 12px 12px;
}
.scissors {
  position: absolute;
  top: -26px;
  left: 34px;
  padding: 0 4px;
  background: var(--mat);
  line-height: 0;
}
.scissors svg {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.peel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 42px;
  height: 42px;
  border-bottom-right-radius: 24px;
  background: linear-gradient(135deg, transparent 50%, #dfe8e1 50%);
  box-shadow: -3px -3px 6px rgb(28 43 37 / 0.08);
}

/* The smallest print size, as a measuring line under the sticker. */
.measure-slot {
  width: var(--sticker);
  min-height: 26px;
  margin-top: 18px;
}
.measure {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}
.measure .end {
  flex: none;
  width: 1.5px;
  height: 14px;
  background: var(--ink-soft);
}
.measure .line {
  flex: 1;
  border-top: 1.5px solid var(--ink-soft);
}
.measure .size {
  white-space: nowrap;
}

/* The robin, the check's answer, and the robin's one line. */
.verdict {
  width: min(440px, 92vw);
  min-height: 80px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
}
.robin {
  flex: none;
  width: 72px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.robin img {
  display: block;
  width: 72px;
  height: auto;
}
.verdict-words {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}
.bubble {
  align-self: flex-start;
  margin: 0;
  padding: 9px 13px;
  font-size: 15px;
  line-height: 1.4;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 14px 14px 14px 4px;
}
.status {
  font-size: 16px;
  line-height: 1.45;
}
.status strong {
  font-weight: 750;
}
.status .ok {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.status .ok::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--robin);
}

/* Taking it away. */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.take {
  min-width: 112px;
  padding: 14px 20px;
  font-size: 17px;
  font-weight: 650;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.take.download {
  color: var(--action-ink);
  background: var(--action);
}
.take.download:hover:not(:disabled) {
  background: var(--action-hover);
}
.take:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}
.take:disabled {
  opacity: 0.45;
  cursor: default;
}
.which {
  margin: 0;
  max-width: 30em;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.more {
  min-height: 44px;
  padding: 0 8px;
  font-size: 15px;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Colours and image. */
.options {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  background: rgb(255 255 255 / 0.72);
  border: 1.5px solid var(--grid);
  border-radius: 12px;
}
.options fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.options legend {
  float: left;
  width: 92px;
  padding: 0;
  margin-top: 19px;
  font-size: 14px;
  font-weight: 700;
}
/* The chips wrap in the room beside their label, never back under it: a flex box sits beside a
   float instead of flowing under it, and doesn't clip the chosen chip's ring as overflow would. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 480px) {
  .options legend {
    float: none;
    margin: 0 0 8px;
  }
}
.chip {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  width: 70px;
  min-height: 58px;
  padding: 5px 5px 6px;
  font-size: 12.5px;
  line-height: 1.15;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--grid);
  border-radius: 6px;
  cursor: pointer;
}
.chip[aria-pressed="true"],
.chip.chosen {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--ink);
}
.chip-fill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgb(28 43 37 / 0.18);
  font-size: 20px;
  color: var(--ink-soft);
}
.chip-fill img {
  max-width: 100%;
  height: 28px;
  object-fit: contain;
}
.chip-fill.rainbow {
  background: conic-gradient(#f26a2e, #f7b733, #7fa08c, #1d3f8f, #6a2c70, #f26a2e);
}
.chip-fill.white {
  background: #ffffff;
}
.note {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-soft);
}
.note.problem {
  color: var(--warn);
}

/* ---- The footer ---- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.foot p {
  margin: 0;
}
.plain {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
}
.plain input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--action);
}

/* ---- Small moments ---- */
.pop {
  animation: pop 0.34s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.arrive {
  animation: arrive 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}
@keyframes arrive {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  60% {
    opacity: 1;
    transform: translateY(-8px) rotate(-4deg);
  }
  100% {
    transform: none;
  }
}
.say {
  animation: say 0.25s ease-out both;
}
@keyframes say {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pop,
  .arrive,
  .say,
  .language-list {
    animation: none;
  }
  .field-box {
    transition: none;
  }
  .field-box:focus-within {
    transform: none;
  }
}

/* ---- The page that isn't there ---- */
.lost {
  max-width: 34em;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.lost h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1;
  font-weight: 800;
  font-stretch: 78%;
}
.lost p {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
}
