/*
 * 8.16 / STAGE 1 / AUTHORING CANDIDATE
 * Load LAST, after styles.css and the page-specific/theme stylesheets.
 * Paint-only CTA overrides; dimensions, visibility and behavior are inherited.
 * No checkbox/radio/filter/toggle selectors are changed here.
 */

:root {
  --studio-cta-ink: var(--acid, #c3ff5e);
  --studio-cta-border: #a8ce61;
  --studio-cta-surface: transparent;
  --studio-cta-hover: #32432a;
  --studio-cta-focus: #e3ffc1;
}

html[data-theme="light"] {
  --studio-cta-ink: #385313;
  --studio-cta-border: #58762e;
  --studio-cta-surface: transparent;
  --studio-cta-hover: #e6eddc;
  --studio-cta-focus: #385313;
}

/* Illustrated sections stay dark in both themes in the existing source. */
html :is(
  .ecosystem,
  .website-presentation .website-illustrated-cta,
  .website-promotion .promotion-final-cta,
  .industry-page .ip-hero,
  [data-emergency-site="studio"]
) {
  --studio-cta-ink: #c3ff5e;
  --studio-cta-border: #a8ce61;
  --studio-cta-surface: transparent;
  --studio-cta-hover: #32432a;
  --studio-cta-focus: #e3ffc1;
}

/* Primary calls to action, including quiz/reviews and the existing header CTA. */
html :is(
  .button.primary,
  .button.portfolio-more,
  .site-quiz .site-quiz__button--primary,
  .ecosystem .eco-cta,
  .google-reviews__button--primary,
  .studio-manager__send,
  .mobile-project-cta,
  .header .button.small,
  [data-emergency-site="studio"] a.emergency-contact__link--email
) {
  background: var(--studio-cta-surface);
  color: var(--studio-cta-ink);
  border-color: var(--studio-cta-border);
  border-style: solid;
  border-width: 1px;
  box-shadow: none;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease,
    box-shadow .2s ease, transform .2s ease;
}

html :is(
  .button.primary,
  .button.portfolio-more,
  .site-quiz .site-quiz__button--primary,
  .ecosystem .eco-cta,
  .google-reviews__button--primary,
  .studio-manager__send,
  .mobile-project-cta,
  .header .button.small,
  [data-emergency-site="studio"] a.emergency-contact__link--email
):hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--studio-cta-hover);
  color: var(--studio-cta-ink);
  border-color: var(--studio-cta-ink);
  box-shadow: 0 0 0 1px var(--studio-cta-border);
}

html :is(
  .button.primary,
  .button.portfolio-more,
  .site-quiz .site-quiz__button--primary,
  .ecosystem .eco-cta,
  .google-reviews__button--primary,
  .studio-manager__send,
  .mobile-project-cta,
  .header .button.small,
  [data-emergency-site="studio"] a.emergency-contact__link--email
):focus-visible {
  outline: 2px solid var(--studio-cta-focus);
  outline-offset: 4px;
}

html :is(
  .button.primary,
  .button.portfolio-more,
  .site-quiz .site-quiz__button--primary,
  .ecosystem .eco-cta,
  .google-reviews__button--primary,
  .studio-manager__send,
  .mobile-project-cta,
  .header .button.small,
  [data-emergency-site="studio"] a.emergency-contact__link--email
):is(:disabled, [aria-disabled="true"]) {
  background: var(--studio-cta-surface);
  box-shadow: none;
  transform: none;
}

/* Repeat the light-theme selector to win over the existing explicit filled rules. */
html[data-theme="light"] :is(
  .button.primary,
  .button.portfolio-more,
  .site-quiz .site-quiz__button--primary,
  .ecosystem .eco-cta,
  .google-reviews__button--primary,
  .studio-manager__send,
  .mobile-project-cta,
  [data-emergency-site="studio"] a.emergency-contact__link--email
) {
  background: var(--studio-cta-surface);
  color: var(--studio-cta-ink);
  border-color: var(--studio-cta-border);
}

html[data-theme="light"] :is(
  .button.primary,
  .button.portfolio-more,
  .site-quiz .site-quiz__button--primary,
  .ecosystem .eco-cta,
  .google-reviews__button--primary,
  .studio-manager__send,
  .mobile-project-cta,
  [data-emergency-site="studio"] a.emergency-contact__link--email
):hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--studio-cta-hover);
  color: var(--studio-cta-ink);
  border-color: var(--studio-cta-ink);
}

/* The header intentionally remains dark in both themes. Keep its CTA readable. */
html[data-theme="light"] .header .button.small {
  --studio-cta-ink: #d9f6b4;
  --studio-cta-border: #92b65b;
  --studio-cta-hover: #283621;
  --studio-cta-focus: #d9f6b4;
  background: transparent;
  color: var(--studio-cta-ink);
  border-color: var(--studio-cta-border);
}

html[data-theme="light"] .header .button.small:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--studio-cta-hover);
  color: var(--studio-cta-ink);
  border-color: var(--studio-cta-ink);
}

/* Exact counterpart to the higher-specificity industry-pages.css light rule. */
:root[data-theme="light"] .industry-page .ip-hero .button.primary {
  color: var(--studio-cta-ink);
  background: var(--studio-cta-surface);
  border-color: var(--studio-cta-border);
  box-shadow: none;
}

:root[data-theme="light"] .industry-page .ip-hero .button.primary:hover:not(:disabled):not([aria-disabled="true"]) {
  color: var(--studio-cta-ink);
  background: var(--studio-cta-hover);
  border-color: var(--studio-cta-ink);
}

/* Native file picker action only: no other input styling or state changes. */
.retouch-upload input::file-selector-button {
  color: var(--studio-cta-ink);
  background: var(--studio-cta-surface);
  border: 1px solid var(--studio-cta-border);
  transition: background-color .2s ease, border-color .2s ease;
}

.retouch-upload input::file-selector-button:hover {
  background: var(--studio-cta-hover);
  border-color: var(--studio-cta-ink);
}

.retouch-upload input[type="file"]:focus-visible {
  outline: 2px solid var(--studio-cta-focus);
  outline-offset: 4px;
}

/* Keep the portfolio carousel controls outlined on hover. */
.website-work-controls button:hover:not(:disabled) {
  color: var(--studio-cta-ink);
  background: var(--studio-cta-hover);
  border-color: var(--studio-cta-ink);
}

/*
 * Homepage only. The new picture replaces .hero-showcase in renderHome().
 * No portfolio/card/secondary hero selector is targeted by these rules.
 */
.hero.studio-home-hero {
  display: block;
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
}

.studio-home-hero .studio-home-hero__picture {
  display: block;
  position: absolute;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.studio-home-hero .studio-home-hero__picture img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: right center;
}

.studio-home-hero .studio-home-hero__shade {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(0deg, #171e19 0%, #171e1900 22%),
    linear-gradient(90deg, #171e19fa 0%, #171e19ed 30%, #171e19ad 47%, #171e1933 62%, #171e1900 76%);
}

.studio-home-hero .studio-home-hero__inner {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  min-height: clamp(660px, 51vw, 860px);
  max-width: var(--max, 1440px);
  margin: 0 auto;
  padding: 72px 54px 66px;
}

.studio-home-hero .hero-copy {
  position: relative;
  min-width: 0;
  max-width: 640px;
  margin: 0;
}

.studio-home-hero .hero-intro {
  max-width: 440px;
  color: var(--muted);
}

.studio-home-hero .hero-actions {
  flex-wrap: wrap;
  gap: 20px 28px;
}

.studio-home-hero .hero-actions > * {
  max-width: 100%;
}

.studio-home-hero .hero-bottom {
  box-sizing: border-box;
  position: relative;
  width: calc(100% - 108px);
  max-width: calc(var(--max, 1440px) - 108px);
  margin: 0 auto;
  padding: 24px 0;
  color: var(--muted);
}

html[data-theme="light"] .studio-home-hero .studio-home-hero__shade {
  background:
    linear-gradient(0deg, #f7f8f3 0%, #f7f8f300 20%),
    linear-gradient(90deg, #f7f8f3 0%, #f7f8f3f5 29%, #f7f8f3d9 43%, #f7f8f33d 61%, #f7f8f300 76%);
}

@media (max-width: 1100px) and (min-width: 901px) {
  .studio-home-hero .studio-home-hero__inner {
    gap: 30px;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    padding-inline: 28px;
  }

  .studio-home-hero .hero-bottom {
    width: calc(100% - 56px);
    margin-inline: 28px;
  }
}

/* Mobile: preserve the entire artwork in a separate native-ratio band. */
@media (max-width: 900px) {
  .hero.studio-home-hero {
    display: flex;
    flex-direction: column;
  }

  .studio-home-hero .studio-home-hero__inner {
    display: block;
    order: 1;
    min-height: 0;
    width: 100%;
    padding: 44px 28px 30px;
  }

  .studio-home-hero .hero-copy {
    max-width: 680px;
  }

  .studio-home-hero .studio-home-hero__picture {
    position: relative;
    z-index: auto;
    order: 2;
    inset: auto;
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 1672 / 941;
  }

  .studio-home-hero .studio-home-hero__picture img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  .studio-home-hero .studio-home-hero__shade {
    display: none;
  }

  .studio-home-hero .hero-bottom {
    order: 3;
    align-self: stretch;
    width: auto;
    max-width: none;
    margin: 0 28px;
    padding: 23px 0;
  }
}

@media (max-width: 600px) {
  .studio-home-hero .studio-home-hero__inner {
    padding: 38px 22px 26px;
  }

  .studio-home-hero .hero-actions {
    align-items: flex-start;
    gap: 20px;
  }

  .studio-home-hero .hero-actions .button {
    min-height: 52px;
    padding: 15px 20px;
    white-space: normal;
  }

  .studio-home-hero .hero-actions .text-link {
    align-self: center;
  }

  .studio-home-hero .hero-bottom {
    margin-inline: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html :is(
    .button.primary,
    .button.portfolio-more,
    .site-quiz .site-quiz__button--primary,
    .ecosystem .eco-cta,
    .google-reviews__button--primary,
    .studio-manager__send,
    .mobile-project-cta,
    .header .button.small
  ),
  .retouch-upload input::file-selector-button {
    transition: none;
  }
}

@media (forced-colors: active) {
  html :is(
    .button.primary,
    .button.portfolio-more,
    .site-quiz .site-quiz__button--primary,
    .ecosystem .eco-cta,
    .google-reviews__button--primary,
    .studio-manager__send,
    .mobile-project-cta,
    .header .button.small
  ) {
    color: ButtonText;
    border-color: ButtonText;
    background: Canvas;
    box-shadow: none;
    forced-color-adjust: auto;
  }

  html[data-theme="light"] .header .button.small,
  :root[data-theme="light"] .industry-page .ip-hero .button.primary {
    color: ButtonText;
    border-color: ButtonText;
    background: Canvas;
    box-shadow: none;
  }

  html :is(.button.primary, .button.portfolio-more, .site-quiz .site-quiz__button--primary,
    .ecosystem .eco-cta, .google-reviews__button--primary, .studio-manager__send, .mobile-project-cta,
    .header .button.small):focus-visible {
    outline-color: Highlight;
  }
}
