:root {
  --navy: #1f3864;
  --navy-soft: #2c4f8a;
  --orange: #d97b29;
  --ink: #212529;
  --muted: #6c757d;
  --paper: #ffffff;
  --bg: #f6f7f9;
  --line: #e3e7ee;
  --red: #c0392b;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
a { color: var(--navy-soft); }
a:hover { color: var(--orange); }

/* nav */
nav {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
nav .brand { font-weight: 700; color: var(--navy); text-decoration: none; font-size: 15px; }
nav .links a { margin-left: 18px; text-decoration: none; font-size: 14px; color: var(--muted); }
nav .links a:hover { color: var(--orange); }

/* hero */
header.hero { background: var(--paper); border-bottom: 1px solid var(--line); }
header.hero .wrap { display: flex; gap: 40px; align-items: center; padding-top: 64px; padding-bottom: 64px; flex-wrap: wrap; }
.avatar {
  width: 160px; height: 160px; border-radius: 50%;
  overflow: hidden; flex: 0 0 auto;
  border: 4px solid var(--paper);
  box-shadow: 0 8px 30px rgba(31, 56, 100, 0.25);
  background: var(--bg);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
h1 { font-size: 34px; margin: 0 0 6px; color: var(--navy); line-height: 1.2; }
.role { font-size: 17px; font-weight: 600; color: var(--orange); margin-bottom: 14px; }
.chips { margin: 18px 0 8px; }
.chip {
  display: inline-block; background: var(--bg); border: 1px solid var(--line);
  border-radius: 20px; padding: 4px 14px; margin: 4px 8px 4px 0; font-size: 13px; color: var(--muted);
}
.cta {
  display: inline-block; background: var(--navy); color: #fff !important;
  padding: 11px 26px; border-radius: 8px; text-decoration: none; font-weight: 600; margin-top: 14px;
}
.cta:hover { background: var(--orange); }

/* sections */
section { padding: 56px 0; }
section.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { color: var(--navy); font-size: 26px; margin: 0 0 22px; }
.lead { font-size: 17px; color: #343a40; max-width: 820px; }
ul.services { padding-left: 0; list-style: none; display: grid; gap: 14px; max-width: 820px; }
ul.services li { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; }
ul.services li strong { color: var(--navy); }

/* portfolio */
.grid { display: grid; grid-template-columns: repeat(2, minmax(300px, 1fr)); gap: 22px; }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px; display: flex; flex-direction: column; transition: box-shadow .2s;
}
.card:hover { box-shadow: 0 10px 30px rgba(31, 56, 100, 0.12); }
.card h3 { margin: 0 0 4px; font-size: 17px; color: var(--navy); }
.card p { flex: 1; font-size: 14.5px; color: #495057; margin: 8px 0 14px; }
.badge {
  align-self: flex-start; background: #fdf1e7; color: var(--red);
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 6px; padding: 4px 10px;
}
.tags { margin: 0 0 14px; }
.tag { display: inline-block; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px; font-size: 12px; margin: 0 6px 6px 0; color: var(--muted); }
.links a {
  display: inline-block; text-decoration: none; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--navy); color: var(--navy); border-radius: 7px; padding: 6px 13px; margin: 0 8px 8px 0;
}
.links a:hover { background: var(--navy); color: #fff; }
.links a.dl { border-color: var(--muted); color: var(--muted); }
.links a.dl:hover { background: var(--muted); color: #fff; }

/* two-col info */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 30px; }
.infobox { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 22px 26px; }
.infobox h3 { margin: 0 0 12px; color: var(--navy); font-size: 16px; }
.infobox p { margin: 4px 0; font-size: 14.5px; }
.email-link { font-size: 16px; font-weight: 700; }

/* articles (piece pages) */
article { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 44px 52px; max-width: 880px; margin: 48px auto; }
article h1 { font-size: 27px; }
article h2 { font-size: 20px; margin: 30px 0 10px; }
article h3 { font-size: 16.5px; color: var(--navy); margin: 22px 0 8px; }
article .demo {
  background: #fdf1e7; border-left: 4px solid var(--red); color: var(--red);
  font-weight: 700; font-size: 13px; padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 14px 0;
}
article table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 14px 0; }
article th, article td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
article th { background: var(--bg); color: var(--navy); }
article blockquote {
  border-left: 3px solid var(--orange); margin: 12px 0; padding: 6px 18px;
  color: #343a40; background: var(--bg); border-radius: 0 8px 8px 0;
}
article .back { font-size: 14px; }

footer { padding: 34px 0 46px; color: var(--muted); font-size: 13px; text-align: center; }
@media (max-width: 720px) {
  header.hero .wrap { padding-top: 40px; padding-bottom: 40px; }
  article { padding: 26px 20px; margin: 20px 10px; }
}
@media print {
  nav, .cta, .links { display: none; }
  body { background: #fff; }
  article { border: none; padding: 0; margin: 0; }
}
