/* MR.GAO public UI refresh. Load after the existing front-end stylesheet. */
:root {
  --gao-ink: #101220;
  --gao-panel: #161a2c;
  --gao-line: #343f61;
  --gao-aqua: #81efff;
  --gao-lilac: #c8b4ff;
  --gao-pink: #ffa9df;
}

.site-header-v4,
.mobile-bottom-nav {
  background: #101220f5;
  border-color: var(--gao-line);
}

.site-header-v4 .nav-popover,
.site-header-v4 .mobile-menu {
  background: var(--gao-ink);
  border-color: var(--gao-line);
}

:where(.site-header-v4, .mobile-bottom-nav, .home-concept-v5, .page-grid,
  .resume-shell, .project-request-layout, .novel-library-list) :focus-visible {
  outline: 2px solid var(--gao-aqua);
  outline-offset: 3px;
}

.home-concept-v5 {
  background: #0c0e1a;
}

.home-concept-v5 .hero-shade {
  background:
    linear-gradient(90deg, #0a0c19fa 0%, #14112ee8 32%, #26174748 72%, #11142a9e),
    linear-gradient(0deg, #0c0e1a 0%, transparent 60%);
}

.home-concept-v5 .concept-hero-picture img {
  filter: saturate(1.18) contrast(1.05);
}

.concept-hero .showcase-copy h1 span {
  color: var(--gao-lilac);
  text-shadow: 0 0 32px #7759ca70;
}

.home-concept-v5 .primary-button {
  color: #101220;
  border-color: transparent;
  background: linear-gradient(118deg, var(--gao-aqua), var(--gao-lilac) 72%, var(--gao-pink));
}

.home-concept-v5 .secondary-button {
  color: #eef0ff;
  border-color: #8e84bb;
  background: #14182aeb;
}

.concept-hero .portfolio-index-v4 {
  background: #111526f2;
  border-color: var(--gao-line);
  border-radius: 14px;
  overflow: hidden;
}

.concept-hero .portfolio-index-v4 a {
  border-color: var(--gao-line);
}

.concept-hero .portfolio-index-v4 a:is(:hover, :focus-visible) {
  background: #252947;
  outline-offset: -4px;
}

.concept-capability-title span {
  color: var(--gao-lilac);
}

.concept-project-card,
.content-index-page .data-card,
.project-request-layout .project-request-form,
.project-request-layout .project-request-side {
  border: 1px solid var(--gao-line);
  border-radius: 16px;
  background: var(--gao-panel);
}

.concept-project-card {
  overflow: hidden;
}

.concept-project-card .concept-project-media {
  min-height: 0;
}

.concept-project-media img {
  height: auto;
  aspect-ratio: 16 / 10;
}

@media (max-width: 900px) {
  .home-concept-v5 .concept-hero {
    min-height: 0;
    padding: 0 clamp(16px, 4vw, 32px) 12px;
  }

  .home-concept-v5 .concept-hero .concept-hero-shell {
    display: block;
    min-height: 0;
  }

  .concept-hero .showcase-copy {
    max-width: 620px;
    padding: clamp(28px, 8vw, 66px) 0 28px;
  }

  .home-concept-v5 .concept-hero .showcase-copy h1 {
    font-size: clamp(46px, 12vw, 78px);
    line-height: 1;
  }

  .home-concept-v5 .concept-hero .showcase-copy h1 span {
    font-size: clamp(28px, 8.4vw, 50px);
  }

  .home-concept-v5 .hero-shade {
    background: linear-gradient(115deg, #0b1022f7, #1d163bd4 62%, #181d36a8),
      linear-gradient(0deg, #0c0e1a, transparent 62%);
  }

  .concept-hero .portfolio-index-v4 {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .concept-hero .portfolio-index-v4 a {
    min-height: 86px;
    min-width: 0;
    padding: 12px;
  }

  .concept-hero .portfolio-index-v4 a:nth-child(2n) { border-right: 0; }
  .concept-hero .portfolio-index-v4 a:nth-child(-n+2) {
    border-bottom: 1px solid var(--gao-line);
  }

  .concept-project-card .project-copy { min-height: 0; }
}

@media (max-width: 900px) {
  .site-header-v4 .mobile-menu-toggle { min-height: 44px; }
  .site-header-v4 .mobile-menu {
    max-height: min(66vh, 460px);
    max-height: min(66dvh, 460px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 0 0 16px 16px;
  }

  .site-header-v4 .mobile-menu a { min-height: 44px; }

  .mobile-bottom-nav {
    min-height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-inline: max(8px, env(safe-area-inset-left, 0px))
      max(8px, env(safe-area-inset-right, 0px));
  }

  .mobile-bottom-nav a {
    min-height: 44px;
    color: #e2e6f5;
    font-size: 12px;
  }

  .mobile-bottom-nav span { color: var(--gao-aqua); }
  .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

  body.ai-enabled .ai-widget {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  body.ai-enabled .ai-panel {
    bottom: calc(128px + env(safe-area-inset-bottom, 0px));
    max-height: max(150px, calc(100dvh - 146px - env(safe-area-inset-bottom, 0px)));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 760px) {
  .project-request-layout,
  .project-request-form .form-two { grid-template-columns: minmax(0, 1fr); }

  .project-request-form :is(input:not([type=checkbox]):not([type=hidden]), select, textarea) {
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

  .project-request-form .full-button { min-height: 48px; }
  .resume-shell :is(.resume-main, .resume-side),
  .novel-library-item { min-width: 0; overflow-wrap: anywhere; }
}

@media (max-width: 560px) {
  .home-concept-v5 .concept-hero .hero-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .concept-hero .hero-subtitle { max-width: 44ch; }
  .concept-hero .hero-actions a { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .home-concept-v5 .mdp-canvas,
  .home-concept-v5 .scanlines { visibility: hidden; }
  .concept-project-card,
  .concept-project-media img { transition: none; }
  .concept-project-card:hover,
  .concept-project-card:hover .concept-project-media img { transform: none; }
}

.gao-ai-entry {
  box-sizing: border-box;
  width: 100%;
  max-width: 520px;
  min-height: 80px;
  margin: clamp(16px, 2vw, 26px) 0 0;
  padding: clamp(12px, 2vw, 22px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 2vw, 18px);
  border: 1px solid var(--gao-ai-border, #4f5e92);
  border-radius: 16px;
  background: var(--gao-ai-bg, #161c31);
  color: var(--gao-ai-text, #f7f8ff);
  text-decoration: none;
}

.gao-ai-entry:hover,
.gao-ai-entry:focus-visible {
  border-color: var(--gao-ai-accent, #a6edff);
  color: var(--gao-ai-text, #f7f8ff);
  background: var(--gao-ai-glow, #212b48);
  text-decoration: none;
}

.gao-ai-entry:focus-visible {
  outline: 2px solid var(--gao-ai-accent, #a6edff);
  outline-offset: 3px;
}

.gao-ai-entry__mark {
  display: grid;
  place-items: center;
  width: clamp(36px, 5vw, 54px);
  aspect-ratio: 1;
  border: 1px solid var(--gao-ai-border, #4f5e92);
  border-radius: 10px;
  color: var(--gao-ai-accent, #a6edff);
  font: 800 clamp(15px, 2.5vw, 22px)/1 ui-monospace, Consolas, monospace;
}

.gao-ai-entry__copy {
  display: grid;
  min-width: 0;
  gap: 4px;
  overflow-wrap: anywhere;
}

.gao-ai-entry__copy strong {
  font-size: clamp(16px, 2.3vw, 24px);
  line-height: 1.3;
}

.gao-ai-entry__copy > span {
  color: var(--gao-ai-muted, #bdc6de);
  font-size: 12px;
  line-height: 1.4;
}

.gao-ai-entry__action {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--gao-ai-accent, #a6edff);
  color: var(--gao-ai-accent-ink, #11182a);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 340px) {
  .gao-ai-entry { gap: 8px; }
  .gao-ai-entry__action { gap: 4px; padding-inline: 7px; }
}

/* On the PHP homepage, add gao-night-motion to the existing .concept-hero. */
@media (prefers-reduced-motion: no-preference) {
  :is(.site-preview[data-theme="night"][data-motion="play"] .hero-art,
    .gao-night-motion .concept-hero-picture) {
    transform-origin: 77% 52%;
    animation: gao-night-camera 4.5s cubic-bezier(.2,.5,.3,1) both;
  }

  :is(.site-preview[data-theme="night"][data-motion="play"] .hero-art,
    .gao-night-motion .concept-hero-picture)::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 51% 72%, #ffbc814d 0%, transparent 14%),
      radial-gradient(ellipse at 63% 59%, #b68df136 0%, transparent 18%);
    animation: gao-night-glint 4.5s ease-in-out both;
  }

  :is(.site-preview[data-theme="night"][data-motion="play"] .hero-inner h2,
    .gao-night-motion .showcase-copy h1) {
    animation: gao-night-title 700ms cubic-bezier(.2,.5,.3,1) both;
  }

  @container (max-width: 560px) {
    .site-preview[data-theme="night"][data-motion="play"] .hero-art::after {
      inset-block-end: 47%;
    }
  }

  @media (max-width: 560px) {
    .gao-night-motion .concept-hero-picture::after { inset-block-end: 34%; }
  }
}

@keyframes gao-night-camera {
  from { transform: scale(1); }
  to { transform: scale(1.035); }
}

@keyframes gao-night-glint {
  0%, 100% { opacity: 0; transform: translateX(-2%); }
  46% { opacity: .7; transform: translateX(0); }
  70% { opacity: .26; transform: translateX(2%); }
}

@keyframes gao-night-title {
  from { opacity: .8; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Desktop-only enhancements for the existing homepage markup. */
@media (min-width: 901px) {
  body.home-concept-v5 {
    --desk-surface: #111626;
    --desk-line: #a9b5f535;
    --desk-muted: #b8c0d6;
    --desk-accent: #c5b8ff;
    --desk-gutter: clamp(30px, 5vw, 80px);
    background: #0b0e19;
  }

  .home-concept-v5 .site-header-v4 {
    background: #0b0e19f5;
    border-bottom-color: var(--desk-line);
  }

  .home-concept-v5 .concept-hero {
    min-height: 0;
    padding: 0 var(--desk-gutter) 22px;
  }

  .home-concept-v5 .concept-hero-picture img {
    object-position: 58% 51%;
    filter: saturate(1.05);
  }

  .home-concept-v5 .concept-hero-video {
    object-position: 58% 51%;
    opacity: .72;
  }

  .home-concept-v5 .hero-shade {
    background: linear-gradient(90deg, #0b0e19fa 0%, #111630dc 31%, #141a306c 56%, #11162912 82%),
      linear-gradient(0deg, #0b0e19 0%, #0b0e193d 28%, transparent 58%);
  }

  .home-concept-v5 .mdp-canvas { opacity: .32; }

  .home-concept-v5 .scanlines {
    opacity: .08;
  }

  .home-concept-v5 .concept-hero-shell {
    min-height: 0;
    padding: clamp(42px, 4vw, 62px) 0 clamp(26px, 3.4vw, 48px);
  }

  .home-concept-v5 .concept-hero .showcase-copy {
    max-width: min(580px, 57%);
    padding-top: 0;
  }

  .home-concept-v5 .concept-hero .hero-logo {
    display: block;
    width: 58px;
    height: 58px;
    margin: 0 0 15px;
    filter: brightness(0) invert(1);
  }

  .home-concept-v5 .concept-hero .showcase-copy .eyebrow {
    margin-bottom: 13px;
    color: #b6d6ff;
  }

  .home-concept-v5 .concept-hero .showcase-copy h1 {
    margin-bottom: 18px;
    font-size: clamp(70px, 7.1vw, 108px);
    line-height: .92;
  }

  .home-concept-v5 .concept-hero .showcase-copy h1 span {
    color: var(--desk-accent);
    font-size: .53em;
  }

  .home-concept-v5 .concept-hero .hero-subtitle {
    max-width: 36em;
    font-size: 15px;
    line-height: 1.78;
  }

  .home-concept-v5 .concept-hero .hero-actions {
    margin-top: 22px;
  }

  .home-concept-v5 .concept-hero .hero-actions a {
    min-height: 46px;
    border-radius: 9px;
  }

  .home-concept-v5 .concept-hero .primary-button {
    background: #c5b8ff;
    color: #16152e;
  }

  .home-concept-v5 .concept-hero .secondary-button {
    border-color: #b3afe269;
    background: #161a2de8;
  }

  .home-concept-v5 .concept-hero .gao-ai-entry {
    --gao-ai-bg: #1d2038;
    --gao-ai-border: #9284d676;
    --gao-ai-muted: #c8c4e7;
    --gao-ai-accent: #d1c5ff;
    --gao-ai-accent-ink: #231d42;
    --gao-ai-glow: #2c294a;
    max-width: 490px;
    min-height: 64px;
    margin-top: 15px;
    padding: 10px 13px;
    border-radius: 11px;
  }

  .home-concept-v5 .concept-hero .gao-ai-entry__copy strong { font-size: 17px; }
  .home-concept-v5 .concept-hero .gao-ai-entry__mark { width: 38px; font-size: 16px; }
  .home-concept-v5 .concept-hero .concept-availability { margin-top: 15px; }
  .home-concept-v5 .concept-hero .hero-meta { margin-top: 13px; }

  .home-concept-v5 .concept-hero .portfolio-index-v4 {
    position: relative;
    inset: auto;
    width: min(1440px, 100%);
    margin: 0 auto;
    border: 1px solid var(--desk-line);
    border-radius: 12px;
    background: #121729ed;
  }

  .home-concept-v5 .concept-hero .portfolio-index-v4 a {
    min-height: 92px;
    padding: 15px 20px;
    border-right-color: var(--desk-line);
  }

  .home-concept-v5 .concept-hero .portfolio-index-v4 strong { margin-top: 8px; }

  .home-concept-v5 :is(.concept-capabilities, .home-projects-v4, .home-knowledge-v4, .home-connect-v4) {
    width: min(1440px, calc(100% - 2 * var(--desk-gutter)));
  }

  .home-concept-v5 :is(.concept-capabilities, .home-projects-v4, .home-knowledge-v4) {
    padding-block: clamp(56px, 6vw, 88px);
  }

  .home-concept-v5 .concept-capability-grid,
  .home-concept-v5 .concept-capability-grid article,
  .home-concept-v5 .home-projects-v4 {
    border-color: var(--desk-line);
  }

  .home-concept-v5 .concept-capability-title span { color: var(--desk-accent); }

  .home-concept-v5 .concept-projects-grid {
    gap: clamp(16px, 2vw, 29px);
    margin-top: clamp(24px, 3vw, 40px);
  }

  .home-concept-v5 .concept-project-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--desk-line);
    border-radius: 13px;
    background: var(--desk-surface);
  }

  .home-concept-v5 .concept-project-card:is(:hover, :focus-visible) {
    border-color: var(--desk-accent);
  }

  .home-concept-v5 .concept-project-card .concept-project-media {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .home-concept-v5 .concept-project-media img {
    height: 100%;
    opacity: 1;
  }

  .home-concept-v5 .concept-project-media > span {
    top: 12px;
    left: 12px;
    padding: 5px 8px;
    border-radius: 5px;
    background: #121528e9;
    color: #f0edff;
    text-shadow: none;
  }

  .home-concept-v5 .concept-project-card .project-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 205px;
    padding: 19px 20px;
  }

  .home-concept-v5 .concept-project-card .project-copy h3 {
    font-size: clamp(19px, 2vw, 28px);
    line-height: 1.27;
    text-wrap: balance;
  }

  .home-concept-v5 .concept-project-card .project-copy p { color: var(--desk-muted); }
  .home-concept-v5 .concept-project-card .project-copy b {
    margin-top: auto;
    padding-top: 13px;
    color: var(--desk-accent);
  }

  .home-concept-v5 :where(a, button, summary):focus-visible {
    outline: 2px solid #c5b8ff;
    outline-offset: 3px;
  }

  .home-concept-v5 .concept-project-card:focus-visible { outline-offset: -3px; }
}

@media (min-width: 901px) and (prefers-reduced-motion: reduce) {
  .home-concept-v5 .concept-project-card,
  .home-concept-v5 .concept-project-card img { transition: none; }

  .home-concept-v5 .concept-project-card:hover,
  .home-concept-v5 .concept-project-card:hover img { transform: none; }
}

.home-concept-v5 .concept-hero-picture img[src="/assets/front/img/home-hero-workstation-v1.webp"] {
  content: url("lanzhou-night-hero.webp");
}
@media (min-width: 901px) {
  .home-concept-v5 .concept-project-card[href="/works/multi-industry-website-portfolio.html"] { --gao-work-cover: url("work-web.webp"); }
  .home-concept-v5 .concept-project-card[href="/works/3d-architecture-visualization.html"] { --gao-work-cover: url("work-architecture.webp"); }
  .home-concept-v5 .concept-project-card[href="/works/enterprise-website-dev.html"] { --gao-work-cover: url("work-enterprise.webp"); }
  .home-concept-v5 .concept-project-card:is([href="/works/multi-industry-website-portfolio.html"], [href="/works/3d-architecture-visualization.html"], [href="/works/enterprise-website-dev.html"]) {
    & .concept-project-media img { content: var(--gao-work-cover); }
    & .concept-project-media > span::after { content: " · 示意图"; }
  }
}
