/* ==========================================================================
   Site updates, October 2026. Loaded last on every page (see includes/header.php).
   Only overrides; the original look, fonts and animations are unchanged.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Client artwork
   assets/images/services: the seven service illustrations are self-captioned
   3:2 cards, so the frame takes the image's own proportions (nothing cropped)
   and the text overlay that used to sit on the old stock photos is hidden.
   assets/images/clients: client logos replace the text wordmarks in the belt.
   -------------------------------------------------------------------------- */
.service-art,.services-page .service-art {
  height:auto;
  min-height:0;
  aspect-ratio:3/2;
  background:#fbe3d6;
}

.service-art>div {
  display:none;
}

.service-stack-visual {
  min-height:0;
  aspect-ratio:3/2;
  align-self:start;
  background:#fbe3d6;
}

.service-stack-visual figcaption {
  display:none;
}

.client-wordmark {
  padding:10px;
}

.client-wordmark img {
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
}

/* --------------------------------------------------------------------------
   Header button: smaller pill, label and arrow centred on one line
   -------------------------------------------------------------------------- */
.nav-cta {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:10px 16px;
  font-size:11px;
  line-height:1;
  white-space:nowrap;
}

.nav-cta span {
  margin-left:0;
  font-size:14px;
  line-height:1;
}

/* --------------------------------------------------------------------------
   Orange "ready to make your brand" sections: the highlighted word was orange on
   orange and disappeared ("MEMORABLE?" on the home page). It now shows in paper.
   -------------------------------------------------------------------------- */
.contact h2 em {
  color:var(--paper);
}

/* --------------------------------------------------------------------------
   Hero footer line: the three labels are centred, so they need a gap between them
   -------------------------------------------------------------------------- */
.hero-foot {
  gap:22px;
  flex-wrap:wrap;
}

/* --------------------------------------------------------------------------
   Project pages: "more ideas" cards take the 3:2 shape of the client artwork
   -------------------------------------------------------------------------- */
.cs-card-media {
  aspect-ratio:3/2;
}

/* --------------------------------------------------------------------------
   Contact pop-up: fits on one screen on every device, nothing scrolls.
   Same layout and interactions, just tighter spacing and smaller type.
   -------------------------------------------------------------------------- */
#contact-dialog {
  width:min(640px,94vw);
  max-height:calc(100svh - 24px);
  padding:clamp(22px,4vh,40px) clamp(20px,4vw,44px);
  overflow:hidden;
  box-sizing:border-box;
}

#contact-dialog .eyebrow {
  font-size:10px;
}

#contact-dialog h2 {
  font-size:clamp(24px,4.4vh,36px);
  line-height:1;
  margin:10px 0 8px;
}

#contact-dialog>p:not(.eyebrow) {
  font-size:13px;
  line-height:1.5;
}

#contact-dialog .dialog-close {
  top:10px;
  right:14px;
  font-size:28px;
}

#contact-form {
  margin-top:14px;
  gap:12px 20px;
  grid-template-columns:1fr 1fr;
}

#contact-form label {
  gap:4px;
  font-size:10px;
}

#contact-form label:nth-of-type(n+3),
#contact-form .pill,
#contact-form>small,
#contact-form .form-status {
  grid-column:1/-1;
}

#contact-form input,
#contact-form select,
#contact-form textarea {
  padding:7px 0;
  font-size:14px;
}

#contact-form textarea {
  height:58px;
  min-height:0;
  resize:none;
}

#contact-form .pill {
  padding:12px 20px;
  font-size:11px;
}

#contact-form>small {
  font-size:10px;
  line-height:1.4;
}

#contact-form .form-status {
  font-size:11px;
  margin:0;
}

#contact-form .form-status:empty {
  display:none;
}

@media(max-width:600px) {
  #contact-form {
    grid-template-columns:1fr;
    gap:10px;
  }
  #contact-dialog>p:not(.eyebrow) {
    font-size:12px;
  }
}

/* Short screens (phones held sideways): intro line and footnote give way, the
   message box sits beside the service list, so the whole form still fits. */
@media(max-height:520px) {
  #contact-dialog {
    max-height:calc(100svh - 12px);
    padding:14px 24px 16px;
  }
  #contact-dialog>p:not(.eyebrow),
  #contact-form>small {
    display:none;
  }
  #contact-dialog h2 {
    font-size:20px;
    margin:4px 0 0;
  }
  #contact-form {
    margin-top:8px;
    gap:6px 18px;
    grid-template-columns:1fr 1fr;
  }
  #contact-form label:nth-of-type(n+3) {
    grid-column:auto;
  }
  #contact-form textarea {
    height:46px;
  }
  #contact-form input,
  #contact-form select,
  #contact-form textarea {
    padding:5px 0;
    font-size:13px;
  }
  #contact-form .pill {
    padding:9px 18px;
  }
}

/* --------------------------------------------------------------------------
   Reading size: body paragraphs go to 16px on desktop; tablets and phones keep
   the original 13 to 15px.
   -------------------------------------------------------------------------- */
@media(min-width:1025px) {
  .hero-bottom p,
  .statement-bottom p,
  .services-heading>p,
  .service-content p,
  .case-content>p:not(.eyebrow),
  .philosophy>p:last-child,
  .contact>div>p,
  dialog>p:not(.eyebrow),
  .page-heading p,
  .team-member p,
  .cs-facts dd,
  .cs-brief-grid p,
  .cs-gallery-head p,
  .service-stack-hint,
  .enquiry-section p,
  .services-page .service-content p,
  .services-page .service-content ul,
  .services-page .service-stack-copy .service-content p {
    font-size:16px;
  }
  .footer-main p,
  .client-logos-heading p,
  .enquiry-section label {
    font-size:14px;
  }
}

/* --------------------------------------------------------------------------
   Hero image pop-up (mobile)
   Phones: the hero cards are tappable and open full size in #hero-lightbox.
   Wired up in assets/js/pages/home-hero.js.
   -------------------------------------------------------------------------- */
#hero-lightbox {
  width:min(94vw,640px);
  max-height:calc(100svh - 24px);
  padding:0;
  overflow:hidden;
  box-sizing:border-box;
}

#hero-lightbox figure {
  margin:0;
}

#hero-lightbox img {
  width:100%;
  height:auto;
  max-height:calc(100svh - 90px);
  object-fit:contain;
  background:var(--ink);
}

#hero-lightbox figcaption {
  font-size:10px;
  font-weight:600;
  letter-spacing:.08em;
  padding:14px 16px;
}

#hero-lightbox .dialog-close {
  top:10px;
  right:10px;
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:var(--paper);
  font-size:26px;
  line-height:1;
  box-shadow:0 4px 14px #0003;
}

@media(max-width:700px) {
  .hero .float-ad {
    pointer-events:auto;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
  }
}

@media(prefers-reduced-motion:no-preference) {
  #hero-lightbox[open] {
    animation:hero-lightbox-in .35s cubic-bezier(.2,.7,.2,1);
  }
}

@keyframes hero-lightbox-in {
  from {
    opacity:0;
    scale:.92;
  }
}

/* Hero: the top-right card sits inside the screen edge now, so its caption
   goes to the outer corner where the headline doesn't cover it. */
.fashion>span {
  text-align:right;
}

/* --------------------------------------------------------------------------
   Home: selected work (#work)
   Client logo cards. While pinned, the slider is a column that fits the screen
   under the fixed nav with equal space above and below. The cards take all the
   height that is left and keep the 16:9 shape of the logo artwork, so the logo
   is never cropped. A dark fade behind each heading keeps it readable on the
   light artwork; the heading scales with the card (cqw) so it stays on one
   line below the logo.
   -------------------------------------------------------------------------- */
.home-page .project-button {
  container-type:inline-size;
}

.home-page .project-button img {
  object-position:50% 60%;
}

.home-page .project-button:before {
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:36%;
  min-height:90px;
  background:linear-gradient(to top,rgba(23,23,20,.92),rgba(23,23,20,.75) 45%,rgba(23,23,20,0));
  z-index:1;
  pointer-events:none;
}

.home-page .project-overlay {
  z-index:2;
  left:clamp(14px,3.2cqw,36px);
  right:clamp(14px,3.2cqw,36px);
  bottom:clamp(12px,3.2cqw,32px);
  font-size:clamp(18px,3.4vw,56px);
  font-size:clamp(18px,5.2cqw,58px);
  font-weight:700;
  letter-spacing:-.025em;
  line-height:1.05;
  text-shadow:0 2px 18px rgba(0,0,0,.45);
}

.home-page .work .section-label {
  color:#cfccc5;
}

.home-page .project-meta {
  flex-wrap:wrap;
  gap:4px 20px;
  font-size:clamp(11px,.85vw,14px);
  letter-spacing:.05em;
  line-height:1.4;
}

.home-page .project-meta span:first-child {
  font-weight:700;
  text-transform:uppercase;
}

.home-page .project-meta span:last-child {
  font-weight:600;
  color:#dedbd4;
}

@media(min-width:701px) and (prefers-reduced-motion:no-preference) {
  .home-page .work-sticky {
    --work-nav:var(--nav-compact);
    --work-gap:clamp(16px,3.2vh,36px);
    --work-meta:34px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    min-height:0;
    padding-top:calc(var(--work-nav) + var(--work-gap));
    padding-bottom:var(--work-gap);
  }
  .home-page .work-sticky>* {
    flex:none;
  }
  .home-page .work .section-label {
    margin-bottom:clamp(10px,2.2vh,25px);
  }
  .home-page .work-head {
    margin-bottom:clamp(12px,2.6vh,30px);
  }
  /* Two lines instead of three: the height goes to the cards */
  .home-page .work h2 {
    font-size:min(4.8vw,7.6vh);
  }
  .home-page .work h2 br:first-of-type {
    display:none;
  }
  .home-page .work-track {
    flex:1 1 0;
    min-height:0;
    max-height:calc(75vw + var(--work-meta));
  }
  .home-page .project {
    display:flex;
    flex-direction:column;
  }
  .home-page .project-button {
    flex:1 1 auto;
    height:auto;
    min-height:110px;
  }
  .home-page .project-meta {
    flex:none;
  }
  .home-page .work-bottom {
    margin-top:clamp(10px,2vh,22px);
  }
}

/* Cards sized from the height that is left (container query units): 16:9 like
   the artwork, the same height on every card, up to square on tall screens.
   --work-meta reserves room for the caption row under each card. */
@supports (container-type:size) {
  @media(min-width:701px) and (prefers-reduced-motion:no-preference) {
    .home-page .work-track {
      container-type:size;
    }
    .home-page .project {
      flex-basis:min(75vw,calc((100cqh - var(--work-meta)) * 16 / 9));
    }
    .home-page .project-button {
      flex:none;
      height:calc(100cqh - var(--work-meta));
    }
  }
}

@media(min-width:701px) and (max-width:1000px) and (prefers-reduced-motion:no-preference) {
  .home-page .work h2 {
    font-size:min(6vw,7.6vh);
  }
}

/* Phones and small tablets held sideways: shorter nav, one-line heading */
@media(min-width:701px) and (max-height:500px) and (orientation:landscape) and (prefers-reduced-motion:no-preference) {
  .home-page .work-sticky {
    --work-gap:14px;
  }
  .home-page .work h2 {
    font-size:clamp(20px,3.4vw,30px);
  }
  .home-page .work h2 br {
    display:none;
  }
  .home-page .work-head {
    margin-bottom:10px;
  }
  .home-page .project-meta {
    font-size:10px;
    margin-top:6px;
  }
  .home-page .work-bottom {
    margin-top:8px;
  }
  .home-page .work-bottom>div button {
    font-size:20px;
  }
}

@media(max-width:700px) {
  .home-page #work {
    padding-top:clamp(40px,12vw,56px);
    padding-bottom:clamp(40px,12vw,56px);
  }
  .home-page .project-button {
    height:min(84vw,420px,66svh);
  }
  .home-page .project-overlay {
    font-size:clamp(20px,7.4cqw,32px);
  }
  .home-page .project-meta {
    font-size:11px;
  }
}

/* --------------------------------------------------------------------------
   Header on scroll (assets/js/header-scroll.js)
   Compact once the page has scrolled: a shorter bar and a smaller logo. Hidden
   while scrolling down, back as soon as you scroll up. Pinned sections leave
   room for the compact bar through --nav-compact.
   -------------------------------------------------------------------------- */
:root {
  --nav-compact:64px;
}

.nav {
  transition:height .3s ease,transform .35s ease,box-shadow .3s ease;
}

.nav .brand {
  transform-origin:left center;
  transition:transform .3s ease;
}

.nav-cta {
  transition:padding .3s ease;
}

.nav.is-compact {
  height:var(--nav-compact);
  box-shadow:0 8px 24px rgba(23,23,20,.06);
}

.nav.is-compact .brand {
  transform:scale(.78);
}

.nav.is-compact .nav-cta {
  padding:10px 16px;
}

.nav.is-hidden {
  transform:translateY(-100%);
}

@media(max-width:700px) {
  :root {
    --nav-compact:58px;
  }
  .nav.is-compact+.mobile-menu {
    inset:var(--nav-compact) 0 0;
  }
}

@media(orientation:landscape) and (max-height:500px) {
  :root {
    --nav-compact:52px;
  }
}

@media(prefers-reduced-motion:reduce) {
  .nav,.nav .brand,.nav-cta {
    transition:none;
  }
}

/* --------------------------------------------------------------------------
   Phones: tighter spacing between sections, headings, text and buttons
   -------------------------------------------------------------------------- */
@media(max-width:700px) {
  .section,
  .experiment,
  .contact,
  .philosophy,
  .client-logos {
    padding-top:32px;
    padding-bottom:32px;
  }
  .home-page #work {
    padding-top:clamp(32px,9vw,40px);
    padding-bottom:clamp(32px,9vw,40px);
  }
  .page-heading {
    padding-top:100px;
    padding-bottom:24px;
  }
  .cs-hero {
    padding-top:100px;
    padding-bottom:28px;
  }
  .enquiry-section {
    padding-bottom:32px;
  }
  footer.section {
    padding-top:40px;
    padding-bottom:20px;
  }
  .section-label,
  .client-logos-heading {
    margin-bottom:18px;
  }
  .contact>div:last-child {
    margin-top:22px;
  }
  .contact-button {
    margin-top:14px;
    gap:40px;
  }
  .footer-main {
    gap:22px;
  }
  .footer-bottom {
    margin-top:20px;
  }
  .hero-bottom .text-link {
    margin-top:12px;
  }
  .hero-bottom p,
  .statement-bottom p,
  .services-heading>p,
  .service-content p,
  .philosophy>p:last-child,
  .contact>div>p,
  .page-heading p,
  .team-member p,
  .cs-gallery-head p,
  .enquiry-section p,
  .service-stack-hint {
    line-height:1.5;
  }
}

@media(max-width:700px) {
  /* The home hero is also a .section: keep its room under the header */
  .hero.section {
    padding-top:76px;
    padding-bottom:48px;
  }
  footer.section {
    padding-top:40px!important;
    padding-bottom:20px!important;
  }
}

/* Enquiry forms: spam-trap field (enquiry.php), hidden from people and screen readers */
.form-trap {
  position:absolute!important;
  left:-10000px;
  width:1px;
  height:1px;
  overflow:hidden;
}

/* Phones: the header keeps the logo and the menu button; "Start a project" stays in the menu */
@media(max-width:700px) {
  .nav .nav-cta {
    display:none!important;
  }
}
