/*
 * feyrn site: the app's «Бумага» look, dark print. Light ink on black, one family (Geist), colour only
 * from the covers. Shape rule from the app: what you press is a pill or a circle, covers are 2px.
 * Groups are split by a rule of ink and by space, never by cards.
 */
@font-face { font-family: 'Geist'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('fonts/geist-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geist'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('fonts/geist-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('fonts/geist-mono-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('fonts/geist-mono-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  color-scheme: dark;
  /* The app's dark theme (app/src/renderer/src/styles.css). */
  --bg: #000;
  --ink: #ecebe6;
  --dim: #b9b7b0;
  --faint: #8f8c85;
  --line: rgb(236 235 230 / 0.14);
  --raised: rgb(236 235 230 / 0.07);
  --hover: rgb(236 235 230 / 0.11);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --edge: clamp(20px, 3.1vw, 48px);
  --page: 1280px;
  --nav-h: 72px;
  --sans: 'Geist', 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
a { color: inherit; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 999px; }

.skip { position: absolute; left: var(--edge); top: -60px; z-index: 30; padding: 8px 14px; background: var(--ink); color: var(--bg); border-radius: 999px; text-decoration: none; }
.skip:focus { top: 12px; }

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

/* ---------- Navigation: the app's top bar, transparent over the glow ---------- */
.nav {
  position: sticky; top: 0; z-index: 20; height: var(--nav-h);
  display: flex; align-items: center; gap: 28px;
  max-width: calc(var(--page) + 2 * var(--edge)); margin: 0 auto; padding: 0 var(--edge);
}
.nav::before { /* fades in once the page scrolls under it (body.scrolled, set by an observer) */
  content: ''; position: fixed; inset: 0 0 auto; height: var(--nav-h); z-index: -1;
  background: rgb(0 0 0 / 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); opacity: 0; transition: opacity .3s var(--ease);
}
body.scrolled .nav::before { opacity: 1; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.mark { width: 34px; height: 34px; fill: currentColor; flex: none; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--dim); font-size: 15px; transition: color .2s, background-color .2s; }
.nav-links a:hover { color: var(--ink); background: var(--raised); }

/* ---------- Pills ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; white-space: nowrap;
  height: 52px; padding: 0 24px; border-radius: 999px; text-decoration: none;
  font: 500 16px/1 var(--sans); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .25s var(--ease), background-color .2s, box-shadow .2s;
}
button.pill { border: 0; background: none; cursor: pointer; }
.pill:hover { background: var(--raised); box-shadow: inset 0 0 0 1px rgb(236 235 230 / 0.28); }
.pill:active { transform: scale(0.98); }
.pill-ink { background: var(--ink); color: var(--bg); box-shadow: none; }
.pill-ink:hover { background: #fff; box-shadow: none; }
.pill-sm { height: 40px; padding: 0 18px; font-size: 15px; gap: 8px; }
.pill-sm .icon { width: 16px; height: 16px; }

/* ---------- Hero: the app's home screen, a big title beside a glowing cover ---------- */
.hero {
  --cover: clamp(240px, 31vw, 440px);
  position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 40px;
  max-width: calc(var(--page) + 2 * var(--edge)); margin: 0 auto; padding: 24px var(--edge) 72px;
  min-height: min(calc(100dvh - var(--nav-h)), 880px);
}
.hero-copy { position: relative; z-index: 2; }
.display {
  margin: 0; font-weight: 500; font-size: clamp(40px, 5.6vw, 88px); line-height: 1; letter-spacing: -0.045em;
}
.display span { display: block; white-space: nowrap; }
.dim { color: var(--faint); }
.lead { margin: 28px 0 0; max-width: 30ch; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.45; color: var(--dim); text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.stage { position: relative; display: grid; place-items: center; height: calc(var(--cover) * 1.5); }
/* Same proportions as `.cover-glow` in the app: 3.4 cover sides tall, 4:3. */
.glow {
  position: absolute; left: 50%; top: 50%; z-index: 0; pointer-events: none;
  height: calc(var(--cover) * 3.4); aspect-ratio: 4 / 3; transform: translate(-50%, -50%);
  filter: saturate(1.1);
}
.cover {
  position: relative; z-index: 1; width: var(--cover); aspect-ratio: 1; border-radius: 2px; overflow: hidden;
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.55);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 1.2s var(--ease); }
.cover img + img { opacity: 0; }
.cover img.on { opacity: 1; }
/* What «plays»: the title and the artist under the cover, as on the app's listening screen. */
.now {
  position: absolute; z-index: 1; left: 50%; top: calc(50% + var(--cover) / 2 + 22px); width: max(var(--cover), 280px);
  margin: 0; transform: translateX(-50%); text-align: center; transition: opacity .6s var(--ease);
}
.now.out { opacity: 0; }
.now b, .now span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now b { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.now span { margin-top: 3px; font-size: 14px; color: var(--dim); }

/* ---------- Together: two people on one line, like the room screen ---------- */
.together {
  max-width: calc(var(--page) + 2 * var(--edge)); margin: 0 auto; padding: 0 var(--edge) 140px;
}
.together::before { content: ''; display: block; height: 1px; margin-bottom: 120px; background: var(--line); }
.h2 { margin: 0; font-weight: 500; font-size: clamp(38px, 4.6vw, 68px); line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance; }
.body { margin: 20px 0 0; max-width: 46ch; font-size: 18px; color: var(--dim); text-wrap: pretty; }

.pair {
  display: grid; grid-template-columns: auto minmax(120px, 1fr) auto; align-items: center; gap: 28px;
  margin: 88px 0 0;
}
.person { display: flex; align-items: center; gap: 16px; }
.person-right { text-align: right; }
.avatar {
  display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; flex: none;
  font-weight: 600; font-size: 30px; color: var(--dim);
  background: linear-gradient(140deg, var(--hover), var(--raised)); box-shadow: inset 0 0 0 1px var(--line);
}
.who b { display: block; font-weight: 600; font-size: 19px; }
.who small { font-size: 14px; color: var(--faint); }
.who small::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #4fb477; vertical-align: 1px; }
.person-right .who small::before { display: none; }
.person-right .who small::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: #4fb477; vertical-align: 1px; }

.link { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.mark-small { width: 46px; height: 46px; padding: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); box-sizing: content-box; }
.wire { position: relative; height: 1px; background: var(--line); overflow: hidden; }
/* A pulse runs from the edges into the middle: both people hear the same beat. */
.wire i { position: absolute; top: 0; left: 0; width: 34%; height: 1px; background: linear-gradient(90deg, transparent, var(--ink), transparent); transform: translateX(-100%); }
.wire + svg + .wire i { left: auto; right: 0; transform: translateX(100%); }

.together-foot {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 48px; align-items: end;
  margin-top: 96px; padding-top: 32px; border-top: 1px solid var(--line);
}
.code-label { display: block; font-size: 14px; color: var(--faint); }
.code-value { display: block; margin-top: 8px; font: 500 clamp(40px, 5.4vw, 76px)/1 var(--mono); letter-spacing: 0.04em; }
.perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.perks li { color: var(--dim); font-size: 17px; max-width: 52ch; }
.perks b { color: var(--ink); font-weight: 600; }

/* ---------- Features: real screens behind three pill tabs, then two groups of plain lines ---------- */
.features, .sources, .install, .foot { max-width: calc(var(--page) + 2 * var(--edge)); margin: 0 auto; padding: 0 var(--edge) 140px; }
.features::before, .sources::before, .install::before { content: ''; display: block; height: 1px; margin-bottom: 120px; background: var(--line); }
.tabs { display: inline-flex; gap: 4px; margin-top: 48px; padding: 4px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.tabs button {
  height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: none; color: var(--dim);
  font: 500 15px/1 var(--sans); cursor: pointer; transition: background-color .2s, color .2s;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected='true'] { background: var(--ink); color: var(--bg); }
/* A screen of the app, framed like its window: 8px, the way Windows 11 rounds it. */
.window { margin: 28px 0 0; }
.window a { display: block; border-radius: 8px; }
.window img {
  display: block; width: 100%; height: auto; border-radius: 8px; background: #050505;
  box-shadow: 0 0 0 1px var(--line), 0 40px 120px rgb(0 0 0 / 0.6);
  transition: opacity .35s var(--ease);
}
.window img.swap { opacity: 0; }
.window figcaption { margin-top: 18px; color: var(--faint); font-size: 15px; max-width: 60ch; }
.groups { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 88px; }
.groups h3, .steps h3 { margin: 0 0 14px; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.groups ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.groups li { color: var(--dim); font-size: 17px; padding-left: 20px; position: relative; }
.groups li::before { content: ''; position: absolute; left: 0; top: 0.78em; width: 8px; height: 1px; background: var(--faint); }

/* ---------- Sources: the names are the design, one per line ---------- */
.source-list { margin: 56px 0 0; }
.source-list div { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: baseline; gap: 32px; padding: 22px 0; }
.source-list div + div { border-top: 1px solid var(--line); }
.source-list dt { font-size: clamp(26px, 2.8vw, 40px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.05; }
.source-list dd { margin: 0; color: var(--dim); font-size: 17px; }
.sources .body { margin-top: 40px; color: var(--faint); font-size: 16px; }

/* ---------- Install: the button on the left, what happens next on the right ---------- */
.install { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 0 64px; }
.install::before { grid-column: 1 / -1; }
.install-get .pill { margin-top: 36px; }
.meta { margin: 16px 0 0; color: var(--faint); font-size: 14px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 32px 64px; }
.steps li + li { padding-top: 32px; border-top: 1px solid var(--line); }
.steps li::before {
  content: counter(step); position: absolute; left: 0; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line);
  font: 500 15px/1 var(--mono); color: var(--dim);
}
.steps li + li::before { top: 32px; }
.steps p { margin: 0; color: var(--dim); font-size: 17px; max-width: 52ch; }

/* ---------- Footer ---------- */
.foot { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 32px; padding-bottom: 48px;
  background: linear-gradient(var(--line), var(--line)) no-repeat center top / calc(100% - 2 * var(--edge)) 1px; }
.foot .mark { width: 26px; height: 26px; }
.foot .brand { font-size: 16px; }
.foot p { margin: 0; color: var(--faint); font-size: 14px; text-align: right; }

/* ---------- Join page: one invitation, the code, two ways in ---------- */
.nav-end { margin-left: auto; }
.join { max-width: calc(var(--page) + 2 * var(--edge)); margin: 0 auto; padding: 72px var(--edge) 120px; }
.join-title { font-size: clamp(40px, 6vw, 92px); }
.join-code { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 32px; margin-top: 64px; }
.join-code .code-label { flex-basis: 100%; }
.join-code .code-value { margin: 0; }
.join .body { margin-top: 40px; }
.join-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 88px; padding-top: 32px; border-top: 1px solid var(--line); }
.join-ways h2 { margin: 0 0 12px; font-size: 19px; font-weight: 600; }
.join-ways p { margin: 0; color: var(--dim); font-size: 17px; max-width: 44ch; }
.join-ways .pill { margin-top: 28px; }
.join-ways .meta { margin-top: 16px; font-size: 14px; color: var(--faint); }
@media (max-width: 900px) {
  .join { padding-top: 40px; }
  .join-title span { white-space: normal; }
  .join-ways { grid-template-columns: 1fr; gap: 40px; margin-top: 56px; }
}

/* ---------- Motion: things arrive once; nothing loops but the glow and the wire ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise .9s var(--ease) both; }
  .hero-copy > :nth-child(2) { animation-delay: .08s; }
  .hero-copy > :nth-child(3) { animation-delay: .16s; }
  .stage { animation: fade 1.4s var(--ease) .1s both; }
  .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .reveal.in { opacity: 1; transform: none; }
  .pair.in .wire i { animation: wire 2.5s cubic-bezier(.45, 0, .2, 1) infinite; }
  .pair.in .wire + svg + .wire i { animation-name: wire-back; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes wire { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(300%); } }
@keyframes wire-back { 0% { transform: translateX(100%); } 60%, 100% { transform: translateX(-300%); } }

/* ---------- Narrow screens: one column, cover first ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav .pill-sm { margin-left: auto; }
  .hero { grid-template-columns: 1fr; gap: 8px; padding-top: 8px; min-height: 0; --cover: min(64vw, 340px); }
  /* Room under the cover for the song's title and artist before the heading. */
  .stage { order: -1; margin-bottom: 48px; }
  .lead { max-width: 34ch; }
  .together { padding-bottom: 96px; }
  .together::before { margin-bottom: 88px; }
  .display { font-size: min(10.2vw, 64px); }
  .pair { grid-template-columns: 1fr; justify-items: start; gap: 20px; margin-top: 56px; }
  .person-right { justify-self: end; }
  .link { width: 100%; }
  .together-foot { grid-template-columns: 1fr; gap: 36px; margin-top: 56px; }
  .features, .sources, .install { padding-bottom: 96px; }
  .features::before, .sources::before, .install::before { margin-bottom: 88px; }
  .tabs { display: flex; width: 100%; overflow-x: auto; }
  .tabs button { flex: 1 0 auto; }
  .groups { grid-template-columns: 1fr; gap: 40px; margin-top: 56px; }
  .source-list div { grid-template-columns: 1fr; gap: 6px; }
  .install { grid-template-columns: 1fr; gap: 48px; }
  .foot { flex-direction: column; align-items: flex-start; }
  .foot p { text-align: left; }
}
@media (max-width: 480px) {
  .actions .pill { width: 100%; }
  .avatar { width: 60px; height: 60px; font-size: 24px; }
}
