/* My Calm Mix */
:root {
  --bg: #0a0f14;
  --ink: #e9eef0;
  --muted: #a3b0b8;
  --faint: rgba(233, 238, 240, 0.08);
  --line: rgba(233, 238, 240, 0.12);
  --card: rgba(16, 24, 31, 0.55);
  --accent: #a6d9cb;
  --accent2: #ad9fe3;
  --r: 16px;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --dock-h: 76px;
  --tap: 28px;
  --slow: cubic-bezier(.4, .1, .2, 1);
  color-scheme: dark;
}
@media (pointer: coarse) { :root { --tap: 34px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--sans); letter-spacing: .005em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  padding-bottom: calc(var(--dock-h) + 24px + env(safe-area-inset-bottom));
}
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
body::after { /* fine grain so gradients never band */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { top: 12px; }
.ic { width: 22px; height: 22px; flex: none; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1400px; margin: 0 auto; padding: 18px 20px 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 400 21px/1 var(--serif); letter-spacing: .01em; }
.logo { width: 34px; height: 34px; animation: breathe 9s var(--slow) infinite; }
.nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.install { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; }

main { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.intro { padding: 18px 0 14px; }
.intro h1 { font: 300 clamp(28px, 4.4vw, 44px)/1.1 var(--serif); margin: 0 0 8px; letter-spacing: -.01em; }
.intro p { margin: 0; color: var(--muted); max-width: 640px; font-size: 15px; }
.count { color: var(--accent); white-space: nowrap; }

/* presets */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); font-size: 13px; color: var(--ink); transition: background .4s, border-color .4s; white-space: nowrap; }
.chip:hover { background: rgba(255, 255, 255, .07); }
.chip.mine { padding: 0 4px 0 14px; gap: 2px; border-color: rgba(166, 217, 203, .35); }
.chip.mine .x { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.chip.mine .x .ic { width: 14px; height: 14px; }
.chip.mine .x:hover { color: var(--ink); background: var(--faint); }
.sep { flex: none; width: 1px; background: var(--line); margin: 4px 4px; }

/* filters */
.filters { display: flex; gap: 4px; flex-wrap: wrap; margin: 2px 0 12px; }
.filters button { min-height: var(--tap); padding: 0 12px; border-radius: 999px; font-size: 13px; color: var(--muted); transition: color .3s, background .3s; }
.filters button[aria-pressed="true"] { color: var(--ink); background: var(--faint); }

/* grid & cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; outline: none; }
.card {
  --c: #888; position: relative; border-radius: var(--r); padding: 10px 10px 8px;
  background: var(--card); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: background .8s var(--slow), border-color .8s var(--slow), box-shadow .8s var(--slow);
  display: flex; flex-direction: column; gap: 7px; min-width: 0;
}
.card[hidden] { display: none; }
.card.on { background: color-mix(in srgb, var(--c) 16%, rgba(16, 24, 31, .6)); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.card.live { box-shadow: 0 0 28px -8px color-mix(in srgb, var(--c) 55%, transparent); }
.c-head { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; min-height: var(--tap); border-radius: 10px; }
.c-head .ic { width: 26px; height: 26px; color: color-mix(in srgb, var(--c) 70%, var(--ink)); transition: color .6s; }
.card.on .c-head .ic { color: color-mix(in srgb, var(--c) 40%, #fff); }
.c-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-val { font-size: 11px; color: var(--muted); opacity: 0; transition: opacity .4s; font-variant-numeric: tabular-nums; }
.c-val.show { opacity: 1; }
.led { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--line); flex: none; transition: background .5s, box-shadow .5s; }
.card.on .led { background: var(--c); border-color: transparent; }
.card.live .led { box-shadow: 0 0 10px var(--c); animation: breathe 4s var(--slow) infinite; }

.c-vars { display: flex; gap: 3px; flex-wrap: wrap; }
.c-vars button {
  font-size: 11px; line-height: 1; padding: 0 7px; min-height: calc(var(--tap) - 6px); border-radius: 999px; color: var(--muted);
  border: 1px solid transparent; transition: color .3s, background .3s, border-color .3s; white-space: nowrap;
}
.c-vars button:hover { color: var(--ink); }
.c-vars button[aria-checked="true"] { color: var(--ink); background: color-mix(in srgb, var(--c) 22%, transparent); border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.card:not(.on) .c-vars button[aria-checked="true"] { background: var(--faint); border-color: transparent; }

/* gauges: one look per family */
.gauge { --v: .5; position: relative; height: var(--tap); touch-action: pan-y; cursor: ew-resize; display: flex; align-items: center; gap: 2px; border-radius: 8px; user-select: none; -webkit-user-select: none; }
.gauge:not(.g-line):not(.g-wave) { justify-content: space-between; }
.card .gauge { --gc: color-mix(in srgb, var(--c) 70%, #fff); }
.card:not(.on) .gauge { --gc: rgba(233, 238, 240, .45); }
.gauge i { display: block; flex: 1; transition: background .25s, opacity .25s, transform .25s; }
/* line */
.g-line .g-track { position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px; background: var(--faint); overflow: hidden; }
.g-line .g-fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--v)); background: var(--gc, var(--accent)); border-radius: 3px; }
.g-thumb { position: absolute; top: 50%; left: calc(var(--v) * 100%); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px rgba(10, 15, 20, .6); transition: transform .2s; }
.gauge.drag .g-thumb, .gauge:hover .g-thumb { transform: scale(1.18); }
/* dots and drops */
.g-dots i, .g-drops i { height: 5px; max-width: 5px; border-radius: 50%; background: var(--faint); margin: 0 1px; }
.g-drops i { height: 8px; max-width: 5px; border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%; }
.g-dots i.on, .g-drops i.on { background: var(--gc); }
.g-dots i:nth-child(odd) { transform: translateY(-3px); }
/* bars */
.g-bars i { max-width: 5px; border-radius: 2px; background: var(--faint); height: calc(5px + var(--i) * 1.25px); align-self: flex-end; margin-bottom: 7px; }
.g-bars i.on { background: var(--gc); }
/* rings */
.g-rings i { flex: none; width: calc(5px + var(--i) * 1.3px); height: calc(5px + var(--i) * 1.3px); border-radius: 50%; border: 1.5px solid var(--faint); }
.g-rings i.on { border-color: var(--gc); }
/* wave */
.g-wave svg { position: absolute; inset: 3px 0; width: 100%; height: calc(100% - 6px); overflow: visible; }
.g-wave path { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.g-wave .g-bg { stroke: var(--faint); }
.g-wave .g-fg { stroke: var(--gc); }
.g-wave .g-thumb { width: 12px; height: 12px; margin: -6px 0 0 -6px; }

/* icon motion while a sound plays */
.card.live .a-fall path { animation: fall 1.4s linear infinite; }
.card.live .a-fall path:nth-child(2) { animation-delay: -.5s; }
.card.live .a-fall path:nth-child(3) { animation-delay: -1s; }
.card.live .a-flash { animation: flash 7s ease-in-out infinite; }
.card.live .a-drift { animation: drift 5s var(--slow) infinite; }
.card.live .a-sway { animation: sway 6s var(--slow) infinite; }
.card.live .a-flap { animation: flap 3s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.card.live .d2 { animation-delay: -1.2s !important; }
.card.live .d3 { animation-delay: -2.1s !important; }
.card.live .a-twinkle { animation: twinkle 3.5s ease-in-out infinite; }
.card.live .a-pulse, .card.live .a-breathe { animation: breathe 5s var(--slow) infinite; transform-origin: center; transform-box: fill-box; }
.card.live .a-flicker { animation: flicker 2.2s ease-in-out infinite; transform-origin: 50% 100%; transform-box: fill-box; }
.card.live .a-tick { animation: spin 60s steps(60) infinite; transform-origin: 16px 16px; }
.card.live .a-eq path { animation: eq 1.6s ease-in-out infinite; transform-origin: 50% 100%; transform-box: fill-box; }
.card.live .a-eq path:nth-child(2n) { animation-delay: -.6s; }
.card.live .a-eq path:nth-child(3n) { animation-delay: -1.1s; }
.card.live .a-ripple { animation: rise 4s var(--slow) infinite; }
.card.live .a-swing { animation: swing 5s ease-in-out infinite; transform-origin: 16px 5px; }
.card.live .a-chime { animation: swing 3.4s ease-in-out infinite; transform-origin: 50% 0; transform-box: fill-box; }
.card.live .a-float { animation: float 4s var(--slow) infinite; }
.card.live .a-vibrate path { animation: vib .9s ease-in-out infinite; transform-origin: 50% 100%; transform-box: fill-box; }
.card.live .a-vibrate path:nth-child(2n) { animation-delay: -.4s; }
.card.live .a-press { animation: twinkle 2.6s ease-in-out infinite; }

@keyframes fall { 0% { transform: translateY(-3px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(4px); opacity: 0; } }
@keyframes flash { 0%, 86%, 100% { opacity: .35; } 88% { opacity: 1; } 90% { opacity: .4; } 92% { opacity: 1; } }
@keyframes drift { 0%, 100% { transform: translateX(-1px); } 50% { transform: translateX(2px); } }
@keyframes sway { 0%, 100% { transform: translateX(-1.5px); } 50% { transform: translateX(1.5px); } }
@keyframes flap { 0%, 100% { transform: scaleY(1) translateY(0); } 50% { transform: scaleY(.6) translateY(-1px); } }
@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes flicker { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(.97, 1.05); } 60% { transform: scale(1.02, .97); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes eq { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.55); } }
@keyframes rise { 0% { transform: translateY(2px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(-3px); opacity: 0; } }
@keyframes swing { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); opacity: .7; } 50% { transform: translateY(-2.5px); opacity: 1; } }
@keyframes vib { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.94); } }

/* dock */
.dock {
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  width: min(1100px, calc(100% - 24px)); min-height: var(--dock-h);
  display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px;
  background: rgba(12, 18, 24, .72); border: 1px solid var(--line); border-radius: 26px;
  -webkit-backdrop-filter: blur(22px) saturate(1.3); backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .7);
}
.play { width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #0a0f14; transition: transform .3s var(--slow), box-shadow .6s; }
.play .ic { width: 24px; height: 24px; }
.play:hover { transform: scale(1.04); }
.play.is-on { box-shadow: 0 0 30px -4px rgba(166, 217, 203, .55); animation: glow 6s var(--slow) infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 22px -6px rgba(166, 217, 203, .45); } 50% { box-shadow: 0 0 34px -2px rgba(173, 159, 227, .6); } }
.sliders { display: flex; gap: 14px; flex: 1; min-width: 0; }
.sl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.sl-l { font-size: 12px; color: var(--muted); flex: none; }
.sl .gauge { flex: 1; --gc: var(--accent); }
.tools { display: flex; gap: 2px; flex: none; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 54px; padding: 6px 6px 4px; border-radius: 14px; font-size: 11px; color: var(--muted); transition: color .3s, background .3s; }
.tool:hover { color: var(--ink); background: var(--faint); }
.tool.active { color: var(--accent); }
.tool .lbl { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(5, 8, 11, 0); display: flex; align-items: flex-end; justify-content: center; padding: 12px; transition: background .25s; }
.sheet[hidden] { display: none; }
.sheet.open { background: rgba(5, 8, 11, .55); }
.sheet-panel { position: relative; width: min(460px, 100%); margin-bottom: calc(var(--dock-h) + 14px + env(safe-area-inset-bottom)); background: rgba(16, 23, 30, .96); border: 1px solid var(--line); border-radius: 22px; padding: 20px; transform: translateY(16px); opacity: 0; transition: transform .3s var(--slow), opacity .25s; }
.sheet.open .sheet-panel { transform: none; opacity: 1; }
.sheet-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.sheet-close:hover { background: var(--faint); color: var(--ink); }
.sheet h2 { font: 400 22px/1.2 var(--serif); margin: 0 0 4px; }
.muted { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.small { font-size: 13px; margin: 12px 0 0; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.opt:hover { background: rgba(255, 255, 255, .08); }
.opt.primary { background: var(--accent); color: #0a0f14; border-color: transparent; font-weight: 500; }
.save-form { display: flex; gap: 8px; }
.save-form input { flex: 1; min-width: 0; min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); color: var(--ink); font: inherit; font-size: 16px; }
.save-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--dock-h) + 30px + env(safe-area-inset-bottom)); transform: translate(-50%, 10px); z-index: 30; background: rgba(233, 238, 240, .94); color: #0a0f14; padding: 9px 16px; border-radius: 999px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--slow); max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot { max-width: 1400px; margin: 40px auto 0; padding: 0 20px; color: var(--muted); font-size: 13px; }
.foot p { margin: 4px 0; }
.nojs { text-align: center; padding: 20px; }

/* article pages */
.page { max-width: 720px; margin: 0 auto; padding: 10px 20px 40px; }
.page h1 { font: 300 clamp(30px, 5vw, 44px)/1.12 var(--serif); margin: 22px 0 10px; }
.page .lede { color: var(--muted); font-size: 17px; margin: 0 0 28px; }
.page h2 { font: 400 24px/1.25 var(--serif); margin: 36px 0 8px; }
.page p, .page li { color: #d3dade; font-size: 16px; line-height: 1.7; }
.page .note { border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; color: var(--muted); margin: 18px 0; }
.page .refs { font-size: 13.5px; color: var(--muted); padding-left: 18px; }
.page .refs li { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin-bottom: 8px; }
.page details { border-top: 1px solid var(--line); padding: 14px 0; }
.page details:last-of-type { border-bottom: 1px solid var(--line); }
.page summary { cursor: pointer; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.page summary::-webkit-details-marker { display: none; }
.page summary::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1; transition: transform .3s; }
.page details[open] summary::after { transform: rotate(45deg); }
.page details p { margin: 10px 0 0; }
.cta { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #0a0f14; text-decoration: none; font-weight: 500; margin-top: 18px; }
body.article { padding-bottom: 40px; }

/* phones */
@media (max-width: 760px) {
  :root { --dock-h: 118px; }
  .top { padding: 14px 16px 2px; }
  .brand { font-size: 19px; }
  .logo { width: 30px; height: 30px; }
  .nav { gap: 14px; font-size: 13px; }
  main, .foot { padding: 0 16px; }
  .intro { padding: 12px 0 10px; }
  .intro p { font-size: 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { padding: 9px 9px 6px; }
  .dock { flex-wrap: wrap; gap: 6px 10px; padding: 8px 10px; border-radius: 22px; width: calc(100% - 16px); bottom: calc(8px + env(safe-area-inset-bottom)); }
  .play { width: 50px; height: 50px; }
  .sliders { flex-direction: column; gap: 0; }
  .tools { width: 100%; justify-content: space-between; }
  .tool { min-width: 0; flex: 1; padding: 4px 2px; }
  .sheet-panel { margin-bottom: calc(var(--dock-h) + 8px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) { .nav a[href="faq.html"] { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
