.studio-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: .65rem; }
.studio-footer { padding: 1.25rem 1rem; }
.studio-footer a { color: #d0e8f8; }
.studio-document { margin: 0; padding: 1.25rem; color: #f1f6ff; background: #081321; font: 1rem/1.65 system-ui, sans-serif; }
.studio-document nav, .studio-document main { max-width: 52rem; margin: auto; }
.studio-document nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.studio-document img { display: block; max-width: 100%; height: auto; border-radius: .65rem; }
.studio-document a, #enquiry-form a { color: #a3dcff; text-decoration: underline; }
.studio-skip:not(:focus) { position: absolute; clip-path: inset(50%); }
#enquiry-form { max-width: 52rem; }
#enquiry-form label { display: grid; gap: .35rem; margin-block: .75rem; }
#enquiry-form select { width: min(100%, 28rem); padding: .65rem; color: #edf6ff; background: #10233c; border: 1px solid #577392; border-radius: .5rem; font: inherit; }
#enquiry-status[data-error] { color: #ffb7ae; }
:focus-visible { outline: 2px solid #a3dcff; outline-offset: 3px; }

.brand-surface picture { display: contents; }
@media (max-width: 700px) {
  .brand-surface { background-image: url("studiosoft-brand-960-r59.webp"); }
}
html:has(#enquiry-form) { scroll-behavior: auto; }
#enquiry-form button[type="submit"] { min-height: 44px; cursor: pointer; }

.brand-summary {
  position: relative;
  z-index: 2;
  padding: clamp(.6rem, 1.4vw, 1rem) 1rem .55rem;
  background: #06182d;
  text-align: center;
}
.brand-summary h1 {
  margin: 0;
  color: #eef8ff;
  font-size: clamp(1.1rem, 2vw, 1.65rem);
  line-height: 1.25;
}
.brand-summary p {
  max-width: 48rem;
  margin: .4rem auto 0;
  color: #cee2f8;
  font-size: clamp(.9rem, 1.4vw, 1rem);
  line-height: 1.5;
}

/* Keep the header steady between documents with different lengths. */
body:has(> .wrap > .top) {
  background: radial-gradient(ellipse 75% 300px at 82% -40px, #184e89, transparent 75%), #050f1e;
}
.top {
  flex-wrap: wrap;
  padding-block-start: .5rem;
}
header.header.container { margin-block-start: .5rem; }
.top .nav {
  order: 3;
  flex: 1 0 100%;
  padding: 4px 0 12px;
}

html { scroll-behavior: auto; }

.top .nav a,
header .navigation a,
header .mobile-links a {
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .top .nav a,
  header .navigation a {
    transition: color 120ms ease-out;
  }
}

.brand-quick-links {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.5rem, 1.3vw, 1rem);
  padding: .35rem clamp(.7rem, 3vw, 2rem) .85rem;
  background: #06182d;
}
.brand-quick-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.4rem, 1vw, .8rem);
  min-width: 0;
  min-height: 48px;
  padding: .5rem clamp(.55rem, 1.5vw, 1rem);
  border: 1px solid #5883a5;
  border-radius: .65rem;
  background: #0d2944;
  color: #f5faff;
  text-decoration: none;
  font-size: clamp(.875rem, 1.35vw, 1.125rem);
  font-weight: 750;
  line-height: 1.25;
}
.brand-quick-link .nav-icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  color: #8de9ff;
}
.brand-quick-link:is(:hover, :focus-visible, :active) {
  border-color: #8de9ff;
  background: #19486b;
  color: #fff;
}
.brand-quick-link:focus-visible {
  outline: 2px solid #b3f2ff;
  outline-offset: 2px;
}
.brand-quick-link:is(:hover, :focus-visible) span {
  text-decoration: underline;
  text-underline-offset: .23em;
}
@media (prefers-reduced-motion: no-preference) {
  .brand-quick-link {
    transition: background-color 130ms ease-out, border-color 130ms ease-out;
  }
}
@media (max-width: 700px) {
  .brand-quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-quick-link { justify-content: flex-start; }
}

.brand-panel {
  /* The navigation sits at the bottom edge of the panel. */
  mask-image: none !important;
}

@media (min-width: 701px) {
  .brand-panel {
    /* The artwork keeps its proportions and leaves room for the copy and navigation. */
    --previous-panel-width: clamp(700px, calc((100svh - 14.5rem) * 3), 1780px);
    max-width: calc((100vw + min(100%, var(--previous-panel-width))) / 2);
  }
}

@media (min-width: 701px) and (max-height: 780px) {
  .home { padding-top: .5rem; }
  .brand-summary { padding-block: .4rem .25rem; }
  .brand-summary p { margin-top: .25rem; line-height: 1.35; }
  .brand-quick-links {
    gap: .5rem;
    padding-inline: 1rem;
    padding-block: .25rem;
  }
  .brand-quick-link {
    gap: .5rem;
    padding-inline: .6rem;
    font-size: clamp(.875rem, 1.25vw, 1rem);
  }
}

@media (max-width: 380px) {
  .brand-summary { padding-top: .5rem; padding-bottom: .4rem; }
  .brand-quick-links { padding-bottom: .5rem; }
}

@font-face {
  font-family: Allura;
  src: url("fonts/allura-lorr.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
.brand-name-accent {
  font-family: Allura, "Segoe Script", Georgia, cursive;
  font-weight: 400;
  letter-spacing: normal;
}
.brand strong .brand-name-accent {
  font-size: 1.35em;
  line-height: .8;
}
.brand-surface { container-type: inline-size; }
.home-wordmark {
  position: absolute;
  z-index: 3;
  inset: 15% 9% 32% 34.5%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #f4faff;
  background: radial-gradient(ellipse at 54% 48%, #082238 0%, #051727 73%, #031320 100%);
  box-shadow: 0 0 1.3cqw .8cqw #041523;
  pointer-events: none;
}
.home-wordmark-name {
  font: 760 clamp(1.35rem, 6.7cqw, 7.4rem)/.95 system-ui, sans-serif;
  letter-spacing: -.055em;
  white-space: nowrap;
}
.home-wordmark-name .brand-name-accent {
  color: #8deaff;
  font-size: 1.42em;
  line-height: .75;
  text-shadow: 0 0 .26em #2188b855;
}
.home-wordmark-caption {
  margin-top: .7cqw;
  font-size: clamp(.45rem, 1.2cqw, 1.1rem);
  font-weight: 650;
  letter-spacing: .22em;
  text-transform: uppercase;
}

/* R59.13: touch navigation, readable labels, explicit controls. */
@media (max-width: 700px), (max-width: 1000px) and (pointer: coarse) {
  .brand-hits,.brand-surface>.consultation {display:none!important}
  
  .top .nav a,header.header .navigation a {
    box-sizing:border-box;min-width:0;min-height:52px!important;height:auto!important;
    display:flex!important;align-items:center;justify-content:center!important;gap:7px;
    padding:9px 7px!important;border:1px solid #77bce8!important;border-radius:9px;
    background:#153e61!important;color:#f5faff!important;
    font-size:15px!important;font-weight:750!important;line-height:1.25!important;
    text-align:center;text-decoration:none!important;white-space:normal!important;overflow-wrap:normal;
    opacity:1!important;visibility:visible!important;box-shadow:inset 0 1px 0 #ffffff1a;
  }
  .top .nav,header.header .navigation {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px!important;
    width:100%!important;flex:1 0 100%!important;order:3;position:static!important;
    padding:8px 0 12px!important;align-items:stretch;justify-items:stretch;
  }
  header.header {display:flex!important;flex-wrap:wrap!important;align-items:center;gap:8px;max-width:100%;height:auto!important}
  header.header .mobile-toggle,header.header .mobile-links {display:none!important}
  header.header .navigation a {position:relative!important;transform:none!important;margin:0!important}
  .top .nav a[aria-current="page"],header.header .navigation a[aria-current="page"] {background:#215878!important;border-color:#b9efff!important}
  .top .nav a:active,header.header .navigation a:active {background:#28638b!important}
}
@media (max-width: 360px) {
  .top .nav a,header.header .navigation a {font-size:14px!important;padding-inline:5px!important}
}

/* R59.14: actual top banner tabs, not the controls underneath. */
.mobile-banner-tabs {display:none}
@media (max-width: 700px), (max-width: 1000px) and (pointer: coarse) {
  .brand-hits {display:none!important}
  .brand-surface::after {
    content:""!important;display:block!important;position:absolute!important;
    inset:68% 0 auto!important;height:16.5%!important;width:100%!important;
    transform:none!important;mask-image:none!important;-webkit-mask-image:none!important;
    z-index:4!important;pointer-events:none!important;
    background:linear-gradient(180deg,transparent 0%,#06182d 16%,#06182d 82%,transparent 100%)!important;
  }
  .mobile-banner-tabs {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));
    position:relative;z-index:5;gap:0;padding:4px 6px;
    background:linear-gradient(180deg,#041426,#08223b);
    border-top:1px solid #3488b4;border-bottom:1px solid #3488b4;
  }
  .mobile-banner-tabs a {
    min-width:0;min-height:58px;display:flex;align-items:center;justify-content:center;gap:8px;
    padding:8px 5px;color:#edf8ff;text-decoration:none;
    font-size:clamp(12px,3.6vw,16px);font-weight:750;line-height:1.2;
    text-align:left;letter-spacing:.015em;
  }
  .mobile-banner-tabs a:nth-child(odd){border-right:1px solid #286587}
  .mobile-banner-tabs a:nth-child(-n+2){border-bottom:1px solid #286587}
  .mobile-banner-tabs a svg {width:30px;height:30px;flex:0 0 30px;color:#3bdcff;filter:drop-shadow(0 0 5px #13adf455)}
  .mobile-banner-tabs a:active,.mobile-banner-tabs a:focus-visible {background:#15496b;outline:1px solid #8beaff;outline-offset:-2px}
}

/* R59.15: mobile home alignment; keep existing button sizes and desktop geometry. */
@media (max-width: 700px), (max-width: 1000px) and (pointer: coarse) {
  .mobile-specialties,.brand-quick-links {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    padding-inline:10px!important;
    align-items:stretch;
  }
  .mobile-specialties a:not(.consultation-mobile) {
    position:relative!important;
    box-sizing:border-box;
    width:100%!important;
    min-width:0;
    justify-content:center!important;
    align-items:center!important;
    text-align:center!important;
    padding-inline:22px!important;
  }
  .mobile-specialties a:not(.consultation-mobile)>span {
    text-align:center;
    min-width:0;
    overflow-wrap:normal;
  }
  .mobile-specialties a:not(.consultation-mobile)>b {
    position:absolute;
    right:9px;
    top:50%;
    transform:translateY(-50%);
    line-height:1;
  }
  .mobile-specialties .consultation-mobile {
    grid-column:1/-1;
    justify-self:center!important;
    justify-content:center!important;
    align-items:center!important;
    text-align:center!important;
    width:auto!important;
    min-width:170px;
  }
  .brand-quick-links .brand-quick-link {
    box-sizing:border-box;
    min-width:0;
    width:100%;
    justify-content:center!important;
    align-items:center!important;
    gap:6px;
    text-align:center;
    padding-inline:6px;
  }
  .brand-quick-links .brand-quick-link span {min-width:0;text-align:center;overflow-wrap:normal}
  .brand-quick-links .brand-quick-link .nav-icon {flex:0 0 auto}
  .mobile-banner-tabs a {text-align:center;justify-content:center;align-items:center}
}

/* R59.16: mobile animation restoration, preserve the R59.15 navigation. */
.mobile-motion-enable {display:none}
@media (max-width: 700px), (max-width: 1000px) and (pointer: coarse) {
  .brand-surface::after {
    inset:67.5% 1% auto 10%!important;height:18%!important;width:auto!important;
    background:linear-gradient(180deg,#061726 0%,#071c2e 54%,#081d31 100%)!important;
    mask-image:linear-gradient(to bottom,transparent,#000 12%,#000 89%,transparent),linear-gradient(to right,transparent,#000 5%,#000 98%,transparent)!important;
    -webkit-mask-image:linear-gradient(to bottom,transparent,#000 12%,#000 89%,transparent),linear-gradient(to right,transparent,#000 5%,#000 98%,transparent)!important;
    mask-composite:intersect!important;-webkit-mask-composite:source-in!important;
    z-index:2!important;
  }
  .brand-glow-canvas {z-index:4!important}
  .r41-portal-stage.studio-portal {display:flex!important;flex-direction:column;min-height:0!important;height:auto!important;gap:0}
  .studio-portal .r41-portal-art {
    position:relative!important;inset:auto!important;opacity:1!important;flex:0 0 auto;
    width:100%!important;height:clamp(190px,58vw,280px)!important;
    min-height:0!important;margin:0 auto 8px!important;align-self:center
  }
  .studio-portal .r41-portal-canvas {
    filter:saturate(1.55) brightness(1.38)!important;
    mask-image:radial-gradient(ellipse 75% 73% at 52% 49%,#000 0%,#000 47%,rgba(0,0,0,.7) 75%,transparent 100%)!important;
    -webkit-mask-image:radial-gradient(ellipse 75% 73% at 52% 49%,#000 0%,#000 47%,rgba(0,0,0,.7) 75%,transparent 100%)!important;
  }
}

@media (prefers-reduced-motion: reduce) and (max-width: 1000px) and (pointer: coarse) {
  html:not([data-ss-motion="on"]) .mobile-motion-enable {
    position:absolute;z-index:7;right:8px;bottom:5px;display:inline-flex;align-items:center;
    padding:5px 9px;border:1px solid #65cbe8;border-radius:6px;background:#08243b;
    color:#e7faff;font-size:12px;line-height:1.2;text-decoration:none
  }
}

/* R59.18: original S / water only, plus readable controls for motion. */
@media (max-width:700px), (max-width:1000px) and (pointer:coarse) {
 .brand-surface::after {z-index:2!important}
 .brand-glow-canvas {z-index:4!important}
 .mobile-motion-enable {
   display:inline-flex;position:absolute;z-index:7;right:8px;bottom:5px;
   align-items:center;min-height:26px;padding:3px 7px;border:1px solid #65cbe855;
   border-radius:5px;background:#08243bc9;color:#b9e8ff;font-size:10px;
   line-height:1.2;text-decoration:none
 }
 .mobile-motion-enable:not([data-paused="true"]) {display:none}
}

/* R59.19: mobile artwork with labels removed from source, no covering strip. */
@media (max-width:700px), (max-width:1000px) and (pointer:coarse) {
 .brand-surface {background-image:url("studiolorr-brand-mobile-clean.webp")!important}
 .brand-surface::after {display:none!important;content:none!important}
 .brand-glow-canvas {z-index:4!important}
}

/* R59.20: center CTA label independently of its right-aligned arrow. */
@media (max-width:700px), (max-width:1000px) and (pointer:coarse) {
 .mobile-specialties .consultation-mobile {
   position:relative!important;
   justify-content:center!important;
   align-items:center!important;
   text-align:center!important;
   padding-inline:22px!important;
 }
 .mobile-specialties .consultation-mobile > span[aria-hidden="true"] {
   position:absolute!important;
   right:9px!important;
   left:auto!important;
   top:50%!important;
   transform:translateY(-50%)!important;
   margin:0!important;
   line-height:1!important;
 }
}

/* R59.22: mobile banner 16% larger, identical image/canvas coordinate space. */
@media (max-width:700px), (max-width:1000px) and (pointer:coarse) {
 .brand-surface {
   aspect-ratio:2048 / 791.12!important;
   background-size:116% 100%!important;
   background-position:center center!important;
 }
 .brand-surface .brand-original,
 .brand-surface .brand-glow-canvas {
   inset:0 auto 0 -8%!important;
   width:116%!important;
   max-width:none!important;
   height:100%!important;
 }
 .brand-surface .home-wordmark {
   inset:15% 2.44% 32% 32.02%!important;
 }
 .brand-surface .home-wordmark-name {
   font-size:clamp(1.35rem,7.772cqw,7.4rem)!important;
 }
 .brand-surface .home-wordmark-caption {
   font-size:clamp(.45rem,1.392cqw,1.1rem)!important;
   margin-top:.812cqw!important;
 }
}
