/* portfolio.maifrino.com — Ricardo Maifrino
   One stylesheet for index.html and work.html. Mobile first. */

:root {
  --bg: #f6f1e8;
  --surface: #fffcf7;
  --ink: #221c16;
  --body: #443a31;
  --muted: #6b5c4e;
  --line: #ddd2c0;
  --line-soft: #ebe2d3;
  --accent: #a83e18;
  --accent-dark: #7d2d10;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Karla', 'Helvetica Neue', Arial, sans-serif;
  --gutter: 20px;
  --maxw: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

/* grid/flex children must be allowed to shrink below their intrinsic width */
.hero > *, .cards > *, .pillars > *, .stats > *, .about > *, .section-head > * { min-width: 0; }

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- type ---------- */

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.1rem, 7vw, 4.2rem); line-height: 1.05; text-wrap: pretty; }
h2 { font-size: clamp(1.7rem, 4.6vw, 2.7rem); line-height: 1.12; }
h3 { font-size: 1.4rem; font-weight: 500; line-height: 1.18; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
em { font-style: italic; font-weight: 500; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--accent);
  margin: 0;
}
.eyebrow-muted { color: var(--muted); }
.lede { font-size: clamp(1.05rem, 2.4vw, 1.25rem); color: var(--body); max-width: 40em; }

/* ---------- header ---------- */

.site-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 20px 0;
}
.brand {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 500;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 1rem; }
.nav a:hover { color: var(--accent); }
.nav .btn { font-size: 0.95rem; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink);
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--line-soft); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff7ee; }
.btn-primary:hover { background: var(--accent-dark); color: #fff7ee; }
.btn-light { border-color: var(--bg); color: var(--bg); }
.btn-light:hover { background: rgba(246,241,232,.14); color: var(--bg); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- hero ---------- */

.hero { display: grid; gap: 28px; padding: 16px 0 44px; }
.hero-text { display: flex; flex-direction: column; gap: 20px; }
.hero-photo {
  width: 100%; max-width: min(430px, 100%); aspect-ratio: 1; object-fit: cover;
  border-radius: 28px; border: 1px solid var(--line); background: #fff;
  justify-self: center;
}

/* ---------- stats ---------- */

.stats {
  display: grid; gap: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 26px 0;
  border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
}
.stat-n { font-family: var(--serif); font-size: clamp(2rem, 6vw, 2.9rem); font-weight: 500; line-height: 1; }
.stat-l { font-size: 0.95rem; color: var(--body); margin-top: 6px; }

/* ---------- sections ---------- */

.section { padding: 52px 0 0; }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }

.about { display: grid; gap: 22px; }
.about-body { display: flex; flex-direction: column; gap: 18px; }
.about-body p { font-size: clamp(1rem, 2.2vw, 1.15rem); color: #2e261f; margin: 0; }
.about-note { font-size: 1rem; color: var(--muted); }

.pillars { display: grid; gap: 18px; }
.pillar {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.pillar p { font-size: 1rem; color: var(--body); }

/* ---------- markets + logos ---------- */

.flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flags li { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 500; }
.flags img { width: 28px; height: 20px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); }

.logos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.logos li {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 15px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  font-weight: 600; font-size: 0.95rem;
}
.logos img { height: 18px; width: auto; }

/* ---------- work cards ---------- */

.cards { display: grid; gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column;
  color: inherit; text-decoration: none;
}
a.card:hover { border-color: var(--accent); }
.card img { width: 100%; height: 180px; object-fit: cover; filter: saturate(.88); }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body p { font-size: 0.97rem; color: var(--body); margin: 0; }
.card h3 { font-size: 1.3rem; }
.card-result {
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 0.95rem; font-weight: 700; color: var(--ink);
}
.card-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted);
}

/* ---------- filters ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.chip {
  min-height: 44px; padding: 0 17px;
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink);
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600;
  cursor: pointer;
}
.chip:hover { background: var(--line-soft); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.count { font-size: 0.95rem; color: var(--body); margin: 0 0 18px; }

/* ---------- cta + footer ---------- */

.cta {
  margin-top: 52px; padding: 32px 24px;
  background: var(--ink); color: var(--bg); border-radius: 22px;
  display: flex; flex-direction: column; gap: 22px;
}
.cta h2 { color: var(--bg); }
.cta p { color: #ddd0bd; margin: 8px 0 0; }

.site-foot {
  display: flex; flex-direction: column; gap: 8px;
  padding: 26px 0 36px; margin-top: 30px;
  font-size: 0.93rem; color: var(--muted);
}
.site-foot a { color: var(--muted); text-decoration: underline; }
.site-foot a:hover { color: var(--accent); }

/* ---------- wider screens ---------- */

@media (min-width: 700px) {
  :root { --gutter: 40px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
  .flags { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta { flex-direction: row; align-items: center; justify-content: space-between; padding: 40px; }
  .cta .actions { flex-shrink: 0; }
  .site-foot { flex-direction: row; justify-content: space-between; align-items: center; }
  .section-head.row { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; }
}

@media (min-width: 980px) {
  :root { --gutter: 56px; }
  body { font-size: 18px; }
  .hero { grid-template-columns: 1.25fr 1fr; align-items: center; gap: 48px; padding: 28px 0 64px; }
  .hero-photo { justify-self: end; }
  .about { grid-template-columns: 1fr 2fr; gap: 40px; }
  .cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section { padding: 68px 0 0; }
}

/* ---------- printing ---------- */

@media print {
  :root { --bg: #fff; --surface: #fff; }
  body { background: #fff; font-size: 10.5pt; }
  .site-head, .filters, .count, .cta, .actions, .hero-photo { display: none !important; }
  .card, .pillar { break-inside: avoid; border-color: #ccc; }
  .card img { height: 120px; }
  a { color: inherit; text-decoration: none; }
  .section { padding-top: 18pt; }
}
