/* Home page redesign. Builds on lab.css (tokens, pins, reveals) and adds the home's own pieces. */

.btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 8px 0 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: #0a0a0b;
  background: #fff;
}
.btn i {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  transition: background 0.3s var(--ease);
}
.btn:hover i { background: var(--blue); color: #fff; }
.btn.ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding-right: 24px;
}

/* 01 Hero */
.hh-art {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 2880px;
  transform: translateX(-50%);
  pointer-events: none;
}
.hh-zoom { position: relative; transform-origin: 50.61% 41.3%; will-change: transform, opacity; }
.hh-hand { display: block; width: 100%; height: auto; }
.hh-hand.robot { position: absolute; inset: 0; clip-path: inset(0 0 0 50.61%); }
.hh-hand.human { clip-path: inset(0 49.39% 0 0); }
.hh-hand { animation: hand-in 2.2s var(--ease) both; }
.hh-hand.human { --from: -5%; }
.hh-hand.robot { --from: 5%; }
@keyframes hand-in {
  from { transform: translateX(var(--from)); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.spark {
  position: absolute;
  left: 50.61%;
  top: 41.3%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.spark.dot {
  width: 0.5%;
  min-width: 4px;
  background: radial-gradient(circle, #fff 0 28%, rgba(196, 214, 255, 0.9) 42%, rgba(120, 140, 255, 0) 70%);
  animation: spark-in 1s 1.6s both, breathe 5s 2.6s ease-in-out infinite;
}
.spark.halo {
  width: 5%;
  background: radial-gradient(circle, rgba(150, 180, 255, 0.45), rgba(68, 78, 254, 0.16) 42%, rgba(68, 78, 254, 0) 70%);
  mix-blend-mode: screen;
  animation: spark-in 1.4s 1.6s both, breathe 5s 2.6s ease-in-out infinite;
}
@keyframes spark-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes breathe {
  0%, 100% { scale: 0.85; }
  50% { scale: 1.12; }
}

.hh-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: min(22.2vw, 640px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 90px 24px 0;
  text-align: center;
}
.hh-h1 {
  font-size: clamp(64px, 10.5vw, 168px);
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  color: #fff;
}
/* On phones "Science Fiction" (about 5.6em wide) has to fit inside the screen */
@media (max-width: 600px) {
  .hh-h1 { font-size: min(64px, 16.5vw); }
}
.hh-h1 .sci, .hh-h1 .fic, .hh-h1 .dot { display: inline-block; will-change: transform, opacity, filter; }
.hh-h1 .sci, .hh-h1 .fic { animation: focus-in 1.6s var(--ease) both; }
.hh-h1 .fic { animation-delay: 0.18s; position: relative; margin-left: 0.24em; }
.hh-h1 .fic span { display: inline-block; will-change: transform, opacity, filter; }
.hh-h1 .fic > span:not(.strike):not(.strike-ghost) { opacity: 0.62; }
.hh-h1 .sci { position: relative; }
.hh-h1 .dot { position: absolute; left: 100%; bottom: 0; opacity: 0; }
.strike-ghost {
  position: absolute;
  left: -3%;
  right: -3%;
  top: 50%;
  height: 0.085em;
  border-radius: 0.05em;
  background: linear-gradient(90deg, rgba(31, 40, 184, 0.45), rgba(91, 99, 255, 0.5) 30%, rgba(143, 149, 255, 0.55) 50%, rgba(91, 99, 255, 0.5) 70%, rgba(31, 40, 184, 0.45));
}
.strike {
  position: absolute;
  left: -3%;
  right: -3%;
  top: 50%;
  height: 0.085em;
  border-radius: 0.05em;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #1f28b8, #5b63ff 30%, #8f95ff 50%, #5b63ff 70%, #1f28b8);
  box-shadow: 0 0 18px rgba(68, 78, 254, 0.9), 0 0 60px rgba(68, 78, 254, 0.5);
}
.strike b {
  position: absolute;
  right: -0.08em;
  top: 50%;
  width: 0.36em;
  height: 0.36em;
  border-radius: 50%;
  transform: translate(50%, -50%);
  background: radial-gradient(circle, #fff 0 18%, rgba(160, 170, 255, 0.7) 40%, transparent 70%);
}
.hh-lede { font-size: clamp(19px, 1.7vw, 24px); font-weight: 500; color: rgba(255, 255, 255, 0.9); max-width: 760px; margin: 0; }
.hh-intro { animation: fade-up 1.2s 0.5s var(--ease) both; }
.hh-intro.b { animation-delay: 0.7s; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
/* The landing heading, then the four platforms under it (the site's bento) */
.hh-head {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 0;
  width: min(880px, calc(100% - 48px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  pointer-events: none;
  will-change: transform;
}
.hh-head [data-line] { opacity: 0; }
.hh-head .h-display { font-size: 84px; }
.hh-head .lede { margin: 4px 0 0; max-width: 780px; color: rgba(255, 255, 255, 0.78); }
.bento {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 28px;
  width: min(1180px, calc(100% - 12vw));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 20px;
  pointer-events: none;
  /* Hidden until its cards start to open (home.js), so placing it under the heading at load isn't counted by
     the browser as a layout shift */
  visibility: hidden;
}
.bento-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 24px;
  color: inherit;
  text-decoration: none;
  background: #0d0d12;
  clip-path: inset(100% 0 0 0 round 24px);
  will-change: clip-path, transform;
}
.bento-card.diag { grid-column: 1; grid-row: 1; }
.bento-card.nano { grid-column: 2; grid-row: 1; }
.bento-card.manu { grid-column: 1 / span 2; grid-row: 2; }
.bento-card.vis { grid-column: 3; grid-row: 1 / span 2; }
.bento-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform; transition: scale 1.2s var(--ease); }
.bento-card:hover img { scale: 1.04; }
.bento-card::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(0deg, rgba(0, 0, 0, 0.45), transparent); pointer-events: none; }
.bento-card .cap {
  position: relative;
  z-index: 1;
  margin: 12px;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px) saturate(1.5);
  -webkit-backdrop-filter: blur(12px) saturate(1.5);
  opacity: 0;
}
.bento-card h3 { margin: 0; font-family: var(--head); font-style: italic; font-weight: 500; font-size: 19px; line-height: 1.15; }
.bento-card p { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: rgba(255, 255, 255, 0.85); }

/* Platform scenes: copy on the left, the drawing fills the stage */
.plat-copy {
  position: absolute;
  z-index: 20;
  left: max(56px, calc((100vw - 1240px) / 2));
  /* Centred in the space under the menu bar, which takes the top 94px */
  top: calc(50% + 47px);
  transform: translateY(-50%);
  width: min(420px, 36vw);
}
.plat-copy.hi { top: 40%; }
.plat-copy .h-display { font-size: clamp(36px, 3.8vw, 58px); margin-top: 8px; }
.plat-copy p { margin: 16px 0 0; color: var(--muted); font-size: 17px; line-height: 1.5; }
.plat-copy .facts { margin-top: 26px; display: grid; gap: 14px; }
.plat-copy .facts div { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: baseline; border-top: 1px solid var(--line); padding-top: 12px; }
.plat-copy .facts b { font-family: var(--head); font-style: italic; font-weight: 500; font-size: 26px; color: #fff; white-space: nowrap; }
.plat-copy .facts span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.plat-copy a.more { display: inline-block; margin-top: 22px; color: #fff; font-size: 15px; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.35); padding-bottom: 3px; }
.stage-step {
  position: absolute;
  z-index: 20;
  right: 36px;
  top: 112px;
  font: 12px var(--mono);
  color: rgba(255, 255, 255, 0.5);
  text-align: right;
  display: grid;
  gap: 6px;
}
.stage-step b { color: #fff; font-weight: 500; }
.rec-bg { position: absolute; top: 0; right: 0; width: 56%; height: 100%; object-fit: cover; object-position: 60% 40%; opacity: 0; filter: saturate(0.85) brightness(0.6); will-change: opacity; }
.rec-note {
  position: absolute;
  z-index: 20;
  left: 46%;
  right: max(36px, calc((100vw - 1240px) / 2));
  bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
}
.rec-note h3 { margin: 0; font-family: var(--head); font-style: italic; font-weight: 500; font-size: clamp(22px, 2vw, 32px); line-height: 1.15; }
.rec-note p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.rec-note a.more { align-self: flex-start; margin-top: 6px; color: #fff; font-size: 15px; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.35); padding-bottom: 3px; }
#more .track { top: calc(50% + 70px); }
#more .card { height: min(480px, 58vh); }
.product {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  will-change: transform, opacity, filter;
}

/* The statement stays a read-along, just smaller, so the domain cards can share the section */
#what .read { max-width: 760px; margin: 28px auto 0; font-size: clamp(20px, 2.1vw, 30px); line-height: 1.35; text-align: center; }
.domains { max-width: 1180px; width: 100%; margin: 88px auto 0; }
.domains > .h-display { font-size: clamp(32px, 3.6vw, 52px); text-align: center; margin: 0 0 48px; text-transform: capitalize; }
.domain-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.domain {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 280px;
  padding: 32px 28px 36px;
  text-align: left;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0a0a0d;
  transition: border-color 0.4s;
}
.domain::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 70% at 50% 0%, rgba(68, 78, 254, 0.32), rgba(68, 78, 254, 0) 70%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.domain:hover { border-color: rgba(68, 78, 254, 0.7); }
.domain:hover::before { opacity: 1; }
.domain-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  transition: background 0.4s, border-color 0.4s;
}
.domain-icon svg { width: 26px; height: 26px; }
.domain:hover .domain-icon { background: #444efe; border-color: #444efe; }
.domain h3 { position: relative; margin: 0; font-family: var(--head); font-style: italic; font-weight: 500; font-size: 26px; line-height: 1.1; }
.domain p { position: relative; margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.55; }

/* Full stack line */
.proof-stage { display: flex; flex-direction: column; justify-content: center; padding: 80px 24px 0; }
.proof-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 18px; margin-bottom: 36px; }
.proof-head .h-display { font-size: clamp(40px, 5vw, 76px); }
.stack-line { position: relative; max-width: 1100px; width: 100%; margin: 0 auto; }
.stack-line svg { width: 100%; height: 120px; overflow: visible; display: block; }
.stack-steps { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: -8px; }
.stack-steps div { text-align: center; opacity: 0.25; transition: opacity 0.4s; }
.stack-steps div.on { opacity: 1; }
.stack-steps b { display: block; font-family: var(--head); font-style: italic; font-weight: 500; font-size: 24px; }
.stack-steps span { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }
.sites { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 1100px; width: 100%; margin: 64px auto 0; text-align: left; }
.sites > div { border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px; background: rgba(255, 255, 255, 0.02); }
.sites b { display: block; font-family: var(--head); font-style: italic; font-weight: 500; font-size: 24px; }
.sites span { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* Careers: a photo that grows from a card to the full screen */
.grow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100vw;
  height: 100vh;
  transform: translate(-50%, -50%);
  overflow: hidden;
  will-change: clip-path;
}
.grow img { width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: 50% 50%; }
.grow::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.4) 35%, rgba(0, 0, 0, 0.9) 100%); }
.careers-copy { position: absolute; inset: auto 0 12vh; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; padding: 0 24px; }
.careers-copy .h-display { font-size: clamp(44px, 6vw, 96px); }

/* News */
.news { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 1180px; width: 100%; margin: 48px auto 0; text-align: left; }
.news a { color: inherit; text-decoration: none; display: block; }
.news .pic { aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden; background: #111; }
.news img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s var(--ease); }
.news a:hover img { transform: scale(1.04); }
.news .mono { display: block; margin-top: 16px; }
.news b { display: block; margin-top: 8px; font-size: 19px; font-weight: 600; line-height: 1.35; }

.foot { position: relative; color: var(--fg); }
.foot-glow { position: absolute; inset: 0; z-index: 0; overflow: hidden; opacity: 0.3; pointer-events: none; }
.foot-glow img { position: absolute; top: -300px; left: 50%; width: 100%; height: auto; transform: translateX(-50%) scale(1.5); }
.foot-glass {
  position: relative;
  z-index: 1;
  padding: 64px 32px;
  background: linear-gradient(55deg, rgba(31, 31, 31, 0.75), rgba(87, 87, 87, 0.2));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.foot-glass::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 33%;
  height: 1px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  filter: blur(1px);
}
.foot-grid { max-width: 1152px; margin: 0 auto; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 48px; }
.foot-brand img { height: 30px; width: auto; display: block; }
.foot-brand p { margin: 24px 0 0; max-width: 220px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.foot-grid h4 { margin: 0 0 16px; font-family: var(--body); font-size: 12px; font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); }
.foot-grid a { display: block; margin-top: 12px; color: var(--fg); font-size: 16px; text-decoration: none; }
.foot-grid a:hover { color: #444efe; }
.foot-copy { max-width: 1152px; margin: 64px auto 0; padding-top: 32px; border-top: 1px solid rgba(255, 255, 255, 0.1); text-align: center; color: var(--muted); font-size: 14px; }

@media (max-width: 860px) {
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .foot-brand { grid-column: 1 / -1; }
  .plat-copy { left: 24px; right: 24px; width: auto; top: 84px; transform: none; }
  .plat-copy p, .plat-copy .facts { display: none; }
  .sites, .news { grid-template-columns: 1fr; }
  .domain-grid { grid-template-columns: 1fr 1fr; }
  .domain p { font-size: 15px; }
  .domain { min-height: 0; padding: 24px 20px 28px; }
  .domain h3 { font-size: 22px; }
  .domains { margin-top: 64px; }
  .domains > .h-display { margin-bottom: 28px; }
  .stage-step { display: none; }
  .rec-bg { display: none; }
  .rec-note { left: 24px; right: 24px; bottom: 16px; }
  .rec-note h3 { font-size: 20px; }
  .rec-note p { font-size: 13px; line-height: 1.4; }
  .hh-head .lede { font-size: 16px; }
  .bento { width: calc(100% - 32px); bottom: 20px; gap: 10px; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .bento-card.diag { grid-column: 1; grid-row: 1; }
  .bento-card.nano { grid-column: 2; grid-row: 1; }
  .bento-card.vis { grid-column: 1 / span 2; grid-row: 2; }
  .bento-card.manu { grid-column: 1 / span 2; grid-row: 3; }
  .bento-card .cap { margin: 8px; padding: 8px 10px; border-radius: 12px; }
  .bento-card h3 { font-size: 15px; }
  .bento-card p { display: none; }
}
@media (max-width: 560px) {
  .domain-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .hh-hand, .spark, .hh-intro, .hh-h1 .sci, .hh-h1 .fic { animation: none; }
}

/* Fit: keep every scene's words clear of the menu bar and of each other, on short laptops and on phones */
@media (min-width: 861px) and (max-height: 780px) {
  .plat-copy .h-display { font-size: clamp(32px, 3.2vw, 46px); }
  .plat-copy p { margin-top: 12px; font-size: 15px; }
  .plat-copy .facts { margin-top: 16px; gap: 10px; }
  .plat-copy .facts b { font-size: 22px; }
  .plat-copy a.more { margin-top: 14px; }
}
@media (max-width: 860px) {
  .plat-copy, .plat-copy.hi { top: 100px; }
  .proof-stage { justify-content: flex-start; padding: 104px 16px 0; }
  /* Centred when there is room, pinned under the menu bar when there is not */
  .proof-stage > :first-child { margin-top: auto; }
  .proof-stage > :last-child { margin-bottom: auto; }
  .proof-head { gap: 10px; margin-bottom: 18px; }
  .proof-head .h-display { font-size: clamp(30px, 8vw, 40px); }
  .proof-head .lede { font-size: 15px; }
  .stack-line svg { height: 56px; }
  .stack-steps b { font-size: 13px; }
  .stack-steps span { font-size: 10.5px; line-height: 1.3; padding: 0 3px; }
  .sites { margin-top: 22px; gap: 8px; }
  .sites > div { padding: 12px 16px; border-radius: 14px; }
  .sites b { font-size: 18px; }
  .sites span { margin-top: 2px; font-size: 12px; }
}
a.domain, a.card { color: inherit; text-decoration: none; }
