/* Decorative glow may extend past the viewport, but must never widen the page.
   Clip at the root without creating a scroll container that breaks sticky scenes. */
:root {
  --arjia-small-height: 100svh;
  --arjia-visible-height: 100svh;
}
html {
  overflow-x: clip;
}
html,
body {
  scrollbar-width: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}
@media (max-width: 1100px),
  (max-width: 1400px) and (hover: none) and (pointer: coarse) {
  :root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --edge-inset: max(
      12px,
      env(safe-area-inset-left, 0px),
      env(safe-area-inset-right, 0px)
    );
    --page-gutter: max(
      clamp(16px, 4vw, 36px),
      env(safe-area-inset-left, 0px),
      env(safe-area-inset-right, 0px)
    );
  }
  @supports (height: 100dvh) {
    :root {
      --arjia-visible-height: 100dvh;
    }
  }
  html {
    scroll-padding-top: 96px;
  }
  body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  button,
  a,
  input,
  select,
  summary {
    -webkit-tap-highlight-color: transparent;
  }
  button,
  a,
  summary {
    touch-action: manipulation;
  }
  body > main.hero-brand {
    width: min(640px, 90vw);
    top: 44svh;
  }
  .hero-brand h1 {
    translate: 0 calc(var(--hero-logo-offset, 0px) * 0.55);
    /* Preserve glow/intro paint up to the actual viewport edge, including
       capped tablet and short landscape compositions. */
    overflow-x: clip;
    overflow-clip-margin: var(--hero-clip-margin, 5vw);
  }
  .hero-brand .hero-description {
    --hero-frame-width: min(700px, calc(100vw - var(--page-gutter) * 2));
    top: calc(100% - 14px + var(--hero-text-offset, 0px) * 0.4);
  }
  .aperture-stage {
    --hero-frame-height: 136px;
    touch-action: pan-y;
  }
  .aperture-stage h2 {
    font-size: calc(clamp(27px, 5vw, 42px) * var(--hero-text-scale, 1));
    letter-spacing: -0.055em;
  }
  .aperture-reveal > span {
    width: calc(100% - 30px);
    top: calc(50% + 29px);
    font-size: 12px;
    line-height: 1.5;
  }
  .aperture-stage.is-touch-revealed {
    --aperture-radius: 800px;
  }
  .aperture-stage.is-touch-revealed .aperture-base {
    visibility: hidden;
  }
  .scroll-cue {
    left: var(--page-gutter);
    top: calc(100svh - var(--safe-bottom) - 68px);
    min-height: 44px;
    font-size: 12px;
  }
  body > footer {
    padding: 0 var(--page-gutter) calc(24px + var(--safe-bottom));
    justify-content: flex-end;
  }
  body > footer .footnote {
    display: none;
  }
  .nyx-sticky {
    padding: calc(var(--safe-top) + 80px) var(--page-gutter)
      calc(24px + var(--safe-bottom));
  }
  .nyx-title-row {
    gap: 16px;
    align-items: center;
  }
  .nyx-title-row h2 {
    font-size: clamp(34px, 5.2vw, 50px);
  }
  .nyx-byline {
    font-size: 11px;
    letter-spacing: 0.1em;
  }
  .nyx-subtitle {
    margin-top: 7px;
    font-size: 14px;
    line-height: 1.45;
  }
  .nyx-sequence {
    display: block;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior-y: auto;
    scrollbar-width: thin;
    margin-top: 12px;
  }
  .nyx-sticky.is-reading .nyx-sequence {
    overflow-y: auto;
  }
  .nyx-film {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px 18px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    max-width: 620px;
    aspect-ratio: auto;
    margin: 0 auto;
    padding-bottom: 12px;
  }
  .nyx-media {
    display: grid;
    place-items: center;
    grid-area: 2/1/3/3;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    container-type: size;
  }
  .nyx-frame {
    display: block;
    position: relative;
    width: min(100cqw, calc(100cqh * 907 / 595));
    aspect-ratio: 907/595;
    overflow: clip;
  }
  #nyx-video,
  .nyx-hotspots {
    position: absolute;
    inset: auto;
    left: calc(-100% * 176 / 907);
    top: calc(-100% * 76 / 595);
    width: calc(100% * 1280 / 907);
    max-width: none;
    height: calc(100% * 720 / 595);
    aspect-ratio: auto;
    transform: none;
    margin: 0;
  }
  .nyx-hotspot {
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    font-size: 11px;
    border-radius: 11px;
  }
  .nyx-feature[data-order] {
    position: relative;
    inset: auto;
    width: auto;
    padding: 8px 4px;
    background: transparent;
    text-align: left;
  }
  .nyx-feature[data-order="1"] {
    grid-area: 1/1;
  }
  .nyx-feature[data-order="2"] {
    grid-area: 1/2;
  }
  .nyx-feature[data-order="3"] {
    grid-area: 3/1;
  }
  .nyx-feature[data-order="4"] {
    grid-area: 3/2;
  }
  .nyx-feature[data-order]::before {
    height: 3px;
    margin: 0 0 9px;
    transform: none;
  }
  .nyx-feature[data-order] p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
  }
  .nyx-feature[data-order] h3 {
    font-size: clamp(17px, 2.4vw, 22px);
    margin: 7px 0;
  }
  .nyx-feature > span {
    font-size: 10px;
    letter-spacing: 0.08em;
  }
  .nyx-feature[role="button"] {
    cursor: pointer;
  }
  .nyx-feature[role="button"]:focus-visible {
    outline: 2px solid var(--nyx-ink);
    outline-offset: 2px;
    border-radius: 12px;
  }
  .nyx-scroll-note {
    flex-shrink: 0;
    font-size: 10px;
    gap: 12px;
    margin-top: 10px;
    letter-spacing: 0.07em;
  }
  body > .nyx-feature.is-expanded {
    position: fixed !important;
    z-index: 1100;
    grid-area: auto;
    max-width: calc(100vw - 24px);
    margin: 0;
    --nyx-ink: #375a66;
  }
  .nyx-detail-open .chapter-stage {
    pointer-events: none;
  }
  .nyx-panel-close {
    width: 44px;
    height: 44px;
    right: 16px;
    top: 16px;
  }
  .nyx-expanded-content p {
    font-size: 15px;
  }
  #nyx-load-error {
    grid-column: 1/-1;
  }
  .clu-caption {
    top: calc(var(--safe-top) + 82px);
    left: var(--page-gutter);
    right: var(--page-gutter);
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .clu-intro {
    --clu-dock-left: calc(var(--page-gutter) + 6px + 5.2vw);
    --clu-dock-top: calc(var(--safe-top) + 125px);
  }
  .clu-title {
    padding: 90px 16px;
    transform: translate(
        calc(var(--clu-dock, 0) * (var(--clu-dock-left) - 50vw)),
        calc(var(--clu-dock, 0) * (var(--clu-dock-top) - 50svh))
      )
      scale(calc(1 - var(--clu-dock, 0) * 0.8));
  }
  .clu-title h2 {
    width: 94vw;
  }
  .clu-product {
    display: flex;
    flex-direction: column;
    padding: calc(var(--safe-top) + 108px) var(--page-gutter)
      calc(28px + var(--safe-bottom));
    overflow: clip;
  }

  .clu-product > #clu-object-canvas {
    z-index: 2;
  }

  .clu-play {
    min-height: 44px;
    bottom: calc(32px + var(--safe-bottom));
  }
  .clu-continue {
    font-size: 18px;
  }
  .assistant-composer {
    --composer-width: min(560px, calc(100vw - var(--edge-inset) * 2));
  }
  .assistant-input-row {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    gap: 8px;
  }
  .assistant-pill {
    height: 48px;
  }
  .assistant-pill-content {
    padding: 6px 13px;
    gap: 7px;
  }
  .assistant-action-orb {
    width: 44px;
    height: 44px;
  }
  #assistant-message {
    font-size: 16px;
  }
  #assistant-message::placeholder {
    font-size: 12px;
    letter-spacing: 0.07em;
  }
  .assistant-view-toggle {
    left: calc(50% + var(--assistant-eye-x, 0px));
    width: 44px;
    height: 44px;
  }
  .assistant-bubble {
    max-width: min(252px, 84%);
    padding: 12px 19px;
  }
  .assistant-bubble p {
    font-size: 15px;
    line-height: 1.5;
  }
  .assistant-thread {
    padding-inline: 4px;
    touch-action: pan-y;
  }
  .assistant-conversation-space {
    bottom: calc(100% + var(--assistant-history-gap, 16px));
  }

  .assistant-message-status {
    max-height: 72px;
    overflow: auto;
    margin-top: 6px;
    padding: 6px 10px;
  }
  .assistant-focus-panel {
    width: min(600px, calc(100vw - 12px));
  }
  .ares-type-block {
    left: var(--page-gutter);
    right: var(--page-gutter);
    top: clamp(150px, 24svh, 240px);
  }
  .ares-type-block h2 {
    font-size: clamp(17px, 3vw, 23px);
  }
  .ares-font-options {
    flex-wrap: wrap;
  }
  .ares-font-options button {
    min-height: 44px;
    font-size: 13px;
  }
}

@media (max-width: 700px) {
  .nyx-sequence {
    margin-top: var(--page-gutter);
    container-type: inline-size;
  }
  .nyx-sequence > .nyx-film {
    box-sizing: border-box;
    min-height: 100%;
    /* Cap the middle row at the complete laptop window, then share spare
       space equally around the card pairs and computer. */
    grid-template-rows:
      auto
      minmax(
        min(180px, max(0px, calc(100svh - 400px))),
        calc(100cqw * 595 / 907)
      )
      auto;
    align-content: space-evenly;
    row-gap: var(--page-gutter);
    padding-block: var(--page-gutter);
  }
  .nyx-scroll-note {
    margin-top: var(--page-gutter);
  }
  .nyx-hotspot {
    --nyx-marker-size: min(28px, 8cqw, calc(8cqh * 907 / 595));
    width: var(--nyx-marker-size);
    height: var(--nyx-marker-size);
    min-width: var(--nyx-marker-size);
    font-size: 10px;
    border-radius: 9px;
  }
  .nyx-film .nyx-feature[data-order] {
    padding: 4px;
  }
  .nyx-film .nyx-feature[data-order]::before {
    width: 24px;
    height: 2px;
    margin-bottom: 6px;
  }
  .nyx-film .nyx-feature[data-order] > span {
    font-size: 9px;
    letter-spacing: 0.06em;
  }
  .nyx-film .nyx-feature[data-order] h3 {
    font-size: 15px;
    line-height: 1.25;
    margin: 5px 0;
  }
  .nyx-film .nyx-feature[data-order] p {
    font-size: 12px;
    line-height: 1.45;
  }
  .clu-intro {
    --clu-dock-top: calc(var(--safe-top) + 105px);
  }
  #clu-video {
    object-fit: cover;
    object-position: center;
  }
  .clu-product {
    padding-top: calc(var(--safe-top) + 88px);
    padding-bottom: calc(24px + var(--safe-bottom));
  }
}
@media (max-width: 420px) {
  .nyx-title-row {
    flex-wrap: nowrap;
    gap: 12px;
  }
  .nyx-film {
    gap: 8px 12px;
  }
}
@media (max-width: 700px) and (max-height: 740px) {
  .nyx-sticky {
    padding-top: 76px;
    padding-bottom: 20px;
  }
  .nyx-sequence {
    margin-top: 12px;
  }
  .nyx-sequence > .nyx-film {
    row-gap: 8px;
    padding-block: 4px;
  }
  .nyx-film .nyx-feature[data-order] h3 {
    font-size: 14px;
  }
  .clu-intro {
    --clu-dock-top: calc(var(--safe-top) + 93px);
  }
  .clu-product {
    padding-top: calc(var(--safe-top) + 76px);
    padding-bottom: calc(20px + var(--safe-bottom));
  }
}
@media (max-height: 540px) and (max-width: 1100px),
  (max-height: 540px) and (max-width: 1400px) and (hover: none) and (pointer: coarse) {
  body > main.hero-brand {
    top: 40svh;
    width: min(420px, 54vw);
  }
  .hero-brand .hero-description {
    --hero-frame-width: min(550px, 72vw);
    top: calc(100% - 28px);
  }
  .aperture-stage {
    --hero-frame-height: 84px;
  }
  .aperture-stage h2 {
    font-size: calc(27px * var(--hero-text-scale, 1));
  }
  .aperture-reveal > span {
    top: calc(50% + 20px);
    font-size: 11px;
  }
  .scroll-cue {
    top: calc(100svh - var(--safe-bottom) - 68px);
    left: var(--page-gutter);
    font-size: 10px;
  }
  .nyx-sticky {
    padding-top: 76px;
    padding-bottom: 20px;
  }
  .nyx-title-row h2 {
    font-size: 30px;
  }
  .nyx-subtitle {
    margin-top: 4px;
    font-size: 14px;
  }
  .nyx-sequence {
    margin-top: 8px;
  }
  .clu-product {
    padding-top: calc(var(--safe-top) + 84px);
    padding-bottom: 20px;
  }

  .clu-title {
    transform: translate(
        calc(var(--clu-dock, 0) * (var(--clu-dock-left) - 50vw)),
        calc(var(--clu-dock, 0) * (var(--safe-top) + 101px - 50svh))
      )
      scale(calc(1 - var(--clu-dock, 0) * 0.8));
  }

  .ares-type-block {
    top: 116px;
  }
}
@media (min-aspect-ratio: 5/4) and (max-height: 700px) and (max-width: 1100px),
  (min-aspect-ratio: 5/4) and (max-height: 700px) and (max-width: 1400px) and (hover: none) and (pointer: coarse) {
  .nyx-sequence > .nyx-film {
    height: 100%;
    min-height: 0;
    max-width: none;
    padding: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    align-content: stretch;
    align-items: center;
  }
  .nyx-media {
    grid-area: 1/2/3/3;
  }
  .nyx-feature[data-order="1"] {
    grid-area: 1/1;
  }
  .nyx-feature[data-order="2"] {
    grid-area: 1/3;
  }
  .nyx-feature[data-order="3"] {
    grid-area: 2/1;
  }
  .nyx-feature[data-order="4"] {
    grid-area: 2/3;
  }
  .nyx-film .nyx-feature[data-order] {
    padding: 2px;
  }
  .nyx-film .nyx-feature[data-order]::before {
    height: 2px;
    margin-bottom: 4px;
  }
  .nyx-film .nyx-feature[data-order] > span {
    font-size: 8px;
    letter-spacing: 0.04em;
  }
  .nyx-film .nyx-feature[data-order] h3 {
    font-size: 13px;
    line-height: 1.2;
    margin: 4px 0;
  }
  .nyx-film .nyx-feature[data-order] p {
    font-size: 11px;
    line-height: 1.35;
  }
  .nyx-hotspot {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 9px;
    border-radius: 8px;
  }
}

/* The phone hero is one measured composition: logo, gap, and attached frame.
   Desktop keeps the owner's approved opacity, scale, radius, and offsets. */
@media (max-width: 700px) {
  body > main.hero-brand {
    --hero-mobile-width: min(90vw, calc((100svh - 176px) / 0.54));
    width: var(--hero-mobile-width);
    top: calc(
      50svh -
        var(--hero-mobile-center-offset, calc(var(--hero-mobile-width) * 0.32))
    );
  }
  .hero-brand .hero-description {
    left: var(--hero-mobile-ink-left, 5.55%);
    width: var(--hero-mobile-ink-width, 88.2%);
    top: var(
      --hero-mobile-box-top,
      calc(
        var(--hero-mobile-width) * 0.2915 + var(--hero-logo-offset, 0px) *
          0.55 + 12px
      )
    );
    transform: none;
    animation-name: arjia-mobile-description-in;
  }
  .hero-brand .aperture-stage {
    top: 0;
    height: 95px;
    border-radius: calc(
      var(--hero-corner-radius, 29px) * var(--hero-mobile-size-scale, 0.5)
    );
  }
  .hero-brand .aperture-stage h2 {
    position: absolute;
    left: var(--hero-mobile-padding, 20px);
    right: var(--hero-mobile-padding, 20px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-size: var(--hero-mobile-title-size, clamp(18px, 5.8vw, 26px));
    line-height: 1.13;
    letter-spacing: -0.055em;
  }
  .hero-brand .aperture-reveal > span {
    top: auto;
    bottom: var(--hero-mobile-caption-inset, 12px);
    left: var(--hero-mobile-padding, 20px);
    right: var(--hero-mobile-padding, 20px);
    width: auto;
    font-size: clamp(
      9px,
      calc(var(--hero-mobile-ink-width, 79.38vw) * 0.035),
      12px
    );
    line-height: 1.4;
    white-space: normal;
    text-wrap: balance;
  }
}
@keyframes arjia-mobile-description-in {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  .hero-brand .hero-description {
    animation: none;
    transform: none;
  }
}
