/* Shared styles for every production page. */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --body: #333333;
  --muted: #666666;
  --faint: #767676;
  --hair: #dddddd;
  --mono: ui-monospace, "SF Mono", Consolas, "Roboto Mono", monospace;
}
:root[data-theme="dark"] {
  --bg: #1a1a1a;
  --ink: #ececec;
  --body: #c4c4c4;
  --muted: #a3a3a3;
  --faint: #888888;
  --hair: #333333;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #1a1a1a;
    --ink: #ececec;
    --body: #c4c4c4;
    --muted: #a3a3a3;
    --faint: #888888;
    --hair: #333333;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 13px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration: none; font-weight: 700; border-bottom: 1px solid var(--ink); }
a:hover { opacity: .6; box-shadow: 0 1px 0 0 var(--ink); }

.topbar { position: fixed; top: 10px; right: 12px; z-index: 50; display: flex; gap: 8px; }
.theme-toggle { border: 1px solid var(--ink); background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 10px; letter-spacing: .12em; padding: 5px 10px; cursor: pointer; }
.theme-toggle:hover { background: var(--ink); color: var(--bg); box-shadow: none; }
#bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.shell { position: relative; z-index: 1; }

.shell { max-width: 780px; margin: 0 auto; padding: 36px 24px 64px; }
.nav { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 11px; letter-spacing: .1em; margin-bottom: 20px; }
.nav .cur { font-weight: 700; }

.box { border: 1px solid var(--ink); padding: 18px 20px; background: var(--bg); }

.head-box { display: flex; gap: 20px; align-items: center; }
.head-box .ph { flex: none; border: 1px solid var(--ink); }
.head-box .ph img { display: block; width: 180px; height: 180px; object-fit: cover; }
.head-box h1 { font-size: 17px; letter-spacing: .02em; margin: 0 0 4px; text-transform: uppercase; }
.head-box .rl { color: var(--body); margin: 0 0 2px; }
.head-box .org { color: var(--muted); margin: 0; font-size: 12px; }
.head-box .fo { color: var(--body); font-style: italic; margin: 6px 0 0; font-size: 12px; }

.sec { margin-top: 24px; }
.sec .sb { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); letter-spacing: .1em; margin-bottom: 12px; }
.sec .sb h1, .sec .sb h2 { margin: 0; font-size: inherit; line-height: inherit; color: var(--ink); font-weight: 700; letter-spacing: .14em; }
.box p { margin: 0 0 10px; color: var(--body); }
.box p:last-child { margin-bottom: 0; }

.pub { display: grid; grid-template-columns: 46px minmax(0,1fr) 150px 160px; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); align-items: baseline; }
.pub-entry:first-child .pub { border-top: 1px solid var(--hair); }
.pub .y { grid-column: 1; grid-row: 1; color: var(--muted); }
.pub .ta { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pub .t { font-weight: 700; color: var(--ink); }
.pub .a { color: var(--muted); font-size: 11px; }
.pub .a em { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.pub .a a.ca { color: inherit; font-weight: inherit; border-bottom: none; text-decoration: none; }
.pub .a a.ca:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.pub .v { grid-column: 3; grid-row: 1; color: var(--muted); font-size: 12px; font-style: italic; }
.pub .l { grid-column: 4; grid-row: 1; font-size: 12px; white-space: nowrap; }
.sep { color: var(--faint); }
.abs { font-weight: 700; border-bottom: 1px solid var(--ink); cursor: pointer; }
.abs:hover { opacity: .6; box-shadow: 0 1px 0 0 var(--ink); }
.pub-abs { padding: 10px 0 12px 58px; color: var(--body); font-size: 12px; }
.pub-entry > summary { list-style: none; cursor: pointer; }
.pub-entry > summary::-webkit-details-marker { display: none; }

.nrow { display: flex; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.nrow .d { flex: none; width: 76px; color: var(--muted); font-size: 12px; padding-top: 1px; font-style: italic; }
.nrow p { margin: 0; color: var(--body); }

.kv { display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 8px 16px; align-items: baseline; }
.kv .k { color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.more { margin-top: 12px; }

@media (max-width: 640px) {
  .head-box { flex-direction: column; align-items: flex-start; }
  .pub { grid-template-columns: 46px minmax(0,1fr); }
  .pub .y { grid-column: 1; grid-row: auto; }
  .pub .ta, .pub .v, .pub .l { grid-column: 2; grid-row: auto; }
  .nrow { flex-direction: column; gap: 2px; }
  .nrow .d { width: auto; padding-top: 0; }
}
.foot { margin-top: 36px; color: var(--muted); font-size: 11px; letter-spacing: 0.4px; }


/* Page-specific spacing shares the same layout and typography. */
.page-publications .sec, .page-code .sec, .page-news .sec { margin-top: 0; }
.page-cv .sec:first-child { margin-top: 0; }

/* Repository cards. */
.repos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.repo { min-width: 0; border: 1px solid var(--ink); background: var(--bg); padding: 14px 16px; }
.repo .rname { font-size: 12px; overflow-wrap: anywhere; }
.repo .rdesc { margin: 6px 0 0; color: var(--body); font-size: 12px; }
.repo .rstats { display: none; margin: 6px 0 0; color: var(--faint); font-size: 11px; letter-spacing: .05em; }
.repo .rstats.show { display: block; }
@media (max-width: 640px) {
  .repos { grid-template-columns: 1fr; }
}

/* Not-found page. */
.nf { margin-top: 40px; text-align: left; }
.nf .code { font-size: 56px; font-weight: 700; letter-spacing: .06em; line-height: 1; margin: 0 0 14px; }
.nf h1 { font-size: 13px; letter-spacing: .14em; margin: 0 0 10px; text-transform: uppercase; }
.nf p { margin: 0 0 14px; color: var(--body); }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
