/* Element defaults and global policies (focus, motion, hidden, dialogs). Layer "base": every component and every
   page rule wins over it. Utilities after the layer stay unlayered on purpose. */
@layer base{
  *{box-sizing:border-box}
  html{scroll-padding-top:calc(var(--header) + 20px);scroll-behavior:auto}
  body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--font-body);-webkit-font-smoothing:antialiased;line-height:1.6}
  h1,h2,h3,h4,p{margin:0}
  h1,h2,h3{font-weight:500;line-height:1.06;letter-spacing:-.055em}
  h1{font-weight:600}
  h2{font-size:clamp(40px,4.9vw,68px)}
  h3{font-size:28px}
  p{line-height:1.65}
  em{font-family:var(--font-editorial);font-weight:400}
  code{font-family:var(--font-mono);font-size:.86em}
  a{color:inherit;text-decoration:none}
  a[href^="mailto:"]{overflow-wrap:anywhere}
  img,svg{max-width:100%}
  img{display:block}
  button,input,textarea,select{font:inherit}
  button{border:0;color:inherit;cursor:pointer}
  button:disabled{opacity:.55;cursor:not-allowed}
  select{color:var(--ink)}
  textarea{resize:vertical}
  button,a{-webkit-tap-highlight-color:transparent}
  a,button,input,textarea,select{touch-action:manipulation}
  ::selection{background:var(--yellow);color:var(--ink)}
  [hidden]{display:none!important}
  /* One focus ring for links, buttons and fields. Sections and the main area receive focus only to move the
     reading position; a ring around a whole section is noise. */
  :focus-visible{outline:var(--focus-width) solid var(--focus-colour);outline-offset:6px}
  button:focus-visible{outline-offset:5px}
  #main[tabindex="-1"]:focus,section[tabindex="-1"]:focus,[id][tabindex="-1"]:not(a,button,input,textarea,select,summary):focus{outline:none}
  /* Dialog: native modal dialogs keep focus containment, Escape and a visible close control (.close-round) */
  dialog{position:fixed;margin:auto;width:min(900px,calc(100% - 36px));max-height:calc(100dvh - 48px);overflow:auto;padding:40px;border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--paper-light);color:var(--ink);box-shadow:var(--shadow-overlay);overscroll-behavior:contain}
  dialog::backdrop{background:var(--backdrop);backdrop-filter:blur(5px)}
  @media(max-width:700px){
    h2{font-size:clamp(39px,8.3vw,56px);line-height:1.06}
  }
  @media(max-width:420px){
    dialog{padding:34px 22px 24px}
  }
  /* Motion is optional: without it every element shows its finished, resting state. In-page links glide through
     common.js; there is no page-wide smooth scrolling (it animated anchor loads and history restoration). */
  html[data-motion=off] *,html[data-motion=off] *:before,html[data-motion=off] *:after{scroll-behavior:auto!important;animation:none!important;transition:none!important}
  @media(prefers-reduced-motion:reduce){
    html:not([data-motion=on]) *,html:not([data-motion=on]) *:before,html:not([data-motion=on]) *:after{animation:none!important;transition:none!important}
    *,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
  }
}
/* Utilities */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.svg-library{position:absolute;width:0;height:0;overflow:hidden}
.hp-field{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
.quiet-focus:focus,.quiet-focus:focus-visible{outline:none}
/* Page transitions between the default view and project pages (transitions.js opts in): the illustration
   travels, the rest crossfades, the header is swapped instead of shown twice. */
::view-transition-old(site-header){display:none}
::view-transition-new(site-header){animation:none}
::view-transition-group(*){animation-duration:.55s;animation-timing-function:var(--ease-out)}
::view-transition-old(root),::view-transition-new(root){animation-duration:.3s}
