/* passionfruit.design. One theme, from the fruit: aubergine skin, yellow pulp, pale pith.
   Contrast on --ink: --pith 17.1:1, --pulp 11.1:1, --muted 10.6:1. */
:root {
  --ink: #17091c;
  --skin: #3a1640;
  --pulp: #ffb800;
  --pith: #f6f1e7;
  --muted: #c9bccb;
  --error: #ff9c8a;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1rem, 4vw, 3rem);
  --gap: 2.5rem;
  --measure: 36em;
  /* Masthead: the height of the bar of section links, and of what sits above it. */
  --bar: 2.75rem;
  --mast-top: 6rem;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Keeps link targets and focused fields clear of the bar that stays in view. */
  scroll-padding-top: calc(var(--bar) + 1rem);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--pith);
  font-family: var(--font);
  font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.3125rem);
  line-height: 1.55;
  overflow-wrap: break-word;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.035em;
  word-spacing: 0.08em;
  text-wrap: balance;
}

p { margin: 0 0 1em; max-width: var(--measure); }
ul, ol { margin: 0; padding: 0; list-style: none; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; }

a {
  color: var(--pulp);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: text-underline-offset 150ms ease-out;
}
a:hover { text-underline-offset: 0.3em; }

:focus-visible {
  outline: 3px solid var(--pulp);
  outline-offset: 3px;
  border-radius: 2px;
}
main:focus { outline: none; }

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100%;
  z-index: 3;
  padding: 0.6em 1em;
  background: var(--pulp);
  color: var(--ink);
  font-weight: 800;
}
.skip:focus { top: 0.5rem; }

/* Masthead. The two versions are tabs, and the section links sit in the bar
   the current tab opens onto. On a wide, tall screen the whole masthead stays
   in view; elsewhere the top part scrolls away and only the bar stays. */
.masthead {
  position: sticky;
  top: calc(-1 * var(--mast-top));
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--ink);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 3.25rem;
  padding: 0 var(--gutter);
  color: var(--pith);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.mark { width: 1.75rem; height: 1.75rem; fill: var(--skin); stroke: var(--pith); stroke-width: 1.5; }
.mark .pulp { fill: var(--pulp); stroke: none; }
.versions { padding: 0 var(--gutter); }
.versions ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem; }
.versions a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  padding: 0 1.1rem;
  border: 1px solid var(--skin);
  border-top: 3px solid var(--skin);
  border-bottom: 0;
  border-radius: 0.5rem 0.5rem 0 0;
  color: var(--muted);
  font-size: max(0.9rem, 0.8em);
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}
.versions a:hover { color: var(--pith); border-top-color: var(--muted); }
.versions a[aria-current] { background: var(--skin); border-top-color: var(--pulp); color: var(--pith); }
.sections { padding: 0 var(--gutter); background: var(--skin); }
/* One line always, so the bar keeps its height. The text shrinks a little on
   the narrowest phones, and the gap is only a minimum, so five links fit at
   320px even in a wide system font (DejaVu Sans on Linux). Below that the bar
   scrolls sideways. */
.sections ul { display: flex; justify-content: space-between; column-gap: 0.125rem; overflow-x: auto; scrollbar-width: none; }
.sections a {
  display: flex;
  align-items: center;
  height: var(--bar);
  color: var(--pith);
  font-size: clamp(0.75rem, 3.6vw, max(0.9rem, 0.8em));
  font-weight: 700;
  text-decoration-color: transparent;
  white-space: nowrap;
}
/* The link for the part of the page being read is marked as the page scrolls
   (site.js). Hover is only for pointers that hover: on a touch screen it would
   stay on the last link tapped. */
.sections a[aria-current] { text-decoration-color: var(--pulp); text-decoration-thickness: 0.2em; }
@media (hover: hover) {
  .sections a:hover { text-decoration-color: var(--pulp); }
}
@media (min-width: 40rem) {
  :root { --mast-top: 3.5rem; }
  .masthead { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .brand { height: var(--mast-top); }
  .sections { grid-column: 1 / -1; }
  .sections ul { justify-content: flex-end; column-gap: 2rem; overflow: visible; }
}
@media screen and (min-width: 68rem) and (min-height: 40rem) {
  html { scroll-padding-top: calc(var(--mast-top) + var(--bar) + 1rem); }
  .masthead { top: 0; }
}

/* Sections */
main > section, .page {
  padding: clamp(3rem, 8vw, 7rem) var(--gutter);
  border-top: 1px solid var(--skin);
}
main > section > h2, .page h1 {
  font-size: clamp(2.5rem, 1rem + 7vw, 7rem);
  margin-bottom: 0.4em;
}
.intro, .lede { color: var(--muted); font-size: clamp(1.2rem, 1rem + 0.9vw, 1.75rem); line-height: 1.4; }

/* Even rows. The page says how many go in a row on a wide screen (.per-row-N),
   picked so the count divides evenly; anything left over grows to fill its row. */
.even { display: flex; flex-wrap: wrap; gap: var(--gap); }
.even > * { flex: 1 1 100%; min-width: 0; }
@media (min-width: 40rem) {
  .even > * { flex-basis: 40%; }
}
@media (min-width: 80rem) {
  .per-row-3 > * { flex-basis: 30%; }
  .per-row-4 > * { flex-basis: 22%; }
}

/* Two columns under a full-width heading, once there is room. */
@media (min-width: 56rem) {
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--gap); align-items: start; }
  .split > h2 { grid-column: 1 / -1; }
}

/* Parts that fold away: the summary shows, and a chevron after its last word
   turns when it is open. */
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary > :first-child::after {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-left: 0.6em;
  border: solid var(--pulp);
  border-width: 0 0.15em 0.15em 0;
  transform: translateY(-0.3em) rotate(45deg);
  transition: transform 150ms ease-out;
}
details[open] > summary > :first-child::after { transform: translateY(-0.05em) rotate(-135deg); }
summary :is(h2, h3) { margin: 0; }
details[open] > summary { margin-bottom: 0.5em; }

/* Hero */
.hero { border-top: 0; padding-top: clamp(2rem, 6vw, 6rem); }
.hero h1 {
  font-size: clamp(2.25rem, 11.6vw, 20rem);
  line-height: 0.86;
  letter-spacing: -0.055em;
  margin-left: -0.04em;
  color: var(--pith);
  animation: rise 700ms cubic-bezier(0.2, 0.7, 0.1, 1) both;
}
/* One sentence to a line. */
.hero h1 span { display: block; }
.hero .lede {
  margin-top: clamp(1.5rem, 4vw, 3rem);
  max-width: 32em;
  font-size: clamp(1.15rem, 0.9rem + 1.5vw, 2.1rem);
  line-height: 1.35;
  color: var(--pith);
  animation: rise 700ms 120ms cubic-bezier(0.2, 0.7, 0.1, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(0.4em); }
}

/* What I do, How I build: the lead point, then the numbered ones that follow from it */
.principle-lead { margin-top: 2rem; padding-top: 1.5rem; border-top: 0.5rem solid var(--pulp); }
.principle-lead h3 { margin-bottom: 0.4em; }
.principle-lead p { margin: 0; font-size: 1.15em; }
@media (min-width: 56rem) {
  .principle-lead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: var(--gap); align-items: start; }
}
.principles { counter-reset: p; row-gap: 1.25rem; margin-top: 2rem; }
.principles summary { display: flex; align-items: baseline; gap: 0.6rem; }
.principles li { counter-increment: p; padding-top: 1rem; border-top: 1px solid var(--skin); }
.principles summary::before {
  content: counter(p, decimal-leading-zero);
  color: var(--pulp);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.principles h3 { font-size: 1.15em; line-height: 1.2; letter-spacing: -0.02em; }
.principles p { margin: 0; }
@media (min-width: 40rem) {
  .principles { row-gap: 2rem; }
  .principles summary { display: block; }
  .principles summary::before { display: block; margin-bottom: 0.3rem; font-size: 2em; line-height: 1; letter-spacing: -0.03em; }
}

/* The lot: one unbroken column, browser to network */
.stack { background: var(--pith); color: var(--ink); border-top: 0; }
.stack .intro { color: #4a3a4f; }
.stack a { color: var(--ink); }
.layers { border-left: 0.5rem solid var(--pulp); margin-top: 2rem; }
.layer {
  padding: clamp(0.9rem, 2vw, 1.5rem) 0 clamp(0.9rem, 2vw, 1.5rem) clamp(1rem, 4vw, 3rem);
  border-bottom: 2px solid var(--ink);
}
.layer:last-child { border-bottom: 0; }
.layer h3 { font-size: clamp(1.6rem, 1rem + 3vw, 3.5rem); }
.layer h3::after { width: 0.3em; height: 0.3em; margin-left: 0.4em; border-color: var(--ink); }
.layer p { margin-bottom: 0.6em; font-size: 1.05em; }
.tech { display: flex; flex-wrap: wrap; gap: 0.15em 0; font-weight: 600; }
.tech li:not(:last-child)::after { content: "/"; padding: 0 0.5em; color: #8a5a00; font-weight: 400; }

/* Work */
.projects { row-gap: 0; margin-top: 2rem; }
.project { padding: 1.25rem 0 1.5rem; border-top: 1px solid var(--skin); font-size: max(1rem, 0.92em); }
.project h3 { font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.6rem); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 0.4em; }
.project :is(h2, h3) a { color: var(--pith); text-decoration-color: var(--pulp); }
.project :is(h2, h3) a:hover { color: var(--pulp); }
.project p { margin-bottom: 0; }
.project .kind { color: var(--muted); margin-bottom: 0.6em; }
.project summary { color: var(--pulp); font-weight: 700; }
.facts { display: grid; gap: 0.35rem; }
.facts li { padding-left: 1.2em; position: relative; max-width: var(--measure); }
.facts li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 0.45em; height: 0.45em; border-radius: 50%; background: var(--pulp); }
.projects > .flagship { flex-basis: 100%; border-top: 0.5rem solid var(--pulp); padding: 1.5rem 0 2rem; font-size: 1em; }
.flagship h3, .principle-lead h3 { font-size: clamp(1.9rem, 1rem + 3vw, 3.25rem); line-height: 1; letter-spacing: -0.035em; }
.flagship > p:not(.kind) { font-size: 1.15em; }
.flagship .facts { display: block; columns: 18rem; column-gap: var(--gap); }
.flagship .facts li { break-inside: avoid; margin-bottom: 0.35rem; }
@media (min-width: 56rem) {
  .flagship { display: grid; grid-template: auto 1fr / minmax(0, 1fr) minmax(0, 2fr); column-gap: var(--gap); align-items: start; }
  .flagship > p:not(.kind), .flagship .facts { grid-column: 2; grid-row: 1 / span 2; }
}

/* Receipts */
.receipts dl { gap: 1px; background: var(--skin); border: 1px solid var(--skin); margin: 2rem 0; }
.receipt { background: var(--ink); padding: 1.25rem; }
.receipts dl > .receipt-wide { flex-basis: 100%; }
.receipt dt { color: var(--muted); font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.receipt dd { margin: 0.25rem 0 0; }
.figure { display: block; color: var(--pulp); font-size: clamp(2rem, 1.2rem + 3vw, 3.25rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.note { display: block; font-size: 0.9em; margin: 0.35rem 0; }
.check { font-size: 0.85em; }
span.check { color: var(--muted); }
.headers { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 0.8rem; }
.headers li { border: 1px solid var(--skin); padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.85em; }

/* About */
.about-top { display: grid; gap: 1.5rem var(--gap); align-items: center; margin: 1.5rem 0 2.5rem; }
.about img { display: block; width: 100%; max-width: 34rem; height: auto; border-top: 0.5rem solid var(--pulp); }
.about .lead { margin: 0; max-width: 24em; font-size: clamp(1.4rem, 1rem + 1.5vw, 2.2rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; word-spacing: 0.12em; }
.about .even { row-gap: 0; }
@media (min-width: 56rem) {
  .about-top { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

/* Advice */
.advice .facts { margin: 1.5rem 0; font-size: clamp(1.25rem, 1rem + 1.1vw, 2rem); font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
.advice .facts li::before { top: 0.4em; }
@media (min-width: 56rem) {
  .advice .facts { grid-column: 2; grid-row: 2 / span 2; margin: 0; }
}

/* Contact */
.form { max-width: var(--measure); display: grid; gap: 1.25rem; margin-top: 2rem; }
@media (min-width: 56rem) {
  .contact .form { margin-top: 0; }
}
.field { display: grid; gap: 0.35rem; }
label { font-weight: 700; }
input, textarea {
  font: inherit;
  color: var(--pith);
  background: #23102a;
  border: 2px solid var(--muted);
  border-radius: 4px;
  padding: 0.65rem 0.75rem;
  width: 100%;
}
textarea { resize: vertical; min-height: 10rem; }
input:focus-visible, textarea:focus-visible { border-color: var(--pulp); outline-offset: 1px; }
[aria-invalid="true"] { border-color: var(--error); }
.error { color: var(--error); margin: 0; font-weight: 600; }
.error:empty { display: none; }
.status { margin: 0; font-weight: 700; color: var(--error); }
.status:empty { display: none; }
.status.ok { color: var(--ink); background: var(--pulp); padding: 0.75rem 1rem; }
button, .button {
  display: inline-block;
  justify-self: start;
  font: inherit;
  font-weight: 900;
  font-size: 1.15em;
  color: var(--ink);
  background: var(--pulp);
  border: 0;
  border-radius: 4px;
  padding: 0.75rem 2.25rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease-out;
}
:is(button, .button):hover { transform: translateY(-2px); }
:is(button, .button):active { transform: none; }
button[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Pages below the home pages */
.page { max-width: 56rem; }
.page h1 { font-size: clamp(2rem, 1rem + 5vw, 5rem); }
.page :is(section, .marked) { margin-top: 2.5rem; }
.page h2 { font-size: clamp(1.6rem, 1rem + 2.5vw, 2.6rem); margin-bottom: 0.5em; }
.page .facts { margin-bottom: 1em; }
.page .projects { margin: 1rem 0; }
.links li { margin: 0.3rem 0; }
.crumbs { margin-bottom: 1.5rem; color: var(--muted); font-size: 0.9em; }
.crumbs ol { display: flex; flex-wrap: wrap; }
.crumbs li:not(:last-child)::after { content: "/"; padding: 0 0.5em; }
.questions details { padding: 0.9rem 0; border-top: 1px solid var(--skin); }
.questions h3 { font-size: 1.15em; line-height: 1.2; letter-spacing: -0.02em; }
.questions p { margin: 0; }
/* The one part of a plain page that names tools, set apart so nobody has to read it. */
.marked { padding-left: 1.25rem; border-left: 0.5rem solid var(--skin); }
.page .marked h2 { margin: 0; }
.marked .kind { color: var(--muted); }

/* Footer */
.footer {
  padding: 2.5rem var(--gutter) 3rem;
  border-top: 0.5rem solid var(--pulp);
  color: var(--muted);
  font-size: 0.9em;
}
.footer address { font-style: normal; }
.footer ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0 0 1em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (forced-colors: active) {
  .status.ok, .skip, button, .button { border: 2px solid; }
  .versions a[aria-current] { background: Highlight; color: HighlightText; forced-color-adjust: none; }
  .layers { border-left-color: CanvasText; }
}

@media print {
  body { background: #fff; color: #000; }
  .masthead { position: static; }
  .masthead nav, .contact, .skip, .crumbs { display: none; }
}
