/* findingnamo. two colours, three shades, one family, four sizes. the scanner
   is the only object; the face marks are the only outlines. */

:root {
  --paper: #fbf4e6;
  --ink: #2f241c;
  --muted: #665544;
  --line: #e4d5bd;
  --tomato: #b84832;

  --font: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --t-display: 40px;
  --t-title: clamp(26px, 2.2vw, 32px);
  --t-body: 18px;
  --t-label: 13px;

  --wrap: 1240px;
  --gut: 56px;
  --nav: 72px;
  --shadow-card:
    0 1px 2px rgba(47, 36, 28, 0.06), 0 24px 50px -32px rgba(47, 36, 28, 0.38);
  --shadow-soft:
    0 1px 2px rgba(47, 36, 28, 0.08), 0 14px 30px -18px rgba(47, 36, 28, 0.34);
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-padding-top: calc(var(--nav) + 20px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-body)/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scrollbar-color: var(--line) transparent;
}

::selection {
  background: var(--tomato);
  color: var(--paper);
}

h1,
p {
  margin: 0;
}

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

button,
input {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  cursor: pointer;
}
a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--tomato);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gut) * 2);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.skip {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font: 700 var(--t-label)/1 var(--font);
  text-decoration: none;
  transform: translateY(-160%);
}
.skip:focus {
  transform: none;
}

body.is-loading {
  overflow: hidden;
}

/* ---------------------------------------------------------------- loader */
.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
}

.loader__card {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 34px 28px 28px;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.loader__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 700 var(--t-body)/1 var(--font);
  letter-spacing: -0.03em;
}

.loader__brand .mark {
  width: 20px;
  height: 20px;
}

.loader__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 16px;
}

.loader__line {
  text-align: left;
  font: 700 var(--t-title)/1.2 var(--font);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.loader__track {
  height: 10px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--line);
}

.loader__track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--tomato);
  border-radius: 4px;
}

.loader__pct {
  flex: none;
  color: var(--muted);
  font: 700 var(--t-label)/1.4 var(--font);
  font-variant-numeric: tabular-nums;
}

.loader__retry {
  width: 100%;
  margin-top: 18px;
}

.loader.is-error .loader__line {
  color: var(--tomato);
}
.loader.is-error .loader__track i {
  background: var(--tomato);
}

/* ---------------------------------------------------------------- type */
h1,
.brand {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

h1 {
  font-size: var(--t-display);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 8px;
  font: 700 var(--t-body)/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--tomato);
  color: var(--paper);
}

.btn--primary:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------------------------------------------------------------- nav */
.nav {
  position: relative;
  z-index: 60;
  background: var(--paper);
}

.nav__bar {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: calc(760px + var(--gut) * 2);
  height: var(--nav);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: var(--t-body);
  line-height: 1;
  text-decoration: none;
}

.mark {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--tomato);
}

/* ---------------------------------------------------------------- hero */
.hero {
  padding: 28px 0 64px;
}

.hero__inner {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.hero__art {
  width: 100%;
  margin-top: 30px;
}

/* ---------------------------------------------------------------- scanner */
.scan {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 390px;
  overflow: hidden;
  background: var(--paper);
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  color: var(--ink);
}

.scan__chip {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 3;
  padding: 5px 9px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--muted);
  font: 700 var(--t-label)/1 var(--font);
  pointer-events: none;
}

.scan__main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  padding: 20px 22px;
}

.scan__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1;
  width: 100%;
  min-height: 170px;
  padding: 18px;
  border-radius: 6px;
  background: var(--line);
  color: var(--ink);
  text-align: center;
}

.scan__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 100%;
}

.scan__drop:hover,
.scan__drop:focus-visible,
.scan__drop.is-over {
  background: var(--paper);
}

.scan__drop.has-preview {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: var(--ink);
}

.scan__drop.has-preview .scan__empty {
  display: none;
}

.scan__preview {
  position: relative;
  display: block;
  width: 100%;
  height: 320px;
}

.scan__preview > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scan__faces {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}

.face {
  position: absolute;
  border: 2px solid var(--tomato);
  border-radius: 6px;
  box-shadow: 0 0 0 2px var(--paper);
}

.face--not {
  border-color: var(--ink);
}

.face b {
  position: absolute;
  left: 0;
  top: 0;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--tomato);
  color: var(--paper);
  font: 700 var(--t-label)/1.1 var(--font);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.face--not b {
  background: var(--ink);
  color: var(--paper);
}

.scan__drop-art {
  width: 42px;
  height: 42px;
  color: var(--tomato);
}
.scan__drop-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.scan__drop-title {
  font: 700 var(--t-title)/1.2 var(--font);
  letter-spacing: -0.03em;
}

.scan__drop-sub {
  max-width: 36ch;
  color: var(--muted);
  font-size: var(--t-label);
  line-height: 1.45;
}

.scan__samples {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.scan__samples-label {
  margin-right: 2px;
  color: var(--muted);
  font-size: var(--t-label);
  line-height: 1.4;
}

.scan__sample {
  width: 46px;
  height: 46px;
  padding: 0;
  overflow: hidden;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(47, 36, 28, 0.22);
}

.scan__sample img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
}

.scan__sample:hover,
.scan__sample:focus-visible {
  box-shadow: 0 5px 10px -4px rgba(47, 36, 28, 0.35);
}

/* ---------------------------------------------------------------- closing */
.closing {
  padding: 56px 0 28px;
  background: var(--ink);
  color: var(--paper);
}

.closing .wrap {
  max-width: calc(760px + var(--gut) * 2);
}

.closing__links {
  padding: 0 0 36px;
}

.brand--light {
  color: var(--paper);
}
.brand--light .mark {
  color: var(--tomato);
}

.closing__brand p {
  max-width: 36ch;
  margin-top: 14px;
  color: var(--line);
  font-size: var(--t-body);
  line-height: 1.55;
}

.closing__brand p.closing__license {
  margin-top: 8px;
  color: var(--line);
  font-size: var(--t-label);
  line-height: 1.5;
}

.closing__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px 32px;
  color: var(--line);
  font-size: var(--t-label);
  line-height: 1.5;
}

.credits summary {
  color: var(--paper);
  cursor: pointer;
  font-weight: 700;
}

.credits p {
  max-width: 86ch;
  margin-top: 10px;
  color: var(--line);
  font-size: var(--t-label);
  line-height: 1.65;
}

/* ---------------------------------------------------------------- breakpoints */
@media (max-width: 1180px) {
  :root {
    --gut: 40px;
  }
}

@media (max-width: 1024px) {
  :root {
    --gut: 34px;
  }
}

@media (max-width: 700px) {
  :root {
    --gut: 22px;
    --nav: 64px;
  }

  .brand .mark {
    width: 20px;
    height: 20px;
  }
  .hero {
    padding-top: 16px;
  }
  .scan {
    min-height: 0;
  }
  .scan__main {
    padding: 14px;
  }
  .scan__drop {
    min-height: 156px;
    padding: 18px 12px;
  }
  .scan__preview {
    height: 240px;
  }

  .closing {
    padding: 44px 0 24px;
  }
  .closing__links {
    padding: 0 0 28px;
  }
  .closing__legal {
    flex-direction: column;
  }
}
