/* ==========================================================================
   sabinasz.net — shared stylesheet
   Used by the home page and by every article / living document page.
   Design goals: academic seriousness, high readability, restraint.
   ========================================================================== */

/* --- Design tokens -------------------------------------------------------- */
:root {
  --ink:        #1a1a1a;   /* primary text                       */
  --ink-soft:   #4a4a4a;   /* secondary text, metadata           */
  --ink-faint:  #767676;   /* captions, dates, fine print        */
  --accent:     #3b7ea1;   /* light academic blue — links, accents */
  --accent-dim: #5c9bbd;   /* hover / visited                      */
  --rule:       #e3e0da;   /* hairline rules                     */
  --paper:      #ffffff;   /* page background — warm off-white   */
  --card:       #fbfaf7;   /* raised surfaces                    */

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, Cambria, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           Helvetica, Arial, sans-serif;

  --measure: 42rem;        /* reading column width               */
  --measure-wide: 52rem;   /* home / showcase width              */
}

/* --- Reset / base --------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Centered content column. Add class `wide` for showcase pages. */
.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}
.page.wide { max-width: var(--measure-wide); }

/* --- Typography ----------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--sans);
  line-height: 1.25;
  font-weight: 600;
  color: var(--ink);
}

h1 {
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}
h2 {
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin: 3rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}
h3 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }
h4 { font-size: 1.02rem; margin: 1.5rem 0 0.4rem; }

/* A section-level h1 inside the article body (not the doc title, which lives
   in .doc-header) needs room above it and breathing space before its text. */
article > h1 {
  margin-top: 3.5rem;
  margin-bottom: 1rem;
}

/* Tighten spacing when h2 immediately follows h1 */
h1 + h2 {
  /* 3.25rem total - 1.25rem offset = 2rem visual gap */
  margin-top: 1rem;
}

p { margin: 0 0 1.2rem; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover { color: var(--accent-dim); border-bottom-color: currentColor; }

strong { font-weight: 600; }

blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 3px solid var(--rule);
  color: var(--ink-soft);
  font-style: italic;
}

code, pre {
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9em;
}
code {
  background: #f1eee8;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
pre {
  background: #f1eee8;
  padding: 1rem 1.2rem;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; padding: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

/* --- Site header (home page) --------------------------------------------- */
.site-header { margin-bottom: 1rem; }

.site-header .name {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
}
.site-header .intro {
  color: var(--ink-soft);
  font-size: 1.15rem;
}

/* --- Home hub (category rows) ---------------------------------------------
   The home page is a stable hub: each category is one row linking to its own
   index page. Adding content never touches this file.
   -------------------------------------------------------------------------- */
.hub {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.hub li { border-bottom: 1px solid var(--rule); }

.hub-item {
  display: block;
  padding: 1.6rem 0.25rem;
  color: inherit;
  border-bottom: 0;
}
.hub-item:hover { border-bottom: 0; }
.hub-item:hover .hub-title { color: var(--accent-dim); }
.hub-item:hover .hub-arrow { transform: translateX(4px); }

.hub-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.hub-title {
  font-family: var(--sans);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}
.hub-arrow {
  font-family: var(--sans);
  color: var(--ink-faint);
  transition: transform 0.15s ease;
}
.hub-desc {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0.3rem 0 0;
}

/* --- Content listings -----------------------------------------------------
   The home page is built from <ul class="entries"> lists. To publish
   something new, copy one <li class="entry"> block and edit its contents.
   -------------------------------------------------------------------------- */
.entries {
  list-style: none;
  margin: 0;
  padding: 0;
}
.entry {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
.entry:last-child { border-bottom: 0; }

.entry .entry-title {
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  display: block;
}
.entry .entry-meta {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-faint);
  letter-spacing: 0.01em;
  margin-bottom: 0.35rem;
}
.entry .entry-desc {
  color: var(--ink-soft);
  font-size: 1.02rem;
  margin: 0;
}
/* Citation line for papers, posters, and theses — sits quietly below the summary */
.entry .entry-cite {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin: 0.4rem 0 0;
}

/* Small typed label, e.g. ARTICLE · LIVING DOCUMENT · SOFTWARE */
.tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  vertical-align: 0.12em;
}
.tag.live     { color: #246b4a; }   /* status: living document */
.tag.soft     { color: #2b4a7a; }   /* software             */
.tag.paper    { color: #6a4a8a; }   /* peer-reviewed papers */
.tag.thesis   { color: #8a6a2a; }   /* theses               */
.tag.poster   { color: #1f6f73; }   /* conference posters   */
.tag.essay    { color: #8a3a4a; }   /* essays               */
.tag.tutorial { color: #a05a28; }   /* tutorials            */

/* --- Tag filter bar ------------------------------------------------------- */
/* Injected by JavaScript on work.html as a progressive enhancement: where the
   script does not run, the bar never appears and every entry stays visible.
   Each button carries its form's colour (via --c), so the bar reads as a
   legend; the active button fills with that colour. */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.9rem;
}
.filter-btn {
  --c: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.filter-btn.filter-paper    { --c: #6a4a8a; }
.filter-btn.filter-thesis   { --c: #8a6a2a; }
.filter-btn.filter-poster   { --c: #1f6f73; }
.filter-btn.filter-essay    { --c: #8a3a4a; }
.filter-btn.filter-tutorial { --c: #a05a28; }
.filter-btn.filter-live     { --c: #246b4a; }
.filter-btn:hover  { border-color: var(--c); }
.filter-btn:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.filter-btn[aria-pressed="true"] {
  color: var(--paper);
  background: var(--c);
  border-color: var(--c);
}

/* --- Article / document header (sub-pages) -------------------------------- */
.backlink {
  font-family: var(--sans);
  font-size: 0.85rem;
  display: inline-block;
  margin-bottom: 2.5rem;
}
.backlink::before { content: "←  "; }

.doc-header { margin-bottom: 2.5rem; }
.doc-header .doc-meta {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: 0.5rem;
}

/* --- Citation / version box (living documents) ---------------------------- */
.cite-box {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 1.2rem 1.4rem;
  margin: 2rem 0;
  font-size: 0.95rem;
}
.cite-box h3 {
  margin-top: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.cite-box .cite-text {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: #f7f5f1;
  border-radius: 4px;
  padding: 0.8rem 1rem;
  line-height: 1.6;
}
.version-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.88rem;
}
.version-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.version-list li:last-child { border-bottom: 0; }
.version-list .v-current { color: var(--ink-faint); }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-faint);
}
.site-footer a { color: var(--ink-soft); }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 34rem) {
  body { font-size: 1.05rem; }
  .page { padding: 2.5rem 1.2rem 4rem; }
  h1, .site-header .name { font-size: 1.9rem; }
}

/* --- Dark mode ------------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
  :root {
    --ink:       #e8e6e1;
    --ink-soft:  #b3b0a9;
    --ink-faint: #8a8780;
    --accent:    #7fb8d6;
    --accent-dim:#a0cce2;
    --rule:      #2e2c29;
    --paper:     #16140f; /* keep the warm cast */
    --card:      #1e1c17;
  }
  code, pre { background: #232019; }
  .cite-box .cite-text { background: #232019; }
}




/**
Code
 */

code {
  background: transparent !important;
  border: none;
}

/* Ensure the pre block keeps its original padding */
pre {
  position: relative;
  /* Remove the padding-top: 2.5rem !important; */
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;

  /* Typography */
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  /* Appearance */
  background: var(--paper);
  color: var(--ink-faint);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;

  /* Interaction */
  transition: all 0.15s ease;
  z-index: 10;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}