/* linkhost — shared styles. No external fonts, no CDN, nothing to fetch. */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-sunk: #f7f7f6;
  --fg: #17181a;
  --fg-muted: #6a6d73;
  --fg-faint: #8f9296;
  --rule: #e4e4e2;
  --rule-strong: #cfcfcc;
  --accent: #c8452a;
  --accent-soft: #fbeeea;
  --danger: #a52222;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --measure: 44rem;
  --pad: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131416;
    --bg-sunk: #1a1b1e;
    --fg: #e9e9e7;
    --fg-muted: #9a9ea4;
    --fg-faint: #74787e;
    --rule: #2a2c30;
    --rule-strong: #3a3d42;
    --accent: #ff7a5c;
    --accent-soft: #2a1c18;
    --danger: #ff8a8a;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3rem var(--pad) 4rem;
}

.wrap-wide { max-width: 60rem; }

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

h1, h2, h3 { line-height: 1.25; font-weight: 600; margin: 0; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; }

p { margin: 0.7rem 0; }

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

code, .mono { font-family: var(--mono); font-size: 0.85em; }

/* ---- masthead ---- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.masthead .site {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  letter-spacing: 0.02em;
}

.masthead .site:hover { text-decoration: none; color: var(--accent); }

.masthead nav {
  font-size: 0.85rem;
  color: var(--fg-muted);
  display: flex;
  gap: 1rem;
}

.masthead nav a { color: var(--fg-muted); }

.lede {
  color: var(--fg-muted);
  margin: 1.5rem 0 0;
  font-size: 0.95rem;
}

/* ---- project index ---- */

.project-list { margin-top: 2rem; }

.project-item {
  display: block;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
  color: inherit;
}

.project-item:first-child { border-top: 0; }
.project-item:hover { text-decoration: none; }
.project-item:hover .project-title { color: var(--accent); }

.project-title {
  font-weight: 600;
  font-size: 1.02rem;
  transition: color 0.1s;
}

.project-sub {
  color: var(--fg-muted);
  font-size: 0.92rem;
  margin-top: 0.15rem;
}

.project-meta {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--fg-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  align-items: center;
}

.tag {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--fg-muted);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.05rem 0.35rem;
}

/* ---- lander ---- */

.lander-head { margin-top: 2.5rem; }

.lander-head .date {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.lander-head h1 { margin-top: 0.4rem; font-size: 1.9rem; }

.lander-head .subtitle {
  color: var(--fg-muted);
  font-size: 1.02rem;
  margin-top: 0.5rem;
}

.lander-head .tags { margin-top: 0.9rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }

.hero {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 2rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
}

.embed {
  width: 100%;
  height: 60vh;
  min-height: 320px;
  margin-top: 2rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg-sunk);
}

.section-label {
  margin-top: 2.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.file-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  color: inherit;
}

.file-row:hover { text-decoration: none; background: var(--bg-sunk); }

.file-main { min-width: 0; }

.file-name {
  font-weight: 500;
  color: var(--accent);
  word-break: break-word;
}

.file-desc {
  color: var(--fg-muted);
  font-size: 0.88rem;
  margin-top: 0.1rem;
}

.file-size {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fg-faint);
  white-space: nowrap;
  flex: none;
}

/* ---- footer ---- */

.foot {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--fg-faint);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.foot a { color: var(--fg-faint); }

/* ---- notices ---- */

.notice {
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  margin: 1.5rem 0;
  border-radius: 0 3px 3px 0;
}

.notice.quiet {
  border-left-color: var(--rule-strong);
  background: var(--bg-sunk);
}

.empty {
  color: var(--fg-muted);
  font-size: 0.92rem;
  padding: 2rem 0;
}

/* ---- forms and buttons (admin) ---- */

label {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 0.3rem;
}

input[type='text'],
input[type='password'],
input[type='date'],
textarea,
select {
  width: 100%;
  font: inherit;
  font-size: 0.92rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: 0.45rem 0.6rem;
}

textarea { font-family: var(--mono); font-size: 0.82rem; line-height: 1.5; resize: vertical; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

.field { margin-bottom: 0.9rem; }

.field-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 12rem; min-width: 0; }

.hint { font-size: 0.78rem; color: var(--fg-faint); margin-top: 0.25rem; }

button {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.4rem 0.85rem;
  border-radius: 3px;
  border: 1px solid var(--rule-strong);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}

button:hover { border-color: var(--fg-faint); }
button:disabled { opacity: 0.5; cursor: default; }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary:hover { filter: brightness(1.08); }

button.link {
  border: 0;
  background: none;
  color: var(--fg-muted);
  padding: 0.2rem 0.3rem;
  font-size: 0.8rem;
  text-decoration: underline;
}

button.link:hover { color: var(--accent); }
button.link.danger:hover { color: var(--danger); }

.btn-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

.status {
  font-size: 0.82rem;
  color: var(--fg-muted);
  min-height: 1.2rem;
}

.status.ok { color: var(--fg); }
.status.err { color: var(--danger); }

/* ---- admin layout ---- */

.panel { padding: 2rem 0; border-top: 1px solid var(--rule); }
.panel:first-of-type { border-top: 0; }

.panel > h2 { margin-bottom: 0.25rem; }
.panel > .hint { margin-bottom: 1.1rem; }

.admin-project {
  border-top: 1px solid var(--rule);
  padding: 1rem 0;
}

.admin-project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-project-body { margin-top: 0.9rem; padding-left: 1rem; border-left: 1px solid var(--rule); }

.admin-file {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.drop {
  border: 1px dashed var(--rule-strong);
  border-radius: 3px;
  padding: 1.1rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin-top: 0.9rem;
  cursor: pointer;
}

.drop.over { border-color: var(--accent); color: var(--accent); }

.log {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--fg-muted);
  background: var(--bg-sunk);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.6rem 0.75rem;
  margin-top: 1rem;
  max-height: 14rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.log:empty { display: none; }

@media (max-width: 640px) {
  .wrap { padding: 2rem 1.1rem 3rem; }
  .lander-head h1 { font-size: 1.5rem; }
  h1 { font-size: 1.35rem; }
  .file-row { flex-direction: column; gap: 0.2rem; }
  .file-size { align-self: flex-start; }
}
