/* Public portfolio. Everything is scoped to body.pf-body so the private site is untouched. */

body.pf-body {
  --pf-bg: #0a0a0b;
  --pf-bg-2: #111113;
  --pf-panel: #141416;
  --pf-line: #24242a;
  --pf-line-2: #34343c;
  --pf-text: #f1efe9;
  --pf-muted: #a19f99;
  --pf-faint: #6b6a66;
  --pf-accent: #d4ff4f;
  --pf-accent-ink: #10130a;
  --pf-violet: #a78bfa;
  --pf-serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --pf-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pf-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  background: var(--pf-bg);
  color: var(--pf-text);
  font-family: var(--pf-sans);
  font-size: 16.5px;
  line-height: 1.65;
  color-scheme: dark;
}

body.pf-body ::selection {
  background: var(--pf-accent);
  color: var(--pf-accent-ink);
}

.pf-body .pf-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: clamp(20px, 5vw, 56px);
}

.pf-body em {
  font-family: var(--pf-serif);
  font-style: italic;
  font-weight: 400;
}

.pf-body .pf-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pf-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pf-muted);
  margin: 0;
}

.pf-body .pf-num {
  font-family: var(--pf-mono);
  color: var(--pf-accent);
}

/* Header */

.pf-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: linear-gradient(to bottom, rgba(10, 10, 11, 0.85), rgba(10, 10, 11, 0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pf-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.pf-brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.pf-brand em {
  font-size: 18px;
}

.pf-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}

.pf-nav a {
  color: var(--pf-muted);
  transition: color 0.2s;
}

.pf-nav a:hover {
  color: var(--pf-text);
}

.pf-nav .pf-pill {
  color: var(--pf-text);
  padding: 7px 14px;
  border: 1px solid var(--pf-line-2);
  border-radius: 999px;
  transition: border-color 0.2s, background 0.2s;
}

.pf-nav .pf-pill:hover {
  border-color: var(--pf-text);
}

/* Buttons */

.pf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.pf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--pf-line-2);
  background: transparent;
  color: var(--pf-text);
  font: 500 15px var(--pf-sans);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.pf-btn:hover {
  border-color: var(--pf-text);
  transform: translateY(-1px);
}

.pf-btn-solid {
  background: var(--pf-accent);
  border-color: var(--pf-accent);
  color: var(--pf-accent-ink);
}

.pf-btn-solid:hover {
  border-color: var(--pf-accent);
  background: #e2ff86;
}

.pf-btn .card-arrow {
  color: inherit;
}

/* Hero */

.pf-hero {
  position: relative;
  padding: 128px 0 88px;
  overflow: hidden;
  border-bottom: 1px solid var(--pf-line);
}

.pf-hero::before {
  /* faint grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--pf-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--pf-line) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.45;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 20%, transparent 75%);
}

.pf-glow {
  position: absolute;
  width: 760px;
  height: 760px;
  right: -180px;
  top: -260px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(212, 255, 79, 0.22), rgba(167, 139, 250, 0.12) 45%, transparent 70%);
  filter: blur(20px);
  animation: pf-drift 14s ease-in-out infinite alternate;
}

@keyframes pf-drift {
  to {
    transform: translate(-80px, 60px) scale(1.08);
  }
}

.pf-hero .pf-wrap {
  position: relative;
}

.pf-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pf-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pf-muted);
  margin: 0 0 28px;
}

.pf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pf-accent);
  box-shadow: 0 0 0 0 rgba(212, 255, 79, 0.6);
  animation: pf-pulse 2.4s infinite;
}

@keyframes pf-pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(212, 255, 79, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(212, 255, 79, 0);
  }
}

.pf-title {
  font-family: var(--pf-sans);
  font-weight: 600;
  font-size: clamp(48px, 7.5vw, 96px);
  line-height: 0.9;
  letter-spacing: -0.055em;
  margin: 0;
}

.pf-title em {
  letter-spacing: -0.02em;
  color: var(--pf-accent);
}

.pf-lede {
  max-width: 36ch;
  margin-top: 32px;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.35;
  color: var(--pf-muted);
}

/* Index */

.pf-index {
  padding-block: 96px 64px;
}

.pf-index ol {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  border-top: 1px solid var(--pf-line);
}

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

.pf-index button {
  width: 100%;
  display: grid;
  grid-template-columns: 56px 1fr auto 24px;
  align-items: center;
  gap: 16px;
  padding: 22px 4px;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pf-index-name {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 500;
  letter-spacing: -0.025em;
  transition: transform 0.3s, color 0.3s;
}

.pf-index-kicker {
  font-family: var(--pf-mono);
  font-size: 12.5px;
  color: var(--pf-faint);
}

.pf-index .card-arrow {
  color: var(--pf-faint);
  transition: transform 0.3s, color 0.3s;
}

.pf-index button:hover .pf-index-name {
  transform: translateX(8px);
  color: var(--pf-accent);
}

.pf-index button:hover .card-arrow {
  color: var(--pf-accent);
  transform: translateX(4px);
}

/* Projects */

.pf-project {
  padding-block: 112px;
  border-top: 1px solid var(--pf-line);
  scroll-margin-top: 40px;
}

.pf-project-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(32px, 6vw, 96px);
  row-gap: 56px;
  align-items: start;
}

.pf-project-meta {
  position: sticky;
  top: 100px;
}

.pf-project-meta h2 {
  font-size: clamp(40px, 5.4vw, 68px);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.045em;
  margin: 18px 0 18px;
}

.pf-tagline {
  font-family: var(--pf-serif);
  font-style: italic;
  font-size: clamp(21px, 2.2vw, 26px);
  line-height: 1.3;
  color: var(--pf-muted);
  margin: 0;
}

.pf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.pf-tags span {
  font-family: var(--pf-mono);
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--pf-line-2);
  color: var(--pf-muted);
  white-space: nowrap;
}

.pf-project-body p {
  margin: 0 0 1.1em;
  max-width: 62ch;
  color: #d6d4cd;
}

.pf-project-body .pf-actions {
  margin-top: 28px;
}

.pf-project-visual {
  grid-column: 2;
}

/* Little Brother gets the full width for its diagram */
.pf-project.wide .pf-project-meta {
  position: static;
}

.pf-project.wide .pf-project-visual {
  grid-column: 1 / -1;
}

.pf-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 36px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--pf-line);
}

.pf-stat strong {
  font-family: var(--pf-serif);
  font-weight: 400;
  font-size: clamp(72px, 10vw, 128px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--pf-accent);
}

.pf-stat span {
  font-family: var(--pf-mono);
  font-size: 13px;
  color: var(--pf-muted);
}

/* Reveal on scroll */

.pf-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pf-reveal.in {
  opacity: 1;
  transform: none;
}

.pf-project-body.pf-reveal {
  transition-delay: 0.1s;
}

/* Shared figure styles */

.pf-viz {
  margin: 0;
  padding: 28px;
  border: 1px solid var(--pf-line);
  border-radius: 20px;
  background: linear-gradient(180deg, var(--pf-panel), var(--pf-bg-2));
}

.pf-viz figcaption {
  margin-top: 20px;
  font-size: 14px;
  color: var(--pf-faint);
}

.pf-body .chip {
  font-family: var(--pf-mono);
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--pf-line-2);
  background: var(--pf-bg);
  white-space: nowrap;
}

.pf-body .chip.strong {
  border-color: var(--pf-accent);
  color: var(--pf-accent);
}

/* Little Brother diagram */

.lb {
  margin: 0;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--pf-line);
  border-radius: 24px;
  background:
    radial-gradient(ellipse 60% 50% at 30% 50%, rgba(212, 255, 79, 0.05), transparent 70%),
    linear-gradient(180deg, var(--pf-panel), var(--pf-bg-2));
}

.lb-queries {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.lb-queries .pf-label {
  margin-right: 8px;
}

.lb-queries button {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--pf-line-2);
  background: var(--pf-bg);
  color: var(--pf-muted);
  font: 14px var(--pf-sans);
  cursor: pointer;
  transition: all 0.2s;
}

.lb-queries button::before {
  content: "“";
}

.lb-queries button::after {
  content: "”";
}

.lb-queries button:hover {
  color: var(--pf-text);
  border-color: var(--pf-faint);
}

.lb-queries button[aria-pressed="true"] {
  background: var(--pf-accent);
  border-color: var(--pf-accent);
  color: var(--pf-accent-ink);
}

.lb-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--pf-sans);
}

.lb-tall {
  display: none;
  max-width: 420px;
  margin: 0 auto;
}

@media (max-width: 700px) {
  .lb-wide {
    display: none;
  }

  .lb-tall {
    display: block;
  }
}

.lb-edge {
  fill: none;
  stroke: var(--pf-line-2);
  stroke-width: 1.5;
  transition: stroke 0.4s;
}

.lb-edge.on {
  stroke: rgba(212, 255, 79, 0.35);
}

.lb-flow {
  fill: none;
  stroke: var(--pf-accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 3 13;
  opacity: 0;
  transition: opacity 0.4s;
  animation: lb-flow 0.9s linear infinite;
}

.lb-flow.on {
  opacity: 1;
}

@keyframes lb-flow {
  to {
    stroke-dashoffset: -16;
  }
}

.lb-voice-ring {
  fill: none;
  stroke: var(--pf-accent);
  stroke-width: 1;
  opacity: 0.4;
  transform-box: fill-box;
  transform-origin: center;
  animation: lb-ring 2.4s ease-out infinite;
}

@keyframes lb-ring {
  from {
    transform: scale(0.8);
    opacity: 0.6;
  }
  to {
    transform: scale(1.3);
    opacity: 0;
  }
}

.lb-voice-core {
  fill: var(--pf-accent);
}

.lb-mic {
  fill: none;
  stroke: var(--pf-accent-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lb-cap {
  font-family: var(--pf-mono);
  font-size: 12px;
  fill: var(--pf-muted);
}

.lb-node {
  cursor: pointer;
  outline: none;
  opacity: 0.4;
  transition: opacity 0.35s;
}

.lb-node:hover,
.lb-node:focus-visible {
  opacity: 0.85;
}

.lb-node rect {
  fill: var(--pf-bg);
  stroke: var(--pf-line-2);
  stroke-width: 1.2;
  transition: stroke 0.35s, fill 0.35s;
}

.lb-node.on {
  opacity: 1;
}

.lb-node.on rect {
  stroke: rgba(212, 255, 79, 0.55);
}

.lb-node.target rect {
  fill: var(--pf-accent);
  stroke: var(--pf-accent);
}

.lb-node.target text {
  fill: var(--pf-accent-ink);
}

.lb-root rect {
  fill: #18181b;
}

.lb-node:focus-visible rect {
  stroke: var(--pf-text);
}

.lb-t,
.lb-t-big {
  fill: var(--pf-text);
  font-weight: 500;
  font-size: 14px;
}

.lb-t-big {
  font-size: 17px;
  font-weight: 600;
}

.lb-t-sub {
  fill: var(--pf-muted);
  font-family: var(--pf-mono);
  font-size: 11px;
}

.lb-doc path:first-child {
  fill: var(--pf-bg-2);
  stroke: var(--pf-line-2);
  stroke-width: 1.2;
  transition: fill 0.35s, stroke 0.35s;
}

.lb-doc-lines {
  fill: none;
  stroke: var(--pf-faint);
  stroke-width: 1.3;
  stroke-linecap: round;
}

.lb-node.on .lb-doc path:first-child {
  fill: var(--pf-accent);
  stroke: var(--pf-accent);
}

.lb-node.on .lb-doc-lines {
  stroke: var(--pf-accent-ink);
}

.lb-node.target .lb-doc path:first-child {
  fill: var(--pf-bg);
}

.lb-node.target .lb-doc-lines {
  stroke: var(--pf-accent);
}

.lb-meter {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--pf-line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
}

.lb-meter-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.lb-meter-text {
  margin: 0;
  font-size: 15px;
  color: var(--pf-muted);
}

.lb-meter-text strong {
  color: var(--pf-text);
  font-weight: 600;
}

.lb-cells {
  display: flex;
  gap: 4px;
}

.lb-cells span {
  width: 14px;
  height: 8px;
  border-radius: 3px;
  background: var(--pf-line-2);
  transition: background 0.3s;
}

.lb-cells span.on {
  background: var(--pf-accent);
}

.lb-files {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lb-files code {
  font-family: var(--pf-mono);
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--pf-bg);
  border: 1px solid var(--pf-line-2);
  color: var(--pf-accent);
}

.lb-arrow {
  color: var(--pf-faint);
}

/* Diary visual */

.diary-table {
  font-family: var(--pf-mono);
  font-size: 12px;
  border: 1px solid var(--pf-line);
  border-radius: 12px;
  overflow: hidden;
}

.diary-row {
  display: grid;
  grid-template-columns: 1fr 0.8fr 1.6fr 1.2fr;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--pf-line);
}

.diary-head {
  border-top: 0;
  background: var(--pf-bg);
  color: var(--pf-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.diary-bar {
  display: block;
  height: 9px;
  border-radius: 3px;
  background: var(--pf-line-2);
}

.diary-mood {
  display: block;
  height: 9px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--pf-accent) var(--m), var(--pf-line) var(--m));
}

.diary-empty {
  font-style: normal;
  color: var(--pf-faint);
}

.diary-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.diary-route .arrow,
.diary-route .plus {
  color: var(--pf-faint);
}

/* Encrage visual */

.enc-flow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.enc-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  min-width: 92px;
}

.enc-end strong {
  font-size: 14px;
  font-weight: 500;
  margin-top: 6px;
}

.enc-end span {
  font-family: var(--pf-mono);
  font-size: 11.5px;
  color: var(--pf-faint);
}

.enc-icon {
  fill: none;
  stroke: var(--pf-text);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.enc-track {
  position: relative;
  height: 40px;
  border-radius: 999px;
  border: 1px dashed var(--pf-line-2);
  overflow: hidden;
}

.enc-track i {
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 4px;
  animation: enc-move 2.7s linear infinite;
  animation-delay: var(--d);
  opacity: 0;
}

@keyframes enc-move {
  0% {
    left: 2%;
    opacity: 0;
    background: var(--pf-text);
    transform: rotate(0deg);
  }
  8% {
    opacity: 1;
  }
  22% {
    background: var(--pf-text);
    transform: rotate(0deg);
  }
  30% {
    background: var(--pf-violet);
    transform: rotate(45deg) scale(0.9);
  }
  92% {
    opacity: 1;
  }
  100% {
    left: calc(98% - 16px);
    opacity: 0;
    background: var(--pf-violet);
    transform: rotate(45deg) scale(0.9);
  }
}

/* Pompa visual */

.pompa {
  display: grid;
  grid-template-columns: auto 64px 1fr;
  align-items: center;
  gap: 4px 12px;
}

.pompa-sources {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pompa-merge {
  height: 72px;
  border: 1.5px solid var(--pf-line-2);
  border-left: 0;
  border-radius: 0 18px 18px 0;
  position: relative;
}

.pompa-merge::after {
  content: "";
  position: absolute;
  right: -46px;
  top: 50%;
  width: 40px;
  border-top: 1.5px solid var(--pf-accent);
}

.pompa-out {
  padding-left: 52px;
  display: flex;
  flex-direction: column;
}

.pompa-out em {
  font-size: 40px;
  line-height: 1;
  color: var(--pf-accent);
}

.pompa-out span {
  font-size: 14px;
  color: var(--pf-muted);
  margin-top: 6px;
}

/* Toolkit */

.pf-toolkit {
  padding-block: 112px;
  border-top: 1px solid var(--pf-line);
}

.pf-toolkit-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(32px, 6vw, 96px);
  padding: 32px 0;
  border-bottom: 1px solid var(--pf-line);
}

.pf-toolkit-row:first-of-type {
  margin-top: 24px;
  border-top: 1px solid var(--pf-line);
}

.pf-toolkit-row h3 {
  margin: 0 0 16px;
  font-family: var(--pf-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
}

.pf-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pf-tiles span {
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--pf-panel);
  border: 1px solid var(--pf-line);
  font-size: 15px;
  transition: border-color 0.2s, color 0.2s;
}

.pf-tiles span:hover {
  border-color: var(--pf-accent);
  color: var(--pf-accent);
}

/* Footer */

.pf-footer {
  padding-block: 64px calc(80px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--pf-line);
  background: radial-gradient(ellipse 60% 80% at 50% 120%, rgba(212, 255, 79, 0.1), transparent 70%);
}

.pf-footer-title {
  margin: 0;
  font-size: clamp(48px, 9vw, 120px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.pf-footer-title em {
  color: var(--pf-accent);
  letter-spacing: -0.02em;
}

/* Responsive */

@media (max-width: 860px) {
  .pf-project-grid,
  .pf-toolkit-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .pf-project-grid {
    row-gap: 36px;
  }

  .pf-project-meta {
    position: static;
  }

  .pf-project-visual {
    grid-column: 1;
  }

  .pf-project {
    padding-block: 80px;
  }
}

@media (max-width: 560px) {
  body.pf-body {
    font-size: 16px;
  }

  .pf-nav {
    gap: 14px;
  }

  .pf-hero {
    padding: 104px 0 64px;
  }

  .pf-index button {
    grid-template-columns: 36px 1fr 20px;
    gap: 12px;
  }

  .pf-index-kicker {
    display: none;
  }

  .pf-viz {
    padding: 20px;
  }

  .diary-row {
    gap: 10px;
    padding: 11px 12px;
  }

  .diary-head {
    font-size: 9.5px;
    letter-spacing: 0.04em;
  }

  .enc-flow {
    gap: 10px;
  }

  .enc-end {
    min-width: 70px;
  }

  .pompa {
    grid-template-columns: auto 36px;
  }

  .pompa-merge::after {
    display: none;
  }

  .pompa-out {
    grid-column: 1 / -1;
    padding: 18px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf-glow,
  .pf-dot,
  .lb-flow,
  .lb-voice-ring,
  .enc-track i {
    animation: none;
  }

  .lb-flow.on {
    stroke-dasharray: none;
  }

  .enc-track i {
    opacity: 1;
    background: var(--pf-violet);
  }

  .enc-track i:nth-child(1) { left: 10%; }
  .enc-track i:nth-child(2) { left: 25%; }
  .enc-track i:nth-child(3) { left: 40%; }
  .enc-track i:nth-child(4) { left: 55%; }
  .enc-track i:nth-child(5) { left: 70%; }
  .enc-track i:nth-child(6) { left: 85%; }
}
