/* roruizf.com — 2026 redesign
   Concept: an engineer's notebook. Warm paper, ink, and a thermal palette
   borrowed from the carpet plots used to read 8,760-hour simulation results. */

:root {
  --paper: #f3f0e8;
  --paper-2: #ebe7dc;
  --card: #fbfaf6;
  --ink: #15140f;
  --ink-2: #4a473e;
  --ink-3: #7a766a;
  --line: rgba(21, 20, 15, .12);
  --heat: #e4572e;
  --cold: #2b59c3;
  --ok: #2f9e6b;
  --thermal: linear-gradient(90deg, #1d3c8f, #2b7bc3, #44b4a6, #f2c14e, #ec7a2c, #c8302a);

  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 14px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f100d;
    --paper-2: #16170f;
    --card: #191a14;
    --ink: #eeeadf;
    --ink-2: #b9b4a6;
    --ink-3: #85806f;
    --line: rgba(238, 234, 223, .12);
    --heat: #ff7a4d;
    --cold: #6f9bff;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* faint engineering grid */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .35;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  z-index: -1;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
code { font-family: var(--mono); font-size: .86em; padding: .1em .35em; border-radius: 5px; background: var(--paper-2); }
h1, h2, h3 { margin: 0; font-weight: 400; }
em { font-style: italic; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: .01em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--heat); outline-offset: 3px; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font: 500 15px/1 var(--sans);
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--small { padding: 9px 16px; font-size: 14px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--ink); color: var(--paper);
  font: 600 13px/1 var(--mono);
}
.brand__name { font-weight: 600; letter-spacing: -.01em; }
.nav__links { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: block; padding: 8px 14px; border-radius: 999px;
  text-decoration: none; color: var(--ink-2); font-size: 15px;
  transition: color .2s, background .2s;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--ink); background: var(--paper-2); }
@media (max-width: 860px) { .nav__links { display: none; } }
@media (max-width: 420px) { .brand__name { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 9vw, 110px) 0 40px; }
.hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 980px) { .hero__grid { grid-template-columns: 1fr; } }

.status {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 28px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card);
  font-size: 14px; color: var(--ink-2);
}
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(47,158,107,.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(47,158,107,0); } 100% { box-shadow: 0 0 0 0 rgba(47,158,107,0); } }

.hero__title {
  font-family: var(--serif);
  font-size: clamp(40px, 5.2vw, 70px);
  line-height: .98;
  letter-spacing: -.02em;
}
.hero__title em {
  display: block;
  background: var(--thermal);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding-bottom: .08em;
}
.hero__lede { margin: 28px 0 0; max-width: 56ch; color: var(--ink-2); font-size: 18px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }

/* ---------- Carpet plot figure ---------- */
.plot {
  margin: 0;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--card);
  box-shadow: 0 1px 0 var(--line), 0 30px 60px -30px rgba(0,0,0,.25);
}
.plot__head, .plot__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink-3); flex-wrap: wrap; }
.plot__head { margin-bottom: 12px; }
.plot__clock { color: var(--ink); font-variant-numeric: tabular-nums; }
.plot__body { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.plot__yaxis { display: flex; flex-direction: column; justify-content: space-between; color: var(--ink-3); font-size: 10.5px; text-align: right; }
#carpet { width: 100%; height: auto; aspect-ratio: 730 / 240; border-radius: 6px; background: var(--paper-2); cursor: crosshair; image-rendering: pixelated; }
.plot__xaxis { display: flex; justify-content: space-between; margin: 6px 0 12px 38px; color: var(--ink-3); font-size: 10.5px; }
.plot__tip {
  position: absolute; pointer-events: none;
  padding: 6px 9px; border-radius: 8px;
  background: var(--ink); color: var(--paper);
  font-size: 11.5px; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
}
.colorbar { display: inline-flex; align-items: center; gap: 8px; }
.colorbar i { width: 110px; height: 8px; border-radius: 4px; background: var(--thermal); }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: clamp(48px, 7vw, 88px) 0 0;
  border-top: 1px solid var(--line);
}
.stat { padding: 24px 20px 4px 0; display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 8px; }
.stat + .stat { padding-left: 20px; border-left: 1px solid var(--line); }
.stat dt { grid-column: 1 / -1; order: 3; color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.stat dd { margin: 0; font: 400 clamp(48px, 6vw, 72px)/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__unit { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
@media (max-width: 820px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 11vw, 140px) 0; }
.section--alt { background: var(--paper-2); }
.section--ink { background: #12130f; color: #eeeadf; --line: rgba(238,234,223,.13); --ink-2: #b9b4a6; --ink-3: #85806f; --card: #1a1b15; --paper-2: #23241c; }
.section__head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 64px); }
.eyebrow { margin: 0 0 18px; color: var(--heat); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
.section h2, .contact__title {
  font-family: var(--serif);
  font-size: clamp(36px, 4.8vw, 60px);
  line-height: 1.02;
  letter-spacing: -.015em;
}
.section h2 em, .contact__title em { color: var(--ink-3); }
.section__lede { margin: 20px 0 0; color: var(--ink-2); max-width: 60ch; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }
.card {
  position: relative;
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: transform .3s ease, border-color .3s ease;
}
.card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--thermal);
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.card:hover::after { transform: scaleX(1); }
.card__icon { width: 48px; height: 48px; margin-bottom: 22px; color: var(--ink); }
.card h3 { font: 600 21px/1.25 var(--sans); letter-spacing: -.01em; margin-bottom: 10px; }
.card p { margin: 0; color: var(--ink-2); font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 22px 0 0; }
.tags li { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font: 500 12px/1.4 var(--mono); color: var(--ink-2); }

/* ---------- Repos ---------- */
.repos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.repo.repo--feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; align-items: start; }
.repo--feature .repo__top, .repo--feature h3, .repo--feature p, .repo--feature .repo__link { grid-column: 1; }
.repo--feature .repo__code { grid-column: 2; grid-row: 1 / span 4; margin: 0; align-self: center; font-size: 14px; }
@media (max-width: 900px) {
  .repos { grid-template-columns: 1fr; }
  .repo.repo--feature { display: flex; }
  .repo--feature .repo__code { margin-top: 24px; }
}
.repo {
  display: flex; flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  text-decoration: none;
  transition: transform .3s ease, border-color .3s ease, background .3s ease;
}
.repo:hover { transform: translateY(-3px); border-color: rgba(238,234,223,.35); }
.repo__top { display: flex; justify-content: space-between; color: var(--ink-3); margin-bottom: 14px; }
.repo__stars b { color: #f2c14e; font-weight: 500; }
.repo h3 { font: 600 22px/1.2 var(--mono); letter-spacing: -.02em; margin-bottom: 10px; }
.repo--feature h3 { font-size: clamp(24px, 2.6vw, 32px); }
.repo p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.repo code { background: var(--paper-2); }
.repo__code {
  margin: 24px 0 0; padding: 18px 20px;
  border-radius: 10px; background: #0b0c09; color: #d9d4c6;
  font-size: 13px; line-height: 1.7; overflow-x: auto;
  border: 1px solid rgba(238,234,223,.08);
}
.repo__code .c { color: #7a766a; }
.repo__code .k { color: #ec7a2c; }
.repo__link { margin-top: auto; padding-top: 22px; color: var(--ink-3); transition: color .2s; }
.repo:hover .repo__link { color: #eeeadf; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.job { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 32px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 700px) { .job { grid-template-columns: 1fr; gap: 8px; } }
.job__when { color: var(--ink-3); padding-top: 6px; font-size: 13px; }
.job h3 { font: 600 22px/1.3 var(--sans); letter-spacing: -.01em; }
.job h3 span { font-weight: 400; color: var(--ink-3); }
.job ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.job li { position: relative; padding-left: 20px; color: var(--ink-2); }
.job li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 2px; background: var(--heat); }
.edu { margin-top: 40px; padding: 24px 28px; border: 1px dashed var(--line); border-radius: var(--radius); }
.edu .eyebrow { margin-bottom: 8px; }
.edu p:last-child { margin: 0; color: var(--ink-2); }

/* ---------- Publications ---------- */
.pubs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pub {
  display: grid; grid-template-columns: 90px 1fr; gap: 20px; align-items: start;
  padding: 26px 28px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
}
@media (max-width: 600px) { .pub { grid-template-columns: 1fr; gap: 6px; } }
.pub__year { font-size: 14px; color: var(--heat); padding-top: 4px; }
.pub h3 { font: 400 clamp(20px, 2.1vw, 25px)/1.25 var(--serif); }
.pub p { margin: 10px 0 0; color: var(--ink-3); }

/* ---------- Contact ---------- */
.contact { padding: clamp(80px, 12vw, 160px) 0; text-align: left; position: relative; overflow: hidden; }
.contact::before {
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -60%; height: 100%;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--heat) 22%, transparent), transparent 60%);
  z-index: -1;
}
.contact__title { font-size: clamp(44px, 7vw, 96px); line-height: .98; }
.contact__lede { margin: 28px 0 0; max-width: 58ch; color: var(--ink-2); font-size: 18px; }
.contact__mail {
  display: inline-flex; align-items: center; gap: .4em;
  margin-top: 40px;
  font: 400 clamp(28px, 4.6vw, 56px)/1.1 var(--serif);
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 6px;
  word-break: break-all;
  transition: color .2s, border-color .2s;
}
.contact__mail span { transition: transform .25s ease; }
.contact__mail:hover { color: var(--heat); border-color: var(--heat); }
.contact__mail:hover span { transform: translateX(8px); }
.contact__links { display: flex; gap: 22px; list-style: none; padding: 0; margin: 32px 0 0; }
.contact__links a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.contact__links a:hover { color: var(--ink); }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 26px 0; color: var(--ink-3); }
.foot__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}


/* =====================================================================
   Theme — "Blueprint" (chosen 2026-11-20). Overrides the base tokens above.
   ===================================================================== */
/* Variant C — "Blueprint": an engineering drawing on screen.
   Deep blueprint navy, cyan linework, amber highlights, IBM Plex (Sans Condensed / Sans / Mono), crop marks. */
:root, :root:not([data-theme]) {
  --paper: #0b1a2c;
  --paper-2: #0f2238;
  --card: rgba(16, 38, 62, .72);
  --ink: #e3ecf6;
  --ink-2: #a9bdd3;
  --ink-3: #6f8aa8;
  --line: rgba(120, 175, 230, .2);
  --heat: #ffb547;
  --cyan: #62d3ff;
  --ok: #62d3ff;
  --thermal: linear-gradient(90deg, #0d2b55, #1c5fa0, #2fa3cf, #8fe0e6, #ffd58a, #ff9a3c, #e8553a);
  --carpet: "13 43 85, 28 95 160, 47 163 207, 143 224 230, 255 213 138, 255 154 60, 232 85 58";
  --serif: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 0px;
  color-scheme: dark;
}
body { font-size: 16.5px; }
/* blueprint grid: minor 24px, major 120px */
body::before {
  background-image:
    linear-gradient(rgba(120,175,230,.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,175,230,.14) 1px, transparent 1px),
    linear-gradient(rgba(120,175,230,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,175,230,.06) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  opacity: 1;
  mask-image: none;
}

.hero__title, .section h2, .contact__title { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; line-height: 1; text-transform: none; }
.hero__title em, .section h2 em, .contact__title em { font-style: normal; }
.hero__title em { background: none; color: var(--heat); -webkit-background-clip: initial; background-clip: initial; }
.section h2 em, .contact__title em { color: var(--cyan); }
.eyebrow { color: var(--cyan); letter-spacing: .14em; }
.eyebrow::before { content: "[ "; color: var(--ink-3); }
.eyebrow::after { content: " ]"; color: var(--ink-3); }

.btn { border-radius: 0; background: var(--heat); border-color: var(--heat); color: #0b1a2c; font-weight: 600; font-family: var(--mono); font-size: 14px; }
.btn:hover { transform: none; background: #ffc871; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--cyan); color: var(--cyan); background: transparent; }

.nav { background: rgba(11, 26, 44, .82); }
.brand__mark { border-radius: 0; background: transparent; color: var(--cyan); border: 1px solid var(--cyan); }
.brand__name { font-family: var(--mono); font-weight: 500; font-size: 14px; }
.nav__links a { border-radius: 0; font-family: var(--mono); font-size: 13px; }
.nav__links a:hover, .nav__links a.is-active { background: transparent; color: var(--cyan); }

.status { border-radius: 0; background: transparent; font-family: var(--mono); font-size: 12.5px; border-color: var(--line); }
.status__dot { background: var(--cyan); box-shadow: none; }

/* crop marks on boxed elements */
.plot, .card, .repo, .pub, .edu { position: relative; border-radius: 0; box-shadow: none; }
.plot::before, .card::before, .repo::before, .pub::before {
  content: ""; position: absolute; inset: -6px; pointer-events: none;
  background:
    linear-gradient(var(--cyan), var(--cyan)) top left / 12px 1px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) top left / 1px 12px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 12px 1px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) bottom right / 1px 12px no-repeat;
  opacity: .8;
}
.plot { background: rgba(9, 22, 38, .85); }
#carpet { border-radius: 0; }
.colorbar i { border-radius: 0; }
.plot__clock { color: var(--heat); }

.stats { border-top-color: var(--line); }
.stat dd { font-family: var(--serif); font-weight: 600; color: var(--ink); }
.stat__unit { color: var(--cyan); }

.card { background: var(--card); backdrop-filter: blur(2px); }
.card::after { background: var(--heat); height: 2px; }
.card:hover { transform: none; border-color: rgba(98, 211, 255, .5); }
.card__icon { color: var(--cyan); }
.card h3, .job h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: 0; }
.tags li { border-radius: 0; color: var(--cyan); border-color: rgba(98,211,255,.3); }
code { border-radius: 0; background: rgba(98,211,255,.1); color: var(--cyan); }

.section--ink { background: rgba(6, 16, 28, .75); color: var(--ink);
  --line: rgba(120,175,230,.2); --ink-2: #a9bdd3; --ink-3: #6f8aa8; --card: rgba(16,38,62,.72); --paper-2: rgba(98,211,255,.1); }
.repo:hover { transform: none; border-color: rgba(98, 211, 255, .5); }
.repo:hover .repo__link { color: var(--cyan); }
.repo__stars b { color: var(--heat); }
.repo h3 { color: var(--ink); }
.repo__code { border-radius: 0; background: #06101c; border-color: var(--line); }
.repo__code .k { color: var(--heat); }

.job__when { color: var(--heat); }
.job li::before { background: var(--cyan); }
.edu { border-color: rgba(98,211,255,.35); }
.section--alt { background: rgba(6, 16, 28, .45); }
.pub { background: var(--card); }
.pub__year { color: var(--heat); }
.pub h3 { font-family: var(--serif); font-weight: 500; letter-spacing: 0; }

.contact::before { background: radial-gradient(ellipse at center, rgba(98,211,255,.14), transparent 60%); }
.contact__mail { font-family: var(--mono); font-weight: 400; font-size: clamp(22px, 3.6vw, 44px); border-bottom-color: var(--cyan); }
.contact__mail:hover { color: var(--heat); border-color: var(--heat); }
.foot { color: var(--ink-3); }
