@import url('themes.css');
/* ═══════════════════════════════════════════════════════════════
   SendenSana — Ses Atölyesi (js/SoundAtelier.js ile birlikte)
   Renkler YALNIZ css/themes.css belirteçlerinden (.sa[data-theme]);
   Nefes Stüdyosu'nun (.bs) kardeşi: koyu zemin, ince çizgi, hap çipler, iri mono rakam.
   ═══════════════════════════════════════════════════════════════ */
.sa {
  --sa-bg1: var(--th-bg1);
  --sa-bg2: var(--th-bg2);
  --sa-ink: var(--th-ink);
  --sa-muted: var(--th-muted);
  --sa-in: var(--th-in);
  --sa-out: var(--th-out);
  --sa-hold: var(--th-hold);
  --sa-panel: var(--th-panel);
  --sa-line: var(--th-line);
  --sa-chip: var(--th-chip);
  --sa-chip-on: var(--th-chip-on);
  --sa-chip-on-ink: var(--th-chip-on-ink);
  --sa-shadow: var(--th-shadow);
  --sa-display: 'Bricolage Grotesque', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --sa-body: 'Karla', 'Helvetica Neue', Arial, sans-serif;
  --sa-mono: 'JetBrains Mono', Consolas, 'Courier New', monospace;

  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  background: radial-gradient(80% 90% at 30% 20%, var(--sa-bg2), var(--sa-bg1) 72%);
  color: var(--sa-ink);
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  font-family: var(--sa-body);
  text-align: start;
  box-sizing: border-box;
}
.sa *, .sa *::before, .sa *::after { box-sizing: border-box; }

.sa-stage { display: grid; align-content: start; gap: 18px; padding: 28px 28px 26px; min-width: 0; }
.sa-panel {
  display: grid; align-content: start; gap: 18px; padding: 28px 26px 26px; min-width: 0;
  background: var(--sa-panel); border-inline-start: 1px solid var(--sa-line);
}
.sa-head { display: grid; gap: 6px; }
.sa-title {
  margin: 0; font-family: var(--sa-display); font-weight: 700; font-size: 1.55rem; letter-spacing: -0.02em; color: var(--sa-ink); line-height: 1.1;
}
.sa-tag { margin: 0; color: var(--sa-muted); font-size: 0.92rem; line-height: 1.5; }

/* ── Kahraman: çal düğmesi + durum + ses hattı ── */
.sa-hero {
  display: flex; align-items: center; gap: 20px; padding: 18px; border-radius: 20px;
  border: 1px solid var(--sa-line); background: var(--sa-chip); outline: none;
}
.sa-hero:focus-visible { box-shadow: 0 0 0 2px var(--sa-in); }
.sa-play {
  flex: none; position: relative; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%;
  border: 0; background: var(--sa-chip-on); color: var(--sa-chip-on-ink); cursor: pointer;
  box-shadow: 0 0 0 8px var(--sa-chip), 0 0 0 9px var(--sa-line), 0 10px 30px var(--sa-shadow);
  transition: transform 0.15s ease, filter 0.15s;
}
.sa-play:hover { filter: brightness(1.08); }
.sa-play:active { transform: scale(0.97); }
.sa-play:focus-visible { outline: 2px solid var(--sa-in); outline-offset: 12px; }
.sa-play svg { width: 34px; height: 34px; fill: currentColor; }
.sa-ico-pause { display: none; }
.sa--playing .sa-ico-pause { display: inline; }
.sa--playing .sa-ico-play { display: none; }

.sa-meta { display: grid; gap: 10px; min-width: 0; flex: 1; }
.sa-state {
  font-family: var(--sa-mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sa-muted);
  overflow-wrap: anywhere;
}
.sa--playing .sa-state { color: var(--sa-in); }
.sa-bars { display: flex; align-items: center; gap: 3px; height: 34px; }
.sa-bars i {
  flex: 1 1 0; min-width: 1px; max-width: 4px; height: 100%; border-radius: 2px; background: var(--sa-out);
  transform: scaleY(0.12); transform-origin: center; opacity: 0.55; transition: transform 1.2s ease, opacity 1.2s;
}
.sa--playing .sa-bars i {
  opacity: 0.95; background: var(--sa-in); transform: scaleY(calc(var(--h) * 0.8));
  animation: sa-bar 2.4s ease-in-out var(--d) infinite alternate;
}
@keyframes sa-bar {
  from { transform: scaleY(calc(var(--h) * 0.35)); }
  to { transform: scaleY(var(--h)); }
}
.sa--still .sa-bars i, .sa--still.sa--playing .sa-bars i { animation: none; transition: none; }
.sa-clock { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sa-clock[hidden] { display: none; }
.sa-clock small { font-family: var(--sa-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sa-muted); }
.sa-clock b {
  font-family: var(--sa-mono); font-weight: 500; font-size: 1.9rem; line-height: 1; color: var(--sa-ink);
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.sa-empty { margin: -6px 0 0; color: var(--sa-hold); font-size: 0.86rem; }
.sa-empty[hidden] { display: none; }

/* ── Gruplar / çipler (Nefes Stüdyosu ile aynı dil) ── */
.sa-group { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.sa-group legend {
  margin-bottom: 8px; padding: 0; font-family: var(--sa-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sa-muted);
}
.sa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sa-chip { position: relative; cursor: pointer; }
.sa-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sa-chip span {
  display: inline-flex; align-items: center; min-height: 36px; padding: 7px 13px; border-radius: 999px;
  background: var(--sa-chip); border: 1px solid var(--sa-line); color: var(--sa-ink);
  font-size: 0.86rem; line-height: 1.2; transition: background 0.15s, border-color 0.15s;
}
.sa-chip:hover span { border-color: var(--sa-in); }
.sa-chip input:checked + span { background: var(--sa-chip-on); border-color: transparent; color: var(--sa-chip-on-ink); font-weight: 600; }
.sa-chip input:focus-visible + span { outline: 2px solid var(--sa-in); outline-offset: 2px; }
.sa-chip--custom { cursor: default; }
.sa-chip--custom input { cursor: default; }
.sa-chip--custom input:not(:checked) + span { opacity: 0.5; border-style: dashed; }
.sa-chip--custom:hover span { border-color: var(--sa-line); }

.sa-master { display: grid; gap: 8px; font-family: var(--sa-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sa-muted); }
.sa-range { width: 100%; margin: 0; accent-color: var(--sa-chip-on); cursor: pointer; }

.sa-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sa-link {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--sa-line);
  background: transparent; color: var(--sa-ink); font: inherit; font-size: 0.86rem; cursor: pointer; min-height: 40px;
}
.sa-link:hover { border-color: var(--sa-in); }
.sa-link:focus-visible, .sa-layer__tog:focus-visible { outline: 2px solid var(--sa-in); outline-offset: 2px; }
.sa-note {
  margin: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--sa-line);
  color: var(--sa-muted); font-size: 0.8rem; line-height: 1.5;
}

/* ── Katman kartları ── */
.sa-layers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sa-layer {
  --lv: 0;
  position: relative; display: grid; gap: 10px; padding: 12px 12px 14px; border-radius: 16px;
  background: var(--sa-chip); border: 1px solid var(--sa-line); overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
/* ince seviye çizgisi: kartın altında ses düzeyi kadar */
.sa-layer::after {
  content: ''; position: absolute; inset-inline-start: 0; bottom: 0; height: 2px; width: calc(var(--lv) * 100%);
  background: var(--sa-in); opacity: 0.8; transition: width 0.2s;
}
.sa-layer.is-on { border-color: var(--sa-in); }
.sa-layer.is-on { border-color: color-mix(in srgb, var(--sa-in) 55%, transparent); background: color-mix(in srgb, var(--sa-in) 9%, var(--sa-chip)); }
.sa-layer__tog {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 4px 2px;
  border: 0; border-radius: 10px; background: transparent; color: var(--sa-ink); font: 600 0.95rem/1.2 var(--sa-body);
  text-align: start; cursor: pointer;
}
.sa-layer__dot {
  flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--sa-muted); transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.sa-layer.is-on .sa-layer__dot { background: var(--sa-in); border-color: var(--sa-in); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sa-in) 22%, transparent); }
.sa-layer.is-loading .sa-layer__dot { animation: sa-pulse 1s ease-in-out infinite alternate; }
@keyframes sa-pulse { from { opacity: 0.35; } to { opacity: 1; } }
.sa-layer__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sa-layer__v { font-family: var(--sa-mono); font-size: 0.72rem; font-weight: 400; color: var(--sa-muted); font-variant-numeric: tabular-nums; }
.sa-layer:not(.is-on) .sa-range { opacity: 0.55; }

/* ── Dar ekran: tek sütun ── */
@media (max-width: 860px) {
  .sa { grid-template-columns: minmax(0, 1fr); border-radius: 20px; }
  .sa-panel { border-inline-start: 0; border-top: 1px solid var(--sa-line); background: transparent; }
  .sa-stage { order: 0; }
}
@media (max-width: 480px) {
  .sa-stage, .sa-panel { padding: 20px 16px; gap: 16px; }
  .sa-hero { gap: 16px; padding: 14px; }
  .sa-play { width: 68px; height: 68px; box-shadow: 0 0 0 6px var(--sa-chip), 0 0 0 7px var(--sa-line), 0 8px 24px var(--sa-shadow); }
  .sa-play svg { width: 28px; height: 28px; }
  .sa-clock b { font-size: 1.6rem; }
  .sa-layers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sa-title { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sa-bars i, .sa-layer, .sa-layer::after, .sa-chip span, .sa-play { transition: none; animation: none !important; }
}
/* Bitişik / hece yazılarında harf aralığı ve eş-genişlikli yazı kelimeyi koparır (Arapça harfleri ayrılır) → gövde yazısı */
.sa:is(:lang(ar), :lang(hi), :lang(th), :lang(ja), :lang(ko), :lang(zh)) :is(.sa-state, .sa-group legend, .sa-master, .sa-clock small) { letter-spacing: 0; font-family: var(--sa-body); font-size: 0.82rem; }
