/* AI Corp — minimal visual identity.
   One stylesheet while the platform is a shell; it splits when there is enough
   to split (the pages of tickets 05 to 07). */

:root {
  --ink: #14181f;
  --ink-soft: #5a6472;
  --paper: #fbfbfc;
  --line: #e3e6ea;
  --accent: #2f5bd7;
  --measure: 44rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header,
.site-footer {
  padding: 1rem 1.5rem;
}

.site-header {
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand:hover { color: var(--accent); }

.site-main {
  flex: 1;
  padding: 3rem 1.5rem;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
}

.site-main--narrow { max-width: 24rem; }

/* --- The signed-in person, in the header ---------------------------------- */

.site-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
}

.account-email { color: var(--ink-soft); }

.account-link {
  color: var(--accent);
  text-decoration: none;
}

.account-link:hover { text-decoration: underline; }

.site-nav {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
}

.account-signout { margin: 0; }

.account-signout button {
  background: none;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  padding: 0.25rem 0.75rem;
}

.account-signout button:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}

/* --- The login page ------------------------------------------------------- */

.auth-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 2rem;
}

.auth-eyebrow {
  margin: 0 0 0.25rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.auth-sub {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.auth-error {
  margin: 0 0 1rem;
  border: 1px solid #e0b4b4;
  border-radius: 0.375rem;
  background: #fdf3f3;
  color: #8a2b2b;
  font-size: 0.875rem;
  padding: 0.625rem 0.75rem;
}

.auth-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.auth-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  font: inherit;
  margin-bottom: 1rem;
  padding: 0.5rem 0.625rem;
}

.auth-input:focus {
  border-color: var(--accent);
  outline: 2px solid rgb(47 91 215 / 0.15);
}

.auth-submit {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: 0.375rem;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0.5625rem 1rem;
}

.auth-submit:hover { background: #2749ad; }

.auth-note {
  margin: 1.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 2.25rem;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.125rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.site-footer p { margin: 0; }

/* --- Projects: the listing and one project -------------------------------- */

.page-head { margin-bottom: 2.5rem; }

.page-head h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
}

.breadcrumb {
  color: var(--ink-soft);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

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

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.card--archived { background: transparent; }

.card-link { text-decoration: none; }

.card-title {
  color: var(--accent);
  font-size: 1.125rem;
  margin: 0 0 0.25rem;
}

.card-meta {
  color: var(--ink-soft);
  font-size: 0.875rem;
  margin: 0 0 0.75rem;
}

.card-body { margin: 0 0 0.75rem; }

.card-foot {
  color: var(--ink-soft);
  font-size: 0.8125rem;
  margin: 0;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  margin-left: 0.5rem;
  padding: 0.0625rem 0.5rem;
}

.panel {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding-top: 1.5rem;
}

.panel-title {
  font-size: 1rem;
  letter-spacing: 0.02em;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}

.team {
  list-style: none;
  margin: 0;
  padding: 0;
}

.team li {
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0;
}

.team li:last-child { border-bottom: 0; }

.empty { color: var(--ink-soft); }

/* --- Tiles, and the cards on the home page -------------------------------- */

.home-cards { margin-top: 2.5rem; }

.card--inert {
  background: transparent;
  border-style: dashed;
}

.card--inert .card-title { color: var(--ink-soft); }

.tile-action {
  border: 1px solid var(--accent);
  border-radius: 0.375rem;
  color: var(--accent);
  display: inline-block;
  padding: 0.25rem 0.75rem;
  text-decoration: none;
}

.tile-action:hover {
  background: var(--accent);
  color: #fff;
}

/* --- The AI Staff chat ---------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.chat-log {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.chat-bubble {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.875rem 1rem;
}

.chat-bubble--user {
  background: #fff;
  border-color: var(--accent);
}

.chat-bubble--pending { color: var(--ink-soft); font-style: italic; }

.chat-bubble--error {
  background: #fdf3f3;
  border-color: #e6c3c3;
  color: #7a2a2a;
}

.chat-body > :first-child { margin-top: 0; }
.chat-body > :last-child { margin-bottom: 0; }

.chat-body pre {
  background: #f4f5f7;
  border-radius: 0.5rem;
  overflow-x: auto;
  padding: 0.75rem;
}

.chat-body code {
  background: #f4f5f7;
  border-radius: 0.25rem;
  font-size: 0.9em;
  padding: 0.05rem 0.3rem;
}

.chat-body pre code { background: none; padding: 0; }

.chat-body table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  width: 100%;
}

.chat-body th,
.chat-body td {
  border: 1px solid var(--line);
  padding: 0.375rem 0.625rem;
  text-align: left;
}

.chat-empty { color: var(--ink-soft); }

.chat-input {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  font: inherit;
  padding: 0.625rem 0.75rem;
  resize: vertical;
  width: 100%;
}

.chat-input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(47, 91, 215, 0.15);
}

.chat-actions {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.chat-actions .auth-submit { margin: 0; width: auto; }

.chat-reset {
  background: none;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  padding: 0.375rem 0.875rem;
}

.chat-reset:hover { border-color: var(--ink-soft); color: var(--ink); }
