:root {
  color-scheme: dark;
  --fg: #ececec;
  --bg: #0a0a0c;
  --muted: #8b8b92;
  --accent: #9fb4ff;
  --border: #2c2c34;
  --panel: #121214;
  --error: #ff8a80;
  --success: #8affb0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--accent); }

.site-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}

.brand {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

/* Identity block */
.identity-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: block;
}

.avatar-placeholder {
  background: var(--panel);
}

.name {
  font-family: "Fraunces", Georgia, serif;
  font-optical-sizing: auto;
  font-size: 2.4rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.1;
}

.headline {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Bordered panels (resume, post previews) */
.panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  margin-bottom: 1rem;
}

details.panel { padding: 0; }

details.panel summary {
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

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

details.panel summary::before {
  content: "\203A";
  display: inline-block;
  margin-right: 0.6rem;
  transition: transform 0.15s ease;
  color: var(--muted);
}

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

.resume-body {
  padding: 0 1.1rem 1.1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.resume-body h1, .resume-body h2, .resume-body h3 { margin-top: 1.2rem; }
.resume-body h1:first-child, .resume-body h2:first-child { margin-top: 0; }

/* Posts */
.posts { margin-top: 0.5rem; }

.post-preview {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-preview h2 { margin: 0; font-size: 1.15rem; }
.post-preview h2 a { text-decoration: none; color: var(--fg); }
.post-preview h2 a:hover { color: var(--accent); }

.excerpt { margin: 0; color: var(--muted); font-size: 0.92rem; }

.read-more {
  align-self: flex-end;
  font-size: 0.85rem;
  text-decoration: none;
}

.muted { color: var(--muted); }

/* Individual post page */
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--muted);
}

.post h1 { margin-bottom: 0.25rem; }

.post time {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.post-body img { border-radius: 8px; margin: 1rem 0; }
.post-body pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
}
.post-body code { font-size: 0.9em; }

/* Footer */
.site-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  font-size: 0.85rem;
}

.site-footer a { color: inherit; }
.sep { margin: 0 0.4em; }

/* Admin */
.admin-form, .admin-dashboard { max-width: 720px; }

.admin-form label {
  display: block;
  margin: 1rem 0 0.35rem;
  font-weight: 600;
}

.admin-form .hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
  margin: -0.15rem 0 0.4rem;
}

.admin-form input, .admin-form textarea {
  width: 100%;
  padding: 0.6rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
}

.admin-form input[type="url"], .admin-form input[type="text"] { font-family: inherit; }

.admin-form textarea { font-family: "SFMono-Regular", Consolas, monospace; }

.admin-form button, .admin-dashboard button {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #10131f;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.admin-form a { margin-left: 1rem; color: var(--muted); }

.error { color: var(--error); }
.success { color: var(--success); }

.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-bar a { margin-right: 1rem; }

.admin-dashboard table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.admin-dashboard th, .admin-dashboard td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.admin-dashboard button {
  margin-top: 0;
  background: transparent;
  color: var(--error);
  padding: 0.2rem 0.5rem;
  font-weight: 400;
}
