/* Card view of the framework — layered on /style.css and /framework/framework.css */

.fc {
  --wide: 52rem;
  --card: color-mix(in srgb, var(--ink) 3%, var(--ground));
  --faint: color-mix(in srgb, var(--ink) 22%, transparent);
}

.fc-head,
.fc-moments,
.fc-main,
.fc footer {
  max-width: calc(var(--wide) + 2 * var(--gutter));
}

.fc-head { padding-bottom: 1rem; }

.fc-moments { position: static; border-bottom: 0; padding-bottom: 0; }

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

.fc-main { padding-top: 1.25rem; }

.fc-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.6rem, 2vw, 1.25rem);
}

.fc-grid > li { display: flex; }

.fc-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: clamp(0.9rem, 3vw, 1.75rem);
  min-height: clamp(11rem, 34vw, 15rem);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.fc-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.fc-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.fc-card h2 {
  margin: auto 0 0;
  font-family: var(--display);
  font-size: clamp(1.05rem, 0.85rem + 1vw, 1.5rem);
  font-weight: 560;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
  font-variation-settings: "opsz" 72, "SOFT" 0, "WONK" 0;
}

.fc-n {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.fc-card .fw-chain { margin: 0.35rem 0 0; font-size: 0.82rem; }

@media (max-width: 559px) {
  .fc-card .fw-chain { display: none; }
}

.fc-alt { margin: 1.5rem 0 0; font-size: 0.92rem; }
.fc-alt a::after { content: "\00a0\2192"; }

/* ---------- icons ---------- */

.fc-icon {
  width: clamp(2.75rem, 9vw, 3.75rem);
  height: auto;
  margin-bottom: 0.75rem;
  overflow: visible;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fc-icon .keep { fill: var(--accent); stroke: var(--accent); }
.fc-icon .cut { stroke: var(--faint); }
.fc-icon .strike {
  stroke: var(--accent);
  stroke-dasharray: 48;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.4s ease;
}

.fc-icon .mood { stroke: var(--faint); stroke-width: 1.5; transition: opacity 0.3s ease; }
.fc-icon .line { stroke: var(--accent); stroke-width: 2.5; }
.fc-icon .dot { fill: var(--accent); stroke: none; }

.fc-icon .ground { stroke: var(--ink); stroke-width: 1.5; }
.fc-icon .root { stroke: var(--accent); stroke-width: 2.5; }
.fc-icon .root.faint { stroke: var(--faint); stroke-width: 1.5; }

.fc-icon .soil { fill: color-mix(in srgb, var(--ink) 14%, transparent); stroke: none; }
.fc-icon .seed { fill: var(--accent); stroke: none; }
.fc-icon .sprout {
  stroke: var(--accent);
  transform-origin: 32px 44px;
  transition: transform 0.35s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .fc-card:hover .strike { stroke-dashoffset: 48; animation: fc-draw 0.45s ease forwards; }
  .fc-card:hover .mood { opacity: 0.25; }
  .fc-card:hover .sprout { transform: scale(1.08); }
}

@keyframes fc-draw {
  from { stroke-dashoffset: 48; }
  to { stroke-dashoffset: 0; }
}

/* ---------- moment filter on cards ---------- */

.fc-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: none;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ground);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.6rem;
  text-align: center;
}

.fc.is-filtering .fc-card { opacity: 0.4; }
.fc.is-filtering .fc-card.has-match { opacity: 1; border-color: var(--accent); }
.fc.is-filtering .fc-card.has-match .fc-badge { display: block; }

/* ---------- in-page panel ---------- */

.fc-grid > li.fc-slot { grid-column: 1 / -1; display: block; }
.fc-grid > li.fc-slot[hidden] { display: none; }

.fc-panel {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--ground);
}

.fc-panel__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}

.fc-close {
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  width: 2.5rem;
  height: 2.5rem;
  margin: -0.5rem -0.5rem 0 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.fc-close:hover { color: var(--ink); background: var(--card); }

.fc-panel__n { margin: 0; }

.fc-panel h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  font-weight: 560;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
  font-variation-settings: "opsz" 96, "SOFT" 0, "WONK" 0;
}

.fc-panel__rules { max-width: var(--measure); }

/* the open card */
.fc-card[aria-expanded="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--ground));
  transform: none;
}

.fc-card[aria-expanded="true"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.45rem;
  width: 0.8rem;
  height: 0.8rem;
  background: inherit;
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  transform: translateX(-50%) rotate(45deg);
}

@media (prefers-reduced-motion: no-preference) {
  .fc-panel.is-in { animation: fc-reveal 0.25s ease both; }
}

@keyframes fc-reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* the chain, drawn as three steps on a line */
.fc-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 1.25rem 0 1.5rem;
  padding: 0;
  counter-reset: step;
}

.fc-steps li {
  position: relative;
  padding-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.fc-steps li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
}

.fc-steps li::after {
  content: "";
  position: absolute;
  top: 0.27rem;
  left: 0.8rem;
  right: 0.4rem;
  height: 1px;
  background: var(--rule);
}

.fc-steps li:last-child::after { display: none; }
.fc-steps li:last-child { color: var(--ink); font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
  .fc-panel.is-in .fc-steps li { animation: fc-step 0.35s ease both; }
  .fc-panel.is-in .fc-steps li:nth-child(2) { animation-delay: 0.08s; }
  .fc-panel.is-in .fc-steps li:nth-child(3) { animation-delay: 0.16s; }
}

@keyframes fc-step {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: none; }
}

.fc-panel__rules li { padding-left: 0.75rem; }

.fc-panel__nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.fc-panel__nav button {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.fc-panel__nav button:hover { border-color: var(--accent); }
.fc-prev::before { content: "\2190\00a0"; }
.fc-next::after { content: "\00a0\2192"; }

.fc-close:focus-visible,
.fc-panel__nav button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .fc-card { transition: none; }
  .fc-card:hover { transform: none; }
}
