@font-face { font-family: Manrope; src: url('../fonts/manrope-400.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Manrope; src: url('../fonts/manrope-600.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: Manrope; src: url('../fonts/manrope-800.ttf') format('truetype'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Material Symbols Rounded'; src: url('../fonts/material-symbols.ttf') format('truetype'); font-weight: 400; font-display: block; }

/* цвета */

:root {
  color-scheme: light;
  --page: #f4f0e9;
  --ink: #302c27;
  --muted: #797169;
  --primary: #e5c2a3;
  --primary-ink: #51341e;
  --secondary: #e7e2d9;
  --tertiary: #dce4d6;
  --button: #fbf6ee;
  --line: #d4ba9f;
  --focus: #865331;
  --snack: #342e27;
  --snack-ink: #fff4e8;
  --shadow: rgba(72, 46, 25, .09);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #191714;
  --ink: #eee1d3;
  --muted: #b7a99a;
  --primary: #543e2d;
  --primary-ink: #f3d2b3;
  --secondary: #302b25;
  --tertiary: #303a2b;
  --button: #443b31;
  --line: #79634b;
  --focus: #e7b48a;
  --snack: #ebdfd0;
  --snack-ink: #33291f;
  --shadow: rgba(0, 0, 0, .17);
}

:root[data-palette='iris'] { --page: #f2eff8; --ink: #302b3b; --muted: #776c87; --primary: #d7c5ef; --primary-ink: #46305e; --secondary: #e6dfee; --tertiary: #dfdfef; --button: #faf5ff; --line: #b8a2d0; --focus: #765399; }
:root[data-palette='mint'] { --page: #edf3ee; --ink: #23392e; --muted: #657c6d; --primary: #b8ddc6; --primary-ink: #234a35; --secondary: #dce7df; --tertiary: #dee6ce; --button: #f3fbf4; --line: #9bbca5; --focus: #477b59; }
:root[data-theme='dark'][data-palette='iris'] { --page: #19151f; --ink: #ebdff5; --muted: #b6a7c6; --primary: #4a385e; --primary-ink: #e9cffd; --secondary: #302737; --tertiary: #303044; --button: #44364e; --line: #7e6295; --focus: #d6aff1; }
:root[data-theme='dark'][data-palette='mint'] { --page: #121b16; --ink: #deeee1; --muted: #a3bcab; --primary: #294e38; --primary-ink: #bfedcf; --secondary: #25372c; --tertiary: #353f28; --button: #384b3c; --line: #577c62; --focus: #a1d6b0; }

/* чтобы тема переключалась плавно, переменные надо зарегистрировать как цвета */
@property --page { syntax: '<color>'; inherits: true; initial-value: #f4f0e9; }
@property --ink { syntax: '<color>'; inherits: true; initial-value: #302c27; }
@property --muted { syntax: '<color>'; inherits: true; initial-value: #797169; }
@property --primary { syntax: '<color>'; inherits: true; initial-value: #e5c2a3; }
@property --primary-ink { syntax: '<color>'; inherits: true; initial-value: #51341e; }
@property --secondary { syntax: '<color>'; inherits: true; initial-value: #e7e2d9; }
@property --tertiary { syntax: '<color>'; inherits: true; initial-value: #dce4d6; }
@property --button { syntax: '<color>'; inherits: true; initial-value: #fbf6ee; }
@property --line { syntax: '<color>'; inherits: true; initial-value: #d4ba9f; }
@property --focus { syntax: '<color>'; inherits: true; initial-value: #865331; }
@property --snack { syntax: '<color>'; inherits: true; initial-value: #342e27; }
@property --snack-ink { syntax: '<color>'; inherits: true; initial-value: #fff4e8; }
@property --shadow { syntax: '<color>'; inherits: true; initial-value: rgba(72, 46, 25, .09); }

:root {
  transition-property: --page, --ink, --muted, --primary, --primary-ink, --secondary, --tertiary, --button, --line, --focus, --snack, --snack-ink, --shadow;
  transition-duration: 450ms;
  transition-timing-function: cubic-bezier(.2, 0, 0, 1);
}

/* база */

* { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: Manrope, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--primary); color: var(--primary-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }

.mi {
  display: inline-block;
  flex-shrink: 0;
  font-family: 'Material Symbols Rounded';
  font-weight: 400;
  font-style: normal;
  font-size: 25px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: 'liga';
}

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100% - 48px, 520px);
  min-height: 100svh;
  margin: auto;
  padding: 28px 0 24px;
}

main { padding: 38px 0 36px; }

/* шапка */

.top, .tools { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.palettes { display: flex; gap: 9px; }

.swatch {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d9b592;
  transition: transform 200ms cubic-bezier(.2, .8, .2, 1);
}
.swatch[data-palette='iris'] { background: #bca0db; }
.swatch[data-palette='mint'] { background: #9bc4a8; }
.swatch[aria-pressed='true'] { outline: 2px solid var(--ink); outline-offset: 3px; transform: scale(.84); }
.swatch:active { transform: scale(.7); }

.theme {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 18px;
  background: var(--secondary);
  transition: transform 180ms ease;
}
.theme:active { transform: scale(.9); }
.sun, [data-theme='dark'] .moon { display: none; }
[data-theme='dark'] .sun { display: block; }

/* профиль */

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: profile-in 650ms cubic-bezier(.2, .9, .3, 1) both;
}

.avatar-motion {
  margin-bottom: 22px;
  transform-origin: 50% 65%;
  animation: float 4.8s ease-in-out infinite;
}

.avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  padding: 0;
  border: 0;
  border-radius: 36px;
  background: var(--primary);
  color: var(--primary-ink);
  transform: rotate(-7deg);
  transition: border-radius 380ms cubic-bezier(.2, 1.4, .3, 1), transform 220ms ease;
}
.avatar > span {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -7px;
  transform: rotate(7deg) translate(-3px, -4px);
}
.avatar[data-shape='1'] { border-radius: 50% 24% 50% 24%; transform: rotate(8deg); }
.avatar[data-shape='2'] { border-radius: 24% 50% 24% 50%; transform: rotate(-10deg); }
.avatar[data-shape='3'] { border-radius: 50%; transform: none; }
.avatar:active { transform: scale(.9); }

h1 {
  margin: 0;
  font-size: clamp(48px, 12vw, 60px);
  font-weight: 800;
  letter-spacing: -3.5px;
  line-height: 1.2;
}

.handle {
  margin: 5px 0 0;
  padding: 6px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: transform 150ms ease;
}
.handle:active { background: var(--secondary); transform: scale(.95); }
@media (hover: hover) and (pointer: fine) {
  .handle:hover { background: var(--secondary); }
}

.divider {
  height: 12px;
  margin: 30px 0 28px;
  background: var(--focus);
  opacity: .55;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='12'%3E%3Cpath d='M-14 6Q-7 14 0 6Q7-2 14 6T28 6T42 6' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") 0 0 / 28px 12px repeat-x;
  animation: wave 1.6s linear infinite;
}

/* карточки */

.links { display: grid; gap: 12px; }

.card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 94px;
  padding: 18px;
  border: 0;
  border-radius: 28px;
  background: var(--secondary);
  box-shadow: 0 2px 0 var(--shadow);
  text-align: left;
  transition: transform 220ms cubic-bezier(.2, 1.4, .3, 1);
  animation: tile-in 650ms cubic-bezier(.18, 1.25, .32, 1) 120ms both;
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: currentColor;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.telegram { background: var(--primary); color: var(--primary-ink); border-radius: 32px 32px 12px 32px; }
.feedback { border-radius: 28px 12px 28px 12px; animation-delay: 200ms; }
.wallet { background: var(--tertiary); border-radius: 12px 28px 32px 32px; animation-delay: 280ms; }

.icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: color-mix(in srgb, currentColor 7%, transparent);
}
.icon .mi { font-size: 26px; transition: transform 250ms cubic-bezier(.2, 1.8, .3, 1); }

.name { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.65px; line-height: 1.25; }
.text { flex: 1; min-width: 0; }
.address { display: block; margin-top: 5px; color: var(--muted); font: 11px ui-monospace, monospace; }

.action {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--button);
  color: var(--ink);
}
.action .mi { font-size: 22px; }

@media (hover: hover) {
  .card:hover { transform: translateY(-2px); }
  .card:hover::after { opacity: .045; }
  .action { transition: transform 180ms ease; }
}
.card:hover .icon .mi { transform: rotate(-12deg) scale(1.15); }
.card:hover .action { transform: translate(2px, -2px) rotate(-8deg); }
.card:active { transform: scale(.975) translateY(2px); }
.card:active::after { opacity: .09; }
.wallet.copied .action { background: var(--ink); color: var(--page); transform: rotate(8deg); }

.ripple {
  position: absolute;
  z-index: -1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: currentColor;
  opacity: .12;
  pointer-events: none;
}

.manual { margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; }
.manual label { display: block; margin-bottom: 10px; font-size: 13px; }
.manual input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page);
  color: var(--ink);
  font: 12px monospace;
}

/* плеер */

.player {
  margin-top: 20px;
  padding: 20px 22px;
  border-radius: 28px;
  background: var(--secondary);
  animation: tile-in 650ms cubic-bezier(.18, 1.25, .32, 1) 360ms both;
}
.player-top { display: flex; align-items: center; gap: 14px; }

.record {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-ink);
}
.playing .record { animation: spin 8s linear infinite; }

.track { flex: 1; min-width: 0; }
.track h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.5px; }
.track p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.play-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 20px;
  background: var(--primary);
  color: var(--primary-ink);
  transition: transform 180ms ease, border-radius 180ms ease;
}
.play-button .mi { font-size: 32px; }
.play-button:active { transform: scale(.9); }
.playing .play-button { border-radius: 50%; }

.seek-row { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.seek-row time { min-width: 28px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.duration { text-align: right; }

.seek {
  --progress: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 28px;
  margin: 0;
  background: none;
  cursor: pointer;
}
.seek:disabled { opacity: .45; cursor: default; }
.seek::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 5px;
  background: linear-gradient(to right, var(--focus) var(--progress), var(--line) var(--progress));
}
.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 5px;
  height: 24px;
  margin-top: -9.5px;
  border: 0;
  border-radius: 3px;
  background: var(--focus);
  box-shadow: 0 0 0 4px var(--secondary);
}
.seek::-moz-range-track { height: 5px; border-radius: 5px; background: var(--line); }
.seek::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--focus); }
.seek::-moz-range-thumb { width: 5px; height: 24px; border: 0; border-radius: 3px; background: var(--focus); box-shadow: 0 0 0 4px var(--secondary); }

/* низ, уведомление, фон */

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding: 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
footer .mi { font-size: 19px; }

.snackbar {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 10;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 16px 22px;
  border-radius: 18px;
  background: var(--snack);
  color: var(--snack-ink);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.snackbar.visible { opacity: 1; transform: translate(-50%, 0); }

.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.ambient span {
  position: absolute;
  top: 15%;
  left: -75px;
  width: 180px;
  height: 180px;
  border-radius: 35% 65% 57% 43% / 45% 38% 62% 55%;
  background: var(--primary);
  opacity: .17;
  transform: translate(var(--px, 0px), var(--py, 0px));
  animation: drift 15s ease-in-out infinite;
  will-change: transform;
}
.ambient span:nth-child(2) { top: 55%; left: auto; right: -70px; width: 210px; height: 210px; background: var(--tertiary); animation-duration: 19s; animation-delay: -6s; }
.ambient span:nth-child(3) { top: 82%; left: 12%; width: 70px; height: 70px; animation-duration: 17s; animation-delay: -9s; }
.ambient span:nth-child(4) { top: 8%; left: auto; right: 12%; width: 84px; height: 84px; background: var(--tertiary); animation-duration: 13s; animation-delay: -3s; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wave { to { mask-position: 28px 0; } }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}
@keyframes profile-in {
  from { opacity: 0; transform: translateY(12px); }
}
@keyframes tile-in {
  from { opacity: 0; transform: translateY(20px) scale(.94); }
}
@keyframes drift {
  0%, 100% { transform: translate(var(--px, 0px), var(--py, 0px)) rotate(-10deg); }
  50% { transform: translate(calc(var(--px, 0px) + 14px), calc(var(--py, 0px) - 22px)) rotate(35deg); }
}

/* адаптив */

@media (max-width: 360px) {
  .page { width: calc(100% - 32px); padding-top: 20px; }
  main { padding-top: 28px; }
  .card { gap: 12px; padding: 14px; min-height: 88px; }
  .icon, .action { width: 42px; height: 42px; }
  .name { font-size: 17px; }
  .avatar { width: 86px; height: 86px; border-radius: 30px; }
  .avatar > span { font-size: 62px; }
}

@media (min-width: 800px) {
  .page { padding-top: 32px; }
  main { padding: 48px 0; }
  .card { min-height: 100px; }
  .divider { margin: 34px 0; }
}

/* на десктопе всё раскладывается в сетку из трёх колонок */
@media (min-width: 900px) {
  .page { width: min(100% - 96px, 1440px); padding-top: 28px; }
  .top { flex-shrink: 0; margin-bottom: 18px; }

  main {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: center;
    gap: 24px;
    padding: 8px 0 32px;
  }
  .profile, .divider, .links, .player, .manual { grid-column: 1 / -1; }

  .profile h1 { font-size: 64px; letter-spacing: -4px; }
  .avatar-motion { margin-bottom: 18px; }
  .avatar { width: 96px; height: 96px; border-radius: 34px; }
  .avatar > span { font-size: 69px; }
  .divider { margin: 10px 0 14px; }

  .links { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    min-height: clamp(224px, 27vh, 320px);
    padding: 30px;
    border-radius: 32px;
  }
  .card .icon { width: 60px; height: 60px; margin-bottom: 32px; border-radius: 22px; }
  .card .icon .mi { font-size: 30px; }
  .card .name { font-size: clamp(24px, 2.2vw, 32px); letter-spacing: -1px; }
  .card > .name, .card > .text { margin-top: auto; }
  .card .text { flex: 0; }
  .card .address { margin-top: 10px; font-size: 13px; }
  .card .action { position: absolute; top: 30px; right: 26px; width: 52px; height: 52px; }

  .player {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    align-items: center;
    gap: clamp(32px, 5vw, 80px);
    margin: 0;
    padding: 26px 30px;
  }
  .player-top { gap: 16px; }
  .seek-row { margin: 0; }
  .track h2 { font-size: 19px; }
  .track p { font-size: 13px; }

  footer { margin-top: 0; padding: 12px 0 0; }

  .ambient span { left: 8%; width: 280px; height: 280px; opacity: .1; }
  .ambient span:nth-child(2) { right: 7%; width: 250px; height: 250px; }
  .ambient span:nth-child(3) { left: 24%; }
  .ambient span:nth-child(4) { right: 23%; }
}

@media (min-width: 900px) and (max-height: 760px) {
  .page { padding-top: 20px; }
  .top { margin-bottom: 8px; }
  main { gap: 18px; padding-top: 0; }
  .avatar-motion { margin-bottom: 12px; }
  .avatar { width: 76px; height: 76px; border-radius: 27px; }
  .avatar > span { font-size: 56px; }
  .profile h1 { font-size: 52px; }
  .divider { margin: 4px 0; }
  .card { min-height: 200px; padding: 24px; }
  .card .action { top: 24px; right: 24px; }
  .player { padding: 20px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ripple { display: none; }
  .card:hover, .card:active, .card:hover .action, .card:hover .icon .mi, .theme:active, .avatar:active { transform: none; }
  .ambient span { will-change: auto; }
}
