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

:root {
  --bg: #0a0a0b;
  --surface: #111113;
  --surface-hover: #18181b;
  --border: #222225;
  --text: #e4e4e7;
  --text-muted: #71717a;
  --accent: #a1a1aa;
  --accent-bright: #fafafa;
  --terminal-bg: #09090b;
  --green: #22c55e;
  --radius: 10px;
  --max-w: 960px;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Layout ── */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
header {
  padding: 96px 0 64px;
  text-align: center;
}

header h1 {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent-bright);
}

header p {
  margin-top: 12px;
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Section Titles ── */
section {
  padding: 48px 0;
}

section > .wrap > h2 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 32px;
}

/* ── Project Grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  gap: 24px;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.card:hover {
  border-color: #333338;
  background: var(--surface-hover);
}

.card-body {
  padding: 24px;
}

.card-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-bright);
}

.tag {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 100px;
}

.card-body > p {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── Terminal Block ── */
.terminal {
  margin-top: 20px;
  background: var(--terminal-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--accent);
  overflow-x: auto;
}

.terminal .prompt {
  color: var(--green);
  user-select: none;
}

.terminal .comment {
  color: #52525b;
}

/* ── README Details ── */
.readme-details {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.readme-details summary {
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
  list-style: none;
}

.readme-details summary::-webkit-details-marker {
  display: none;
}

.readme-details summary::before {
  content: "›";
  display: inline-block;
  margin-right: 8px;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.readme-details[open] summary::before {
  transform: rotate(90deg);
}

.readme-details summary:hover {
  color: var(--accent-bright);
}

.readme-content {
  max-height: 400px;
  overflow-y: auto;
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--terminal-bg);
}

/* ── Scrollbar ── */
.readme-content::-webkit-scrollbar {
  width: 6px;
}

.readme-content::-webkit-scrollbar-track {
  background: transparent;
}

.readme-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ── README Prose ── */
.readme-content h1,
.readme-content h2,
.readme-content h3,
.readme-content h4 {
  color: var(--accent-bright);
  font-weight: 600;
  margin: 20px 0 8px;
}

.readme-content h1 { font-size: 1.15rem; }
.readme-content h2 { font-size: 1.05rem; }
.readme-content h3 { font-size: 0.95rem; }
.readme-content h4 { font-size: 0.88rem; }

.readme-content h1:first-child,
.readme-content h2:first-child,
.readme-content h3:first-child {
  margin-top: 0;
}

.readme-content p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 10px 0;
}

.readme-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.readme-content a:hover {
  color: var(--accent-bright);
}

.readme-content ul,
.readme-content ol {
  padding-left: 20px;
  margin: 10px 0;
}

.readme-content li {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 4px 0;
}

.readme-content code {
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.78rem;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.readme-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  margin: 12px 0;
  overflow-x: auto;
}

.readme-content pre code {
  background: none;
  padding: 0;
  font-size: 0.76rem;
  line-height: 1.7;
}

.readme-content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 14px;
  margin: 12px 0;
  color: #52525b;
}

.readme-content img {
  max-width: 100%;
  border-radius: 6px;
  margin: 12px 0;
}

.readme-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.82rem;
}

.readme-content th,
.readme-content td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
  color: var(--text-muted);
}

.readme-content th {
  color: var(--accent-bright);
  font-weight: 500;
}

.readme-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.readme-loading {
  color: #3f3f46;
  font-size: 0.8rem;
  font-style: italic;
}

.readme-error {
  color: #52525b;
  font-size: 0.8rem;
}

/* ── Button ── */
.btn {
  display: inline-block;
  margin-top: 20px;
  padding: 10px 22px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--bg);
  background: var(--accent-bright);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn:hover {
  opacity: 0.85;
}

/* ── Support Section ── */
.support-block {
  text-align: center;
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.support-block h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-bright);
}

.support-block p {
  margin-top: 12px;
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.support-links {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-outline {
  display: inline-block;
  padding: 10px 24px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

/* ── Footer ── */
footer {
  padding: 48px 0;
  text-align: center;
  font-size: 0.78rem;
  color: #3f3f46;
}

/* ── Responsive ── */
@media (max-width: 540px) {
  header {
    padding: 64px 0 48px;
  }
  header h1 {
    font-size: 2rem;
  }
  .card-body {
    padding: 18px;
  }
  .terminal {
    font-size: 0.72rem;
    padding: 14px;
  }
  .readme-content {
    max-height: 300px;
    padding: 16px;
  }
}
