/* Brand layer over the Shibuya theme. Colours come from the theme's Radix teal scale, so light and
   dark mode follow the reader's choice; button colours meet WCAG AA contrast in both. */

:root {
  --sd-color-primary: var(--accent-11);
  --sd-color-primary-highlight: var(--accent-12);
  --sd-color-primary-text: #ffffff;
  --wo-radius: 14px;
}

html.dark {
  --sd-color-primary-text: #04201c;
}

/* ---- landing page: hero (scoped with :has(.wo-hero), so other pages keep the theme's layout) */

.yue:has(.wo-hero) > section:first-of-type > h1 {
  max-width: 13em;
  margin-inline: auto;
  text-align: center;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.wo-hero {
  max-width: 40rem;
  margin: 0 auto 1.5rem;
  text-align: center;
}

.wo-hero__lead {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--sy-c-text);
}

.wo-hero__actions,
.wo-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.wo-cta {
  margin: 3.5rem 0 1rem;
}

.wo-hero__actions .sd-btn,
.wo-cta .sd-btn {
  padding: 0.7rem 1.4rem;
  font-weight: 600;
}

/* The install command sits under the buttons, centred and compact. */
.yue:has(.wo-hero) > section:first-of-type > .highlight-bash {
  max-width: 21rem;
  margin: 0 auto;
}

.wo-hero-visual {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 1rem;
}

.wo-hero__actions a,
.wo-cta a {
  text-decoration: none;
}

/* Wide screens: text on the left, the 3D model on the right, both above the fold. The hero's
   elements are direct children of the page's first section; everything after them spans both
   columns. */
@media (min-width: 1100px) {
  .yue:has(.wo-hero) > section:first-of-type {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    column-gap: 3rem;
    align-items: center;
  }

  .yue:has(.wo-hero) > section:first-of-type > * {
    grid-column: 1 / -1;
  }

  .yue:has(.wo-hero) > section:first-of-type > h1,
  .yue:has(.wo-hero) > section:first-of-type > .wo-hero,
  .yue:has(.wo-hero) > section:first-of-type > .highlight-bash {
    grid-column: 1;
    margin-inline: 0;
    text-align: left;
  }

  .yue:has(.wo-hero) > section:first-of-type > .wo-hero {
    margin-bottom: 1.25rem;
  }

  .yue:has(.wo-hero) > section:first-of-type > .wo-hero .wo-hero__actions {
    justify-content: flex-start;
  }

  .yue:has(.wo-hero) > section:first-of-type > .wo-hero-visual {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin: 0;
  }
}

/* ---- landing page: the film (poster until played; nothing loads before that) ----------- */

.wo-film {
  max-width: 56rem;
  margin: 1.5rem auto 0;
}

.wo-film video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--sy-c-border);
  border-radius: var(--wo-radius);
  background: #f4f2ec;
}

/* ---- landing page: sections -------------------------------------------------------------- */

.yue:has(.wo-hero) > section:first-of-type > section > h2 {
  margin-top: 4.5rem;
  text-align: center;
  font-size: 2rem;
  letter-spacing: -0.025em;
}

.yue:has(.wo-hero) > section:first-of-type > section > p,
.yue:has(.wo-hero) > section:first-of-type > section > h2 + p {
  max-width: 42rem;
  margin-inline: auto;
  text-align: center;
  font-size: 1.05rem;
}

.yue .sd-card {
  border: 1px solid var(--sy-c-border);
  border-radius: var(--wo-radius);
  background: var(--sy-c-background);
  box-shadow: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.yue .sd-card:hover {
  border-color: var(--accent-7);
  transform: translateY(-2px);
}

.yue .sd-card .sd-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.yue .sd-card ul {
  padding-left: 1.1rem;
}

.wo-step .sd-card-title {
  color: var(--accent-11);
}

.wo-stat .sd-card-body {
  font-size: 0.95rem;
  line-height: 1.45;
}

.wo-stat__value {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent-11);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* ---- 3D logo stage (see hero.js) --------------------------------------------------------- */
/* The poster shows until the live model has drawn its first frame; then they cross-fade. The
   soft halo keeps the midnight enamel readable on the dark theme. */

.wo-hero__stage {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(214 224 245 / 0.55), transparent);
  cursor: grab;
  touch-action: pan-y; /* vertical swipes still scroll the page on touch screens */
}

html.dark .wo-hero__stage {
  background: radial-gradient(closest-side, rgb(90 116 178 / 0.35), transparent);
}

.wo-hero__stage:focus-visible {
  outline: 2px solid var(--accent-9);
  outline-offset: 4px;
}

.wo-hero__stage.is-dragging {
  cursor: grabbing;
}

.wo-hero__stage > img,
.wo-hero__stage > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.6s ease;
}

.wo-hero__stage > canvas {
  opacity: 0;
}

.wo-hero__stage.is-live > canvas {
  opacity: 1;
}

.wo-hero__stage.is-live > img {
  opacity: 0;
}

/* ---- small screens and reduced motion ---------------------------------------------------- */

@media (max-width: 640px) {
  .yue:has(.wo-hero) > section:first-of-type > h1 {
    margin-top: 1.5rem;
    font-size: 2.6rem;
  }

  .wo-hero__lead {
    font-size: 1.1rem;
  }

  .yue:has(.wo-hero) > section:first-of-type > section > h2 {
    margin-top: 3.5rem;
    font-size: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .yue .sd-card,
  .wo-hero__stage > img,
  .wo-hero__stage > canvas {
    transition: none;
  }

  .yue .sd-card:hover {
    transform: none;
  }
}
