:root {
  color-scheme: dark;
  --bg: #102b21;
  --ink: #e9f3ed;
  --muted: #b4c9bd;
  --rule: rgba(233, 243, 237, 0.2);
  --line: rgba(233, 243, 237, 0.42);
  --biz: #f4b88a;
  --tech: #7fe3bd;
  --veil: rgba(16, 43, 33, 0.75);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Geist", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", Consolas, "Courier New", monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

/* Large screens and TVs: sizes are in rem, so raising this scales the whole layout. */
@media (min-width: 1600px) {
  html { font-size: 112.5%; }
}

@media (min-width: 1920px) {
  html { font-size: 125%; }
}

@media (min-width: 2560px) {
  html { font-size: 165%; }
}

@media (min-width: 3840px) {
  html { font-size: 250%; }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Site-wide background photo. It covers the whole page and scrolls with it.
   --veil keeps text readable: lower its last number to show more of the photo. */
body::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(var(--veil), var(--veil)), url("images/background.jpg") center top / cover no-repeat;
}

h1, h2, h3, p, ul, ol, dl, dd {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

a {
  color: inherit;
  text-decoration-color: var(--line);
  text-underline-offset: 0.25em;
}

a:hover {
  color: var(--tech);
  text-decoration-color: currentColor;
}

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

main {
  flex: 1;
  width: 100%;
}

.wrap {
  max-width: 68rem;
  margin-right: auto;
  margin-left: auto;
  padding-right: 1.25rem;
  padding-left: 1.25rem;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.skip-link {
  position: absolute;
  z-index: 1;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--bg);
}

.skip-link:focus {
  top: 1rem;
}

.biz { color: var(--biz); }
.tech { color: var(--tech); }
.biz-fill { fill: var(--biz); }
.tech-fill { fill: var(--tech); }

.label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Header and footer */

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.125rem 1.5rem;
  padding-block: 1.25rem;
}

.brand {
  margin-right: auto;
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin-right: -0.25rem;
}

.site-header nav a {
  display: block;
  padding: 0.5rem 0.25rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--ink);
}

.site-header nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--tech);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.5em;
}

.site-footer {
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-block: clamp(2.5rem, 5vw, 3.5rem) 1.5rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.7;
}

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

.site-footer a:hover {
  color: var(--tech);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 2.5rem;
}

.footer-brand .brand {
  display: block;
  color: var(--ink);
}

.footer-brand p {
  margin-top: 0.5rem;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.footer-button {
  display: inline-block;
  padding: 0.5rem 1.125rem;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: transparent;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
}

.footer-button:hover {
  border-color: var(--tech);
}

.footer-heading {
  margin-bottom: 1.25rem;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-links li + li {
  margin-top: 0.6rem;
}

.footer-links a {
  text-decoration: none;
}

.site-footer .footer-links a[aria-current="page"] {
  color: var(--tech);
}

.footer-contact li {
  overflow-wrap: anywhere;
}

.footer-contact li + li {
  margin-top: 0.25rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
}

.arrow-up {
  display: inline-block;
}

/* Shared section layout */

.split {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 1rem 2rem;
  padding-block: 2.25rem;
  border-top: 1px solid var(--rule);
}

.split > h2 {
  font-size: 1.5rem;
  line-height: 1.2;
}

/* Home */

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

.hero-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

/* Profile photo. The size and position zoom in on the face; the initials only show if the photo fails to load. */
.portrait {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 10rem;
  height: 10rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 3rem;
}

.portrait::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: url("images/profile_picture.jpeg") 50% 14% / 180% auto no-repeat;
}

.hero-name {
  margin-top: 1rem;
  font-size: clamp(1.5rem, 9.8vw, 5.75rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 2.5rem 4rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.hero-sub {
  max-width: 30em;
  color: var(--muted);
}

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

.button {
  padding: 0.625rem 1.5rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.button:hover {
  border-color: var(--tech);
  background: var(--tech);
  color: var(--bg);
}

.button-outline {
  background: transparent;
  color: var(--ink);
}

.button-outline:hover {
  background: transparent;
  color: var(--tech);
}

.text-link {
  padding-block: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.bridge {
  display: block;
  width: 100%;
  max-width: 30rem;
  height: auto;
  margin-left: auto;
  overflow: visible;
}

.bridge text {
  font-family: var(--mono);
}

.bridge-head {
  font-size: 11px;
  letter-spacing: 0.1em;
}

.bridge-label {
  fill: var(--ink);
  font-size: 12.5px;
}

.links path,
.packets path {
  fill: none;
}

.links path {
  stroke: var(--line);
  stroke-width: 1;
}

.packets path {
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 0.1 99.9;
  animation: packet 3.2s linear infinite;
}

.packets-biz path { stroke: var(--biz); }
.packets-tech path { stroke: var(--tech); }

.packets path:nth-child(2) { animation-delay: -1.1s; }
.packets path:nth-child(3) { animation-delay: -2.2s; }
.packets-tech path { animation-duration: 2.6s; }

@keyframes packet {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}

.bridge-core {
  fill: var(--bg);
  stroke: var(--ink);
  stroke-width: 1;
}

.bridge-core-label {
  fill: var(--ink);
  font-size: 11px;
}

.index-list {
  border-bottom: 1px solid var(--rule);
}

.index-row {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.25rem 2rem;
  padding-block: 1.375rem;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}

.index-row h2 {
  font-size: 1.5rem;
  line-height: 1.2;
}

.index-row p {
  color: var(--muted);
}

.arrow {
  display: inline-block;
  color: var(--muted);
}

.index-row:hover,
.next-link:hover {
  color: var(--tech);
}

.index-row:hover .arrow,
.next-link:hover .arrow {
  color: var(--tech);
  transform: translateX(4px);
}

.contact-rows dt {
  margin-bottom: 0.125rem;
}

.contact-rows a {
  display: inline-block;
  padding-block: 0.125rem;
}

/* Inner pages */

.page-head {
  max-width: 44rem;
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem);
}

.page-head h1 {
  font-size: clamp(2.75rem, 7vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.page-head p {
  max-width: 36em;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.0625rem;
}

.next-link {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}

.next-link strong {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.next-link .arrow {
  margin-left: auto;
}

/* Page heading with the profile photo beside it (About and Contact) */

.head-with-photo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* About */

.lead {
  max-width: 26em;
  padding-bottom: 2.5rem;
  font-family: var(--serif);
  font-size: clamp(1.625rem, 3.2vw, 2.25rem);
  line-height: 1.22;
  letter-spacing: -0.012em;
}

.about-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem 4rem;
  padding-block: 2.25rem;
  border-top: 1px solid var(--rule);
}

.prose {
  max-width: 34em;
}

.facts > div {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.5rem;
}

.facts > div:first-child {
  padding-top: 0;
}

.facts dd {
  font-size: 0.9375rem;
}

/* Experience */

.role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  padding-block: 2.25rem;
  border-top: 1px solid var(--rule);
}

.role-head h2 {
  font-size: 2rem;
}

.role-org {
  margin-top: 0.5rem;
  font-weight: 500;
}

.role-place {
  color: var(--muted);
  font-size: 0.9375rem;
}

.role-dates {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.duty-list li + li {
  margin-top: 0.75rem;
}

/* Work */

.project {
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule);
}

.project:first-child {
  padding-top: 0;
  border-top: 0;
}

.project:last-child {
  padding-bottom: 0;
}

.project h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

/* A small arrow on links that open another site. */
.arrow-out {
  display: inline-block;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.75em;
}

a:hover .arrow-out {
  color: var(--tech);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  margin-top: 0.5rem;
}

/* The .tech or .biz class sets the colour. */
.badge {
  padding: 0.0625rem 0.375rem;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-desc {
  max-width: 36em;
  margin-top: 0.75rem;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tags li {
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.75rem;
}

/* Skills */

.skill-rows > div {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 0.125rem 1.5rem;
  padding-block: 0.625rem;
}

.skill-rows > div:first-child {
  padding-top: 0.125rem;
}

.skill-rows dt {
  font-weight: 500;
}

.skill-rows dd {
  color: var(--muted);
}

/* Education */

.edu-list > li {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.25rem 2rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule);
}

.edu-list h2 {
  font-size: 1.75rem;
}

.edu-name p {
  margin-top: 0.375rem;
  color: var(--muted);
}

.edu-name .edu-school {
  margin-top: 0.125rem;
  font-size: 0.9375rem;
}

.edu-result {
  font-family: var(--mono);
  font-size: 0.875rem;
}

/* Contact */

.contact-rows {
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}

.contact-rows > div {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  align-items: baseline;
  gap: 0.25rem 2rem;
  padding-block: 1.125rem;
  border-top: 1px solid var(--rule);
}

.contact-rows dd {
  grid-column: 2;
  overflow-wrap: break-word;
}

/* The contact rows above already draw this line. */
.message-section {
  border-top: 0;
}

.message-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field-wide,
.message-form .button {
  grid-column: 1 / -1;
}

.field .label {
  display: block;
  margin-bottom: 0.25rem;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--veil);
  color: var(--ink);
  font: inherit;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--ink);
}

.field textarea {
  resize: vertical;
}

.message-form .button {
  font-family: inherit;
  cursor: pointer;
}

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  .arrow,
  .arrow-up,
  .arrow-out {
    transition: transform 0.2s ease;
  }

  .back-to-top:hover .arrow-up {
    transform: translateY(-2px);
  }

  a:hover .arrow-out {
    transform: translate(2px, -2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .packets {
    display: none;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* Responsive */

@media (max-width: 68rem) {
  .edu-list > li {
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  }

  .edu-result {
    grid-column: 2;
  }

  .hero-top {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .portrait {
    width: 6rem;
    height: 6rem;
    font-size: 1.875rem;
  }
}

@media (max-width: 58rem) {
  .hero-row,
  .about-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .bridge {
    margin-inline: auto;
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 50rem) {
  .site-header nav {
    width: 100%;
    margin-top: 0.25rem;
  }

  .site-header ul {
    justify-content: space-between;
    gap: 0;
    margin-inline: -0.25rem;
  }
}

@media (max-width: 40rem) {
  .site-header nav a {
    padding-inline: 0.125rem;
    font-size: 0.8125rem;
  }

  .bridge-label {
    font-size: 13px;
  }

  .split,
  .skill-rows > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .index-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .index-row p {
    grid-column: 1 / -1;
    grid-row: 2;
  }

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

  .footer-bottom {
    flex-direction: column;
  }

  .edu-list > li {
    grid-template-columns: minmax(0, 1fr);
  }

  .edu-result {
    grid-column: 1;
  }

  .contact-rows > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-rows dd {
    grid-column: 1;
  }

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

@media (max-width: 23rem) {
  .site-header nav a {
    font-size: 0.75rem;
  }
}

/* The smallest phones: all seven links can't fit on one line, so use two even rows. */
@media (max-width: 21.5rem) {
  .site-header ul {
    display: grid;
    grid-template-columns: repeat(4, auto);
  }
}

/* Touch screens: bigger tap targets. */
@media (pointer: coarse) {
  .site-header nav a {
    padding-top: 0.6875rem;
    padding-bottom: 0.6875rem;
  }

  .footer-links li + li {
    margin-top: 0.875rem;
  }

  .footer-contact li + li {
    margin-top: 0.5rem;
  }
}
