/* supabrain.space — sober academic layout */

:root {
  --bg: #fafaf8;
  --fg: #1a1a1a;
  --muted: #555;
  --rule: #d8d4cc;
  --link: #2c5282;
  --link-hover: #1a365d;
  --code-bg: #f0ece5;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
               Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  margin: 0;
  padding: 0;
  text-rendering: optimizeLegibility;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

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

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

h1 {
  font-size: 2.3rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 0.25rem;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 2.5rem;
  font-style: italic;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 3rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

.thesis {
  margin: 2.5rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--rule);
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--fg);
}

.thesis em {
  font-style: normal;
  font-weight: 500;
}

.paper-meta {
  border: 1px solid var(--rule);
  background: #fff;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0 2rem;
  font-size: 0.96rem;
}

.paper-meta .paper-title {
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.45;
  margin: 0 0 0.5rem;
}

.paper-meta .paper-author {
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.paper-meta .paper-links {
  margin: 0;
}

.paper-meta .paper-links a {
  margin-right: 1.25rem;
}

.paper-meta .paper-status {
  color: var(--muted);
  font-style: italic;
}

.abstract {
  font-size: 0.96rem;
  line-height: 1.6;
}

.abstract p {
  text-align: justify;
}

figure {
  margin: 1.5rem 0;
}

figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: #fff;
}

figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.4rem;
  line-height: 1.4;
  text-align: center;
}

ul, ol {
  padding-left: 1.5rem;
  margin: 0 0 1rem;
}

li {
  margin: 0.35rem 0;
}

.iterations {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
  border-top: 1px solid var(--rule);
}

.iterations li {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  margin: 0;
  font-size: 0.94rem;
  align-items: baseline;
}

.iterations .it-label {
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.iterations .it-outcome {
  color: var(--fg);
}

.iterations .it-outcome em {
  color: var(--muted);
  font-style: italic;
}

code, kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

dl {
  margin: 0.75rem 0;
}

dt {
  font-weight: 600;
  margin-top: 0.5rem;
}

dd {
  margin: 0 0 0.4rem 0;
}

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: left;
}

footer p {
  margin: 0.35rem 0;
}

footer a {
  color: var(--muted);
}

/* Mobile */
@media (max-width: 640px) {
  html { font-size: 16px; }
  main { padding: 2rem 1.15rem 3rem; }
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.15rem; }
  .thesis { font-size: 1.02rem; padding: 1rem 1.1rem; }
  .paper-meta { padding: 1rem 1.1rem; }
  .paper-meta .paper-links a { display: block; margin: 0 0 0.5rem; }
  .iterations li { grid-template-columns: 4rem 1fr; gap: 0.75rem; font-size: 0.92rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --fg: #e6e3da;
    --muted: #999591;
    --rule: #2c2c34;
    --link: #7aa7d6;
    --link-hover: #9cc1e3;
    --code-bg: #22222a;
  }
  .paper-meta { background: #1c1c22; }
  figure img { background: #1c1c22; }
}
