/* The what's new stories of an app, on a black page. The section (.wn) has the size of the open panel: the ring sits
   in its middle, the panel (.panel) lies over it, clipped by a circle that grows from the ring and shrinks back into
   it. The panel is a size container, so everything inside is measured in cqw and follows its width. The interface
   card (.device) is one element for all four screens: GSAP changes its size and corners from one to the next, and
   the four drawings (.ill) cross inside it. */
:root {
  --page: #000000;            /* the page */
  --panel: #0d0d12;           /* the panel of the stories */
  --surface: #17171e;         /* the interface card */
  --ink: #f3f2f7;             /* the words */
  --muted: rgba(243, 242, 247, 0.56); /* the small words */
  --violet: #8a7dff;          /* the first colour of the ring, focus mode */
  --coral: #ff7a5c;           /* the second, shared lists */
  --amber: #ffc163;           /* the third, the summary */
  --seen: #3b3b44;            /* the ring once seen */
}

* {
  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;
}

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

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 14px;
  overflow: hidden;
}

.wn {
  position: relative;
  height: min(600px, calc(100vh - 28px));
  aspect-ratio: 0.58;
  max-width: calc(100vw - 28px);
}

/* ---------------------------------------------------------------- the ring */
.wn__ringpos {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
}

.ring {
  position: absolute;
  left: -46px;
  top: -46px;
  width: 92px;
  height: 92px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ring:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 6px;
}

.ring__arcs {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring__arcs path {
  fill: none;
  stroke-width: 3.6;
  stroke-linecap: round;
}

.ring__grey path {
  stroke: var(--seen);
}

.ring__live path {
  stroke: url(#wn-ring);
  filter: drop-shadow(0 0 3px rgba(255, 122, 92, 0.35));
}

.ring__icon {
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #1d1d25, #101015);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 10px 24px -10px rgba(0, 0, 0, 0.9);
}

.ring__icon svg {
  width: 46px;
  height: 46px;
}

.ring__label {
  position: absolute;
  left: 0;
  top: 60px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 560;
  font-variation-settings: 'wdth' 104;
}

.ring__word {
  display: inline-block;
}

.ring__count {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #16121f;
  background: linear-gradient(120deg, var(--violet), var(--coral));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ---------------------------------------------------------------- the panel */
.panel {
  position: absolute;
  inset: 0;
  container-type: size;
  border-radius: 28px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  visibility: hidden;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}

.panel__bg {
  position: absolute;
  inset: 0;
  --ga: var(--violet);
  --gb: var(--coral);
}

.glow {
  position: absolute;
  width: 120cqw;
  height: 120cqw;
  border-radius: 50%;
  opacity: 0.5;
  filter: blur(30px);
}

.glow--a {
  left: -46cqw;
  top: -50cqw;
  background: radial-gradient(circle, var(--ga), transparent 62%);
}

.glow--b {
  right: -60cqw;
  top: 18cqh;
  background: radial-gradient(circle, var(--gb), transparent 60%);
  opacity: 0.32;
}

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

.panel__chrome {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: 3.6cqw 4cqw 0;
  z-index: 3;
  pointer-events: none;
}

.panel__bars {
  display: flex;
  gap: 1.2cqw;
}

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

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #ffffff;
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 2.6cqw;
  margin-top: 3.4cqw;
}

.panel__app svg {
  display: block;
  width: clamp(22px, 9cqw, 32px);
  height: clamp(22px, 9cqw, 32px);
}

.panel__who {
  display: grid;
  line-height: 1.15;
  font-size: clamp(11px, 3.9cqw, 14px);
}

.panel__who b {
  font-weight: 640;
}

.panel__who span {
  color: var(--muted);
  font-size: clamp(9.5px, 3.3cqw, 12px);
}

.panel__close {
  margin-left: auto;
  width: clamp(28px, 10cqw, 36px);
  height: clamp(28px, 10cqw, 36px);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  pointer-events: auto;
  cursor: pointer;
  transition: background-color 0.2s;
}

.panel__close svg {
  width: 56%;
  height: 56%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.panel__close:focus-visible,
.cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (hover: hover) {
  .panel__close:hover {
    background: rgba(255, 255, 255, 0.14);
  }
}

.panel__paused {
  position: absolute;
  left: 50%;
  top: calc(3.6cqw + 3px + 3.4cqw + clamp(28px, 10cqw, 36px) + 3cqw);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: clamp(9.5px, 3.2cqw, 12px);
  font-weight: 560;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
}

.panel__paused svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

/* ---------------------------------------------------------------- the interface card */
.device {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 2;
  overflow: hidden;
  background: linear-gradient(170deg, #1d1d26 0%, var(--surface) 46%, #121218 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 24px 50px -18px rgba(0, 0, 0, 0.85),
    0 40px 80px -40px color-mix(in srgb, var(--accent, var(--violet)) 45%, transparent);
}

.device__gloss {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 38%);
  pointer-events: none;
  z-index: 2;
}

.ill {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
}

.box {
  flex: none;
  width: 4.4cqw;
  height: 4.4cqw;
  border-radius: 1.3cqw;
  box-shadow: inset 0 0 0 1.4px rgba(255, 255, 255, 0.22);
}

/* focus mode */
.f {
  width: 64cqw;
  display: grid;
  gap: 3.4cqw;
}

.f__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.f__label {
  font-size: 3.9cqw;
  font-weight: 620;
}

.tg {
  position: relative;
  width: 10.4cqw;
  height: 6cqw;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.tg i {
  position: absolute;
  left: 0.7cqw;
  top: 0.7cqw;
  width: 4.6cqw;
  height: 4.6cqw;
  border-radius: 50%;
  background: linear-gradient(#ffffff, #dcdce4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.f__rows {
  display: grid;
  gap: 2cqw;
}

.f__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2.6cqw;
  height: 9.4cqw;
  padding: 0 3cqw;
  border-radius: 2.6cqw;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.f__row--on {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.ln {
  height: 1.7cqw;
  width: var(--w);
  max-width: 36cqw;
  border-radius: 1cqw;
  background: rgba(255, 255, 255, 0.24);
}

.f__tag {
  margin-left: auto;
  padding: 0.7cqw 2cqw;
  border-radius: 999px;
  font-size: 2.9cqw;
  font-weight: 600;
  color: #15121f;
  background: var(--violet);
  opacity: 0;
}

.f__timer {
  display: flex;
  align-items: center;
  gap: 2.8cqw;
}

.f__timer svg {
  width: 11cqw;
  height: 11cqw;
  transform: rotate(-90deg);
}

.f__timer circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 3.4;
}

.f__timer .f__arc {
  stroke: var(--violet);
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.f__timer span {
  display: grid;
  line-height: 1.1;
}

.f__timer b {
  font-size: 4.6cqw;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

.f__timer small {
  font-size: 2.9cqw;
  color: var(--muted);
}

/* shared lists */
.s {
  position: relative;
  width: 56cqw;
  display: grid;
  gap: 3.6cqw;
}

.s__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.s__title {
  font-size: 3.9cqw;
  font-weight: 620;
}

.s__avs {
  display: flex;
}

.av {
  display: grid;
  place-items: center;
  width: 6.6cqw;
  height: 6.6cqw;
  margin-left: -1.1cqw;
  border-radius: 50%;
  font-size: 2.3cqw;
  font-weight: 700;
  color: #17131c;
  box-shadow: 0 0 0 0.8cqw var(--surface);
}

.av--a {
  background: linear-gradient(140deg, #ffd3a0, var(--amber));
}

.av--b {
  background: linear-gradient(140deg, #ffb4a2, var(--coral));
}

.av--c {
  background: linear-gradient(140deg, #c9c2ff, var(--violet));
}

.s__rows {
  display: grid;
  gap: 2cqw;
}

.s__row {
  display: flex;
  align-items: center;
  gap: 2.6cqw;
  height: 8.6cqw;
  padding: 0 3cqw;
  border-radius: 2.6cqw;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.s__row .box {
  display: grid;
  place-items: center;
}

.s__row .box svg {
  width: 80%;
  height: 80%;
  fill: none;
  stroke: #17131c;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.s__txt {
  position: relative;
  font-size: 3.3cqw;
  font-weight: 500;
}

.s__txt i {
  position: absolute;
  left: -1%;
  right: -1%;
  top: 55%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.s__cursor {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.4cqw;
  pointer-events: none;
}

.s__cursor svg {
  width: 3.4cqw;
  height: 3.9cqw;
  fill: var(--coral);
  stroke: #ffffff;
  stroke-width: 1;
  stroke-linejoin: round;
}

.s__cursor b {
  margin-top: 2.4cqw;
  padding: 0.5cqw 1.6cqw;
  border-radius: 999px;
  font-size: 2.6cqw;
  font-weight: 650;
  color: #1a0f0b;
  background: var(--coral);
}

/* smart summary */
.m {
  position: relative;
  width: 70cqw;
  height: 40cqw;
}

.m__notes,
.m__sum {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2.4cqw;
}

.m__notes {
  overflow: hidden;
  border-radius: 2cqw;
}

.m__meta {
  font-size: 3cqw;
  color: var(--muted);
  font-weight: 540;
}

.m__ln {
  display: block;
  width: var(--w);
  height: 1.8cqw;
  border-radius: 1cqw;
  background: rgba(255, 255, 255, 0.18);
  transform-origin: 0 50%;
}

.m__sheen {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 26cqw;
  background: linear-gradient(100deg, transparent, rgba(255, 193, 99, 0.5), transparent);
  mix-blend-mode: screen;
  transform: translateX(-30cqw) skewX(-14deg);
}

.m__sum {
  gap: 2.2cqw;
  opacity: 0;
}

.m__star {
  display: flex;
  align-items: center;
  gap: 1.4cqw;
  font-size: 3.4cqw;
  font-weight: 640;
  color: var(--amber);
}

.m__star svg {
  width: 4.4cqw;
  height: 4.4cqw;
  fill: var(--amber);
  filter: drop-shadow(0 0 4px rgba(255, 193, 99, 0.6));
}

.m__line {
  font-size: 4.6cqw;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variation-settings: 'wdth' 96;
}

.m__chips {
  display: flex;
  gap: 1.6cqw;
  margin-top: 1cqw;
}

.m__chips b {
  padding: 1cqw 2.4cqw;
  border-radius: 999px;
  font-size: 2.8cqw;
  font-weight: 600;
  background: rgba(255, 193, 99, 0.12);
  color: var(--amber);
  box-shadow: inset 0 0 0 1px rgba(255, 193, 99, 0.28);
}

/* widgets */
.w {
  width: 66cqw;
  height: 56cqw;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2.4cqw;
}

.w__tile {
  position: relative;
  border-radius: 3.4cqw;
  padding: 2.8cqw;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.w__tile small {
  font-size: 2.7cqw;
  color: var(--muted);
  font-weight: 540;
}

.w__bars {
  display: flex;
  align-items: flex-end;
  gap: 1.1cqw;
  height: 13cqw;
}

.w__bars i {
  flex: 1;
  height: var(--h);
  border-radius: 0.8cqw;
  background: linear-gradient(to top, var(--violet), var(--coral));
  transform-origin: 50% 100%;
}

.w__tile--goal {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 1.6cqw;
}

.w__tile--goal svg {
  width: 11cqw;
  height: 11cqw;
  flex: none;
  transform: rotate(-90deg);
}

.w__tile--goal circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 4;
}

.w__tile--goal .w__arc {
  stroke: var(--coral);
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.w__tile--goal span {
  display: grid;
  line-height: 1.1;
}

.w__tile b {
  font-size: 4.4cqw;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.w__tile--done b {
  font-size: 9cqw;
  line-height: 1;
  font-weight: 680;
  font-variation-settings: 'wdth' 92;
  background: linear-gradient(120deg, #ffffff, var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.w__sq {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.8cqw;
}

.w__sq i {
  aspect-ratio: 1;
  border-radius: 0.8cqw;
  background: rgba(255, 255, 255, 0.1);
}

/* ---------------------------------------------------------------- the words and the button */
.copy {
  position: absolute;
  left: 7cqw;
  right: 7cqw;
  bottom: calc(9cqh + clamp(30px, 11cqw, 42px));
  z-index: 2;
  pointer-events: none;
}

.copy__kicker {
  margin: 0 0 1.6cqw;
  font-size: clamp(10px, 3.4cqw, 12.5px);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--kick, var(--violet));
}

.copy__title {
  margin: 0;
  font-size: clamp(19px, 8.4cqw, 31px);
  line-height: 1.02;
  font-weight: 660;
  letter-spacing: -0.025em;
  font-variation-settings: 'wdth' 94;
}

.copy__note {
  margin: 2.2cqw 0 0;
  font-size: clamp(11px, 3.8cqw, 14px);
  line-height: 1.35;
  color: var(--muted);
  max-width: 30em;
}

.copy__kicker,
.copy__title,
.copy__note {
  will-change: transform;
}

.cta {
  position: absolute;
  left: 7cqw;
  right: 7cqw;
  bottom: 6cqh;
  z-index: 4;
  height: clamp(30px, 11cqw, 42px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: #121016;
  font: inherit;
  font-size: clamp(12px, 4cqw, 15px);
  font-weight: 620;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
}

.cta__bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #ffffff, #e7e5ee);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 10px 26px -10px rgba(138, 125, 255, 0.7);
}

.cta__txt {
  position: relative;
  display: inline-block;
  font-variation-settings: 'wdth' 100;
  transition: font-variation-settings 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@media (hover: hover) {
  .cta:hover .cta__txt {
    font-variation-settings: 'wdth' 118;
  }
}

/* the arrows that show where a tap goes, only with a mouse */
.hint {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: clamp(24px, 8cqw, 30px);
  height: clamp(24px, 8cqw, 30px);
  margin-top: -15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.hint svg {
  width: 60%;
  height: 60%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hint--l {
  left: 2.4cqw;
}

.hint--r {
  right: 2.4cqw;
}

@media (hover: hover) {
  .panel[data-side='l'] .hint--l,
  .panel[data-side='r'] .hint--r {
    opacity: 0.8;
  }

  .panel[data-side='l'] .hint--l {
    transform: translateX(-2px);
  }

  .panel[data-side='r'] .hint--r {
    transform: translateX(2px);
  }
}
