@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500&display=swap');

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

:root {
  --bg: #131316;
  --surface: #18181b;
  --text: #b0b0b0;
  --text-dim: #484848;
  --accent: #6b1c1c;
  --accent-bright: #9a2e2e;
  --border: #181818;
  --sans: 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
  --display: 'Roboto Mono', monospace;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Canvas ── */

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* ── Navigation ── */

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  gap: 2rem;
  padding: 1.5rem 2.5rem;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  font-family: var(--sans);
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s;
  position: relative;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--accent-bright);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
}

/* ── Pages ── */

.page {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.page.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Landing ── */

#page-landing {
  align-items: flex-end;
  justify-content: flex-end;
}

.landing-content {
  text-align: right;
  z-index: 10;
  padding: 3rem 3.5rem;
  max-width: 600px;
}

.landing-hello {
  font-family: var(--display);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin-bottom: 0.3rem;
}

.landing-name {
  font-family: var(--display);
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 300;
  font-style: normal;
  letter-spacing: 0.05em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.8rem;
}

.landing-tagline {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 300;
  letter-spacing: 0.08em;
  margin-bottom: 1.8rem;
}

.landing-links {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
  font-size: 0.82rem;
  font-family: var(--sans);
}

.landing-links a {
  color: var(--accent-bright);
  text-decoration: none;
  transition: color 0.2s;
}

.landing-links a:hover {
  color: var(--text);
}

.sep {
  color: var(--text-dim);
  user-select: none;
}

/* ── Scrollable pages ── */

#page-blog.active,
#page-cv.active {
  overflow-y: auto;
  align-items: flex-start;
  justify-content: flex-start;
  pointer-events: auto;
}

.page-inner {
  max-width: 640px;
  width: 100%;
  margin: 6rem auto 4rem;
  padding: 0 2rem;
  z-index: 10;
  position: relative;
}

.page-inner h2 {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 400;
  margin-bottom: 2.5rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

/* ── Blog ── */

.blog-entry {
  margin-bottom: 2.5rem;
}

.blog-entry time {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.blog-entry h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 400;
  margin: 0.25rem 0 0.4rem;
}

.blog-entry h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.blog-entry h3 a:hover {
  color: var(--accent-bright);
}

.blog-entry p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Blog Post ── */

.blog-back {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.blog-back:hover {
  color: var(--accent-bright);
}

.blog-post time {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.blog-post-title {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--text);
  margin: 0.5rem 0 2rem;
  border: none;
  padding: 0;
}

.blog-post-body {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text);
}

.blog-post-body h2 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text);
  margin: 2rem 0 0.8rem;
  border: none;
  padding: 0;
}

.blog-post-body p {
  margin-bottom: 1rem;
}

.blog-post-body code {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85em;
  background: var(--surface);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.blog-post-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin-bottom: 1.2rem;
}

.blog-post-body pre code {
  background: none;
  padding: 0;
}

#page-blog-post.active {
  overflow-y: auto;
  align-items: flex-start;
  justify-content: flex-start;
  pointer-events: auto;
}

/* ── CV ── */

.cv-section {
  margin-bottom: 2.5rem;
}

.cv-section h3 {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-bright);
  margin-bottom: 1.2rem;
  font-family: var(--sans);
}

.cv-item {
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

.cv-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

.cv-title {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text);
}

.cv-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.cv-desc a {
  color: var(--accent-bright);
  text-decoration: none;
}

.cv-desc a:hover {
  color: var(--text);
}

.cv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cv-tags span {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 2px;
  transition: border-color 0.2s, color 0.2s;
}

.cv-tags span:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ── Scrollbar ── */

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ── Selection ── */

::selection {
  background: var(--accent);
  color: var(--text);
}
