/* Portfolio: Jordan Ames, an invented product designer for developer
   tools. Bone paper, black ink and one pistachio accent. Large light
   Segoe UI for display, Consolas for captions and numbers. Square
   corners, hairline rules and numbered sections, like a printed
   folio. */

.pf-page {
  --pf-night: #141414;
  --pf-on-night: #f8f6f1;
  --pf-pist-deep-text: #365a17;
  --pf-red-text: #b3261e;
  --pf-card: #fff;
  --pf-red-wash: #fbeceb;
  --pf-bone: #eeeae1;
  --pf-paper: #f8f6f1;
  --pf-ink: #141414;
  --pf-muted: #57544c;
  --pf-line: #cdc6b6;
  --pf-pist: #c6de9d;
  --pf-pist-pale: #dcebc4;
  --pf-pist-deep: #365a17;
  --pf-stone: #d9d2c2;
  --pf-char: #23231f;
  --pf-red: #b3261e;
  --pf-coral: #e8765f;
  --pf-display: "Segoe UI Light", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --pf-body: "Segoe UI", system-ui, -apple-system, sans-serif;
  --pf-mono: Consolas, "SF Mono", Menlo, monospace;

  background: var(--pf-bone);
  color: var(--pf-ink);
  font-family: var(--pf-body);
  font-size: 1.0625rem;
}

/* Dark mode, the default: the studio wall at night. Charcoal
   ground, bone type, the black work panels and pistachio kept (PRD section 13.10). Only this template's own tokens
   change; screen only, so print always uses the light palette. */
@media screen {
  :root[data-theme="dark"] .pf-page {
    --pf-night: #050505;
    --pf-pist-deep-text: #b5d98a;
    --pf-red-text: #ff8a80;
    --pf-card: #1a1a17;
    --pf-red-wash: #3a1b19;
    --pf-bone: #121210;
    --pf-paper: #1a1a17;
    --pf-ink: #efece4;
    --pf-muted: #b3ae9f;
    --pf-line: #3a3830;
    --pf-stone: #2a2823;
    color-scheme: dark;
  }
}

.pf-theme-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.pf-theme-btn:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
}

html:has(.pf-page) {
  scroll-behavior: smooth;
}

.pf-page [hidden] {
  display: none !important;
}

:where(.pf-page) p,
:where(.pf-page) h1,
:where(.pf-page) h2,
:where(.pf-page) h3,
:where(.pf-page) ul,
:where(.pf-page) ol,
:where(.pf-page) dl,
:where(.pf-page) dd,
:where(.pf-page) figure,
:where(.pf-page) blockquote,
:where(.pf-page) fieldset {
  margin: 0;
}

:where(.pf-page) ul,
:where(.pf-page) ol {
  padding: 0;
  list-style: none;
}

:where(.pf-page) li {
  margin: 0;
}

:where(.pf-page) h1,
:where(.pf-page) h2,
:where(.pf-page) h3 {
  color: inherit;
}

.pf-page a {
  color: inherit;
}

.pf-page :focus-visible {
  outline: 3px solid var(--pf-ink);
  outline-offset: 3px;
}

.pf-page section[id] {
  scroll-margin-top: 72px;
}

.pf-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.pf-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.pf-caption {
  color: var(--pf-muted);
  font-family: var(--pf-mono);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.pf-section-head {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: baseline;
  gap: var(--space-2) var(--space-6);
  margin-bottom: var(--space-12);
  padding-top: var(--space-4);
  border-top: 1px solid var(--pf-ink);
}

.pf-section-head--tight {
  grid-template-columns: 80px minmax(0, 1fr);
  margin-bottom: var(--space-8);
}

.pf-h2 {
  font-family: var(--pf-display);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.pf-section-note {
  color: var(--pf-muted);
  line-height: 1.55;
}

.pf-h3 {
  margin: var(--space-10) 0 var(--space-4);
  font-family: var(--pf-mono);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.pf-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--pf-bone);
  border-bottom: 1px solid var(--pf-line);
}

.pf-header-in {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  max-width: 1240px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.pf-name {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.pf-name:hover {
  color: var(--pf-ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.pf-avail {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--pf-muted);
  font-family: var(--pf-mono);
  font-size: 0.85rem;
}

.pf-dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pf-pist-deep);
}

.pf-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--pf-pist-deep);
  opacity: 0;
  animation: pf-ping 2.4s ease-out infinite;
}

@keyframes pf-ping {
  0% { opacity: 0.7; transform: scale(0.6); }
  80%, 100% { opacity: 0; transform: scale(1.5); }
}

.pf-nav {
  margin-left: auto;
}

.pf-nav ul {
  display: flex;
  gap: var(--space-6);
}

.pf-nav a {
  display: block;
  padding: var(--space-2) 0;
  font-weight: 600;
  text-decoration: none;
  box-shadow: inset 0 -2px 0 transparent;
  transition: box-shadow var(--transition-fast);
}

.pf-nav a:hover {
  color: var(--pf-ink);
  box-shadow: inset 0 -2px 0 var(--pf-ink);
}

.pf-nav a[aria-current="true"] {
  box-shadow: inset 0 -4px 0 var(--pf-pist);
}

.pf-menu-btn {
  display: none;
}

/* ---------- Hero ---------- */

.pf-hero {
  padding: var(--space-16) 0 var(--space-20);
}

.pf-hero .pf-caption {
  margin-bottom: var(--space-6);
}

.pf-hero-title {
  max-width: 17em;
  font-family: var(--pf-display);
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.pf-hero-title em {
  font-style: normal;
  color: var(--pf-muted);
}

.pf-hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-8) var(--space-16);
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--pf-line);
}

.pf-hero-text {
  max-width: 36em;
  font-size: 1.15rem;
  line-height: 1.6;
}

.pf-facts {
  display: grid;
  gap: 0;
}

.pf-facts div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--pf-line);
}

.pf-facts div:first-child {
  padding-top: 0;
}

.pf-facts dt {
  color: var(--pf-muted);
  font-family: var(--pf-mono);
  font-size: 0.9rem;
}

/* ---------- Work ---------- */

.pf-work {
  padding: var(--space-12) 0 var(--space-16);
}

.pf-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-10);
}

.pf-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--pf-ink);
  border-radius: 0;
  background: transparent;
  color: var(--pf-ink);
  font-family: var(--pf-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.pf-filter:hover {
  background: var(--pf-paper);
}

.pf-filter[aria-pressed="true"] {
  background: var(--pf-night);
  color: var(--pf-on-night);
}

.pf-filter-n {
  font-family: var(--pf-mono);
  font-size: 0.85rem;
  font-weight: 400;
}

.pf-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-16) var(--space-8);
}

.pf-card {
  position: relative;
  grid-column: span 6;
}

.pf-card[data-slot="0"] { grid-column: span 7; }
.pf-card[data-slot="1"] { grid-column: span 5; margin-top: var(--space-16); }
.pf-card[data-slot="2"] { grid-column: span 5; }
.pf-card[data-slot="3"] { grid-column: span 7; margin-top: var(--space-16); }

.pf-thumb {
  position: relative;
  display: grid;
  align-content: center;
  gap: 10px;
  aspect-ratio: 16 / 10;
  padding: 9%;
  overflow: hidden;
  background: var(--pf-stone);
}

.pf-thumb > * {
  transition: transform var(--transition-slow);
}

.pf-card:hover .pf-thumb > *,
.pf-card:focus-within .pf-thumb > * {
  transform: translateY(-6px);
}

.pf-thumb s,
.pf-thumb i,
.pf-thumb b {
  display: block;
  font-style: normal;
  text-decoration: none;
}

.pf-w30 { width: 30%; }
.pf-w35 { width: 35%; }
.pf-w40 { width: 40%; }
.pf-w50 { width: 50%; }
.pf-w55 { width: 55%; }
.pf-w60 { width: 60%; }
.pf-w70 { width: 70%; }
.pf-w80 { width: 80%; }

/* Dashboard thumbnail: a build with a failing step */
.pf-thumb--dash {
  background: var(--pf-char);
}

.pf-t-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.pf-t-bar i {
  flex: 1;
  height: 10px;
  background: var(--pf-pist);
}

.pf-t-bar i.is-fail {
  background: var(--pf-coral);
}

.pf-t-bar i:last-child {
  background: #45453d;
}

.pf-t-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #2d2d28;
}

.pf-t-row b {
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #5b5b52;
}

.pf-t-row b.is-ok { background: var(--pf-pist); }
.pf-t-row b.is-fail { background: var(--pf-coral); }

.pf-t-row s {
  flex: 1;
  height: 7px;
  background: #4a4a42;
}

.pf-t-row.is-focus {
  background: #3a3a33;
  box-shadow: inset 3px 0 0 var(--pf-coral);
}

/* API thumbnail: request and response panes */
.pf-thumb--api {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 12px;
  background: var(--pf-pist);
}

.pf-t-pane {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  background: var(--pf-paper);
}

.pf-t-pane s {
  height: 7px;
  background: #d8d3c6;
}

.pf-t-pane s.is-key { background: var(--pf-night); }

.pf-t-pane.is-dark {
  background: var(--pf-night);
}

.pf-t-pane.is-dark s { background: #3d3d38; }
.pf-t-pane.is-dark s.is-ok { background: var(--pf-pist); }

.pf-t-send {
  position: absolute;
  left: 9%;
  bottom: 9%;
  padding: 4px 12px;
  background: var(--pf-night);
  color: var(--pf-on-night);
  font-family: var(--pf-mono);
  font-size: 0.8rem;
}

/* Onboarding thumbnail: three steps and a form */
.pf-thumb--onb,
.pf-thumb--invite {
  justify-items: center;
  gap: 16px;
}

.pf-thumb--invite {
  background: var(--pf-pist-pale);
}

.pf-t-steps {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pf-t-steps i {
  width: 36px;
  height: 6px;
  background: #b9b19f;
}

.pf-t-steps i.is-done { background: var(--pf-night); }
.pf-t-steps i.is-now { background: var(--pf-pist-deep); }

.pf-t-card {
  display: grid;
  gap: 10px;
  width: 64%;
  padding: 18px;
  background: var(--pf-paper);
  box-shadow: 6px 6px 0 var(--pf-ink);
}

.pf-t-card s {
  height: 7px;
  background: #d8d3c6;
}

.pf-t-card s:first-child {
  height: 10px;
  background: var(--pf-night);
}

.pf-t-card s.is-field {
  height: 20px;
  border: 1px solid #b9b19f;
  background: transparent;
}

.pf-t-card s.is-btn {
  height: 20px;
  background: var(--pf-pist-deep);
}

/* Timeline thumbnail: events on either side of a line */
.pf-thumb--time {
  display: block;
  background: var(--pf-paper);
  box-shadow: inset 0 0 0 1px var(--pf-line);
}

.pf-t-line {
  position: absolute;
  left: 50%;
  top: 12%;
  bottom: 12%;
  width: 2px;
  background: var(--pf-night);
}

.pf-t-event {
  position: absolute;
  height: 13%;
  background: var(--pf-stone);
}

.pf-t-event::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--pf-night);
}

.pf-t-event.is-a { top: 14%; right: calc(50% + 18px); width: 30%; }
.pf-t-event.is-b { top: 33%; left: calc(50% + 18px); width: 24%; background: var(--pf-pist); }
.pf-t-event.is-c { top: 52%; right: calc(50% + 18px); width: 22%; background: var(--pf-coral); }
.pf-t-event.is-d { top: 71%; left: calc(50% + 18px); width: 32%; }

.pf-t-event.is-a::before,
.pf-t-event.is-c::before { right: -23px; }
.pf-t-event.is-b::before,
.pf-t-event.is-d::before { left: -23px; }

/* Command-line thumbnail */
.pf-thumb--cli {
  background: var(--pf-night);
}

.pf-t-term {
  display: grid;
  gap: 12px;
}

.pf-t-term s {
  height: 8px;
  background: #3d3d38;
}

.pf-t-term s.is-prompt { background: var(--pf-pist); }
.pf-t-term s.is-err { background: var(--pf-coral); }
.pf-t-term s.is-hint { background: var(--pf-stone); }

/* Invite thumbnail: faces joining */
.pf-t-faces {
  display: flex;
}

.pf-t-faces i {
  width: 40px;
  height: 40px;
  margin-left: -10px;
  border: 3px solid var(--pf-pist-pale);
  border-radius: 50%;
  background: var(--pf-night);
}

.pf-t-faces i:first-child { margin-left: 0; }
.pf-t-faces i:nth-child(2) { background: var(--pf-pist-deep); }
.pf-t-faces i:nth-child(3) { background: #8a8270; }

.pf-t-faces i.is-add {
  display: grid;
  place-items: center;
  border: 2px dashed var(--pf-ink);
  background: var(--pf-paper);
  color: var(--pf-ink);
  font-family: var(--pf-mono);
  font-size: 1.2rem;
}

.pf-card-body {
  padding-top: var(--space-4);
}

.pf-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
  color: var(--pf-muted);
  font-family: var(--pf-mono);
  font-size: 0.88rem;
}

.pf-card-meta span:first-child {
  color: var(--pf-ink);
}

.pf-card-title {
  font-family: var(--pf-display);
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.pf-open {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

/* The title button covers the whole card, so the picture is a target too. */
.pf-open::after {
  content: "";
  position: absolute;
  inset: 0;
}

.pf-open:focus-visible {
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.pf-open:focus-visible::after {
  outline: 3px solid var(--pf-ink);
  outline-offset: 6px;
}

.pf-card:hover .pf-open {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.pf-card-result {
  margin-top: var(--space-2);
  color: var(--pf-muted);
  line-height: 1.5;
}

.pf-card-result::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: var(--space-2);
  background: var(--pf-pist-deep);
  vertical-align: 0;
}

/* ---------- Approach ---------- */

.pf-approach {
  padding: var(--space-12) 0 var(--space-16);
}

.pf-principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--space-12);
}

.pf-principle {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: var(--space-2) var(--space-4);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--pf-line);
}

.pf-principle:nth-child(2) { transition-delay: 90ms; }
.pf-principle:nth-child(4) { transition-delay: 90ms; }

.pf-p-n {
  grid-row: span 2;
  color: var(--pf-pist-deep-text);
  font-family: var(--pf-mono);
  font-size: 1.05rem;
}

.pf-principle h3 {
  font-family: var(--pf-display);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.15;
}

.pf-principle p {
  max-width: 34em;
  color: var(--pf-muted);
  line-height: 1.6;
}

/* ---------- About ---------- */

.pf-about {
  padding: var(--space-12) 0 var(--space-16);
}

.pf-about-in {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-12);
  align-items: start;
}

.pf-portrait {
  position: sticky;
  top: 96px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--pf-pist);
}

.pf-portrait-sun {
  position: absolute;
  right: 12%;
  top: 10%;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--pf-paper);
}

.pf-portrait-head {
  position: absolute;
  left: 32%;
  top: 30%;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--pf-night);
}

.pf-portrait-body {
  position: absolute;
  left: 16%;
  right: 18%;
  bottom: 0;
  height: 32%;
  border-radius: 50% 50% 0 0 / 70% 70% 0 0;
  background: var(--pf-night);
}

.pf-portrait-tag {
  position: absolute;
  left: 16px;
  top: 14px;
  color: var(--pf-ink);
  font-family: var(--pf-mono);
  font-size: 0.85rem;
}

.pf-about-copy > p {
  max-width: 38em;
  margin-bottom: var(--space-4);
  line-height: 1.65;
}

.pf-about-copy > .pf-about-lede {
  margin-bottom: var(--space-6);
  font-family: var(--pf-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.pf-cv li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--pf-line);
}

.pf-cv li:last-child {
  border-bottom: 1px solid var(--pf-line);
}

.pf-cv-when {
  color: var(--pf-muted);
  font-family: var(--pf-mono);
  font-size: 0.9rem;
  line-height: 1.8;
}

/* ---------- Quotes ---------- */

.pf-words {
  padding: 0 0 var(--space-16);
}

.pf-quotes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-12);
}

.pf-quote {
  padding-left: var(--space-6);
  border-left: 4px solid var(--pf-pist);
}

.pf-quote blockquote {
  margin: 0 0 var(--space-4);
  padding: 0;
  border: 0;
  background: none;
}

.pf-quote blockquote p {
  font-family: var(--pf-display);
  font-size: clamp(1.25rem, 1.9vw, 1.55rem);
  font-weight: 300;
  line-height: 1.35;
}

.pf-quote figcaption {
  color: var(--pf-muted);
  font-size: 0.95rem;
}

.pf-quote figcaption strong {
  color: var(--pf-ink);
}

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

.pf-contact {
  padding: var(--space-16) 0;
  background: var(--pf-night);
  color: var(--pf-on-night);
}

.pf-contact :focus-visible {
  outline-color: var(--pf-pist);
}

.pf-contact-in {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-12);
  align-items: start;
}

.pf-contact .pf-caption {
  margin-bottom: var(--space-6);
  color: #b3ad9f;
}

.pf-contact-title {
  margin-bottom: var(--space-6);
  font-family: var(--pf-display);
  font-size: clamp(2.2rem, 4.4vw, 3.8rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.pf-contact-text {
  max-width: 30em;
  margin-bottom: var(--space-8);
  color: #d4cfc3;
  line-height: 1.6;
}

.pf-email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
}

.pf-email-link {
  font-family: var(--pf-display);
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 300;
  text-decoration: underline;
  text-decoration-color: var(--pf-pist);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  overflow-wrap: anywhere;
}

.pf-page .pf-email-link:hover {
  color: var(--pf-pist);
}

.pf-copy {
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--pf-bone);
  border-radius: 0;
  background: transparent;
  color: var(--pf-on-night);
  font-family: var(--pf-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.pf-copy:hover {
  background: var(--pf-bone);
  color: var(--pf-ink);
}

.pf-copy-status {
  min-height: 1.5em;
  margin-top: var(--space-3);
  color: var(--pf-pist);
  font-family: var(--pf-mono);
  font-size: 0.9rem;
}

.pf-form-wrap {
  padding: var(--space-8);
  background: var(--pf-paper);
  color: var(--pf-ink);
}

.pf-form-wrap :focus-visible {
  outline-color: var(--pf-ink);
}

.pf-field {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  padding: 0;
  border: 0;
  min-width: 0;
}

.pf-label {
  padding: 0;
  font-weight: 600;
}

.pf-hint {
  color: var(--pf-muted);
  font-size: 0.95rem;
}

.pf-page .pf-input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--pf-ink);
  border-radius: 0;
  background: var(--pf-card);
  color: var(--pf-ink);
  font: inherit;
}

.pf-page .pf-input:focus-visible {
  outline: 3px solid var(--pf-ink);
  outline-offset: 2px;
}

.pf-page .pf-input[aria-invalid="true"] {
  border: 2px solid var(--pf-red);
}

.pf-page .pf-textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}

.pf-count {
  color: var(--pf-muted);
  font-family: var(--pf-mono);
  font-size: 0.85rem;
  text-align: right;
}

.pf-error {
  color: var(--pf-red-text);
  font-size: 0.95rem;
  font-weight: 600;
}

.pf-kind-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.pf-kind {
  position: relative;
  display: block;
  cursor: pointer;
}

.pf-kind input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.pf-kind span {
  display: grid;
  gap: 2px;
  height: 100%;
  padding: var(--space-3);
  border: 1px solid var(--pf-ink);
  background: var(--pf-card);
  font-weight: 600;
  line-height: 1.3;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.pf-kind small {
  color: var(--pf-muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.pf-kind:hover span {
  background: var(--pf-bone);
}

.pf-kind input:checked + span {
  background: var(--pf-night);
  color: var(--pf-on-night);
  box-shadow: inset 0 -5px 0 var(--pf-pist);
}

.pf-kind input:checked + span small {
  color: #d4cfc3;
}

.pf-kind input:focus-visible + span {
  outline: 3px solid var(--pf-ink);
  outline-offset: 2px;
}

.pf-kinds:has([aria-invalid="true"]) .pf-kind span {
  border-color: var(--pf-red);
}

.pf-errors {
  margin-bottom: var(--space-6);
  padding: var(--space-4) var(--space-5);
  border-left: 5px solid var(--pf-red);
  background: var(--pf-red-wash);
  scroll-margin-top: 90px;
}

.pf-errors-title {
  margin-bottom: var(--space-2);
  font-size: 1.05rem;
}

.pf-errors ul {
  display: grid;
  gap: var(--space-1);
}

.pf-errors a {
  color: var(--pf-red-text);
  font-weight: 600;
}

.pf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
}

.pf-submit,
.pf-again {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 50px;
  padding: 0 var(--space-6);
  border: 0;
  border-radius: 0;
  background: var(--pf-night);
  color: var(--pf-on-night);
  font-family: var(--pf-body);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 -5px 0 var(--pf-pist);
  transition: box-shadow var(--transition-fast);
}

.pf-submit:hover,
.pf-again:hover {
  box-shadow: inset 0 -50px 0 var(--pf-pist);
  color: var(--pf-ink);
}

.pf-submit:disabled {
  cursor: progress;
}

.pf-submit.is-busy::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: pf-spin 0.8s linear infinite;
}

@keyframes pf-spin {
  to { transform: rotate(360deg); }
}

.pf-demo {
  color: var(--pf-muted);
  font-size: 0.95rem;
}

.pf-thanks {
  display: grid;
  gap: var(--space-4);
  justify-items: start;
}

.pf-thanks-title {
  font-family: var(--pf-display);
  font-size: 2rem;
  font-weight: 300;
  line-height: 1.1;
  scroll-margin-top: 90px;
}

.pf-thanks p {
  line-height: 1.6;
}

.pf-status:not(:empty) {
  padding: var(--space-3) var(--space-4);
  border-left: 5px solid var(--pf-pist-deep);
  background: var(--pf-pist-pale);
}

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

.pf-footer {
  padding: var(--space-8) 0;
  background: var(--pf-night);
  color: #d4cfc3;
  border-top: 1px solid #3a3a34;
}

.pf-footer :focus-visible {
  outline-color: var(--pf-pist);
}

.pf-footer-in {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: 0.95rem;
}

.pf-top {
  color: var(--pf-on-night);
  font-weight: 600;
}

.pf-page .pf-top:hover {
  color: var(--pf-pist);
}

/* ---------- Case study dialog ---------- */

.pf-dialog {
  width: min(780px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--pf-ink);
  border-radius: 0;
  background: var(--pf-paper);
  color: var(--pf-ink);
  box-shadow: 14px 14px 0 rgba(20, 20, 20, 0.35);
}

.pf-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: pf-rise var(--transition-slow) ease both;
}

.pf-dialog::backdrop {
  background: rgba(20, 20, 20, 0.62);
}

@keyframes pf-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.pf-dialog :focus-visible {
  outline: 3px solid var(--pf-ink);
  outline-offset: 3px;
}

.pf-dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-8);
  border-bottom: 1px solid var(--pf-line);
}

.pf-close,
.pf-step {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--pf-ink);
  border-radius: 0;
  background: transparent;
  color: var(--pf-ink);
  font-family: var(--pf-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.pf-close:hover,
.pf-step:hover:not(:disabled) {
  background: var(--pf-night);
  color: var(--pf-on-night);
}

.pf-step:disabled {
  border-color: var(--pf-line);
  color: #8f8a7e;
  cursor: default;
}

.pf-dialog-body {
  flex: 1;
  min-height: 0;
  padding: var(--space-8);
  overflow-y: auto;
}

.pf-case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.pf-case-meta span {
  padding: 2px 10px;
  border: 1px solid var(--pf-line);
  font-family: var(--pf-mono);
  font-size: 0.85rem;
}

.pf-case-title {
  margin-bottom: var(--space-4);
  font-family: var(--pf-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.pf-case-lede {
  margin-bottom: var(--space-6);
  font-size: 1.12rem;
  line-height: 1.6;
}

.pf-dialog-body h3 {
  margin: var(--space-6) 0 var(--space-3);
  font-family: var(--pf-mono);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pf-case-list {
  display: grid;
  gap: var(--space-3);
}

.pf-case-list li {
  position: relative;
  padding-left: var(--space-6);
  line-height: 1.55;
}

.pf-case-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  background: var(--pf-pist-deep);
}

.pf-case-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.pf-case-stats div {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-5);
  border-top: 4px solid var(--pf-pist);
  background: var(--pf-bone);
}

.pf-case-stats dt {
  order: 2;
  color: var(--pf-muted);
  font-size: 0.95rem;
}

.pf-case-stats dd {
  order: 1;
  font-family: var(--pf-display);
  font-size: 2.6rem;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.pf-case-stats dd.pf-was {
  order: 3;
  margin-top: var(--space-1);
  color: var(--pf-muted);
  font-family: var(--pf-mono);
  font-size: 0.85rem;
  letter-spacing: 0;
}

.pf-case-team {
  margin-top: var(--space-6);
  color: var(--pf-muted);
  font-size: 0.95rem;
}

.pf-dialog-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-8);
  border-top: 1px solid var(--pf-line);
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .pf-section-head {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .pf-section-note {
    grid-column: 2;
    max-width: 40em;
  }
}

@media (max-width: 900px) {
  .pf-hero-foot,
  .pf-about-in,
  .pf-contact-in {
    grid-template-columns: minmax(0, 1fr);
  }

  .pf-card[data-slot] {
    grid-column: span 6;
    margin-top: 0;
  }

  .pf-portrait {
    position: relative;
    top: 0;
    max-width: 360px;
    aspect-ratio: 5 / 4;
  }

  .pf-principles {
    gap: 0 var(--space-8);
  }
}

@media (max-width: 760px) {
  .pf-header {
    position: static;
  }

  .pf-page section[id] {
    scroll-margin-top: 12px;
  }

  .pf-errors,
  .pf-thanks-title {
    scroll-margin-top: 12px;
  }

  .pf-header-in {
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    padding: var(--space-3) var(--space-5);
  }

  .pf-avail {
    order: 3;
    width: 100%;
  }

  .pf-menu-btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-left: auto;
    padding: 0 var(--space-4);
    border: 1px solid var(--pf-ink);
    border-radius: 0;
    background: transparent;
    color: var(--pf-ink);
    font-family: var(--pf-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
  }

  .pf-menu-btn[aria-expanded="true"] {
    background: var(--pf-night);
    color: var(--pf-on-night);
  }

  .pf-nav {
    display: none;
    order: 4;
    width: 100%;
    margin: 0;
  }

  .pf-nav.is-open {
    display: block;
  }

  .pf-nav ul {
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--pf-line);
  }

  .pf-nav a {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--pf-line);
  }

  .pf-wrap {
    padding: 0 var(--space-5);
  }

  .pf-hero {
    padding: var(--space-10) 0 var(--space-12);
  }

  .pf-grid {
    gap: var(--space-12) var(--space-5);
  }

  .pf-principles,
  .pf-quotes {
    grid-template-columns: minmax(0, 1fr);
  }

  .pf-quotes {
    gap: var(--space-8);
  }
}

@media (max-width: 560px) {
  .pf-section-head {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-8);
  }

  .pf-section-note {
    grid-column: auto;
  }

  .pf-card[data-slot] {
    grid-column: span 12;
  }

  .pf-principle {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: var(--space-6) 0;
  }

  .pf-principle h3 {
    font-size: 1.35rem;
  }

  .pf-cv li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .pf-facts div {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .pf-kind-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .pf-form-wrap {
    margin: 0 calc(var(--space-5) * -1);
    padding: var(--space-6) var(--space-5);
  }

  .pf-contact {
    padding: var(--space-12) 0 0;
  }

  .pf-dialog {
    width: 100%;
    max-width: none;
    max-height: 100%;
    height: 100%;
    border: 0;
    box-shadow: none;
  }

  .pf-dialog-bar {
    padding-left: var(--space-5);
  }

  .pf-dialog-body {
    padding: var(--space-6) var(--space-5);
  }

  .pf-dialog-nav {
    padding: var(--space-3) var(--space-5);
  }

  .pf-case-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .pf-case-stats dd {
    font-size: 2.2rem;
  }
}

@media (max-width: 380px) {
  .pf-wrap {
    padding: 0 var(--space-4);
  }

  .pf-header-in {
    padding: var(--space-3) var(--space-4);
  }

  .pf-form-wrap {
    margin: 0 calc(var(--space-4) * -1);
    padding: var(--space-5) var(--space-4);
  }

  .pf-filter {
    padding: 0 var(--space-3);
  }

  .pf-step {
    padding: 0 var(--space-3);
  }
}

@media (prefers-reduced-motion: reduce) {
  html:has(.pf-page) {
    scroll-behavior: auto;
  }

  .pf-dot::after {
    animation: none;
  }

  .pf-dialog[open] {
    animation: none;
  }

  .pf-thumb > * {
    transition: none;
  }

  .pf-card:hover .pf-thumb > *,
  .pf-card:focus-within .pf-thumb > * {
    transform: none;
  }

  .pf-page .fade-in-up {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .pf-page .fade-in-up {
    opacity: 1;
    transform: none;
  }

  .pf-header {
    position: static;
  }
}

/* Keep the page still behind an open case study. */
html:has(.pf-dialog[open]) {
  overflow: hidden;
}
