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

html { scroll-behavior: smooth; }

:root {
  --bg: #fffff8;
  --bg-box: rgba(255,255,240,0.8);
  --text: #2a2a18;
  --text-muted: #666650;
  --text-dim: #888870;
  --border: #c8c8a0;
  --grid: #e8e8d8;
  --grid-opacity: 0.4;
  --accent: #1a1a10;
  --tag-bg: #e8e8d8;
  --selection-bg: #d4cba8;
  --selection-text: #1a1a10;
}

body.dark {
  --bg: #1a1a18;
  --bg-box: rgba(40,40,38,0.8);
  --text: #d4d4c8;
  --text-muted: #a0a098;
  --text-dim: #787870;
  --border: #3a3a35;
  --grid: #2a2a28;
  --grid-opacity: 0.5;
  --accent: #d4d4c8;
  --tag-bg: #2a2a28;
  --selection-bg: #4a4a40;
  --selection-text: #d4d4c8;
}

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

body {
  font-family: 'Source Code Pro', monospace;
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

.grid-bg {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: var(--grid-opacity);
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.3s;
}

nav {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  transition: background 0.3s, border-color 0.3s;
}

.nav-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

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

main {
  max-width: 700px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

section {
  margin-bottom: 50px;
  scroll-margin-top: 70px;
}

.notebook-corner {
  position: fixed;
  top: 60px;
  right: 20px;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.section-label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

h1 {
  font-size: 38px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 4px;
}

.role {
  font-size: 16px;
  color: var(--text-muted);
  font-style: italic;
}

.box {
  border: 1px solid var(--border);
  background: var(--bg-box);
  padding: 16px 18px;
  transition: background 0.3s, border-color 0.3s;
}

.box-label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.obs {
  font-size: 15px;
  color: var(--text);
  line-height: 1.8;
}

.obs::before { content: '→ '; color: var(--text-dim); }

.obs + .obs { margin-top: 8px; }

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

.entry {
  font-size: 14px;
  color: var(--text);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.entry-label {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 2px;
}

.entry-title {
  font-weight: 500;
}

.entry-date {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 8px;
}

.project-link {
  text-decoration: none;
  color: inherit;
}

.project-link:hover .entry-title {
  text-decoration: underline;
  text-decoration-color: var(--border);
}

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

.tag {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--tag-bg);
  padding: 3px 8px;
  border-radius: 2px;
  transition: background 0.3s;
}

.contact-row {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.contact-row a {
  color: var(--text);
  text-decoration: none;
}

.contact-row a:hover {
  text-decoration: underline;
}

footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  transition: border-color 0.3s;
}

@media (max-width: 600px) {
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 11px; }
  .two-col { grid-template-columns: 1fr; }
  .contact-row { flex-direction: column; gap: 8px; }
  .notebook-corner { display: none; }
}
