/* barneyh.net */

@font-face {
  font-family: 'Geist';
  src: url('../fonts/geist-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('../fonts/geist-mono-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../fonts/instrument-serif-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('../fonts/instrument-serif-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #14140f;
  --soft: #5c5c54;
  --faint: #8a897f;
  --line: #dcdbd3;
  --accent: #1f4fd8;
  --shadow: 0 1px 2px rgb(20 20 15 / 0.04), 0 12px 32px -12px rgb(20 20 15 / 0.16);
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --page: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0b;
    --surface: #161613;
    --ink: #f1f0ea;
    --soft: #a8a79d;
    --faint: #7d7c73;
    --line: #2a2a25;
    --accent: #9db8ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 40px -16px rgb(0 0 0 / 0.7);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

::selection {
  background: var(--ink);
  color: var(--bg);
}

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

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

.wrap {
  width: 100%;
  max-width: calc(var(--page) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

/* ---------- type ---------- */

.label {
  font: 500 12px/1.2 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.serif {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}

em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

/* ---------- header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.top.is-stuck {
  border-bottom-color: var(--line);
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font: 400 17px/1 var(--serif);
  font-style: italic;
  padding-bottom: 1px;
}
.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  font-size: 15px;
}
.nav a {
  color: var(--soft);
  text-decoration: none;
  transition: color 0.15s;
}
.nav a:hover {
  color: var(--ink);
}
.nav .button {
  color: var(--bg);
}
@media (max-width: 640px) {
  .nav a:not(.button) {
    display: none;
  }
}

/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font: 500 15px/1.2 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s, background 0.15s, color 0.15s;
}
.button:hover {
  transform: translateY(-1px);
}
.button.small {
  padding: 8px 14px;
  font-size: 14px;
}
.button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.button.ghost:hover {
  border-color: var(--ink);
}
.arrow {
  display: inline-block;
  transition: transform 0.15s;
}
a:hover > .arrow {
  transform: translate(2px, -2px);
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(56px, 11vw, 132px) clamp(40px, 6vw, 72px);
}
.hero h1 {
  margin-top: 22px;
  max-width: 13ch;
  font: 400 clamp(52px, 9.2vw, 116px) / 0.96 var(--serif);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero h1 em {
  color: var(--accent);
}
.hero .lede {
  margin-top: clamp(24px, 3vw, 34px);
  max-width: 58ch;
  font-size: clamp(18px, 1.7vw, 21px);
  line-height: 1.55;
  color: var(--soft);
  text-wrap: pretty;
}
.hero .lede strong {
  color: var(--ink);
  font-weight: 500;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.facts > div {
  padding: 26px 24px 26px 0;
}
.facts > div + div {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.facts dt {
  font: 400 clamp(24px, 2.6vw, 32px) / 1.1 var(--serif);
  letter-spacing: -0.01em;
}
.facts dd {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--soft);
}
@media (max-width: 860px) {
  .facts {
    grid-template-columns: repeat(2, 1fr);
  }
  .facts > div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }
  .facts > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 460px) {
  .facts {
    grid-template-columns: 1fr;
  }
  .facts > div,
  .facts > div + div {
    padding-left: 0;
    border-left: 0;
  }
  .facts > div + div {
    border-top: 1px solid var(--line);
  }
}

/* ---------- sections ---------- */

.section {
  padding-block: clamp(72px, 10vw, 128px);
}
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 20px 48px;
  align-items: end;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-head h2 {
  margin-top: 14px;
  font: 400 clamp(38px, 5vw, 60px) / 1.02 var(--serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.section-head p {
  max-width: 52ch;
  color: var(--soft);
  text-wrap: pretty;
}
@media (max-width: 760px) {
  .section-head {
    grid-template-columns: 1fr;
  }
}

/* ---------- projects ---------- */

.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line);
}
.project:nth-of-type(even) .project-visual {
  order: -1;
}
.project h3 {
  margin-top: 16px;
  font-size: clamp(30px, 3.4vw, 40px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.project .tagline {
  margin-top: 8px;
  font: italic 400 clamp(21px, 2.2vw, 26px) / 1.2 var(--serif);
  color: var(--soft);
}
.project .summary {
  margin-top: 20px;
  max-width: 50ch;
  text-wrap: pretty;
}
.points {
  margin-top: 20px;
  display: grid;
  gap: 10px;
  max-width: 52ch;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--soft);
}
.points li {
  position: relative;
  padding-left: 22px;
}
.points li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 10px;
  height: 1px;
  background: var(--faint);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.tags li {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 12px/1.3 var(--mono);
  color: var(--soft);
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 26px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line);
  transition: text-decoration-color 0.15s;
}
.project-link:hover {
  text-decoration-color: var(--ink);
}
@media (max-width: 860px) {
  .project {
    grid-template-columns: 1fr;
  }
  .project .project-visual,
  .project:nth-of-type(even) .project-visual {
    order: -1;
  }
}

/* A browser window around a screenshot */
.frame {
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
a.frame:hover {
  transform: translateY(-4px);
}
.frame-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.dots {
  display: flex;
  gap: 6px;
}
.dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}
.frame-url {
  flex: 1;
  min-width: 0;
  max-width: 280px;
  margin-inline: auto;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg);
  font: 400 12px/1.4 var(--mono);
  color: var(--soft);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.frame-bar::after {
  content: '';
  width: 39px;
}
.frame img {
  width: 100%;
  aspect-ratio: 800 / 504;
  object-fit: cover;
  object-position: top;
}

/* Sloshed has no website to photograph: a board of tiles in the app's own colours */
.board {
  --indigo: #4338ca;
  aspect-ratio: 800 / 560;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 40px);
  border-radius: 14px;
  background: radial-gradient(120% 120% at 15% 0%, #5b4fe0 0%, var(--indigo) 45%, #2a2190 100%);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
a.board:hover {
  transform: translateY(-4px);
}
.board-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(6px, 1.2vw, 12px);
  width: min(100%, 440px);
}
.board-grid i {
  aspect-ratio: 1;
  border-radius: 22%;
  background: rgb(255 255 255 / 0.1);
}
.board-grid .o {
  background: #fb923c;
}
.board-grid .p {
  background: #f472b6;
}
.board-grid .g {
  background: #4ade80;
}
.board-grid .b {
  background: #7dd3fc;
}
.board-grid .w {
  background: #fff;
}
.board-grid .hole {
  background: transparent;
}
.board-name {
  grid-column: 2 / 6;
  grid-row: 2 / 4;
  display: grid;
  place-items: center;
  color: #fff;
  font: 700 clamp(26px, 4.6vw, 46px) / 1 var(--sans);
  letter-spacing: -0.04em;
}

/* ---------- client work ---------- */

.clients {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}
.clients h3 {
  margin-top: 14px;
  font: 400 clamp(30px, 3.6vw, 42px) / 1.08 var(--serif);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.clients p {
  margin-top: 16px;
  color: var(--soft);
  max-width: 50ch;
  text-wrap: pretty;
}
.lock {
  justify-self: center;
  width: min(100%, 340px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
}
.lock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 400 13px/1.4 var(--mono);
  color: var(--soft);
}
.lock-row svg {
  flex: none;
}
.lock-field {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font: 400 18px/1 var(--mono);
  letter-spacing: 0.3em;
  color: var(--faint);
}
.lock-button {
  margin-top: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}
@media (max-width: 760px) {
  .clients {
    grid-template-columns: 1fr;
  }
}

/* ---------- java ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(28px, 5vw, 72px);
}
.split .prose p + p {
  margin-top: 16px;
}
.split .prose {
  color: var(--soft);
  text-wrap: pretty;
}
.split .prose strong {
  color: var(--ink);
  font-weight: 500;
}
.repos {
  border-top: 1px solid var(--line);
}
.repos a {
  display: grid;
  grid-template-columns: minmax(190px, 0.9fr) minmax(0, 1.5fr) auto;
  gap: 6px 24px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: padding 0.2s;
}
.repos a:hover {
  padding-inline: 8px;
}
.repos .name {
  font: 500 14px/1.4 var(--mono);
}
.repos .what {
  font-size: 15px;
  color: var(--soft);
}
.repos .kind {
  font: 400 12px/1.4 var(--mono);
  color: var(--faint);
  white-space: nowrap;
}
@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .repos a {
    grid-template-columns: 1fr auto;
  }
  .repos .what {
    grid-column: 1 / -1;
    order: 3;
  }
}

/* ---------- toolkit and about ---------- */

.toolkit {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 24px;
  margin-top: clamp(48px, 7vw, 80px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.toolkit h3 {
  font: 500 12px/1.2 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.toolkit ul {
  margin-top: 14px;
  display: grid;
  gap: 6px;
  font-size: 15.5px;
}
@media (max-width: 760px) {
  .toolkit {
    grid-template-columns: repeat(2, 1fr);
  }
}

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.about .big {
  font: 400 clamp(26px, 3vw, 36px) / 1.25 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.about .big + p {
  margin-top: 22px;
  color: var(--soft);
  max-width: 56ch;
  text-wrap: pretty;
}
.degree {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.degree .grade {
  margin-top: 14px;
  font: 400 34px/1.05 var(--serif);
  letter-spacing: -0.02em;
}
.degree p {
  margin-top: 10px;
  color: var(--soft);
  font-size: 15.5px;
}
@media (max-width: 860px) {
  .about {
    grid-template-columns: 1fr;
  }
}

/* ---------- contact and footer ---------- */

.contact {
  padding-block: clamp(72px, 11vw, 140px);
  border-top: 1px solid var(--line);
  text-align: center;
}
.contact h2 {
  margin: 18px auto 0;
  max-width: 14ch;
  font: 400 clamp(46px, 7.6vw, 96px) / 0.98 var(--serif);
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.contact p {
  margin: 22px auto 0;
  max-width: 46ch;
  color: var(--soft);
}
.contact .actions {
  justify-content: center;
}
.contact .button {
  padding: 14px 22px;
  font-size: 16px;
}

.foot {
  border-top: 1px solid var(--line);
  padding-block: 28px;
  font-size: 14px;
  color: var(--soft);
}
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
}
.foot a {
  text-decoration: none;
}
.foot a:hover {
  color: var(--ink);
}
.foot nav {
  display: flex;
  gap: 20px;
}

/* ---------- not found ---------- */

.lost {
  min-height: calc(100vh - 69px);
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 64px;
}
.lost h1 {
  margin-top: 16px;
  font: 400 clamp(44px, 7vw, 80px) / 1 var(--serif);
  letter-spacing: -0.02em;
}
.lost p {
  margin: 16px auto 28px;
  color: var(--soft);
  max-width: 40ch;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
