/* fwdslsh.dev: the components only this site has. The look itself — palette,
   type, layout, prose, code, tables, buttons, cards, hero, footer — is the
   family theme, assets/style.css from unify-docs-template, which this site
   extends (unify.yaml); _includes/head.html links this file after it. */

/* ===== Masthead: the tools dropdown, the icon links and the phone menu ===== */

.head-icons, .head-menu-panel ul { list-style: none; margin: 0; padding: 0; }
.head-menu-panel li { margin: 0; }

/* The current section: each page's <body> carries its section's class (unify's
   root-attribute merge), so the nav needs no script to know where it is. */
body.tools .nav-tools,
body.blog .nav-blog,
body.members .nav-members,
body.about .nav-about { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent-bright); }
body.tools .nav-tools::before,
body.blog .nav-blog::before,
body.members .nav-members::before,
body.about .nav-about::before { color: var(--accent); }

.nav-caret svg { width: 14px; height: 14px; margin-left: 2px; transition: transform var(--dur); }

.nav-dropdown { position: relative; }

.nav-dropdown-content {
  position: absolute;
  top: 100%;
  left: -0.75rem;
  width: min(300px, calc(100vw - 2rem));
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--dur), transform var(--dur), visibility var(--dur);
}

.nav-dropdown:is(:hover, :focus-within) .nav-dropdown-content { opacity: 1; visibility: visible; transform: none; }
.nav-dropdown:is(:hover, :focus-within) .nav-caret svg { transform: rotate(180deg); }

.nav-tool-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  text-decoration: none;
}
.nav-tool-link:hover { background: var(--accent-tint); }

.nav-tool-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border: 1px solid var(--border-faint);
  border-radius: var(--radius);
  color: var(--accent);
}
.nav-tool-icon svg { width: 18px; height: 18px; }

.nav-tool-name { display: block; font: 600 0.875rem var(--mono); color: var(--text); }
.nav-tool-desc { display: block; font-size: 0.8125rem; color: var(--dim); }

.nav-all {
  display: block;
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border-faint);
  font: 400 0.8125rem var(--mono);
  text-decoration: none;
}

.head-icons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border-faint);
}
.head-icons a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: var(--text-2);
}
.head-icons a:hover { color: var(--accent); background: var(--accent-tint); }
.head-icons svg { width: 20px; height: 20px; }

/* Phones: the links fold into a disclosure, no script needed. */
.head-menu { display: none; position: relative; }

.head-menu summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.head-menu summary::-webkit-details-marker { display: none; }
.head-menu summary svg { width: 22px; height: 22px; }
.head-menu[open] summary { color: var(--accent); }

.head-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(260px, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}
.head-menu-panel .nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  font: 400 0.875rem var(--mono);
  color: var(--text-2);
  text-decoration: none;
}
.head-menu-panel .nav-link::before { content: "/"; color: var(--dim); }
.head-menu-panel ul ul { padding-left: 1.5rem; margin-bottom: 0.5rem; }

.nav-sublink {
  display: flex;
  align-items: center;
  min-height: 2.25rem;
  font: 400 0.8125rem var(--mono);
  color: var(--dim);
  text-decoration: none;
}

@media (max-width: 40rem) {
  .site-head .head-links { display: none; }
  .head-menu { display: block; }
  .head-icons { margin-left: auto; padding-left: 0; border-left: 0; gap: 0; }
}

/* ===== Section tabs (the tool pages) ===== */

.tabs { border-bottom: 1px solid var(--border-faint); margin-bottom: 2rem; }

.tabs ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  white-space: nowrap;
}
.tabs li { margin: 0; }

.tabs a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font: 400 0.875rem var(--mono);
  color: var(--dim);
  text-decoration: none;
}
.tabs a:hover { color: var(--text); }

/* The current tab: each section page's body class (from its frontmatter) names it. */
body.t-overview .tab-overview,
body.t-start .tab-start,
body.t-concepts .tab-concepts,
body.t-examples .tab-examples,
body.t-templates .tab-templates,
body.t-browse .tab-browse,
body.t-users .tab-users {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent-bright);
}

/* Narrow screens: the tabs collapse into a disclosure menu instead of scrolling
   sideways. The summary shows the section name plus the current tab. */
.tabs-toggle { display: none; }

body.t-overview .tabs-current::before { content: "· Overview"; }
body.t-start .tabs-current::before { content: "· Getting started"; }
body.t-concepts .tabs-current::before { content: "· How it works"; }
body.t-examples .tabs-current::before { content: "· Examples"; }
body.t-templates .tabs-current::before { content: "· Templates"; }
body.t-browse .tabs-current::before { content: "· Browse templates"; }
body.t-users .tabs-current::before { content: "· Who's using it"; }

@media (max-width: 40rem) {
  .tabs { position: relative; }
  .tabs-toggle { display: block; }

  .tabs-toggle summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    font: 400 0.875rem var(--mono);
    color: var(--accent);
    cursor: pointer;
    list-style: none;
  }
  .tabs-toggle summary::-webkit-details-marker { display: none; }
  .tabs-toggle summary svg { width: 16px; height: 16px; margin-left: auto; transition: transform var(--dur); }
  .tabs-toggle[open] summary svg { transform: rotate(180deg); }

  .tabs ul { display: none; }
  .tabs-toggle[open] + ul {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    inset: 100% 0 auto;
    z-index: 10;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-faint);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    white-space: normal;
  }
  .tabs-toggle[open] + ul a { box-shadow: none; }
}

/* ===== Code blocks: the copy button and syntax colours main.js adds ===== */

.code-wrap { position: relative; max-width: var(--measure-wide); }
.code-wrap > pre { margin-top: 0; }

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font: 400 0.75rem var(--mono);
  color: var(--dim);
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  padding: 2px 0.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--dur), color var(--dur), border-color var(--dur);
}
.copy-btn svg { width: 12px; height: 12px; }
.code-wrap:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover, .copy-btn[data-copied] { color: var(--accent); border-color: var(--accent); opacity: 1; }

@media (max-width: 48rem) {
  .code-wrap { margin-inline: calc(-1 * var(--gutter)); max-width: none; }
  .code-wrap > pre { border-radius: 0; border-inline: 0; }
}

.shj-syn-cmnt { color: var(--dim); font-style: italic; }
.shj-syn-str, .shj-syn-insert { color: #9ee6a8; }
.shj-syn-kwd, .shj-syn-err, .shj-syn-deleted { color: #ff8b7e; }
.shj-syn-num, .shj-syn-bool, .shj-syn-type, .shj-syn-oper, .shj-syn-var, .shj-syn-section { color: var(--accent-2); }
.shj-syn-class { color: #ffc27a; }
.shj-syn-func { color: #d6b4ff; }

/* ===== Tool cards: the install line ===== */

.card .install {
  margin-top: auto;
  font: 400 0.8125rem/1.5 var(--mono);
  color: var(--text);
  background: var(--bg-panel);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  overflow-x: auto;
  white-space: nowrap;
}
.card .install::before { content: "$ "; color: var(--dim); }

.card h3 img { width: 20px; height: 20px; flex-shrink: 0; }
.card.template h3 { overflow-wrap: anywhere; }

/* ===== Compare (unify "Why unify?") ===== */

.compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  max-width: var(--measure-wide);
  margin-block: 1.5rem;
}
.compare .vs { font: 600 0.875rem var(--mono); color: var(--dim); }

@media (max-width: 37.5rem) {
  .compare { grid-template-columns: 1fr; }
  .compare .vs { justify-self: center; }
}

/* ===== Members ===== */

.member {
  display: flex;
  max-width: var(--measure-wide);
  margin-bottom: 1rem;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-lg);
}
.member img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}
.member-body { display: grid; gap: 0.5rem; min-width: 0; }
.member h2 { margin: 0; font-size: 1.125rem; }
.member h2::before { content: none; }
.member h2 a { color: var(--text); text-decoration: none; }
.member h2 a:hover { color: var(--accent); }
.member p { margin: 0; font-size: 0.9375rem; }

/* ===== Blog ===== */

.post-list {
  list-style: none;
  padding: 0;
  max-width: var(--measure);
  border-top: 1px solid var(--border-faint);
}
.post-list li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.25rem 1rem;
  margin: 0;
  padding-block: 1rem;
  border-bottom: 1px solid var(--border-faint);
}
.post-list time {
  font: 400 0.8125rem/1.9 var(--mono);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.post-list a { font-weight: 600; color: var(--text); text-decoration: none; }
.post-list a:hover { color: var(--accent); }
.post-list p { grid-column: 2; margin: 0; font-size: 0.9375rem; }
.post-list .post-by { font: 400 0.8125rem var(--mono); color: var(--dim); }

@media (max-width: 30rem) {
  .post-list li { grid-template-columns: 1fr; }
  .post-list p { grid-column: 1; }
}

.empty-state {
  max-width: var(--measure);
  padding: 2rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.post-back { margin-top: 3rem; font: 400 0.875rem var(--mono); }

/* ===== Footer: brand and two link columns ===== */

.foot-grid {
  max-width: var(--site);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  text-align: left;
  font: 400 0.8125rem/1.6 var(--mono);
}
.foot-grid h2 {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.foot-grid li { margin: 0; }
.foot-grid a { display: inline-flex; align-items: center; min-height: 2rem; color: var(--text-2); text-decoration: none; }
.foot-grid a:hover { color: var(--accent); }
.foot-brand { display: grid; gap: 0.75rem; align-content: start; }
.foot-brand p { font-size: 0.8125rem; }

@media (max-width: 48rem) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}

/* ===== The model benchmark ledger ===== */

.model-ledger-page main { max-width: none; padding-inline: clamp(1rem, 2vw, 2rem); }
.model-ledger { margin-block: 1.5rem; min-width: 0; font-size: 0.875rem; }
.model-ledger .ledger-controls[hidden], .model-ledger .ledger-actions[hidden] { display: none; }
.model-ledger > p { margin-bottom: 0.75rem; }
.model-ledger .ledger-status { color: var(--text); font-family: var(--mono); }
.model-ledger .ledger-help { color: var(--dim); }
.model-ledger .ledger-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-block: 1.5rem; }
.model-ledger label { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; color: var(--text-2); }
.model-ledger .ledger-controls label:first-child { grid-column: span 2; }
.model-ledger :is(input, select, button) { font: inherit; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-card); padding: 0.5rem 0.75rem; min-height: 44px; }
.model-ledger :is(input, select) { max-width: 100%; width: 100%; }
.model-ledger button { cursor: pointer; }
.model-ledger button:hover { border-color: var(--accent); }
.model-ledger input[aria-invalid="true"] { outline: 2px solid var(--text); }
.model-ledger .ledger-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.model-ledger .ledger-actions label { flex-direction: row; align-items: center; margin-right: auto; }
.model-ledger input[type="checkbox"] { width: 1rem; min-height: 1rem; accent-color: var(--accent); }
.model-ledger .ledger-scroll { overflow: auto; max-height: 34rem; border: 1px solid var(--border-strong); border-radius: var(--radius); }
.model-ledger table { display: table; max-width: none; overflow: visible; border: 0; border-radius: 0; width: 100%; font-size: 0.8125rem; margin: 0; }
.model-ledger caption { padding: 0.75rem; text-align: left; color: var(--dim); }
.model-ledger :is(th, td) { padding: 0.75rem; }
.model-ledger th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.model-ledger th button { border: 0; border-radius: 0; padding: 0; background: none; font: 500 0.75rem var(--mono); min-height: 0; }
.model-ledger td:nth-child(2), .model-ledger td:nth-child(3) { min-width: 12rem; }
.model-ledger td.ledger-number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.model-ledger .ledger-detail td { padding: 1rem; background: var(--bg-panel); }
.model-ledger .ledger-detail details { margin-top: 0.75rem; }
.model-ledger summary { cursor: pointer; color: var(--accent); }
.model-ledger pre { margin-top: 0.75rem; max-height: 20rem; max-width: 60rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.75rem; }
@media (max-width: 40rem) {
  .model-ledger .ledger-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .model-ledger .ledger-controls label:last-child { grid-column: 1 / -1; }
}
