:root {
  --ink: #1a1a1d;
  --accent: #c3073f;
  --accent-dark: #9c0532;
  --text: #495057;
  --muted: #6c757d;
  --line: #dee2e6;
  --chip: #f1f3f5;
  --side-w: 17rem;
  --bar-h: 3.5rem;
  --content-w: 46rem;
  --prose-w: 40rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--bar-h);
}

body {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: #fff;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: 'Saira Extra Condensed', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink);
}

h1 {
  font-size: clamp(3.25rem, 12vw, 6rem);
  line-height: 0.92;
}

h2 {
  margin-bottom: 2rem;
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  line-height: 1;
}

h3 {
  font-size: 1.75rem;
  line-height: 1.1;
}

p {
  margin: 0 0 1rem;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

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

.accent {
  color: var(--accent);
  font-weight: 700;
}

.subheading {
  margin: 0;
  font-family: 'Saira Extra Condensed', sans-serif;
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.3;
  color: var(--muted);
}

.lead {
  max-width: var(--prose-w);
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

.skip-link {
  position: absolute;
  top: -10rem;
  left: 0.5rem;
  z-index: 20;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
}

.skip-link:focus {
  top: 0.5rem;
  color: #fff;
}

/* Sidebar: a sticky top bar on small screens, a fixed left column on large ones */

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  height: var(--bar-h);
  background: var(--ink);
}

.sidebar :focus-visible {
  outline-color: #fff;
}

.sidebar-id {
  text-decoration: none;
}

.sidebar-id img {
  display: block;
  border: 0.4rem solid var(--accent);
  border-radius: 50%;
}

/* The top bar is nav only; the hero carries the photo and name on small screens */
.sidebar-id,
.sidebar-social {
  display: none;
}

.sidebar nav {
  flex: 1;
  min-width: 0;
  height: 100%;
}

/* The right-edge fade signals that the link row scrolls sideways */
.sidebar nav ul {
  display: flex;
  height: 100%;
  padding: 0 2rem 0 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
}

.sidebar nav ul::-webkit-scrollbar {
  display: none;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: #adb5bd;
  border-bottom: 3px solid transparent;
}

.sidebar nav a:hover {
  color: #fff;
}

.sidebar nav a.active {
  color: #fff;
  border-bottom-color: var(--accent);
}

/* Sections */

main > section {
  padding: 3rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

main > section > *,
.site-footer > * {
  max-width: var(--content-w);
  margin-left: auto;
  margin-right: auto;
}

.hero-photo {
  display: block;
  width: 6rem;
  height: 6rem;
  margin-bottom: 1.5rem;
  border: 4px solid var(--accent);
  border-radius: 50%;
}

.role {
  margin: 0.75rem auto 0.75rem;
  font-family: 'Saira Extra Condensed', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
}

.role span {
  font-weight: 500;
  color: var(--muted);
}

.status {
  width: fit-content;
  margin-left: 0;
  margin-bottom: 1.75rem;
  padding: 0.2rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
}

/* Blocks narrower than the content column stay on its left edge */
.hero > .hero-photo,
.hero > .lead,
.hero > .status,
.contact > .lead {
  margin-left: max(0px, calc((100% - var(--content-w)) / 2));
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 1.25rem 1rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.stats li {
  padding-left: 1rem;
  font-size: 0.9rem;
  line-height: 1.4;
  border-left: 3px solid var(--accent);
}

.stats strong {
  display: block;
  font-family: 'Saira Extra Condensed', sans-serif;
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 6px;
}

.links a:hover {
  color: #fff;
  background: var(--ink);
}

.links a.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.links a.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.links svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

/* Experience and education entries */

.entry + .entry {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

#education .entry + .entry {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}

.entry-head {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.entry-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.entry-meta .accent {
  display: block;
}

.bullets {
  margin: 1.25rem 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.bullets li {
  margin-bottom: 0.75rem;
}

.bullets li::marker {
  color: var(--accent);
}

.bullets strong {
  color: var(--ink);
}

.chips-label {
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips li {
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* Skills */

.skills {
  margin-top: 0;
  margin-bottom: 0;
}

.skills dt {
  margin-bottom: 0.6rem;
  font-family: 'Saira Extra Condensed', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.skills dd {
  margin: 0 0 1.5rem;
}

/* Projects */

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.card + .card {
  margin-top: 1.25rem;
}

.card h3 {
  margin-bottom: 0.75rem;
}

.card-featured {
  border-left: 4px solid var(--accent);
}

.card-label {
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.card strong {
  color: var(--ink);
}

.card h4 {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.card .bullets {
  margin: 0.75rem 0 0.5rem;
}

.card .stats {
  align-self: stretch;
  margin-top: 1rem;
  margin-bottom: 1.75rem;
}

.card .bullets + .chips {
  margin-top: 1rem;
}

/* Numbered workflow steps inside a case study */
.steps {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 0.35rem 0 0.35rem 2.75rem;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0.3rem;
  left: 0;
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.9rem;
  text-align: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
}

.card-link {
  margin-top: 1.25rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 6px;
}

.card-link::after {
  content: ' \2197';
}

.card-link:hover {
  color: #fff;
  background: var(--accent);
}

/* Contact */

.contact {
  background: #f8f9fa;
}

.contact-email {
  margin-bottom: 0.25rem;
  font-family: 'Saira Extra Condensed', sans-serif;
  font-size: clamp(1.9rem, 7vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.contact-email a {
  color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.15em;
}

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

.contact-phone {
  margin-bottom: 1.75rem;
  color: var(--muted);
}

.site-footer {
  padding: 1.5rem 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer p {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .entry-head {
    flex-direction: row;
    justify-content: space-between;
    gap: 2rem;
  }

  .entry-meta {
    flex-shrink: 0;
    text-align: right;
  }

  /* Label column on the left, chips on the right */
  .skills {
    display: grid;
    grid-template-columns: 13rem 1fr;
  }

  .skills dt,
  .skills dd {
    margin: 0;
    padding: 1rem 0;
    border-top: 1px solid var(--line);
  }

  .skills dt:first-of-type,
  .skills dt:first-of-type + dd {
    padding-top: 0;
    border-top: 0;
  }

  .skills dt {
    padding-right: 1.5rem;
  }
}

@media (min-width: 992px) {
  html {
    scroll-padding-top: 0;
  }

  body {
    padding-left: var(--side-w);
  }

  .sidebar {
    position: fixed;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    width: var(--side-w);
    height: 100vh;
    padding: 2rem 0;
    overflow-y: auto;
    text-align: center;
  }

  .sidebar-id {
    display: block;
    margin: auto 0 1.75rem;
    padding: 0 1rem;
  }

  .sidebar-id img {
    width: 9rem;
    height: 9rem;
    margin: 0 auto 1rem;
  }

  .sidebar-name {
    display: block;
    font-family: 'Saira Extra Condensed', sans-serif;
    font-size: 1.9rem;
    font-weight: 600;
    line-height: 1.1;
    text-transform: uppercase;
    color: #fff;
  }

  .sidebar-role {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: #adb5bd;
  }

  .sidebar nav {
    flex: none;
    height: auto;
  }

  .sidebar nav ul {
    flex-direction: column;
    height: auto;
    padding: 0;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .sidebar nav a {
    justify-content: center;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    border-bottom: 0;
  }

  .sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.04);
  }

  .sidebar nav a.active {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 4px 0 var(--accent);
  }

  .sidebar-social {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1.75rem;
  }

  .sidebar-social a {
    display: flex;
    padding: 0.6rem;
    color: #adb5bd;
    border-radius: 6px;
  }

  .sidebar-social a:hover {
    color: #fff;
    background: var(--accent);
  }

  .sidebar-social svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
  }

  main > section {
    padding: 4.5rem 3rem;
  }

  .hero {
    padding-top: 6rem;
  }

  .hero-photo {
    display: none;
  }

  .site-footer {
    padding: 1.5rem 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
