/* 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);
  --measure: 40rem;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 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;
  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: 1;
  padding: 0.6em 1em;
  background: var(--pulp);
  color: var(--ink);
  font-weight: 800;
}
.skip:focus { top: 0.5rem; }

/* Masthead */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding: 1.25rem var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  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; }
.masthead ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.9em; }
.masthead nav a { color: var(--pith); text-decoration-color: var(--pulp); }
.masthead nav a:hover { color: var(--pulp); }
.masthead .versions ul { gap: 0; border: 2px solid var(--pulp); border-radius: 4px; }
.masthead .versions a { display: block; padding: 0.3em 0.9em; font-weight: 800; text-decoration: none; }
.masthead .versions a[aria-current] { background: var(--pulp); color: var(--ink); }

/* 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: 1.15em; }

/* Hero */
.hero { border-top: 0; padding-top: clamp(2rem, 6vw, 6rem); }
.hero h1 {
  font-size: clamp(3rem, 13.2vw, 22rem);
  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;
}
.hero .lede {
  margin-top: clamp(1.5rem, 4vw, 3rem);
  max-width: 34rem;
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.6rem);
  line-height: 1.4;
  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); }
}

/* How I build */
.principles { counter-reset: p; display: grid; gap: 1.5rem; max-width: 52rem; }
.principles li {
  counter-increment: p;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  font-size: 1.1em;
}
.principles li::before {
  content: counter(p, decimal-leading-zero);
  color: var(--pulp);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.principles p { margin: 0; }
.principles strong { font-weight: 900; }

/* 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(1.25rem, 3vw, 2.25rem) 0 clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 4vw, 3rem);
  border-bottom: 2px solid var(--ink);
}
.layer:last-child { border-bottom: 0; }
.layer h3 { font-size: clamp(2rem, 0.8rem + 5.5vw, 5.5rem); margin-bottom: 0.25em; }
.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 { display: grid; gap: 0; max-width: 64rem; }
.project { padding: 1.5rem 0; border-top: 1px solid var(--skin); }
.project h3 { font-size: clamp(1.6rem, 1rem + 2.5vw, 2.75rem); margin-bottom: 0.3em; }
.project .kind { color: var(--muted); margin-bottom: 0.5em; }
.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); }
.flagship { border-top: 0.5rem solid var(--pulp); padding: 2rem 0; }
.flagship h3 { font-size: clamp(2.2rem, 1rem + 5vw, 5rem); }
.flagship .facts { display: grid; gap: 0.4rem; }

/* Receipts */
.receipts dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1px; background: var(--skin); border: 1px solid var(--skin); margin: 2rem 0; }
.receipt { background: var(--ink); padding: 1.25rem; }
.receipt-wide { grid-column: 1 / -1; }
.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 p { font-size: 1.15em; max-width: 44rem; }
.about p:first-of-type { font-size: clamp(1.4rem, 1rem + 1.5vw, 2.2rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }

/* Advice */
.advice .facts { margin: 1.5rem 0; font-size: 1.15em; font-weight: 700; }

/* Contact */
.form { max-width: var(--measure); display: grid; gap: 1.25rem; margin-top: 2rem; }
.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 {
  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;
  transition: transform 120ms ease-out;
}
button:hover { transform: translateY(-2px); }
button:active { transform: none; }
button[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Text pages */
.page { max-width: 56rem; }
.page section { margin-top: 2.5rem; }
.page h2 { font-size: clamp(1.6rem, 1rem + 2.5vw, 2.6rem); margin-bottom: 0.5em; }
.links li { margin: 0.3rem 0; }

/* Footer */
.footer {
  padding: 2.5rem var(--gutter) 3rem;
  border-top: 0.5rem solid var(--pulp);
  color: var(--muted);
  font-size: 0.9em;
}
.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 { border: 2px solid; }
  .masthead .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 nav, .contact, .skip { display: none; }
}
