/* Yapnap site. Flat dark surfaces, one accent colour, no gradients. Every page uses these classes; there are no
   inline styles, so the Content-Security-Policy in _headers can stay strict. */
:root {
  color-scheme: dark;
  --bg: #222329;
  --side: #1b1c21;
  --elev: #2b2c33;
  --hover: #2f3038;
  --active: #383944;
  --text: #ececf1;
  --muted: #a4a7b3;
  --faint: #7d8090;
  --border: #ffffff14;
  --accent: #ff6b4a;
  --accent-hover: #ff5a35;
  --on-accent: #ffffff;
  --radius: 12px;
  --max: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 10px; }
h1 { font-size: clamp(28px, 4vw, 38px); margin: 36px 0 10px; }
h2 { font-size: 22px; margin-top: 36px; }
h3 { font-size: 16px; }
h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 12px; }

p { margin: 0 0 14px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 22px; }

.lead { color: var(--muted); font-size: 17px; max-width: 68ch; margin-bottom: 26px; }
.meta { color: var(--faint); font-size: 13.5px; font-weight: 600; }
.small { font-size: 13px; color: var(--faint); padding-top: 18px; padding-bottom: 28px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { left: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--side);
  border-bottom: 1px solid var(--border);
}

.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }

.site-header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.site-header nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
}
.site-header nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.site-header nav a[aria-current="page"] { background: var(--active); color: var(--text); }

/* Footer */

.site-footer {
  background: var(--side);
  border-top: 1px solid var(--border);
  margin-top: 64px;
}

.site-footer .foot {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
  padding-top: 36px;
  padding-bottom: 12px;
}
.site-footer p { color: var(--muted); font-size: 14px; margin: 6px 0 0; max-width: 42ch; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--muted); font-size: 15px; }
.site-footer a:hover { color: var(--text); }
.site-footer .about-line strong { font-size: 17px; }

@media (max-width: 760px) {
  .site-footer .foot { grid-template-columns: 1fr 1fr; }
  .site-footer .about-line { grid-column: 1 / -1; }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--elev);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.big { height: 52px; padding: 0 24px; font-size: 16px; }
.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 12px; }

/* Home */

.hero { padding-top: 42px; padding-bottom: 8px; }
.hero .wordmark { width: min(420px, 80%); margin-bottom: 18px; }
.hero .lead { font-size: 18px; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.feature {
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 14.5px; margin: 0; }

.steps {
  padding-left: 22px;
  margin: 0;
  display: grid;
  gap: 10px;
  color: var(--muted);
}
.steps strong { color: var(--text); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 36px;
}
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } }

.card {
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card p { color: var(--muted); }

.dl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin: 26px 0 8px;
}
.dl h2 { margin: 0 0 4px; font-size: 20px; }

.notice {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--side);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14.5px;
  max-width: 52ch;
}

pre {
  background: var(--side);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
}
code {
  font-family: ui-monospace, Consolas, "Cascadia Mono", monospace;
  font-size: 14px;
}
.hash { word-break: break-all; color: var(--text); }

/* Changelog */

.release {
  border-top: 1px solid var(--border);
  padding: 22px 0 6px;
}
.release h2 { margin-top: 0; font-size: 19px; }
.release ul { padding-left: 20px; color: var(--muted); margin: 0 0 8px; }
.release li { margin-bottom: 6px; }

/* Plugins and themes */

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button {
  height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  font-size: 14.5px;
  cursor: pointer;
}
.tabs button:hover { background: var(--hover); color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--active); color: var(--text); border-color: var(--border); }
.tabs .count { color: var(--faint); font-weight: 600; margin-left: 6px; font-variant-numeric: tabular-nums; }

.search {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--elev);
  color: var(--text);
  font: inherit;
  margin-bottom: 18px;
}
.search::placeholder { color: var(--faint); }
.search:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.plugin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.plugin-row h3 { margin: 0 0 3px; font-size: 16px; }
.plugin-row p { margin: 0; color: var(--muted); font-size: 14.5px; }
.plugin-row .side { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.theme-card {
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.theme-card h3 { margin: 0; font-size: 16px; }
.theme-card p { margin: 0; color: var(--muted); font-size: 14px; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--active);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  align-self: flex-start;
}

.sw { display: flex; height: 30px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.sw i { flex: 1; }

.preview {
  height: 110px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--side);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.empty { color: var(--muted); padding: 30px 0; }
.note {
  margin-top: 26px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--side);
  color: var(--muted);
  font-size: 14.5px;
}

/* Small screens */

@media (max-width: 600px) {
  body { font-size: 15px; }
  .hero { padding-top: 26px; }
  .actions .btn { flex: 1 1 100%; }
  .plugin-row { grid-template-columns: 1fr; }
  .plugin-row .side { justify-content: flex-start; }
}
