/* =========================================================
   Music portfolio — dark, RTL, mobile-first
   Theme tokens live in :root so you can tweak from one place.
   ========================================================= */

@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* surface */
  --bg:           #0c0c0e;
  --bg-soft:      #111114;
  --surface:      #16161a;
  --surface-2:    #1d1d22;
  --surface-3:    #26262c;
  --border:       #2a2a31;
  --border-soft:  #1f1f25;

  /* text */
  --text:         #f5f5f7;
  --text-muted:   #a8a8b3;
  --text-dim:     #6e6e78;

  /* accent — warm amber, evokes studio glow */
  --accent:       #e8b07a;
  --accent-hi:    #f3c391;
  --accent-soft:  rgba(232, 176, 122, 0.16);
  --accent-fade:  rgba(232, 176, 122, 0.06);

  /* shape */
  --radius-xs:    8px;
  --radius-sm:    10px;
  --radius:       14px;
  --radius-lg:    20px;

  /* layout */
  --player-h:     140px;
  --max-w:        1240px;
  --gutter:       20px;

  /* effects */
  --shadow-sm:    0 2px 10px rgba(0,0,0,0.35);
  --shadow:       0 8px 30px rgba(0,0,0,0.45);
  --shadow-lg:    0 20px 60px rgba(0,0,0,0.6);
  --transition:   180ms cubic-bezier(.2,.7,.2,1);
}

@media (min-width: 768px) {
  :root {
    --player-h: 92px;
    --gutter: 32px;
  }
}

/* ---------- reset / base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom));
  /* dotted glow at the top — subtle warmth */
  background-image:
    radial-gradient(900px 500px at 80% -10%, rgba(232, 176, 122, 0.08), transparent 60%),
    radial-gradient(700px 400px at 10% 0%, rgba(120, 110, 200, 0.06), transparent 55%);
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }

::selection { background: var(--accent-soft); color: var(--text); }

/* ---------- skip link / a11y ---------- */
.skip-link {
  position: absolute; inset-inline-start: 12px; top: -100px;
  background: var(--accent); color: #1a1207;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-weight: 700; z-index: 1000;
  transition: top var(--transition);
}
.skip-link:focus { top: 12px; }

/* ---------- hero ---------- */

.hero {
  padding: 56px var(--gutter) 40px;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 50% 100%, var(--accent-fade), transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  text-align: center;
}
.hero-mark {
  width: 44px; height: 44px;
  margin: 0 auto 18px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
  display: grid; place-items: center;
  padding: 9px;
}
.hero-mark svg { width: 100%; height: 100%; }

.hero-title {
  font-size: clamp(28px, 6vw, 44px);
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.hero-tagline {
  margin: 0 auto 28px;
  color: var(--text-muted);
  font-size: clamp(15px, 2.2vw, 18px);
  max-width: 560px;
}

.hero-actions {
  display: flex; flex-wrap: wrap;
  justify-content: center; gap: 10px;
}
.hero-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
}
.hero-btn:hover {
  background: var(--surface-3);
  border-color: var(--accent-soft);
  transform: translateY(-1px);
}
.hero-btn svg { width: 16px; height: 16px; opacity: 0.85; }
.hero-btn[data-kind="phone"] { background: var(--accent); color: #1a1207; border-color: transparent; }
.hero-btn[data-kind="phone"]:hover { background: var(--accent-hi); }
.hero-btn[data-kind="phone"] svg { opacity: 1; }

.hero-about-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color var(--transition);
}
.hero-about-link:hover { color: var(--accent); }
.hero-about-link svg { width: 14px; height: 14px; }

/* ---------- language toggle ---------- */

.lang-toggle-mount {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  z-index: 10;
}

.lang-toggle {
  padding: 6px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.lang-toggle:hover {
  color: var(--text);
  border-color: var(--accent-soft);
  background: var(--surface-3);
}
.lang-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* on the studio page, the toggle sits inside .page-head */
.page-head .lang-toggle-mount {
  position: static;
  margin-inline-start: auto;
}

/* ---------- filter chips ---------- */

.filters {
  position: sticky; top: 0; z-index: 50;
  padding: 14px var(--gutter);
  background: rgba(12, 12, 14, 0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.filters-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex; flex-wrap: nowrap; gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding-bottom: 2px;
}
.filters-inner::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 14px; font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  transition: all var(--transition);
  scroll-snap-align: start;
  white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--surface-3); }
.chip[aria-selected="true"] {
  background: var(--accent);
  color: #1a1207;
  border-color: transparent;
  font-weight: 700;
}

/* ---------- track grid ---------- */

.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px var(--gutter) 60px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 24px; }
}
@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
  position: relative;
  text-align: start;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--surface-3);
  background: var(--surface-2);
}
.card.is-playing {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.cover {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-2);
}
.cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 400ms cubic-bezier(.2,.7,.2,1);
}
.card:hover .cover img { transform: scale(1.04); }

.cover-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 12px;
  color: rgba(255,255,255,0.92);
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  line-height: 1.3;
  text-shadow: 0 1px 12px rgba(0,0,0,0.4);
}
.cover-fallback span { display: block; max-width: 100%; }

.cover-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.5));
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.card:hover .cover-overlay,
.card:focus-within .cover-overlay,
.card.is-playing .cover-overlay { opacity: 1; }

.cover-play {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1207;
  display: grid; place-items: center;
  box-shadow: 0 8px 22px rgba(0,0,0,0.5);
  transform: translateY(8px);
  transition: transform var(--transition);
  pointer-events: auto;
}
.card:hover .cover-play,
.card.is-playing .cover-play { transform: translateY(0); }
.cover-play:hover { background: var(--accent-hi); }
.cover-play svg { width: 20px; height: 20px; }
.cover-play[data-state="playing"] svg { width: 18px; height: 18px; }

.card-body {
  padding: 12px 14px 14px;
  display: flex; flex-direction: column; gap: 4px;
  flex: 1;
}
.card-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  /* clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.card-meta .pill {
  padding: 2px 8px;
  background: var(--surface-3);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 11px;
}
.card-meta .pill--artist {
  background: var(--accent-soft);
  color: var(--accent-hi);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 15px;
}

/* ---------- about ---------- */

.about {
  background: var(--bg-soft);
  border-top: 1px solid var(--border-soft);
  padding: 64px var(--gutter);
  scroll-margin-top: 80px;
}
.about[hidden] { display: none; }

.about-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}
@media (min-width: 768px) {
  .about-inner {
    grid-template-columns: 280px 1fr;
    gap: 48px;
  }
  .about.about--no-photo .about-inner { grid-template-columns: 1fr; max-width: 760px; }
}

.about-photo {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
}
.about-photo[hidden] { display: none; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.about-content { min-width: 0; }

.about-eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.about-name {
  margin: 0 0 6px;
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.about-role {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 15px;
}
.about-role[hidden] { display: none; }

.about-bio {
  color: var(--text);
  line-height: 1.85;
  margin-bottom: 26px;
}
.about-bio p {
  margin: 0 0 12px;
}
.about-bio p:last-child { margin-bottom: 0; }

.about-info {
  margin: 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--border-soft);
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 24px;
  row-gap: 12px;
  font-size: 14px;
}
.about-info dt {
  color: var(--text-dim);
  font-weight: 500;
  white-space: nowrap;
}
.about-info dd {
  margin: 0;
  color: var(--text);
  white-space: pre-line;
}
.about-info dd a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color var(--transition);
}
.about-info dd a:hover { border-bottom-color: var(--accent); }

/* ---------- footer ---------- */

.page-footer {
  text-align: center;
  padding: 28px var(--gutter);
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border-soft);
}
.page-footer p { margin: 0; }

/* ---------- player (fixed bottom) ---------- */

.player {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 100;
  background: rgba(18, 18, 22, 0.92);
  backdrop-filter: saturate(150%) blur(20px);
  -webkit-backdrop-filter: saturate(150%) blur(20px);
  border-top: 1px solid var(--border);
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  user-select: none;
  -webkit-user-select: none;
}
.player[hidden] { display: none; }

.player-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 18px;
  align-items: center;
}

@media (min-width: 768px) {
  .player-inner {
    grid-template-columns: minmax(220px, 1fr) 2fr;
  }
}

.player-meta {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}
.player-cover {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-3);
  flex-shrink: 0;
}
.player-cover img { width: 100%; height: 100%; object-fit: cover; }
.player-cover .cover-fallback { font-size: 11px; padding: 4px; }

.player-text { min-width: 0; flex: 1; }
.player-title {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.player-stack {
  display: flex; flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.player-controls {
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.player-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.player-btn:hover { background: var(--surface-3); }
.player-btn:active { transform: scale(0.94); }
.player-btn svg { width: 22px; height: 22px; }

.player-btn.player-play {
  width: 40px; height: 40px;
  background: var(--text);
  color: #0c0c0e;
}
.player-btn.player-play:hover { background: #fff; }
.player-btn.player-play svg { width: 22px; height: 22px; }

.player-progress {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}
.player-time {
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  min-width: 34px;
  text-align: center;
}

.player-seek {
  flex: 1;
  height: 18px;
  display: flex; align-items: center;
  cursor: pointer;
  position: relative;
  outline: none;
}
.player-seek-track {
  flex: 1;
  height: 4px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  transition: height var(--transition);
}
.player-seek:hover .player-seek-track,
.player-seek:focus .player-seek-track { height: 6px; }
.player-seek-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 80ms linear;
}
.player-seek:hover .player-seek-fill { background: var(--accent-hi); }

/* hide native audio element completely */
audio { display: none; }

/* ---------- toast ---------- */

.toast-container {
  position: fixed;
  bottom: calc(var(--player-h) + 16px + env(safe-area-inset-bottom));
  inset-inline: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
  z-index: 200;
  padding: 0 var(--gutter);
}
.toast {
  pointer-events: auto;
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow);
  max-width: 90vw;
  text-align: center;
  animation: toast-in 200ms ease-out, toast-out 200ms ease-in 3s forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

/* ---------- secondary page chrome (e.g. studio.html) ---------- */

body.page-studio { padding-bottom: env(safe-area-inset-bottom); }

.page-head {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--border-soft);
}
.page-head-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color var(--transition), background var(--transition);
}
.page-head-back:hover { color: var(--text); background: var(--surface-2); }
.page-head-back svg { width: 16px; height: 16px; }
.page-head-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

/* ---------- studio gallery slider ---------- */

.gallery-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px var(--gutter) 60px;
}

.gallery {
  display: flex; flex-direction: column;
  gap: 14px;
}

.gallery-stage {
  position: relative;
}

.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  aspect-ratio: 4 / 3;
  outline: none;
  -webkit-overflow-scrolling: touch;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track:focus-visible { box-shadow: 0 0 0 2px var(--accent-soft); }

@media (min-width: 600px) {
  .gallery-track { aspect-ratio: 16 / 10; }
}
@media (min-width: 900px) {
  .gallery-track { aspect-ratio: 16 / 9; }
}

.gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  position: relative;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.gallery-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.gallery-fallback {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  color: var(--text-dim);
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  padding: 20px;
  text-align: center;
}
.gallery-fallback svg { width: 48px; height: 48px; opacity: 0.5; }
.gallery-fallback span { font-size: 14px; color: var(--text-muted); }

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(12, 12, 14, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  border: 1px solid var(--border);
  z-index: 2;
  opacity: 0;
  transition: background var(--transition), opacity var(--transition);
}
.gallery-stage:hover .gallery-nav,
.gallery-stage:focus-within .gallery-nav { opacity: 1; }
.gallery-nav:hover { background: var(--surface-3); }
.gallery-nav:active { transform: translateY(-50%) scale(0.94); }
.gallery-nav svg { width: 22px; height: 22px; }
.gallery-nav--prev { inset-inline-start: 12px; }
.gallery-nav--next { inset-inline-end: 12px; }

@media (hover: none) {
  .gallery-nav { opacity: 0.85; }
}

.gallery-counter {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.gallery-dots {
  display: flex; justify-content: center;
  gap: 6px;
}
.gallery-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), width var(--transition);
}
.gallery-dot:hover { background: var(--surface-3); transform: scale(1.15); }
.gallery-dot[aria-current="true"] {
  background: var(--accent);
  width: 22px;
  border-radius: 999px;
}

.gallery-caption {
  text-align: center;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  margin: 0;
  min-height: 1.5em;
}

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