:root {
  --ink: #101010;
  --muted: #6a6a63;
  --soft-line: #cfcfca;
  --paper: #ffffff;
  --edge: clamp(1.25rem, 4.6vw, 4.5rem);
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-size: 1rem;
  line-height: 1.4;
  text-rendering: optimizeLegibility;
}

body.intro-locked {
  overflow: hidden;
}

.intro-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
  opacity: 1;
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 520ms;
  -webkit-tap-highlight-color: transparent;
}

.intro-enabled .intro-gate { display: grid; }

.intro-enter {
  position: absolute;
  bottom: max(2rem, env(safe-area-inset-bottom));
  right: var(--edge);
  font: 0.85rem Arial, Helvetica, sans-serif;
  letter-spacing: 0.06em;
  padding: 0.75rem;
}

.intro-gate:focus-visible { outline: 2px solid var(--ink); outline-offset: -6px; }

.intro-gate.is-leaving {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.intro-stage {
  position: relative;
  isolation: isolate;
  width: min(100vw, 46.158854svh);
  aspect-ratio: 709 / 1536;
}

.intro-portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.intro-handwriting {
  position: absolute;
  bottom: 0;
  left: 2%;
  display: grid;
  width: 96%;
  aspect-ratio: 9 / 11;
  place-items: center;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.intro-media {
  display: block;
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.intro-animation {
  opacity: 1;
  transition: opacity 160ms linear;
}

.intro-complete {
  opacity: 0;
  transition: opacity 160ms linear;
}

.intro-gate.is-complete .intro-animation {
  opacity: 0;
}

.intro-gate.is-complete .intro-complete {
  opacity: 1;
}

.site-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 650ms ease 140ms, transform 650ms cubic-bezier(0.22, 1, 0.36, 1) 140ms;
}

.intro-locked .site-page {
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.15rem var(--edge);
  border-top: 2px solid #5c5c56;
  color: #5c5c56;
  font-size: clamp(0.6875rem, 3.6vw, 0.875rem);
  letter-spacing: 0.025em;
  text-transform: lowercase;
}

/* Name and degree are the first thing a visitor reads: a step larger than
   the title beside them, in the site's dark grey. */
.site-header h1 {
  margin: 0;
  font: inherit;
  font-size: clamp(0.75rem, 3.9vw, 0.9375rem);
  color: #5c5c56;
}

.site-header a {
  padding-bottom: 0.08rem;
  border-bottom: 1px solid transparent;
}

.site-header a:hover {
  border-bottom-color: currentColor;
}

.index {
  position: relative;
  min-height: 100svh;
  width: min(100%, 100rem);
  margin: 0 auto;
  padding: clamp(6rem, 8vw, 8rem) var(--edge) clamp(4rem, 8vw, 7rem);
  opacity: 1;
  transform: none;
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.index.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.project-list {
  border-top: 1px solid var(--ink);
}

.project-item summary::-webkit-details-marker {
  display: none;
}

.intro-line { white-space: nowrap; }

.project-item {
  color: var(--muted);
  border-bottom: 1px solid var(--soft-line);
}

.project-item:last-child {
  border-bottom-color: var(--ink);
}

.project-item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9rem, 17rem) 1.5rem;
  gap: 0.75rem;
  align-items: center;
  min-height: clamp(4.6rem, 6.5vw, 5.75rem);
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.item-type,
.item-status {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.item-name {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.035em;
}

.plus {
  position: relative;
  justify-self: end;
  width: 1.15rem;
  height: 1.15rem;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.plus::before,
.plus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.15rem;
  height: 1px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 180ms ease;
}

.plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.project-item[open] > summary .plus::after {
  transform: translate(-50%, -50%);
}

.project-item > summary:focus-visible .item-name {
  color: var(--ink);
}

@media (hover: hover) {
  .item-name {
    transition: color 180ms ease;
  }

  .project-item > summary:hover .item-name {
    color: var(--ink);
  }

  .project-item:not([open]) > summary:hover .plus {
    transform: rotate(90deg);
  }
}

.item-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9rem, 17rem) 1.5rem;
  gap: 0.75rem;
  align-items: start;
  padding: 0 0 2rem;
  animation: open-item 220ms ease both;
}

.item-content p {
  grid-column: 1;
  max-width: 39rem;
  margin: 0;
  font-size: clamp(0.92rem, 1.25vw, 1.05rem);
}

.item-content p strong {
  font-weight: 500;
}

.item-content-feature p {
  max-width: 48rem;
}

.item-content a,
.item-status {
  grid-column: 2;
  justify-self: start;
}

.item-content a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.4em;
  transition: text-underline-offset 220ms ease;
}

@media (hover: hover) {
  .item-content a:hover {
    text-underline-offset: 0.2em;
  }
}

@keyframes open-item {
  from { opacity: 0; transform: translateY(-0.4rem); }
  to { opacity: 1; transform: translateY(0); }
}

footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.2rem var(--edge) 3rem;
  border-top: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

footer p {
  margin: 0;
}

/* Footer: e-mail, whatsapp and instagram on one edge, the languages on the
   other. Every item is a 26px square drawn like a legend in a plan: a hairline
   frame in the page's line colour, the sign or code in the header's grey and
   size. Below a 332px screen they shrink so all nine still share one row. */
footer {
  --button: clamp(1.375rem, calc((100vw - 6.125rem) / 9), 1.625rem);
}

.contact-links,
.footer-langs {
  display: flex;
  gap: 0.375rem;
}

.contact-links a,
.footer-langs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--button);
  height: var(--button);
  padding-top: 1px;
  box-shadow: inset 0 0 0 1px var(--soft-line);
  background: var(--paper);
  color: inherit;
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.contact-links svg {
  width: 86%;
  height: 86%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The drawn lines stay as fine as the frame at every button size. */
.contact-links svg * {
  vector-effect: non-scaling-stroke;
}

/* The current language and a touched button: the frame takes the text grey. */
.contact-links a:hover,
.contact-links a:focus-visible,
.footer-langs a:hover,
.footer-langs a:focus-visible,
.footer-langs a[aria-current="page"] {
  box-shadow: inset 0 0 0 1px currentColor;
}

@media (max-width: 580px) {
  .footer-langs a { font-size: 0.6875rem; }
}


.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 101;
  padding: 0.75rem 1rem;
  background: var(--paper);
  transform: translateY(-200%);
}

.skip-link:focus { transform: translateY(0); }

.neural-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("assets/neuroscience-light-desktop.webp") right top / cover no-repeat;
  opacity: 0.64;
}

/* Keep the pencil drawing visible through the project column. */
.project-list {
  width: min(46%, 36rem);
  border-top: 0;
  background: transparent;
}
.project-item { color: var(--ink); }
.project-item:last-child { border-bottom-color: var(--soft-line); }
.project-item > summary {
  grid-template-columns: minmax(0, 1fr) 1.25rem;
  gap: 0.25rem 0.75rem;
  min-height: 4.65rem;
  padding: 0.9rem 0;
}
.project-item > summary .item-name { grid-column: 1; grid-row: 1; }
.project-item > summary .item-type {
  grid-column: 1;
  grid-row: 2;
  color: var(--muted);
  letter-spacing: 0.015em;
  line-height: 1.5;
}
.project-item > summary .plus { grid-column: 2; grid-row: 1 / 3; }
.item-content { grid-template-columns: minmax(0, 1fr); }
.item-content > a, .item-content > .item-status { grid-column: 1; }
.item-story { padding-right: 0; color: var(--muted); }
.pure-descriptor { text-wrap: balance; }

.index-caption,
.list-hint {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.index-caption { margin-top: 1.25rem; }
.list-hint { display: flex; justify-content: space-between; margin: 0 0 1rem; }
.item-story { grid-column: 1; max-width: 38rem; padding-right: 0; }
.item-story p { margin: 0 0 1rem; line-height: 1.7; }
.item-story .item-lead { color: var(--ink); line-height: 1.4; }
.item-story .item-note {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  line-height: 1.7;
  margin: 0;
}
.project-item[open] > summary { color: var(--ink); }

summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}

/* A portrait composition keeps the brain and DNA in view on narrow screens. */
@media (max-aspect-ratio: 1 / 1) {
  .neural-background {
    background-image: url("assets/neuroscience-light-mobile.webp");
    background-position: center top;
  }
}

@media (max-width: 680px) {
  .intro-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }

  .intro-portrait {
    object-fit: cover;
    object-position: center;
  }

  .intro-handwriting {
    top: auto;
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    left: 50%;
    width: min(96vw, 48vh);
    width: min(96vw, 48dvh);
    transform: translateX(-50%);
  }

  .index {
    padding-inline: 1.25rem;
  }

  .project-item summary {
    grid-template-columns: minmax(0, 1fr) 1.25rem;
    min-height: 4.75rem;
    padding: 1rem 0;
  }

  .item-type {
    display: block;
    grid-column: 1;
    grid-row: 2;
    margin-top: 0.25rem;
  }

  .item-name {
    grid-column: 1;
    grid-row: 1;
  }

  .plus {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .item-name {
    font-size: 1.15rem;
    letter-spacing: -0.03em;
  }

  .item-content {
    grid-template-columns: 1fr;
    padding-bottom: 1.7rem;
  }

  .item-content p,
  .item-content a,
  .item-status {
    grid-column: 1;
  }

  .item-content a,
  .item-status {
    margin-top: 0.25rem;
  }

  .item-story { padding-right: 0; }
  .neural-background { opacity: 0.48; }
  .index { padding-top: 5.75rem; }
  .project-list { width: 100%; background: transparent; }
  .project-item > summary { min-height: 4.75rem; }
  .project-item > summary .item-type { margin-top: 0; }

}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Zero, not 0.01ms: any duration would also "transition" inherited visibility and block focus(). */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
  .index,
  .site-page {
    opacity: 1;
    transform: none;
  }
}


.instagram-icon { width: 0.72em; height: 0.72em; flex: 0 0 auto; }

.pure-tree {
  display: grid;
  gap: 0.1rem;
  margin-bottom: 1rem;
}
.pure-branch { color: var(--muted); }
.pure-branch > summary {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 2.25rem;
  padding: 0;
  cursor: pointer;
  list-style: none;
  text-transform: lowercase;
  transition: color 180ms ease;
}
.pure-branch > summary::-webkit-details-marker { display: none; }
.pure-branch > summary::after {
  content: "";
  flex: 0 0 auto;
  width: 0.6rem;
  height: 0.6rem;
  margin-left: 0.7rem;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat;
  transition: background-size 220ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.pure-branch[open] > summary { color: var(--ink); }
[dir="rtl"] .pure-branch > summary { direction: ltr; justify-content: flex-end; }
[dir="rtl"] .pure-branch > summary::after { order: -1; margin-left: 0; margin-right: 0.7rem; }
[dir="rtl"] .site-header h1 { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .item-name { unicode-bidi: plaintext; text-align: right; }
.item-story .pure-branch-text:first-of-type { margin-top: 0.6rem; }
.pure-branch[open] > summary::after { background-size: 100% 1px, 1px 0; }
@media (hover: hover) {
  .pure-branch > summary:hover { color: var(--ink); }
  .pure-branch:not([open]) > summary:hover::after { transform: rotate(90deg); }
}
.pure-letter { color: var(--ink); font-weight: 500; margin: 0; }

.pure-branch-text {
  max-width: 38rem;
  color: var(--muted);
  line-height: 1.7;
  text-transform: lowercase;
}

/* Smooth open and close where the browser can animate to auto height. */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }

  .project-item::details-content,
  .pure-branch::details-content {
    block-size: 0;
    overflow: clip;
    overflow-clip-margin: 0.75rem;
    transition: block-size 420ms cubic-bezier(0.22, 1, 0.36, 1), content-visibility 420ms allow-discrete;
  }

  .project-item[open]::details-content,
  .pure-branch[open]::details-content {
    block-size: auto;
  }

  /* A chapter closed because another opened shuts at once, so the opened one stays put. */
  .pure-branch.is-snapping::details-content { transition: none; }
}

/* Paul's art statement sits above the project list. */
.art-statement {
  margin: 0 0 clamp(2rem, 4vw, 3.5rem);
  text-align: center;
  color: var(--ink);
}
.art-statement blockquote { margin: 0; }
.art-statement p {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.4;
  letter-spacing: -0.035em;
}
.art-statement em { font-style: italic; font-synthesis: style; }
.art-statement figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}
@media (max-width: 680px) {
  .site-header { flex-wrap: wrap; gap: 0.3rem 1rem; }
}

/* pure as a building: the roof is something greater than you, four pillars, one foundation */
.pure-house { margin: 0.4rem 0 1.6rem; max-width: 30rem; color: var(--tone-dark, var(--ink)); }
.ph-roof-btn { display: block; width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.ph-roof { display: block; width: 100%; height: auto; }
.ph-roof polygon { fill: none; stroke: var(--soft-line); stroke-width: 1; vector-effect: non-scaling-stroke; transition: fill 200ms ease, stroke 200ms ease; }
.ph-roof-btn[aria-expanded="true"] .ph-roof polygon { fill: var(--tone-dark, var(--ink)); stroke: var(--tone-dark, var(--ink)); }
.ph-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-top: 0.35rem; }
.ph-pillar { display: flex; flex-direction: column; min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--muted); font: inherit; text-transform: lowercase; text-align: center; cursor: pointer; }
.ph-shaft { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.55rem; min-height: clamp(6rem, 22vw, 8.5rem); padding: 0.8rem 0.25rem; border: 1px solid var(--soft-line); transition: background-color 200ms ease, border-color 200ms ease; }
.ph-letter { font-size: clamp(1.5rem, 7vw, 2.25rem); line-height: 1; font-weight: 400; color: var(--tone-dark, var(--ink)); transition: color 200ms ease; }
.pure-house .ph-name { display: block; margin: 0; padding: 0; font-size: clamp(0.5625rem, 2.5vw, 0.6875rem); letter-spacing: 0.08em; line-height: 1.25; color: var(--muted); transition: color 200ms ease; }
.ph-pillar[aria-expanded="true"] .ph-shaft { background: var(--tone-dark, var(--ink)); border-color: var(--tone-dark, var(--ink)); }
.ph-pillar[aria-expanded="true"] .ph-letter { color: var(--paper); }
.ph-pillar[aria-expanded="true"] .ph-name { color: var(--paper); }
.pure-house .ph-base { display: block; width: 100%; margin: 0.35rem 0 0; padding: 0.7rem 0; border: 1px solid var(--soft-line); border-radius: 0; background: transparent; color: inherit; font: inherit; font-size: 0.75rem; letter-spacing: 0.22em; text-transform: lowercase; text-align: center; cursor: pointer; transition: background-color 200ms ease, color 200ms ease; }
.pure-house .ph-base[aria-expanded="true"] { background: var(--tone-dark, var(--ink)); color: var(--paper); }
@media (hover: hover) {
  .ph-pillar:hover .ph-shaft { border-color: var(--tone-dark, var(--ink)); }
  .ph-pillar:hover .ph-name { color: var(--tone-dark, var(--ink)); }
  .ph-roof-btn:hover .ph-roof polygon { stroke: var(--tone-dark, var(--ink)); }
  .pure-house .ph-base:hover { border-color: var(--tone-dark, var(--ink)); }
}
.pure-chapters { margin-bottom: 1rem; }
.ph-panel[hidden] { display: none; }
.ph-panel { animation: ph-rise 300ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes ph-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .ph-panel { animation: none; }
  .ph-shaft, .ph-letter, .pure-house .ph-name, .pure-house .ph-base,
  .ph-roof polygon { transition: none; }
}
.pact-note { margin-top: 0.4rem; }
#site-page .item-content a.row-cta.pact-cta { background: transparent; color: var(--tone-dark, var(--ink)); border: 1px solid var(--tone-dark, var(--ink)); }

/* pact: the three steps, numbered with thin figures */
.pact-steps { list-style: none; counter-reset: step; margin: 0.8rem 0 1rem; padding: 0; border-top: 1px solid rgba(0,0,0,.12); }
.pact-steps li { counter-increment: step; display: grid; grid-template-columns: 1.6rem 1fr; padding: 0.6rem 0; border-bottom: 1px solid rgba(0,0,0,.12); color: var(--muted); line-height: 1.55; }
.pact-steps li::before { content: counter(step); color: var(--tone-dark, var(--ink)); }
