/* Palette: drafting film, graphite, non-photo blue (the sketching pencil
   industrial designers construct with). */
:root {
  --paper: #f3f4f1;
  --graphite: #22252a;
  --lead: #5d636b;
  --rule: #c7cbcf;
  --blue: #4f8fcf;
  --blue-soft: #d7e6f4;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --measure: 62ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}

/* Faint construction grid, like the underlay of a drawing sheet */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(79, 143, 207, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(79, 143, 207, 0.07) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

a { color: inherit; }
a:focus-visible,
.mark:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--graphite);
  color: var(--paper);
  padding: 0.5rem 0.75rem;
}
.skip:focus { left: 0.5rem; }

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem var(--gutter);
  max-width: 76rem;
  margin: 0 auto;
}
.mark {
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  font-stretch: 125%;
  text-decoration: none;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
}
.site-header nav { display: flex; gap: 1.5rem; }
.site-header nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--lead);
}
.site-header nav a:hover { color: var(--graphite); text-decoration: underline; text-decoration-color: var(--blue); text-underline-offset: 4px; }

main {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Hero */
.hero { padding: clamp(3rem, 10vw, 7rem) 0 clamp(3rem, 8vw, 5rem); }

.name {
  margin: 0;
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  font-stretch: 125%;
  font-size: clamp(3.25rem, 13vw, 10.5rem);
  line-height: 0.88;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
}
.name span:last-child { color: transparent; -webkit-text-stroke: 2px var(--graphite); }

/* Dimension line: the one bold idea on the page */
.dimension {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: clamp(1.25rem, 3vw, 2rem);
  color: var(--blue);
}
.dim-tick {
  width: 2px;
  height: 1.25rem;
  background: currentColor;
  flex: none;
}
.dim-line {
  flex: 1;
  height: 2px;
  background: currentColor;
  position: relative;
  transform-origin: center;
  animation: draw 1.1s cubic-bezier(.6, 0, .2, 1) both;
}
.dimension .dim-line:first-of-type::before,
.dimension .dim-line:last-of-type::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transform: translateY(-50%);
}
.dimension .dim-line:first-of-type::before { left: 0; border-right: 10px solid currentColor; }
.dimension .dim-line:last-of-type::after { right: 0; border-left: 10px solid currentColor; }
.dim-label {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  animation: fade 0.6s 0.8s both;
}
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.hero-body {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  margin-top: clamp(2.5rem, 6vw, 4rem);
  align-items: start;
}
.lede {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  line-height: 1.5;
  max-width: 34ch;
}

/* Title block, as in the corner of a technical drawing */
.title-block {
  margin: 0;
  border: 1.5px solid var(--graphite);
  font-size: 0.9rem;
}
.title-block div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  border-bottom: 1px solid var(--graphite);
}
.title-block div:last-child { border-bottom: 0; }
.title-block dt {
  padding: 0.6rem 0.75rem;
  color: var(--lead);
  border-right: 1px solid var(--graphite);
}
.title-block dd { margin: 0; padding: 0.6rem 0.75rem; font-weight: 500; }

/* Sections */
.section-title {
  margin: 0 0 2rem;
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  font-stretch: 125%;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.01em;
}
.work,
.about,
.contact {
  padding: clamp(3rem, 8vw, 5.5rem) 0;
  border-top: 1.5px solid var(--graphite);
}

/* Projects */
.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-areas:
    "head body"
    "head outcome";
  column-gap: clamp(2rem, 6vw, 5rem);
  row-gap: 1.25rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
}
.project:first-of-type { border-top: 0; padding-top: 0; }
.project-head { grid-area: head; }
.project h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.2;
  font-weight: 700;
  font-variation-settings: "wdth" 110;
}
.project-meta { margin: 0.75rem 0 0; color: var(--lead); font-size: 0.95rem; }
.project-body { grid-area: body; max-width: var(--measure); }
.project-body p { margin: 0 0 0.9rem; }
.project-body p:last-child { margin-bottom: 0; }

.outcome {
  grid-area: outcome;
  margin: 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  max-width: var(--measure);
}
.outcome strong {
  font-variation-settings: "wdth" 125;
  font-stretch: 125%;
  font-weight: 800;
  margin-right: 0.35rem;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
}
.about-text { max-width: var(--measure); }
.about-text p { margin: 0 0 1rem; }
.skills h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}
.skills ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.skills li {
  border: 1px solid var(--graphite);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.92rem;
}

/* Contact */
.contact-line { margin: 0 0 0.5rem; font-size: 1.15rem; color: var(--lead); }
.email {
  display: inline-block;
  font-weight: 800;
  font-variation-settings: "wdth" 115;
  font-size: clamp(1.4rem, 5vw, 3.25rem);
  letter-spacing: -0.01em;
  text-decoration: underline;
  text-decoration-color: var(--blue);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
  word-break: break-word;
}
.email:hover { color: var(--blue); }

.site-footer {
  max-width: 76rem;
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  color: var(--lead);
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }

/* Small screens */
@media (max-width: 760px) {
  .hero-body,
  .about-grid { grid-template-columns: 1fr; }
  .project {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "body" "outcome";
  }
  .name span:last-child { -webkit-text-stroke-width: 1.5px; }
  .dim-label { font-size: 0.8rem; white-space: normal; text-align: center; }
  .title-block div { grid-template-columns: 6.5rem 1fr; }
}
