/* Language navigation and layout */
.languages { display: flex; flex: 0 0 auto; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 5px; }
.languages a { display: grid; place-items: center; min-width: 32px; min-height: 34px; border-radius: 3px; font: 11px var(--mono); }
.languages a[aria-current="page"] { background: var(--accent); color: var(--bg); }
.languages a:focus-visible, .languages a:hover { outline-offset: 1px; }
.hero > *, .about > *, .project-grid > *, .stack-row > * { min-width: 0; }
.hero h1 { font-size: clamp(3.25rem, 6.2vw, 6.25rem); letter-spacing: -.065em; overflow-wrap: anywhere; }
.lab-art { isolation: isolate; }
.lab-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, #c3f36b15 50%, transparent);
  height: 25%;
  opacity: .65;
}
.chip, .project, .project-visual > :nth-child(2), .stack-row > div span { transition: transform .28s ease, border-color .28s ease, background-color .28s ease; }
.project:focus-within { border-color: var(--accent); }
.project-open, .filters button, .art-bottom button, .quick-commands button { min-height: 44px; }
.project-open { align-items: center; }
.dialog-close { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; }
dialog { max-height: 85dvh; }
#terminal-output { max-height: min(330px, 42dvh); min-height: min(180px, 25dvh); }
#command { font-size: max(16px, 1em); }
.stack-row > div span { overflow-wrap: anywhere; }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .project:hover { transform: translateY(-4px); border-color: var(--accent); }
  .study:hover .study-path { transform: rotate(-3deg) translateY(-4px); }
  .foundry:hover .furnace { transform: translateX(-50%) rotate(-23deg) skew(10deg) scale(1.08); }
  .slides:hover .slide-stack, .sync:hover .sync-flow { transform: translateY(-6px) scale(1.06); }
  .stack-row > div span:hover { transform: translateY(-3px); border-color: var(--accent); }
}

@media (max-width: 1000px) {
  .nav-actions { gap: 12px; }
  .hero h1 { font-size: clamp(2.8rem, 7vw, 4.6rem); }
}
@media (max-width: 820px) {
  header { height: auto; min-height: 78px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 8px; }
  header .site-nav { order: 3; width: 100%; justify-content: space-between; border-top: 1px solid var(--line); gap: 16px; }
  header .site-nav a { padding: 10px 0; }
  header .contact-link { display: none; }
  .nav-actions { margin-left: auto; }
}
@media (max-width: 700px) {
  .hero h1 { font-size: clamp(2.45rem, 10vw, 4.65rem); }
  .hero-links, .hero-note, .contact-bottom > div { flex-wrap: wrap; }
  .project-meta { flex-wrap: wrap; }
  .lab-banner .button { white-space: normal; }
  .orbit { width: min(260px, 83%); height: auto; aspect-ratio: 1; }
}
@media (max-width: 370px) {
  header { gap: 7px; }
  .nav-actions { gap: 6px; }
  .lab-art { min-height: 360px; }
  .orbital { height: 245px; }
  .art-top, .art-bottom { padding: 12px; }
  .art-bottom button span { margin-left: 4px; }
  .about-details { grid-template-columns: 1fr; }
  .contact h2 { font-size: clamp(2rem, 12vw, 2.7rem); }
  .contact h2 > span { float: none; font-size: .72em; }
  #terminal-form { padding-inline: 12px; }
  .sync-flow { gap: 9px; }
}

@keyframes enter-view { from { opacity: .5; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes lab-scan { 0%, 12% { transform: translateY(-105%); } 73%, 100% { transform: translateY(410%); } }
@keyframes chip-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes signal-pulse { 0%, 100% { opacity: .85; scale: 1; } 50% { opacity: .4; scale: .7; } }
@keyframes terminal-in { from { opacity: .5; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *, .entered-view { animation: enter-view .65s ease-out both; }
  .hero-copy h1 { animation-delay: .06s; }
  .hero-copy p { animation-delay: .12s; }
  .hero-links, .hero-note { animation-delay: .18s; }
  .lab-art { animation: enter-view .9s ease-out both; }
  .lab-art::after { animation: lab-scan 5s linear 2; animation-fill-mode: both; }
  body:not(.craft) .chip { animation: chip-float 3s ease-in-out 4; }
  .satellite, .pulse, .cursor { animation: signal-pulse 1.8s ease-in-out 5; }
  .s2 { animation-delay: .5s; }
  dialog[open] { animation: terminal-in .2s ease-out both; }
}

