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

/* Avenir Next, the Impulse Arc typeface, self-hosted so it renders everywhere. */
@font-face {
  font-family: "Avenir Next"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("/fonts/avenir-next-medium.woff2") format("woff2"), url("/fonts/avenir-next-medium.woff") format("woff");
}
@font-face {
  font-family: "Avenir Next"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/fonts/avenir-next-bold.woff2") format("woff2"), url("/fonts/avenir-next-bold.woff") format("woff");
}
@font-face {
  font-family: "Avenir Next"; font-weight: 500; font-style: italic; font-display: swap;
  src: url("/fonts/avenir-next-medium-italic.woff2") format("woff2"), url("/fonts/avenir-next-medium-italic.woff") format("woff");
}

:root {
  --font: "Avenir Next", "Avenir", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg: #100c0a;
  --bg-surface: #1b1512;
  --bg-hover: #241c17;
  --bg-active: #2c221b;
  --text: #f1ece4;
  --text-dim: #ab9e8f;
  --accent: #7f97b5;
  --accent-ink: #0e1218;
  --danger: #d9694e;
  --border: rgba(255, 255, 255, 0.09);
  --radius: 12px;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.logo:hover { text-decoration: none; }
.logo .fm { color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn:active { opacity: 0.8; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); }

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn-sm:hover { opacity: 0.9; text-decoration: none; }
.btn-sm.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-sm.btn-icon { padding: 6px 8px; }
.btn-danger { background: var(--danger); }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  padding: 0;
}

.inline { display: inline; }

/* Landing */
.landing { max-width: 720px; margin: 0 auto; padding: 80px 24px; }
.hero { text-align: center; margin-bottom: 64px; }
.hero h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 16px; }
.hero-sub { color: var(--text-dim); font-size: 16px; max-width: 480px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; }

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.features.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.feature {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 24px;
}
.feature h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.feature p { color: var(--text-dim); font-size: 14px; }

.roadmap {
  margin-top: 72px;
  text-align: center;
}
.roadmap h2 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.roadmap-sub { color: var(--text-dim); font-size: 14px; max-width: 520px; margin: 0 auto 20px; line-height: 1.7; }
.roadmap .hint { margin-top: 8px; }

.mail-form {
  display: flex;
  gap: 8px;
  justify-content: center;
  max-width: 420px;
  margin: 0 auto;
}
.mail-form input {
  flex: 1;
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}
.mail-form input:focus { border-color: var(--accent); }

@media (max-width: 520px) {
  .features, .features.cols-3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 24px; }
}

/* Auth */
.auth-page {
  max-width: 360px;
  margin: 80px auto;
  padding: 0 24px;
}
.auth-page h1 { font-size: 20px; font-weight: 600; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-dim); }
.auth-form input {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
}
.auth-form input:focus { border-color: var(--accent); }

textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  margin-bottom: 8px;
}
textarea:focus { border-color: var(--accent); }
.auth-note { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin: -8px 0 20px; }
.auth-alt { margin-top: 20px; font-size: 14px; color: var(--text-dim); }
.form-error { color: var(--danger); font-size: 14px; margin-bottom: 12px; }
.form-success { color: var(--accent); font-size: 14px; margin-bottom: 12px; }
.hint { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* Full-width notice above page content (billing advance notice, etc). */
.banner {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 20px 0;
  font-size: 14px;
}
.banner a { color: var(--accent); }
.banner-error { border-left-color: var(--danger); }

/* Ledger layout (pricing page) */
.ledger-section { max-width: 600px; margin: 0 auto; }
.ledger-intro { font-size: 15px; color: var(--text-dim); line-height: 1.7; margin-bottom: 32px; }
.ledger { width: 100%; border-collapse: collapse; margin-bottom: 32px; }
.ledger td { padding: 14px 0; vertical-align: top; font-size: 15px; border-bottom: 1px solid var(--border); }
.ledger-item { width: 90px; font-weight: 600; color: var(--text); padding-right: 16px; }
.ledger-rate { width: 180px; color: var(--text); padding-right: 24px; white-space: nowrap; }
.ledger-note { color: var(--text-dim); }
.ledger-footer { font-size: 13px; color: var(--text-dim); line-height: 1.7; }

@media (max-width: 520px) {
  .ledger-rate { white-space: normal; }
  .ledger-note { display: none; }
}

/* Dashboard */
.dashboard { display: flex; min-height: calc(100vh - 49px); }
.dash-sidebar {
  width: 220px;
  border-right: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}
.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav-item {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
}
.dash-nav-item:hover { background: var(--bg-hover); text-decoration: none; }
.dash-nav-item.active { background: var(--bg-active); color: var(--accent); }

.dash-storage { font-size: 12px; color: var(--text-dim); }
.storage-label { margin-bottom: 4px; }
.storage-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.storage-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }
.storage-tier { margin-top: 4px; text-transform: capitalize; }

.dash-content { flex: 1; padding: 24px 32px; max-width: 800px; }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.dash-header h2 { font-size: 20px; font-weight: 600; }

.proj-list { display: flex; flex-direction: column; gap: 8px; }
.proj-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.proj-title { font-weight: 500; color: var(--text); }
.proj-title:hover { color: var(--accent); }
.proj-meta { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.proj-actions { display: flex; gap: 8px; }
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-active);
  color: var(--text-dim);
  text-transform: capitalize;
}
.empty-state { color: var(--text-dim); font-size: 14px; }

.proj-url { margin-bottom: 24px; }
.proj-url code {
  display: block;
  background: var(--bg-surface);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  word-break: break-all;
}
.proj-url a { color: var(--text-dim); }
.proj-url a:hover { color: var(--accent); }

.section { margin-bottom: 32px; }
.section h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.section-compact { margin-bottom: 20px; }
.section-compact h3 { margin-bottom: 6px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); font-size: 14px; }

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  margin-bottom: 16px;
}
.upload-area:hover, .upload-area.dragover { border-color: var(--accent); }
.upload-area p { color: var(--text-dim); font-size: 14px; }

.file-list { display: flex; flex-direction: column; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.file-num { width: 28px; text-align: right; color: var(--text-dim); font-size: 12px; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.file-name { color: var(--text); text-decoration: none; }
a.file-name:hover { color: var(--accent); }
.file-plays { color: var(--text-dim); font-size: 13px; white-space: nowrap; }
.file-duration { color: var(--text-dim); font-size: 13px; }
.file-size { color: var(--text-dim); font-size: 13px; width: 60px; text-align: right; }
.file-reorder { display: inline-flex; gap: 2px; }
.btn-sm[disabled] { opacity: 0.3; cursor: default; pointer-events: none; }

.cover-manage { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.cover-preview { width: 160px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-surface); }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  width: 220px;
}
.inline-form input:focus { border-color: var(--accent); }

.code-block {
  background: var(--bg-surface);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-family: "SF Mono", "Menlo", monospace;
  color: var(--text-dim);
  overflow-x: auto;
}

.code-block-wrap {
  position: relative;
}
.code-block-wrap .code-block {
  padding-right: 40px;
}
.btn-copy {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.btn-copy:hover { color: var(--text); background: var(--bg-hover); }

.settings-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.settings-label { width: 140px; color: var(--text-dim); flex-shrink: 0; }

.token-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.token {
  background: var(--bg-surface);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: "SF Mono", "Menlo", monospace;
  color: var(--text-dim);
  word-break: break-all;
}
.token-regen { margin-top: 8px; }

.danger-zone { border-top: 1px solid var(--danger); padding-top: 24px; margin-top: 48px; }
.danger-zone h3 { color: var(--danger); }

.upload-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; }
.upload-item-name { flex: 1; }
.upload-item-bar { width: 120px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.upload-item-fill { height: 100%; background: var(--accent); transition: width 0.1s; }
.upload-item-fill.ok { background: var(--accent); }
.upload-item-fill.error { background: var(--danger); }
.upload-item-status { font-size: 12px; color: var(--text-dim); width: 60px; text-align: right; }

/* Profile */
.profile { max-width: 560px; margin: 0 auto; padding: 48px 24px; }
.profile-header { margin-bottom: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-header h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.profile-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.profile-followers { font-size: 13px; color: var(--text-dim); margin: -24px 0 24px; }

/* Feed */
.feed { max-width: 640px; margin: 0 auto; padding: 48px 24px; }
.feed h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 24px; }
.feed-list { display: flex; flex-direction: column; }
/* Each row pairs the share card (an anchor) with a sibling copy-link button,
   so the button never sits inside the anchor and cannot trigger navigation. */
.feed-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.feed-item-row .feed-item { flex: 1; min-width: 0; border-bottom: none; }
.feed-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.feed-item:hover { text-decoration: none; }
.feed-item:hover .feed-track { color: var(--accent); }
.feed-track { font-weight: 500; }
.feed-meta { font-size: 13px; color: var(--text-dim); }
.profile-shares { display: flex; flex-direction: column; gap: 6px; }
.profile-share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-surface);
  border-radius: var(--radius);
  color: var(--text);
  transition: background 0.1s;
}
.profile-share:hover { background: var(--bg-hover); text-decoration: none; }
.profile-share-title { font-weight: 500; }
.profile-share-meta { font-size: 13px; color: var(--text-dim); }

@media (max-width: 640px) {
  .dashboard { flex-direction: column; }
  .dash-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    padding: 12px 16px;
  }
  .dash-nav { flex-direction: row; gap: 8px; }
  .dash-storage { display: none; }
  .dash-content { padding: 20px 16px; }
  .proj-card { flex-direction: column; align-items: flex-start; gap: 12px; }
  /* The file row has many controls; on narrow screens drop the secondary
     metadata (also shown on Insights) so the name and the reorder/delete
     controls keep usable width and tap targets. */
  .file-row { gap: 8px; }
  .file-size, .file-plays { display: none; }
}

.site-footer {
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

.footer-links { margin-left: 16px; }
.footer-links a { color: var(--text-dim); margin-left: 12px; }
.footer-links a:hover { color: var(--text); }

/* Text pages (terms, privacy, support) */
.text-page { max-width: 640px; margin: 0 auto; padding: 64px 24px; }
.text-page h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.text-page h2 { font-size: 15px; font-weight: 600; margin: 28px 0 8px; }
.text-page p { font-size: 14px; color: var(--text-dim); margin-bottom: 8px; line-height: 1.7; }
.text-page code { font-family: "SF Mono", "Menlo", monospace; font-size: 13px; color: var(--text); }
.text-page .code-block { margin: 4px 0 8px; }
.text-meta { font-size: 12px; }

/* Home / public feed */
.home { max-width: 1140px; margin: 0 auto; padding: 8px 28px 90px; }
.home-hero { position: relative; max-width: 680px; padding: 40px 0 36px; }
.home-hero::before {
  content: ""; position: absolute; left: -120px; top: -60px; width: 520px; height: 320px;
  background: radial-gradient(60% 60% at 30% 30%, rgba(234,184,106,0.16), transparent 70%);
  pointer-events: none; z-index: -1;
}
.home-hero h1 { font-size: 38px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.06; }
.home-sub { color: var(--text-dim); font-size: 16px; margin-top: 14px; line-height: 1.6; }
.home-hero .hero-actions { justify-content: flex-start; margin-top: 24px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.fcard { display: block; color: var(--text); }
.fcard:hover { text-decoration: none; }
.fcard-cover {
  aspect-ratio: 1 / 1; border-radius: 14px; position: relative; overflow: hidden;
  box-shadow: 0 8px 26px rgba(0,0,0,0.35); display: flex; align-items: flex-end; justify-content: flex-end;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.fcard-play { margin: 14px; color: rgba(255,255,255,0.94); opacity: 0; transform: translateY(4px);
  transition: opacity 0.16s, transform 0.16s; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.45)); }
.fcard:hover .fcard-cover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0,0,0,0.48); }
.fcard:hover .fcard-play { opacity: 1; transform: translateY(0); }
.fcard-title { font-weight: 700; font-size: 15px; margin-top: 12px; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard-meta { color: var(--text-dim); font-size: 13px; margin-top: 3px; }

@media (max-width: 520px) {
  .home { padding: 4px 18px 70px; }
  .home-hero h1 { font-size: 28px; }
  .fgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
}
