/* TabbyGato website: the two light demos (js/demo-light.mjs). Uses the page's tokens from site.css. */

/* ---------- The folder story (opening section) ---------- */
.fs { margin-top: 64px; }
.fs-stage {
  display: grid;
  grid-template-columns: minmax(0, 5fr) auto minmax(0, 7fr);
  align-items: start;
  gap: 28px;
}
.fs-label {
  font-family: var(--text); font-size: 15px; font-weight: 650; letter-spacing: -0.005em;
  color: var(--muted); margin: 0 0 12px;
}

/* Left: a plain file list in a neutral look, so it reads as "your computer" and not as TabbyGato. */
.fs-window {
  background: #F7F7F5;
  border: 1px solid #D9DAD6;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(32, 38, 37, .05), 0 16px 36px -22px rgba(32, 38, 37, .35);
  overflow: hidden;
  font-size: 14.5px;
}
.fs-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  background: #EEEEEB; border-bottom: 1px solid #DEDFDB;
  font-weight: 600; color: var(--ink);
}
.fs-bar svg { width: 18px; height: 18px; }
.fs-head, .fs-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 86px; align-items: center; column-gap: 12px;
  padding: 0 14px;
}
.fs-head {
  min-height: 30px; border-bottom: 1px solid #E4E5E1;
  font-size: 12.5px; font-weight: 600; color: #5B635F;
}
.fs-tree, .fs-tree ul { list-style: none; margin: 0; padding: 0; }
.fs-row {
  min-height: 34px;
  border-bottom: 1px solid #ECEDEA;
  color: var(--ink);
}
.fs-tree > li:last-child > .fs-row { border-bottom: 0; }
.fs-name { display: flex; align-items: center; gap: 8px; min-width: 0; padding-block: 6px; line-height: 1.3; }
.fs-name svg { width: 16px; height: 16px; flex: none; }
.fs-tree ul .fs-name { padding-left: 26px; }
.fs-kind { font-size: 12.5px; color: #5B635F; white-space: nowrap; }
.fs-folder > .fs-row .fs-name { font-weight: 600; }
.fs-count {
  padding: 8px 14px; border-top: 1px solid #E4E5E1; background: #EEEEEB;
  font-size: 12.5px; color: #5B635F; font-variant-numeric: tabular-nums;
}
.ic-folder { fill: #DCD3C2; stroke: #8C8371; stroke-width: 1.4; stroke-linejoin: round; }
.ic-file { fill: #FFF; stroke: #7E8580; stroke-width: 1.4; stroke-linejoin: round; }
.ic-file path + path { fill: none; }

/* Middle: the one button */
.fs-action { align-self: center; display: grid; justify-items: center; gap: 10px; padding-top: 28px; }
.fs-add, .fs-reset {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 48px; padding: 0 20px 0 16px;
  border-radius: 999px; font-size: 16px; font-weight: 620; white-space: nowrap;
  transition: background-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.fs-add {
  border: 0; background: var(--accent); color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(32, 38, 37, .12), 0 10px 22px -12px rgba(36, 92, 83, .7);
}
.fs-add:hover { background: var(--accent-hover); }
.fs-add:active { transform: translateY(1px); }
.fs-reset { border: 1px solid rgba(36, 92, 83, .28); background: #E3ECE6; color: var(--accent); }
.fs-reset:hover { background: #D6E4DB; }
.fs-add svg, .fs-reset svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fs-add[hidden], .fs-reset[hidden] { display: none; }

/* Right: TabbyGato's Home, in the app's own look */
.fs-app {
  background: var(--score);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-frame);
  padding: 18px;
  min-height: 100%;
}
.fs-top { margin-bottom: 14px; }
.fs-top-title { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; color: var(--ink); }
.fs-status { margin: -8px 0 14px; font-size: 14px; color: var(--muted); }
.fs-status:empty { display: none; }
.fs-invite {
  display: grid; place-items: center; text-align: center;
  min-height: 150px; padding: 20px; margin-bottom: 12px;
  border: 1.5px dashed #C3CDC5; border-radius: 12px;
  font-size: 15.5px; color: var(--muted); text-wrap: balance;
}
.fs-shelves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.fs-shelf {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px 8px;
}
.fs-shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.fs-shelf h4 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.fs-shelf-head span { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fs-shelf ul { list-style: none; margin: 0; padding: 0; }
.fs-shelf li { display: grid; padding: 5px 0 6px; line-height: 1.3; }
.fs-shelf li + li { border-top: 1px solid #EEF1EC; }
.fs-shelf li b { font-size: 14px; font-weight: 620; color: var(--ink); overflow-wrap: anywhere; }
.fs-shelf li span { font-size: 12.5px; color: var(--muted); }
.fs-samples { grid-column: 1 / -1; }
.fs-samples ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
.fs-samples li + li { border-top: 0; }

/* Before the press: the invitation and the sample songs. After: the shelves from the folder. */
.fs-stage[data-state="before"] .fs-new,
.fs-stage[data-state="before"] .fs-top { display: none; }
.fs-stage[data-state="after"] .fs-invite { display: none; }

/* The one authored moment: the file list reads once, top to bottom, then the songs settle onto shelves. */
@media (prefers-reduced-motion: no-preference) {
  .fs-animate[data-state="after"] .fs-row { animation: fs-read .5s var(--ease) both; animation-delay: calc(var(--r, 0) * 32ms); }
  .fs-animate[data-state="after"] .fs-new { animation: fs-shelf .45s var(--ease-out) both; animation-delay: 380ms; }
  .fs-animate[data-state="after"] .fs-new li { animation: fs-settle .55s var(--ease-out) both; animation-delay: calc(440ms + var(--i, 0) * 55ms); }
  .fs-animate[data-state="after"] .fs-top { animation: fs-shelf .4s var(--ease-out) both; animation-delay: 300ms; }
}
@keyframes fs-read { 0%, 100% { background-color: transparent; } 35% { background-color: #E3ECE6; } }
@keyframes fs-shelf { from { opacity: 0; } to { opacity: 1; } }
@keyframes fs-settle { from { opacity: 0; transform: translateY(-14px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }

.fs-safe {
  display: flex; align-items: center; gap: 10px;
  max-width: none; margin: 28px 0 0;
  font-size: 16px; font-weight: 550; color: var(--ink);
}
.fs-safe .dot { --c: var(--cat-4); }
.fs-links { display: flex; flex-wrap: wrap; gap: 0 22px; margin-top: 4px; }

@media (max-width: 1050px) {
  .fs-stage { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .fs-action { padding-top: 0; justify-items: start; }
}
@media (max-width: 700px) {
  .fs { margin-top: 44px; }
  .fs-shelves, .fs-samples ul { grid-template-columns: minmax(0, 1fr); }
  .fs-app { padding: 14px; }
  .fs-safe { align-items: flex-start; }
  .fs-safe .dot { margin-top: 9px; }
}
@media (max-width: 420px) {
  .fs-head, .fs-row { grid-template-columns: minmax(0, 1fr); }
  .fs-kind { display: none; }
}

/* ---------- Count and metronome (Minute 4) ---------- */
.cd {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 28px 22px;
  box-shadow: var(--shadow-soft);
}
.cd-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; }
.cd-head h4 { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; margin: 0; }
.cd-play {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px 0 14px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-size: 15px; font-weight: 620; white-space: nowrap;
  transition: background-color .18s var(--ease);
}
.cd-play:hover { background: var(--accent-hover); }
.cd-play svg { width: 18px; height: 18px; flex: none; fill: currentColor; }
.cd-play .i-stop { display: none; }
.cd-play[aria-pressed="true"] .i-play { display: none; }
.cd-play[aria-pressed="true"] .i-stop { display: block; }

/* One bar of four beats. Each beat holds its clicks: 1, 2, 3 or 4 of them. */
.cd-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px;
  padding: 10px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.cd-beat { display: flex; gap: 2px; }
.cd-cell {
  position: relative; flex: 1 1 0; min-width: 0;
  display: grid; place-items: center;
  height: 52px; border-radius: 9px;
  font-size: 19px; font-weight: 450; color: #5F6C64; line-height: 1;
  transition: background-color .08s linear, color .08s linear;
}
.cd-cell.is-beat, .cd-cell.is-accent { font-size: 24px; font-weight: 650; color: var(--ink); }
/* The accent: a short stripe under each accented click */
.cd-cell.is-accent::after {
  content: ""; position: absolute; left: 50%; bottom: 6px;
  width: 18px; height: 4px; margin-left: -9px; border-radius: 4px;
  background: var(--cat-2);
}
.cd-cell.is-mark::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9AA59D; }
.cd-cell.is-now { background: #DCEADF; color: var(--accent); }
.cd-cell.is-now.is-mark::before { background: var(--accent); }

.cd-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 20px; }
.cd-field { display: grid; gap: 8px; }
.cd-label { font-size: 15px; font-weight: 620; color: var(--ink); }
.cd-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.cd-seg button {
  min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--score); font-size: 14.5px; font-weight: 600; color: var(--muted);
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.cd-seg button:hover { color: var(--ink); border-color: #B9C4BB; }
.cd-seg button[aria-pressed="true"] { background: #DCEADF; border-color: rgba(36, 92, 83, .35); color: var(--accent); }

/* The second row is quieter: smaller type, and a hairline above it */
.cd-quiet { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); grid-template-columns: auto minmax(0, 1fr); column-gap: 28px; align-items: start; }
.cd-quiet .cd-label { font-size: 14px; color: var(--muted); }
.cd-quiet .cd-seg button { font-size: 13.5px; padding: 0 12px; }
.cd-readout { margin: 18px 0 0; font-size: 16px; color: var(--ink); text-wrap: pretty; }

@media (max-width: 1050px) and (min-width: 701px) {
  .cd-quiet { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .cd { padding: 20px 16px 18px; }
  .cd-head h4 { font-size: 18px; }
  .cd-row { gap: 3px; }
  .cd-beat { gap: 1px; }
  .cd-cell { height: 44px; font-size: 15px; border-radius: 7px; }
  .cd-cell.is-beat, .cd-cell.is-accent { font-size: 19px; }
  .cd-cell.is-accent::after { width: 12px; margin-left: -6px; bottom: 4px; }
  .cd-quiet { grid-template-columns: minmax(0, 1fr); }
  .cd-seg button { padding: 0 11px; }
  /* A phone's beat is about 66px wide: the beat number gives up room so "trip" and "let" stay two words */
  .cd-row[data-value="triplets"] .cd-cell { flex-grow: .7; }
  .cd-row[data-value="triplets"] .cd-cell.is-between { flex-grow: 1.15; font-size: 13px; }
}
