/* LeKiwi Arm project page, on top of Bulma */

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --wash: #f8fafc;
  --accent: #2563eb;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --tile-radius: 14px;
  --tile-shadow: 0 0 0 1px rgb(15 23 42 / 0.06), 0 12px 32px -14px rgb(15 23 42 / 0.38);
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a:focus, .button:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.nowrap { white-space: nowrap; }
.hero { position: relative; overflow: hidden; }
/* Bulma centres .container with auto margins, which in a .hero shrinks it to its content: use the full width */
.hero > .container, .section > .container { width: 100%; }

/* ------------------------------------------------------------------ arrival: pieces rise in one after another */
.enter { opacity: 0; transform: translateY(14px); animation: rise 0.95s var(--ease) var(--d, 0ms) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.95s var(--ease) var(--d, 0ms), transform 0.95s var(--ease) var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ title and Code button */
.intro .hero-body { padding: 5.5rem 1.5rem 1.25rem; }
.publication-title {
  font-weight: 700 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.025em;
  color: var(--ink) !important;
  margin-bottom: 1.9rem !important;
}
.button {
  border-radius: 12px !important;
  font-weight: 600 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative;
  overflow: hidden;
}
.button.is-dark {
  background: #1e293b !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.button.is-dark:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  background: var(--accent) !important;
}
.button.is-dark:active { transform: translateY(0); box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
.publication-links .button { padding-left: 1.4em; padding-right: 1.4em; }
.button .icon svg { width: 1.1em; height: 1.1em; fill: currentColor; }

/* ------------------------------------------------------------------ three videos side by side */
.teaser .hero-body { padding: 2.5rem 1.5rem 5rem; }
.trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
.trio-item { margin: 0; }
.trio-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--tile-radius);
  background: linear-gradient(180deg, #24364c 0%, #172231 55%, #111822 100%);
  box-shadow: var(--tile-shadow);
}
.trio-media::after {  /* a soft sweep of light until the video shows its first picture */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgb(255 255 255 / 0.07) 50%, transparent 62%);
  background-size: 300% 100%;
  animation: sweep 1.9s ease-in-out infinite;
  transition: opacity 0.7s ease;
}
.trio-media.loaded::after { opacity: 0; animation: none; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.trio-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  opacity: 0;
  transition: opacity 1s var(--ease);
}
.trio-media video.ready { opacity: 1; }
.trio figcaption {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

/* ------------------------------------------------------------------ interactive demo */
.section.demo {
  padding: 5rem 1.5rem 6rem;
  background: var(--wash);
  border-top: 1px solid var(--line);
}
.section-head { margin-bottom: 2.25rem; }
.section-head .title.is-3 { position: relative; margin-bottom: 0 !important; padding-bottom: 0.9rem; color: var(--ink); font-weight: 700 !important; }
.section-head .title.is-3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.sim-embed {
  position: relative;
  height: min(78vh, 780px);
  min-height: 520px;
  overflow: hidden;
  border-radius: 16px;
  background: radial-gradient(130% 95% at 50% 0%, #3d5a79 0%, #1d2b3c 46%, #0d131b 100%);  /* as the sim's loading screen */
  box-shadow: var(--tile-shadow);
}
.sim-embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.sim-embed:fullscreen { height: 100%; border-radius: 0; }

.sim-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-top: 0.7rem;
}
.sim-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--faint);
  transition: background 0.2s, color 0.2s;
}
.sim-bar a:hover { background: #eef2f7; color: var(--ink); }
.sim-bar a[hidden] { display: none; }
.sim-bar svg { width: 17px; height: 17px; }

/* ------------------------------------------------------------------ back-to-top button */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 6px 18px -8px rgb(15 23 42 / 0.35);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.scroll-to-top.visible { opacity: 1; visibility: visible; }
.scroll-to-top:hover {
  color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}
.scroll-to-top svg { display: block; }

/* ------------------------------------------------------------------ small screens, less motion */
@media screen and (max-width: 768px) {
  .intro .hero-body { padding: 3.5rem 1.25rem 1rem; }
  .teaser .hero-body { padding: 1.5rem 1.25rem 3.5rem; }
  .section.demo { padding: 3.5rem 1rem 4rem; }
  .sim-embed { height: 85vh; min-height: 560px; }
  .publication-title { font-size: 2.5rem !important; line-height: 1.2 !important; }
  .button { margin: 0.25rem !important; font-size: 0.875rem !important; padding: 0.75rem 1rem !important; }
}
@media screen and (max-width: 640px) {
  .trio { grid-template-columns: minmax(0, 1fr); max-width: 420px; margin: 0 auto; gap: 2rem; }
}
@media screen and (max-width: 480px) {
  .publication-title { font-size: 2rem !important; }
}
@media (prefers-reduced-motion: reduce) {
  .enter, .js .reveal { opacity: 1 !important; transform: none !important; animation: none !important; transition: none !important; }
  .trio-media::after { animation: none; }
}
