/* dco-tek public site (spec 02 §4): hand-written, no framework, no web
   fonts, nothing from another origin. Light and dark follow the system.
   Works down to 360 px wide with no horizontal scroll. */

:root {
  color-scheme: light dark;
  --fg: #1d1d1f;
  --muted: #5f5f66;
  --bg: #ffffff;
  --surface: #f4f4f6;
  --line: #dcdce1;
  --accent: #1f5fbf;
  --code-bg: #f0f0f3;
  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8e8ea;
    --muted: #a0a0a8;
    --bg: #111113;
    --surface: #1b1b1f;
    --line: #2e2e34;
    --accent: #5ea4ff;
    --code-bg: #1e1e23;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  overflow-wrap: anywhere;
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

.site-header, main, .site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.site-header a { color: inherit; text-decoration: none; }
.site-header a:hover { color: var(--accent); }
.wordmark { font-weight: 700; font-size: 1.15rem; letter-spacing: 0.02em; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.95rem; }

main { padding-top: 2rem; padding-bottom: 3rem; }

h1, h2, h3, h4 { line-height: 1.25; margin: 2rem 0 0.75rem; }
h1 { font-size: 2rem; margin-top: 0; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

section > h2:first-child, section > h3:first-child { scroll-margin-top: 1rem; }

p, ul, ol, pre, table, blockquote { margin: 0 0 1rem; }

code {
  font: 0.9em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.1em 0.3em;
}

pre {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
}

pre code { background: none; padding: 0; }

blockquote {
  border-left: 3px solid var(--line);
  padding-left: 1rem;
  color: var(--muted);
}

table { border-collapse: collapse; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--line); padding: 0.35rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--surface); }

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

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.page-header { margin-bottom: 2rem; }
.page-header .category { margin: 0; color: var(--muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; }
.tagline { font-size: 1.15rem; color: var(--muted); }

.project-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; list-style: none; padding: 0; }

.status {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 0.55rem;
  color: var(--muted);
}

.cards {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 0.75rem;
}

.card a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  height: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.card a:hover { border-color: var(--accent); }
.card-name { font-weight: 600; }
.card .status { align-self: flex-start; }
.card-tagline { color: var(--muted); font-size: 0.95rem; }

.category-list h2 a { color: inherit; text-decoration: none; }

.site-footer {
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a { color: inherit; }

/* Gated units (spec 02 §3.2): a teaser shows that something exists, with a
   button to ask for access. */
.gated { color: var(--muted); }
.lock { font-size: 0.85em; }

.request-access {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.6rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.request-access:hover { background: var(--accent); color: var(--bg); }

.card .request-access { margin: 0.5rem 1rem 0.9rem; align-self: flex-start; }
.card:has(.gated) { display: flex; flex-direction: column; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface); }
.card .gated { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.9rem 1rem 0; }

/* The gate page (spec 03 §7.2). */
.listed { padding: 0.6rem 0.9rem; border-left: 3px solid var(--accent); background: var(--surface); }
.invite-form { display: grid; gap: 0.5rem; max-width: 24rem; margin: 1.5rem 0; }
.invite-form input[type="email"] { font: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.invite-form button { font: inherit; justify-self: start; padding: 0.45rem 1rem; border: 0; border-radius: 6px; background: var(--accent); color: var(--bg); cursor: pointer; }
.note { color: var(--muted); font-size: 0.9rem; }
/* The honeypot: out of sight and out of the tab order. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.error { color: #b3261e; font-weight: 600; }

/* What the page records (#76), generated from what it declares. */
.privacy { max-width: var(--measure); margin: 0 auto 2rem; padding: 0 1rem; font-size: 0.85rem; color: var(--muted); }

/* The connection (#76): slow, or the socket reconnecting (LiveView marks
   its container phx-disconnected). */
.slow-notice, .reconnecting { max-width: var(--measure); margin: 0.5rem auto; padding: 0.4rem 1rem; font-size: 0.85rem; background: var(--surface); border-radius: 4px; }
.reconnecting { display: none; }
.phx-disconnected .reconnecting { display: block; }
