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

:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #888;
  --bio: #444;
  --border: #e0e0e0;
  --input-bg: #fff;
  --hover-bg: #f0f0f0;
  --btn-bg: #1a1a1a;
  --btn-fg: #fafafa;
  --status: #555;
  --footer: #bbb;
  --nav-active: #1a1a1a;
}

[data-theme="dark"] {
  --bg: #111;
  --fg: #f0f0f0;
  --muted: #666;
  --bio: #aaa;
  --border: #2e2e2e;
  --input-bg: #1c1c1c;
  --hover-bg: #1e1e1e;
  --btn-bg: #f0f0f0;
  --btn-fg: #111;
  --status: #888;
  --footer: #444;
  --nav-active: #f0f0f0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

/* ── Top bar ── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  transition: background 0.2s, border-color 0.2s;
  z-index: 100;
}

.topbar-name {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--fg);
  text-decoration: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ── Nav ── */
nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

nav a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

nav a:hover { color: var(--fg); background: var(--hover-bg); }
nav a.active { color: var(--nav-active); font-weight: 600; }

/* ── Theme toggle ── */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  margin-left: 0.5rem;
}

.theme-toggle:hover { color: var(--fg); background: var(--hover-bg); }
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"]  .theme-toggle .icon-moon { display: block; }

/* ── Page wrapper ── */
.page {
  padding-top: 56px; /* offset for fixed topbar */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Home page centers vertically */
.page.home {
  justify-content: center;
  padding-top: 80px;
  padding-bottom: 2rem;
}

/* Inner pages align top */
.page.inner {
  padding-top: 80px;
  padding-bottom: 4rem;
}

main {
  width: 100%;
  padding: 0 1.5rem;
}

.page.home main {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.page.inner main {
  max-width: 680px;
  margin: 0 auto;
}

/* ── Page heading ── */
.page-heading {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 2rem;
}

/* ── Avatar ── */
.avatar {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ── Profile ── */
.profile { text-align: center; }

.profile h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--fg);
}

.profile .title {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 0.25rem;
}

.profile .bio {
  margin-top: 0.85rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--bio);
}

/* ── Social links ── */
.links { display: flex; gap: 0.75rem; }

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.15s, background 0.15s;
}

.links a:hover { border-color: var(--fg); background: var(--hover-bg); }
.links a svg { flex-shrink: 0; }

/* ── Divider ── */
.divider {
  width: 100%;
  border: none;
  border-top: 1px solid var(--border);
}

/* ── Contact form ── */
.contact { width: 100%; }

.contact h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1rem;
  text-align: center;
}

.contact form { display: flex; flex-direction: column; gap: 0.75rem; }

.contact input,
.contact textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--fg);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s, background 0.2s, color 0.2s;
  resize: none;
}

.contact input::placeholder,
.contact textarea::placeholder { color: var(--muted); }

.contact input:focus,
.contact textarea:focus { border-color: var(--fg); }

.contact textarea { height: 110px; }

.contact button {
  align-self: flex-end;
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.contact button:hover { opacity: 0.75; }

.status {
  font-size: 0.85rem;
  text-align: center;
  color: var(--status);
  min-height: 1.2em;
  margin-top: 0.5rem;
}

/* ── Inner page content blocks ── */
.entry {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.entry:last-child { border-bottom: none; }

.entry-meta {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.entry h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.3rem;
}

.entry h3 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.entry p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--bio);
}

.placeholder-note {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  padding: 2rem 0;
  text-align: center;
}

/* ── Footer ── */
footer {
  margin-top: 3rem;
  font-size: 0.75rem;
  color: var(--footer);
  text-align: center;
}
