/* === Base === */
:root {
  --bg: #111111;
  --bg-card: #181818;
  --text: #e8e6e3;
  --text-soft: #8a8a8a;
  --accent: #7faa8b;
  --accent-bg: rgba(127,170,139,0.08);
  --rule: #2a2a2a;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding: 0 1.5rem;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 9999;
}

/* === Nav === */
nav {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
}

.nav-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

/* === Page container === */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 0 4rem;
  animation: fadeUp 0.6s ease both;
}

/* === Typography === */
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 0.25em;
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.35rem;
  color: #fff;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}

.subtitle {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-soft);
  margin-bottom: 2.5rem;
}

hr {
  border: none;
  height: 1px;
  background: var(--rule);
  margin: 2.5rem 0;
}

p {
  font-size: 0.95rem;
  line-height: 1.85;
  font-weight: 300;
  margin-bottom: 1rem;
}

p:last-child { margin-bottom: 0; }

strong {
  font-weight: 500;
  color: #fff;
}

/* === Links row === */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: transparent;
  transition: all 0.2s ease;
}

.links a:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.links a svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* === Project cards === */
.projects {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.project {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  transition: border-color 0.2s;
}

.project:hover {
  border-color: #3a3a3a;
}

.project p {
  font-size: 0.875rem;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 0;
}

.project .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.project .tag {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--accent-bg);
  color: var(--accent);
}

/* === Verse block === */
.verse {
  margin-top: 3rem;
  padding: 1.25rem 1.5rem;
  background: var(--accent-bg);
  border-radius: 8px;
  border: 1px solid var(--rule);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.925rem;
  color: var(--accent);
  line-height: 1.75;
}

.verse cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* === Blockquote (for identity page) === */
blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.8;
}

/* === Section spacing === */
.section {
  margin-bottom: 2.5rem;
}

/* === Footer === */
footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.75rem;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}

/* === Animation === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Mobile === */
@media (max-width: 520px) {
  body { padding: 0 1.25rem; }
  .page { padding: 2rem 0 3rem; }
  .links { flex-direction: column; }
  .links a { justify-content: center; }
  nav { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
}