/* FitsWise website. Plain CSS, light and dark follow Windows. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f5f5f5;
  --raised: #ffffff;
  --text: #171717;
  --muted: #6b6b6b;
  --faint: #a3a3a3;
  --border: #e7e7e7;
  --dot: rgb(0 0 0 / 9%);
  --ink: #171717; /* buttons and selected controls */
  --on-ink: #ffffff;
  --green: #12b76a;
  --green-text: #0e8a52;
  --stage: radial-gradient(60% 70% at 50% 55%, #e6e8eb, #f3f4f5 75%);
  --shadow: 0 1px 2px rgb(0 0 0 / 5%), 0 12px 32px -12px rgb(0 0 0 / 14%);
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Inter, system-ui, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, Inter, system-ui, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #141414;
    --raised: #171717;
    --text: #ededed;
    --muted: #a1a1a1;
    --faint: #6b6b6b;
    --border: #262626;
    --dot: rgb(255 255 255 / 8%);
    --ink: #ededed;
    --on-ink: #0a0a0a;
    --green-text: #3ad48b;
    --stage: radial-gradient(60% 70% at 50% 55%, #1d1f21, #121212 75%);
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 16px 40px -16px rgb(0 0 0 / 70%);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

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

.wrap {
  width: min(1120px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.narrow {
  width: min(760px, 100% - 2 * var(--gutter));
}

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

.skip:focus {
  z-index: 10;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 8px 14px;
  clip-path: none;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: 999px;
}

.defs {
  position: absolute;
}

.eyebrow {
  margin-bottom: 14px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-text);
}

h2 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

/* ---------- buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font: 600 15px/1 var(--font);
  text-decoration: none;
  transition:
    scale 160ms var(--ease),
    opacity 160ms;
}

.button:hover {
  opacity: 0.88;
}

.button:active {
  scale: 0.96;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button.ghost {
  background: var(--raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

.button.small {
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
}

svg.fill {
  fill: currentColor;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  text-decoration: none;
}

.brand img {
  border-radius: 6px;
}

.nav-links {
  display: flex;
  gap: 2px;
  margin-inline: auto;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
}

.nav-links a {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition:
    color 160ms,
    background 160ms;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--raised);
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--muted);
  transition: color 160ms;
}

.icon-button:hover {
  color: var(--text);
}

.icon-button svg {
  width: 20px;
  fill: currentColor;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 56px;
}

.dither {
  position: absolute;
  inset: auto 0 0;
  width: 100%;
  height: 70%;
  image-rendering: pixelated;
  mask-image: linear-gradient(to bottom, transparent, #000 45%, #000 70%, transparent);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.app-icon {
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 160ms;
}

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

.badge b {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.badge svg {
  width: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: translate 200ms var(--ease);
}

.badge:hover svg {
  translate: 2px 0;
}

h1 {
  margin-top: 22px;
  font-size: clamp(42px, 7.4vw, 84px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.lede {
  max-width: 600px;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 19px);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}

.meta {
  margin-top: 18px;
  color: var(--faint);
  font: 12px/1.5 var(--mono);
}

/* ---------- live preview frame ---------- */
.try {
  position: relative;
  padding-bottom: 96px;
}

.frame {
  overflow: hidden;
  border-radius: 18px;
  background: var(--raised);
  box-shadow:
    inset 0 0 0 1px var(--border),
    var(--shadow);
}

.frame-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  font: 12px/1 var(--mono);
  color: var(--muted);
}

.dots {
  display: flex;
  gap: 7px;
}

.dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border);
}

.frame-hint {
  justify-self: end;
}

.frame-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 500px;
}

.scenes {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 10px;
  list-style: none;
  border-right: 1px solid var(--border);
}

.scenes button {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font: 500 15px/1.2 var(--font);
  text-align: start;
  cursor: pointer;
  transition:
    background 160ms,
    color 160ms;
}

.scenes button:hover {
  color: var(--text);
}

.scenes button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
}

.preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.stage {
  position: relative;
  min-height: 360px;
  background:
    radial-gradient(var(--dot) 1px, transparent 1.4px) 0 0 / 16px 16px,
    var(--stage);
  cursor: grab;
  touch-action: pan-y;
}

.stage:active {
  cursor: grabbing;
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 600ms var(--ease);
}

.stage.live canvas {
  opacity: 1;
}

.stage-poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 400ms;
}

.stage-poster img {
  width: auto;
  height: 72%;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.stage.live .stage-poster {
  opacity: 0;
}

/* the app's own lower card */
.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 28px 20px;
  border-left: 1px solid var(--border);
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.rings {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.ring {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 64px;
}

.ring svg {
  width: 56px;
  height: 56px;
  rotate: -90deg;
}

.ring circle {
  fill: none;
  stroke-width: 4;
}

.ring circle:first-child {
  stroke: color-mix(in srgb, var(--text) 9%, transparent);
}

.ring circle:last-child {
  stroke: var(--text);
  stroke-linecap: round;
  stroke-dasharray: 144.5;
  stroke-dashoffset: calc(144.5 * (1 - var(--p) / 100));
  transition: stroke 400ms;
}

.ring[data-charging] circle:last-child {
  stroke: var(--green);
}

.ring b {
  position: absolute;
  top: 0;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.ring span {
  color: var(--muted);
  font-size: 12px;
}

.ring em {
  position: absolute;
  top: -3px;
  right: 1px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--raised);
  border-radius: 50%;
  background: var(--green);
  scale: 0.5;
  opacity: 0;
  transition:
    scale 220ms var(--ease),
    opacity 220ms;
}

.ring em svg {
  width: 10px;
  height: 10px;
  rotate: 0deg;
  fill: #fff;
}

.ring[data-charging] em {
  scale: 1;
  opacity: 1;
}

/* liquid segments, after devl.dev's: the selection pours from one option to the next */
.segments {
  position: relative;
  display: flex;
  padding: 4px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--border);
  transition: opacity 300ms;
  --i: 0;
}

.segments[data-disabled] {
  opacity: 0.45;
}

.segments button {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--faint);
  cursor: pointer;
  transition: color 250ms;
}

.segments[data-disabled] button {
  cursor: not-allowed;
}

.segments button[aria-checked="true"] {
  color: var(--on-ink);
}

.segments svg {
  width: 22px;
  fill: currentColor;
}

.segments .halo {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.segments .halo.dotted {
  stroke-dasharray: 0.1 2.55;
}

.goo {
  position: absolute;
  inset: 4px;
  filter: url(#goo);
}

.goo i {
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 46px;
  border-radius: 999px;
  background: var(--ink);
  translate: calc(var(--i) * 56px) 0;
}

.goo .lead {
  transition: translate 280ms cubic-bezier(0.3, 1.3, 0.5, 1);
}

.goo .tail {
  scale: 0.8;
  transition: translate 560ms cubic-bezier(0.5, 0, 0.2, 1);
}

.hint {
  min-height: 1.4em;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- features ---------- */
.features {
  padding: 40px 0 96px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 20px;
  margin-top: 44px;
}

.tile .art {
  display: grid;
  place-items: center;
  height: 230px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(var(--dot) 1px, transparent 1.4px) 0 0 / 16px 16px,
    var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.tile h3 {
  margin-top: 16px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tile p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.popup-art {
  height: 196px;
  transition: translate 400ms var(--ease);
}

.popup-art img {
  width: auto;
  height: 100%;
}

.tile:hover .popup-art {
  translate: 0 -4px;
}

.popup-art img {
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.menu {
  display: grid;
  gap: 1px;
  width: 210px;
  padding: 5px;
  border-radius: 10px;
  background: var(--raised);
  box-shadow:
    inset 0 0 0 1px var(--border),
    var(--shadow);
  font-size: 13px;
}

.menu span {
  padding: 6px 10px 6px 28px;
  border-radius: 6px;
}

.menu span:first-child {
  font-weight: 600;
}

.menu .on,
.menu .tick {
  position: relative;
}

.menu .on {
  background: var(--surface);
}

.menu .on::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--text);
}

.menu .tick::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 50%;
  width: 7px;
  height: 4px;
  margin-top: -4px;
  border: solid var(--text);
  border-width: 0 0 1.5px 1.5px;
  rotate: -45deg;
}

.menu hr {
  width: 100%;
  margin: 3px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.keys {
  display: flex;
  gap: 8px;
}

kbd {
  display: grid;
  place-items: center;
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--raised);
  box-shadow:
    inset 0 0 0 1px var(--border),
    inset 0 -3px 0 var(--border),
    0 4px 10px -6px rgb(0 0 0 / 20%);
  font: 500 14px var(--font);
  transition:
    translate 120ms,
    box-shadow 120ms;
}

.tile:hover kbd {
  translate: 0 2px;
  box-shadow:
    inset 0 0 0 1px var(--border),
    inset 0 -1px 0 var(--border);
}

.tile:hover kbd:nth-child(2) {
  transition-delay: 40ms;
}

.tile:hover kbd:nth-child(3) {
  transition-delay: 80ms;
}

.tile:hover kbd:nth-child(4) {
  transition-delay: 120ms;
}

.settings {
  display: grid;
  width: min(280px, 100% - 32px);
  padding: 6px 14px;
  border-radius: 12px;
  background: var(--raised);
  box-shadow:
    inset 0 0 0 1px var(--border),
    var(--shadow);
  font-size: 13px;
}

.settings > * {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.settings > * + * {
  border-top: 1px solid var(--border);
}

.settings b {
  color: var(--muted);
  font-weight: 500;
}

/* liquid switch: the knob stretches as it travels */
.switch {
  flex: none;
  position: relative;
  width: 40px;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 14%, transparent);
  appearance: none;
  cursor: pointer;
  transition: background 250ms;
}

.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 25%);
  transition:
    left 300ms cubic-bezier(0.3, 1.4, 0.5, 1),
    width 160ms var(--ease);
}

.switch:active::before {
  width: 24px;
}

.switch:checked {
  background: var(--green);
}

.switch:checked::before {
  left: calc(100% - 3px - 18px);
}

.switch:checked:active::before {
  left: calc(100% - 3px - 24px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(300px, 100% - 32px);
  padding: 14px;
  border-radius: 12px;
  background: var(--raised);
  box-shadow:
    inset 0 0 0 1px var(--border),
    var(--shadow);
  font-size: 12px;
  transition: translate 400ms var(--ease);
}

.tile:hover .toast {
  translate: 0 -6px;
}

.toast img {
  border-radius: 5px;
}

.toast span {
  display: grid;
  flex: 1;
  color: var(--muted);
}

.toast b {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.toast i {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-style: normal;
  font-weight: 600;
}

.numbers {
  display: grid;
  gap: 10px;
  width: min(240px, 100% - 32px);
  margin: 0;
}

.numbers div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}

.numbers dt {
  color: var(--muted);
  font: 12px var(--mono);
}

.numbers dd {
  margin: 0;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

/* ---------- privacy ---------- */
.privacy {
  padding-bottom: 96px;
}

.note {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 40px;
  padding: 40px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.note ul {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.note li {
  padding-inline-start: 22px;
  position: relative;
}

.note li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.note li b {
  color: var(--text);
  font-weight: 600;
}

/* ---------- faq ---------- */
.faq {
  padding-bottom: 96px;
}

.faq h2 {
  margin-bottom: 28px;
}

details {
  border-bottom: 1px solid var(--border);
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 17px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  background:
    linear-gradient(currentColor, currentColor) center / 12px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 12px no-repeat;
  color: var(--muted);
  transition: rotate 250ms var(--ease);
}

details[open] summary::after {
  rotate: 45deg;
}

details p {
  padding-bottom: 20px;
  color: var(--muted);
}

/* ---------- last call and footer ---------- */
.final {
  padding: 32px 0 112px;
}

.final-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
}

.final .meta {
  margin-top: -8px;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 calc(32px + env(safe-area-inset-bottom));
  color: var(--faint);
  font-size: 13px;
}

.footer-inner {
  display: grid;
  gap: 8px;
}

.footer a {
  color: var(--muted);
}

/* ---------- smaller screens ---------- */
@media (max-width: 980px) {
  .frame-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .scenes {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
  }
  .scenes li {
    flex: none;
  }
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .note {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 28px;
  }
}

@media (max-width: 720px) {
  .nav-links,
  .frame-hint {
    display: none;
  }
  .nav-end {
    margin-inline-start: auto;
  }
  .frame-bar {
    grid-template-columns: auto 1fr;
    gap: 16px;
  }
  .preview {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage {
    min-height: 0;
    aspect-ratio: 1 / 0.85;
  }
  .panel {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 24px 12px;
  }
  .tiles {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero {
    padding-top: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
  }
}
