/* thealxlabs — one stylesheet, no build step.
   Two colours, ink and paper; the grey is a mix of the two.
   Geist for the text, Geist Mono for the numbers and statuses. */

@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0A0A0A;
  --paper: #FFFFFF;
  --grey: #5E5E5E;     /* 6.5:1 on paper */

  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gap: 2.5rem;       /* between blocks of text */

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #FFFFFF;
    --paper: #0A0A0A;
    --grey: #9C9C9C;   /* 7.2:1 on paper */
  }
}

/* Base */

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

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

body {
  margin: 0;
  padding: clamp(4rem, 18vh, 11rem) 1.5rem 3rem clamp(1.5rem, 18vw - 3rem, 16rem);
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header, main, footer { max-width: 50rem; }

h1, h2, p, ol, ul {
  margin: 0;
  padding: 0;
  font: inherit;
}

ol, ul { list-style: none; }

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

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

/* The door. Its glyph has 16 empty units either side in its 100-unit box,
   so the box is pulled left by 16% to line the door up with the text. */

.door {
  --size: clamp(4rem, 3rem + 2vw, 5rem);
  display: block;
  width: var(--size);
  height: var(--size);
  margin: 0 0 1.5rem calc(var(--size) * -0.16);
}

/* Work: one line per project on wide screens, two lines on narrow ones. */

.work { margin-top: var(--gap); }

.row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  grid-template-areas:
    "num title status"
    ".   line  line";
  column-gap: 1rem;
  align-items: baseline;
  padding-block: 0.375rem;
}

@media (min-width: 48em) {
  .row {
    grid-template-columns: 2rem 8rem minmax(0, 1fr) 6.5rem;
    grid-template-areas: "num title line status";
    column-gap: 1.5rem;
    padding-block: 0.125rem;
  }
}

.num    { grid-area: num; }
.title  { grid-area: title; }
.line   { grid-area: line; color: var(--grey); }
.status { grid-area: status; }

.num,
.status {
  color: var(--grey);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.arrow {
  display: inline-block;
  margin-left: 0.3em;
}

/* Footer */

footer { margin-top: var(--gap); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.links a {
  text-decoration: underline;
  text-decoration-color: var(--grey);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

@media (max-width: 30em) {
  .links li:first-child { flex-basis: 100%; }   /* the email gets its own line on phones */
}

footer p {
  margin-top: 0.25rem;
  color: var(--grey);
}

/* States. The arrow's nudge is the only motion on the page. */

@media (hover: hover) {
  a.row:hover .title {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
  }

  .links a:hover { text-decoration-color: currentColor; }
}

@media (prefers-reduced-motion: no-preference) {
  .arrow { transition: transform 150ms ease; }
  a.row:focus-visible .arrow { transform: translate(2px, -2px); }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  a.row:hover .arrow { transform: translate(2px, -2px); }
}
