/* ---- Reset ---- */

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

ul {
  list-style: none;
}

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

/* ---- Tokens ---- */

:root {
  --ink: #3e3e3e;
  --text: #777;
  --soft: #999;
  --line: #e8e8e8;
  --accent: #2a9fd6;
  --accent-hover: #43b3e0;
  --nav-height: 3.5rem;

  color-scheme: light;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  background: #fff;
  color: var(--text);
  font-family: "Open Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
strong {
  color: var(--ink);
}

a {
  color: var(--accent);
  transition: color 0.2s;
}

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

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: #f4f4f4;
  color: var(--ink);
}

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

/* Wide, with a small gutter on each side instead of a narrow centered column. */
.container {
  width: min(1200px, 100% - 3rem);
  margin: 0 auto;
}

/* ---- Top nav ---- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  height: var(--nav-height);
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav ul {
  display: flex;
  justify-content: center;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1.25rem;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.nav a:hover,
.nav a[aria-current="true"] {
  color: var(--accent);
}

/* ---- Hero ---- */

.hero {
  padding: calc(var(--nav-height) + 6rem) 0 6rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: 4rem;
  align-items: center;
}

.avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h1 strong {
  font-weight: 700;
}

.role {
  margin-top: 1rem;
  color: var(--soft);
  font-size: 1rem;
  font-weight: 600;
}

.intro {
  margin-top: 1.25rem;
  max-width: 40rem;
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.85;
}

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

.button {
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

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

/* The first button (email) is the main one; the rest are outlined. */
.button + .button {
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
}

.button + .button:hover {
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent);
}

/* ---- Sections ---- */

.section {
  padding: 6rem 0;
  border-top: 1px solid var(--line);
}

.section-head {
  margin-bottom: 3rem;
  text-align: center;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.section-head p {
  margin-top: 0.5rem;
  font-size: 1.1rem;
  font-weight: 300;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  padding: 2rem;
  border-radius: 8px;
  background: #fff;
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 0.1),
    0 2px 6px rgb(0 0 0 / 0.06);
  font-size: 0.975rem;
}

.card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.35;
}

.card h3 a {
  color: var(--ink);
  text-decoration: none;
}

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

.card > p + p {
  margin-top: 0.75rem;
}

.tag {
  color: var(--soft);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---- Experience ---- */

.jobs {
  display: grid;
  gap: 1.5rem;
}

.job {
  padding: 2.5rem;
}

.job-head,
.role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
}

.subtitle {
  font-size: 1rem;
}

.context {
  max-width: 50rem;
  margin-top: 0.75rem;
  font-style: italic;
}

.role-head {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--line);
}

.job-head + .role-head {
  margin-top: 1.25rem;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
}

h4 span {
  color: var(--soft);
  font-weight: 400;
}

.bullets {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.bullets li::marker {
  color: #ccc;
}

.stack {
  margin-top: 1rem;
}

/* ---- Skills and education ---- */

.card h3 + * {
  margin-top: 1rem;
}

.pairs {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem 1rem;
  align-items: baseline;
}

.pairs dt {
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
}

.education {
  display: grid;
  gap: 1rem;
}

.education li {
  display: grid;
}

/* ---- Contact ---- */

.contact .buttons {
  justify-content: center;
  margin-top: 0;
}

.copyright {
  margin-top: 4rem;
  color: var(--soft);
  font-size: 0.85rem;
  text-align: center;
}

/* ---- 404 ---- */

.not-found {
  padding: 8rem 0;
  text-align: center;
}

.not-found p + * {
  margin-top: 1rem;
}

.not-found .buttons {
  justify-content: center;
}

/* ---- Narrower screens ---- */

@media (max-width: 980px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-inner {
    grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
    gap: 2.5rem;
  }
}

@media (max-width: 736px) {
  .container {
    width: calc(100% - 2rem);
  }
  .nav ul {
    justify-content: flex-start;
  }
  .nav a {
    padding: 0 0.9rem;
  }
  .hero {
    padding: calc(var(--nav-height) + 3rem) 0 4rem;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  .avatar {
    width: 12rem;
    margin: 0 auto;
  }
  .intro {
    margin-inline: auto;
  }
  .hero .buttons {
    justify-content: center;
  }
  .section {
    padding: 4rem 0;
  }
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .card,
  .job {
    padding: 1.5rem;
  }
}
