/* One viewport below the shared navigation, with the supplied cube renderer. */
.contact-cube {
  --contact-height: calc(100svh - var(--header-height) - 56px);
  --contact-channel-size: clamp(28px,min(5.28vw,7svh),76px);
  --contact-stage-size: min(560px,42vw,calc((var(--contact-height) - var(--contact-channel-size) * 1.22 - 216px) / 1.4));
  --contact-qr-reference-size: min(560px,42vw,calc((var(--contact-height) - var(--contact-channel-size) * 1.22 - 138px) / 1.4));
  --contact-qr-offset: 32px;
  --contact-account-gap: 25px;
  --contact-talk-size: clamp(64px,min(16vw,16svh),220px);
  --plate-top: #0c0c0c; --plate-side: #151515; --plate-grid: rgb(255 255 255 / 18%);
  --shadow: rgb(255 255 255 / 5%); --cube-top: #f4f4f2; --cube-edge: rgb(0 0 0 / 35%);
  --side-l-hi: #8c8c8c; --side-l-lo: #141414; --side-r-hi: #4a4a4a; --side-r-lo: #080808;
  --contact-ease: cubic-bezier(.65,0,.35,1);
  --contact-speed-line-opacity: .75;
  height: var(--contact-height); overflow: clip; position: relative; isolation: isolate;
}
:root[data-theme="light"] .contact-cube {
  --contact-speed-line-opacity: 1;
  --plate-top: #f3f3f1; --plate-side: #ebebe8; --plate-grid: rgb(0 0 0 / 8%);
  --shadow: transparent; --cube-top: #111111; --cube-edge: rgb(255 255 255 / 25%);
  --side-l-hi: #3c3c3c; --side-l-lo: #cfcfcb; --side-r-hi: #6a6a6a; --side-r-lo: #e2e2de;
}
.contact-stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.contact-cube .contact-section-content {
  width: 100%; height: 100%; min-height: 0; gap: 0; position: relative; z-index: 1;
  padding: 24px var(--page-gutter) 20px;
}
.contact-layout { display: grid; grid-template-columns: 1fr; grid-template-rows: 50px 1fr; justify-items: center; align-items: center; width: 100%; flex: 1; min-height: 0; gap: 16px; overflow: visible; }
.contact-channels { grid-row: 1; display: grid; grid-template-columns: 1fr 1fr; width: min(280px,100%); height: 50px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; position: relative; z-index: 2; transform: translateY(20px); }
.contact-channels { background: rgb(var(--background-rgb) / 60%); -webkit-backdrop-filter: blur(var(--navigation-glass-blur,30px)); backdrop-filter: blur(var(--navigation-glass-blur,30px)); }
.contact-switch-thumb { position: absolute; inset: 3px auto 3px 3px; width: calc((100% - 6px) / 2); border-radius: inherit; background: var(--foreground); pointer-events:none; transition: background-color 300ms; }
.contact-channel {
  display: flex; align-items: center; justify-content: center; gap: 8px; position: relative; border: 0; border-radius: 999px; padding: 0; background: none; cursor: pointer;
  color: var(--text-secondary); font-family: Inter,sans-serif; font-weight: 600;
  font-size: 14px; line-height: 1.22; letter-spacing: 0;
  transition: color 300ms var(--contact-ease);
}
.contact-channel[aria-selected="true"] { color: var(--on-fill); }
.contact-channel svg { width: 24.2px; height: 24.2px; }
/* The two chat bubbles occupy less of their viewBox than the paper plane. */
.contact-channel[data-key="wechat"] svg { width: 26.6px; height: 26.6px; }
.contact-channel:focus-visible { outline: 2px solid var(--foreground); outline-offset: 8px; }
/* Extend each channel outward to its half of the rendered QR frame. The
   transparent button area remains part of the capsule's hover boundary. */
@media (hover: hover) and (pointer: fine) {
  .contact-channel::before {
    content: ''; position: absolute; top: -4px; bottom: -4px;
    width: max(100%,calc(var(--contact-qr-reference-size) * .4368));
  }
  .contact-channel[data-key="wechat"]::before { right: 0; }
  .contact-channel[data-key="telegram"]::before { left: 0; }
}
.contact-qr-stage { grid-row: 2; position: relative; width: var(--contact-stage-size); margin-block: 0; justify-self: center; }
/* Independent reference for the enlarged QR, without resizing the sculpture. */
.contact-qr-stage::after { content: ''; position: absolute; width: var(--contact-qr-reference-size); height: var(--contact-qr-offset); visibility: hidden; pointer-events: none; }
.contact-qr-frame { display: block; position: relative; width: 100%; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
.contact-qr-frame::before { content: ''; position: absolute; left: 50%; top: calc(var(--contact-stage-size) * .9 - var(--contact-qr-reference-size) * .8736 + var(--contact-qr-offset)); width: calc(var(--contact-qr-reference-size) * .8736); height: calc(var(--contact-qr-reference-size) * .8736); transform: translateX(-50%); }
.contact-qr-frame:focus-visible { outline: 1px solid var(--text-secondary); outline-offset: 12px; border-radius: 16px; }
.contact-qr-frame canvas { position: absolute; left: -62%; top: -62%; width: 224%; height: 224%; pointer-events: none; transition: transform 1500ms var(--contact-ease); }
.contact-idline { position: absolute; top: calc(var(--contact-stage-size) * .5 + var(--contact-qr-reference-size) * .4368 - max(0px,var(--contact-qr-reference-size) * .4368 - var(--contact-stage-size) * .4) + var(--contact-qr-offset) + var(--contact-account-gap)); left: 50%; width: calc(var(--contact-qr-reference-size) * .8736); height: 30px; display: flex; align-items: center; justify-content: center; color: var(--foreground); font-size: 17px; line-height: 24px; font-weight: 500; letter-spacing: .06em; opacity: 0; visibility: hidden; transform: translate(-50%,6px); pointer-events: none; transition: opacity 300ms var(--contact-ease), transform 300ms var(--contact-ease), visibility 300ms; }
/* Keep the QR-to-account gap and the full account row inside one hover zone. */
.contact-idline::before { content: ''; position: absolute; bottom: 100%; left: 0; width: 100%; height: var(--contact-account-gap); }
.contact-account { position: relative; display: flex; align-items: center; width: max-content; }
.contact-qr-stage.qr-ready .contact-idline { opacity: 1; visibility: visible; transform: translate(-50%,0); pointer-events: auto; }
.contact-idtxt { flex: 0 0 auto; overflow: hidden; text-align: left; font-size: 1.2em; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: pre; user-select: text; }
.contact-idtxt .g { color: var(--text-secondary); }
.contact-idtxt .contact-handle-at { position: relative; top: -.08em; }
.contact-copy { position: absolute; left: calc(100% + 6px); top: 50%; transform: translateY(-50%); display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; background: none; color: var(--text-secondary); cursor: pointer; }
.contact-copy:is(:hover,:focus-visible), .contact-copy.ok { color: var(--foreground); }
.contact-copy svg { grid-area: 1 / 1; transition: opacity 200ms var(--contact-ease), transform 300ms var(--contact-ease); }
.contact-copy .ic-ok { opacity: 0; transform: scale(.6); }
.contact-copy .ic-ok path { stroke-dasharray: 16; stroke-dashoffset: 16; }
.contact-copy.ok .ic-copy { opacity: 0; transform: scale(.6); }
.contact-copy.ok .ic-ok { opacity: 1; transform: scale(1); }
.contact-copy.ok .ic-ok path { animation: contact-copy-draw 350ms 80ms var(--contact-ease) forwards; }
@keyframes contact-copy-draw { to { stroke-dashoffset: 0; } }
.contact-cube-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.contact-mobile-action { display: none; }
.contact-talk-title { flex: 0 0 auto; width: 100%; height: calc(var(--contact-talk-size) * .75); display: flex; align-items: center; justify-content: flex-start; margin: 0; position: relative; z-index: 2; color: var(--foreground); text-align: left; font-family: "Clash Display",sans-serif; font-size: 9.5vw; font-weight: 600; line-height: .95; letter-spacing: -.015em; transform: translateY(50px); }
.contact-cube .contact-footer { margin-top: auto; position: relative; flex: 0 0 auto; }
@media (max-width: 760px) {
  .contact-cube {
    --contact-qr-offset: 32px;
    --contact-channel-size: clamp(24px,7.4vw,48px);
    /* Reserve readable text and touch controls; size the sculpture to the rest. */
    --contact-stage-size: min(76vw,360px,calc((var(--contact-height) - var(--contact-channel-size) * 1.22 - 308px) / 1.2));
    --contact-qr-reference-size: min(76vw,360px,calc((var(--contact-height) - var(--contact-channel-size) * 1.22 - 218px) / 1.2));
  }
  .contact-cube .contact-section-content { padding-top: 16px; }
  .contact-layout { gap: 16px; }
  .contact-channels { width: min(264px,100%); }
  .contact-channel { font-size: 13px; }
  .contact-qr-stage { margin-bottom: 0; }
  .contact-idline { height: 30px; font-size: 15px; }
  .contact-mobile-action { display: none; }
  .contact-mobile-action:hover { background: var(--foreground); color: var(--background); }
}
@media (max-width: 600px) {
  .contact-cube { --contact-stage-size: min(76vw,360px,calc((var(--contact-height) - var(--contact-channel-size) * 1.22 - 284px) / 1.2)); }
}
@media (prefers-reduced-motion: reduce) {
  .contact-channel, .contact-switch-thumb, .contact-qr-frame canvas, .contact-idline, .contact-copy svg { transition: none; }
  .contact-copy.ok .ic-ok path { animation: none; stroke-dashoffset: 0; }
}

.contact-title-fixed { flex: 0 0 auto; white-space: pre; }
.contact-title-morph { flex: 1; min-width: 0; position: relative; display: grid; justify-items: start; text-align: left; font: inherit; letter-spacing: inherit; line-height: inherit; }
.contact-title-morph canvas { pointer-events: none; }
