/* apps.json — site styles
   Single stylesheet shared across reader, directory, and badge generator. */

:root {
  --bg: #fffdf4;
  --paper: #ffffff;
  --bg-soft: #fff3c4;
  --ink: #222222;
  --muted: #606b74;
  --rule: #e8dfbd;
  --accent: #1d6f9f;
  --accent-soft: #e5f4fb;
  --ok: #2f7a4a;
  --warn: #b58300;
  --err: #b8312b;
  --radius: 6px;
  --max-width: 760px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.35rem 1.5rem 6rem;
}

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #154f72; }

h1, h2, h3 { font-weight: 700; line-height: 1.22; margin: 0 0 0.5rem; }
h1 { font-size: 2.75rem; letter-spacing: 0; }
h2 { font-size: 1.55rem; margin-top: 2rem; }
h3 { font-size: 1.05rem; margin-top: 1.5rem; }

code, pre, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.muted { color: var(--muted); }
.lede { font-size: 1.35rem; line-height: 1.35; max-width: 720px; margin: 0.25rem 0 0.8rem; }
.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}
.rule { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

/* Site nav (always visible) */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}
.site-brand { text-decoration: none; color: var(--ink); }
.site-brand strong { font-weight: 700; }
.site-nav-sep { color: var(--muted); }

pre {
  margin: 0;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow-x: auto;
}

/* Try-the-reader form */
.try-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}
.try-form input[type="url"] {
  flex: 1 1 320px;
  padding: 0.5rem 0.6rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
}
.try-form button {
  padding: 0.5rem 0.9rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 6px;
  cursor: pointer;
}
.try-form button:hover { background: #154f72; border-color: #154f72; }

/* Coming-soon placeholder */
.placeholder code { background: var(--bg-soft); padding: 0.1em 0.4em; border-radius: 4px; }
.placeholder ul { padding-left: 1.1rem; }

/* Principles */
.principles-list {
  padding-left: 1.1rem;
  margin: 0.5rem 0 0.8rem;
}
.principles-list li { margin: 0.35rem 0; }
.principles-list strong { color: var(--ink); }

/* ----- Reader output ----- */

#reader-output { padding-top: 1rem; }

.profile { display: flex; flex-direction: column; gap: 1.5rem; }

.author-block { display: flex; flex-direction: column; gap: 0.6rem; }
.author-block h1 { font-size: 2.4rem; margin: 0; }
.author-block h1 a { text-decoration: none; color: var(--ink); border-bottom: 2px solid transparent; }
.author-block h1 a:hover { border-color: var(--accent); }

.social-chips {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.chip {
  display: inline-flex; align-items: center; gap: 0.35em;
  padding: 0.18em 0.65em;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--ink);
}
.chip:hover { background: var(--bg-soft); color: var(--ink); }
.chip-platform { color: var(--muted); }
.chip:hover .chip-platform { color: var(--bg-soft); }
.chip-handle { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.chip-vibe { background: #edf6f2; color: #2f5d51; }
.chip-fork { background: #f2f5eb; color: #50603d; }

/* ----- App list ----- */

.app-list { display: flex; flex-direction: column; gap: 1.25rem; }

.app-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 1rem 1.1rem 0.95rem;
  display: flex; flex-direction: column; gap: 0.55rem;
}

.app-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem;
  justify-content: space-between;
}
.app-name { font-size: 1.25rem; margin: 0; }
.app-meta { display: flex; gap: 0.5rem; font-size: 0.85rem; }
.app-meta .ver {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg-soft); padding: 0.1em 0.4em; border-radius: 4px;
}

.app-desc { margin: 0; }

.fact-group {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
}
.fact-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0;
  text-transform: uppercase;
  padding-top: 0.22rem;
}

.tag-row { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag {
  font-size: 0.78rem; padding: 0.05em 0.5em;
  background: var(--bg-soft); border-radius: 999px; color: var(--muted);
}

.target-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.target-btn {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 0.45rem 0.7rem;
  background: var(--accent); color: white;
  border: 1px solid var(--accent); border-radius: 5px;
  text-decoration: none; cursor: pointer;
  font-family: inherit; font-size: 0.95rem;
  line-height: 1.1; gap: 0.1rem;
}
.target-btn:hover { background: #154f72; border-color: #154f72; }
.target-label { font-weight: 600; }
.target-kind { font-size: 0.72rem; opacity: 0.75; font-family: ui-monospace, monospace; }

.prov-row {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  font-size: 0.85rem;
}
.claim-chip {
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--muted);
}
.claim-chip:hover { background: var(--bg-soft); color: var(--ink); }
.claim-chip a { color: inherit; text-decoration: none; }
.claim-chip a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .fact-group { grid-template-columns: 1fr; gap: 0.25rem; }
  .fact-label { padding-top: 0; }
}

.trust-report {
  border-top: 1px dashed var(--rule);
  padding-top: 0.45rem;
  font-size: 0.86rem;
}
.trust-report summary {
  cursor: pointer;
  color: var(--muted);
}
.trust-list {
  list-style: none;
  padding: 0.45rem 0 0;
  margin: 0;
  display: grid;
  gap: 0.25rem;
}
.trust-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px dotted var(--rule);
  padding-bottom: 0.2rem;
}
.trust-name { color: var(--muted); }
.trust-state {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}
.trust-verified .trust-state,
.trust-valid .trust-state { color: var(--ok); }
.trust-invalid .trust-state,
.trust-unverified .trust-state { color: var(--warn); }
.trust-not_checked .trust-state,
.trust-missing .trust-state { color: var(--muted); }

.empty { color: var(--muted); font-style: italic; }
.feed-footer { padding-top: 1rem; border-top: 1px solid var(--rule); font-size: 0.85rem; }
.feed-footer a { word-break: break-all; }

.loading { padding: 1rem 0; }

/* ----- Error states ----- */

.error-card {
  border: 1px solid var(--err);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: #fbf3f1;
  padding: 1rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.error-title { color: var(--err); margin: 0; font-size: 1.1rem; }
.error-message { margin: 0; }
.error-url code { background: var(--paper); padding: 0.1em 0.4em; border-radius: 3px; word-break: break-all; }
.error-hint { background: var(--paper); padding: 0.6rem 0.8rem; border-radius: 6px; border: 1px solid var(--rule); }
.error-hint h3 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.error-hint p { margin: 0; font-size: 0.95rem; }
.error-diag code { background: var(--paper); padding: 0.1em 0.4em; border-radius: 3px; word-break: break-all; }

.error-list { margin: 0; padding-left: 1.2rem; }
.error-list li { margin: 0.15rem 0; font-size: 0.92rem; }
.error-path { background: var(--paper); padding: 0.05em 0.3em; border-radius: 3px; font-size: 0.85em; }

.warning-block { margin-top: 0.5rem; }
.warning-block summary { cursor: pointer; color: var(--warn); font-size: 0.9rem; }
.warning-path { background: var(--paper); padding: 0.05em 0.3em; border-radius: 3px; font-size: 0.85em; color: var(--warn); }

/* ----- Badge generator ----- */

.badge-form { display: flex; flex-direction: column; gap: 0.4rem; }
.badge-form input[type="url"] {
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
}
.feed-status { margin: 0; min-height: 1.2em; font-size: 0.9rem; }
.feed-status[data-kind="ok"] { color: var(--ok); }
.feed-status[data-kind="warn"] { color: var(--warn); }

.badge-previews { margin-top: 1.5rem; }
.preview-row { padding: 1rem 0; }
.preview-row img { display: inline-block; vertical-align: middle; }
.preview-caption { margin: 0 0 1rem; font-size: 0.85rem; }

.snippet-row { display: flex; gap: 0.4rem; align-items: stretch; }
.snippet-row textarea {
  flex: 1;
  padding: 0.5rem 0.6rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  resize: vertical;
  word-break: break-all;
}
.copy-btn {
  padding: 0.5rem 0.9rem;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.copy-btn:hover:not(:disabled) { background: #154f72; border-color: #154f72; }
.copy-btn:disabled { opacity: 0.7; cursor: default; }

/* ----- Seeded directory ----- */

.directory-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(120px, auto));
  gap: 0.5rem;
  margin: 1rem 0;
}
.directory-controls input,
.directory-controls select {
  min-width: 0;
  padding: 0.5rem 0.6rem;
  font-family: inherit;
  font-size: 0.92rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
}
.directory-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.directory-card h3 { margin-top: 0; }
.correction-note { font-size: 0.9rem; }

@media (max-width: 680px) {
  body { padding-inline: 1rem; }
  .directory-controls { grid-template-columns: 1fr; }
  h1 { font-size: 2.35rem; }
}

/* ----- Footer ----- */

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}
