/* dellarocca.mx — "Cloud to Machine"
   Colours come from the brand files: navy #0F172A, royal #2563EB, sky #38BDF8, signal #3B82F6. */

/* Self-hosted variable fonts (SIL OFL — licences in /assets/fonts) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/inter-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("/assets/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: #ffffff;
  --alt: #f8fafc;
  --card: #ffffff;
  --panel: #f1f5f9;
  --chip: #f1f5f9;
  --text: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --strong: #cbd5e1;
  --line: #94a3b8;
  --accent: #2563eb;
  --inv: #0f172a;
  --inv-fg: #ffffff;
  --inv-accent: #38bdf8;
  --web-border: #1e3a8a;
  --strip: #0f172a;
  --strip-border: #0f172a;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Dark: follows the system unless the visitor picked a theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f172a; --alt: #0b1220; --card: #0f172a; --panel: #0b1220; --chip: #1e293b;
    --text: #f8fafc; --body: #cbd5e1; --muted: #94a3b8; --border: #1e293b; --strong: #334155; --line: #64748b;
    --accent: #38bdf8; --inv: #f8fafc; --inv-fg: #0f172a; --inv-accent: #2563eb; --web-border: #3b82f6;
    --strip: #0b1220; --strip-border: #1e293b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f172a; --alt: #0b1220; --card: #0f172a; --panel: #0b1220; --chip: #1e293b;
  --text: #f8fafc; --body: #cbd5e1; --muted: #94a3b8; --border: #1e293b; --strong: #334155; --line: #64748b;
  --accent: #38bdf8; --inv: #f8fafc; --inv-fg: #0f172a; --inv-accent: #2563eb; --web-border: #3b82f6;
  --strip: #0b1220; --strip-border: #1e293b;
}

/* Logo + theme-icon swaps (light assets by default) */
.on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .on-light { display: none; }
  :root:not([data-theme="light"]) .on-dark { display: inline-block; }
}
:root[data-theme="dark"] .on-light { display: none; }
:root[data-theme="dark"] .on-dark { display: inline-block; }

/* ——— base ——— */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s, color .2s;
}
img, svg { display: block; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; }
:focus-visible { outline: 3px solid #3b82f6; outline-offset: 2px; border-radius: 6px; }
::selection { background: #2563eb; color: #fff; }

.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 32px; }
@media (max-width: 640px) { .wrap { padding-inline: 20px; } }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  padding: 10px 16px; border-radius: 8px; background: var(--inv); color: var(--inv-fg); font-weight: 600;
}
.skip:focus { top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.eyebrow { font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 4vw, 40px); letter-spacing: -0.02em; line-height: 1.1; }
.section-head { display: flex; flex-direction: column; gap: 8px; }
.chip { font-family: var(--font-mono); font-size: 12px; padding: 4px 10px; border-radius: 6px; background: var(--chip); color: var(--body); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 10px;
  font-weight: 600; text-decoration: none; transition: background-color .15s, border-color .15s;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; color: #fff; }
.btn-ghost { border: 1px solid var(--strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--line); color: var(--text); }
.btn-inv { min-height: 44px; padding: 0 18px; background: var(--inv); color: var(--inv-fg); }
.btn-inv:hover { color: var(--inv-fg); opacity: .9; }

/* ——— top bar ——— */
.topbar { border-bottom: 1px solid var(--border); background: var(--bg); }
.topbar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.brand span { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; font-size: 15px; font-weight: 500; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: var(--body); text-decoration: none; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 860px) { .nav-links { display: none; } }

.lang { display: flex; border: 1px solid var(--strong); border-radius: 999px; padding: 3px; }
.lang > * {
  min-width: 44px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--body);
}
.lang [aria-current="true"] { background: var(--inv); color: var(--inv-fg); }
.lang a:hover { color: var(--text); }

.icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid var(--strong); background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--line); }
.icon-btn svg { width: 18px; height: 18px; }

/* ——— hero ——— */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 64px; padding-block: 96px 80px; }
.hero-copy { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(44px, 6vw, 76px); line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance; }
.hero h1 span { color: var(--accent); }
.lede { font-size: 19px; line-height: 1.6; color: var(--body); max-width: 560px; text-wrap: pretty; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.where { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.where svg { width: 16px; height: 16px; flex: none; }

.stack { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.stack-end { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-inline: 4px; }
.stack-end.bottom { justify-content: flex-end; }
.slab { border-radius: 14px; padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; }
.slab small { font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.slab strong { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.slab-4 { background: #38bdf8; color: #0f172a; }
.slab-3 { margin-left: 28px; background: #2563eb; color: #fff; }
.slab-2 { margin-left: 56px; background: #1e3a8a; color: #fff; border: 1px solid var(--web-border); }
.slab-1 { margin-left: 84px; background: var(--inv); color: var(--inv-fg); }
.slab-1 small { color: var(--inv-accent); }
@media (max-width: 520px) { .slab-3 { margin-left: 12px; } .slab-2 { margin-left: 24px; } .slab-1 { margin-left: 36px; } }

/* ——— proof strip ——— */
.strip { background: var(--strip); border-block: 1px solid var(--strip-border); }
.strip .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; padding-block: 40px; }
.strip dd, .strip dt { margin: 0; }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; }
.stat dd { font-family: var(--font-display); font-weight: 700; font-size: 32px; letter-spacing: -0.02em; line-height: 1.15; color: #38bdf8; }
.stat dt { font-size: 15px; line-height: 1.5; color: #cbd5e1; }

/* ——— featured ——— */
.featured { display: flex; flex-direction: column; gap: 32px; padding-block: 96px 48px; }
.feature-card { display: flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; background: var(--card); }
.feature-copy { flex: 1 1 420px; min-width: 0; padding: 40px; display: flex; flex-direction: column; gap: 20px; }
.feature-copy .big { font-size: 20px; line-height: 1.55; font-weight: 500; }
.feature-copy ul:not(.chips) { padding-left: 20px; display: flex; flex-direction: column; gap: 12px; color: var(--body); }
.feature-meta { font-size: 14px; color: var(--muted); }
@media (max-width: 640px) { .feature-copy, .diagram { padding: 24px; } }

.diagram { flex: 1 1 400px; min-width: 0; margin: 0; background: var(--panel); padding: 40px; display: flex; flex-direction: column; gap: 12px; font-family: var(--font-mono); font-size: 13px; line-height: 1.45; }
.d-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; text-align: center; }
.d-box { padding: 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--strong); }
.d-box.hot { background: #2563eb; border-color: #2563eb; color: #fff; }
.d-box.edge { border-color: #2563eb; }
.d-box.dash { border-style: dashed; border-color: var(--line); text-align: center; }
.d-box.inv { background: var(--inv); color: var(--inv-fg); border-color: var(--inv); text-align: center; margin-top: 8px; }
.d-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.d-links i { justify-self: center; width: 2px; height: 18px; background: var(--line); }
.d-db { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.d-tenants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.d-tenants span { padding: 6px 0; border-radius: 8px; background: var(--chip); text-align: center; }
.d-db em { font-style: normal; color: var(--accent); }
.diagram figcaption { margin-top: 6px; font-family: var(--font-body); font-size: 13px; line-height: 1.5; color: var(--muted); text-align: center; }

/* ——— experience ——— */
.experience { display: flex; flex-direction: column; gap: 32px; padding-block: 64px 96px; }
.exp-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--strong);
  background: transparent; color: var(--body); font: 500 14px var(--font-body); cursor: pointer;
}
.filters button:hover { border-color: var(--line); color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--inv); border-color: var(--inv); color: var(--inv-fg); }
.roles { list-style: none; padding: 0; display: flex; flex-direction: column; }
.role { display: flex; flex-wrap: wrap; gap: 24px 48px; padding-block: 32px; border-top: 1px solid var(--border); transition: opacity .2s; }
.role.is-dim { opacity: .28; }
.role-when { flex: 0 1 220px; display: flex; flex-direction: column; gap: 6px; }
.role-when time, .role-when .dates { font-family: var(--font-mono); font-size: 13px; color: var(--body); }
.role-when span { font-size: 13px; color: var(--muted); }
.role-what { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.role-what h3 { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 1.2; }
.role-what .title { font-size: 16px; font-weight: 500; color: var(--accent); }
.role-what ul:not(.chips) { list-style: disc; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--body); }
.role-link { font-size: 14px; font-weight: 500; }

/* ——— skills ——— */
.skills { background: var(--alt); border-block: 1px solid var(--border); }
.skills .wrap { display: flex; flex-direction: column; gap: 40px; padding-block: 96px; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.card h3 { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.card p { font-size: 15px; line-height: 1.6; color: var(--body); }
.cards-row { display: flex; flex-wrap: wrap; gap: 16px; }
.cards-row .card { flex: 1 1 300px; min-width: 0; }
.cards-row .card:first-child { flex-basis: 420px; }

/* ——— contact / footer ——— */
.contact { display: flex; flex-direction: column; gap: 48px; padding-block: 96px 64px; }
.contact-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; }
.contact-top > div:first-child { display: flex; flex-direction: column; gap: 16px; max-width: 620px; }
.contact h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(36px, 5vw, 48px); letter-spacing: -0.02em; line-height: 1.05; text-wrap: balance; }
.contact p { font-size: 18px; color: var(--body); }
.contact-links { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; font-weight: 500; }
.contact-links a { color: var(--text); }
.contact-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 32px; border-top: 1px solid var(--border); }
.contact-bottom img { width: 300px; max-width: 100%; height: auto; margin-left: -18px; }
.contact-bottom small { font-size: 13px; color: var(--muted); }

/* ——— printed CV ——— */
.print-cv { display: none; }

@media print {
  @page { margin: 0.5in 0.6in; }

  :root, :root[data-theme="dark"] { color-scheme: light; }
  html, body { background: #fff !important; color: #0f172a !important; }
  body { font-size: 9.5pt; line-height: 1.36; }
  .web, .skip { display: none !important; }
  .print-cv { display: block; text-wrap: pretty; }
  .print-cv a { color: inherit; text-decoration: none; }

  .pcv-head { display: flex; justify-content: space-between; align-items: center; gap: 14pt; padding-bottom: 8pt; border-bottom: 1.5pt solid #2563eb; break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pcv-id { display: flex; align-items: center; gap: 10pt; }
  .pcv-id img { width: 32pt; height: 32pt; }
  .pcv-id h1 { white-space: nowrap; font-family: var(--font-display); font-weight: 700; font-size: 18pt; line-height: 1.1; letter-spacing: -0.01em; }
  .pcv-id p { margin-top: 2pt; font-size: 9.5pt; font-weight: 500; color: #1d4ed8; }
  .pcv-contact { list-style: none; padding: 0; text-align: right; font-size: 8.5pt; line-height: 1.45; color: #334155; white-space: nowrap; }
  .pcv-contact li:last-child { color: #1d4ed8; }

  .pcv-summary { margin-top: 8pt; }

  .print-cv h2 { margin: 11pt 0 5pt; padding-bottom: 2pt; border-bottom: 0.75pt solid #cbd5e1; font-family: var(--font-mono); font-weight: 500; font-size: 8.5pt; letter-spacing: .12em; text-transform: uppercase; color: #1d4ed8; break-after: avoid; }
  .pcv-skills { margin: 0; display: grid; grid-template-columns: 1.25in minmax(0, 1fr); gap: 1pt 10pt; font-size: 9pt; break-inside: avoid; }
  .pcv-skills dt { font-weight: 600; }
  .pcv-skills dd { margin: 0; }

  .pcv-role { margin-top: 7pt; }
  .pcv-role:first-of-type { margin-top: 0; }
  .pcv-role h3 { display: flex; justify-content: space-between; gap: 10pt; font-family: var(--font-display); font-weight: 600; font-size: 10.5pt; break-after: avoid; }
  .pcv-role h3 small { font-family: var(--font-body); font-weight: 400; font-size: 9.5pt; color: #334155; }
  .pcv-role h3 time { font-family: var(--font-mono); font-weight: 400; font-size: 8.5pt; color: #334155; white-space: nowrap; }
  .pcv-note { margin-top: 0; font-size: 9pt; font-style: italic; color: #475569; break-after: avoid; }
  .pcv-role ul { margin-top: 2pt; padding-left: 12pt; }
  .pcv-role li { margin-top: 1.5pt; break-inside: avoid; }
  .pcv-edu p + p { margin-top: 3pt; }
}
