/* theorycorner.com — single stylesheet, no JS. Theme values live in :root. */
@font-face {
  font-family: 'Roboto Slab';
  src: url('/static/fonts/RobotoSlab-Regular.woff2') format('woff2'),
       url('/static/fonts/RobotoSlab-Regular.woff') format('woff');
  font-weight: normal; font-style: normal; font-display: swap;
}

:root {
  --bg-top: #ffffff;
  --bg-bottom: #daa520;        /* goldenrod */
  --card: rgba(0, 0, 0, .22);
  --card-radius: clamp(16px, 4vw, 40px);
  --text: #111;
  --muted: #3a3a3a;
  --link: #1a1aee;
  --tag-bg: rgba(255, 255, 255, .35);
  --font: 'Roboto Slab', Georgia, 'Times New Roman', serif;
  --max: 780px;
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  background: linear-gradient(var(--bg-top), var(--bg-bottom)) no-repeat fixed;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  overflow-wrap: break-word;
}
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { text-align: center; line-height: 1.25; margin: 1.2em 0 .6em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
img, video { max-width: 100%; height: auto; }
article img, main > p > img { display: block; margin: 1em auto; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
pre { overflow-x: auto; padding: .75em 1em; background: rgba(255,255,255,.4); border-radius: 8px; }
table { border-collapse: collapse; margin: 1em auto; }
td, th { padding: .25em .6em; }
blockquote { margin: 1em 0; padding: .25em 1em; border-left: 4px solid rgba(0,0,0,.3); }

/* header / nav */
.site-header { text-align: center; padding: 12px 16px 4px; }
.site-header nav a { margin: 0 .55em; white-space: nowrap; }
.site-header nav img { vertical-align: -1px; }

/* the card */
main {
  max-width: var(--max);
  margin: 10px auto 40px;
  padding: clamp(18px, 5vw, 48px);
  background: var(--card);
  border-radius: var(--card-radius);
}
main > :first-child { margin-top: 0; }

.site-footer { text-align: center; padding: 0 16px 40px; color: var(--muted); font-size: .9em; }

/* two columns that stack on narrow screens */
.row, .intro {
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center;
}
.row > *, .intro > div { flex: 1 1 280px; min-width: 0; }
.intro .portrait { flex: 0 1 220px; width: 220px; margin: 0 auto; border-radius: 50%; }
.center-div { text-align: center; margin: 1em auto; }

/* topics + post list */
.topics { text-align: center; position: relative; }
.tag {
  display: inline-block; margin: 2px 2px; padding: 1px 9px;
  background: var(--tag-bg); border-radius: 999px; font-size: .85em; text-decoration: none;
}
.tag:hover, .tag.active { background: rgba(255,255,255,.65); text-decoration: none; }
.backforth { animation: bf .5s linear both infinite alternate; display: inline-block; }
@keyframes bf { from { transform: translateX(.25em); } to { transform: translateX(0); } }

.posts { list-style: none; padding: 0; margin: 0 auto; max-width: 620px; }
.posts li {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 2px 12px; padding: .5em 0; border-bottom: 1px solid rgba(0,0,0,.15);
}
.posts li:last-child { border-bottom: 0; }
.post-title { flex: 1 1 320px; }
.post-meta { color: var(--muted); font-size: .85em; white-space: nowrap; }
.post-meta time { margin-right: 4px; }
article > .post-meta { text-align: center; margin-top: -0.5em; }

.pager { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 2em; padding-top: 1em; border-top: 1px solid rgba(0,0,0,.15); }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery a { display: block; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: #fff; }
.gallery img:hover { outline: 3px solid rgba(255,255,255,.7); }

.cryptoaddr { font-size: .75em; word-break: break-all; }
.mascot { display: block; margin: 1em auto; }

@media (prefers-reduced-motion: reduce) { .backforth { animation: none; } }

/* ---- theme: B-paper ---- */
:root { --bg-top: #f7f2e8; --bg-bottom: #f7f2e8; --card: transparent; --text: #221d14; --muted: #6b614f; --link: #9a5a00; --tag-bg: #ecdfc3; --max: 700px; }
html { background: #f7f2e8; }
body { font-size: 18px; line-height: 1.6; }
main { padding: 8px clamp(16px, 4vw, 24px) 40px; }
h1, h2, h3, h4 { text-align: left; }
h1 { font-size: 2rem; margin-top: .4em; }
.site-header { max-width: var(--max); margin: 0 auto; padding: 18px clamp(16px,4vw,24px) 12px; text-align: left; display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; border-bottom: 2px solid #221d14; }
.site-header::before { content: "Theory Corner"; font-size: 1.35rem; font-weight: bold; }
.site-header nav a { margin: 0 0 0 1em; color: var(--text); text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }
.intro { align-items: flex-start; }
.intro .portrait { width: 160px; flex-basis: 160px; margin: 0; }
.topics, .center-div { text-align: left; }
.posts { max-width: none; }
.posts li { border-bottom: 1px dotted #b8aa8c; }
.post-meta { font-family: ui-monospace, Menlo, monospace; font-size: .78em; letter-spacing: .02em; }
article > .post-meta { text-align: left; }
.tag { border-radius: 4px; }
.tag:hover, .tag.active { background: #d9c48f; }
.site-footer { border-top: 1px solid #b8aa8c; max-width: var(--max); margin: 0 auto; padding-top: 14px; text-align: left; }
.gallery img { border-radius: 2px; border: 1px solid #d9cdb3; }
