/* Self-hosted fonts: Latin subsets only. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #faf8f4;
  --ink: #211e18;
  --muted: #5f584e;
  --line: #ddd6ca;
  --accent: #b9470b;
  --receipt: #fffefb;
  --receipt-shadow: rgb(33 30 24 / 0.16);
  --phone-ring: transparent;

  /* The Sous Chef panel keeps its brand orange in both themes. */
  --panel: #f58234;
  --on-panel: #211e18;

  --sans: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section: clamp(4rem, 10vw, 7.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15120f;
    --ink: #f3eee6;
    --muted: #a99f91;
    --line: #37312a;
    --accent: #f79a5c;
    --receipt: #25211c;
    --receipt-shadow: rgb(0 0 0 / 0.5);
    --phone-ring: rgb(255 255 255 / 0.16);
  }
}

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

* {
  margin: 0;
}

html {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

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

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

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

:focus-visible {
  outline: 2px solid currentcolor;
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.wrap {
  width: min(100% - 2 * var(--gutter), 76rem);
  margin-inline: auto;
}

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

.skip:focus {
  top: 0.5rem;
}

.eyebrow,
.when,
.where,
.site-head nav,
.links,
.site-foot,
time {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

/* External links carry a small arrow, drawn so it never depends on a font. */
.ext::after {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-left: 0.35em;
  background: currentcolor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 1h7v7H7.6V3.4L1.9 9.1l-1-1L6.6 2.4H2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Header */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  text-decoration: none;
}

.brand img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: #fff;
}

@media (max-width: 30rem) {
  .brand span {
    display: none;
  }
}

.site-head ul {
  display: flex;
  gap: clamp(0.875rem, 3vw, 2rem);
}

.site-head nav a {
  text-decoration: none;
}

.site-head nav a:hover {
  text-decoration: underline;
}

/* Hero */

.hero {
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(2.5rem, 5vw, 3.5rem);
}

.hero .eyebrow {
  color: var(--muted);
}

.hero h1 {
  margin-block: 0.75rem 1.5rem;
  font-size: clamp(3.5rem, 15.5vw, 9.25rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-wrap: initial;
}

.nick {
  color: var(--accent);
  font-weight: 300;
  letter-spacing: -0.045em;
}

.lede {
  display: grid;
  gap: 0.75rem;
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.5rem;
}

/* Sous Chef panel */

.project {
  background: var(--panel);
  color: var(--on-panel);
  padding-block: 0 clamp(3rem, 7vw, 5rem);
}

.project a:hover {
  color: inherit;
}

.project-grid {
  display: grid;
  gap: 2.5rem;
}

.project-copy {
  display: grid;
  gap: 0.875rem;
  max-width: 34rem;
}

.project-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-block: 0.5rem;
}

.project-title picture {
  flex: none;
}

.project-title img {
  width: 4rem;
  height: 4rem;
  border-radius: 22%;
  box-shadow: 0 2px 8px rgb(33 30 24 / 0.2);
}

.project-title h2 {
  font-size: clamp(1.875rem, 4vw, 2.625rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

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

.button {
  display: inline-block;
  padding: 0.5rem 0.9375rem;
  border: 1.5px solid var(--on-panel);
  border-radius: 99px;
  background: var(--on-panel);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.project a.button:hover {
  background: #000;
  color: #fff;
}

.button.ghost {
  background: transparent;
  color: var(--on-panel);
}

.project a.button.ghost:hover {
  background: var(--on-panel);
  color: #fff;
}

.phones {
  order: -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.5rem, 2.5vw, 1.25rem);
  margin-top: -1.5rem;
}

.features {
  display: grid;
  gap: 0.375rem 2rem;
  padding-top: 1.25rem;
  border-top: 1.5px solid var(--on-panel);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.phone {
  overflow: hidden;
  border: clamp(3px, 0.6vw, 6px) solid #15120f;
  border-radius: clamp(1.125rem, 3.4vw, 2.25rem);
  background: #15120f;
  outline: 1px solid var(--phone-ring);
  box-shadow: 0 1.25rem 2.5rem -0.75rem rgb(33 30 24 / 0.45);
}

.phone:nth-child(2) {
  transform: translateY(1.25rem);
}

.phone:nth-child(3) {
  transform: translateY(0.5rem);
}

/* How it's built */

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.built,
.experience,
.skills,
.credentials,
.earlier {
  padding-top: var(--section);
}

.built-grid {
  display: grid;
  gap: 3rem;
}

.receipt-shadow {
  max-width: 24rem;
  margin-inline: auto;
  filter: drop-shadow(0 0.75rem 1.25rem var(--receipt-shadow));
}

.receipt {
  --tooth: 7px;
  padding: 1.75rem 1.5rem 2.25rem;
  background: var(--receipt);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.4;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--tooth)) 100%;
}

.receipt-head {
  font-size: 1.125rem;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.receipt-sub,
.receipt-foot {
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.receipt-sub {
  padding-bottom: 1.125rem;
  border-bottom: 1px dashed var(--muted);
  margin-bottom: 1.125rem;
}

.ledger {
  display: grid;
  gap: 0.5rem;
}

.ledger > div {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

/* The dotted leader between a label and its value. */
.ledger > div::before {
  content: "";
  order: 1;
  flex: 1 1 1rem;
  min-width: 1rem;
  border-bottom: 1px dotted var(--muted);
  transform: translateY(-0.2em);
}

.ledger dt {
  order: 0;
}

.ledger dd {
  order: 2;
  font-variant-numeric: tabular-nums;
}

.ledger.total {
  padding-block: 1.125rem;
  border-top: 1px dashed var(--muted);
  margin-top: 1.125rem;
  font-weight: 500;
}

.ledger.total > div::before {
  border-bottom-style: solid;
  opacity: 0;
}

.receipt-foot {
  padding-top: 1.125rem;
  border-top: 1px dashed var(--muted);
}

.barcode {
  height: 2.75rem;
  margin: 0.875rem auto 0;
  width: 82%;
  background: repeating-linear-gradient(
    90deg,
    currentcolor 0 2px,
    transparent 2px 5px,
    currentcolor 5px 6px,
    transparent 6px 9px,
    currentcolor 9px 13px,
    transparent 13px 15px,
    currentcolor 15px 16px,
    transparent 16px 21px
  );
}

.notes {
  display: grid;
  gap: 1.75rem;
}

.notes h3 {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

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

.stack {
  display: grid;
  border-top: 1px solid var(--line);
}

.built .stack {
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.stack > div {
  display: grid;
  gap: 0.125rem;
  padding-block: 0.875rem;
  border-bottom: 1px solid var(--line);
}

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

/* Experience */

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

.jobs > li {
  display: grid;
  gap: 0.25rem;
}

.when {
  color: var(--muted);
}

.jobs h3 {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.where {
  color: var(--muted);
  margin-block: 0.25rem 0.625rem;
}

.jobs ul {
  display: grid;
  gap: 0.375rem;
  padding-left: 1rem;
  list-style: "– ";
}

/* Certifications and education */

.credentials {
  display: grid;
  gap: var(--section);
}

.ledger.wide {
  gap: 1rem;
}

.ledger.wide > div {
  gap: 0.75rem;
}

.ledger.wide dt {
  flex: 0 1 auto;
  font-weight: 500;
  line-height: 1.3;
}

.ledger.wide small {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 400;
}

.ledger.wide dd {
  flex: none;
  max-width: 8.5rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8125rem;
  text-align: right;
}

/* Earlier projects */

.projects {
  border-top: 1px solid var(--line);
}

.projects li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1rem;
  padding-block: 0.875rem;
  border-bottom: 1px solid var(--line);
}

.projects a {
  font-weight: 600;
}

.projects p {
  grid-column: 1 / -1;
  color: var(--muted);
}

.projects time {
  grid-row: 1;
  grid-column: 2;
  color: var(--muted);
}

/* About */

.about {
  margin-top: var(--section);
  overflow: hidden;
  background: var(--panel);
  color: var(--on-panel);
}

.about a:hover {
  color: inherit;
  text-decoration-thickness: 2px;
}

.about-grid {
  display: grid;
  gap: 2rem;
  padding-block: clamp(3rem, 7vw, 5rem) 0;
}

.about picture {
  order: 2;
  align-self: end;
  width: min(100%, 20rem);
  margin-inline: auto;
}

.about picture img {
  mix-blend-mode: multiply;
}

.about-copy {
  display: grid;
  gap: 0.875rem;
  max-width: 36rem;
}

.about h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.about .contact-title {
  margin-top: 1.5rem;
}

.email {
  font-size: clamp(1.25rem, 5.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.about .links {
  margin-top: 0;
}

/* Footer */

.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  padding-block: 1.5rem;
  color: var(--muted);
}

/* Wider screens */

@media (min-width: 40rem) {
  .stack > div {
    grid-template-columns: 11rem 1fr;
    gap: 1rem;
  }

  .jobs > li {
    grid-template-columns: 11rem 1fr;
    gap: 1rem;
  }

  .jobs h3 {
    margin-top: -0.2rem;
  }

  .jobs ul {
    max-width: 44rem;
  }

  .projects li {
    grid-template-columns: 17rem 1fr auto;
    gap: 1rem;
  }

  .projects p {
    grid-column: 2;
  }

  .projects time {
    grid-column: 3;
  }

  .notes {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .features {
    grid-template-columns: repeat(2, auto);
    justify-content: space-between;
  }
}

@media (min-width: 58rem) {
  .hero {
    padding-bottom: clamp(3.5rem, 7vw, 5rem);
  }

  /* Keep the intro inside the panel's left column, clear of the phones. */
  .lede {
    max-width: min(29rem, 41%);
  }

  .project-grid {
    grid-template-columns: 5fr 7fr;
    grid-template-areas:
      "copy phones"
      "copy features";
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 0 clamp(2rem, 4vw, 4rem);
  }

  .project-copy {
    grid-area: copy;
  }

  .features {
    grid-area: features;
  }

  .project-copy {
    padding-top: clamp(3rem, 5vw, 4.5rem);
  }

  .phones {
    grid-area: phones;
    order: 0;
    align-items: start;
    margin-top: -21rem;
    margin-bottom: 11rem;
  }

  .phone:nth-child(1) {
    transform: translateY(8.5rem);
  }

  .phone:nth-child(2) {
    transform: translateY(3.5rem);
  }

  .phone:nth-child(3) {
    transform: translateY(-1.5rem);
  }

  .built-grid {
    grid-template-columns: 22rem 1fr;
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: start;
  }

  .receipt-col {
    position: sticky;
    top: 2rem;
  }

  .receipt-shadow {
    margin-inline: 0;
  }

  .credentials {
    grid-template-columns: 1fr 1fr;
    gap: clamp(2.5rem, 6vw, 5rem);
  }

  .about-grid {
    grid-template-columns: 20rem 1fr;
    gap: clamp(2.5rem, 7vw, 6rem);
  }

  .about picture {
    order: 0;
    width: 100%;
  }

  .about-copy {
    padding-bottom: clamp(3rem, 7vw, 5rem);
  }
}

/* 404 */

.lost {
  display: grid;
  gap: 1rem;
  padding-block: clamp(4rem, 15vh, 9rem);
}

.lost h1 {
  font-size: clamp(3rem, 11vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

/* Motion is decoration here, so it only runs where it is wanted and supported.
   Scroll-driven animation runs off the main thread and needs no JavaScript. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  @supports (animation-timeline: view()) {
    .built {
      view-timeline: --built block;
    }

    .receipt {
      animation: print linear both;
      animation-timeline: --built;
      animation-range: entry 8% entry 62%;
    }
  }
}

@keyframes print {
  from {
    clip-path: inset(0 0 72% 0);
  }
  to {
    clip-path: inset(0 0 -1rem 0);
  }
}
