/* Layout: one narrow column, plain system type. Who I am and the signup first, then a short list of builds, then posts. */
:root {
  --bg: #FBFBF9;
  --ink: #1A1D1B;
  --muted: #5F6862;
  --line: #E1E4DF;
  --accent: #1F4FD8;
  --live: #1E7A4C;
  --wait: #8A5F00;
  --draft-bg: #FFF3BF;
  --draft-ink: #574300;
  --draft-line: #C9A300;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131614; --ink: #E9ECE8; --muted: #9AA39D; --line: #2A302C;
    --accent: #8FA8FF; --live: #5FCB92; --wait: #E0B24A;
    --draft-bg: #332C0E; --draft-ink: #F1DE96; --draft-line: #8C7420;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131614; --ink: #E9ECE8; --muted: #9AA39D; --line: #2A302C;
  --accent: #8FA8FF; --live: #5FCB92; --wait: #E0B24A;
  --draft-bg: #332C0E; --draft-ink: #F1DE96; --draft-line: #8C7420;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.55 var(--font); }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
p { margin: 0; }
[hidden] { display: none !important; }

.page {
  max-width: 40rem; margin: 0 auto;
  padding-block: 3rem 4rem;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 3rem;
}
section { display: flex; flex-direction: column; gap: 0.75rem; }
h2 { font: 700 1.0625rem/1.4 var(--font); margin: 0; }

/* Draft-only notes. Everything with .draft disappears when DRAFT is false. */
.draft-banner {
  background: var(--draft-bg); color: var(--draft-ink); border-bottom: 1px solid var(--draft-line);
  font-size: 0.875rem; line-height: 1.5; padding-block: 0.6rem;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.draft-banner p { max-width: 40rem; margin: 0 auto; }
.blank {
  background: var(--draft-bg); color: var(--draft-ink); border: 1px dashed var(--draft-line);
  padding: 0.5rem 0.75rem; font-size: 0.9375rem; line-height: 1.5;
}

/* Intro */
.intro { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.photo { width: 7.5rem; height: 7.5rem; border-radius: 50%; object-fit: cover; display: block; border: 1px solid var(--line); }
.photo-blank {
  width: 7.5rem; height: 7.5rem; border-radius: 50%;
  background: var(--draft-bg); color: var(--draft-ink); border: 1px dashed var(--draft-line);
  display: grid; place-items: center; font-weight: 600; font-size: 0.8125rem;
}
.about { min-width: 0; display: flex; flex-direction: column; gap: 0.75rem; }
h1 { font: 700 1.5rem/1.2 var(--font); margin: 0; }
.links { font-size: 0.9375rem; color: var(--muted); }
@media (max-width: 30rem) {
  .intro { grid-template-columns: minmax(0, 1fr); }
  .photo, .photo-blank { width: 5.5rem; height: 5.5rem; }
}

/* Signup */
.signup { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.25rem; }
.signup form { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.signup fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: contents; }
.signup input {
  flex: 1 1 12rem; min-width: 0; font: 400 1rem/1.4 var(--font); color: var(--ink);
  background: transparent; border: 1px solid var(--muted); border-radius: 6px; padding: 0.6rem 0.75rem;
}
.signup button {
  font: 600 1rem/1.4 var(--font); background: var(--accent); color: var(--bg);
  border: 1px solid var(--accent); border-radius: 6px; padding: 0.6rem 1rem; cursor: pointer;
}
.signup fieldset:disabled input, .signup fieldset:disabled button { opacity: 0.45; cursor: not-allowed; }
.fine { font-size: 0.9375rem; color: var(--muted); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#leave { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
#leave-url { overflow-wrap: anywhere; }
.msg { font-size: 0.9375rem; }
.msg:empty { display: none; }

/* Builds */
.builds { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.build {
  display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  column-gap: 0.9rem; align-items: center;
  padding-block: 0.85rem; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none;
}
a.build:hover .name { color: var(--accent); text-decoration: underline; }
.icon { width: 2.75rem; height: 2.75rem; border-radius: 22%; display: block; object-fit: cover; border: 1px solid var(--line); background: var(--line); }
.text { min-width: 0; }
.name { font-weight: 700; }
.line { color: var(--muted); font-size: 0.9375rem; line-height: 1.45; }
.status { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 0.4em; }
.status::before { content: ""; width: 0.5em; height: 0.5em; border-radius: 50%; background: currentColor; }
.status.live { color: var(--live); }
.status.wait { color: var(--wait); }
@media (max-width: 30rem) {
  .build { grid-template-columns: 2.75rem minmax(0, 1fr); row-gap: 0.25rem; }
  .build .status { grid-column: 2; }
}

/* Posts */
.posts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.post { display: flex; flex-direction: column; gap: 0.2rem; }
.post .date { font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.post h3 { font: 700 1.0625rem/1.4 var(--font); margin: 0; }

/* Build page */
.build-body { display: flex; flex-direction: column; gap: 1.1rem; }
.build-body section { margin-top: 0.75rem; }
.back { font-size: 0.9375rem; }
.build-head { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1rem; align-items: center; }
.build-head .icon { width: 3.5rem; height: 3.5rem; }
.build-head h1 { font-size: 1.75rem; }
.meta { font-size: 0.9375rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; }
.shot { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--line); }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.visit { font-weight: 600; }

footer {
  border-top: 1px solid var(--line); padding-top: 1.25rem;
  font-size: 0.9375rem; color: var(--muted);
  display: flex; flex-direction: column; gap: 0.4rem;
}
