:root {
  --bg: #0a0a0a;
  --surface: #131313;
  --border: #232323;
  --text: #e7e7e4;
  --text-dim: #8c8c88;
  --accent: #3ecf8e;
  --accent-dim: #2a9d6c;
  --max: 680px;
  --max-wide: 900px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Header ---------- */

header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  font-size: 14px;
  color: var(--text-dim);
  padding: 7px 13px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

nav a:hover,
nav a:focus-visible {
  color: var(--text);
  background: var(--surface);
}

nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface);
}

.socials {
  display: flex;
  gap: 14px;
  align-items: center;
}

.socials a {
  color: var(--text-dim);
  transition: color 0.15s ease;
  display: flex;
}

.socials a:hover,
.socials a:focus-visible {
  color: var(--accent);
}

.socials svg {
  width: 18px;
  height: 18px;
}

/* ---------- Layout ---------- */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 24px 96px;
}

main.wide {
  max-width: var(--max-wide);
}

section + section {
  margin-top: 64px;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 20px;
}

h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

p {
  margin: 0 0 18px;
  color: var(--text);
}

.dim {
  color: var(--text-dim);
}

/* ---------- Hero ---------- */

.avatar {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
  margin-bottom: 28px;
}

.hero-greeting {
  font-size: 15px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

/* ---------- Cards ---------- */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 620px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease;
}

.card:hover,
.card:focus-visible {
  border-color: var(--accent-dim);
}

.card-body {
  padding: 18px 20px 22px;
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
}

.card p {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.55;
}

.card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tag {
  font-size: 11.5px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
}

.card-link-row {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  gap: 16px;
}

.card-link-row a {
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.15s ease;
}

.card-link-row a:hover {
  color: var(--accent);
}

/* ---------- Skills / education ---------- */

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-pill-alt {
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 12px;
}

.edu-item {
  border-left: 2px solid var(--border);
  padding-left: 18px;
  margin-bottom: 20px;
}

.edu-item:last-child {
  margin-bottom: 0;
}

.edu-item .role {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}

.edu-item .meta {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.edu-item .desc {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0;
}

/* ---------- Form ---------- */

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

label {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  display: block;
}

input,
textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 11px 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-dim);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

button {
  align-self: flex-start;
  background: var(--accent);
  color: #06140d;
  border: none;
  border-radius: 5px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

button:hover {
  background: #4fe0a0;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-status {
  font-size: 13px;
  color: var(--text-dim);
  min-height: 18px;
}

.form-status.success {
  color: var(--accent);
}

.form-status.error {
  color: #e07a5f;
}

/* ---------- Blog list ---------- */

.post-item {
  display: block;
  text-decoration: none;
  color: var(--text);
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.post-item:first-child {
  padding-top: 0;
}

.post-item h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
}

.post-item .post-date {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.post-item p {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0;
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px 40px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- Focus visibility ---------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
