/* makers.lv — single stylesheet, no build step. */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f3f1ee;
  --text: #1c1b1a;
  --muted: #6b6762;
  --border: #e4e0db;
  --accent: #9e3039;        /* Latvian carmine */
  --accent-hover: #852630;
  --accent-soft: #f6e7e8;
  --accent-text: #ffffff;
  --ok: #1f7a4d;
  --ok-soft: #e3f3ea;
  --warn: #8a5a00;
  --warn-soft: #fbf0d9;
  --info: #285ea8;
  --info-soft: #e5eefa;
  --danger: #b42318;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 16px rgb(0 0 0 / .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --surface: #1c1b1a;
    --surface-2: #252321;
    --text: #ecebe9;
    --muted: #a19c96;
    --border: #34312e;
    --accent: #e0707a;
    --accent-hover: #ea8c94;
    --accent-soft: #3a2124;
    --accent-text: #1a0d0f;
    --ok: #6fcf9a;
    --ok-soft: #1b3326;
    --warn: #e8b85a;
    --warn-soft: #3a2d12;
    --info: #8db4ec;
    --info-soft: #1c2a3e;
    --danger: #f07b70;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; padding-block: 24px 48px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3vw + 1rem, 2.2rem); }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
img, svg, iframe { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 16px; }
.narrow { max-width: 720px; margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only, .hp {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); }
.icon { vertical-align: -2px; flex-shrink: 0; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.15rem; }
.logo:hover { color: var(--text); }
.logo-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: var(--accent-text); font-weight: 800;
}
.logo-tld { color: var(--accent); }
.nav { display: flex; gap: 16px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover, .nav a[aria-current] { color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.langs { display: flex; gap: 2px; text-transform: uppercase; font-size: .8rem; font-weight: 600; }
.langs a { color: var(--muted); text-decoration: none; padding: 4px 6px; border-radius: var(--radius-sm); }
.langs a[aria-current] { color: var(--text); background: var(--surface-2); }

.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.menu-panel a, .menu-panel button { padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; text-align: left; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); }
.menu-panel form { display: contents; }
.menu-user { padding: 6px 10px 10px; margin: 0 0 4px; border-bottom: 1px solid var(--border); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-block: 24px; color: var(--muted); font-size: .925rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; }
.footer-row p { margin: 0; }
.footer-row nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-row nav a { color: var(--muted); }
.footer-row .small { width: 100%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; min-height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn-like.is-liked { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.linklike:hover { text-decoration: underline; }

/* Avatars: letter + color, no images. */
.avatar {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 10px;
  font-weight: 700; font-size: .95rem; letter-spacing: .02em; color: #fff; user-select: none;
}
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; font-size: .75rem; }
.avatar-lg { width: 72px; height: 72px; border-radius: 16px; font-size: 1.6rem; }
.av-0 { background: #9e3039; } .av-1 { background: #2d6a9f; } .av-2 { background: #3b7d4f; } .av-3 { background: #8a5a14; }
.av-4 { background: #6a4c9c; } .av-5 { background: #1f7a7a; } .av-6 { background: #a34a7a; } .av-7 { background: #4f5b66; }

/* Chips & status */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: .8rem; font-weight: 500;
  text-decoration: none; border: 1px solid transparent; white-space: nowrap; cursor: pointer; font-family: inherit;
}
a.chip:hover, button.chip:hover { border-color: var(--border); color: var(--text); }
.chip-quiet { background: transparent; color: var(--muted); padding-inline: 0; }
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.chip-ai { background: var(--info-soft); color: var(--info); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-idea::before { background: #a78bfa; }
.status-building::before { background: #e8a33a; }
.status-launched::before { background: #22a06b; }
.status-paused::before { background: #8b8680; }
.status-closed::before { background: #c4bfb9; }

/* Notices */
.flash, .notice { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; border: 1px solid transparent; }
.flash { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); font-weight: 500; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-info { background: var(--info-soft); color: var(--info); }
.notice-error { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }

/* Home */
.hero { padding-block: 16px 24px; max-width: 760px; }
.lead { font-size: 1.125rem; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters label { flex: 1 1 150px; }
.filters .filter-q { flex: 3 1 260px; }
.filter-chip { align-self: center; padding: 6px 12px; font-size: .875rem; }
.result-count { font-size: .9rem; margin-bottom: 8px; }

/* Project table: a table on wide screens, cards on narrow ones. */
.projects { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.projects th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.projects td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.projects tbody tr:last-child td { border-bottom: 0; }
.projects tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.projects .num { text-align: right; width: 56px; color: var(--muted); font-variant-numeric: tabular-nums; }
.projects tr.is-hidden { opacity: .55; }
.project-cell { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-width: 0; }
.project-cell:hover { color: var(--text); }
.project-cell:hover strong { color: var(--accent); }
.project-cell-text { display: flex; flex-direction: column; min-width: 0; }
.project-cell .tagline { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.col-tech { max-width: 260px; }
.col-tech .chip { margin: 2px 4px 2px 0; }
.col-launch { white-space: nowrap; color: var(--muted); font-size: .9rem; }

@media (max-width: 960px) {
  .projects .col-tech, .projects .col-launch { display: none; }
}
@media (max-width: 640px) {
  .projects, .projects tbody, .projects tr, .projects td { display: block; }
  .projects thead { display: none; }
  .projects tr { display: grid; grid-template-columns: 1fr auto auto; align-items: center; border-bottom: 1px solid var(--border); padding: 4px 0; }
  .projects tbody tr:last-child { border-bottom: 0; }
  .projects td { border: 0; padding: 4px 12px; }
  .projects .col-project { grid-column: 1 / -1; padding-top: 10px; }
  .projects .col-category { display: none; }
  .projects .col-status { grid-column: 1; padding-bottom: 10px; }
  .projects .num { width: auto; padding-bottom: 10px; }
  .projects td.num:nth-last-child(2)::before { content: "♥ "; }
  .projects td.num:last-child::before { content: "💬 "; }
  .hide-xs { display: none; }
  .nav { display: none; }
  .header-row { gap: 12px; }
}

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.empty { text-align: center; padding: 48px 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

/* Forms */
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; min-height: 40px;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 0; border-color: var(--accent); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); margin: 0; }
.form fieldset { border: 0; padding: 0; margin: 0 0 28px; }
.form > fieldset > legend { font-weight: 700; font-size: 1.1rem; margin-bottom: 12px; padding: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
.req { color: var(--accent); }
.hint { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
.field-error { color: var(--danger); font-size: .875rem; margin: 4px 0 0; font-weight: 500; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.checks { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks legend { font-weight: 600; font-size: .95rem; margin-bottom: 6px; padding: 0; width: 100%; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.form-actions { display: flex; gap: 8px; }
.tag-hints { margin-top: 8px; }
.danger-zone, .settings-section { margin-top: 40px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone .check { margin-bottom: 12px; }

/* Auth */
.auth-card { max-width: 420px; margin: 32px auto; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.code-input { font-family: var(--mono); font-size: 1.5rem; letter-spacing: .3em; text-align: center; }
.resend { margin-top: 16px; }

/* Project page */
.project-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 28px; }
.project-title { min-width: 0; }
.project-title h1 { margin-bottom: .2em; }
.tagline-lg { font-size: 1.15rem; color: var(--muted); }
.project-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.project-actions form { margin: 0; }
.project-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.project-meta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; position: sticky; top: 76px; }
.project-meta dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; font-size: .925rem; }
.project-meta dt { color: var(--muted); }
.project-meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.maker { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.admin-box { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.video { position: relative; aspect-ratio: 16 / 9; margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 860px) {
  .project-grid { grid-template-columns: 1fr; }
  .project-meta { position: static; order: -1; }
  .project-head { gap: 14px; }
  .project-head .avatar-lg { width: 56px; height: 56px; font-size: 1.25rem; }
}

.prose { overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.4em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: .25em; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
.prose pre { background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-sm); overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 0 0 1em; padding-left: 14px; border-left: 3px solid var(--border); color: var(--muted); }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; }

/* Comments */
.comments { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.comment { padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment.is-hidden { opacity: .55; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.comment-author { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.comment-actions { margin-left: auto; display: flex; gap: 12px; }
.comment-actions form { margin: 0; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.login-hint { margin-top: 20px; }

/* Profile */
.profile-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 32px; }
.bio { white-space: pre-wrap; max-width: 640px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* Errors */
.error-page { text-align: center; padding: 48px 16px; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--accent); margin: 0; line-height: 1; }

.htmx-request { opacity: .7; transition: opacity .15s; }
