/* ===== Henrry Carrasco — personal site ===== */
:root {
  --paper: #faf8f4;
  --paper-2: #f2eee6;
  --ink: #1b1f2a;
  --ink-2: #4a5061;
  --ink-3: #7a8091;
  --line: #e3ddd1;
  --accent: #9b2c2c;      /* rojo peruano sobrio */
  --accent-soft: #f6e9e6;
  --navy: #1f2d4d;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 980px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14161c;
    --paper-2: #1b1e26;
    --ink: #eceae5;
    --ink-2: #b9bcc6;
    --ink-3: #8a8f9c;
    --line: #2c303b;
    --accent: #e08a7c;
    --accent-soft: #2a1f1f;
    --navy: #c9d3ea;
  }
}

*, *::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-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 58px; }
.brand { font-family: var(--serif); font-size: 20px; color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.nav { display: flex; gap: 20px; align-items: center; font-size: 14.5px; }
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover { color: var(--accent); }
.nav .lang { border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; color: var(--ink); }
@media (max-width: 760px) { .nav .sec { display: none; } }

/* ---------- hero ---------- */
.hero { padding: 64px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1fr 200px; gap: 40px; align-items: center; }
.eyebrow { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0 0 14px; }
h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(38px, 6.4vw, 62px); line-height: 1.04;
  margin: 0 0 18px; letter-spacing: -0.015em;
}
.lede { font-size: 19px; color: var(--ink-2); max-width: 36em; margin: 0 0 22px; }
.portrait {
  width: 200px; height: 200px; border-radius: 50%;
  background: var(--navy); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 64px; letter-spacing: .02em;
  overflow: hidden; border: 6px solid var(--paper-2);
  box-shadow: 0 0 0 1px var(--line);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; font-size: 15px; font-weight: 600;
  text-decoration: none; border: 1px solid var(--ink); color: var(--ink);
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn:hover { text-decoration: none; opacity: .88; }
@media (max-width: 760px) {
  .hero { padding: 36px 0 24px; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .portrait { width: 120px; height: 120px; font-size: 40px; order: -1; }
}

/* ---------- facts strip ---------- */
.facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin: 8px 0 0;
}
.fact { padding: 18px 16px 18px 0; }
.fact + .fact { padding-left: 18px; border-left: 1px solid var(--line); }
.fact dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.fact dd { margin: 0; font-weight: 600; font-size: 15.5px; line-height: 1.4; }
@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3) { padding-left: 0; border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- highlights ---------- */
.highlights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 40px 0 8px; }
.hl {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 18px 16px;
}
.hl .num { font-family: var(--serif); font-size: 38px; line-height: 1; color: var(--accent); margin-bottom: 8px; }
.hl p { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
@media (max-width: 760px) { .highlights { grid-template-columns: 1fr 1fr; } }

/* ---------- sections ---------- */
section.block { padding: 48px 0 8px; scroll-margin-top: 70px; }
.block-head { display: grid; grid-template-columns: 200px 1fr; gap: 40px; }
h2 {
  font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.2;
  margin: 0; position: relative;
}
h2::after { content: ""; display: block; width: 32px; height: 2px; background: var(--accent); margin-top: 12px; }
@media (max-width: 760px) {
  section.block { padding-top: 36px; }
  .block-head { grid-template-columns: 1fr; gap: 18px; }
}

.about p { margin: 0 0 14px; color: var(--ink); }
.about p:last-child { margin-bottom: 0; }

.items { list-style: none; margin: 0; padding: 0; }
.item { padding: 0 0 22px; margin: 0 0 22px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; margin-bottom: 0; }
.item-top { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; flex-wrap: wrap; }
h3 { font-size: 17.5px; margin: 0; font-weight: 600; line-height: 1.4; }
.when { font-size: 14px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.org { color: var(--ink-2); font-size: 15.5px; margin: 2px 0 6px; }
.item p { margin: 6px 0 0; color: var(--ink-2); }
.tag {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  margin-left: 6px; vertical-align: 2px;
}

.skills { display: grid; gap: 18px; }
.skills h3 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; font-size: 14.5px; background: var(--paper-2); }

/* ---------- contact / footer ---------- */
.contact-card {
  background: var(--navy); color: var(--paper); border-radius: 14px;
  padding: 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.contact-card p { margin: 0; font-size: 17px; }
.contact-card a { color: var(--paper); font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .contact-card { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); }
  .contact-card a { color: var(--accent); }
}

footer { padding: 48px 0 40px; color: var(--ink-3); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 22px; }

@media print {
  .topbar, .cta, footer { display: none; }
  body { background: #fff; color: #000; font-size: 12pt; }
  section.block { padding-top: 18px; break-inside: avoid; }
}
