/**
 * Core Styles for Engineering Notes & Case Studies
 * Ameerul Arif Workspace
 */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

body {
  font-family: var(--font-sans);
  background-color: #0d1117;
  color: #e6edf3;
  line-height: 1.75;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Heading Spacing & Rhythms */
h1, h2, h3, h4 {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.85rem, 5vw, 2.75rem);
  line-height: 1.25;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.25rem;
  border-bottom: 1px solid #30363d;
  padding-bottom: 0.65rem;
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #58a6ff;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

/* Readable Paragraph Geometry */
p {
  margin-top: 0;
  margin-bottom: 1.75rem;
  color: #c9d1d9;
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 72ch; /* Optimal reading line length */
}

.mono {
  font-family: var(--font-mono);
}

/* Container Spacing */
.note-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Cards & Architecture Diagram Blocks */
.technical-block {
  margin: 2.5rem 0;
  padding: 1.75rem;
  border: 1px solid #30363d;
  background-color: #161b22;
  border-radius: 8px;
}

/* Code Formatting */
pre, code {
  font-family: var(--font-mono);
}

pre {
  background: #161b22;
  padding: 1.25rem;
  border: 1px solid #30363d;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e6edf3;
  margin: 1.75rem 0;
  overflow-x: auto;
}

code:not(pre code) {
  background: #21262d;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.875em;
  color: #79c0ff;
  border: 1px solid #30363d;
}

/* Lists */
.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
  color: #c9d1d9;
  max-width: 72ch;
}

.prose ul {
  list-style: square;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin-bottom: 0.75rem;
  line-height: 1.75;
  font-size: 0.95rem;
}

.prose strong {
  color: #ffffff;
  font-weight: 600;
}

  border: 0;
  border-top: 1px solid #30363d;
  margin: 3.5rem 0;
}

/* Links inside prose */
.prose a {
  color: #58a6ff;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.prose a:hover {
  color: #79c0ff;
}

/* Media: Images, Videos, Embeds */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #30363d;
  margin: 2rem auto;
  display: block;
}

.prose figure {
  margin: 2.5rem 0;
}
.prose figure img {
  margin: 0 auto 0.75rem auto;
}
.prose figcaption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #8b949e;
  text-align: center;
}

.prose video {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #30363d;
  margin: 2rem 0;
  display: block;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #30363d;
  background: #000;
}
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Mobile & Touch Responsive Polish */
@media (max-width: 640px) {
  .note-container {
    padding: 0 1rem;
    padding-top: 5rem;
    padding-bottom: 4rem;
  }
  h1 {
    font-size: 1.65rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  h2 {
    font-size: 1.1rem;
    margin-top: 2.25rem;
    margin-bottom: 1rem;
  }
  h3 {
    font-size: 0.95rem;
    margin-top: 1.5rem;
  }
  p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
  }
  .technical-block {
    margin: 1.5rem 0;
    padding: 1rem;
  }
  pre {
    padding: 0.85rem;
    font-size: 0.78rem;
    margin: 1.25rem 0;
  }
}

[x-cloak] {
  display: none !important;
}
