/* Kieran Edward Walsh — static rebuild of the Cargo site */

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("/fonts/space-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #fdff00;
  --ink: #000;
  --card: transparent;
  --sans: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "Space Mono", ui-monospace, Menlo, monospace;
  /* Cargo sizes type in viewport-scaled rems; mirror that fluidly */
  --step: 16px;
  --margin: clamp(16px, 2.7vw, 52px);
  --gutter: clamp(12px, 1.6vw, 28px);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step);
  line-height: 1.25;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2 { font: inherit; margin: 0; }
b, strong { font-weight: 600; }
small { font-family: var(--mono); font-size: 0.66em; line-height: 1.3; }
a { color: inherit; text-decoration: none; }
a { transition: opacity 0.15s ease; }
a:hover { opacity: 0.5; }
.nav { font-family: var(--mono); font-size: 0.9375em; letter-spacing: -0.01em; }
a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 0.06em; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

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

.icon {
  width: 1em; height: 1em;
  display: inline-block;
  vertical-align: -0.12em;
  margin-right: 0.25em;
}

/* Grid: Cargo rows of proportional columns */
.row {
  display: flex;
  gap: var(--gutter);
  align-items: flex-start;
  width: 100%;
}
.col { flex: var(--span, 1) 1 0; min-width: 0; }
.col > img + img, .col > video + video { margin-top: var(--gutter); }

/* Header */
.site-header { padding: var(--margin) var(--margin) 0; }
.info h1, .info a[href^="/"] { white-space: nowrap; }
.info p { margin: 0; }
.info p + p { margin-top: 1em; }
.info .row > .col:not(:nth-child(2)) { min-width: max-content; }

/* Projects */
main { padding: var(--margin); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--margin); }
.project {
  background: var(--card);
  color: var(--ink);
  padding: var(--margin);
  min-width: 0;
  overflow-wrap: break-word;
}
.project:not([style*="--card"]) { padding-inline: 0; }
.project .row + .row { margin-top: var(--gutter); }
.project > .embed + br + b > br:first-child { display: none; }

.embed { position: relative; aspect-ratio: 16 / 9; width: 100%; max-width: 1100px; margin-bottom: var(--gutter); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Phone */
@media (max-width: 767px) {
  .row { flex-direction: column; }
  .col { flex: none; width: 100%; }
  .col:empty { display: none; }
  .info .row > .col { min-width: 0; }
  .project { padding: var(--margin) calc(var(--margin) * 0.75); }
}

@media (prefers-reduced-motion: reduce) {
  video[autoplay] { animation: none; }
}
