:root {
  --primary: #3d6899;
  --primary-dark: #335780;
  --ink: #243e5b;
  --muted: #5d7590;
  --line: #d5dfeb;
  --paper: #eef3f8;
  --leaf: #5d8a4a; /* arbocharta green */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  font-family: "Anonymous Pro", ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper) radial-gradient(#c3d1e2 1px, transparent 1px) 0 0 / 22px 22px;
}

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1rem; }

a { color: var(--primary-dark); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* header: logo on top, nav below on small screens */
.site-header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1.5rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand img { display: block; }
nav { display: flex; gap: 1.25rem; }
nav a { color: var(--ink); text-decoration: none; padding: 0.4rem 0; border-bottom: 2px solid transparent; }
nav a:hover { border-color: var(--primary); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.75rem; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1rem; }

section { padding: 2.5rem 0; }
.intro { padding-top: 3rem; }

/* terminal cursor at the end of plain paragraphs (not the ones ending with a link) */
main p:not(.cta):not(.typing)::after,
.cursor {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.2em;
  vertical-align: text-bottom;
  background: var(--primary);
  animation: blink 1.1s steps(1) infinite;
}
/* typing: the full text is already in the page, the not-yet-typed part is just transparent */
.typing .rest { color: transparent; }
.typing .cursor { display: none; margin-left: 0; }
.typing.started .cursor { display: inline-block; }
@keyframes blink { 50% { opacity: 0; } }

/* project: image above text on mobile, side by side from tablet up */
.project { display: grid; gap: 1.25rem; }
.project-shot { display: block; border: 1px solid var(--line); background: #fff; }
.project-shot img { display: block; width: 100%; height: auto; }

/* arbocharta link: the underline is a branch that grows green on hover */
.arbocharta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--leaf);
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
  transition: background-size 0.3s, color 0.2s;
}
.arbocharta svg { transition: transform 0.3s; transform-origin: 50% 100%; }
.arbocharta:hover { color: var(--leaf); background-size: 100% 6px; }
.arbocharta:hover svg { transform: rotate(-12deg) scale(1.12); }

.visit::after { content: " →"; }
.mail { font-weight: 700; overflow-wrap: anywhere; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; padding: 1.25rem 0; }

@media (min-width: 40rem) {
  body { font-size: 1.2rem; }
  h1 { font-size: 2.4rem; }
  .project { grid-template-columns: 16rem 1fr; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .arbocharta, .arbocharta svg { transition: none; }
  main p::after, .cursor { animation: none; }
}
