/* Palette taken from the refinery: bauxite ore, alumina powder, ochre safety paint, graphite steel */
:root {
  --alumina: #f5f6f3;
  --paper: #ffffff;
  --graphite: #25282c;
  --steel: #5f676e;
  --rule: #c9ccc6;
  --bauxite: #8c3a1e;
  --ochre: #d9a21b;

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Source Serif 4", Georgia, serif;

  --measure: 66ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--alumina);
  color: var(--graphite);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}

a { color: var(--bauxite); text-underline-offset: 0.2em; }
a:hover { color: var(--graphite); }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--graphite); color: var(--paper);
  padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { top: 1rem; }

/* Header */
.top {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap;
  padding: 1.25rem var(--gutter);
}
.mark {
  font-family: var(--display); font-weight: 700; font-size: 1.375rem;
  color: var(--graphite); text-decoration: none;
}
.top nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.top nav a {
  font-family: var(--display); font-size: 1.125rem; font-weight: 500;
  color: var(--steel); text-decoration: none;
}
.top nav a:hover { color: var(--bauxite); }

/* Hero: an engineering drawing sheet with its title block */
.sheet { padding: 0 var(--gutter) clamp(3rem, 8vw, 6rem); }

.sheet-frame {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--graphite);
  outline: 1px solid var(--graphite);
  outline-offset: 6px;
  margin: 6px;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "intro intro"
    "name  name"
    ".     block";
  row-gap: 1.5rem;
  min-height: min(78vh, 46rem);
  align-content: space-between;
}

.intro {
  grid-area: intro;
  max-width: 38ch;
  margin: 0;
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  line-height: 1.55;
}

h1 {
  grid-area: name;
  font-size: clamp(4.5rem, 19vw, 15rem);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.01em;
  color: var(--bauxite);
  margin-left: -0.04em;
  padding-bottom: 0.12em;
}

.title-block {
  grid-area: block;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: min(100%, 26rem);
  border: 2px solid var(--graphite);
}
.title-block th,
.title-block td {
  border: 1px solid var(--graphite);
  padding: 0.45rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.title-block th {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1rem;
  color: var(--steel);
  white-space: nowrap;
  width: 1%;
}
.title-block tr:first-child td { font-weight: 600; }
.title-block tr:last-child th { color: var(--graphite); background: var(--ochre); }
.title-block tr:last-child td { background: #f6e7bf; }

/* One load moment: the name settles onto the sheet */
@media (prefers-reduced-motion: no-preference) {
  h1 { animation: settle 900ms cubic-bezier(.2,.7,.2,1) both; }
  .title-block { animation: fade 700ms 400ms ease-out both; }
}
@keyframes settle {
  from { opacity: 0; transform: translateY(0.12em); letter-spacing: 0.04em; }
  to   { opacity: 1; transform: none; letter-spacing: -0.01em; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Sections */
.block {
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr);
  column-gap: clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--rule);
}
.block > h2 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: var(--graphite);
  position: sticky; top: 1.5rem; align-self: start;
}
.block > :not(h2) { grid-column: 2; }

h3 { font-size: 1.5rem; }

/* Work timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1.5rem;
  padding: 0 0 2.25rem;
}
.timeline > li + li { padding-top: 2.25rem; border-top: 1px solid var(--rule); }
.when {
  margin: 0.2rem 0 0;
  font-family: var(--display); font-size: 1.125rem; color: var(--steel);
}
.sub { margin: 0.25rem 0 0.75rem; color: var(--steel); }
.points { margin: 0; padding-left: 1.1rem; max-width: var(--measure); }
.points li { margin-bottom: 0.4rem; }
.points li::marker { color: var(--ochre); }

/* Projects */
.project p { max-width: var(--measure); }
.project-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; }
.tools { margin: 0; font-family: var(--display); font-size: 1.05rem; color: var(--steel); }

.project.lead {
  background: var(--paper);
  border-left: 6px solid var(--bauxite);
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: 2.5rem;
}
.project.lead h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); max-width: 28ch; }

.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  margin: 1.5rem 0;
  border-top: 2px solid var(--graphite);
}
.figures > div { padding: 0.75rem 1rem 0 0; }
.figures dt { font-size: 0.9rem; color: var(--steel); line-height: 1.35; }
.figures dd {
  margin: 0.25rem 0 0;
  font-family: var(--display); font-weight: 600; font-size: 2.25rem; line-height: 1;
  color: var(--bauxite);
}
.spec { font-size: 0.95rem; color: var(--steel); margin-bottom: 0; }

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2rem 2.5rem;
}
.project-list .project { border-top: 2px solid var(--graphite); padding-top: 1rem; }
.project-list h3 { font-size: 1.4rem; }
.project-list .project-head { flex-direction: column; }
.project-list p:last-child { margin-bottom: 0; }

/* Education */
.edu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2rem 2.5rem;
}
.edu h3 { font-size: 1.35rem; margin-bottom: 0.4rem; }
.edu p { margin: 0; }
.plain { margin: 0; padding-left: 1.1rem; }
.plain li::marker { color: var(--ochre); }

.skills-h { margin: 2.5rem 0 0.9rem; font-size: 1.35rem; }
.skills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skills li {
  font-family: var(--display); font-size: 1.1rem; font-weight: 500;
  border: 1px solid var(--graphite);
  padding: 0.2rem 0.75rem;
  background: var(--paper);
}

/* Contact */
.contact p { margin: 0 0 0.5rem; }
.links a {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.foot {
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--rule);
  color: var(--steel);
  font-size: 0.9rem;
}
.foot p { margin: 0; }

/* Narrow screens */
@media (max-width: 760px) {
  .sheet-frame {
    grid-template-columns: 1fr;
    grid-template-areas: "intro" "name" "block";
    min-height: 0;
  }
  .title-block { min-width: 0; width: 100%; }
  .block { grid-template-columns: 1fr; }
  .block > h2 { position: static; margin-bottom: 1.5rem; }
  .block > :not(h2) { grid-column: 1; }
  .timeline > li { grid-template-columns: 1fr; gap: 0.25rem; }
}
