/* Page CSS on top of the taste-skill kit (assets/system.css): only what the kit lacks.
   The kit owns tokens, grid, type, buttons, nav, footer and hover motion; nothing here restyles those. */

:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);   /* strong ease-out for the viewer and press states */
}

/* Browser surfaces the kit leaves at their defaults. */
::selection { background: var(--p-accent); color: var(--p-accent-ink); }
html { scrollbar-color: color-mix(in oklab, var(--p-ink) 35%, transparent) transparent; accent-color: var(--p-accent); }
input, textarea { caret-color: var(--p-accent); }

/* ------------------------------------------------------------ linked tiles */
a.tile { text-decoration: none; }
a.tile:focus-visible { outline: 2px solid var(--p-action); outline-offset: 4px; border-radius: var(--r-lg); }
.tile__name { margin: 0; font: 500 var(--t-card)/1.3 var(--font-text); letter-spacing: -0.01em; text-wrap: balance; }
.reel { --tile-ratio: 9 / 16; }


/* ------------------------------------------------------------ showreel frame */
/* The film keeps its own ratio inside the one-screen frame, letterboxed on the dark ground. */
.showreel { background: var(--p-inv-bg); overflow: clip; border-radius: var(--r-lg); }
.showreel > video.frame__img { object-fit: contain; }
.showreel:has(video:focus-visible) { outline: 2px solid var(--p-action); outline-offset: 4px; }
.showreel > video:focus-visible { outline: 2px solid var(--p-inv-ink); outline-offset: -6px; }
/* Upright screens (tablet, phone): the frame takes a set share of the screen so the section is never mostly empty. */
@media (max-width: 1023px) { .showreel { height: 56svh; } }
@media (max-width: 639px) { .showreel { height: auto; aspect-ratio: 4 / 5; } }

/* ------------------------------------------------------------ photograph wall (home) */
.wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; border-radius: var(--r-lg); overflow: clip; }
.wall > a { display: block; aspect-ratio: 16 / 15; }
.wall--reels > a { aspect-ratio: 9 / 16; }
.wall--row > a { aspect-ratio: 4 / 5; }
.wall img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wall > a:focus-visible, .masonry > a:focus-visible { outline: 2px solid var(--p-action); outline-offset: -2px; }
/* Upright screens: four photographs two-up fill the screen better than eight small ones. */
@media (max-width: 1023px) {
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall > a { aspect-ratio: 1; }
  .wall > a:nth-child(n + 5) { display: none; }
  .wall--reels > a { aspect-ratio: 9 / 16; }
  .wall--reels > a:nth-child(n + 3) { display: none; }
}
@media (max-width: 639px) {
  .wall--reels > a { aspect-ratio: 4 / 5; }
  .wall--reels > a:nth-child(n + 3) { display: block; }
}
/* Editing work on a tablet: the first edit across the row, large. */
@media (min-width: 640px) and (max-width: 1023px) {
  #work .work-tile { grid-column: 1 / -1; --tile-ratio: 4 / 3; }
  #work .work-tile + .work-tile { display: none; }
}

/* ------------------------------------------------------------ project form panel */
.project-form { background: var(--g-alt, var(--p-surface)); border-radius: var(--r-lg); padding: var(--s-6); }
.project-form textarea { min-height: 120px; }
.project-intro { display: grid; gap: var(--s-7); align-content: start; }
.project-photo { align-self: stretch; height: 100%; min-height: 320px; }
.project-intro > .section-head { margin-bottom: 0; }
/* Stacked (tablet and phone) the text, the photograph and the form take two screens. */
@media (max-width: 1023px) {
  #project { --h: 2; }
  /* the photograph takes whatever the text and the form leave of the two screens */
  #project > .wrap { display: flex; flex-direction: column; gap: var(--s-6); }
  /* stacked, the form stands on the page ground on the container's own lines */
  .project-form { background: none; padding: 0; border-radius: 0; }
  .project-intro { gap: var(--s-6); }
  .project-photo { flex: 1 1 0; height: auto; min-height: 240px; }
}
.field--trap { position: absolute; left: -200vw; width: 1px; height: 1px; overflow: hidden; }
.form-errors { margin: 0 0 var(--s-5); padding: 0; list-style: none; color: color-mix(in oklab, #d92d20 72%, var(--p-ink)); font-weight: 500; }
.form-errors:empty { display: none; }

/* ------------------------------------------------------------ archive pages (work, reels, photographs, about) */
/* These list everything, so they grow with their content instead of holding one screen. */
main > section.archive { height: auto; min-height: 100svh; }
.archive h1 { font: var(--display-weight) var(--t-h2)/1.1 var(--font-display); letter-spacing: var(--display-tracking); }
.archive__empty { color: var(--p-muted); }
.archive-grid { row-gap: var(--s-7); }
.archive-grid > .work-tile { grid-column: span 4; }
@media (max-width: 1023px) { .archive-grid > .work-tile { grid-column: span 6; } }
@media (max-width: 639px) {
  .archive-grid > .work-tile { grid-column: 1 / -1; }
  .archive-grid--reels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-grid--reels > .reel { grid-column: auto; }
}

.masonry { columns: 4; column-gap: var(--s-3); }
.masonry > a { display: block; margin-bottom: var(--s-3); break-inside: avoid; border-radius: var(--r-sm); background: var(--p-surface); }
.masonry img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1023px) { .masonry { columns: 3; } }
@media (max-width: 639px) { .masonry { columns: 2; column-gap: var(--s-2); } .masonry > a { margin-bottom: var(--s-2); } }

.about__bio { display: grid; gap: var(--s-4); max-width: 62ch; font-size: var(--t-lead); line-height: 1.5; }
.about__bio > div { display: grid; gap: var(--s-4); }   /* the bio's own paragraphs, kept together for the page editor */
.about__h2 { margin: var(--s-8) 0 var(--s-5); font: var(--display-weight) var(--t-h3)/1.2 var(--font-display); letter-spacing: var(--display-tracking); }
.about__clients { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); margin: 0; padding: 0; list-style: none; font-size: var(--t-lead); }
.about__quote { margin: var(--s-8) 0 0; }
.about__action { margin-top: var(--s-8); }

/* ------------------------------------------------------------ legal page (privacy, cookies, copyright) */
/* One readable column of plain text. */
.legal { display: grid; gap: var(--s-4); max-width: 68ch; line-height: 1.6; }
.legal__nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); }
.legal h2 { margin-top: var(--s-8); font: var(--display-weight) var(--t-h3)/1.2 var(--font-display); letter-spacing: var(--display-tracking); scroll-margin-top: calc(var(--nav) + var(--s-5)); }
.legal h3 { margin-top: var(--s-5); font: 500 var(--t-card)/1.3 var(--font-text); letter-spacing: -0.01em; }
.legal ul { display: grid; gap: var(--s-3); margin: 0; padding-left: 1.2em; }
.legal code { font-size: 0.9em; overflow-wrap: anywhere; }
.legal p > .link, .legal li > .link { display: inline; }
.legal .link::after { content: none; }

/* ------------------------------------------------------------ pictures fly in */
/* Gallery pictures wait just below their place, a little small, and fly up into it once they have loaded and
   reached the screen (site.js adds .is-in, then .is-done so hover motion gets the element back untouched).
   Only while html.fly-js is set (by the head script): with no script, or once the 4 s safety mark (.fly-safe) is
   set because the page script never announced itself (.fly-ready), every picture simply stands where it belongs. */
html.fly-js:not(.fly-safe) :is(.masonry > a, .archive-grid > a, .wall > a, #work .work-tile, .project-photo):not(.is-done) {
  opacity: 0;
  transform: translate3d(0, 64px, 0) scale(0.94);
  transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: var(--fly-delay, 0ms);
  will-change: transform, opacity;
}
html.fly-js:not(.fly-safe) :is(.masonry > a, .archive-grid > a, .wall > a, #work .work-tile, .project-photo).is-in:not(.is-done) {
  opacity: 1;
  transform: none;
}
/* Reduced motion: no travel, a short fade only. */
@media (prefers-reduced-motion: reduce) {
  html.fly-js:not(.fly-safe) :is(.masonry > a, .archive-grid > a, .wall > a, #work .work-tile, .project-photo):not(.is-done) {
    transform: none;
    transition: opacity 200ms ease;
    transition-delay: 0ms;
  }
}

/* ------------------------------------------------------------ viewer (photographs, films, embeds) */
.viewer {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: #f4f2ef; overflow: hidden;
  display: grid; grid-template-rows: minmax(0, 1fr) auto; place-items: center;
  opacity: 0; transform: scale(0.97);
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out), overlay 150ms allow-discrete, display 150ms allow-discrete;
}
.viewer:not([open]) { display: none; }
.viewer[open] { opacity: 1; transform: none; transition-duration: 220ms; }
@starting-style { .viewer[open] { opacity: 0; transform: scale(0.97); } }
.viewer::backdrop { background: rgb(20 19 18 / 0); transition: background-color 150ms var(--ease-out), overlay 150ms allow-discrete, display 150ms allow-discrete; }
.viewer[open]::backdrop { background: rgb(20 19 18 / 0.94); transition-duration: 220ms; }
@starting-style { .viewer[open]::backdrop { background: rgb(20 19 18 / 0); } }

.viewer__stage { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 0; padding: 56px 72px 8px; touch-action: pan-y; }
.viewer__stage > * { display: block; max-width: 100%; max-height: 100%; border: 0; border-radius: var(--r-sm); background: #111; }
/* sized from the viewport, so a tall photograph is never taller than the room above its title */
.viewer__stage > img { width: auto; height: auto; max-width: min(100%, calc(100vw - 144px)); max-height: calc(100dvh - 128px); object-fit: contain; background: none; user-select: none; -webkit-user-drag: none; }
.viewer__stage > :is(video, iframe) { aspect-ratio: var(--viewer-ratio, 16 / 9); height: auto; width: min(100%, calc((100dvh - 120px) * var(--viewer-ratio-n, 1.7778))); }
.viewer__stage > iframe.viewer__embed { aspect-ratio: auto; width: min(100%, 420px); height: calc(100dvh - 128px); background: #fff; }
.viewer__title { margin: 0; padding: 8px 72px 20px; min-height: 48px; font-size: var(--t-small); text-align: center; color: #c9c5bf; }
.viewer__title:empty { visibility: hidden; }

.viewer__btn {
  position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: rgb(255 255 255 / 0.1); color: inherit; cursor: pointer;
  transition: background-color 150ms ease, transform 160ms var(--ease-out);
}
.viewer__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.viewer__btn:active { transform: scale(0.94); }
.viewer__btn:focus-visible { outline: 2px solid #f4f2ef; outline-offset: 2px; }
.viewer__btn--close { top: 12px; right: 16px; }
.viewer__btn--prev { left: 16px; top: 50%; margin-top: -22px; }
.viewer__btn--next { right: 16px; top: 50%; margin-top: -22px; }
.viewer__btn[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .viewer__btn:hover { background: rgb(255 255 255 / 0.2); } }
@media (max-width: 639px) {
  .viewer__stage { padding: 64px 0 8px; }
  .viewer__stage > img { max-width: 100%; max-height: calc(100dvh - 190px); }
  .viewer__stage > iframe.viewer__embed { height: calc(100dvh - 190px); }
  .viewer__title { padding-inline: 16px; }
  .viewer__btn--prev, .viewer__btn--next { top: auto; bottom: 12px; margin-top: 0; }
  .viewer__title { padding-bottom: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  .viewer, .viewer[open] { transform: none; }
  .viewer__btn:active { transform: none; }
}

/* The services walk-through rests as a plain list on a phone; hold it to two whole screens so the next section starts on one. */
@media (max-width: 1023px) { #services:not(.is-live) { min-height: calc(2 * 100lvh); } }

/* Narrow bars: the name and the menu button come first; the main action is in the hero and the menu sheet. */
@media (max-width: 400px) { .nav:not(.is-open) .nav__actions { display: none; } .nav:not(.is-open) .nav__actions + .nav__toggle { margin-left: auto; } }
/* A section's "See all" link runs the full line on a phone, like the buttons. */
@media (max-width: 639px) { .section-head--split > .link { width: 100%; } }
/* The home tagline sits on one line at every width: sized to its text column. site.js measures the tagline's
   width in em into --tagline-em; 13.6 is the fallback ("Editor | Director | Photographer" measures about 13.1em). */
.hero__text:has(> #hero-h) { container-type: inline-size; width: 100%; }   /* a size container never shrinks to its content, so give it the column */
.hero #hero-h { white-space: nowrap; text-wrap: nowrap; font-size: min(var(--ly-h1), 100cqi / var(--tagline-em, 13.6)); }
/* Footer link columns share the row evenly on a tablet. */
@media (min-width: 640px) and (max-width: 1023px) {
  .closing__links > .grid > .stack-4 { grid-column: 1 / -1; }
  .closing__links > .grid > .footer__col { grid-column: span 6; }
}

/* Tablet (upright): the services list rests as a column of photographs; taller frames carry its two screens.
*/
@media (min-width: 640px) and (max-width: 1023px) {
  #services:not(.is-live) .mo-pc__visual > img { width: 100%; aspect-ratio: auto; height: 34svh; max-height: none; object-fit: cover; }
}

/* The footer, compact at the owner's request (2026-11-21): as tall as its content, not the design kit's one full
   screen. On a wide screen the close is one row (heading and line on the left, the button on the right), then the
   link columns and the legal row. Same specificity as the kit's rules and later, so these win at every width. */
footer.closing { height: auto; min-height: 0; padding: var(--s-9) 0 calc(var(--s-6) + var(--bar)); }
footer.closing > .wrap { height: auto; grid-template-rows: auto auto; row-gap: var(--s-8); }
footer.closing .closing__links { gap: var(--s-6); }
@media (min-width: 1024px) {
  .closing__cta.close--type { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: var(--s-7); }
  .closing__cta.close--type > .btn--xl:not(.btn--wide) { width: auto; flex: none; align-self: flex-end; padding-inline: var(--s-7); }
}
@media (max-width: 639px) {
  footer.closing { padding-top: var(--s-8); }
  footer.closing > .wrap { row-gap: var(--s-7); }
}

/* The home page's menu has five words (Work, Reels, Photographs, Services, About). On a small laptop (1024-1279) they
   sit closer and the centred name is a little smaller, so the last word never reaches the name. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .nav--split .nav__bar { gap: var(--s-5); }
  .nav--split .nav__link { font-size: 14px; padding: 0 6px; }
  .nav--split .nav__link::before, .nav--split .nav__link[aria-current="page"]::after { left: 6px; right: 6px; }
  .nav--split .nav__logo { font-size: 22px; }
}
