/* PHX kit 1.0.0 components. Requires tokens.css. Hubot is ALWAYS uppercase. No hairlines. One button, one size. */

/* Base */
.phx,.phx *,.phx *:before,.phx *:after,.btn{box-sizing:border-box}
.phx{background:var(--phx-color-surface-base);color:var(--phx-color-text-primary);font:var(--phx-font-weight-text) var(--phx-font-size-body)/var(--phx-font-line-height-body) var(--phx-font-family-text);-webkit-font-smoothing:antialiased}
.phx-h2,.phx h2{font:var(--phx-font-weight-display) var(--phx-font-size-h2)/var(--phx-font-line-height-heading) var(--phx-font-family-display);text-transform:uppercase;letter-spacing:var(--phx-font-tracking-caps);margin:0 0 var(--phx-space-4)}
.phx-h3{font:var(--phx-font-weight-display) var(--phx-font-size-h3)/var(--phx-font-line-height-title) var(--phx-font-family-display);text-transform:uppercase;letter-spacing:var(--phx-font-tracking-caps);margin:0 0 var(--phx-space-3)}
.phx-title{font:var(--phx-font-weight-display) var(--phx-font-size-title)/var(--phx-font-line-height-title) var(--phx-font-family-display);text-transform:uppercase;letter-spacing:var(--phx-font-tracking-caps);margin:0 0 var(--phx-space-2)}
.phx-display{font:var(--phx-font-weight-display-heavy) var(--phx-font-size-display)/var(--phx-font-line-height-display) var(--phx-font-family-display);text-transform:uppercase;letter-spacing:var(--phx-font-tracking-display);margin:0}
.phx-lead{font-size:var(--phx-font-size-lead);line-height:1.6;color:var(--phx-color-text-body);max-width:var(--phx-size-measure);margin:0}
.phx-body{font-size:var(--phx-font-size-body);color:var(--phx-color-text-body)}
.phx-label{font:var(--phx-font-weight-display) var(--phx-font-size-label)/var(--phx-font-line-height-title) var(--phx-font-family-display);text-transform:uppercase;letter-spacing:var(--phx-font-tracking-caps-small)}
.phx-caption{font-size:var(--phx-font-size-label);line-height:1.45;color:var(--phx-color-text-body)}

/* Stroke caps: stroke painted under a ground-coloured fill, which hides inner contour overlaps. Visible outline about .022em, min 1.5px */
.phx-stroke{color:var(--phx-stroke-ground,var(--phx-color-surface-base));-webkit-text-stroke:max(3px,.044em) var(--phx-stroke-ink,var(--phx-color-text-primary));paint-order:stroke fill;text-transform:uppercase}

/* THE button: phxwebsites components/kit (pill, 44px, 8px/22px, no border). One size. Hubot caps lettering */
.btn{display:inline-flex;flex:none;width:auto;max-width:max-content;font-synthesis:none;-webkit-font-smoothing:antialiased;align-items:center;justify-content:center;gap:8px;box-sizing:border-box;height:var(--phx-button-height);min-height:var(--phx-button-height);padding:var(--phx-button-pad-y) var(--phx-button-pad-x);border:0;border-radius:var(--phx-radius-pill);cursor:pointer;text-decoration:none;white-space:nowrap;font-family:var(--phx-font-family-display);font-size:var(--phx-button-font-size);font-weight:var(--phx-button-weight);line-height:var(--phx-button-line-height);letter-spacing:var(--phx-button-tracking);text-transform:uppercase;background:var(--phx-color-action-primary);color:var(--phx-color-action-primary-ink);transition:background-color var(--phx-duration-hover) ease,transform 90ms ease}
.btn:hover{background:var(--phx-color-action-primary-hover)}
.btn:active{transform:scale(.98)}
.btn-2{background:var(--phx-color-action-secondary);color:var(--phx-color-action-secondary-ink)}
.btn-2:hover{background:var(--phx-color-action-secondary-hover)}
.btn svg{width:16px;height:16px;flex:none}

/* Icon control: quiet media controls only (sound, pause/play). Not for actions; actions use .btn. 44px hit area, no pill, no border, aria-label required */
.phx-icon-btn{display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--phx-button-height);height:var(--phx-button-height);padding:0;border:0;border-radius:50%;background:none;color:var(--phx-color-text-primary);cursor:pointer;opacity:.75;transition:opacity var(--phx-duration-hover) ease}
.phx-icon-btn:hover,.phx-icon-btn[aria-pressed="true"]{opacity:1}
.phx-icon-btn svg{width:22px;height:22px}
.phx-icon-btn:focus-visible{outline:2px solid var(--phx-color-focus-ring);outline-offset:0}

/* Focus, every interactive element, both themes */
.phx a:focus-visible,.phx button:focus-visible,.phx input:focus-visible,.phx select:focus-visible,.phx textarea:focus-visible,.phx video:focus-visible,.phx [tabindex]:focus-visible,.phx summary:focus-visible,.btn:focus-visible{outline:2px solid var(--phx-color-focus-ring);outline-offset:3px}

/* Section shell and tonal planes */
.phx-wrap{max-width:var(--phx-size-content);margin:0 auto;padding:0 var(--phx-space-gutter)}
.phx-section{padding:var(--phx-space-section) 0}
.phx-section.tone{background:var(--phx-color-surface-raised)}
.phx-plane{background:var(--phx-color-surface-raised);border-radius:var(--phx-radius-plane);padding:var(--phx-space-6)}
.phx-section.tone .phx-plane{background:var(--phx-color-surface-base)}
.phx-head{max-width:760px;margin-bottom:var(--phx-space-6)}
.phx-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:var(--phx-space-4)}
.phx-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:var(--phx-space-3);align-items:start}
.phx-cq{container-type:inline-size}

/* Nav: slim, translucent, blur */
.phx-nav{position:sticky;top:0;z-index:20;background:var(--phx-color-surface-glass);backdrop-filter:saturate(180%) blur(16px);-webkit-backdrop-filter:saturate(180%) blur(16px)}
.phx-nav .phx-wrap{display:flex;align-items:center;gap:var(--phx-space-4);height:var(--phx-size-nav)}
.phx-nav .phx-brand{font:var(--phx-font-weight-display-heavy) var(--phx-font-size-title) var(--phx-font-family-display);text-transform:uppercase;letter-spacing:var(--phx-font-tracking-display);color:var(--phx-color-text-primary);text-decoration:none}
.phx-nav nav{display:flex;gap:var(--phx-space-4);margin-left:auto}
.phx-nav nav a{font-size:var(--phx-font-size-label);color:var(--phx-color-text-body);text-decoration:none;transition:color var(--phx-duration-hover)}
.phx-nav nav a:hover{color:var(--phx-color-text-primary)}

/* Accent line (agave is a line, never an area) */
.phx-accent{display:block;width:var(--phx-size-accent-line);height:var(--phx-size-line);border-radius:var(--phx-radius-line);background:var(--phx-color-accent-line)}

/* Fact tiles */
.phx-facts{display:flex;flex-wrap:wrap;gap:var(--phx-space-2)}
.phx-fact{flex:1 1 140px;background:var(--phx-color-surface-raised);border-radius:var(--phx-radius-media);padding:var(--phx-space-3) var(--phx-space-4);min-width:120px}
.phx-fact b{display:block;font:var(--phx-font-weight-display-heavy) var(--phx-font-size-fact)/1 var(--phx-font-family-display);text-transform:uppercase}
.phx-fact span{display:block;font-size:var(--phx-font-size-label);color:var(--phx-color-text-body);margin-top:var(--phx-space-1);line-height:1.35}

/* Chips (filled, never outlined) */
.phx-chip{display:inline-flex;align-items:center;font-size:var(--phx-font-size-label);line-height:1;padding:6px 12px;border-radius:var(--phx-radius-pill);background:var(--phx-color-surface-raised);color:var(--phx-color-text-body)}

/* Status pills: a dot mark plus words; colour never carries meaning alone */
.phx-status{display:inline-flex;align-items:center;gap:var(--phx-space-2);font-size:var(--phx-font-size-label);font-weight:var(--phx-font-weight-text-strong);line-height:1;padding:8px 14px;border-radius:var(--phx-radius-pill);background:var(--phx-color-surface-raised);color:var(--phx-color-text-primary)}
.phx-status:before{content:"";width:8px;height:8px;border-radius:50%;background:var(--phx-color-text-muted)}
.phx-status.is-live:before{background:var(--phx-color-agave)}
.phx-status.is-attention:before{background:var(--phx-color-attention)}
.phx-status.is-attention{color:var(--phx-color-text-attention)}
.phx-status.is-alert:before{background:var(--phx-color-alert)}
.phx-status.is-alert{color:var(--phx-color-text-alert)}

/* Form fields: filled, no hairline borders; error is said in words */
.phx-field{display:flex;flex-direction:column;gap:var(--phx-space-2);max-width:420px}
.phx-field label{font-size:var(--phx-font-size-label);font-weight:var(--phx-font-weight-text-strong);color:var(--phx-color-text-primary)}
.phx-input,.phx-select{height:var(--phx-size-control);padding:0 var(--phx-space-4);border:0;border-radius:var(--phx-radius-pill);background:var(--phx-color-field-fill);color:var(--phx-color-text-primary);font:var(--phx-font-size-body) var(--phx-font-family-text);appearance:none;-webkit-appearance:none}
.phx-input:hover,.phx-select:hover{background:var(--phx-color-field-fill-hover)}
.phx-select{background-image:linear-gradient(45deg,transparent 50%,var(--phx-color-text-body) 50%),linear-gradient(135deg,var(--phx-color-text-body) 50%,transparent 50%);background-position:calc(100% - 22px) 50%,calc(100% - 16px) 50%;background-size:6px 6px;background-repeat:no-repeat;padding-right:var(--phx-space-6)}
.phx-field.is-error .phx-input{background:var(--phx-color-field-error-fill)}
.phx-help{font-size:var(--phx-font-size-label);color:var(--phx-color-text-body);margin:0}
.phx-field.is-error .phx-help{color:var(--phx-color-text-alert);font-weight:var(--phx-font-weight-text-strong)}
.phx-check{display:inline-flex;align-items:center;gap:var(--phx-space-3);font-size:var(--phx-font-size-body);cursor:pointer}
.phx-check input{appearance:none;-webkit-appearance:none;width:22px;height:22px;margin:0;border-radius:6px;background:var(--phx-color-field-fill-hover);display:grid;place-content:center;cursor:pointer}
.phx-check input:checked{background:var(--phx-color-action-primary)}
.phx-check input:checked:after{content:"";width:10px;height:6px;border-left:2.5px solid var(--phx-color-action-primary-ink);border-bottom:2.5px solid var(--phx-color-action-primary-ink);transform:rotate(-45deg) translate(1px,-1px)}
.phx-toggle{display:inline-flex;align-items:center;gap:var(--phx-space-3);font-size:var(--phx-font-size-body);cursor:pointer}
.phx-toggle input{appearance:none;-webkit-appearance:none;width:44px;height:26px;margin:0;border-radius:var(--phx-radius-pill);background:var(--phx-color-field-fill-hover);position:relative;cursor:pointer;transition:background var(--phx-duration-hover)}
.phx-toggle input:after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:var(--phx-color-surface-base);transition:transform var(--phx-duration-hover)}
.phx-toggle input:checked{background:var(--phx-color-action-primary)}
.phx-toggle input:checked:after{transform:translateX(18px)}

/* Media tiles (one radius) */
.phx-media{position:relative;display:block;border-radius:var(--phx-radius-media);overflow:hidden;background:var(--phx-color-surface-sunken)}
.phx-media img,.phx-media video{display:block;width:100%;height:100%;object-fit:cover;transition:transform var(--phx-duration-media) var(--phx-easing-out)}
.phx-media:hover img{transform:scale(1.02)}
.r916{aspect-ratio:9/16}.r45{aspect-ratio:4/5}.r11{aspect-ratio:1/1}.r169{aspect-ratio:16/9}

/* Reel gallery frame with chapter label and progress bars */
.phx-reel{width:min(100%,var(--phx-size-reel))}
.phx-reel-frame{position:relative;aspect-ratio:9/16;border-radius:var(--phx-radius-media);overflow:hidden;background:var(--phx-color-picture-shade);box-shadow:var(--phx-shadow-frame)}
.phx-reel-frame:before{content:"";position:absolute;left:0;right:0;top:0;height:22%;z-index:1;background:linear-gradient(180deg,rgba(14,14,14,.45),rgba(14,14,14,0));pointer-events:none}
.phx-reel-frame video{width:100%;height:100%;object-fit:cover;display:block}
.phx-segs{position:absolute;z-index:2;left:12px;right:12px;top:12px;display:flex;gap:var(--phx-space-1)}
.phx-segs button{flex:1;height:14px;padding:5px 0;border:0;background:none;cursor:pointer}
.phx-segs i{display:block;height:3px;border-radius:var(--phx-radius-line);background:rgba(245,245,245,.4);overflow:hidden}
.phx-segs u{display:block;height:100%;width:0;background:var(--phx-color-on-picture)}
.phx-reel-meta{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--phx-space-3);margin-top:var(--phx-space-3)}
.phx-chap{margin:0;font-size:var(--phx-font-size-label);line-height:1.35;color:var(--phx-color-text-primary)}
.phx-chap b{font:var(--phx-font-weight-display) var(--phx-font-size-label) var(--phx-font-family-display);text-transform:uppercase;letter-spacing:var(--phx-font-tracking-caps-small);margin-right:var(--phx-space-2)}

/* Lightbox */
dialog.phx-lb{border:0;padding:0;background:var(--phx-color-picture-shade);max-width:none;max-height:none;width:100vw;height:100vh;margin:0}
.phx-lb-in{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--phx-space-3);padding:var(--phx-space-4)}
.phx-lb video{max-height:calc(100dvh - 150px);max-width:min(92vw,900px);border-radius:var(--phx-radius-media);background:var(--phx-color-picture-shade)}
.phx-lb-bar{display:flex;align-items:center;gap:var(--phx-space-3);color:var(--phx-color-on-picture);font-size:var(--phx-font-size-label)}

/* Scroll reveal (add .rv, JS adds .in) */
.rv{opacity:0;transform:translateY(var(--phx-distance-reveal));transition:opacity var(--phx-duration-reveal) var(--phx-easing-out),transform var(--phx-duration-reveal) var(--phx-easing-out)}
.rv.in{opacity:1;transform:none}

/* Reduced motion covers everything: reveal, hovers, presses, transitions. Pages must also stop autoplay in JS. */
@media (prefers-reduced-motion:reduce){
 .rv{opacity:1;transform:none;transition:none}
 .phx *,.btn,.phx-media img{transition:none!important;animation:none!important}
 .phx-media:hover img,.btn:active{transform:none}
 html{scroll-behavior:auto}
}

.phx-hero h1{white-space:nowrap}
@media (min-width:821px){.phx-hero h1{font-size:min(var(--phx-font-size-display),13.5cqi)!important}}
.phx-hero .phx-hero-grid{grid-template-columns:minmax(0,1fr) var(--phx-size-reel)!important}
.phx-hero .phx-hero-grid>:first-child{min-width:0;container-type:inline-size}
/* Shared mobile hero: statement, actions, then the reel down to its chapter label above the fold */
@media (max-width:820px){.phx-hero{padding-top:var(--phx-space-4)!important}.phx-hero .phx-hero-grid{grid-template-columns:minmax(0,1fr)!important;gap:var(--phx-space-4)!important}.phx-hero .phx-hero-kicker{display:none!important}.phx-hero .phx-reel{justify-self:center}.phx-hero .phx-reel-meta{gap:var(--phx-space-2)}}
@media (max-width:640px){.phx-nav nav{display:none}.phx-nav .btn{margin-left:auto}}

/* 1.3.0 · Never crop work. Every image and video shows whole, centred on a solid ground.
   Story and 9:16 frames sit on black; everything else on the sunken surface. */
.phx-fit,.phx img,.phx video{object-fit:contain!important;object-position:center!important}
.phx-fit-ground,.phx .media,.phx .phx-media,.phx .frame,.phx .cc{background-color:var(--phx-color-surface-sunken)}
.phx .r916,.phx .phx-reel-frame,.phx .reel-frame,.phx .frame,.phx .cc,.phx dialog img,.phx dialog video{background-color:var(--phx-color-picture-shade)}
.phx .media:hover>img,.phx .phx-media:hover img,.phx .ad:hover .media img{transform:none}

/* 1.3.1 · Nothing in the hero changes size over time; the nav row centres its contents */
.phx-nav .phx-wrap,.phx .nav .wrap{min-height:var(--phx-size-nav);height:auto;align-items:center}
.phx-reel-meta,.phx .reel-meta{flex-wrap:nowrap!important;align-items:center;height:var(--phx-button-height);min-height:var(--phx-button-height)}
.phx-chap,.phx .chap{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.35}
.phx .chap span{white-space:nowrap}

/* 1.4.0 · One shell for every portfolio page: nothing moves between pages */
html{scrollbar-gutter:stable}
.phx .nav nav a,.phx-nav nav a{display:inline-flex;align-items:center;height:28px;border-bottom:2px solid transparent;font-weight:var(--phx-font-weight-text)}
.phx .nav nav a[aria-current="page"],.phx-nav nav a[aria-current="page"]{border-bottom-color:var(--phx-color-accent-line);color:var(--phx-color-text-primary)}
.phx-hero .phx-hero-grid{align-items:start!important}
.phx-hero .reelbox,.phx-hero .phx-reel{width:var(--phx-size-reel)!important;max-width:100%}
.phx-hero .reel-frame img{width:100%;height:100%;object-fit:contain}
.phx-hero .line{min-height:calc(2 * 1lh)}
@media (max-width:359px){.phx-hero .line{min-height:calc(3 * 1lh)}.phx-hero .ctas{min-height:calc(var(--phx-button-height) * 2 + var(--phx-space-2));align-content:flex-start}}
/* 1.5.0 · Phone and tablet hero. Tablet (700–820) keeps statement and reel side by side; phones size the reel from the screen height so its label stays above the fold. */
@media (min-width:700px) and (max-width:820px){.phx-hero .phx-hero-grid{grid-template-columns:minmax(0,1fr) var(--phx-size-reel)!important;gap:var(--phx-space-6)!important;align-items:center!important}.phx-hero .reelbox,.phx-hero .phx-reel{width:var(--phx-size-reel)!important;justify-self:end}.phx-hero h1{font-size:min(var(--phx-font-size-display),13.5cqi)!important}}
@media (max-width:699px){.phx-hero .reelbox,.phx-hero .phx-reel{width:clamp(176px,min(64vw,calc((100svh - 440px) * .5625)),300px)!important}}

/* 1.6.0 · Layout system. Frames match the work; galleries balance their rows; text never leaves one word alone. */
/* Frames match the work: an image frame takes the piece's own ratio (from its width/height attributes).
   Only a sanctioned fixed slot ([data-phx-slot], e.g. a phone screen) letterboxes, and the piece fills one side of it. */
.phx .media:has(>img),.phx .phx-media:has(>img){aspect-ratio:auto!important;height:auto}
.phx .media:has(>img)>img,.phx .phx-media:has(>img)>img{display:block;width:100%;height:auto!important;object-fit:contain}
/* Gallery: rows chosen from the tile count (phx-gallery.js); one shared picture height; shorter rows centre */
.phx .phx-gallery{display:flex!important;flex-direction:column!important;columns:auto!important;grid-template-columns:none!important;contain:inline-size;min-width:0;--phx-gallery-gap:var(--phx-space-3);--phx-gallery-max-h:440px;display:flex;flex-direction:column;align-items:center;gap:var(--phx-space-5);width:100%}
.phx-gallery-row{display:flex;justify-content:center;align-items:flex-start;gap:var(--phx-gallery-gap);width:100%}
.phx-gallery-row>*{margin:0;min-width:0}
.phx-gallery .media,.phx-gallery .phx-media{aspect-ratio:auto!important}
.phx-gallery .media>img,.phx-gallery .media>video,.phx-gallery .phx-media>img,.phx-gallery .phx-media>video{width:100%;height:100%!important;object-fit:contain}
.phx-gallery figcaption{text-align:left}
@media (max-width:1024px){.phx-gallery{--phx-gallery-max-h:400px}}
@media (max-width:599px){.phx-gallery{--phx-gallery-gap:var(--phx-space-2);--phx-gallery-max-h:340px;gap:var(--phx-space-4)}}
/* Rag: headings balance, body text avoids short last lines, paragraphs keep a readable measure */
.phx h1,.phx h2,.phx h3,.phx h4,.phx .h3,.phx .phx-h3,.phx .kicker,.phx .lead,.phx figcaption,.phx .chap-n{text-wrap:balance}
.phx p,.phx li,.phx dd{text-wrap:pretty}
.phx main p:not([class*=chap]):not(.day){max-width:68ch}
.phx .phx-grid:not([data-rail-on]){--phx-grid-gap:var(--phx-space-4);display:flex!important;flex-direction:column!important;gap:var(--phx-space-5)!important;grid-template-columns:none!important;contain:inline-size;min-width:0;width:100%}
.phx-grid-row{display:flex;justify-content:center;align-items:flex-start;gap:var(--phx-grid-gap);width:100%}
.phx-grid-row>*{margin:0;min-width:0}
@media (max-width:599px){.phx .phx-grid:not([data-rail-on]){--phx-grid-gap:var(--phx-space-3);gap:var(--phx-space-4)!important}}
.phx-gallery-row .chips{flex-wrap:wrap}.phx-gallery-row .chips span{white-space:normal}
