/* ============================================================
   Cassian Vale — design system (rebuilt from the Figma Make source)
   Colors + type extracted from the source bundle CSS.
   ============================================================ */

/* ---- Variable fonts (self-hosted) ---- */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens ---- */
:root {
  --cream:     #f7f5ef;
  --ink:       #211d2b;
  --plum:      #2d1d3d;
  --violet:    #6854e8;
  --peach:     #ff8068;
  --lavender:  #e7e2ff;
  --line:      rgba(33, 29, 43, 0.14);
  --line-soft: rgba(33, 29, 43, 0.08);
  --muted:     #6b6478;
  --card:      #ffffff;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --maxw: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
[hidden] { display: none !important; }

/* ---- Top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 12px; }
.monogram {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--plum); color: var(--cream);
  font-family: var(--serif); font-size: 15px; font-weight: 600;
  letter-spacing: 0.5px;
}
.brand-name { font-size: 13px; font-weight: 700; letter-spacing: 2.5px; }
.main-nav { display: flex; gap: 26px; margin-left: auto; }
.main-nav a {
  font-size: 12.5px; font-weight: 600; letter-spacing: 1.5px;
  color: var(--muted); padding: 6px 0; position: relative;
  transition: color .18s;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; background: var(--violet); transition: right .22s ease;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a.is-active { color: var(--ink); }
.main-nav a.is-active::after { right: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 1.2px;
  padding: 11px 20px; border-radius: 999px;
  transition: transform .16s, background .18s, color .18s, box-shadow .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-signin {
  border: 1px solid var(--ink); color: var(--ink);
  padding: 9px 18px;
}
.btn-signin:hover { background: var(--ink); color: var(--cream); }
.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--violet) 88%, black); box-shadow: 0 6px 18px rgba(104,84,232,.28); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 30px; font-size: 13.5px; }

/* ---- Main / views ---- */
main { flex: 1; }
.view { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---- Hero ---- */
.hero {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px, 5vw, 64px);
  align-items: center; padding: clamp(36px, 6vw, 72px) 0 clamp(30px, 5vw, 56px);
}
.hero-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(40px, 7vw, 84px); line-height: 0.98; letter-spacing: -0.5px;
}
.hero-sub { margin-top: 22px; font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); max-width: 46ch; }
.hero-meta { margin-top: 26px; font-size: 12px; font-weight: 700; letter-spacing: 2.5px; color: var(--violet); }
.hero-cta {
  display: inline-block; margin-top: 20px; font-size: 13px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--ink); border-bottom: 2px solid var(--peach); padding-bottom: 4px;
  transition: color .18s, border-color .18s;
}
.hero-cta:hover { color: var(--peach); }
.hero-figure { position: relative; }
.hero-figure img {
  width: 100%; max-width: 460px; margin-left: auto;
  border-radius: 14px; box-shadow: 0 30px 70px rgba(45,29,61,.30);
  aspect-ratio: 900 / 1740; object-fit: cover;
}

/* ---- Bands (sections) ---- */
.band { padding: clamp(40px, 7vw, 84px) 0; border-top: 1px solid var(--line-soft); }
.band-label {
  font-size: 12px; font-weight: 700; letter-spacing: 3px; color: var(--violet);
  margin-bottom: 18px;
}
.band-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 4.6vw, 56px); line-height: 1.02; letter-spacing: -0.3px;
}
.band-body { margin-top: 18px; font-size: clamp(15px, 1.5vw, 18px); color: var(--muted); max-width: 52ch; }
.band-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center;
}
.live-pill {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 26px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: var(--plum);
  background: var(--lavender); padding: 9px 16px; border-radius: 999px;
}
.live-pill::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--peach);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--peach) 25%, transparent);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ---- Chat teaser (home) ---- */
.chat-teaser {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px; box-shadow: 0 18px 44px rgba(45,29,61,.10);
}
.chat-teaser-head { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 16px; }
.bubble { max-width: 88%; padding: 11px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; }
.bubble-you { background: var(--lavender); color: var(--plum); margin-left: auto; border-bottom-right-radius: 5px; }
.bubble-cassian { background: var(--plum); color: var(--cream); margin-right: auto; margin-top: 12px; border-bottom-left-radius: 5px; }

/* ---- Filter tabs ---- */
.filter-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 24px; }
.filter-tab {
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px; color: var(--muted);
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  transition: all .16s;
}
.filter-tab:hover { color: var(--ink); border-color: var(--ink); }
.filter-tab.is-active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.filter-tabs--lg .filter-tab { padding: 10px 20px; font-size: 12.5px; }

/* ---- Gallery grid ---- */
.gallery-grid { display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); }
.gallery-grid--preview { grid-template-columns: repeat(3, 1fr); }
.gcard {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px;
  overflow: hidden; cursor: pointer; transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.gcard:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(45,29,61,.16); }
.gcard-thumb { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--plum); }
.gcard-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gcard:hover .gcard-thumb img { transform: scale(1.05); }
.gcard-badge {
  position: absolute; top: 12px; left: 12px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 1px;
  background: rgba(33,29,43,.72); color: var(--cream); padding: 5px 10px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.gcard-play {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.gcard-play span {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(247,245,239,.9); color: var(--plum); font-size: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.gcard-body { padding: 15px 16px 18px; }
.gcard-meta { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; color: var(--violet); }
.gcard-title { font-family: var(--serif); font-size: 19px; font-weight: 500; margin-top: 6px; line-height: 1.15; }
.gcard-desc { font-size: 13.5px; color: var(--muted); margin-top: 6px; }

.link-arrow {
  display: inline-block; margin-top: 26px; font-size: 13px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--ink); border-bottom: 2px solid var(--violet); padding-bottom: 4px;
  transition: color .18s, border-color .18s;
}
.link-arrow:hover { color: var(--violet); }

/* ---- Page head (archive / stories) ---- */
.page-head { padding: clamp(36px, 6vw, 64px) 0 8px; }
.page-title { font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 5.5vw, 68px); line-height: 1.0; letter-spacing: -0.3px; }
.page-sub { margin-top: 16px; font-size: clamp(15px, 1.5vw, 18px); color: var(--muted); max-width: 56ch; }
#view-archive, #view-stories { padding-bottom: clamp(48px, 8vw, 96px); }

/* ---- Story list ---- */
.story-list { display: flex; flex-direction: column; gap: 16px; margin-top: 30px; }
.story-row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 20px; align-items: center;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 18px 22px; transition: transform .18s, box-shadow .18s; cursor: pointer;
}
.story-row:hover { transform: translateX(4px); box-shadow: 0 12px 30px rgba(45,29,61,.12); }
.story-play {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--violet); color: #fff; font-size: 18px;
}
.story-num { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--violet); }
.story-title { font-family: var(--serif); font-size: 21px; font-weight: 500; margin-top: 3px; }
.story-desc { font-size: 14px; color: var(--muted); margin-top: 5px; max-width: 60ch; }
.story-dur { font-size: 13px; font-weight: 700; letter-spacing: 1px; color: var(--muted); white-space: nowrap; }
.waveform { display: flex; align-items: center; gap: 2px; height: 26px; margin-top: 8px; }
.waveform i { width: 3px; border-radius: 2px; background: var(--lavender); }

/* ---- Story feature (home) ---- */
.story-feature {
  background: var(--plum); color: var(--cream); border-radius: 18px; padding: 28px;
  box-shadow: 0 20px 48px rgba(45,29,61,.24);
}
.story-feature .sf-label { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--peach); }
.story-feature .sf-title { font-family: var(--serif); font-size: 26px; font-weight: 500; margin-top: 10px; line-height: 1.1; }
.story-feature .sf-desc { font-size: 14.5px; color: color-mix(in srgb, var(--cream) 78%, transparent); margin-top: 12px; }
.story-feature .sf-wave { margin-top: 20px; }
.story-feature .sf-wave i { background: color-mix(in srgb, var(--cream) 34%, transparent); }
.story-feature .sf-meta { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.story-feature .sf-play {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--peach); color: var(--plum); font-size: 17px;
}
.story-feature .sf-dur { font-size: 13px; font-weight: 700; letter-spacing: 1px; }

/* ---- Invite ---- */
.invite {
  text-align: center; padding: clamp(56px, 9vw, 110px) 0; border-top: 1px solid var(--line-soft);
}
.invite-title { font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 5.5vw, 64px); line-height: 1.0; }
.invite-body { margin: 20px auto 0; max-width: 44ch; font-size: clamp(15px, 1.6vw, 18px); color: var(--muted); }
.invite .btn { margin-top: 30px; }

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--line-soft); margin-top: 20px;
  padding: clamp(36px, 5vw, 56px) var(--gutter);
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-tag { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 15px; }
.footer-nav { display: flex; gap: 24px; margin-top: 6px; }
.footer-nav a { font-size: 12px; font-weight: 600; letter-spacing: 1.5px; color: var(--muted); }
.footer-nav a:hover { color: var(--ink); }
.footer-copy { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---- Chat FAB + panel ---- */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--plum); color: var(--cream); padding: 13px 18px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 1px;
  box-shadow: 0 12px 30px rgba(45,29,61,.34); transition: transform .18s;
}
.chat-fab:hover { transform: translateY(-2px); }
.chat-fab-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--peach); animation: pulse 2s infinite; }
.chat-panel {
  position: fixed; right: 22px; bottom: 84px; z-index: 60;
  width: min(360px, calc(100vw - 44px)); height: min(520px, 70vh);
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 30px 70px rgba(45,29,61,.34); display: flex; flex-direction: column; overflow: hidden;
}
.chat-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; background: var(--plum); color: var(--cream);
}
.chat-panel-title { font-size: 14px; font-weight: 700; letter-spacing: 1.5px; }
.chat-panel-status { font-size: 10.5px; letter-spacing: 1.2px; color: color-mix(in srgb, var(--cream) 70%, transparent); margin-top: 2px; }
.chat-close { color: var(--cream); font-size: 26px; line-height: 1; padding: 0 4px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line-soft); }
.chat-input input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px; font-size: 14px;
  background: var(--cream); color: var(--ink);
}
.chat-input input:focus { outline: none; border-color: var(--violet); }
.chat-input button {
  width: 44px; height: 44px; border-radius: 50%; background: var(--violet); color: #fff; font-size: 17px;
  display: grid; place-items: center;
}

/* ---- Modal ---- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(33,29,43,.55); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; width: min(440px, 100%); background: var(--card); border-radius: 20px;
  padding: 34px 32px; box-shadow: 0 40px 90px rgba(0,0,0,.4);
}
.modal-close { position: absolute; top: 18px; right: 20px; font-size: 28px; color: var(--muted); }
.modal-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.modal-tab {
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px; color: var(--muted);
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
}
.modal-tab.is-active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.modal-title { font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1.1; }
.modal-sub { margin-top: 10px; color: var(--muted); font-size: 14.5px; }
.modal-form { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.modal-form input {
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; font-size: 14.5px;
  background: var(--cream); color: var(--ink);
}
.modal-form input:focus { outline: none; border-color: var(--violet); }
.modal-note { margin-top: 14px; font-size: 11px; letter-spacing: 1px; color: var(--muted); text-align: center; }

/* ---- Media viewer ---- */
.viewer { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; }
.viewer-backdrop { position: absolute; inset: 0; background: rgba(20,16,26,.86); backdrop-filter: blur(6px); }
.viewer-card { position: relative; max-width: min(920px, 94vw); }
.viewer-card img { max-height: 78vh; width: auto; max-width: 100%; border-radius: 12px; margin: 0 auto; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.viewer-cap { margin-top: 18px; text-align: center; color: var(--cream); }
.viewer-type { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--peach); }
.viewer-title { font-family: var(--serif); font-size: 26px; font-weight: 500; margin-top: 6px; }
.viewer-desc { font-size: 14.5px; color: color-mix(in srgb, var(--cream) 70%, transparent); margin-top: 6px; }
.viewer-close {
  position: absolute; top: -14px; right: -6px; font-size: 34px; color: var(--cream);
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 30px; }
  .hero-figure { order: -1; }
  .hero-figure img { margin: 0 auto; max-width: 340px; }
  .band-split { grid-template-columns: 1fr; gap: 28px; }
  .gallery-grid, .gallery-grid--preview { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .main-nav { gap: 16px; }
  .main-nav a { font-size: 11.5px; letter-spacing: 1px; }
  .brand-name { display: none; }
  .gallery-grid, .gallery-grid--preview { grid-template-columns: 1fr 1fr; gap: 14px; }
  .gcard-title { font-size: 17px; }
  .story-row { grid-template-columns: 48px 1fr; gap: 14px; }
  .story-play { width: 48px; height: 48px; }
  .story-dur { grid-column: 2; }
  .chat-fab-label { display: none; }
  .chat-fab { padding: 15px; }
}
@media (max-width: 420px) {
  .gallery-grid, .gallery-grid--preview { grid-template-columns: 1fr; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
