/* The Iris website. Colours only through the tokens below, which follow the Windows app's
   (windows/app/ui/public/app.css); light and dark follow the system. Type is the system's own, so a
   visitor on Windows sees Segoe UI Variable, as in the app they are about to install.

   The idea: the page opens on a viewfinder, the Iris camera's picture. It is a pane over a field of
   soft, defocused light, with the camera's state on a liquid-glass chip. On load it does what the
   product does: it looks for the iPhone, then the picture comes into focus and the camera goes live.
   Everything below it is quiet text on near-white paper. */

:root {
  color-scheme: light dark;
  --paper: #f6f7f9;
  --text: #1a1a1a;
  --text-secondary: rgb(0 0 0 / 0.6);
  --separator: rgb(0 0 0 / 0.08);
  --well: rgb(0 0 0 / 0.05);
  --field: #e8edf4;
  --light-sky: rgb(158 191 238);
  --light-lilac: rgb(204 188 241);
  --light-mint: rgb(170 220 202);
  --light-apricot: rgb(244 212 180);
  --frame-rim: rgb(255 255 255 / 0.95);
  --frame-edge: rgb(0 0 0 / 0.06);
  --frame-shadow: rgb(15 25 45 / 0.28);
  --glass: rgb(255 255 255 / 0.5);
  --glass-strong: rgb(255 255 255 / 0.78);
  --glass-hover: rgb(255 255 255 / 0.95);
  --glass-rim: #ffffff;
  --glass-edge: rgb(0 0 0 / 0.07);
  --glass-shadow: rgb(15 25 45 / 0.2);
  --mark: rgb(26 26 26 / 0.88);
  --qr-tile: #ffffff;
  --focus: #000000;
  --state-searching: #ff9f0a;
  --state-live: #34c759;
  --spring: cubic-bezier(0.3, 1.4, 0.45, 1);
  --face-text: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --face-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --face-code: "Cascadia Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace;
  --width: min(100% - 2 * clamp(16px, 4vw, 40px), 1160px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1d20;
    --text: #ffffff;
    --text-secondary: rgb(255 255 255 / 0.66);
    --separator: rgb(255 255 255 / 0.1);
    --well: rgb(255 255 255 / 0.08);
    --field: #161a22;
    --light-sky: rgb(52 96 170);
    --light-lilac: rgb(98 76 162);
    --light-mint: rgb(36 116 96);
    --light-apricot: rgb(150 98 58);
    --frame-rim: rgb(255 255 255 / 0.16);
    --frame-edge: rgb(255 255 255 / 0.08);
    --frame-shadow: rgb(0 0 0 / 0.6);
    --glass: rgb(255 255 255 / 0.1);
    --glass-strong: rgb(255 255 255 / 0.16);
    --glass-hover: rgb(255 255 255 / 0.24);
    --glass-rim: rgb(255 255 255 / 0.3);
    --glass-edge: rgb(255 255 255 / 0.07);
    --glass-shadow: rgb(0 0 0 / 0.45);
    --mark: rgb(255 255 255 / 0.9);
    --focus: #ffffff;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--face-text);
  font-size: 17px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

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

h1,
h2 {
  font-family: var(--face-display);
  font-weight: 600;
  margin: 0;
}

p {
  margin: 0;
}

/* The mark is a mask filled with the colour of the text around it. */
.mark {
  display: block;
  background: currentColor;
  -webkit-mask: url("/mark.svg") center / contain no-repeat;
  mask: url("/mark.svg") center / contain no-repeat;
}

/* Header */

.bar {
  width: var(--width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--face-display);
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
}

.brand .mark {
  width: 30px;
  height: 30px;
}

.language {
  font-size: 15px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
}

.language:hover {
  color: var(--text);
  background: var(--well);
}

main {
  width: var(--width);
  margin: 0 auto;
}

/* The viewfinder */

.viewfinder {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  grid-template-areas: "hero signal";
  align-items: center;
  gap: 32px;
  min-height: clamp(540px, 74vh, 680px);
  padding: clamp(40px, 5vw, 72px);
  border-radius: 32px;
  background: var(--field);
  box-shadow:
    inset 0 0 0 1px var(--frame-edge),
    0 48px 96px -56px var(--frame-shadow);
}

/* The pane's lit top edge, above the light. */
.viewfinder::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 var(--frame-rim);
  pointer-events: none;
}

/* Defocused light, as a camera sees a room behind its subject. Each disc is a point of light out of
   focus: a flat circle with a soft edge, blurred by its distance from the plane of focus. */
.light {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.light i {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--c) 72%, transparent);
  opacity: 0.85;
  filter: blur(var(--blur));
}

.light i:nth-child(1) { --c: var(--light-sky); --blur: 22px; width: 48%; left: 50%; top: -18%; }
.light i:nth-child(2) { --c: var(--light-lilac); --blur: 10px; width: 30%; left: 76%; top: 44%; }
.light i:nth-child(3) { --c: var(--light-mint); --blur: 4px; width: 20%; left: 60%; top: 70%; }
.light i:nth-child(4) { --c: var(--light-apricot); --blur: 36px; width: 38%; left: -6%; top: 64%; }
.light i:nth-child(5) { --c: var(--light-sky); --blur: 2px; width: 8%; left: 90%; top: 12%; }
.light i:nth-child(6) { --c: var(--light-lilac); --blur: 40px; width: 26%; left: 18%; top: -16%; }

.hero {
  grid-area: hero;
}

.hero h1 {
  font-size: clamp(40px, 0.9rem + 4vw, 68px);
  line-height: 1.03;
  letter-spacing: -0.035em;
  text-wrap: balance;
  overflow-wrap: break-word;
  margin-bottom: 20px;
}

.lede {
  font-size: clamp(17px, 0.75rem + 0.6vw, 20px);
  color: var(--text-secondary);
  max-width: 32em;
  margin-bottom: 32px;
}

.get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

/* The one action on the page: a capsule of clear glass, lit along the top edge, standing off the
   picture, giving a little when pressed. */
.download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px 0 20px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 0 0 1px var(--glass-edge),
    0 1px 2px var(--glass-shadow),
    0 12px 32px -12px var(--glass-shadow);
  transition: transform 320ms var(--spring), background-color 150ms;
}

.download:hover {
  background: var(--glass-hover);
}

.download:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}

.download svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.meta {
  font-size: 15px;
  color: var(--text-secondary);
}

/* What the camera shows while it waits for the iPhone: the mark, and the state below it. */
.signal {
  grid-area: signal;
  display: grid;
  justify-items: center;
  gap: 28px;
}

.signal .mark {
  width: clamp(104px, 12vw, 156px);
  aspect-ratio: 1;
  background: var(--mark);
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  backdrop-filter: blur(24px) saturate(1.8);
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 0 0 1px var(--glass-edge),
    0 10px 28px -12px var(--glass-shadow);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--state-live);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--state-live) 22%, transparent);
}

.words {
  display: grid;
}

.words > span {
  grid-area: 1 / 1;
}

.searching {
  opacity: 0;
}

/* The one moment of motion: the camera looks for the iPhone, then the picture comes into focus and
   the state turns live. Without motion the page shows the live picture straight away. */
@media (prefers-reduced-motion: no-preference) {
  .light i {
    animation: defocused 1200ms cubic-bezier(0.2, 0.7, 0.2, 1) 1400ms backwards;
  }

  .signal .mark {
    animation: mark-defocused 1200ms cubic-bezier(0.2, 0.7, 0.2, 1) 1400ms backwards;
  }

  .dot {
    animation: dot-searching 400ms ease 1400ms backwards;
  }

  .searching {
    animation: shown 300ms ease 1400ms backwards;
  }

  .live {
    animation: hidden 300ms ease 1500ms backwards;
  }
}

@keyframes defocused {
  from {
    filter: blur(calc(var(--blur) + 44px));
    opacity: 0.55;
    transform: scale(1.1);
  }
}

@keyframes mark-defocused {
  from {
    filter: blur(8px);
    opacity: 0.35;
  }
}

@keyframes dot-searching {
  from {
    background: var(--state-searching);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--state-searching) 22%, transparent);
  }
}

@keyframes shown {
  from {
    opacity: 1;
  }
}

@keyframes hidden {
  from {
    opacity: 0;
  }
}

/* What Iris does */

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px clamp(24px, 4vw, 56px);
  padding: clamp(56px, 8vw, 96px) clamp(0px, 3vw, 40px) 0;
}

.facts h2 {
  font-size: 18px;
  line-height: 1.35;
  margin-bottom: 6px;
}

.facts p {
  font-size: 16px;
  color: var(--text-secondary);
}

/* Before you start, and set up */

.guide {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 40px clamp(32px, 6vw, 88px);
  padding: clamp(64px, 9vw, 112px) clamp(0px, 3vw, 40px) 0;
}

.guide h2 {
  font-size: clamp(24px, 1rem + 0.8vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.needs dl {
  margin: 0;
}

.needs dl > div {
  padding: 14px 0;
  border-top: 1px solid var(--separator);
}

.needs dt {
  font-size: 14px;
  color: var(--text-secondary);
}

.needs dd {
  margin: 2px 0 0;
}

.setup ol {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.setup li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 48px;
}

.setup li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--well);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.setup .aside {
  margin-top: 6px;
  font-size: 15px;
  color: var(--text-secondary);
}

/* The TestFlight link as a code for the iPhone's camera, on a white tile in either theme. A visitor
   on a phone or tablet taps the link instead, so it is left out there. */
.scan {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
}

.scan img {
  display: block;
  flex: none;
  width: 140px;
  height: 140px;
  padding: 12px;
  border-radius: 18px;
  background: var(--qr-tile);
  box-shadow:
    0 0 0 1px var(--separator),
    0 10px 28px -14px var(--glass-shadow);
}

.scan p {
  max-width: 14em;
  font-size: 15px;
  color: var(--text-secondary);
}

@media (max-width: 520px), (hover: none) and (pointer: coarse) {
  .scan {
    display: none;
  }
}

.verify {
  margin: 6px 0 0 48px;
  font-size: 15px;
}

.verify summary {
  cursor: pointer;
  color: var(--text-secondary);
  width: fit-content;
}

.verify summary:hover {
  color: var(--text);
}

.verify p {
  margin: 10px 0;
  color: var(--text-secondary);
}

.verify pre {
  margin: 0 0 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--well);
  font-family: var(--face-code);
  font-size: 14px;
  overflow-x: auto;
}

.verify .hash {
  white-space: pre-wrap;
  word-break: break-all;
}

/* Footer */

.foot {
  width: var(--width);
  margin: clamp(72px, 10vw, 128px) auto 0;
  padding: 24px 0 48px;
  border-top: 1px solid var(--separator);
  font-size: 14px;
  color: var(--text-secondary);
}

.foot p + p {
  margin-top: 4px;
}

/* Narrower windows: the picture stands on end, the camera's state above the words. */

@media (max-width: 960px) {
  .viewfinder {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "signal" "hero";
    gap: 40px;
    min-height: 0;
    padding: clamp(32px, 6vw, 56px) clamp(22px, 6vw, 56px) clamp(36px, 6vw, 56px);
    border-radius: 28px;
  }

  .hero h1 {
    font-size: clamp(32px, 10px + 6vw, 56px);
  }

  .signal {
    justify-items: start;
    gap: 20px;
  }

  .signal .mark {
    width: clamp(64px, 14vw, 96px);
  }

  .light i:nth-child(1) { width: 80%; left: 40%; top: -22%; }
  .light i:nth-child(2) { width: 46%; left: 72%; top: 34%; }
  .light i:nth-child(3) { width: 30%; left: 64%; top: 76%; }
  .light i:nth-child(4) { width: 64%; left: -20%; top: 62%; }
  .light i:nth-child(6) { width: 44%; left: -10%; top: -10%; }

  .facts,
  .guide {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .download {
    width: 100%;
    justify-content: center;
  }

  .verify {
    margin-left: 0;
  }
}
