/* style.css — clean monochrome research stylesheet */

:root{
  --page-width: 860px;
  --page-pad-x: 34px;
  --page-pad-y: 40px;

  --body-size: 16px;
  --body-line: 1.55;

  --h1-size: 34px;
  --h2-size: 22px;
  --h3-size: 18px;

  --mono-size: 14px;

  --rule: 1px solid #000;
  --hair: 1px solid #000;

  --max-line: 72ch;

  --font-mono: "Metrilous Mono", ui-monospace, monospace;
}

@font-face{
  font-family: "Metrilous Serif";
  src: url("/assets/fonts/metrilous-serif.woff2") format("woff2");
  font-display: swap;
}
@font-face{
  font-family: "Metrilous Mono";
  src: url("/assets/fonts/metrilous-mono.woff2") format("woff2");
  font-display: swap;
}
@font-face{
  font-family: "Metrilous Display";
  src: url("/assets/fonts/metrilous-display.woff2") format("woff2");
  font-display: swap;
}
@font-face{
  font-family: "Metrilous Math";
  src: url("/assets/fonts/metrilous-math.woff2") format("woff2");
  font-display: swap;
}

html,body{
  background:#fff;
  color:#000;
  margin:0;
  padding:0;
  overflow-x: hidden;
}

body{
  font-family: "Metrilous Serif", serif;
  font-size: var(--body-size);
  line-height: var(--body-line);
}

main{
  max-width: var(--page-width);
  margin: 0 auto;
  padding: var(--page-pad-y) var(--page-pad-x);
}

article{
  max-width: var(--page-width);
  margin: 0 auto;
  padding: var(--page-pad-y) var(--page-pad-x);
}

p{
  margin: 0 0 14px 0;
  max-width: var(--max-line);
}

hr{
  border:0;
  border-top: var(--hair);
  margin: 26px 0;
}

a{
  color:#000;
  text-decoration: underline;
}

a:hover{
  text-decoration-thickness: 2px;
}

a:focus{
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Hero */
.hero{
  font-family: "Metrilous Display", "Metrilous Serif", serif;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 2rem 0 1rem;
}

.tagline{
  font-size: 1.25rem;
  color: #555;
  margin-bottom: 1rem;
  max-width: var(--max-line);
}

/* Navigation */
nav{
  margin: 1rem 0 2rem;
  font-size: 0.9rem;
}

nav a{
  color: #555;
  text-decoration: none;
  padding: 0.25rem 0;
}

nav a:hover{
  color: #000;
  text-decoration: underline;
}

h1,h2,h3{
  font-weight: 600;
  margin: 26px 0 10px 0;
  max-width: var(--max-line);
}

h1{ font-size: var(--h1-size); }
h2{ font-size: var(--h2-size); }
h3{ font-size: var(--h3-size); }

/* Sections */
section{
  margin: 3rem 0;
}

section h2{
  font-size: 1.5rem;
  border-bottom: 1px solid #000;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Callout boxes */
.callout{
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

/* Labels */
.label{
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  margin-bottom: 0.25rem;
}

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

pre{
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 3px;
  overflow-x: auto;
}

code{
  background: #f5f5f5;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

pre code{
  background: none;
  padding: 0;
}

/* Math */
.math{
  font-family: "Metrilous Math", "Metrilous Serif", serif;
  background: #f5f5f5;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.math-block{
  display: block;
  padding: 1rem;
  overflow-x: auto;
  background: #f5f5f5;
  border-radius: 3px;
  margin: 1rem 0;
}

/* KaTeX */
.katex{
  font-size: 1.1em;
}

.katex-display{
  margin: 1.5rem 0;
  overflow-x: auto;
}

/* Tables */
table{
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

table caption{
  caption-side: top;
  text-align: left;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

th{
  background: #f5f5f5;
  border: var(--hair);
  font-weight: 600;
  text-align: left;
  padding: 0.75rem;
  border-bottom: 2px solid #ddd;
  vertical-align: top;
}

td{
  border: var(--hair);
  padding: 0.75rem;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

tr:hover td{
  background: #fafafa;
}

/* Footer */
footer{
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ddd;
  color: #555;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px){
  .hero{
    font-size: 2rem;
  }

  table{
    font-size: 0.8rem;
  }

  th, td{
    padding: 0.5rem;
  }

  section{
    margin: 2rem 0;
  }

  .callout{
    padding: 1rem;
  }
}

/* Print: deterministic PDF */
@media print {
  html, body {
    background: #fff;
    color: #000;
  }

  @page {
    size: A4;
    margin: 20mm;
  }

  main, article {
    max-width: none;
    padding: 0;
    margin: 0;
  }

  .hero {
    font-size: 36px;
  }

  h1 { font-size: 28px; }
  h2 { font-size: 20px; }
  h3 { font-size: 16px; }

  p, li, td, th {
    font-size: 14px;
    line-height: 1.5;
  }

  a {
    text-decoration: none;
    color: #000;
  }

  table {
    page-break-inside: avoid;
    border-collapse: collapse;
  }

  tr {
    page-break-inside: avoid;
  }

  th, td {
    border: 1px solid #000;
    background: #fff !important;
  }

  tr:hover td {
    background: #fff !important;
  }

  section {
    page-break-before: auto;
    page-break-after: auto;
    page-break-inside: avoid;
  }

  pre, code, .code {
    font-size: 12px;
  }

  .math {
    background: #f5f5f5;
  }

  .screen-only {
    display: none;
  }
}
