/* Site styles, loaded after Quiet Surfaces (tokens.css, then bundle.css). */

/* Pages hand over to each other with a view transition. continuity.js names the one element that travels. */
@view-transition { navigation: auto; }

/* ---------- Departures from Quiet Surfaces, for a quieter, more neutral feel ---------- */

/* Neutrals: muted greys in place of the system's navy-tinted ground and ink. */
:root {
  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --veil: rgba(245, 245, 247, 0.6);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --stroke: rgba(0, 0, 0, 0.08);
  --sheet: rgba(250, 250, 252, 0.6);
  --sheet-edge: rgba(255, 255, 255, 0.8);
  --track: rgba(0, 0, 0, 0.08);
  --track-strong: rgba(0, 0, 0, 0.3);
  --on-media-ink: #1d1d1f;
  --h: 257;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161617;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --veil: rgba(22, 22, 23, 0.5);
    --glass: rgba(255, 255, 255, 0.08);
    --glass-strong: rgba(255, 255, 255, 0.16);
    --stroke: rgba(255, 255, 255, 0.1);
    --sheet: rgba(44, 44, 46, 0.56);
    --sheet-edge: rgba(255, 255, 255, 0.16);
    --track: rgba(255, 255, 255, 0.1);
    --track-strong: rgba(255, 255, 255, 0.4);
  }
}

/* Type: the system face for titles as well, at a gentler weight, in place of the condensed display face. */
.display-large, .display-page, .display-title, .display-lead { margin: 0; font-family: var(--font-ui); font-variation-settings: normal; text-wrap: balance; }
.display-large { font-size: clamp(34px, 9vw, 48px); line-height: 1.08; font-weight: 600; letter-spacing: -0.02em; }
.display-page { font-size: clamp(28px, 7vw, 34px); line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; }
.display-title { font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.012em; }
.display-lead { font-size: 19px; line-height: 1.4; font-weight: 400; letter-spacing: -0.01em; }
.text-body { font-size: 17px; line-height: 1.47; letter-spacing: -0.01em; }

/* ---------- Page ---------- */
.site { position: relative; min-height: 100vh; }
.site-page { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 72px; padding: 20px var(--space-6) 48px; }
.site-main { flex: 1 0 auto; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 72px; }
.site-section { width: 100%; max-width: 680px; display: flex; flex-direction: column; gap: var(--space-6); }
.site-section--wide { max-width: 1040px; }
.site-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-5); }
.site-heading { margin: 0; font-size: 28px; line-height: 1.14; font-weight: 600; letter-spacing: -0.02em; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 22px; }
.site-more { align-self: center; }
.site-empty { margin: 0; color: var(--ink-2); }
.site-link { color: inherit; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--track-strong); text-underline-offset: 3px; }
.site-link:hover { text-decoration-color: currentColor; }
a.qs-btn, a.qs-iconbtn { text-decoration: none; }
a.qs-link { font-weight: 600; }

/* The page's media as an ambient wash behind the top of the page, fading into the ground. */
.site-wash { position: absolute; inset: 0 0 auto 0; height: 720px; -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent); mask-image: linear-gradient(to bottom, #000 40%, transparent); }
/* A slight tint: the image keeps its own saturation and sits under a heavier veil than the system's ambient treatment. */
.site-wash .qs-ambient__layer { filter: blur(var(--blur-ambient)) saturate(1.1); }
.site-wash::after { background: color-mix(in srgb, var(--bg) 66%, transparent); }

/* ---------- Shapes and surfaces ---------- */

/* Squircle corners where the browser draws them, round corners elsewhere. */
.site-squircle { border-radius: var(--radius-xl); }
@supports (corner-shape: squircle) {
  .site-squircle { corner-shape: squircle; border-radius: 46px; }
}

/* Liquid glass: the floating button's glass, for anything that floats over the wash or the page. */
.site-liquid { color: var(--ink); border: 1px solid var(--sheet-edge); background: linear-gradient(140deg, color-mix(in srgb, var(--glass-strong) 70%, transparent), color-mix(in srgb, var(--glass) 55%, transparent)), color-mix(in srgb, var(--bg) 45%, transparent); backdrop-filter: blur(var(--blur-control)) saturate(1.8); -webkit-backdrop-filter: blur(var(--blur-control)) saturate(1.8); box-shadow: var(--shadow-fab); }

/* A tinted surface that sits in the page is lifted from below, not from above like a rising sheet. */
.site-tinted { box-shadow: var(--shadow-raised); }

/* Line icons: 24px grid, 1.9px strokes, round caps and joins, in the text colour */
.site-icon { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.site-icon--chevron { stroke-width: 2.4; }

/* Stand-in artwork: muted shapes in one hue, for anything without a cover image. */
.art-base { fill: oklch(0.5 0.045 var(--h)); }
.art-light { fill: oklch(0.78 0.035 var(--h)); }
.art-mid { fill: oklch(0.62 0.05 var(--h)); }
.art-dark { fill: oklch(0.3 0.035 var(--h)); }

/* ---------- Navigation: a floating liquid-glass pill that stays still between pages ---------- */
.site-nav { position: sticky; top: 20px; z-index: 5; display: inline-flex; align-items: center; gap: 2px; padding: 6px; border-radius: var(--radius-pill); view-transition-name: site-nav; }
.site-nav a { height: 44px; padding: 0 18px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; font-size: 16px; font-weight: 600; text-decoration: none; color: var(--ink); transition: background var(--duration-base) ease; }
.site-nav a[aria-current="page"] { background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--stroke); }

/* ---------- Profile: a liquid-glass card with the photo overlapping its top edge, text centred beneath, links bottom right ---------- */
.site-profile-wrap { width: 100%; max-width: 520px; margin-top: 56px; }
.site-profile { position: relative; padding: 0 28px 20px; display: flex; flex-direction: column; align-items: center; gap: var(--space-5); text-align: center; }
.site-profile p { margin: 0; text-wrap: balance; color: color-mix(in srgb, var(--ink) 80%, transparent); }
.site-profile__id { display: flex; flex-direction: column; gap: 4px; }
.site-profile__name { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.012em; }
.site-roles span + span::before { content: " · "; }
.site-profile__sentence { align-self: stretch; }
.site-profile__foot { align-self: stretch; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); text-align: left; }
/* The photo sits above the card's edge and its edge light, so neither shows through it. */
.site-avatar { position: relative; z-index: 1; width: 112px; height: 112px; margin-top: -68px; flex: none; overflow: hidden; border-radius: 50%; background: linear-gradient(180deg, #a5abb8, #858994); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 12px 24px -6px rgba(0, 0, 0, 0.42), 0 30px 52px -18px rgba(0, 0, 0, 0.5); }
.site-avatar > img { position: absolute; max-width: none; display: block; object-fit: cover; }
.site-links { display: flex; gap: var(--space-2); margin-left: auto; }
.site-iconlink { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: var(--glass); border: 1px solid var(--stroke); transition: transform var(--duration-press) ease; }
.site-iconlink:active { transform: scale(.92); }
.site-iconlink svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Media tiles that open a page ---------- */
.site-tile { display: block; color: inherit; text-decoration: none; border-radius: var(--radius-xl); transition: transform var(--duration-press) ease; }
.site-tile:active { transform: scale(.98); }
.site-tile .qs-chip { position: absolute; top: var(--space-5); left: var(--space-5); z-index: 1; }
.site-tile .qs-media__caption { display: flex; flex-direction: column; gap: 4px; }
.site-tile h3, .site-tile p { margin: 0; }
.site-tile p { color: rgba(255, 255, 255, 0.82); }

/* Captions stay readable over light media: a deeper scrim under them, and a light one at the top for the chip. */
.site-tile .qs-media__scrim { background: linear-gradient(to top, rgba(3, 5, 16, .88) 0%, rgba(3, 5, 16, .7) 38%, rgba(3, 5, 16, 0) 76%), linear-gradient(to bottom, rgba(3, 5, 16, .26), rgba(3, 5, 16, 0) 20%); }

/* Liquid glass over media: a sheen across the fill, a bright top rim, a soft lower shade and lift, over a blurred, saturated backdrop. */
.site-tile .qs-chip, .site-cover .qs-chip, .site-cover .qs-iconbtn--on-media { border: 1px solid rgba(255, 255, 255, .26); background: linear-gradient(140deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .07) 55%, rgba(255, 255, 255, .13)); backdrop-filter: blur(var(--blur-control)) saturate(1.8) brightness(1.08); -webkit-backdrop-filter: blur(var(--blur-control)) saturate(1.8) brightness(1.08); box-shadow: var(--shadow-glass); text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
/* Over a light cover the glass dims what is behind it, so a white label still reads. The build marks light covers. */
[data-tone="light"] .qs-chip, [data-tone="light"] .qs-iconbtn--on-media { background: linear-gradient(140deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .07) 55%, rgba(255, 255, 255, .13)), rgba(3, 5, 16, .3); backdrop-filter: blur(var(--blur-control)) saturate(1.8) brightness(.5); -webkit-backdrop-filter: blur(var(--blur-control)) saturate(1.8) brightness(.5); }

/* ---------- Feed: one grouped list, a row per entry, with a thumbnail of the page it points to ---------- */
.site-list { padding: 0; overflow: hidden; border-radius: var(--radius-lg); }
.site-row { display: flex; align-items: center; gap: var(--space-4); padding: 14px 18px; }
.site-row + .site-row { border-top: 1px solid var(--stroke); }
.site-row p { margin: 0; }
.site-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.site-thumb { width: 48px; flex: none; aspect-ratio: 1 / 1; border-radius: var(--radius-sm); }
.site-thumb--icon { display: grid; place-items: center; color: var(--ink-2); background: var(--track); }
.site-thumb--icon svg { width: 22px; height: 22px; }
.site-meta { margin: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */
.site-foot { width: 100%; max-width: 1040px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-5); padding-top: var(--space-6); border-top: 1px solid var(--stroke); font-size: 13px; color: var(--ink-2); }
.site-foot__links { display: flex; flex-wrap: wrap; gap: var(--space-6); }

/* ---------- Project page: one tinted surface, coloured from the cover ---------- */
.site-project { width: 100%; max-width: 760px; padding: 0; overflow: hidden; }
.site-cover { position: relative; }
.site-cover .qs-media { border-radius: 0; }
.site-cover__back { position: absolute; top: 16px; left: 16px; z-index: 2; }
.site-cover__chips { position: absolute; top: 22px; right: 16px; z-index: 2; display: flex; gap: var(--space-2); }
.site-project__body { position: relative; margin-top: -48px; padding: 0 40px 40px; display: flex; flex-direction: column; gap: 28px; }
.site-project__head { display: flex; flex-direction: column; gap: 10px; }
.site-project__head .display-lead { max-width: 36ch; color: rgba(255, 255, 255, 0.8); }
.site-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: var(--space-3); }
.site-facts dt { color: rgba(255, 255, 255, 0.66); }
.site-facts dd { margin: 4px 0 0; }
.site-facts a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* The hero of a page is where a tile's media arrives. */
.site-hero-media { view-transition-name: qs-shared; }

/* ---------- Blog post ---------- */
.site-post { width: 100%; max-width: 880px; display: flex; flex-direction: column; align-items: center; gap: 40px; }
.site-post__head { max-width: 620px; display: flex; flex-direction: column; align-items: center; gap: var(--space-5); text-align: center; }
.site-post__head .display-lead { max-width: 36ch; color: var(--ink-2); }
.site-post > .qs-media { width: 100%; }

/* Long-form text */
.site-prose { width: 100%; max-width: 60ch; font-size: 17px; line-height: 1.47; letter-spacing: -0.01em; }
.site-prose > * { margin: 0 0 var(--space-5); }
.site-prose > *:last-child { margin-bottom: 0; }
.site-prose h2, .site-prose h3 { margin: 36px 0 var(--space-3); font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.012em; }
.site-prose h3 { font-size: 19px; }
.site-prose a { color: inherit; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--track-strong); text-underline-offset: 3px; }
.site-prose ul, .site-prose ol { padding-left: 1.2em; }
.site-prose li + li { margin-top: var(--space-1); }
.site-prose img { display: block; height: auto; border-radius: var(--radius-md); }
.site-prose code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; letter-spacing: 0; }
.site-prose :not(pre) > code { padding: 2px 8px; border-radius: var(--radius-pill); background: var(--track); }
.site-prose pre { padding: 16px 18px; overflow-x: auto; line-height: 1.55; border-radius: var(--radius-md); background: var(--glass); border: 1px solid var(--stroke); }
.site-prose blockquote { padding: 14px 16px; border-radius: var(--radius-md); color: var(--ink-2); background: var(--glass); border: 1px solid var(--stroke); }
.site-prose blockquote > *:last-child { margin-bottom: 0; }
.qs-surface--tinted .site-prose a { color: var(--hi); text-decoration-color: currentColor; }

/* ---------- Not found ---------- */
.site-notfound { align-items: center; padding-top: 56px; text-align: center; }
.site-notfound p { margin: 0; color: var(--ink-2); }

/* ---------- Hover: cards lift, lean towards the pointer and catch the light ---------- */
/* hover.js reports the pointer's place on the card. --px and --py run from -1 to 1 across it; --mx and --my are the same point as percentages. */
.site-tile, .site-profile-wrap { --px: 0; --py: 0; --mx: 50%; --my: 0%; }

@media (hover: hover) and (pointer: fine) {
  /* Settling back is slow; following the pointer is quick. */
  .site-tile .qs-media, .site-tile .qs-media > img, .site-tile .qs-media > svg, .site-tile .qs-media__caption, .site-tile .qs-chip, .site-profile, .site-avatar { transition: transform var(--duration-move) var(--ease-standard), box-shadow var(--duration-move) var(--ease-standard); }
  .site-tile:hover .qs-media, .site-tile:hover .qs-media > img, .site-tile:hover .qs-media > svg, .site-tile:hover .qs-media__caption, .site-tile:hover .qs-chip, .site-profile-wrap:hover .site-profile, .site-profile-wrap:hover .site-avatar { transition-duration: 180ms; }

  /* A tile rises and leans. Inside it, the picture drifts against the pointer and the words drift with it, which gives the tile depth. */
  .site-tile:hover .qs-media { transform: perspective(900px) rotateX(calc(var(--py) * -3.5deg)) rotateY(calc(var(--px) * 4.5deg)) translateY(-5px) scale(1.012); box-shadow: 0 46px 70px -32px rgba(0, 0, 0, .62); }
  .site-tile:hover .qs-media > img, .site-tile:hover .qs-media > svg { transform: scale(1.05) translate(calc(var(--px) * -5px), calc(var(--py) * -5px)); }
  .site-tile:hover .qs-media__caption, .site-tile:hover .qs-chip { transform: translate(calc(var(--px) * 3px), calc(var(--py) * 3px)); }

  /* The profile card barely leans, being glass, and follows the pointer more slowly. Its photo floats a touch further than the card. */
  .site-profile-wrap:hover .site-profile, .site-profile-wrap:hover .site-avatar { transition-duration: 320ms; }
  .site-profile-wrap:hover .site-profile { transform: perspective(1100px) rotateX(calc(var(--py) * -0.9deg)) rotateY(calc(var(--px) * 1.1deg)) translateY(-2px); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6), inset 0 -1px 2px rgba(0, 0, 0, .1), 0 22px 38px -14px rgba(0, 0, 0, .4), 0 3px 8px rgba(0, 0, 0, .11); }
  .site-profile-wrap:hover .site-avatar { transform: translate(calc(var(--px) * 2px), calc(var(--py) * 1.5px - 1px)) scale(1.015); }

  /* Light: a soft glow under the pointer, and a brighter line along the nearest edge. */
  .site-tile .qs-media::after, .site-tile .qs-media::before, .site-profile::before, .site-profile::after { content: ""; position: absolute; pointer-events: none; border-radius: inherit; corner-shape: inherit; opacity: 0; transition: opacity var(--duration-base) ease; }
  .site-tile .qs-media::after { inset: 0; background: radial-gradient(520px circle at var(--mx) var(--my), rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 55%); }
  .site-profile::before { inset: 0; z-index: -1; background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--glass-strong) 55%, transparent), transparent 62%); }
  .site-tile .qs-media::before, .site-profile::after { padding: 1px; background: radial-gradient(300px circle at var(--mx) var(--my), rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 70%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
  .site-tile .qs-media::before { inset: 0; z-index: 2; }
  .site-profile::after { inset: -1px; }
  .site-tile:hover .qs-media::after, .site-tile:hover .qs-media::before, .site-profile-wrap:hover .site-profile::before, .site-profile-wrap:hover .site-profile::after { opacity: 1; }

  /* Controls answer more quietly. */
  .site-nav a:hover:not([aria-current]) { background: var(--glass); }
  .site-iconlink { transition: transform var(--duration-base) var(--ease-standard), background var(--duration-base) ease; }
  .site-iconlink:hover { transform: scale(1.08); background: var(--glass-strong); }
}

/* With reduced motion the light still responds, and nothing moves. */
@media (prefers-reduced-motion: reduce) {
  .site-tile:hover .qs-media, .site-tile:hover .qs-media > img, .site-tile:hover .qs-media > svg, .site-tile:hover .qs-media__caption, .site-tile:hover .qs-chip, .site-profile-wrap:hover .site-profile, .site-profile-wrap:hover .site-avatar, .site-iconlink:hover { transform: none; }
}

/* ---------- Phones ---------- */
@media (max-width: 699px) {
  .site-page { gap: 48px; padding: 64px var(--space-6) calc(120px + env(safe-area-inset-bottom, 0px)); }
  .site-main { gap: 48px; }
  .site-wash { height: 600px; }
  .site-heading { font-size: 24px; }
  .site-section { gap: var(--space-5); }

  /* The navigation moves to the bottom, within reach of a thumb. */
  .site-nav { position: fixed; top: auto; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); }

  .site-profile-wrap { margin-top: 34px; }
  .site-profile { padding: 0 20px 16px; gap: var(--space-4); }
  .site-avatar { width: 96px; height: 96px; margin-top: -58px; }
  .site-profile__name { font-size: 20px; }
  .site-roles { font-size: 14px; }
  .site-roles span { display: block; }
  .site-roles span + span::before { content: none; }
  .site-profile__sentence { font-size: 16px; }

  /* Tiles: a sideways rail on the home page, one column elsewhere. The rail's padding leaves room for the tiles' shadows. */
  .site-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .site-grid--rail { display: flex; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-left: 20px; margin: 0 -20px -64px; padding: 0 20px 64px; }
  .site-grid--rail::-webkit-scrollbar { display: none; }
  .site-grid--rail > .site-tile { flex: none; width: 280px; scroll-snap-align: start; }
  .site-more { align-self: stretch; }

  .site-project__body { padding: 0 var(--space-7) 28px; }
}
