.apstudio-footer {
  --apstudio-footer-bg: #0b0b0c;
  --apstudio-footer-fg: #f6f4ed;
  --apstudio-footer-muted: rgba(246, 244, 237, 0.48);
  --apstudio-footer-accent: #d6ff57;
  position: relative;
  z-index: 10;
  min-width: 320px;
  background: var(--apstudio-footer-bg);
  color: var(--apstudio-footer-fg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.apstudio-footer,
.apstudio-footer * {
  box-sizing: border-box;
}

.apstudio-footer__link {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  gap: 24px;
  align-items: center;
  min-height: 44px;
  padding: 0 clamp(20px, 4vw, 56px);
  color: inherit;
  text-decoration: none;
}

.apstudio-footer__project {
  position: relative;
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  gap: 8px;
  align-items: center;
}

.apstudio-footer__mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  overflow: visible;
  color: var(--apstudio-footer-fg);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.apstudio-footer__mark .frame,
.apstudio-footer__mark .line,
.apstudio-footer__mark .detail {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.apstudio-footer__mark .frame {
  opacity: 0.32;
}

.apstudio-footer__mark .detail {
  opacity: 0.5;
  stroke-width: 0.9;
}

.apstudio-footer__mark .accent-line {
  fill: none;
  stroke: var(--apstudio-footer-accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  vector-effect: non-scaling-stroke;
}

.apstudio-footer__mark .accent-fill {
  fill: var(--apstudio-footer-accent);
}

.apstudio-footer__mark .fill {
  fill: currentColor;
}

.apstudio-footer__mark .signature-edge,
.apstudio-footer__mark .signature-node,
.apstudio-footer__mark .signature-core {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
}

.apstudio-footer__project-code {
  display: none;
}

.apstudio-footer__brand {
  display: inline-flex;
  gap: 0.25em;
  align-items: baseline;
  justify-self: center;
  font-size: 13px;
  font-weight: 820;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.apstudio-footer__brand-slash {
  color: var(--apstudio-footer-accent);
  font-weight: 500;
}

.apstudio-footer__domain {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
  color: var(--apstudio-footer-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 180ms ease;
}

.apstudio-footer__arrow {
  color: var(--apstudio-footer-accent);
  font-size: 11px;
  transition: transform 180ms ease;
}

.apstudio-footer__tooltip {
  position: absolute;
  bottom: calc(100% + 18px);
  left: 0;
  display: grid;
  width: min(360px, calc(100vw - 40px));
  grid-template-columns: 88px 1fr;
  gap: 18px;
  padding: 18px 54px 18px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #111114;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
  color: #f5f4ef;
  opacity: 0;
  pointer-events: none;
  transform: translateY(7px) scale(0.98);
  transform-origin: bottom left;
  transition: opacity 180ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.apstudio-footer__tooltip::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -18px;
  left: 0;
  height: 18px;
}

.apstudio-footer__tooltip-mark {
  display: grid;
  width: 88px;
  height: 88px;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #09090a;
  background-size: 14px 14px;
}

.apstudio-footer__tooltip-mark .apstudio-footer__mark {
  width: 62px;
  height: 62px;
}

.apstudio-footer__tooltip-copy {
  align-self: center;
}

.apstudio-footer__tooltip-copy strong,
.apstudio-footer__tooltip-copy span,
.apstudio-footer__tooltip-copy small {
  display: block;
}

.apstudio-footer__tooltip-copy strong {
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.apstudio-footer__tooltip-copy span {
  margin-top: 8px;
  color: #929298;
  font-size: 12px;
  line-height: 1.45;
}

.apstudio-footer__tooltip-copy small {
  margin-top: 9px;
  color: var(--apstudio-footer-accent);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.apstudio-footer__expand {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: #77777e;
  place-items: center;
  appearance: none;
  cursor: zoom-in;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.apstudio-footer__expand svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-width: 1.45;
}

.apstudio-footer__expand:hover,
.apstudio-footer__expand:focus-visible {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #f5f4ef;
  transform: scale(1.04);
}

.apstudio-footer__project:hover .apstudio-footer__mark,
.apstudio-footer__link:focus-visible .apstudio-footer__mark {
  transform: rotate(10deg) scale(1.08);
}

.apstudio-footer__project:hover .signature-edge--accent,
.apstudio-footer__link:focus-visible .signature-edge--accent {
  transform: scale(1.08);
}

.apstudio-footer__project:hover .signature-node--accent,
.apstudio-footer__link:focus-visible .signature-node--accent {
  transform: scale(1.35);
}

.apstudio-footer__project:hover .apstudio-footer__tooltip,
.apstudio-footer__link:focus-visible .apstudio-footer__tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.apstudio-footer__link:hover .apstudio-footer__domain {
  color: var(--apstudio-footer-fg);
}

.apstudio-footer__link:hover .apstudio-footer__arrow {
  transform: translate(2px, -2px);
}

.apstudio-footer__link:focus-visible {
  outline: 2px solid var(--apstudio-footer-accent);
  outline-offset: -2px;
}

html.apstudio-viewer-open,
html.apstudio-viewer-open body {
  overflow: hidden;
}

.apstudio-viewer,
.apstudio-viewer * {
  box-sizing: border-box;
}

.apstudio-viewer[hidden] {
  display: none;
}

.apstudio-viewer {
  --apstudio-viewer-accent: #d6ff57;
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  color: #f6f4ed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  opacity: 0;
  transition: opacity 220ms ease;
}

.apstudio-viewer.is-open {
  opacity: 1;
}

.apstudio-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 5, 0.94);
  backdrop-filter: blur(16px);
}

.apstudio-viewer__panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--apstudio-viewer-accent) 9%, transparent), transparent 36%),
    #09090b;
}

.apstudio-viewer__header {
  display: flex;
  min-height: 76px;
  padding: 14px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.apstudio-viewer__heading span,
.apstudio-viewer__heading strong {
  display: block;
}

.apstudio-viewer__heading span {
  color: rgba(246, 244, 237, 0.44);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.apstudio-viewer__heading strong {
  margin-top: 5px;
  font-size: clamp(15px, 2vw, 21px);
  letter-spacing: -0.025em;
}

.apstudio-viewer__controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.apstudio-viewer__controls button,
.apstudio-viewer__controls output {
  display: grid;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(246, 244, 237, 0.72);
  font: inherit;
  font-size: 15px;
  place-items: center;
  appearance: none;
}

.apstudio-viewer__controls button {
  cursor: pointer;
}

.apstudio-viewer__controls button:hover,
.apstudio-viewer__controls button:focus-visible {
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.apstudio-viewer__controls output {
  width: 58px;
  color: rgba(246, 244, 237, 0.45);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.06em;
}

.apstudio-viewer__controls .apstudio-viewer__close {
  margin-left: 8px;
  color: #fff;
  font-size: 23px;
  font-weight: 300;
}

.apstudio-viewer__workspace {
  position: relative;
  min-height: 0;
  overflow: hidden;
  outline: none;
  cursor: grab;
  touch-action: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 28px 28px;
}

.apstudio-viewer__workspace.is-dragging {
  cursor: grabbing;
}

.apstudio-viewer__origin {
  position: absolute;
  top: 50%;
  left: 50%;
  will-change: transform;
}

.apstudio-viewer__art {
  position: absolute;
  top: 0;
  left: 0;
  width: clamp(270px, 54vmin, 720px);
  height: clamp(270px, 54vmin, 720px);
  transform-origin: center;
  will-change: transform;
}

.apstudio-viewer__mark {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: #f6f4ed;
  filter: drop-shadow(0 26px 70px rgba(0, 0, 0, 0.3));
}

.apstudio-viewer__mark .frame,
.apstudio-viewer__mark .line,
.apstudio-viewer__mark .detail,
.apstudio-viewer__mark .accent-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.apstudio-viewer__mark .frame,
.apstudio-viewer__mark .line {
  stroke: currentColor;
  stroke-width: 1.35px;
}

.apstudio-viewer__mark .frame { opacity: 0.32; }
.apstudio-viewer__mark .detail { stroke: currentColor; stroke-width: 1px; opacity: 0.5; }
.apstudio-viewer__mark .accent-line { stroke: var(--apstudio-viewer-accent); stroke-width: 2px; }
.apstudio-viewer__mark .fill { fill: currentColor; }
.apstudio-viewer__mark .accent-fill { fill: var(--apstudio-viewer-accent); }

.apstudio-viewer__hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(8, 8, 10, 0.7);
  color: rgba(246, 244, 237, 0.42);
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.apstudio-viewer__footer {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.35fr) auto;
  gap: clamp(24px, 4vw, 62px);
  padding: 20px clamp(16px, 3vw, 42px) 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  align-items: end;
}

.apstudio-viewer__story > span {
  color: var(--apstudio-viewer-accent);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.apstudio-viewer__story h2 {
  margin: 7px 0 0;
  font-size: clamp(22px, 3vw, 38px);
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.apstudio-viewer__story p {
  max-width: 520px;
  margin: 9px 0 0;
  color: rgba(246, 244, 237, 0.56);
  font-size: 12px;
  line-height: 1.5;
}

.apstudio-viewer__passport {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
  margin: 0;
}

.apstudio-viewer__passport div {
  min-width: 0;
}

.apstudio-viewer__passport dt {
  color: rgba(246, 244, 237, 0.34);
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.apstudio-viewer__passport dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: rgba(246, 244, 237, 0.72);
  font-size: 10px;
  line-height: 1.35;
}

.apstudio-viewer__archive {
  color: rgba(246, 244, 237, 0.58);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.apstudio-viewer__archive:hover { color: #fff; }

@media (max-width: 560px) {
  .apstudio-footer__link {
    grid-template-columns: minmax(42px, 1fr) auto minmax(42px, 1fr);
    gap: 9px;
    min-height: 44px;
    padding: 0 16px;
  }

  .apstudio-footer__project-code,
  .apstudio-footer__domain-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
  }

  .apstudio-footer__mark {
    width: 21px;
    height: 21px;
  }

  .apstudio-footer__tooltip {
    position: fixed;
    right: 10px;
    bottom: 47px;
    left: 10px;
    width: auto;
    transform-origin: bottom center;
  }

  .apstudio-viewer__header {
    min-height: 64px;
    gap: 10px;
  }

  .apstudio-viewer__heading span { display: none; }
  .apstudio-viewer__controls { gap: 4px; }
  .apstudio-viewer__controls button { min-width: 34px; width: 34px; height: 34px; }
  .apstudio-viewer__controls output { display: none; }
  .apstudio-viewer__controls .apstudio-viewer__close { margin-left: 2px; }

  .apstudio-viewer__art {
    width: min(72vw, 440px);
    height: min(72vw, 440px);
  }

  .apstudio-viewer__hint {
    bottom: 10px;
    max-width: calc(100% - 24px);
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
  }

  .apstudio-viewer__footer {
    grid-template-columns: 1fr;
    gap: 13px;
    max-height: 38vh;
    padding-top: 14px;
    overflow: auto;
  }

  .apstudio-viewer__story h2 { font-size: 24px; }
  .apstudio-viewer__story p { font-size: 11px; }
  .apstudio-viewer__passport { gap: 8px 16px; }
  .apstudio-viewer__archive { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .apstudio-footer__mark,
  .apstudio-footer__tooltip,
  .apstudio-footer__arrow,
  .apstudio-viewer {
    transition: none;
  }
}
