/* ============================================================
   main.css — global styles
   ============================================================ */

@import url("theme.css");
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap");

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---- Base ---- */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-base);
  color: var(--fg-base);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  min-height: 100vh;
}

::selection {
  background: var(--accent-hover);
  color: var(--fg-heading);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--fg-heading);
  line-height: var(--leading-tight);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}
a:hover {
  color: var(--fg-heading);
  opacity: 1;
}

code {
  background: var(--bg-elevated);
  border: var(--border);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.4em;
  font-size: 0.9em;
  color: var(--blue);
}

hr {
  border: none;
  border-top: 1px solid var(--bg-border);
  margin: var(--space-10) 0;
}

/* ---- Layout ---- */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-8);
}

/* ---- Site Header ---- */
.site-header {
  padding: var(--space-8) 0 var(--space-6);
  margin-bottom: var(--space-12);
  border-bottom: var(--border);
}

.site-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--fg-heading);
  letter-spacing: -0.03em;
}

.site-title .prompt {
  color: var(--accent-dim);
  font-weight: 300;
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--accent);
  opacity: 0.7;
  vertical-align: text-bottom;
  margin-left: 3px;
  border-radius: 1px;
  animation: blink 1.2s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 0; }
}

.site-tagline {
  margin-top: var(--space-2);
  color: var(--fg-dim);
  font-size: var(--text-sm);
}

/* ---- Site Nav ---- */
.site-nav {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

.site-nav a {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  transition: color var(--transition);
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
}
.site-nav a[aria-current="page"]::before {
  content: "· ";
  color: var(--accent-dim);
}

/* ---- Section labels ---- */
.section-label {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--bg-border);
}

/* ---- Project Grid ---- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-6);
}

/* ---- Project Card ---- */
.card {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  border-color: var(--accent-dim);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.card-title {
  font-size: var(--text-md);
  color: var(--fg-heading);
  font-weight: 500;
}
.card-title a {
  color: inherit;
}
.card-title a:hover {
  color: var(--accent);
}

.card-desc {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  line-height: var(--leading-loose);
  flex: 1;
}

/* ---- Status Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  padding: 2px var(--space-2);
  border-radius: 99px;
  border: 1px solid;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}
.badge::before {
  content: "●";
  font-size: 0.45em;
}

.badge--active {
  background: var(--status-active-bg);
  color: var(--status-active-fg);
  border-color: var(--status-active-border);
}
.badge--hold {
  background: var(--status-hold-bg);
  color: var(--status-hold-fg);
  border-color: var(--status-hold-border);
}
.badge--complete {
  background: var(--status-complete-bg);
  color: var(--status-complete-fg);
  border-color: var(--status-complete-border);
}

/* ---- Tag Pills ---- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.tag {
  font-size: var(--text-xs);
  padding: 2px var(--space-2);
  background: var(--bg-elevated);
  border: var(--border);
  border-radius: 99px;
  color: var(--fg-muted);
}

/* ---- Card Links ---- */
.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: var(--border);
}
.card-links a {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  transition: color var(--transition);
}
.card-links a::before {
  content: "↗ ";
  color: var(--fg-dim);
}
.card-links a:hover {
  color: var(--accent);
}
.card-links a:hover::before {
  color: var(--accent-dim);
}

/* ---- Site Footer ---- */
.site-footer {
  margin-top: var(--space-16);
  padding: var(--space-8) 0;
  border-top: var(--border);
  color: var(--fg-dim);
  font-size: var(--text-xs);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* ---- Project Detail Page ---- */
.page-header {
  margin-bottom: var(--space-8);
}
.page-header .back-link {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  display: inline-block;
  margin-bottom: var(--space-4);
}
.page-header .back-link:hover { color: var(--accent); }
.page-header .back-link::before { content: "← "; }

.page-title {
  font-size: var(--text-xl);
  color: var(--fg-heading);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-meta {
  font-size: var(--text-xs);
  color: var(--fg-dim);
  letter-spacing: 0.04em;
}

.detail-section {
  margin-bottom: var(--space-10);
}
.detail-section h2 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: var(--border);
}

.detail-section p,
.detail-section li {
  color: var(--fg-muted);
  line-height: var(--leading-loose);
  font-size: var(--text-sm);
}
.detail-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.detail-section ul li::before {
  content: "– ";
  color: var(--fg-dim);
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.link-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.link-item a {
  font-size: var(--text-sm);
}
.link-item .link-desc {
  font-size: var(--text-xs);
  color: var(--fg-dim);
}

.notes-block {
  background: var(--bg-elevated);
  border: var(--border);
  border-left: 2px solid var(--bg-border);
  border-radius: var(--radius);
  padding: var(--space-6);
  font-size: var(--text-sm);
  color: var(--fg-muted);
  line-height: var(--leading-loose);
  white-space: pre-wrap;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .container { padding: 0 var(--space-4); }
  .site-title { font-size: var(--text-xl); }
  .project-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}
