/* kevin-valerio.github.io: scientific paper-white, book-cloth clay accent.
   Plain CSS, no build step. Type: STIX Two Text (journal serif) + IBM Plex Mono. */

:root {
  --bg: #fdfcfa;          /* paper white, faintly warm */
  --bg-soft: #f4f2ec;     /* ivory wash */
  --card: #ffffff;
  --ink: #141413;         /* near-black, warm */
  --muted: #63605a;
  --faint: #8f8b83;
  --rule: #e5e2d9;
  --rule-soft: #efece4;
  --accent: #b4552d;      /* book-cloth clay */
  --accent-dark: #8e3e1d;
  --accent-soft: #f6ece3; /* clay wash */
  --serif: "STIX Two Text", "Times New Roman", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 44rem;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #161514;          /* warm coal */
  --bg-soft: #211f1d;
  --card: #1d1b1a;
  --ink: #e9e6e0;
  --muted: #a7a29a;
  --faint: #807b73;
  --rule: #34312c;
  --rule-soft: #292724;
  --accent: #d68052;      /* clay, lifted for dark bg */
  --accent-dark: #e29a74;
  --accent-soft: #362317;
  color-scheme: dark;
}

[data-theme="dark"] a { text-decoration-color: rgba(214, 128, 82, 0.4); }
[data-theme="dark"] .nav { background: rgba(22, 21, 20, 0.92); }
[data-theme="dark"] .role { color: #c8c4bc; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  zoom: 1.1; /* whole-site 110%, like browser ctrl+zoom */
  line-height: 1.62;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-soft); }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(180, 85, 45, 0.32);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.12s, text-decoration-color 0.12s, background 0.12s;
}
a:hover { color: var(--accent-dark); text-decoration-color: var(--accent-dark); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
}

h1, h2, h3 { font-weight: 600; line-height: 1.22; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(253, 252, 250, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 58rem;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 11px clamp(20px, 5vw, 48px);
}
.nav ul {
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav ul::-webkit-scrollbar { display: none; }
.nav ul a {
  display: block;
  padding: 4px 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.nav ul a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 6px; }
.nav ul a.active {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
}
.theme-btn {
  margin-left: auto;
  background: none;
  border: none;
  padding: 4px 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  color: var(--muted);
  cursor: pointer;
}
.theme-btn::before { content: "["; color: var(--faint); margin-right: 2px; }
.theme-btn::after { content: "]"; color: var(--faint); margin-left: 2px; }
.theme-btn:hover { color: var(--accent); }
.theme-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* ---------- shared width ---------- */

.hero, main, footer {
  max-width: 58rem;
  margin: 0 auto;
  padding-left: clamp(20px, 5vw, 48px);
  padding-right: clamp(20px, 5vw, 48px);
}

/* ---------- hero (paper title block) ---------- */

.hero {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding-top: 56px;
  padding-bottom: 8px;
}
.avatar {
  flex-shrink: 0;
  width: 116px;
  height: 116px;
  border-radius: 2px;
  object-fit: cover;
  object-position: center;
}
.hero-text { max-width: var(--measure); }
.hero h1 {
  margin: 2px 0 4px;
  font-size: clamp(2rem, 5vw, 2.6rem);
  letter-spacing: -0.01em;
}
.role { margin: 0 0 16px; font-size: 1.05rem; font-style: italic; color: #3f3d38; }
.contact { margin: 0; font-family: var(--mono); font-size: 0.8rem; }
.contact a + a, footer a + a { margin-left: 14px; }

/* ---------- sections ---------- */

main section {
  padding: 30px 0;
  border-top: 1px solid var(--rule-soft);
  scroll-margin-top: 60px;
}
main section:first-of-type { border-top: none; }

.sec-h {
  margin: 0 0 16px;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
}
.sec-h::before {
  content: "\00A7";
  color: var(--accent);
  font-weight: 400;
  margin-right: 9px;
}
.sub-h {
  margin: 26px 0 12px;
  font-size: 1.02rem;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
}
.sub-h:first-of-type { margin-top: 6px; }

section > p { max-width: var(--measure); margin: 0 0 14px; }

/* ---------- intro (abstract-style block) ---------- */

.intro-box {
  max-width: var(--measure);
  border-left: 3px solid var(--accent);
  background: var(--bg-soft);
  padding: 15px 21px;
  border-radius: 0;
}
.intro-box p { margin: 0 0 10px; font-size: 0.94rem; }
.intro-box p:last-child { margin-bottom: 0; }

/* ---------- cv (experience / education) ---------- */

.cv { margin: 0; padding: 0; list-style: none; }
.cv > li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.cv > li:last-child { border-bottom: none; }
.cv-when {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}
.cv-body h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.cv-sub { margin: 3px 0 0; font-size: 0.9rem; color: var(--muted); }
.cv-body ul { margin: 6px 0 0; padding: 0; list-style: none; }
.cv-body ul li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 5px;
  font-size: 0.9rem;
}
.cv-body ul li::before {
  content: "\25B8";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8em;
  top: 0.15em;
}
.edu-list > li { padding: 11px 0; }
.edu-list h3 { font-weight: 400; font-size: 0.96rem; }

/* ---------- tooling ---------- */

.proj { margin: 0; padding: 0; list-style: none; }
.proj > li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 20px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.proj > li:last-child { border-bottom: none; }
.proj-name {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--ink);
  padding-top: 4px;
  white-space: nowrap;
}
.proj p { margin: 0; font-size: 0.93rem; line-height: 1.55; }

/* ---------- resource links (bracketed, arXiv-style) ---------- */

.links { margin-top: 10px !important; font-size: 0.9em; }
.links a {
  text-decoration: none;
  color: var(--accent);
  padding: 1px 2px;
  font-weight: 600;
}
.links a::before { content: "["; color: var(--faint); margin-right: 2px; font-weight: 400; }
.links a::after { content: "]"; color: var(--faint); margin-left: 2px; font-weight: 400; }
.links a:hover { color: var(--accent-dark); background: var(--accent-soft); border-radius: 2px; }

/* ---------- entries (talks / writing / findings) ---------- */

.entries { margin: 0; padding: 0; list-style: none; max-width: var(--measure); }
.entries > li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.entries > li:last-child { border-bottom: none; }
.e-year {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 4px;
  white-space: nowrap;
}
.e-meta { font-size: 0.88rem; color: var(--muted); }

/* compact entries: one line per item (talks / writing / findings) */
.entries.compact > li { padding: 7px 0; }
.e-line { margin: 0; font-size: 0.96rem; }

/* findings: year column holds repo tags, tint them clay */
#findings .e-year { color: var(--accent); font-weight: 600; }
#findings .e-year a { color: var(--accent); text-decoration: none; }
#findings .e-year a:hover { color: var(--accent-dark); text-decoration: underline; text-decoration-color: var(--accent-dark); }

/* ---------- bounty table ---------- */

.bounties {
  border-collapse: collapse;
  width: 100%;
  max-width: var(--measure);
  font-size: 0.96rem;
  margin: 0 0 4px;
}
.bounties th {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: left;
  padding: 0 34px 6px 0;
  border-bottom: 1px solid var(--rule);
}
.bounties td {
  padding: 7px 34px 7px 0;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--muted);
}
.bounties td:first-child { color: var(--ink); }
.bounties td:last-child { color: var(--ink); }
.bounties tr:last-child td { border-bottom: none; }

/* ---------- footer ---------- */

footer {
  margin-top: 8px;
  padding-top: 22px;
  padding-bottom: 44px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}
footer p { margin: 0 0 6px; }

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  body { font-size: 17px; }
  .hero { flex-direction: column; gap: 16px; padding-top: 34px; }
  .avatar { width: 92px; height: 92px; }
  .cv > li, .entries > li, .proj > li { grid-template-columns: 1fr; gap: 4px; }
  .cv-when, .e-year, .proj-name { padding-top: 0; }
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a { transition: none; }
}

/* ---------- print ---------- */

@media print {
  [data-theme="dark"] {
    --bg: #fff; --bg-soft: #fff; --card: #fff; --ink: #000; --muted: #333;
    --faint: #555; --rule: #ccc; --rule-soft: #ddd; --accent: #000;
    --accent-dark: #000; --accent-soft: #fff;
  }
  .nav { display: none; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .hero { padding-top: 0; }
  a { color: #000; text-decoration: none; }
  .proj li, .cv > li, .entries > li { break-inside: avoid; }
  main section { padding: 12px 0; border-top: 1px solid #ccc; }
}
