:root {
  --paper: #e9edf2;
  --panel: #f6f8fa;
  --ink: #0f1b2d;
  --muted: #4b5a70;
  --rule: #0f1b2d;
  --signal: #f2c200;
  --blue: #1b3fb5;
  --font-head: "Archivo", "Arial Narrow", Arial, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--blue); text-underline-offset: 3px; }

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

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 2px solid var(--rule);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}

.brand {
  font-family: var(--font-head);
  font-stretch: 112%;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}

.nav { display: flex; gap: 0.25rem; }

.nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0.7rem;
  border-bottom: 3px solid transparent;
}

.nav a:hover { border-bottom-color: var(--ink); }

.nav a.active { border-bottom-color: var(--signal); }

.menu-btn {
  display: none;
  font: inherit;
  font-weight: 600;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}

.hero { padding-top: clamp(2.5rem, 7vw, 5.5rem); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.hero-role { margin: 0 0 1rem; color: var(--muted); font-weight: 500; }

.hero h1 {
  margin: 0;
  font-family: var(--font-head);
  font-stretch: 118%;
  font-weight: 900;
  font-size: clamp(2.6rem, 7.2vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-lead {
  max-width: 34rem;
  margin: 1.5rem 0 0;
  font-size: 1.25rem;
  line-height: 1.5;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  padding: 0.7rem 1.3rem;
  border: 2px solid var(--ink);
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn.solid { background: var(--signal); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); }

.btn.solid:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.btn.line { color: var(--ink); background: transparent; }

.btn.line:hover { background: var(--ink); color: var(--paper); }

.hero-figure { margin: 0; border: 2px solid var(--ink); background: var(--panel); }

.hero-figure img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.stripe {
  height: 14px;
  background: repeating-linear-gradient(-45deg, var(--ink) 0 14px, var(--signal) 14px 28px);
  border-block: 2px solid var(--ink);
}

.block { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-bottom: 2px solid var(--rule); }

.block-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.5rem clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

.block h2 {
  margin: 0;
  font-family: var(--font-head);
  font-stretch: 112%;
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1.1;
  position: sticky;
  top: 5rem;
}

.prose { max-width: 42rem; }

.prose p { margin: 0 0 1.1rem; }

.prose p:last-child { margin-bottom: 0; }

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.project {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 2px solid var(--ink);
}

.project img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}

.project-body { padding: 1rem 1.1rem 1.25rem; }

.project h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-head);
  font-stretch: 105%;
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.25;
}

.project p { margin: 0; color: var(--muted); font-size: 0.97rem; line-height: 1.55; }

.skills { margin: 0; }

.skill-row {
  display: grid;
  grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
  gap: 0.5rem 2rem;
  padding: 1rem 0;
  border-top: 2px solid var(--ink);
}

.skill-row:last-child { border-bottom: 2px solid var(--ink); }

.skill-row dt { font-family: var(--font-head); font-stretch: 105%; font-weight: 800; }

.skill-row dd { margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
  background: var(--panel);
  border: 1.5px solid var(--ink);
  padding: 0.1rem 0.65rem;
  font-size: 0.93rem;
}

.certs { list-style: none; margin: 0; padding: 0; }

.cert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 2px solid var(--ink);
}

.cert:last-child { border-bottom: 2px solid var(--ink); }

.cert span { font-weight: 500; }

.cert a {
  flex-shrink: 0;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--ink);
  padding: 0.3rem 0.9rem;
  transition: background 0.15s ease;
}

.cert a:hover { background: var(--signal); }

.contact { list-style: none; margin: 0; padding: 0; }

.contact li {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 2px solid var(--ink);
}

.contact li:last-child { border-bottom: 2px solid var(--ink); }

.contact .label { color: var(--muted); font-weight: 500; }

.contact .value { font-size: 1.15rem; font-weight: 500; overflow-wrap: anywhere; }

.contact a { color: var(--ink); }

.contact a:hover { color: var(--blue); }

.footer { padding: 1.5rem 0 2.5rem; color: var(--muted); font-size: 0.93rem; }

.footer p { margin: 0; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .hero-figure { max-width: 320px; }
  .block-grid { grid-template-columns: 1fr; }
  .block h2 { position: static; }
}

@media (max-width: 720px) {
  .menu-btn { display: block; }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 2px solid var(--rule);
    padding: 0.5rem 1.25rem 1rem;
  }

  .nav.open { display: flex; }

  .nav a { padding: 0.7rem 0; border-bottom: 1px solid rgba(15, 27, 45, 0.2); }

  .skill-row, .contact li { grid-template-columns: 1fr; gap: 0.25rem; }

  .cert { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero h1 { animation: none; }
  .btn { transition: none; }
}
