:root {
  --ink: #1a1a1c;
  --ink-soft: #4a4a4f;
  --ink-faint: #6e6e74;
  --rule: #e6e4df;
  --bg: #fdfcfa;
  --panel: #f5f1e9;
  --panel-edge: #ebe4d4;
  --accent: oklch(0.38 0.08 275);
  --accent-hover: oklch(0.32 0.09 275);
  --accent-soft: oklch(0.62 0.06 275);
  --measure: 760px;
}

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

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

body {
  margin: 0;
  background-color: var(--bg);
  /* Almost-imperceptible paper grain. Inline SVG so the site stays one HTML + one CSS, no asset files. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.10  0 0 0 0 0.11  0 0 0 0.035 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-repeat: repeat;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 56px 24px 40px;
}

@media (min-width: 720px) {
  body { font-size: 18px; }
  .page { padding: 96px 40px 56px; }
}

/* Header / hero ------------------------------------------------------- */

header.masthead {
  margin-bottom: 56px;
}

.wordmark {
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.15;
  margin: 0 0 18px;
  color: var(--ink);
}

.lede {
  font-size: clamp(20px, 2.6vw, 24px);
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--ink-soft);
  margin: 0;
  max-width: 36ch;
  text-wrap: pretty;
}

/* Small geometric mark — three stacked tilted strokes evoking a fox profile, without illustrating one. */
.mark {
  display: block;
  width: 36px;
  height: 36px;
  margin: 28px 0 0;
  color: var(--accent-soft);
}

.mark svg { width: 100%; height: 100%; display: block; }

@media (min-width: 720px) {
  header.masthead { margin-bottom: 80px; }
  .mark { width: 40px; height: 40px; margin-top: 32px; }
}

/* "Back" link used on subpages -------------------------------------- */

.back {
  margin: 0 0 28px;
  font-size: 14px;
  color: var(--ink-faint);
}

.back a {
  color: var(--ink-faint);
  border-bottom-color: color-mix(in oklch, var(--ink-faint) 35%, transparent);
}

.back a:hover, .back a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Sections + section ornament ----------------------------------------- */

section {
  padding: 56px 0 40px;
  position: relative;
  border-top: 1px solid var(--rule);
}

section:first-of-type { border-top: 0; padding-top: 0; }

/* A tiny diamond centered on the section rule line, in the soft accent. */
section:not(:first-of-type)::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 1px solid var(--accent-soft);
}

@media (min-width: 720px) {
  section { padding: 72px 0 56px; }
}

h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 22px;
}

p {
  margin: 0 0 1em;
  max-width: 62ch;
  text-wrap: pretty;
}

p:last-child { margin-bottom: 0; }

/* Links ---------------------------------------------------------------- */

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklch, var(--accent) 28%, transparent);
  transition: color 120ms ease, border-color 120ms ease;
}

a:hover, a:focus-visible {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Projects (tinted panel) --------------------------------------------- */

section.projects-section {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 6px;
  padding: 40px 28px 36px;
  margin: 24px 0;
}

/* When inside the tinted panel, suppress the section's top rule + ornament — the panel is the visual divider. */
section.projects-section { border-top: 1px solid var(--panel-edge); }
section.projects-section::before { display: none; }

@media (min-width: 720px) {
  section.projects-section { padding: 56px 44px 48px; margin: 32px 0; }
}

.projects {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.project {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.project__name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0;
}

.project__name a {
  color: inherit;
  border-bottom-color: color-mix(in oklch, var(--ink) 22%, transparent);
}

.project__name a:hover,
.project__name a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.project__desc {
  font-size: inherit;
  color: var(--ink-soft);
  margin: 0;
  max-width: 60ch;
}

.project__meta {
  font-size: 14px;
  color: var(--ink-faint);
  margin: 2px 0 0;
}

.project__meta a { color: var(--ink-faint); border-bottom-color: color-mix(in oklch, var(--ink-faint) 35%, transparent); }
.project__meta a:hover, .project__meta a:focus-visible { color: var(--accent); border-bottom-color: var(--accent); }

@media (min-width: 640px) {
  .projects { gap: 32px; }
  .project__name { font-size: 20px; }
}

/* Contact -------------------------------------------------------------- */

.contact {
  font-size: clamp(19px, 2.2vw, 21px);
}

/* Footer --------------------------------------------------------------- */

footer.colophon {
  margin-top: 24px;
  padding: 32px 0 0;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-faint);
}

footer.colophon p {
  margin: 0;
  max-width: none;
}

footer.colophon .legal-name {
  color: var(--ink-soft);
  font-weight: 500;
}

footer.colophon a {
  color: var(--ink-faint);
  border-bottom-color: color-mix(in oklch, var(--ink-faint) 40%, transparent);
}

footer.colophon a:hover,
footer.colophon a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.sep {
  display: inline-block;
  margin: 0 0.5em;
  color: color-mix(in oklch, var(--ink-faint) 55%, transparent);
}

@media (min-width: 720px) {
  footer.colophon { font-size: 14px; margin-top: 32px; padding-top: 40px; }
}

::selection {
  background: color-mix(in oklch, var(--accent) 22%, transparent);
  color: var(--ink);
}
