/* Yary Ribero — portfolio. Shared stylesheet for every page. */

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --text: #1d2430;
  --muted: #5b6575;
  --line: #e3e1db;
  --accent: #1f4e79;
  --accent-soft: #e6eef6;
  --chip: #eef0f3;
  --max: 980px;
  --radius: 10px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161c;
    --surface: #1a2029;
    --text: #e6e9ee;
    --muted: #9aa4b2;
    --line: #2a323d;
    --accent: #7fb2e5;
    --accent-soft: #1d2b3a;
    --chip: #232a35;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12161c;
  --surface: #1a2029;
  --text: #e6e9ee;
  --muted: #9aa4b2;
  --line: #2a323d;
  --accent: #7fb2e5;
  --accent-soft: #1d2b3a;
  --chip: #232a35;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--accent); text-underline-offset: 2px; }
img { max-width: 100%; }

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

/* Header and navigation */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px;
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: .2px; }
.brand span { color: var(--muted); font-weight: 500; }
nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
nav a {
  display: block; padding: 6px 10px; border-radius: 6px;
  color: var(--muted); text-decoration: none; font-size: 15px;
}
nav a:hover { color: var(--text); background: var(--chip); }
nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* Page structure */
main { padding: 40px 0 56px; }
.page-title { font-size: clamp(28px, 5vw, 38px); line-height: 1.2; margin: 0 0 8px; }
.lead { font-size: 18px; color: var(--muted); max-width: 720px; margin: 0 0 32px; }
h2 {
  font-size: 22px; margin: 48px 0 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
h3 { font-size: 18px; margin: 0 0 4px; }
p { margin: 0 0 14px; }
ul.bullets { padding-left: 20px; margin: 8px 0 0; }
ul.bullets li { margin-bottom: 6px; }

/* Hero (home page) */
.hero {
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
}
.hero h1 { font-size: clamp(34px, 6vw, 48px); line-height: 1.1; margin: 0 0 6px; }
.hero .role { font-size: 20px; font-weight: 600; color: var(--accent); margin: 0 0 16px; }
.hero .photo {
  width: 180px; height: 180px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--surface); box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.contact { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 15px; }
.contact a { color: var(--muted); }
.contact a:hover { color: var(--accent); }

/* Cards and grids */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
a.card { display: block; color: inherit; text-decoration: none; transition: border-color .15s; }
a.card:hover { border-color: var(--accent); }
a.card .more { color: var(--accent); font-weight: 600; font-size: 15px; }

.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .num { font-size: 26px; font-weight: 700; color: var(--accent); line-height: 1.2; }
.stat .label { color: var(--muted); font-size: 14px; }

.meta { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { background: var(--chip); color: var(--muted); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.badge {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  border-radius: 6px; padding: 1px 8px; font-size: 13px; font-weight: 600; margin-left: 6px;
  vertical-align: middle;
}

/* Timeline (experience page) */
.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline > li { position: relative; padding: 0 0 28px 28px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--accent);
}
.timeline .when { color: var(--muted); font-size: 14px; font-weight: 600; }
.timeline .org { color: var(--muted); }

/* Case studies */
.case { margin-bottom: 20px; }
.case dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 16px; margin: 12px 0 0; }
.case dt { color: var(--muted); font-size: 14px; font-weight: 600; }
.case dd { margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
tr:last-child td { border-bottom: 0; }

blockquote {
  margin: 0; padding: 16px 20px; background: var(--accent-soft); border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0; font-size: 18px;
}
blockquote cite { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); font-style: normal; }

.cta { margin-top: 40px; }
.button {
  display: inline-block; background: var(--accent); color: var(--surface); text-decoration: none;
  padding: 10px 18px; border-radius: 8px; font-weight: 600;
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.site-footer a { color: var(--muted); }

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero .photo { width: 130px; height: 130px; order: -1; }
  .case dl { grid-template-columns: 1fr; gap: 2px; }
  .case dd { margin-bottom: 8px; }
  main { padding-top: 28px; }
}

@media print {
  .site-header { position: static; }
  nav { display: none; }
  body { background: #fff; }
  .card, .stat, table { break-inside: avoid; }
}

/* Two-column grid for sets of four cards (avoids a lone card on the last row) */
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .grid.two { grid-template-columns: 1fr; } }
