/* ─── Base ─── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  scroll-behavior: smooth;
}

::selection {
  background: rgba(14, 116, 144, 0.2);
}

/* ─── Nav Links ─── */
.nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #52525b;
  transition: all 0.15s;
}

.nav-link:hover {
  color: #18181b;
  background: rgba(0, 0, 0, 0.04);
}

.nav-link.active {
  color: #0369a1;
  background: rgba(14, 116, 144, 0.06);
}

/* ─── Section Numbers ─── */
.section-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: #0369a1;
  background: rgba(14, 116, 144, 0.06);
  border: 1px solid rgba(14, 116, 144, 0.12);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #18181b;
}

/* ─── Cards ─── */
.card {
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 1rem;
  padding: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: #d4d4d8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

/* ─── Architecture Items ─── */
.arch-item {
  padding: 0.625rem 0.875rem;
  background: #f9fafb;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #3f3f46;
  border: 1px solid #f0f0f3;
}

/* ─── Lens Cards ─── */
.lens-card {
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.2s;
}

.lens-card:hover {
  border-color: #d4d4d8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.lens-insight {
  background: #f9fafb;
  border-radius: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #f0f0f3;
}

.lens-insight p {
  font-size: 0.8125rem;
  color: #52525b;
  line-height: 1.5;
}

.lens-label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a1a1aa;
  margin-bottom: 0.25rem;
}

/* ─── Contract Tabs ─── */
.contract-tab {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #71717a;
  background: transparent;
  border: 1px solid #e4e4e7;
  cursor: pointer;
  transition: all 0.15s;
}

.contract-tab:hover {
  color: #3f3f46;
  border-color: #d4d4d8;
}

.contract-tab.active {
  color: #0369a1;
  background: rgba(14, 116, 144, 0.05);
  border-color: rgba(14, 116, 144, 0.2);
}

.contract-panel {
  display: none;
}

.contract-panel.active {
  display: block;
}

/* ─── Code Blocks ─── */
.code-block {
  background: #1e1e2e;
  border: 1px solid #313244;
  border-radius: 0.75rem;
  padding: 1.5rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #cdd6f4;
}

/* ─── Data Flow ─── */
.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.75rem;
  border: 1px solid #f0f0f3;
}

.flow-number {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(14, 116, 144, 0.08);
  color: #0369a1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* ─── Phase Items ─── */
.phase-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  padding: 0.375rem 0;
}

.phase-item::before {
  content: '';
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.375rem;
  flex-shrink: 0;
}

.phase-item.done::before {
  background: rgba(16, 185, 129, 0.1);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2310b981'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
  background-size: 0.875rem;
  background-position: center;
  background-repeat: no-repeat;
}

.phase-item.pending::before {
  background: #f4f4f5;
  border: 1.5px solid #d4d4d8;
}

.phase-item.done {
  color: #3f3f46;
}

.phase-item.pending {
  color: #a1a1aa;
}

/* ─── Decision Cards ─── */
.decision-card {
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s;
}

.decision-card:hover {
  border-color: #d4d4d8;
}

.decision-card[data-status="resolved"] {
  opacity: 0.6;
  border-color: rgba(16, 185, 129, 0.3);
}

.decision-status {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
}

.decision-status.open {
  color: #b45309;
  background: rgba(245, 158, 11, 0.1);
}

.decision-status.resolved {
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
}

.decision-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: #a1a1aa;
  font-family: 'JetBrains Mono', monospace;
}

.decision-toggle {
  padding: 0.5rem;
  border-radius: 0.5rem;
  color: #a1a1aa;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.decision-toggle:hover {
  color: #52525b;
  background: rgba(0, 0, 0, 0.04);
}

.decision-notes {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f3;
}

.decision-notes textarea {
  width: 100%;
  background: #f9fafb;
  border: 1px solid #e4e4e7;
  border-radius: 0.5rem;
  padding: 0.75rem;
  color: #3f3f46;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.decision-notes textarea:focus {
  border-color: rgba(14, 116, 144, 0.4);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.08);
}

.btn-resolve {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-resolve:hover {
  background: rgba(16, 185, 129, 0.15);
}

.btn-save-note {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  background: rgba(14, 116, 144, 0.06);
  color: #0369a1;
  border: 1px solid rgba(14, 116, 144, 0.15);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-save-note:hover {
  background: rgba(14, 116, 144, 0.12);
}

/* ─── Stack Cards ─── */
.stack-card {
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s;
}

.stack-card:hover {
  border-color: #d4d4d8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ─── Scroll Offset ─── */
section[id] {
  scroll-margin-top: 5rem;
}

/* ─── Animations ─── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.decision-notes:not(.hidden) {
  animation: fadeIn 0.2s ease-out;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1aa;
}
