/* ==========================================================================
   S · Blur. R's layout with the buttons of pdepablo.com: a light wash (40%)
   and a plain 20px blur. No rim, no sheen, no shadow, so over the work each
   button takes on the colour of what's behind it. Say hi and Contact stay black.
   ========================================================================== */

.page-s .o-pill:not(.o-pill--dark) {
  background: rgb(245 245 245 / 0.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: none;
}

.page-s .o-pill--dark,
.page-s .r-round {
  background: rgb(0 0 0 / 0.8);
  -webkit-backdrop-filter: blur(8px) saturate(1.4);
  backdrop-filter: blur(8px) saturate(1.4);
  box-shadow: none;
}

/* The words carry the contrast now: the one you're on in black, the rest in a dark grey. */
.page-s .r-bar a,
.page-s .o-top__nav { color: rgb(0 0 0 / 0.62); }
.page-s .r-bar a[aria-current="page"] { color: var(--fg); }

@media (hover: hover) {
  .page-s .o-pill:not(.o-pill--dark):hover { background: rgb(235 235 235 / 0.7); color: var(--fg); }
  .page-s .o-pill--dark:hover,
  .page-s .r-round:hover { background: rgb(0 0 0 / 0.92); }
}

/* Over something dark, the words turn white. */
.page-s .o-pill,
.page-s .r-bar a { transition: color 0.2s ease; }

/* Any other pill (Back to the work, a project's last Close) is a button like the rest. */
.page-s .pill { font-size: var(--t-ui); }

.page-s .o-pill.is-dark:not(.o-pill--dark),
.page-s .r-bar.is-dark a[aria-current="page"] { color: #fff; }
.page-s .r-bar.is-dark a { color: rgb(255 255 255 / 0.72); }
.page-s .r-bar a { color: rgb(0 0 0 / 0.62); }
.page-s .r-bar a[aria-current="page"] { color: var(--fg); }
.page-s .r-bar a.is-dark { color: rgb(255 255 255 / 0.72); }
.page-s .r-bar a.is-dark[aria-current="page"] { color: #fff; }

/* Each pill carries the plain blur on its own. */
.page-s .r-bar a {
  background: rgb(245 245 245 / 0.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: none;
}

/* --- The wall ---------------------------------------------------------------------------- */

/* On hover, only the piece's name, in the middle. The pill fades itself, not its holder: a holder
   below full opacity cuts the pill off from the image behind it, and the blur would only arrive
   once the fade had finished. */
.page-s .n-tile .tile__hover { opacity: 1; transform: none; transition: none; }
.page-s .n-tile .tile__hover .pill--quiet { display: none; }

.page-s .n-tile .tile__hover .pill {
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.2s ease, transform 0.35s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .page-s .n-tile[data-hover]:hover .tile__hover .pill,
  .page-s .n-tile[data-hover]:focus-visible .tile__hover .pill { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .page-s .n-tile .tile__hover .pill { transition: none; }
}

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

/* On a computer: the wall's three columns, 16px apart. The line with W and A beside it | Twitter,
   LinkedIn, Instagram | Contact; buttons in the same group 8px apart. Everything is Medium; the
   email is grey. */
/* The space above the footer: Work, About and How I work leave more after their last list. */
.page-s { --foot-gap: clamp(96px, 14vh, 160px); }

.page-s .s-footer {
  --in: 8px;
  margin-top: var(--foot-gap);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  align-items: stretch;
}

.page-s .s-footer .pill {
  height: var(--pill-h);
  padding: 0 20px;
  background: var(--surface);
  color: var(--fg);
  font-size: var(--t-ui);
  font-weight: var(--strong);
  transition: background-color 150ms ease-out, scale 150ms ease-out;
}

.page-s .s-footer .muted { transition: none; }

.page-s .s-footer__line { justify-content: flex-start; }
.page-s .s-footer__mail { justify-content: space-between; gap: 24px; }

.page-s .s-footer__first,
.page-s .s-footer__nav { display: flex; gap: var(--in); min-width: 0; }

.page-s .s-footer__line { flex: 1 1 auto; min-width: 0; }

.page-s .s-footer__social {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--in);
}

.page-s .s-footer__social .pill { justify-content: center; padding: 0 12px; }

/* Round: exactly as wide as tall, the letter or the logo in the middle. */
.page-s .s-footer__round {
  width: var(--pill-h);
  padding: 0 !important;
  aspect-ratio: 1;
  justify-content: center;
}

.page-s .s-long { display: none; }
.page-s .s-short { display: grid; place-items: center; }

/* Hover: one step darker, the same for every pill, no flip to black. Press: a touch smaller. */
@media (hover: hover) and (pointer: fine) {
  .page-s .s-footer a.pill:hover,
  .page-s .s-footer a.pill:hover .muted { background: var(--surface-hover); color: var(--fg); }
}

.page-s .s-footer a.pill:active { scale: 0.97; }

/* A phone, three rows: the pills that land on top (W, A and Contact), "© 2026 P de Pablo", then
   Twitter, LinkedIn and Instagram. */
@media (max-width: 900px) {
  .page-s { --dock-gap: 8px; }
  .page-s .s-footer { grid-template-columns: 1fr; gap: var(--in); margin-top: var(--dock-gap); }
  .page-s .s-footer__nav,
  .page-s .s-footer__mail { display: none; }
  /* The site's footer stretches its last pill across the row; not here. */
  .page-s .s-footer__social .pill { grid-column: auto; }
  /* As tall as the pills that land on top. */
  .page-s .s-footer .pill { height: var(--dock-h); }

  .page-s .s-footer .s-footer__long { display: none; }
  .page-s .s-footer .s-footer__short,
  .page-s .s-footer .s-footer__who { display: inline; }
}

/* "P de Pablo" goes only on the narrowest phones. */
@media (max-width: 340px) {
  .page-s .s-footer .s-footer__line .s-footer__who { display: none; }
}

/* --- The pills at the bottom, on a phone -------------------------------------------------- */

/* They float until the footer arrives, then stop on top of it and open out: Work and About stay
   the same buttons and delete their letters, from the end, down to a round W and A, and the hand
   opens into "hand + Contact" across the rest of the row.
   Sticky rather than fixed, so the moment they stop floating is the moment the page carries them.
   The widths move through max-width, the one size that animates between the floating pills and
   the footer's. */
/* The order tells the story: the letters go first, straight away (that's the feedback that the
   scroll did something), then Contact grows into the room they leave and its word fades in once
   there's space for it. Going back up is the same motion played backwards, at the same pace: the
   word goes, Contact closes, and once there's room the letters type back in. The shape changes in
   place, so it eases in and out. Width and padding are layout, but only inside the dock, which keeps
   it to itself. */
.page-s { --land: 420ms cubic-bezier(0.645, 0.045, 0.355, 1); }

@media (max-width: 900px) {
  .page-s .r-dock {
    position: sticky;
    left: auto;
    bottom: 24px;
    height: var(--dock-h);
    max-width: none;
    margin: var(--foot-gap) var(--gutter) 0;
    align-items: center;
    justify-content: center;
    transform: none;
    contain: layout;
  }

  /* Specific enough to beat `.page-n a:not(.n-tile)`, which would leave the way back up with a
     colour change only. */
  .page-s .r-dock > .r-bar,
  .page-s .r-dock > .r-round,
  .page-s .r-dock .r-bar a {
    height: var(--dock-h);
    transition:
      max-width var(--land),
      padding var(--land),
      background-color 250ms ease-out,
      color 200ms ease-out,
      transform 150ms ease-out;
  }

  /* Work and About as wide as their word, never narrower than round. */
  .page-s .r-bar { flex: none; }
  .page-s .r-bar a { min-width: var(--dock-h); padding: 0 24px; }

  /* The letters after the first: each one closes up and fades, like a backspace. They go from the
     end on landing (k, r, o), straight away, and come back from the start (o, r, k) at the same
     pace, in the last part of the way back. */
  .page-s .r-word { display: inline-flex; }

  .page-s .r-del {
    display: inline-grid;
    grid-template-columns: 1fr;
    transition:
      grid-template-columns 120ms ease-out,
      opacity 120ms ease-out;
    transition-delay: calc(165ms + (var(--i) - 1) * 45ms);
  }

  .page-s .r-del > span { overflow: hidden; }

  .page-s .r-round {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: var(--dock-h);
    overflow: hidden;
    padding: 0 calc((var(--dock-h) - 26px) / 2);
  }

  /* The hand keeps its size whatever the pill does; the word gives way instead. */
  .page-s .r-round .hi-icon { flex-shrink: 0; }

  .page-s .r-round__text {
    display: inline-grid;
    grid-template-columns: 0fr;
    min-width: 0;
    opacity: 0;
    transform: translateX(-4px);
    transition:
      grid-template-columns var(--land),
      margin var(--land),
      opacity 200ms ease-out 80ms,
      transform var(--land);
  }

  .page-s .r-round__text > span { overflow: hidden; }

  /* Landed. Unlike O's, they stay. */
  .page-s .r-dock.is-landed {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  html:not(.focus-open) .page-s .r-dock.is-landed > *,
  html:not(.focus-open) .page-s .r-dock.is-landed .r-bar a {
    transition:
      max-width var(--land),
      padding var(--land),
      background-color 250ms ease-out,
      color 200ms ease-out,
      transform 150ms ease-out;
  }

  /* W and A round, exactly as wide as tall; Contact takes the rest. */
  html:not(.focus-open) .page-s .r-dock.is-landed .r-round { max-width: 100%; padding: 0 20px; }

  html:not(.focus-open) .page-s .r-dock.is-landed .r-bar a {
    padding: 0;
    background: var(--surface);
    color: var(--fg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html:not(.focus-open) .page-s .r-dock.is-landed .r-del {
    grid-template-columns: 0fr;
    opacity: 0;
    transition-delay: calc((var(--n) - var(--i)) * 45ms);
  }

  html:not(.focus-open) .page-s .r-dock.is-landed .r-round__text {
    grid-template-columns: 1fr;
    margin-left: 8px;
    opacity: 1;
    transform: none;
    transition:
      grid-template-columns var(--land),
      margin var(--land),
      opacity 200ms ease-out 140ms,
      transform var(--land);
  }

  /* A project open over the page: the pills float again, and the footer keeps their place. */
  .focus-open .page-s .r-dock {
    position: fixed;
    left: var(--gutter);
    right: var(--gutter);
    margin-inline: 0;
  }

  .focus-open .page-s .s-footer { margin-top: calc(var(--foot-gap) + var(--dock-h) + var(--dock-gap)); }
}

@media (max-width: 900px) {
  .page-s .r-dock.is-instant *,
  .page-s .r-dock.is-instant > * { transition: none !important; }
}

@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .page-s .r-dock > *,
  .page-s .r-bar a,
  .page-s .r-del,
  .page-s .r-round__text { transition: none !important; }
}

/* Between a phone and a wide screen each third gets narrow, so each one adapts to its own width:
   the line gives way to "© 2026 P de Pablo", then to "© 2026" (the time where Pablo is always beside
   it, in its own pill), and the socials and Contact tighten
   their padding. */
.page-s .s-footer__first,
.page-s .s-footer__social,
.page-s .s-footer__mail { container-type: inline-size; }

.page-s .s-footer__first { container-name: f-first; }
.page-s .s-footer__social { container-name: f-social; }

/* The clip that keeps the line from spilling out would also cut the descenders (g, p) on the pill's
   tight line height, so the text gets room below it. */
.page-s .s-footer__line > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.page-s .s-footer__short { display: none; }

/* The time where Pablo is and a half-filled circle, together in a pill of their own beside the line:
   the whole pill switches the site to the other side, and the circle turns over with the night. The time
   starts where every pill's words do; the circle sits in the middle of the round end, as far from
   the end as from the top and bottom. */
.page-s .s-footer .s-footer__sky {
  flex: none;
  gap: 8px;
  padding: 0 13px 0 20px;
  color: var(--muted);
  font: inherit;
  font-size: var(--t-ui);
  letter-spacing: inherit;
}
.page-s .s-footer__sky:has([data-clock]:empty) { visibility: hidden; }
/* Every digit but the first as wide as a 0, the widest, centred (sky.js): the pill keeps its width. */
.page-s [data-clock] > span { display: inline-block; width: 0.63em; text-align: center; }
.page-s .s-footer__sky svg { flex: none; width: 18px; height: 18px; overflow: visible; color: var(--fg); }
/* Turned as far as the night has come (--turn, from sky.js): half a turn across the five minutes of
   dusk, back at dawn, and in one go when a visitor switches. */
.page-s .s-footer__half,
.page-s .s-footer__disc,
.page-s .s-footer__sun { transform-box: view-box; transform-origin: 12px 12px; }
.page-s .s-footer__half { transform: rotate(calc(var(--turn, 0) * 180deg)); transition: transform 450ms cubic-bezier(0.65, 0, 0.35, 1); }

/* Tatooine: pointed at, the circle shrinks away and two suns shoot out of it, a big one and a small
   one, orbit each other for a while, then dive back in and close into the circle again. site.js marks
   the pill with data-twin for the whole run, so leaving early doesn't cut it short. */
.page-s .s-footer__twins { transform-box: view-box; transform-origin: 12px 12px; }
.page-s .s-footer__sun { fill: currentColor; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .page-s .s-footer__sky[data-twin] .s-footer__disc { animation: twin-disc 1800ms linear; }
  .page-s .s-footer__sky[data-twin] .s-footer__twins { animation: twin-orbit 1800ms linear; }
  .page-s .s-footer__sky[data-twin] .s-footer__sun { animation: twin-near 1800ms linear; }
  .page-s .s-footer__sky[data-twin] .s-footer__sun--far { animation-name: twin-far; }
}
@keyframes twin-disc {
  0% { opacity: 1; transform: scale(1); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  10%, 86% { opacity: 0; transform: scale(0.4); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes twin-orbit {
  0%, 18% { transform: rotate(0deg); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  80%, 100% { transform: rotate(250deg); }
}
@keyframes twin-near {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  8% { opacity: 1; transform: translate(0, 0) scale(1); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  22%, 74% { opacity: 1; transform: translate(-4.6px, 0) scale(1.15); animation-timing-function: cubic-bezier(0.7, 0, 0.84, 0); }
  86% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(0, 0) scale(0.6); }
}
@keyframes twin-far {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  8% { opacity: 1; transform: translate(0, 0) scale(1); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  22%, 74% { opacity: 1; transform: translate(5.6px, 0) scale(1.2); animation-timing-function: cubic-bezier(0.7, 0, 0.84, 0); }
  86% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(0, 0) scale(0.6); }
}
  16%, 84% { opacity: 1; transform: translate(0, 0) scale(1); }
  42%, 62% { opacity: 1; transform: translate(5.6px, 2px) scale(1.2); }
}
.page-s .s-footer .s-footer__sky:active { scale: 0.97; }
@media (hover: hover) and (pointer: fine) {
  .page-s .s-footer .s-footer__sky:hover { background: var(--surface-hover); color: var(--fg); }
}
@media (prefers-reduced-motion: reduce) {
  .page-s .s-footer__half { transition: none; }
}

/* A phone: taller pills, so the circle a little bigger and further from the end. */
@media (max-width: 900px) {
  .page-s .s-footer .s-footer__sky { padding: 0 22px 0 20px; }
  .page-s .s-footer__sky svg { width: 20px; height: 20px; }
}

/* Narrower, the line gives way first, then "P de Pablo", and on a computer at last the whole line:
   the time stays. */
@container f-first (max-width: 540px) {
  .page-s .s-footer__long { display: none; }
  .page-s .s-footer__short { display: inline; }
}

@container f-first (max-width: 425px) {
  .page-s .s-footer__who { display: none; }
}

@media (min-width: 901px) {
  @container f-first (max-width: 312px) {
    .page-s .s-footer .s-footer__line { display: none; }
  }
}

@container f-social (max-width: 330px) {
  .page-s .s-footer__social .pill { padding: 0 4px; }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .page-s .s-footer__mail { padding: 0 16px; gap: 12px; }
  .page-s .s-footer__mail .muted { font-size: var(--t-sm); }
}

@media (prefers-reduced-motion: reduce) {
  .page-s .s-footer .pill { transition: none; }
}

/* Contact in the footer: the email gives way to "Email copied" in the same spot. The old text lifts
   and blurs out, the new one rises into focus; after a moment they swap back. */
.s-footer__swap { display: grid; justify-items: end; }

.s-footer__swap > span {
  grid-area: 1 / 1;
  transition:
    opacity 180ms ease-out,
    transform 260ms var(--expo-out),
    filter 180ms ease-out;
}

.s-footer__swap > span:last-child {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(2px);
  color: var(--fg);
}

:is(.s-footer__mail, .ab-mail)[data-copied] .s-footer__swap > span:first-child {
  opacity: 0;
  transform: translateY(-8px);
  filter: blur(2px);
}

:is(.s-footer__mail, .ab-mail)[data-copied] .s-footer__swap > span:last-child {
  opacity: 1;
  transform: none;
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .s-footer__swap > span { transition: none; transform: none !important; filter: none !important; }
}

/* The fist bump that comes with "Email copied!" (it plays from cosmos.css), just after the words. */
:is(.s-footer__mail, .ab-mail)[data-copied] .fist g { animation-delay: 120ms; animation-fill-mode: backwards; }

.s-footer__swap > span:last-child { display: inline-flex; align-items: center; gap: 6px; }

.s-footer__wave svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--hand-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* One colour for everything that isn't the work: selections, links and the project's call to action
   are black. Orange is only the favicon on a local server. */
.page-s { --accent: var(--fg); }
.page-s .f-proj__cta a { text-decoration: underline; text-decoration-color: rgb(0 0 0 / 0.2); text-underline-offset: 3px; }

/* Every page but the home starts at the same height under the top bar: Work, About and an open
   project, on a computer and on a phone. */
.page-s { --page-top: calc(var(--bar) + 40px); }

@media (max-width: 900px) {
  .page-s { --page-top: calc(var(--bar) + 16px); }
}

.page-s .f-focus .e-proj { padding-top: var(--page-top); }

.page-s .f-focus .e-proj__text { top: var(--page-top); }

.page-s .f-focus .e-proj__text,
.page-s .f-focus .e-proj__media > .media,
.page-s .f-focus .e-proj__media > .row { scroll-margin-top: var(--page-top); }

/* Home: the work starts halfway down the first screen, and the words sit just above it, leaving
   clean white at the top. */
.page-s .o-intro {
  min-height: calc(50svh - var(--bar));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 0;
  padding-bottom: 32px;
}

/* On a phone too the work starts halfway down, so the pills at the bottom leave most of the first
   piece in view. */
@media (max-width: 900px) {
  .page-s .o-intro { min-height: calc(50svh - var(--bar)); }
}

/* The page is never shorter than the screen: the content grows to fill it, so the footer always
   sits at the bottom edge, even when a search leaves one project or a page is short. */
.page-s main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

.page-s main > :is(.n-main, .wk, .ab, .hw, .ct) { flex: 1 0 auto; }
/* Full width: the footer's auto side margins would otherwise shrink it to its content. */
.page-s main > .s-footer { flex-shrink: 0; align-self: stretch; margin-inline: 0; }

/* Nothing wider than 1800px: on a big screen the gutters grow, so the top bar, the pages, the
   work when it's open and the footer all sit in the same centred column. */
.page-s { --page-max: 1800px; }

@media (min-width: 1848px) {
  .page-s { --gutter: calc((100vw - var(--page-max)) / 2); }
}


/* The names under the work on a phone are labels, one step down from the text. */
.page-s .n-tile__caption { font-size: var(--t-sm); }

/* An open project starts like a section of How I work: its title in black with the client and the
   year in grey right under it, then the story 12px down, paragraphs 0.75em apart. */
/* One block: no space between the title and its grey line. */
.page-s .f-focus .e-proj__text h2 { margin-bottom: 0; }
.page-s .f-focus .e-proj__text .e-proj__meta { margin-top: 0; }
.page-s .f-focus .e-proj__text .e-proj__lead { margin-top: 12px !important; }
.page-s .f-focus .e-proj__text p + p:not(.e-proj__lead) { margin-top: 0.75em; }
.page-s .f-focus .e-proj__text dl { margin-top: 24px; }

/* On a phone the picture you tapped comes first, right under the title, so it lands where you can
   see it; the story and the rest of the work follow. Text and pictures share one column there, so
   the two boxes step aside and their contents line up in that order. */
@media (max-width: 900px) {
  .page-s .f-focus .e-proj { display: flex; flex-direction: column; gap: 0; }
  .page-s .f-focus .e-proj__text,
  .page-s .f-focus .e-proj__media { display: contents; }
  .page-s .f-focus .e-proj__text > * { order: 3; }
  .page-s .f-focus .e-proj__text > :is(h2, .e-proj__meta) { order: 1; }
  .page-s .f-focus .e-proj__media > * { order: 4; }
  .page-s .f-focus .e-proj__media > :first-child { order: 2; margin-top: 16px; }
  .page-s .f-focus .e-proj__text .e-proj__lead { margin-top: 16px !important; }
  .page-s .f-focus .e-proj__media > :nth-child(2) { margin-top: 32px; }
  .page-s .f-focus .e-proj__media > :nth-child(n + 3) { margin-top: var(--gap); }
}
