/* Sunlight brand — see ARCHITECTURE.md / brand doc. */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #000000;
  --paper: #0A0A0A;
  --surface: rgba(255, 255, 255, 0.025);
  --surface-2: rgba(255, 255, 255, 0.05);
  --ink: #FFFFFF;
  --ink-soft: #D8D5CE;
  --muted: #8A8276;
  --rule: rgba(198, 106, 50, 0.35);
  --rule-soft: rgba(255, 255, 255, 0.08);
  --sun: #E07A3A;
  --sun-deep: #C66A32;
  --sun-glow: rgba(198, 106, 50, 0.55);
  --success: #6BBE7B;
  --danger: #E07A3A; /* errors use the sun accent — consistent with brand */
  --warn:   #E0B23A;

  --serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --radius: 4px;
  --max-w: 920px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(ellipse 1100px 800px at 110% 8%, var(--sun-glow) 0%, rgba(198,106,50,0.18) 28%, rgba(0,0,0,0) 60%),
    radial-gradient(ellipse 900px 700px at -10% 90%, rgba(198,106,50,0.32) 0%, rgba(0,0,0,0) 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: var(--sun); text-decoration: none; border-bottom: 1px solid var(--rule); }
a:hover { border-bottom-color: var(--sun); }

main { max-width: var(--max-w); margin: 0 auto; padding: 56px 24px 96px; }

/* Brand header (wordmark on the left, nav on the right) */
header.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 40px;
}
header.brand .wordmark { height: 18px; }
header.brand .wordmark svg { height: 100%; width: auto; display: block; }
header.brand .wordmark svg path { fill: var(--ink); }
header.brand .meta {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
header.brand nav { display: flex; gap: 20px; }
header.brand nav a {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; border-bottom: none;
}
header.brand nav a:hover, header.brand nav a.active { color: var(--ink); }

/* Page heading */
header.page { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
header.page h1 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
header.page nav { display: flex; gap: 16px; }
header.page nav a {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; border-bottom: none;
}
header.page nav a:hover, header.page nav a.active { color: var(--ink); }

h1, h2, h3 { font-family: var(--sans); color: var(--ink); margin: 0; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: 44px; line-height: 1.05; }
h2 { font-size: 22px; line-height: 1.2; }
em.serif, .serif { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--sun); }

p { margin: 0 0 14px; color: var(--ink-soft); max-width: 640px; }
.intro { color: var(--ink-soft); margin: 0 0 28px; font-size: 16px; }
.intro em { font-family: var(--serif); font-style: italic; color: var(--sun); font-size: 1.1em; font-weight: 500; }
.muted { color: var(--muted); }
.lead { font-size: 17px; color: var(--ink-soft); max-width: 640px; }

/* Buttons */
button, .btn {
  background: var(--sun); color: #0a0a0a; font-weight: 600;
  border: 0; padding: 10px 18px; border-radius: var(--radius);
  cursor: pointer; font-size: 13px; letter-spacing: 0.06em;
  font-family: var(--sans);
  transition: background 150ms;
}
button:hover, .btn:hover { background: var(--sun-deep); color: #0a0a0a; }
button.secondary, .btn.secondary {
  background: transparent; color: var(--muted);
  border: 1px solid var(--rule-soft); padding: 9px 17px;
}
button.secondary:hover { color: var(--ink); border-color: var(--sun); background: transparent; }
button.compact { padding: 8px 14px; font-size: 12px; }

/* Inputs */
input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius);
  border: 1px solid var(--rule-soft); background: rgba(255,255,255,0.02); color: var(--ink);
  font-size: 14px; outline: none; font-family: inherit;
  transition: border-color 150ms;
}
input:focus, select:focus, textarea:focus { border-color: var(--sun); }
input::placeholder { color: var(--muted); }
label { display: block; font-size: 11px; color: var(--muted); margin: 14px 0 6px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; }

/* Cards */
.card {
  background: rgba(10, 10, 10, 0.55);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 18px;
  backdrop-filter: blur(4px);
}
.card h2 { margin: 0 0 6px; font-size: 18px; letter-spacing: -0.01em; }
.card .desc { margin: 0 0 14px; color: var(--ink-soft); font-size: 14px; }

/* Section eyebrow ("I.  THE FIRM") */
.sec-num {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
  display: flex; align-items: baseline; gap: 12px;
}
.sec-num .roman { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--sun); text-transform: none; font-weight: 500; }

/* Row layout */
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1; }
.row .compact { flex: 0 0 auto; }

/* Progress bar */
.progress { display: flex; align-items: center; gap: 14px; }
.progress .bar { flex: 1; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress .bar > div { height: 100%; background: var(--sun); transition: width .25s ease; }
.progress .count { font-size: 12px; color: var(--muted); white-space: nowrap; letter-spacing: 0.05em; }

/* Tasks */
ul.tasks { list-style: none; padding: 0; margin: 0; }
ul.tasks li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 0; border-top: 1px solid var(--rule-soft);
}
ul.tasks li:first-child { border-top: 0; }
ul.tasks input[type="checkbox"] { margin-top: 3px; accent-color: var(--sun); flex: 0 0 auto; width: auto; }
ul.tasks .body { flex: 1; min-width: 0; }
ul.tasks .body .title { font-size: 15px; color: var(--ink); }
ul.tasks .body .title a { color: var(--ink); border-bottom-color: var(--rule-soft); }
ul.tasks .body .title a:hover { color: var(--sun); border-bottom-color: var(--sun); }
ul.tasks .body .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
ul.tasks li.done .title { color: var(--muted); text-decoration: line-through; }
ul.tasks select { width: auto; min-width: 170px; font-size: 12px; padding: 6px 8px; }

/* Owner / profile badges */
.owner-badge {
  display: inline-block; font-size: 10px; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); margin-left: 8px;
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500;
}
.owner-badge.you            { background: rgba(224, 122, 58, 0.14); color: var(--sun); }
.owner-badge.role-buddy     { background: rgba(107, 190, 123, 0.14); color: var(--success); }
.owner-badge.role-it        { background: rgba(224, 178, 58, 0.14);  color: var(--warn); }
.owner-badge.role-manager   { background: rgba(255, 255, 255, 0.06); color: var(--ink-soft); }

.profile-badge {
  display: inline-block; font-size: 10px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500;
}
.profile-badge.profile-tech    { background: rgba(224, 122, 58, 0.16); color: var(--sun); }
.profile-badge.profile-nontech { background: rgba(255, 255, 255, 0.06); color: var(--ink-soft); }

/* Kanban status pills — used on the new hire checklist + admin candidate view */
.status-pill {
  display: inline-block; font-size: 10px; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); margin-left: 6px;
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500;
}
.status-pill.status-todo        { background: var(--surface-2); color: var(--muted); }
.status-pill.status-in_progress { background: rgba(224, 122, 58, 0.16); color: var(--sun); }
.status-pill.status-done        { background: rgba(107, 190, 123, 0.16); color: var(--success); }

/* ---- Admin shell: left nav rail + main pane ---- */
body.has-sidebar { background-attachment: fixed; }
.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: rgba(8, 8, 8, 0.85);
  border-right: 1px solid var(--rule-soft);
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  backdrop-filter: blur(8px);
}
.sidebar-head {
  padding: 0 22px 26px;
  border-bottom: 1px solid var(--rule-soft);
}
.muted-xs { color: var(--muted); font-size: 12px; }

/* ---- Nav rail ---- */
.nav-rail {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  gap: 2px;
}
.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--rule-soft);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-weight: 500;
  border-bottom: none;
  cursor: pointer;
  transition: background 120ms, color 120ms;
  position: relative;
}
.nav-item svg { stroke: currentColor; flex: 0 0 18px; opacity: 0.9; }
.nav-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}
.nav-item.active {
  color: var(--ink);
  background: rgba(224, 122, 58, 0.10);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px; bottom: 8px;
  width: 2px;
  background: var(--sun);
  border-radius: 0 2px 2px 0;
}
.nav-item.active svg { color: var(--sun); }

/* ---- Main pane ---- */
body.has-sidebar main.main-pane {
  padding: 56px 56px 96px;
  max-width: 1180px;
  margin: 0;
  width: 100%;
}
.main-pane header.page {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.main-pane header.page > div { flex: 1; min-width: 280px; }
.main-pane header.page .intro { margin: 8px 0 0; }
.main-pane header.page > button { flex: 0 0 auto; align-self: flex-start; margin-top: 12px; }

.view[hidden] { display: none; }

@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto;
    flex-direction: row; align-items: center;
    padding: 12px;
  }
  .sidebar-head { padding: 0 12px; border-right: 1px solid var(--rule-soft); border-bottom: 0; }
  .nav-rail { flex-direction: row; padding: 0 12px; }
  .sidebar-foot { border-top: 0; padding: 0 12px; }
  .nav-item.active::before { display: none; }
  body.has-sidebar main.main-pane { padding: 28px 18px 64px; }
}

/* Per-task owner select inside the admin step picker */
.step-list .step .details .task-owner {
  width: auto;
  min-width: 150px;
  max-width: 200px;
  font-size: 12px;
  padding: 5px 8px;
  margin-left: 8px;
}

/* Row actions (edit / delete) on table rows */
th.col-actions, td.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-action {
  background: transparent; color: var(--muted);
  border: 1px solid var(--rule-soft); padding: 6px 8px;
  border-radius: var(--radius); cursor: pointer; margin-left: 4px;
  transition: color 120ms, border-color 120ms, background 120ms;
  display: inline-flex; align-items: center; justify-content: center;
}
.row-action:hover            { color: var(--ink);    border-color: var(--rule);  background: transparent; }
.row-action.del:hover        { color: var(--danger); border-color: var(--danger);}
.row-action svg              { display: block; }

/* ---- Edit modal ---- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
  backdrop-filter: blur(6px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  width: 100%; max-width: 480px;
  padding: 26px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.modal header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule-soft);
}
.modal header h2 { font-size: 18px; }
.modal-close {
  background: transparent; color: var(--muted); border: 0;
  font-size: 22px; line-height: 1; padding: 0 6px; cursor: pointer;
  letter-spacing: 0;
}
.modal-close:hover { color: var(--ink); background: transparent; }

/* Table */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--rule-soft); }
th { color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
tr.clickable { cursor: pointer; transition: background 120ms; }
tr.clickable:hover { background: rgba(255, 255, 255, 0.02); }

footer { color: var(--muted); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; text-align: center; margin-top: 48px; font-weight: 500; }
.err { color: var(--sun); font-size: 12px; min-height: 16px; letter-spacing: 0.04em; }
.ok  { color: var(--success); font-size: 13px; min-height: 16px; }

/* ---- Step picker (admin candidate creation) ---- */
.step-list { list-style: none; padding: 0; margin: 14px 0 0; border-top: 1px solid var(--rule-soft); }
.step-list .step {
  padding: 12px 4px;
  border-bottom: 1px solid var(--rule-soft);
  background: transparent;
  transition: background 120ms;
}
.step-list .step.dragging { opacity: 0.4; }
.step-list .step.drop-target { background: rgba(224, 122, 58, 0.07); }
.step-list .step-row {
  display: grid;
  grid-template-columns: 26px 22px 1fr 80px;
  gap: 10px;
  align-items: center;
}
.step-list .drag-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 16px;
  user-select: none;
  text-align: center;
  letter-spacing: -2px;
}
.step-list .drag-handle:active { cursor: grabbing; }
.step-list .step input[type="checkbox"] { accent-color: var(--sun); width: auto; }
.step-list .step .info { cursor: pointer; }
.step-list .step .info .step-title {
  font-size: 14px; color: var(--ink); font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.step-list .step .info .step-title .chev {
  font-size: 10px; color: var(--muted); transition: transform 150ms;
  display: inline-block;
}
.step-list .step.expanded .info .step-title .chev { transform: rotate(90deg); }
.step-list .step .info .step-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.step-list .step .task-count {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-align: right;
}
.step-list .step.off .info .step-title { color: var(--muted); }
.step-list .step .details {
  display: none;
  padding: 10px 0 4px 58px;
  margin-top: 6px;
}
.step-list .step.expanded .details { display: block; }
.step-list .step .details ul { list-style: none; padding: 0; margin: 0; }
.step-list .step .details li {
  padding: 8px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px dashed var(--rule-soft);
}
.step-list .step .details li:last-child { border-bottom: none; }
.step-list .step .details .task-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}
.step-list .step .details .task-cb {
  width: auto; margin: 0; accent-color: var(--sun);
}
.step-list .step .details .task-title { color: var(--ink-soft); font-size: 13px; }
.step-list .step .details .task-row:has(.task-cb:not(:checked)) .task-title { color: var(--muted); }
.step-list .step .details .task-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.step-list .actions { display: flex; gap: 10px; margin-top: 10px; align-items: center; }
.step-list .actions .hint { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
