/* Shared styles for every page: tokens, type, the experience list,
   the footer, the background layer and the load-in motion. */

/* Departure Mono by Helena Zhang, SIL OFL 1.1 (see fonts/DepartureMono-OFL.txt) */
@font-face {
  font-family: "Departure Mono";
  src: url("../fonts/DepartureMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --color-bg: #1A1716;          /* warm near-black, as behind the Paper shader */
  --color-text: #D0D5DD;        /* gray-300: headings, hover states */
  --color-muted: color-mix(in srgb, #98A2B3 85%, transparent);   /* gray-400 @ 85% */
  --color-subtle: #98A2B3;      /* gray-400 */
  --color-rule: color-mix(in srgb, #98A2B3 15%, transparent);    /* gray-400 @ 15% */
  --color-rule-hover: color-mix(in srgb, #98A2B3 40%, transparent);
  --color-shadow: #182230;      /* gray-800 */
  --color-focus: #9E77ED;
  --font-body: "Departure Mono", ui-monospace, Menlo, monospace;
  --font-name: "Jacquard 12", "Old English Text MT", serif;      /* Google Fonts, OFL */
  --font-weight-regular: 400;   /* Departure Mono ships one weight */
  --font-weight-medium: 400;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-xl: 20px;
  --text-display-lg: 48px;
  --text-display-xl: 60px;
  --leading-sm: 20px;
  --leading-xl: 30px;
  --leading-display-md: 44px;
  --tracking-breath: 0.01em;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* em tracking must resolve per element, not inherit body's 12px value */
* { box-sizing: border-box; margin: 0; padding: 0; letter-spacing: var(--tracking-breath); }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font: var(--font-weight-regular) var(--text-xs)/var(--leading-sm) var(--font-body);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Paper's Dithering shader, mounted full-screen behind the content (assets/bg.js) */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  animation: bg-in 2400ms var(--ease-out) both;
}
@keyframes bg-in { from { opacity: 0; } }

main {
  position: relative;
  z-index: 1;
  max-width: 492px;             /* 460px column + 16px gutters */
  margin: 0 auto;
  padding: 100px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

h1 {
  font-family: var(--font-name);
  font-weight: 400;             /* Jacquard 12 has a single weight */
  letter-spacing: -0.02em;
}

/* Experience list, also used for any label / value rows */
.jobs { list-style: none; }
.jobs li {
  position: relative;
  display: flex;
  border-bottom: 0.5px solid transparent;  /* reserves the rule's height, as in Paper */
}
.jobs li::after {               /* 0.5px rule, drawn as a line so it can animate in */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0.5px;
  background: var(--color-rule);
  transform-origin: left;
  transition: background-color 300ms var(--ease-out);
}
.jobs b { font-weight: var(--font-weight-medium); }

/* Row hover: the row brightens, the others recede, a small arrow slides in. */
.jobs a,
.jobs .row {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex: 1;
  padding: 10px 0;              /* on the link so the whole row is clickable */
  color: inherit;
  text-decoration: none;
  transition: color 300ms var(--ease-out), opacity 300ms var(--ease-out);
}
.jobs i {
  display: inline-block;
  margin-left: 4px;
  font-style: normal;
  opacity: 0;
  transform: translate(-3px, 2px);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}
.jobs:has(a:hover) a { opacity: 0.6; }
.jobs a:hover, .jobs a:focus-visible { opacity: 1; color: var(--color-text); }
.jobs a:hover i, .jobs a:focus-visible i { opacity: 1; transform: none; }
.jobs li:has(a:hover)::after { background: var(--color-rule-hover); }

/* Footer */
.based { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 32px; white-space: nowrap; }
.based nav { display: flex; gap: 24px; }

/* Plain text links */
.based a,
.link {
  padding: 0 5px;
  color: inherit;
  text-decoration: underline transparent;
  text-underline-offset: 3px;
  transition: color 300ms var(--ease-out), text-decoration-color 300ms var(--ease-out);
}
.link { padding: 0; }
.based a:hover, .link:hover { color: var(--color-text); text-decoration-color: currentColor; }

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

/* Load-in: each element rises 10px, sharpens from a soft blur and fades up,
   staggered top to bottom. --i sets the order. */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); filter: blur(6px); }
}
@keyframes draw { from { transform: scaleX(0); } }
@keyframes settle {
  from { opacity: 0; transform: scale(0.94); filter: grayscale(100%) blur(8px); }
}
/* The pixel blackletter renders in left to right in hard steps, like a
   display drawing it column by column. Negative insets leave room for
   strokes outside the text box. */
@keyframes render {
  from { clip-path: inset(-30px 100% -30px -30px); }
  to   { clip-path: inset(-30px -30px -30px -30px); }
}

.in {
  animation: rise 1100ms var(--ease-out) both;
  animation-delay: calc(120ms + var(--i, 0) * 70ms);
}
h1.in { animation: render 1100ms steps(24, jump-end) both; animation-delay: 300ms; }
.jobs li.in::after { animation: draw 1200ms var(--ease-out) both; animation-delay: inherit; }

@media (prefers-reduced-motion: reduce) {
  .in, h1.in, .jobs li.in::after, .bg { animation: none; }
}
