/* marshad.pw (draft). Shared styles for the home page and /blog/. No external requests. */
@font-face { font-family: "Newsreader"; src: url("assets/fonts/newsreader.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("assets/fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #12110e; --bg-soft: #1b1915; --ink: #f4efe6; --muted: #b4ada0; --faint: #9a9489;
  --line: #2e2a24; --accent: #d7b07a; --link: #ead3a6; --focus: #f0d7a4;
  --radius: .55rem; --measure: 40rem; --content: 46rem;
  --sans: "Instrument Sans", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4efe6; --bg-soft: #fffdf8; --ink: #171410; --muted: #5a554c; --faint: #6f695e;
    --line: #d8cfc0; --accent: #8a5418; --link: #6e4314; --focus: #8a5418;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4efe6; --bg-soft: #fffdf8; --ink: #171410; --muted: #5a554c; --faint: #6f695e;
  --line: #d8cfc0; --accent: #8a5418; --link: #6e4314; --focus: #8a5418;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.65 var(--sans); }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
.wrap { width: min(100% - 2.5rem, var(--content)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: var(--bg); padding: .5rem .8rem; border-radius: var(--radius); }
.skip:focus { left: .5rem; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; color: var(--ink); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .9rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.theme-toggle { font: inherit; font-size: .85rem; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .25rem .75rem; cursor: pointer; }

.hero { padding-block: clamp(2.5rem, 8vw, 4.5rem) 1rem; }
.hero-top { display: flex; align-items: center; gap: 1.25rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); letter-spacing: -.01em; }
.sub { margin: .25rem 0 0; color: var(--muted); }
.lede { font-size: 1.2rem; max-width: var(--measure); margin: 1.75rem 0 0; }

.section { padding-block: 2.75rem; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
.kicker { margin: 0 0 .35rem; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
h2 { font-size: clamp(1.6rem, 4vw, 2rem); margin-bottom: 1rem; }
.section p { max-width: var(--measure); }
.src { font-size: .85rem; color: var(--faint); margin-top: -.4rem; }
.src a { color: var(--faint); }

.products { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .85rem; }
@media (min-width: 40rem) { .products { grid-template-columns: 1fr 1fr; } }
.products li { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.products h3 { font-size: 1.3rem; display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.products h3 a { color: var(--ink); text-decoration: none; }
.products h3 a:hover { text-decoration: underline; }
.status { font-family: var(--sans); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .5rem; white-space: nowrap; }
.products p { margin: .45rem 0 .35rem; font-size: .98rem; color: var(--muted); }
.url { font-size: .85rem; }

.papers { padding-left: 1.25rem; margin: 1.25rem 0 0; }
.papers li { margin-bottom: .9rem; }
.papers a.t { font-family: var(--serif); font-size: 1.08rem; color: var(--ink); }
.doi { display: block; font-size: .85rem; color: var(--faint); }
.doi a { color: var(--faint); }
.row { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1rem; font-size: .95rem; }

.contact { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; max-width: var(--measure); }
.contact a { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.contact a:hover { border-color: var(--accent); }
.contact .h { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; text-align: right; }

.site-footer { border-top: 1px solid var(--line); padding-block: 1.5rem 2.5rem; color: var(--faint); font-size: .85rem; }
.site-footer p { margin: .2rem 0; }
@media (max-width: 34rem) { .nav { display: none; } }

/* Portrait */
.portrait { flex: none; width: 6.5rem; height: 6.5rem; border-radius: 50%; object-fit: cover; object-position: 50% 30%;
  border: 2px solid var(--accent); padding: 3px; background: var(--bg-soft); box-shadow: 0 6px 24px rgba(0,0,0,.25); }
@media (min-width: 40rem) { .portrait { width: 7.5rem; height: 7.5rem; } }

/* Writing list */
.posts { list-style: none; padding: 0; margin: 1.25rem 0 0; max-width: var(--measure); }
.posts li { display: grid; grid-template-columns: 7.5rem 1fr; gap: .25rem 1rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.posts li:first-child { border-top: 0; }
.posts time { color: var(--faint); font-size: .88rem; padding-top: .15rem; }
.posts a { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); }
.posts .where { display: block; font-size: .82rem; color: var(--faint); }
@media (max-width: 30rem) { .posts li { grid-template-columns: 1fr; } }
.page-head { padding-block: clamp(2rem, 6vw, 3.5rem) .5rem; }
.template-banner { background: #7a1f1f; color: #fff; padding: .6rem 1rem; text-align: center; font-weight: 600; }
