@font-face {
  font-family: "Inter Tight";
  src: url("/fonts/inter-tight.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}
:root {
  --largura: 1440px;
  color-scheme: dark;
  --page: #050809;
  --alt: #0b1113;
  --text: #fff;
  --dim: rgba(255, 255, 255, 0.66);
  --line: rgba(255, 255, 255, 0.16);
  --hl: #1aa9c2;
  --field: rgba(255, 255, 255, 0.05);
  --warn: #e5a43b;
  --button: #00809f;
  --button-hover: #006f87;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  font:
    17px/1.5 "Inter Tight",
    system-ui,
    sans-serif;
  color: var(--text);
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --page: #fff;
    --alt: #f2f4f4;
    --text: #0a0c0d;
    --dim: rgba(10, 12, 13, 0.68);
    --line: rgba(10, 12, 13, 0.16);
    --hl: #00809f;
    --field: #fff;
    --warn: #a86400;
  }
  .logo .for-dark {
    display: none;
  }
}
@media (prefers-color-scheme: dark) {
  .logo .for-light {
    display: none;
  }
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-height: 100svh;
  background: var(--page);
}
:focus-visible,
label:is(.btn-main, .btn-line, .link):focus-within {
  outline: 2px solid var(--hl);
  outline-offset: 2px;
}
h1:focus {
  outline: none;
}

.bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 max(16px, calc((100vw - var(--largura)) / 2));
  border-bottom: 1px solid var(--line);
}
.logo img {
  display: block;
  width: auto;
  height: 24px;
}
.bar-name {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--dim);
  font-size: 14px;
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}
@media (min-width: 900px) {
  main {
    padding-top: 48px;
  }
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}
.steps li {
  padding-top: 8px;
  border-top: 2px solid var(--line);
  color: var(--dim);
  font-size: 13px;
  transition: border-color 0.3s var(--ease);
}
.steps i {
  margin-right: 6px;
  font: 500 11px var(--mono);
  letter-spacing: 0.08em;
}
.steps li[data-done],
.steps li[aria-current] {
  border-color: var(--hl);
}
.steps li[aria-current] {
  color: var(--text);
}

#status {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--alt);
}
#status:empty {
  display: none;
}

.eyebrow {
  margin: 0;
  color: var(--hl);
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
h1 {
  margin: 8px 0 14px;
  font-size: clamp(30px, 8vw, 40px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
[data-screen="mark"] h1,
[data-screen="sheet"] h1 {
  margin-bottom: 6px;
  font-size: 28px;
}
p {
  margin: 0 0 12px;
}
.lead {
  color: var(--dim);
}
.spec {
  font-size: 15px;
}
.spec:empty {
  display: none;
}
.fine {
  margin-top: 16px;
  color: var(--dim);
  font-size: 14px;
}
.note {
  display: grid;
  gap: 12px;
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--alt);
}
.note p {
  margin: 0;
}
.warn {
  margin: 14px 0;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--warn);
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.btn-main,
.btn-line {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid var(--button);
  border-radius: 999px;
  background: var(--button);
  color: #fff;
  font: inherit;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
a.btn-main {
  text-decoration: none;
}
.btn-main:hover {
  border-color: var(--button-hover);
  background: var(--button-hover);
}
.btn-line {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}
.btn-line:hover {
  border-color: var(--text);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
label input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.link {
  position: relative;
  display: inline-block;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link:hover {
  color: var(--text);
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  margin-top: 10px;
}

.choice {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 28px 0 0;
  padding: 0;
  border: 0;
}
.choice legend {
  margin-bottom: 12px;
  padding: 0;
  font-weight: 500;
}
.choice button {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.choice b {
  font-weight: 500;
}
.choice span {
  color: var(--dim);
  font-size: 15px;
}
.choice button[aria-pressed="true"] {
  border-color: var(--hl);
  background: color-mix(in srgb, var(--hl) 12%, transparent);
  box-shadow: inset 0 0 0 1px var(--hl);
}

.plan {
  margin: 20px 0;
}
.plan svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: var(--alt);
}
.plan figcaption {
  margin-top: 8px;
  color: var(--dim);
  font-size: 14px;
}
.plan-floor path {
  fill: none;
  stroke: var(--line);
}
.plan-frame {
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.5;
}
.plan-piece {
  fill: var(--line);
  stroke: var(--text);
}
.plan-rule {
  fill: none;
  stroke: var(--hl);
  stroke-width: 1.5;
}
.plan-label,
.plan-a4 {
  font: 500 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.plan-label {
  fill: var(--hl);
}
.plan-sheet {
  fill: #fff;
  stroke: rgba(10, 12, 13, 0.45);
}
.plan-a4 {
  fill: #0a0c0d;
}
.plan-end {
  fill: none;
  stroke: var(--hl);
  stroke-width: 2;
}
.how {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: how;
}
.how li {
  display: grid;
  grid-template-columns: 28px 1fr;
  counter-increment: how;
}
.how li::before {
  content: "0" counter(how);
  padding-top: 5px;
  color: var(--hl);
  font: 500 11px var(--mono);
  letter-spacing: 0.08em;
}

.stage {
  display: flex;
  justify-content: center;
  margin: 14px 0;
  border-radius: 12px;
  background: var(--alt);
  overflow: hidden;
}
canvas {
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.result {
  display: grid;
  margin: 14px 0 4px;
}
.result output {
  font-size: 40px;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.result span {
  color: var(--dim);
  font-size: 15px;
}
.tick {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 0;
  cursor: pointer;
}
.tick input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--button);
}
.field {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  font-weight: 500;
}
.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color: var(--text);
  font: inherit;
}
#tape {
  min-height: 60px;
  font-size: 26px;
  font-weight: 300;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}
.options button {
  min-width: 84px;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.options button[aria-pressed="true"] {
  border-color: var(--hl);
  background: color-mix(in srgb, var(--hl) 16%, transparent);
  box-shadow: inset 0 0 0 1px var(--hl);
}

.summary {
  margin: 20px 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.summary li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.summary div {
  display: grid;
  gap: 2px;
}
.summary .what {
  color: var(--dim);
  font: 500 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.summary strong {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
}
.summary small {
  color: var(--dim);
  font-size: 14px;
}
.summary .tools {
  justify-items: end;
}
.summary .link {
  padding: 6px 0;
}

/* Camera measurement. The screen always reads as dark glass over the picture, whatever the theme. */
#arView {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #8f8a80;
}
#ar {
  --text: #fff;
  --dim: rgba(255, 255, 255, 0.72);
  --line: rgba(255, 255, 255, 0.28);
  --hl: #1aa9c2;
  --field: transparent;
  position: fixed;
  inset: 0;
  z-index: 2;
  background: transparent;
  color: var(--text);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
#arLayer {
  position: absolute;
  inset: 0;
  touch-action: none;
}
#arExit {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(5, 8, 9, 0.62);
  color: #fff;
  font-family: inherit;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}
#arHint {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: 68px;
  right: 16px;
  margin: 0;
  padding: 9px 14px;
  border-radius: 14px;
  background: rgba(5, 8, 9, 0.62);
  font-size: 15px;
  line-height: 1.35;
  pointer-events: none;
}
#arHint:empty {
  display: none;
}
#ar .panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 10px;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: rgba(5, 8, 9, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
#ar .size-value {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 10px;
  margin: 0;
}
#ar .size-value output {
  font-size: 32px;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
#ar .size-value span {
  color: var(--dim);
  font-size: 15px;
}
#ar .size-row {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 10px;
}
#ar .nudge {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}
#ar input[type="range"] {
  width: 100%;
  height: 48px;
  margin: 0;
  background: transparent;
  accent-color: var(--hl);
  touch-action: pan-y;
}
#ar .widths {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}
#ar .widths > span:first-child {
  color: var(--dim);
  font-size: 15px;
}
#ar .options {
  gap: 8px;
  margin: 0;
}
#ar .options button {
  min-width: 64px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
}
#ar .widths .link {
  margin-left: auto;
}
#ar .btn-line {
  border-color: var(--line);
  color: var(--text);
}
#ar:not([data-phase="adjust"]) .when-adjust,
#ar:not([data-phase="more"]) .when-more,
#ar:is([data-phase="adjust"], [data-phase="more"]) .when-aim,
#ar:is([data-phase="search"], [data-phase="start"]) .when-sized {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
