/* Colours, fonts and radii are the shared tokens (kit/tokens.css, with the names in theme.css); both load before this file. */
:root {
  --container: 44rem;
  --ease: .15s cubic-bezier(.4, 0, .2, 1);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main { width: 100%; max-width: var(--container); margin: 0 auto; padding: .5rem 0 2rem; }
a { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card { margin: 1rem .5rem 0; padding: 1rem; background: var(--surface); border-radius: var(--radius-lg); }
h1 { margin: 0; font-size: 1.75rem; line-height: 2.25rem; font-weight: 600; color: var(--text-strong); }
.handle { font-weight: 400; color: var(--text-muted); }
.subtitle { margin-top: .25rem; font-size: 1rem; line-height: 1.5rem; color: var(--text-soft); }
.facts { margin-top: .5rem; font-size: .875rem; line-height: 1.25rem; color: var(--text-muted); }
h2 {
  margin: 0 0 .75rem;
  font-size: .75rem;
  line-height: 1rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
}
h3 { margin: 1rem 0 .25rem; font-size: .875rem; line-height: 1.25rem; font-weight: 600; color: var(--text-strong); }
p { margin: 0 0 .75rem; font-size: .875rem; line-height: 1.5; }
p:last-child { margin-bottom: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* Contact row in the hero. */
.contact { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.contact a {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  color: var(--text-soft);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  transition: color var(--ease), background-color var(--ease);
}
.contact a:hover { background: var(--hover); color: var(--text-strong); }
.contact svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }

/* Experience timeline. */
.job { padding: .75rem; background: var(--surface-2); border-radius: var(--radius-md); }
.job + .job { margin-top: .5rem; }
.job .head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; }
.job .role { font-size: 1rem; line-height: 1.5rem; font-weight: 600; color: var(--text-strong); }
.job .when { font-size: .75rem; line-height: 1.5rem; color: var(--text-muted); }
.job .what { font-size: .875rem; line-height: 1.25rem; color: var(--text-muted); }
.job ul { margin-top: .5rem; padding-left: 1.25rem; list-style: disc; font-size: .875rem; line-height: 1.25rem; }
.job li + li { margin-top: .25rem; }

/* Case study. */
.study dl { margin: 0; display: grid; gap: .75rem; }
.study dt { font-size: .875rem; line-height: 1.25rem; font-weight: 600; color: var(--text-strong); }
.study dd { margin: .125rem 0 0; font-size: .875rem; line-height: 1.5; }
.study dd ul { padding-left: 1.25rem; list-style: disc; }
.study dd li + li { margin-top: .25rem; }
.diagram { margin: .75rem 0 0; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram figcaption { margin-top: .25rem; font-size: .75rem; line-height: 1rem; color: var(--text-muted); }
.diagram .box { fill: var(--surface-2); stroke: var(--border); }
.diagram .core { fill: #422006; stroke: var(--accent); }
.diagram text { fill: var(--text-soft); font-size: 12px; font-family: inherit; }
.diagram .t { font-weight: 600; fill: var(--text-strong); }
.diagram .s { fill: var(--text-muted); font-size: 11px; }
.diagram .arrow { stroke: var(--text-muted); stroke-width: 1.5; fill: none; }
.diagram .head { fill: var(--text-muted); }

/* Screenshot carousel: native scroll-snap, so it swipes and scrolls without JS; the buttons are added by JS. */
.slides { margin: 0 0 1rem; }
.slides-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--radius-md);
}
.slides-track::-webkit-scrollbar { display: none; }
.slides-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .slides-track { scroll-behavior: smooth; } }
.slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; }
.slide a { display: block; aspect-ratio: 16 / 10; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.slide img { display: block; width: 100%; height: 100%; object-fit: contain; }
.slide figcaption { margin-top: .5rem; font-size: .75rem; line-height: 1rem; color: var(--text-muted); }
.slides-nav { display: none; align-items: center; justify-content: center; gap: .75rem; margin-top: .5rem; }
.slides.js .slides-nav { display: flex; }
.slides-nav button {
  width: 2rem; height: 2rem; padding: 0;
  font: inherit; font-size: 1.25rem; line-height: 1;
  color: var(--text-soft); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; transition: color var(--ease), background-color var(--ease);
}
.slides-nav button:hover { background: var(--hover); color: var(--text-strong); }
.slides-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.slides-count { min-width: 3.5rem; text-align: center; font-size: .75rem; color: var(--text-muted); }

.links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.links a {
  padding: .25rem .5rem;
  font-size: .75rem;
  line-height: 1rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: color var(--ease), background-color var(--ease);
}
.links a:hover { background: var(--hover); }
.links a.primary { background: var(--accent); color: var(--accent-text); }
.links a.primary:hover { filter: brightness(1.1); }
.tip { position: relative; display: inline-flex; }
.tip [role="tooltip"] {
  position: absolute;
  bottom: calc(100% + .5rem);
  left: 0;
  z-index: 10;
  width: max-content;
  max-width: min(18rem, 80vw);
  padding: .5rem .75rem;
  font-size: .75rem;
  line-height: 1rem;
  font-weight: 400;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--ease), visibility var(--ease);
}
.tip:hover [role="tooltip"], .tip:focus-within [role="tooltip"] { opacity: 1; visibility: visible; }

/* Tech-stack badges. */
.badges { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .5rem; }
.badges li {
  padding: .125rem .5rem;
  font-size: .75rem;
  line-height: 1rem;
  color: var(--accent);
  background: rgb(245 158 11 / .12); /* translucent, so it reads the same on --surface and --surface-2 */
  border: 1px solid rgb(245 158 11 / .4);
  border-radius: 999px;
}
.study .badges { margin-bottom: 1rem; }

/* Other projects. */
.projects > li { padding: .75rem; background: var(--surface-2); border-radius: var(--radius-md); }
.projects > li + li { margin-top: .5rem; }
.projects .name { font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; color: var(--text-strong); }
.projects .desc { font-size: .875rem; line-height: 1.25rem; color: var(--text-muted); }
.projects .desc + .desc { margin-top: .25rem; }
.projects .links { margin-top: .5rem; }
.projects .links a { background: var(--surface); }
.projects .links a:hover { background: var(--hover); }
.projects .links a.primary { background: var(--accent); }
.projects .links a.primary:hover { filter: brightness(1.1); }

/* Skills. */
.skills { display: grid; gap: .5rem; }
.skills > div { font-size: .875rem; line-height: 1.25rem; }
.skills dt, .skills dd { display: block; margin: 0; }
.skills dt { font-weight: 600; color: var(--text-strong); }
.skills dd { color: var(--text-muted); }
.skills dd ul { margin-top: .25rem; padding-left: 1.25rem; list-style: disc; }
.skills dd li + li { margin-top: .125rem; }
.skills { gap: .75rem; }
.side ul.plain { display: grid; gap: .25rem; font-size: .875rem; line-height: 1.25rem; }
dl.skills { margin: 0; }

@media (min-width: 40rem) {
  .card { padding: 1.25rem; }
  main { padding-top: 1rem; }
}

/* Wide screens: skills and facts move to a right-hand column. It is not sticky: it is taller than most
   viewports, so a sticky column would crop its lower cards until the main column ends. On narrow screens it stacks below. */
@media (min-width: 56rem) {
  main { max-width: 72rem; }
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
}

/* 404 page: one centred card under the bar. */
.notfound { display: grid; place-items: center; text-align: center; }
.notfound h1 { margin-bottom: .5rem; }
.notfound a { display: inline-block; padding: .5rem .75rem; color: var(--text); background: var(--surface-2); border-radius: var(--radius-sm); text-decoration: none; transition: background-color var(--ease); }
.notfound a:hover { background: var(--hover); }
