@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&family=Newsreader:opsz,wght@6..72,400;500;600&display=swap');

:root {
  --bg-color: #ffffff;
  --surface-color: #ffffff;
  --panel-bg: #ffffff;
  --text-primary: #111111;
  --text-color: #111111;
  --text-secondary: #111111;
  --text-muted: #111111;
  --link-color: #111111;
  --link-hover: #111111;
  --border-color: #dddddd;
  --code-bg: #f4f4f4;
  --blockquote-color: #111111;
  --panel-strong: #111111;
  --accent: #111111;
  --selection-bg: #111111;
  --selection-text: #ffffff;
  --canvas-1: #111111;
  --canvas-2: #2c2c2c;
  --canvas-3: #454545;
  --canvas-4: #5f5f5f;
  --canvas-5: #787878;
  --canvas-6: #929292;
  --monospace: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

body.dark-mode {
  --bg-color: #060606;
  --surface-color: #060606;
  --panel-bg: #060606;
  --text-primary: #f3f3f3;
  --text-color: #f3f3f3;
  --text-secondary: #f3f3f3;
  --text-muted: #f3f3f3;
  --link-color: #f3f3f3;
  --link-hover: #f3f3f3;
  --border-color: #2a2a2a;
  --code-bg: #121212;
  --blockquote-color: #f3f3f3;
  --panel-strong: #f3f3f3;
  --accent: #f3f3f3;
  --selection-bg: #f3f3f3;
  --selection-text: #060606;
  --canvas-1: #f3f3f3;
  --canvas-2: #dddddd;
  --canvas-3: #c5c5c5;
  --canvas-4: #acacac;
  --canvas-5: #949494;
  --canvas-6: #7b7b7b;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg-color);
}

body {
  min-height: 100vh;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: 'Newsreader', Georgia, serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.painting-bg {
  display: none;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
}

code,
pre,
samp,
kbd {
  font-family: var(--monospace);
}

.content-card,
.container {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 56px;
  background: var(--surface-color);
  animation: fadeIn 0.45s ease-out both;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--border-color);
}

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

.site-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 38px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.lorenz-container {
  width: 112px;
  height: 68px;
  flex-shrink: 0;
  pointer-events: none;
}

#lorenzCanvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  background: transparent;
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  border-bottom-color: currentColor;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--text-primary);
  transform: translateY(-1px);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.theme-icon {
  display: block;
}

body.dark-mode .sun-icon {
  display: none;
}

body.dark-mode .moon-icon {
  display: block;
}

body:not(.dark-mode) .sun-icon {
  display: block;
}

body:not(.dark-mode) .moon-icon {
  display: none;
}

main {
  display: grid;
  gap: 40px;
  padding-top: 28px;
}

.intro-grid,
.notes-grid {
  display: grid;
  gap: 32px;
  align-items: start;
}

.intro-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
}

.notes-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.85fr);
}

.greeting {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(46px, 5vw, 64px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.lede {
  max-width: 44ch;
  color: var(--text-secondary);
  font-size: 17px;
  margin-bottom: 10px;
}

.interest-list {
  max-width: 48ch;
  margin-left: 1.1rem;
  color: var(--text-secondary);
}

.interest-list li {
  margin-bottom: 8px;
  padding-left: 2px;
}

.bio p {
  margin-bottom: 18px;
}

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

.bio strong,
.blog-title a,
.blog-title-main,
.blog-content h2,
.blog-content h3 {
  color: var(--text-primary);
}

.bio a,
.back-link,
.blog-content a,
#references a {
  border-bottom: 1px solid transparent;
}

.bio a:hover,
.back-link:hover,
.blog-content a:hover,
#references a:hover {
  border-bottom-color: currentColor;
}

.ascii-panel,
.axiom-block {
  border: 0;
  background: transparent;
  padding: 0;
}

.ascii-art {
  min-height: 18em;
  white-space: pre;
  overflow: hidden;
  font-family: var(--monospace);
  font-size: 12px;
  line-height: 1.02;
  color: var(--panel-strong);
}

.ascii-art-compact {
  min-height: 10.6em;
  font-size: 11px;
}

.ascii-caption {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.side-notes {
  display: grid;
  gap: 0;
}

.blog-list {
  max-width: 100%;
}

.blog-item {
  padding: 0 0 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

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

.blog-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 4px;
}

.blog-date,
.blog-meta {
  color: var(--text-muted);
  font-size: 13px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

blockquote {
  border-left: 1px solid var(--text-primary);
  padding-left: 18px;
  color: var(--blockquote-color);
}

img,
video {
  max-width: 100%;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media screen and (max-width: 900px) {
  .intro-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .content-card,
  .container {
    width: min(980px, calc(100% - 40px));
    padding-top: 28px;
    padding-bottom: 40px;
  }
}

@media screen and (max-width: 768px) {
  .site-title {
    font-size: 32px;
  }

  .lorenz-container {
    width: 92px;
    height: 56px;
  }

  .greeting {
    font-size: 42px;
  }

  .nav-link {
    font-size: 13px;
  }

  .ascii-art {
    font-size: 10px;
  }
}

@media screen and (max-width: 480px) {
  .content-card,
  .container {
    width: calc(100% - 24px);
    padding-top: 20px;
    padding-bottom: 28px;
  }

  header {
    gap: 14px;
    padding-bottom: 16px;
  }

  .header-brand {
    gap: 10px;
  }

  .site-title {
    font-size: 26px;
  }

  .lorenz-container {
    width: 76px;
    height: 46px;
  }

  .greeting {
    font-size: 34px;
  }

  .lede,
  .bio p,
  .interest-list li {
    font-size: 15px;
  }

  .ascii-art {
    min-height: 15em;
    font-size: 9px;
  }

  .ascii-art-compact {
    min-height: 8.8em;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  body,
  .content-card,
  .container,
  .greeting,
  .theme-toggle {
    animation: none !important;
    transition: none !important;
  }
}
