/* ============================================================================
   rodrigo-carfon.github.io — shared design system  ·  "instrument panel"
   Modular tiles on a cool neutral ground. Blue accent, teal as data-positive.
   Inter for text, Geist Mono for data and labels. Light + dark via tokens.
   Plain CSS: no front matter, so Jekyll copies it verbatim.
   ========================================================================= */

:root {
  --bg:      #e7eaef;
  --tile:    #ffffff;
  --tile-2:  #f4f6f9;
  --ink:     #171b24;
  --ink-2:   #4b5462;
  --ink-3:   #79818f;
  --line:    #dde1e8;
  --line-2:  #eaedf1;

  --blue:    #2f6bed;
  --blue-d:  #1f52c9;
  --blue-l:  #e7eefe;
  --teal:    #0f9d8f;
  --teal-l:  #dcf3f0;
  --amber:   #e08a1e;

  /* chart series — one colour, one meaning */
  --chart-coffee: #e0722e;
  --chart-cotton: #2f6bed;
  --chart-answer: #0f9d8f;
  --chart-label:  #79818f;
  --chart-grid:   #dde1e8;
  --chart-card:   #ffffff;

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --container: 1040px;
  --radius: 14px;
  --radius-sm: 10px;
  --gap: 16px;
  --section-gap: 2.5rem;
  --shadow: 0 1px 2px rgba(23, 27, 36, .04), 0 4px 16px rgba(23, 27, 36, .04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #14171d;
    --tile:   #1c2029;
    --tile-2: #232833;
    --ink:    #eef1f6;
    --ink-2:  #b3bccb;
    --ink-3:  #7c8698;
    --line:   #2a2f3a;
    --line-2: #232833;

    --blue:   #6d99ff;
    --blue-d: #5b8cff;
    --blue-l: #1a2540;
    --teal:   #33c0af;
    --teal-l: #113230;
    --amber:  #e8a54a;

    --chart-coffee: #ef8a4c;
    --chart-cotton: #6d99ff;
    --chart-answer: #33c0af;
    --chart-label:  #9aa3b2;
    --chart-grid:   #2a2f3a;
    --chart-card:   #f6f8fb; /* charts keep a light island for legibility */
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.28);
  }
}
:root[data-theme="light"] {
  --bg:#e7eaef; --tile:#ffffff; --tile-2:#f4f6f9; --ink:#171b24; --ink-2:#4b5462;
  --ink-3:#79818f; --line:#dde1e8; --line-2:#eaedf1;
  --blue:#2f6bed; --blue-d:#1f52c9; --blue-l:#e7eefe; --teal:#0f9d8f; --teal-l:#dcf3f0; --amber:#e08a1e;
  --chart-coffee:#e0722e; --chart-cotton:#2f6bed; --chart-answer:#0f9d8f;
  --chart-label:#79818f; --chart-grid:#dde1e8; --chart-card:#ffffff;
  --shadow: 0 1px 2px rgba(23,27,36,.04), 0 4px 16px rgba(23,27,36,.04);
}
:root[data-theme="dark"] {
  --bg:#14171d; --tile:#1c2029; --tile-2:#232833; --ink:#eef1f6; --ink-2:#b3bccb;
  --ink-3:#7c8698; --line:#2a2f3a; --line-2:#232833;
  --blue:#6d99ff; --blue-d:#5b8cff; --blue-l:#1a2540; --teal:#33c0af; --teal-l:#113230; --amber:#e8a54a;
  --chart-coffee:#ef8a4c; --chart-cotton:#6d99ff; --chart-answer:#33c0af;
  --chart-label:#9aa3b2; --chart-grid:#2a2f3a; --chart-card:#f6f8fb;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.28);
}

/* ── Reset & base ───────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--blue); }
img, svg { max-width: 100%; }
img { height: auto; display: block; }
.tabular, .num, table { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

/* ── Layout ─────────────────────────────────────────────────────────────── */

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 2.75rem 0 3.25rem; }

/* ── Nav ────────────────────────────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--container); margin: 0 auto; padding: .7rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav-logo { font-family: var(--mono); font-size: 13px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.nav-logo span { color: var(--blue); }
.nav-logo:hover { color: var(--ink); }
.nav-links { display: flex; gap: 1.4rem; list-style: none; align-items: center; }
.nav-links a { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); text-decoration: none; transition: color .18s; }
.nav-links a:hover { color: var(--blue); }
.nav-cta {
  color: #fff !important; background: var(--blue);
  padding: 7px 14px; border-radius: 8px; transition: background .18s;
}
.nav-cta:hover { background: var(--blue-d); }

/* ── Bento grid ─────────────────────────────────────────────────────────── */

.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.row-2  { grid-row: span 2; }

/* ── Tile ───────────────────────────────────────────────────────────────── */

.tile {
  background: var(--tile); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem 1.6rem; box-shadow: var(--shadow);
}
.tile-pad-lg { padding: 2rem 2.1rem; }
.tile.link { text-decoration: none; color: inherit; display: block; transition: border-color .18s, transform .18s; }
.tile.link:hover { border-color: var(--blue); transform: translateY(-2px); }
.tile.accent { background: linear-gradient(155deg, #1b2a52, var(--blue)); color: #fff; border: none; }

/* ── Type ───────────────────────────────────────────────────────────────── */

.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--blue); font-weight: 500;
}
h1 { font-size: clamp(1.85rem, 4vw, 2.45rem); font-weight: 700; line-height: 1.12; letter-spacing: -.025em; text-wrap: balance; }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.65rem); font-weight: 650; line-height: 1.22; letter-spacing: -.02em; }
h3 { font-size: 15px; font-weight: 600; color: var(--ink); }
p  { color: var(--ink-2); }
.lead { font-size: 15.5px; color: var(--ink-2); line-height: 1.65; }
.note { font-size: 13px; color: var(--ink-3); }
.h-accent { color: var(--blue); }
.hero-sub {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-3);
  letter-spacing: .02em; margin-top: .7rem;
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
}
.hero-sub::before { content: ''; width: 22px; height: 2px; background: var(--blue); border-radius: 2px; }

/* ── Stat tile ──────────────────────────────────────────────────────────── */

.stat { display: flex; flex-direction: column; justify-content: center; }
.stat .n { font-size: 1.8rem; font-weight: 750; letter-spacing: -.02em; line-height: 1; color: var(--ink); }
.stat .n.blue { color: var(--blue); }
.stat .n.teal { color: var(--teal); }
.stat .l { font-size: 12.5px; color: var(--ink-3); margin-top: .55rem; line-height: 1.4; }

/* ── Live / status tile ─────────────────────────────────────────────────── */

.pill {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; font-weight: 500;
  background: rgba(255,255,255,.16); color: #fff; padding: 3px 9px; border-radius: 999px;
}
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: #57e39a; }

/* ── Chips ──────────────────────────────────────────────────────────────── */

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  background: var(--tile-2); border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 6px; white-space: nowrap;
}
.chip.on { background: var(--blue-l); border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); color: var(--blue-d); }

/* ── Stack (layers) ─────────────────────────────────────────────────────── */

.layer { display: grid; grid-template-columns: 120px 1fr; gap: 1.1rem; padding: 1.1rem 0; border-top: 1px solid var(--line-2); align-items: start; }
.layer:first-child { border-top: none; padding-top: .3rem; }
.layer-key { font-family: var(--mono); font-size: 12px; color: var(--blue); text-transform: lowercase; padding-top: 3px; }
.layer-note { font-size: 14px; color: var(--ink-3); margin-top: .6rem; line-height: 1.6; }

/* ── Work tiles ─────────────────────────────────────────────────────────── */

.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 900px) { .work-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .work-grid { grid-template-columns: 1fr; } }
.work-thumb {
  border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line);
  background: var(--tile-2); margin-bottom: 1rem; aspect-ratio: 2 / 1;
}
.work-thumb img, .work-thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-bottom: .5rem; letter-spacing: .02em; }
.work-title { font-size: 16.5px; font-weight: 650; letter-spacing: -.01em; margin-bottom: .5rem; }
.tile.link:hover .work-title { color: var(--blue); }
.work-desc { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin-bottom: .9rem; }
.work-go { font-family: var(--mono); font-size: 12px; color: var(--blue); margin-top: .4rem; display: inline-block; }

/* ── Experience rows ────────────────────────────────────────────────────── */

.xp { display: grid; grid-template-columns: 168px 1fr; gap: 1.4rem; padding: 1.4rem 0; border-top: 1px solid var(--line-2); }
.xp:first-child { border-top: none; padding-top: .3rem; }
.xp-when { font-family: var(--mono); font-size: 12px; color: var(--ink-3); padding-top: 3px; }
.xp-role { font-size: 15px; font-weight: 600; color: var(--ink); }
.xp-role .org { color: var(--ink-3); font-weight: 400; }
.xp-desc { font-size: 14px; color: var(--ink-2); margin-top: .5rem; line-height: 1.65; }

/* ── Pipeline diagram ───────────────────────────────────────────────────── */

.pipeline { display: flex; align-items: center; margin: 1.5rem 0; overflow-x: auto; padding-bottom: .4rem; }
.pipe-step { flex-shrink: 0; background: var(--tile-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem 1rem; text-align: center; min-width: 104px; }
.pipe-step .ps-name { font-size: 13px; font-weight: 600; color: var(--ink); display: block; }
.pipe-step .ps-tech { font-family: var(--mono); font-size: 10px; color: var(--ink-3); display: block; margin-top: 2px; }
.pipe-step.on { background: var(--blue-l); border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); }
.pipe-step.on .ps-name { color: var(--blue-d); }
.pipe-arrow { flex-shrink: 0; color: var(--ink-3); font-size: 15px; padding: 0 .45rem; }

/* ── Code block ─────────────────────────────────────────────────────────── */

.code-block { background: #12151c; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.1rem 1.3rem; margin: 1.3rem 0; overflow-x: auto; }
.code-block .cb-bar { display: flex; align-items: center; gap: 6px; margin-bottom: .85rem; padding-bottom: .65rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.cb-dot { width: 10px; height: 10px; border-radius: 50%; }
.cb-dot.r{background:#f2665a}.cb-dot.y{background:#f4bd4f}.cb-dot.g{background:#5ac26a}
.cb-filename { font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,.4); margin-left: 6px; }
.code-block pre { font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: #dfe4ec; white-space: pre; margin: 0; }
.kw{color:#c79bff}.fn{color:#7fb2ff}.st{color:#8fd694}.cm{color:#8b95a7;font-style:italic}.nm{color:#f0a06a}.op{color:#7fd0e0}
.inline-code { font-family: var(--mono); font-size: 12.5px; background: var(--tile-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }

/* ── Callout ────────────────────────────────────────────────────────────── */

.callout { background: var(--teal-l); border: 1px solid color-mix(in srgb, var(--teal) 30%, var(--line)); border-radius: var(--radius-sm); padding: .95rem 1.15rem; margin: 1.3rem 0; }
.callout p { color: color-mix(in srgb, var(--teal) 55%, var(--ink)); margin: 0; font-size: 13.5px; }

/* ── Tables ─────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; width: 100%; }
th, td { border-bottom: 1px solid var(--line-2); padding: 7px 12px; text-align: right; }
th { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .04em; color: var(--ink-3); text-transform: uppercase; background: var(--tile-2); }
tbody tr:last-child td { border-bottom: none; }

/* ── Contact ────────────────────────────────────────────────────────────── */

.contact-links { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: .5rem; }
.contact-links a { font-family: var(--mono); font-size: 13px; color: var(--ink-2); text-decoration: none; transition: color .18s; }
.contact-links a:hover { color: var(--blue); }
.contact-links a::before { content: '→ '; color: var(--blue); }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--line); margin-top: 1.5rem; }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 1.6rem 1.25rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer p { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin: 0; }
.footer a { color: var(--blue); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ── Utilities ──────────────────────────────────────────────────────────── */

.mt-sm{margin-top:1rem}.mt-md{margin-top:1.5rem}.mt-lg{margin-top:2.2rem}
.text-mono{font-family:var(--mono)}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 880px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .span-3, .span-4 { grid-column: span 2; }
  .xp { grid-template-columns: 1fr; gap: .4rem; }
  .xp-when { padding-top: 0; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
  .span-1, .span-2, .span-3, .span-4 { grid-column: span 1; }
  .layer { grid-template-columns: 1fr; gap: .4rem; }
  .pipeline { flex-direction: column; align-items: stretch; }
  .pipe-step { min-width: 0; }
  .pipe-arrow { transform: rotate(90deg); padding: .3rem 0; }
  .nav-links { gap: .9rem; }
  .footer-inner { flex-direction: column; gap: .5rem; }
}
