/* ==========================================================================
   Home — final handoff (final_home-v2.dc.html, 2026-10-30)
   The bento grid, the video hero and the Sign in tile. The tiles below them
   are css/home-sections.css; the CTA tile is css/cta-band.css.
   ========================================================================== */

/* ---------------------------------------------------------------- Grid --- */
/* Phone first: one column in the design's phone order (the CTA comes before
   What's New there, after it on desktop). */

.home-grid {
  display: grid;
  gap: var(--ffb-bento-gap);
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "hero"
    "signin"
    "cap"
    "explore"
    "areas"
    "path"
    "cta"
    "logos"
    "accr";
}

@media (min-width: 700px) {
  .home-grid {
    grid-auto-rows: minmax(130px, auto);
  }
}

/* Capabilities and Explore pair up. */
@media (min-width: 900px) and (max-width: 1099px) {
  .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "hero hero"
      "signin signin"
      "cap explore"
      "areas areas"
      "path path"
      "cta cta"
      "logos logos"
      "accr accr";
  }
}

@media (min-width: 1100px) {
  .home-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: minmax(150px, auto);
    grid-template-areas:
      "hero hero hero hero hero hero hero hero hero signin signin signin"
      "hero hero hero hero hero hero hero hero hero signin signin signin"
      "hero hero hero hero hero hero hero hero hero signin signin signin"
      "cap cap cap cap cap cap explore explore explore explore explore explore"
      "areas areas areas areas areas areas areas areas path path path path"
      "areas areas areas areas areas areas areas areas path path path path"
      "logos logos logos logos logos logos logos logos logos logos logos logos"
      "accr accr accr accr accr accr accr accr accr accr accr accr"
      "cta cta cta cta cta cta cta cta cta cta cta cta";
  }
}

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

.home-hero {
  --ffb-focus: var(--ffb-focus-on-dark);
  grid-area: hero;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(320px, 52vh, 460px);
  padding: clamp(24px, 3vw, 44px);
  border-radius: var(--ffb-r-bento);
  background: var(--ffb-navy-deep);
}

.home-hero__video {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ffb-hero-scrim);
}

.home-hero__eyebrow {
  margin-bottom: 14px;
  font-weight: 500;
  font-size: var(--ffb-eyebrow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ffb-green-hover);
}

/* A step under the design's clamp(32px, min(3.6vw, 6.4vh), 56px) so the
   longest typed line stays on one line in the desktop hero (Keith,
   2026-11-02): it needs about 21em, and the hero is ~9/12 of the frame. */
.home-hero__title {
  font-size: clamp(30px, min(3vw, 6.4vh), 46px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.home-hero__fixed {
  display: block;
}

/* Every headline sits in the same cell; the hidden ones hold the height of
   the longest, so the typing never moves the lines around it. */
.home-hero__rotate {
  display: grid;
}

.home-hero__ghost,
.home-hero__typed {
  grid-area: 1 / 1;
}

.home-hero__ghost {
  visibility: hidden;
}

.home-hero__caret {
  display: inline-block;
  width: 3px;
  height: 0.8em;
  margin-left: 6px;
  vertical-align: -0.05em;
  background: var(--ffb-green);
  animation: home-caret 1s step-end infinite;
}

@keyframes home-caret {
  50% {
    opacity: 0;
  }
}

.home-hero__sub {
  margin-top: 14px;
  max-width: 560px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ffb-on-dark-lead);
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.home-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: var(--ffb-r-pill);
  background: var(--ffb-green);
  font-family: var(--ffb-poppins);
  font-weight: 600;
  font-size: 16px;
  color: var(--ffb-green-ink);
  transition: background var(--ffb-t-ui) ease;
}

.home-hero__cta:hover {
  background: var(--ffb-green-hover);
  color: var(--ffb-green-ink);
}

.home-hero__cta svg {
  width: 18px;
  height: 18px;
}

/* ------------------------------------------------------------- Sign in --- */

.home-signin {
  --ffb-focus: var(--ffb-focus-on-dark);
  grid-area: signin;
  position: relative;
  z-index: 5;
  container-type: inline-size;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  padding: 26px;
  border-radius: var(--ffb-r-bento);
  background: var(--ffb-signin-tile);
  color: #ffffff;
  transition: transform var(--ffb-t-ui) ease;
}

.home-signin:hover {
  background: var(--ffb-signin-tile-hover);
  color: #ffffff;
  transform: translateY(-3px);
}

.home-signin__pattern {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.ffb-pattern--signin {
  --pat-line: #ffffff;
  --pat-line-a: 0.16;
  right: 0;
  bottom: 0;
  width: 62%;
  height: 62%;
  opacity: 0.5;
}

.home-signin__chip {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--ffb-r-pill);
  background: var(--ffb-on-dark-chip);
  font-weight: 500;
  font-size: var(--ffb-eyebrow);
  letter-spacing: var(--ffb-track-label);
  text-transform: uppercase;
}

.home-signin__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ffb-green);
}

/* 28px rather than the design's 44px: this tile sets the hero row's height
   on desktop (Keith, 2026-11-02 — a shorter row). */
.home-signin__title {
  margin-top: 28px;
  font-size: clamp(30px, 2.6vw, 40px);
  line-height: 1.2;
  color: #ffffff;
}

.home-signin__btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 14px;
  margin: 0 0 8px; /* design: 16px above (Keith, 2026-11-02) */
  padding: 14px 26px;
  border-radius: var(--ffb-r-pill);
  background: #ffffff;
  font-family: var(--ffb-jakarta);
  font-weight: 700;
  font-size: 17px;
  color: var(--ffb-navy-brand);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.home-signin:hover .home-signin__btn,
.home-signin:focus-visible .home-signin__btn {
  background: var(--ffb-green-hover);
  box-shadow: var(--ffb-glow-signin);
}

.home-signin__nudge {
  display: inline-flex;
  color: var(--ffb-blue);
  animation: home-nudge 4.5s ease-in-out infinite;
}

.home-signin__nudge svg {
  width: 22px;
  height: 22px;
}

@keyframes home-nudge {
  0%,
  76%,
  100% {
    transform: translateX(0);
  }
  82% {
    transform: translateX(7px);
  }
  87% {
    transform: translateX(0);
  }
  92% {
    transform: translateX(5px);
  }
  96% {
    transform: translateX(0);
  }
}

/* The tablet: My Learning on a navy bezel, turned in perspective (Keith,
   2026-11-02, over the design's placement). Desktop: centred, overhanging
   the tile's bottom edge. Tablet widths (the
   tile spans the row): as tall as the tile less its padding, centred
   vertically on the right. Phone: as the design, bleeding off the corner. */
.home-signin__stage {
  flex: 1 0 auto;
}

.home-signin__tablet {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 5cqw;
  /* The tile's height less its padding, but never wider than half the tile
     (31.25cqw tall = 50cqw wide at 16:10). Capped on the height, so the
     width always follows from the ratio. */
  height: min(calc(100% - 52px), 31.25cqw);
  aspect-ratio: 16 / 10;
  translate: 0 -50%;
  padding: 9px;
  border-radius: 20px;
  background: var(--ffb-navy-brand);
  box-shadow: var(--ffb-shadow-tablet-sm);
  transform: perspective(1800px) rotateY(22deg) rotateX(6deg) rotateZ(-4deg);
  transform-origin: center bottom;
  backface-visibility: hidden;
  pointer-events: none;
}

.home-signin__tablet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  filter: contrast(1.12) saturate(1.12) brightness(1.03);
}

@media (max-width: 699px) {
  .home-signin {
    overflow-y: clip;
  }

  .home-signin__stage {
    min-height: 54cqw;
  }

  .home-signin__tablet {
    top: auto;
    right: auto;
    left: 8cqw;
    bottom: -16cqw;
    width: 108cqw;
    height: auto;
    translate: none;
  }
}

@media (min-width: 1100px) {
  .home-signin {
    container-type: normal;
  }

  /* 165px (design: 190px): a shorter row with the tablet still clear of the
     button. */
  .home-signin__stage {
    position: relative;
    min-height: 165px;
    container-type: inline-size;
  }

  /* Overhangs the tile's bottom edge as in the design, by an amount tied to
     its own width (cqw of the stage), and anchored to that edge rather than
     to the button, so it holds its place as the window narrows. -20px is
     Keith's (2026-11-02), 6px inside the tile's 26px bottom padding. */
  .home-signin__tablet {
    top: auto;
    right: auto;
    bottom: calc(-20px - 3cqw);
    /* The perspective turn pulls the drawn tablet left of its box; +5cqw
       puts what you see back on the tile's centre line. */
    left: calc(50% + 5cqw);
    height: auto;
    translate: -50% 0;
    /* Drawn at twice its size and halved in the transform, as the design
       does: the browser renders a 3D-turned layer at its own unscaled size,
       so a box drawn at the final ~300px smears the screenshot's text, while
       a double-size box is rendered sharp and then shrunk. Bezel, radii and
       shadow are doubled to match. Scaled about the bottom centre, so the
       anchoring above is unchanged. */
    width: min(225cqw, 900px); /* the design's: ~112% of the stage once halved */
    padding: 18px;
    border-radius: 40px;
    box-shadow: var(--ffb-shadow-tablet);
    transform: perspective(1800px) rotateY(22deg) rotateX(6deg) rotateZ(-4deg) scale(0.5);
  }

  .home-signin__tablet img {
    border-radius: 24px;
  }
}
