/* semgit — the Writ home dashboard and the bare auth screens (the last
   section of the one stylesheet, #70). Linked last. */

/* ---------------------------------------------------------- Writ home dashboard */

/* Home uses the application workspace, not the document controls — the
   account behind the avatar (the theme, Sign out) it keeps (#71, #76). */
.shell:has(.writ-home) > .topbar .view :is([data-clean], .zoom) { display: none; }

.writ-home {
  display: grid;
  min-height: 100%;
  align-content: start;
  gap: clamp(36px, 6vw, 64px);
  padding: clamp(32px, 6vw, 68px) clamp(18px, 5vw, 56px) var(--s8);
  background: var(--canvas);
}

.writ-home > * {
  width: min(1080px, 100%);
  margin-inline: auto;
}

.writ-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--s7);
  padding-bottom: clamp(32px, 5vw, 52px);
  border-bottom: 1px solid var(--line);
}

.writ-home-hero-copy {
  display: grid;
  max-width: 680px;
  gap: var(--s3);
}

.writ-home-eyebrow {
  color: var(--ink-3);
  font-size: var(--t-xs);
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.writ-home-hero h1 {
  max-width: 650px;
  font-size: clamp(30px, 4.2vw, 46px);
  font-weight: 620;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.writ-home-hero-copy > p:last-child {
  max-width: 590px;
  color: var(--ink-2);
  font-size: var(--t-lg);
  line-height: 1.6;
}

.writ-home-actions {
  display: flex;
  gap: var(--s2);
}

.writ-home-actions .btn {
  min-height: 36px;
  padding-inline: var(--s4);
}

.writ-home-projects {
  display: grid;
  gap: var(--s5);
}

.writ-home-heading {
  display: grid;
  gap: var(--s1);
}

.writ-home-heading h1 {
  font-size: clamp(25px, 3vw, 32px);
  font-weight: 620;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.writ-home-heading > p:last-child {
  color: var(--ink-3);
  font-size: var(--t-sm);
}

.writ-home-create {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, .32fr) auto;
  align-items: end;
  gap: var(--s4);
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  box-shadow: var(--e1);
}

.writ-home-create-heading {
  display: flex;
  grid-column: 1 / -1;
  align-items: baseline;
  gap: var(--s3);
  padding-bottom: var(--s1);
}

.writ-home-create-heading h2 {
  font-size: var(--t-lg);
  font-weight: 620;
  letter-spacing: -.012em;
}

.writ-home-create-heading p {
  color: var(--ink-3);
  font-size: var(--t-sm);
}

.writ-home-field {
  display: grid;
  gap: var(--s2);
}

.writ-home-field label {
  color: var(--ink-2);
  font-size: var(--t-sm);
  font-weight: 600;
}

.writ-home-field input,
.writ-home-field select {
  width: 100%;
  min-height: 38px;
  padding: var(--s2) var(--s3);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--r2);
}

.writ-home-field input:hover,
.writ-home-field select:hover { border-color: var(--ink-3); }

.writ-home-field small {
  color: var(--ink-3);
  font-size: var(--t-xs);
}

.writ-home-create-submit {
  min-height: 38px;
  padding-inline: var(--s4);
}

.writ-home-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--s4);
  padding: 0;
  margin: 0;
  list-style: none;
}

.writ-home-card {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  gap: var(--s4);
  padding: var(--s5);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  box-shadow: var(--e1);
}

.writ-home-card:hover {
  background: var(--surface);
  border-color: var(--ink-3);
  text-decoration: none;
}

.writ-home-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.writ-home-card-name {
  overflow: hidden;
  font-size: var(--t-lg);
  font-weight: 650;
  letter-spacing: -.012em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.writ-home-visibility {
  flex: none;
  padding: 2px var(--s2);
  color: var(--ink-3);
  background: var(--sunken);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.writ-home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s3);
  padding-top: var(--s4);
  color: var(--ink-3);
  border-top: 1px solid var(--line-2);
  font-size: var(--t-xs);
}

.writ-home-stats > span {
  display: grid;
  gap: 1px;
}

.writ-home-stats strong {
  color: var(--ink-2);
  font-size: var(--t-md);
  font-weight: 620;
}

.writ-home-stats .is-blocked,
.writ-home-stats .is-blocked strong { color: var(--danger); }

.writ-home-updated {
  margin-top: auto;
  color: var(--ink-3);
  font-size: var(--t-xs);
}

.writ-home-empty {
  display: grid;
  min-height: 150px;
  place-content: center;
  gap: var(--s1);
  padding: var(--s6);
  color: var(--ink-3);
  border: 1px dashed var(--line);
  border-radius: var(--r3);
  text-align: center;
}

.writ-home-empty h2 {
  color: var(--ink-2);
  font-size: var(--t-md);
  font-weight: 620;
}

.writ-home-empty p { font-size: var(--t-sm); }

@media (max-width: 720px) {
  .writ-home {
    gap: var(--s7);
    padding: var(--s6) var(--s4) var(--s7);
  }

  .writ-home-hero { grid-template-columns: 1fr; gap: var(--s5); }
  .writ-home-actions { justify-content: flex-start; }
  .writ-home-create { grid-template-columns: 1fr; padding: var(--s4); }
  .writ-home-create-heading { display: grid; gap: 2px; }
  .writ-home-create-submit { width: 100%; }
}

/* Auth screens have no document: no history rail, no notes column, no View
   menu, and a form that reads top to bottom. Inherited whole, the editing shell
   put a "Document history" panel and a "0 NOTES" margin on the login page, and
   the label/input pairs laid out side by side so "Email [input] Password"
   collided on one line. */
.desk--bare { grid-template-columns: minmax(0, 1fr) !important; }
.desk--bare .rail,
.desk--bare .rail-handle,
.desk--bare .margin { display: none !important; }
/* The View choices are the document's; the account behind the avatar — the
   theme, Settings, Sign out — is not (#71), so only those rows go (#76). */
body:has(.desk--bare) .menu.view :is([data-clean], .zoom) { display: none; }

.desk--bare .sheet {
  max-width: 380px; margin: 10vh auto 0; padding: 30px 32px 32px;
  border: 1px solid var(--line); background: var(--surface);
}
.desk--bare .card,
.desk--bare .card.narrow { border: 0; padding: 0; background: none; max-width: none; }
.desk--bare h1 { font-size: 21px; letter-spacing: -.01em; margin: 0 0 6px; }
.desk--bare .muted { font-size: 13px; line-height: 1.55; margin: 0 0 18px; }

/* one field per row: label above its input, input full width */
.desk--bare form label {
  display: block; margin: 0 0 14px;
  font-size: 12px; font-weight: 500; color: var(--ink-2);
}
.desk--bare form input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]) {
  display: block; width: 100%; box-sizing: border-box; margin-top: 5px;
  padding: 9px 11px; font: inherit; font-size: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.desk--bare form input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.desk--bare form .btn,
.desk--bare form button[type="submit"] { width: 100%; margin-top: 4px; padding: 11px 16px; }
.desk--bare .error { margin: 0 0 14px; }
.desk--bare form + p, .desk--bare .card > p:last-child { margin: 16px 0 0; font-size: 13px; }
/* hints sit under the field they explain, so they must read as secondary to it;
   inherited body size they were larger than the labels above them */
.desk--bare form .muted,
.desk--bare form span.muted { font-size: 12px; line-height: 1.5; margin: 6px 0 16px; display: block; }
