/* The app onboarding with the ring that crosses the screens: three onboarding screens of Stillwork, an invented focus
   timer, inside a phone on a dark page. The screen is a size container, so everything inside is measured on the
   phone itself (cqw, cqh) and the whole phone fits a short box as well as a tall one. The ring (.orb) is the one
   element all three screens share: the script moves it from slot to slot with left, top, width and height. */
:root {
  --page: #07070a;            /* the page */
  --frame: #1b1b20;           /* the phone's body */
  --screen: #0c0c11;          /* the screen */
  --ink: #f2f1f6;             /* the words */
  --muted: #8d8b99;           /* the small words */
  --glass: rgba(255, 255, 255, 0.045); /* the cards on the screen */
  --line: rgba(255, 255, 255, 0.08);   /* their edges and rules */
  --one: #8f7dff;             /* the light of the first screen: violet */
  --two: #46d6c4;             /* the light of the second: sea green */
  --three: #ffb071;           /* the light of the third: amber */
  --button: #f6f5fb;          /* the Start button */
  --button-ink: #0c0c11;      /* the words on it */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

/* --accent and the blob positions are moved by the script, on the stage, so the page glows with the screen */
.stage {
  --accent: var(--one);
  --glow: 1;
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 12px 16px;
  overflow: hidden;
  isolation: isolate;
}

.glow {
  position: absolute;
  z-index: -1;
  width: min(70vw, 70vh, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 34%, transparent), transparent 66%);
  opacity: calc(0.55 * var(--glow));
  pointer-events: none;
}

.glow--a {
  left: 50%;
  top: 50%;
  translate: -78% -62%;
}

.glow--b {
  left: 50%;
  top: 50%;
  translate: -18% -30%;
  background: radial-gradient(circle, rgba(120, 120, 160, 0.12), transparent 64%);
}

/* the phone: as tall as the box allows, never wider than it */
.phone {
  position: relative;
  --h: min(94vh, 680px, calc(90vw * 2.05));
  height: var(--h);
  aspect-ratio: 1 / 2.05;
  padding: calc(var(--h) * 0.014);
  border-radius: calc(var(--h) * 0.078);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 22%, rgba(255, 255, 255, 0) 78%, rgba(255, 255, 255, 0.08)),
    var(--frame);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 24px 48px -18px rgba(0, 0, 0, 0.9),
    0 60px 120px -40px rgba(0, 0, 0, 0.9),
    0 0 90px -30px color-mix(in srgb, var(--accent) calc(40% * var(--glow)), transparent);
  opacity: 0;
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--h) * 0.066);
  overflow: hidden;
  background: var(--screen);
  container-type: size;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8);
}

/* the light of the screen: two soft blobs of the accent colour */
.aurora {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.aurora__blob {
  position: absolute;
  width: 120cqw;
  height: 120cqw;
  border-radius: 50%;
  filter: blur(8cqw);
}

.aurora__blob--a {
  left: -10cqw;
  top: 6cqh;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) calc(42% * var(--glow)), transparent), transparent 62%);
}

.aurora__blob--b {
  left: 20cqw;
  top: 48cqh;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) calc(18% * var(--glow)), transparent), transparent 64%);
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.status {
  position: absolute;
  z-index: 3;
  left: 9cqw;
  right: 7cqw;
  top: 2.4cqh;
  height: 8cqw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 3.8cqw;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.status__island {
  position: absolute;
  left: 50%;
  top: 0;
  width: 29cqw;
  height: 8.4cqw;
  translate: -50% 0;
  border-radius: 99px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.status__icons {
  width: 11cqw;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.3;
  stroke-linecap: round;
}

.status__icons rect {
  stroke-width: 1;
  opacity: 0.6;
}

.status__icons .status__charge {
  fill: var(--ink);
  stroke: none;
  opacity: 1;
}

.top {
  position: absolute;
  z-index: 3;
  left: 8cqw;
  right: 8cqw;
  top: 9.4cqh;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top__brand {
  display: inline-flex;
  align-items: center;
  gap: 1.6cqw;
  font-size: 4cqw;
  font-weight: 620;
  font-variation-settings: 'wdth' 106;
}

.top__mark {
  width: 4.6cqw;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.top__skip {
  font-size: 3.6cqw;
  color: var(--muted);
  padding: 1.4cqw 2.6cqw;
  margin-right: -2.6cqw;
  border-radius: 99px;
  transition: color 0.25s ease, background-color 0.25s ease;
}

@media (hover: hover) {
  .top__skip:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.06);
  }
}

/* three thin lines, the one in progress fills */
.steps {
  position: absolute;
  z-index: 3;
  left: 8cqw;
  right: 8cqw;
  top: 15cqh;
  display: flex;
  gap: 2cqw;
}

.steps__seg {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.steps__seg i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.slot {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
}

.slot--hero {
  left: 20cqw;
  top: 22.5cqh;
  width: 60cqw;
  height: 60cqw;
}

.slot--mini {
  left: calc(8cqw + 5cqw);
  top: calc(22.5cqh + 5cqw);
  width: 13cqw;
  height: 13cqw;
}

.slot--cta,
.next {
  position: absolute;
  left: 8cqw;
  right: 8cqw;
  bottom: 6.2cqh;
  height: 13.5cqw;
}

/* the cards of the second and third screens: frosted glass with an edge that takes the light at the top */
.panel {
  position: absolute;
  z-index: 2;
  left: 8cqw;
  right: 8cqw;
  top: 22.5cqh;
  height: 28cqh;
  padding: 5cqw;
  border-radius: 6cqw;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow:
    inset 0 0 0 1px var(--line),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 18px 36px -20px rgba(0, 0, 0, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
}

.week__head {
  display: flex;
  align-items: center;
  gap: 3.4cqw;
}

.week__ringspace {
  flex: none;
  width: 13cqw;
  height: 13cqw;
}

.week__nums {
  display: grid;
  gap: 0.6cqw;
}

.week__label {
  font-size: 3.2cqw;
  color: var(--muted);
}

.week__total {
  font-size: 6.2cqw;
  font-weight: 640;
  font-variation-settings: 'wdth' 96;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.week__chip {
  margin-left: auto;
  font-size: 3cqw;
  font-weight: 600;
  color: var(--two);
  padding: 1cqw 2.2cqw;
  border-radius: 99px;
  background: color-mix(in srgb, var(--two) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--two) 26%, transparent);
}

.week__chart {
  position: absolute;
  left: 5cqw;
  right: 5cqw;
  bottom: 4cqw;
  top: calc(5cqw + 13cqw + 4cqw);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 5cqw;
}

.week__grid {
  position: absolute;
  inset: 0 0 5cqw;
  background: repeating-linear-gradient(180deg, var(--line) 0 1px, transparent 1px 33.3%);
  opacity: 0.7;
  pointer-events: none;
}

.week__bar {
  position: relative;
  width: 6.4cqw;
  height: calc(var(--v) * 100%);
  border-radius: 1.6cqw 1.6cqw 0.6cqw 0.6cqw;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform-origin: 50% 100%;
}

.week__bar--today {
  background: linear-gradient(180deg, var(--two), color-mix(in srgb, var(--two) 35%, transparent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 16px -2px color-mix(in srgb, var(--two) 60%, transparent);
}

.week__bar b {
  position: absolute;
  left: 50%;
  bottom: -4.6cqw;
  translate: -50% 0;
  font-size: 2.6cqw;
  font-weight: 500;
  color: var(--muted);
}

.block__title {
  margin: 0 0 3cqw;
  font-size: 3.2cqw;
  color: var(--muted);
}

.block__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3cqw;
  padding: 3.4cqw 0;
  font-size: 3.5cqw;
  color: var(--muted);
  box-shadow: inset 0 1px 0 var(--line);
}

.block__row strong {
  font-weight: 560;
  color: var(--ink);
  text-align: right;
}

.toggle {
  position: relative;
  flex: none;
  width: 10.4cqw;
  height: 6.2cqw;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.toggle.is-on {
  background: var(--three);
  box-shadow: 0 0 12px -2px color-mix(in srgb, var(--three) 70%, transparent);
}

.toggle__knob {
  position: absolute;
  left: 0.7cqw;
  top: 0.7cqw;
  width: 4.8cqw;
  height: 4.8cqw;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.copy {
  position: absolute;
  z-index: 2;
  left: 8cqw;
  right: 8cqw;
  top: 61cqh;
}

.panel--block {
  height: auto;
  padding-bottom: 2cqw;
}

.copy__item {
  position: absolute;
  inset: 0 0 auto;
  opacity: 0;
  visibility: hidden;
}

.copy h2 {
  margin: 0;
  font-size: 7.4cqw;
  line-height: 1.08;
  font-weight: 620;
  font-variation-settings: 'wdth' 94;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.copy p {
  margin: 3cqw 0 0;
  font-size: 3.9cqw;
  line-height: 1.4;
  color: var(--muted);
  text-wrap: pretty;
}

.next {
  z-index: 3;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: background-color 0.25s ease;
}

.next__face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.8cqw;
  font-size: 4.2cqw;
  font-weight: 560;
  font-variation-settings: 'wdth' 104;
}

.next svg,
.orb__words svg {
  width: 4.2cqw;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .next:hover {
    background: rgba(255, 255, 255, 0.11);
  }
}

/* the ring: a dark glass face, a thin track and a comet of light that turns along its edge (a conic gradient
   masked to the border). The same pieces make the Start button when the ring opens into a pill */
.orb {
  --a: 0deg;
  position: absolute;
  z-index: 4;
  border-radius: 999px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.orb.is-button {
  pointer-events: auto;
}

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

.orb__aura {
  position: absolute;
  inset: -34%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) calc(30% * var(--glow)), transparent), transparent);
  pointer-events: none;
}

.orb__face,
.orb__fill,
.orb__beam,
.orb__halo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.orb__face {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 60%),
    rgba(12, 12, 17, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 20px 40px -20px rgba(0, 0, 0, 0.9);
}

.orb__fill {
  background:
    radial-gradient(120% 140% at 50% 0%, #ffffff, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, var(--button), color-mix(in srgb, var(--button) 82%, var(--accent)));
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent);
  opacity: 0;
}

.orb__beam,
.orb__halo {
  padding: 1.6px;
  background: conic-gradient(from var(--a), transparent 0deg 200deg, color-mix(in srgb, var(--accent) 60%, transparent) 300deg, var(--accent) 345deg, #ffffff 358deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.orb__halo {
  inset: -3px;
  padding: 5px;
  filter: blur(6px);
  opacity: calc(0.85 * var(--glow));
}

.orb__timer {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1cqw;
  pointer-events: none;
}

/* sixty fine ticks inside the ring, the minutes of the timer */
.orb__timer::before {
  content: '';
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.22) 0deg 0.7deg, transparent 0.7deg 6deg);
  -webkit-mask: radial-gradient(closest-side, transparent 90%, #000 91%, #000 98%, transparent 99%);
  mask: radial-gradient(closest-side, transparent 90%, #000 91%, #000 98%, transparent 99%);
}

.orb__time {
  font-size: 12.5cqw;
  font-weight: 560;
  font-variation-settings: 'wdth' 92;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.orb__sub {
  font-size: 3.3cqw;
  color: var(--muted);
}

.orb__label {
  display: grid;
  place-items: center;
  color: var(--button-ink);
  opacity: 0;
  pointer-events: none;
}

.orb__words {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: 1.8cqw;
  font-size: 4.2cqw;
  font-weight: 620;
  font-variation-settings: 'wdth' 104;
  white-space: nowrap;
}

.orb__words--done {
  opacity: 0;
}

.home-bar {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 1.6cqh;
  width: 34cqw;
  height: 1.3cqw;
  translate: -50% 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.55);
}

/* the reflection on the glass: follows the pointer on a spring */
.sheen {
  --mx: 30%;
  --my: 18%;
  position: absolute;
  inset: calc(var(--h) * 0.014);
  border-radius: calc(var(--h) * 0.066);
  pointer-events: none;
  background:
    radial-gradient(40% 24% at var(--mx) var(--my), rgba(255, 255, 255, 0.07), transparent 70%),
    linear-gradient(118deg, transparent 38%, rgba(255, 255, 255, 0.035) 44%, transparent 52%);
  mix-blend-mode: screen;
}
