/* Enotrium - Minimalist Typography */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

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

body {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 18px;
  line-height: 1.6;
  color: #000;
  background: #fff;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 60px 20px;
}

/* ========== SIDEBAR ========== */
.sidebar {
  position: fixed;
  left: 40px;
  top: 40px;
  width: 60px;
  z-index: 100;
}

.logo {
  width: 50px;
  height: 50px;
  display: block;
}

.logo img {
  width: 100%;
  height: auto;
}

.sidebar-links {
  margin-top: 30px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.sidebar-links a {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000;
  text-decoration: none;
  margin-bottom: 20px;
  transition: opacity 0.2s;
}

.sidebar-links a:hover {
  opacity: 0.5;
}

/* ========== HERO ========== */
.hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero h1,
.hero-title {
  font-family: 'Iceland', sans-serif;
  font-size: clamp(160px, 30vw, 300px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.9;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
}

/* ========== SECTIONS ========== */
section {
  margin-top: 100px;
}

h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 30px;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 40px 0 20px;
}

h4 {
  font-size: 18px;
  font-weight: 600;
  margin: 30px 0 15px;
}

p {
  margin-bottom: 20px;
}

/* ========== ARTICLE LIST ========== */
.article-list {
  list-style: none;
}

.article-list li {
  border-top: 1px solid #eee;
  padding: 20px 0;
}

.article-list a {
  color: #000;
  text-decoration: none;
  font-size: 20px;
  display: block;
  transition: opacity 0.2s;
}

.article-list a:hover {
  opacity: 0.5;
}

.article-list .date {
  font-size: 12px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 5px;
}

/* ========== MATH ========== */
.math-block {
  margin: 40px 0;
  overflow-x: auto;
}

.math-block .katex-display {
  margin: 20px 0;
}

/* ========== CODE ========== */
code, pre {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  background: #f5f5f5;
  padding: 2px 6px;
}

pre {
  padding: 20px;
  overflow-x: auto;
  margin: 20px 0;
}

/* ========== LINKS ========== */
a {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  opacity: 0.7;
}

/* ========== LISTS ========== */
ul, ol {
  margin: 20px 0;
  padding-left: 30px;
}

li {
  margin-bottom: 10px;
}

/* ========== ASCII ART / DIAGRAMS ========== */
.ascii-art {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre;
  overflow-x: auto;
  margin: 30px 0;
}

/* ========== TABLES ========== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  font-size: 14px;
}

th, td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  font-weight: 600;
  border-bottom: 2px solid #000;
}

/* ========== BACK LINK ========== */
.back-link {
  display: inline-block;
  margin-bottom: 40px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ========== PROJECT HEADER ========== */
.project-header {
  margin-bottom: 60px;
}

.project-header h1 {
  font-size: 36px;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-header .tagline {
  font-size: 18px;
  color: #666;
  font-style: italic;
}

/* ========== KATEX MATH ========== */
.katex {
  font-weight: 400;
}

.katex .mord,
.katex .mbin,
.katex .mrel,
.katex .mopen,
.katex .mclose,
.katex .minner {
  font-weight: 400;
}

.katex .mathbf {
  font-weight: 500;
}

.math-block .katex-display {
  margin: 20px 0;
}

/* ========== MOBILE ========== */
@media (max-width: 900px) {
  .sidebar {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    text-align: center;
    margin-bottom: 40px;
  }
  
  .sidebar-links {
    writing-mode: horizontal-tb;
    transform: none;
    margin-top: 20px;
  }
  
  .sidebar-links a {
    display: inline-block;
    margin: 0 15px;
  }
  
  .logo {
    margin: 0 auto;
  }
  
  .hero h1,
  .hero-title {
    font-size: clamp(48px, 14vw, 80px);
  }

  .project-header h1 {
    font-size: 28px;
    text-align: center;
  }

  .project-header .tagline {
    text-align: center;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }
  
  .container {
    padding: 40px 15px;
  }
  
  h2 {
    font-size: 22px;
  }
  
  h3 {
    font-size: 18px;
  }
  
  .ascii-art {
    font-size: 11px;
  }
}

/* ========== TOP RIGHT NAV ========== */
.topbar {
  position: fixed;
  top: 40px;
  right: 40px;
  z-index: 200;
}

.topbar-nav a {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
  text-decoration: none !important; /* overrides global link style */
  transition: color 0.2s ease, opacity 0.2s ease;
}

.topbar-nav a:hover {
  opacity: 1;
  color: #000;
}

/* ========== HAMBURGER MENU ========== */
.menu-toggle {
  width: 24px;
  height: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  z-index: 101;
}

.menu-toggle span {
  display: block;
  height: 1px;
  background: #666;
  transition: all 0.3s ease;
}

/* Dropdown */
.menu-dropdown {
  position: absolute;
  top: 30px;
  right: 0;
  display: none;
  flex-direction: column;
  text-align: right;
  background: #fff;
  padding: 10px 0;
  z-index: 100;
}

.menu-dropdown a {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
  text-decoration: none !important;
  margin-top: 10px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.menu-dropdown a:hover {
  color: #000;
  opacity: 1;
}

/* Show menu */
.menu-dropdown.active {
  display: flex;
}