/* The signed-out landing page.
   Light and airy per the brief: lots of white, one accent, and the cube doing
   the talking. Everything is a grid that collapses to one column on a phone —
   the demo is the first thing worth seeing on a small screen too, so it sits
   directly under the headline rather than being pushed below the fold. */

.welcome {
  display: flex;
  flex-direction: column;
  gap: clamp(var(--space-7, 48px), 7vw, 96px);
  padding-bottom: var(--space-8, 64px);
}

/* --------------------------------------------------------------------- */
/* Hero                                                                   */
/* --------------------------------------------------------------------- */

.welcome-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(var(--space-6, 32px), 5vw, 72px);
  align-items: center;
  padding-top: clamp(var(--space-5, 24px), 4vw, 56px);
}

.welcome-eyebrow {
  margin: 0 0 var(--space-3);
  font-size: 0.76rem;
  font-weight: 680;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.welcome-title {
  margin: 0 0 var(--space-4);
  /* Scales with the viewport instead of stepping at breakpoints, so it never
     lands on an awkward two-word last line. */
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  line-height: 1.06;
  letter-spacing: -0.022em;
  font-weight: 760;
}

.welcome-lede {
  margin: 0 0 var(--space-6);
  max-width: 52ch;
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 1.6;
  color: var(--ink-500);
}

.welcome-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.welcome-cta--end {
  margin-top: var(--space-6);
  justify-content: center;
}

.welcome-cta__note {
  margin: var(--space-4) 0 0;
  font-size: 0.86rem;
  color: var(--ink-400);
  max-width: 46ch;
}

/* --------------------------------------------------------------------- */
/* The self-running cube                                                  */
/* --------------------------------------------------------------------- */

.showcase {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* No aspect-ratio here on purpose. The viewer's own `.cube3d__stage` is 5:4,
   so forcing a square left a strip of empty background under the canvas --
   and overriding the canvas with `!important` to fill it would be fighting
   the component that owns the camera. The panel takes the height the cube
   asks for. */
.showcase__stage {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg, 20px);
  /* A soft cast rather than a card: the cube should look like it is sitting on
     the page, not inside a box. */
  background:
    radial-gradient(120% 100% at 50% 0%, var(--paper) 0%, var(--canvas) 55%, #eef2f8 100%);
  box-shadow: inset 0 0 0 1px var(--ink-100);
  overflow: hidden;
}

.showcase__caption {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  min-height: 2.4em;
}

.showcase__label {
  font-size: 0.7rem;
  font-weight: 680;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-400);
}

.showcase__title {
  font-size: 1rem;
  font-weight: 660;
  color: var(--ink-900);
}

.showcase__moves {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink-500);
  letter-spacing: 0.04em;
}

/* A thin phase-coloured rule under the caption: the only place the phase
   colours appear on this page, so it reads as information rather than decor. */
.showcase__caption::after {
  content: "";
  flex-basis: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-100);
  transition: background 240ms ease;
}
.showcase__caption[data-phase="f2l"]::after { background: var(--phase-f2l); }
.showcase__caption[data-phase="oll"]::after { background: var(--phase-oll); }
.showcase__caption[data-phase="pll"]::after { background: var(--phase-pll); }
.showcase__caption[data-phase="cross"]::after { background: var(--phase-cross); }

.showcase__controls {
  display: flex;
  gap: var(--space-2);
}

/* --------------------------------------------------------------------- */
/* What you get                                                           */
/* --------------------------------------------------------------------- */

.welcome-what h2,
.welcome-how h2 {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  letter-spacing: -0.015em;
}

.welcome-section__lede {
  margin: 0 0 var(--space-6);
  max-width: 62ch;
  color: var(--ink-500);
}

.welcome-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* auto-fit down the sizes: two across on a tablet, one on a phone, with no
     breakpoints to keep in step. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: var(--space-4);
}

/* Pinned to three on a wide screen. auto-fit would fit four, which leaves the
   six cards as 4 + 2 — a short second row reads as something missing. */
@media (min-width: 1080px) {
  .welcome-grid { grid-template-columns: repeat(3, 1fr); }
}

.welcome-card {
  padding: var(--space-5);
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--ink-100);
  transition: border-color 160ms ease, transform 160ms ease;
}

.welcome-card:hover {
  border-color: var(--ink-200);
  transform: translateY(-2px);
}

.welcome-card h3 {
  margin: 0 0 var(--space-2);
  font-size: 1.02rem;
  font-weight: 680;
  line-height: 1.3;
}

.welcome-card p {
  margin: 0;
  color: var(--ink-500);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* --------------------------------------------------------------------- */
/* How it goes                                                            */
/* --------------------------------------------------------------------- */

.welcome-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-5);
  counter-reset: step;
}

.welcome-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "n title" ". body";
  gap: var(--space-2) var(--space-3);
  align-items: center;
}

.welcome-steps__n {
  grid-area: n;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: #2a41d8;
  font-weight: 700;
  font-size: 0.9rem;
}

.welcome-steps h3 {
  grid-area: title;
  margin: 0;
  font-size: 1rem;
  font-weight: 660;
}

.welcome-steps p {
  grid-area: body;
  margin: 0;
  color: var(--ink-500);
  font-size: 0.92rem;
}

/* --------------------------------------------------------------------- */
/* Narrow screens                                                         */
/* --------------------------------------------------------------------- */

@media (max-width: 860px) {
  .welcome-hero {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  /* The cube goes above the buttons on a phone: it is the thing that explains
     what this is faster than the copy does. */
  .welcome-hero__copy { order: 1; }
  .showcase { order: 2; }

  .showcase__stage {
    /* Keep it from eating a whole phone screen -- but by limiting the width,
       not the height. The viewer's stage is 5:4, so a max-height with
       `overflow: hidden` above just crops the cube; capping the width lets it
       scale. 72.5vh wide is 58vh tall at that ratio. */
    max-width: min(100%, 72.5vh);
    margin-inline: auto;
  }
}

@media (max-width: 520px) {
  .welcome-cta .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-card { transition: none; }
  .welcome-card:hover { transform: none; }
  .showcase__caption::after { transition: none; }
}
