/* Best Paint colour preview (/colour-preview/). The camera picture fills the phone; one quiet sheet at the bottom
   holds the colours. Same dark wall and single gold accent as the website (css/site.css). */
@font-face { font-family: "Manrope"; font-weight: 200 800; font-style: normal; font-display: swap; src: url("/fonts/manrope-var.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-style: normal; font-display: swap; src: url("/fonts/inter-var.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #070B1C; --panel: #111836; --hi: #fff; --text: #B9C0D6; --dim: #7E87A6; --gold: #E0B13A; --hair: rgba(255, 255, 255, .12);
  --display: "Manrope", "Segoe UI Variable Display", system-ui, sans-serif; --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 18px; --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { margin: 0; min-height: 100%; font-family: var(--body); font-size: 1.0625rem; line-height: 1.6; color: var(--text); background: var(--bg);
  overflow-x: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--hi); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--gold); font-weight: 500; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
button { font: inherit; color: inherit; }

/* the start screen and the "something went wrong" screen */
.page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center;
  padding: calc(2rem + var(--safe-t)) calc(1.5rem + var(--safe-r)) calc(2rem + var(--safe-b)) calc(1.5rem + var(--safe-l));
  background: radial-gradient(700px 380px at 85% -8%, rgba(224, 177, 58, .13), transparent 70%), var(--bg); }
.page-in { width: min(30rem, 100%); margin-inline: auto; }
.wordmark { display: inline-block; margin-bottom: 2.2rem; font-family: var(--display); font-weight: 600; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); text-decoration: none; }
h1 { font-family: var(--display); font-weight: 300; color: var(--hi); font-size: clamp(2.2rem, 9vw, 3.2rem); line-height: 1.06; letter-spacing: -.035em; margin: 0 0 .5em; text-wrap: balance; }
h1:focus { outline: none; }
.lead { font-size: 1.12rem; color: #D5DAEA; margin: 0 0 1.8rem; max-width: 34ch; }
.quiet { font-size: .92rem; color: var(--dim); margin: 1.4rem 0 0; }
.row { display: flex; flex-wrap: wrap; gap: .8rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 52px; padding: .95rem 1.7rem; border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--body); font-weight: 600; font-size: 1rem; line-height: 1; color: var(--bg); text-decoration: none; white-space: nowrap;
  background: linear-gradient(180deg, #F0C65A, var(--gold)); box-shadow: 0 16px 40px rgba(224, 177, 58, .26); transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .2s; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn.ghost { background: rgba(7, 11, 28, .5); color: var(--hi); box-shadow: inset 0 0 0 1px var(--hair); }
.btn.sm { min-height: 44px; padding: .7rem 1.1rem; font-size: .9rem; box-shadow: none; }

/* the camera screen */
.cam { position: fixed; inset: 0; overflow: hidden; background: #000; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
.cam video, .cam canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cam video { object-fit: cover; }
.cam canvas { touch-action: manipulation; cursor: crosshair; }

.ring { position: absolute; left: 50%; top: 40%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 1.5px solid rgba(255, 255, 255, .95); border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(7, 11, 28, .28), inset 0 0 0 1px rgba(7, 11, 28, .28); pointer-events: none; transition: left .3s var(--ease), top .3s var(--ease); }
.hint { position: absolute; left: 50%; top: 40%; margin: 30px 0 0; transform: translateX(-50%); padding: .5rem 1rem; border-radius: 999px; white-space: nowrap; pointer-events: none;
  font-size: .92rem; font-weight: 500; color: var(--hi); background: rgba(7, 11, 28, .62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: opacity .45s var(--ease), left .3s var(--ease), top .3s var(--ease); }
.hint.off { opacity: 0; }

.back { position: absolute; left: calc(.8rem + var(--safe-l)); top: calc(.8rem + var(--safe-t)); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  color: var(--hi); background: rgba(7, 11, 28, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

.sheet { position: absolute; left: 0; right: 0; bottom: 0; margin-inline: auto; max-width: 34rem; display: grid; gap: .7rem;
  padding: .9rem calc(1rem + var(--safe-r)) calc(.9rem + var(--safe-b)) calc(1rem + var(--safe-l));
  background: rgba(17, 24, 54, .9); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-top: 1px solid var(--hair); border-radius: 22px 22px 0 0; }
@media (min-width: 36rem) { .sheet { bottom: 1rem; border: 1px solid var(--hair); border-radius: 22px; } }

.now { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.dot { flex: none; width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); transition: background-color .3s var(--ease); }
.now-text { flex: 1; min-width: 0; margin: 0; display: grid; line-height: 1.25; }
.now-text strong { font-family: var(--display); font-weight: 500; font-size: 1.12rem; letter-spacing: -.02em; color: var(--hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-text span { font-size: .8rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.brands { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px; }
.brands::-webkit-scrollbar, .swatches::-webkit-scrollbar { display: none; }
.brand { flex: 1 0 auto; min-height: 44px; padding: 0 .6rem; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font-size: .82rem; font-weight: 500; color: var(--text); white-space: nowrap; transition: background-color .2s, color .2s; }
.brand[aria-pressed="true"] { background: rgba(255, 255, 255, .1); color: var(--hi); font-weight: 600; }

.swatches { display: flex; gap: .55rem; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding: 5px calc(1rem + var(--safe-r)) 5px calc(1rem + var(--safe-l)); margin: -5px calc(-1rem - var(--safe-r)) -5px calc(-1rem - var(--safe-l)); }
.sw { flex: none; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; scroll-snap-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.sw:active { transform: scale(.94); }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--gold); }

.tools { display: flex; gap: .5rem; }
.tool { flex: 1 1 0; min-height: 44px; padding: 0 .7rem; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--hair); cursor: pointer;
  font-size: .86rem; font-weight: 500; color: var(--hi); white-space: nowrap; touch-action: manipulation; transition: background-color .2s, box-shadow .2s; }
.tool[aria-pressed="true"], .tool.down { background: rgba(224, 177, 58, .14); box-shadow: inset 0 0 0 1px var(--gold); }

/* a phone held sideways: the sheet moves to the side so the picture keeps its height */
@media (orientation: landscape) and (max-height: 520px) {
  .sheet { left: auto; top: 0; bottom: 0; right: 0; width: calc(23rem + var(--safe-r)); max-width: 54%; margin: 0; align-content: center; border: 0; border-left: 1px solid var(--hair); border-radius: 22px 0 0 22px;
    padding: calc(.8rem + var(--safe-t)) calc(1rem + var(--safe-r)) calc(.8rem + var(--safe-b)) 1rem; }
  .swatches { margin: -5px -1rem; padding: 5px 1rem; }
  .brand { padding: 0 .4rem; font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
