/* Tonalia website. Colours, type and radii come from tokens.css (a copy of the app's
   app/src/styles/tokens.css, kept identical by web.test.ts): DESIGN.md is the source. */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--color-border-strong) var(--color-bg);
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

main {
  overflow-x: clip;
}

::selection {
  background: var(--color-row-selected);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

a {
  color: var(--color-primary-ink);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

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

.sprite {
  position: absolute;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wrap,
.top-inner,
.foot-inner,
main > section {
  width: min(1200px, 100% - 32px);
  margin-inline: auto;
}

/* ---- Header ---- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--color-bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--color-border);
}

.top-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.logo {
  width: 30px;
  height: 30px;
  overflow: visible;
}

.top-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.top-nav a {
  color: var(--color-text-2);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--duration-hover) var(--ease-out), background var(--duration-hover) var(--ease-out);
}

.top-nav a:hover {
  color: var(--color-text);
  background: var(--color-surface-2);
}

.lang {
  display: inline-flex;
  padding: 2px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 7px;
}

.lang button {
  font: 500 12px/1 var(--font-mono);
  font-stretch: var(--font-mono-stretch);
  color: var(--color-text-3);
  background: transparent;
  border: 0;
  border-radius: 5px;
  padding: 7px 9px;
  cursor: pointer;
  transition: color var(--duration-hover) var(--ease-out), background var(--duration-hover) var(--ease-out);
}

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

.top-download {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background var(--duration-hover) var(--ease-out);
}

.top-download:hover {
  background: var(--color-primary-hover);
}

/* ---- Hero ---- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 48px;
  min-height: min(calc(100svh - 64px), 860px);
  padding-block: 48px 64px;
}

.hero::before {
  /* the welcome screen's halo, behind the wheel */
  content: "";
  position: absolute;
  inset: 0 -20% 0 35%;
  background: radial-gradient(closest-side, var(--color-primary-soft), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero h1 {
  font-size: clamp(48px, 7.4vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.022em;
  font-variation-settings: "opsz" 96;
}

.lead {
  margin-top: 24px;
  max-width: 34em;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.55;
  color: var(--color-text-2);
}

.download {
  margin-top: 40px;
}

.dl-primary {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 12px 28px 12px 22px;
  border-radius: var(--radius-pill);
  background: var(--gradient-aurora);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-overlay);
  transition: opacity var(--duration-hover) var(--ease-out), transform var(--duration-hover) var(--ease-out);
}

.dl-primary:hover {
  opacity: 0.9;
}

.dl-primary:active {
  transform: translateY(1px);
}

.dl-primary .icon {
  width: 26px;
  height: 26px;
  stroke-width: 1.75;
}

.dl-text {
  display: grid;
  line-height: 1.25;
}

.dl-label {
  font-weight: 600;
  font-size: 18px;
}

.dl-meta {
  font-size: 13px;
  color: rgb(255 255 255 / 0.82);
}

.dl-others {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  margin-top: 18px;
  font-size: 15px;
}

.dl-others a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dl-others .icon {
  width: 18px;
  height: 18px;
}

.dl-free {
  margin-top: 14px;
  font-size: 14px;
  color: var(--color-text-3);
}

/* Wheel */

.hero-wheel {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  grid-template-areas: "wheel readout" "caption caption";
  align-items: center;
  gap: 20px 28px;
}

.wheel-wrap {
  grid-area: wheel;
  width: 100%;
  max-width: 470px;
  justify-self: end;
}

.wheel {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.seg {
  cursor: pointer;
  outline: none;
}

.seg path {
  fill: var(--seg);
  fill-opacity: var(--wheel-dimmed);
  stroke: transparent;
  stroke-width: 2.5;
  transition: fill-opacity var(--duration-panel) var(--ease-out), stroke var(--duration-panel) var(--ease-out);
}

.seg text {
  font: 600 13px var(--font-mono);
  font-stretch: var(--font-mono-stretch);
  fill: var(--color-text);
  opacity: 0.45;
  pointer-events: none;
  transition: opacity var(--duration-panel) var(--ease-out), fill var(--duration-panel) var(--ease-out);
}

.seg[data-tone="compatible"] path {
  fill-opacity: var(--wheel-compatible);
}

.seg[data-tone="weak"] path {
  fill-opacity: var(--wheel-weak);
}

.seg[data-tone="current"] path {
  fill-opacity: 1;
  stroke: var(--color-text);
}

.seg[data-tone="compatible"] text,
.seg[data-tone="current"] text {
  fill: var(--color-on-key);
  opacity: 1;
}

.seg[data-tone="weak"] text {
  opacity: 0.85;
}

.seg:hover path {
  stroke: var(--color-border-strong);
}

.seg[data-tone="current"]:hover path {
  stroke: var(--color-text);
}

.seg:focus-visible path {
  stroke: var(--color-primary);
}

.hub circle {
  fill: var(--color-surface-1);
  stroke: var(--color-border);
}

.hub-key {
  font: 600 34px var(--font-mono);
  font-stretch: var(--font-mono-stretch);
  fill: var(--color-text);
}

.hub-name {
  font: 500 13px var(--font-sans);
  fill: var(--color-text-2);
}

.readout {
  grid-area: readout;
  align-self: center;
}

.readout-head,
.readout-hint {
  font-size: 14px;
  color: var(--color-text-2);
  margin-bottom: 12px;
}

.readout-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.readout-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--color-text);
}

.readout-list li.weak {
  color: var(--color-text-2);
}

.chip {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--chip) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip) 60%, transparent);
  color: color-mix(in srgb, var(--chip) var(--key-text-mix), var(--key-text-base));
  font: 600 13px var(--font-mono);
  font-stretch: var(--font-mono-stretch);
  font-variant-numeric: tabular-nums slashed-zero;
}

.weak .chip {
  border-style: dashed;
}

.hero-wheel figcaption {
  grid-area: caption;
  max-width: 44em;
  justify-self: end;
  font-size: 14px;
  color: var(--color-text-3);
  text-align: right;
}

/* The one authored moment: the wheel lights up like a booth's LEDs, segment by segment. */
@media (prefers-reduced-motion: no-preference) {
  .wheel .seg {
    animation: led-on 700ms var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 28ms + 150ms);
  }

  @keyframes led-on {
    from {
      opacity: 0;
      filter: brightness(2.2) saturate(0.4);
    }
    to {
      opacity: 1;
      filter: none;
    }
  }
}

/* ---- Features ---- */

.features {
  padding-block: 96px 64px;
  border-top: 1px solid var(--color-border);
}

.features > h2,
.privacy > h2,
.install > h2,
.community > h2 {
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -0.025em;
  max-width: 18em;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  align-items: center;
  gap: 56px;
  margin-top: 88px;
}

.feature-flip {
  grid-template-columns: minmax(0, 8fr) minmax(0, 5fr);
}

.feature-flip .feature-copy {
  order: 2;
}

.feature h3 {
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -0.02em;
}

.feature-copy p {
  margin-top: 16px;
  color: var(--color-text-2);
  max-width: 34em;
}

.points {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 15px;
}

.points li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  align-items: baseline;
}

.points li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateY(-1px);
  background: var(--color-primary-ink);
}

.feature:nth-of-type(1) .points li:nth-child(1)::before { background: var(--color-key-8b); }
.feature:nth-of-type(1) .points li:nth-child(2)::before { background: var(--color-cue-2); }
.feature:nth-of-type(1) .points li:nth-child(3)::before { background: var(--color-warning); }
.feature:nth-of-type(2) .points li:nth-child(1)::before { background: var(--color-cue-1); }
.feature:nth-of-type(2) .points li:nth-child(2)::before { background: var(--color-cue-3); }
.feature:nth-of-type(2) .points li:nth-child(3)::before { background: var(--color-cue-4); }
.feature:nth-of-type(3) .points li:nth-child(1)::before { background: var(--color-deck-a); }
.feature:nth-of-type(3) .points li:nth-child(2)::before { background: var(--color-stem-vocals); }
.feature:nth-of-type(3) .points li:nth-child(3)::before { background: var(--color-deck-b); }

.shot {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface-1);
  overflow: hidden;
  box-shadow: var(--shadow-overlay);
}

.shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
}

.shots-note {
  margin-top: 20px;
  text-align: right;
  font-size: 13px;
  color: var(--color-text-3);
}

.more {
  margin-top: 112px;
}

.more h3 {
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -0.02em;
}

.more-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px;
  margin: 32px 0 0;
}

.more-list > div {
  padding-block: 24px;
  border-top: 1px solid var(--color-border);
}

.more-list dt {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 17px;
}

.more-list dt .icon {
  color: var(--color-primary-ink);
}

.more-list dd {
  margin: 8px 0 0 32px;
  color: var(--color-text-2);
  font-size: 15px;
  max-width: 36em;
}

/* ---- Privacy ---- */

.privacy {
  padding-block: 96px;
  border-top: 1px solid var(--color-border);
}

.privacy-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px;
  margin-top: 48px;
}

.privacy-list .icon {
  width: 28px;
  height: 28px;
  color: var(--color-primary-ink);
}

.privacy-list h3 {
  margin-top: 16px;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.privacy-list p {
  margin-top: 10px;
  color: var(--color-text-2);
  font-size: 15px;
}

/* ---- Install ---- */

.install {
  padding-block: 96px;
  border-top: 1px solid var(--color-border);
}

.install-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 48px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-1);
}

.install-grid.windows-first [data-os="windows"] {
  order: -1;
}

.install-os {
  padding: 32px;
}

.install-os + .install-os {
  border-left: 1px solid var(--color-border);
}

.install-grid.windows-first .install-os + .install-os {
  border-left: 0;
}

.install-grid.windows-first [data-os="windows"] {
  border-right: 1px solid var(--color-border);
}

.install-os h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
}

.install-os h3 .icon {
  width: 24px;
  height: 24px;
  color: var(--color-text-2);
}

.install-os ol {
  list-style: none;
  counter-reset: step;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.install-os li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  font-size: 15px;
}

.install-os li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
  font: 500 12px var(--font-mono);
  font-stretch: var(--font-mono-stretch);
  color: var(--color-text-2);
}

.req {
  margin-top: 24px;
  font-size: 14px;
  color: var(--color-text-3);
}

.install-note {
  margin-top: 20px;
  font-size: 15px;
  color: var(--color-text-2);
}

/* ---- Community ---- */

.community {
  padding-block: 96px 112px;
  border-top: 1px solid var(--color-border);
}

.community > p {
  margin-top: 20px;
  max-width: 40em;
  font-size: 18px;
  color: var(--color-text-2);
}

.community-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.community-links a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-3);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: border-color var(--duration-hover) var(--ease-out);
}

.community-links a:hover {
  border-color: var(--color-border-strong);
}

/* ---- Footer ---- */

.foot {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-1);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 28px;
  font-size: 14px;
  color: var(--color-text-3);
}

.foot .logo {
  width: 24px;
  height: 24px;
}

.foot .brand {
  font-size: 17px;
}

/* ---- Narrow screens ---- */

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 56px;
    padding-block: 40px 72px;
  }

  .hero::before {
    inset: 30% -30% 0 -30%;
  }

  .hero-wheel {
    grid-template-columns: minmax(0, 1fr) 200px;
  }

  .wheel-wrap {
    justify-self: center;
  }

  .feature,
  .feature-flip {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-top: 72px;
  }

  .feature-flip .feature-copy {
    order: 0;
  }

  .privacy-list {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 720px) {
  .top-nav {
    display: none;
  }

  .lang {
    margin-left: auto;
  }

  .top-inner {
    gap: 12px;
  }

  .hero h1 {
    font-size: clamp(44px, 13vw, 64px);
  }

  .dl-primary {
    width: 100%;
    justify-content: center;
  }

  .hero-wheel {
    grid-template-columns: 1fr;
    grid-template-areas: "wheel" "readout" "caption";
  }

  .readout-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-wheel figcaption {
    text-align: left;
    justify-self: start;
  }

  .features,
  .privacy,
  .install,
  .community {
    padding-block: 72px;
  }

  .more-list {
    grid-template-columns: 1fr;
  }

  .install-grid {
    grid-template-columns: 1fr;
  }

  .install-os + .install-os,
  .install-grid.windows-first [data-os="windows"] {
    border-left: 0;
    border-right: 0;
  }

  .install-os + .install-os {
    border-top: 1px solid var(--color-border);
  }

  .install-os {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation: none !important;
  }
}
