/* ---------------------------------------------------------------
   Adeia — masthead, hero, and the two structural patterns lifted from
   the reference: the sticky rail and the bento grid.
   --------------------------------------------------------------- */

/* ---------- masthead ---------- */

.mast {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem var(--gutter);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--black) 55%, transparent);
  border-bottom: 1px solid transparent;
  transition:
    border-color var(--mid-dur) var(--ease),
    background var(--mid-dur) var(--ease);
}

.mast.is-stuck {
  border-bottom-color: var(--hair);
  background: color-mix(in srgb, var(--black) 90%, transparent);
}

/* The wordmark. Two lines, tight, with the gradient on the second —
   the reference's logo does the same thing with its own mark. */
.mast__mark {
  display: flex;
  flex-direction: column;
  line-height: 0.95;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.mast__mark span:last-child {
  background-image: var(--sweep);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mast__nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-inline: auto;
}

.mast__nav a {
  font-size: var(--t-small);
  color: var(--muted);
  text-decoration: none;
  transition: color var(--quick) var(--ease-cursor);
}

.mast__nav a:hover {
  color: var(--paper);
}

.mast__end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mast .btn {
  padding: 0.625rem 1.25rem;
}

@media (max-width: 60rem) {
  .mast__nav {
    display: none;
  }
  .mast__end {
    margin-inline-start: auto;
  }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 9rem var(--gutter) 0;
  overflow: hidden;
  isolation: isolate;
}

/* The orb. A wide gradient disc rising from below the fold, exactly as
   the reference does it — the page's light source sits off-screen. */
.hero__orb {
  position: absolute;
  left: 50%;
  bottom: -26vh;
  width: min(88vw, 46rem);
  aspect-ratio: 1;
  translate: -50% 0;
  z-index: -2;
  border-radius: 50%;
  /* Sits low and stays small. It is a light source below the fold, not
     a wash over the page — a big one drowns the headline it is meant to
     sit behind, which is exactly what the first attempt did. */
  background: radial-gradient(
    circle at 50% 45%,
    var(--warm) 0%,
    var(--mid) 38%,
    color-mix(in srgb, var(--cool) 45%, transparent) 62%,
    transparent 74%
  );
  filter: blur(56px);
  opacity: 0.5;
  /* Breathes. Slow enough to notice only if you look. */
  animation: orb-breathe 13s ease-in-out infinite;
}

@keyframes orb-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.055);
    opacity: 0.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__orb {
    animation: none;
  }
}

/* Grain, so the gradient does not band on an 8-bit panel. */
.hero__grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- floating outlined frames ----------
   The reference scatters glowing rounded rectangles behind the
   headline. They drift on the pointer at different depths, which is
   what turns a flat backdrop into a space. --px/--py are written by
   cursor.js in the range -1..1. */

.frame {
  position: absolute;
  z-index: -1;
  border-radius: 20px;
  border: 1px solid;
  pointer-events: none;
  translate: calc(var(--px, 0) * var(--depth, 10px))
    calc(var(--py, 0) * var(--depth, 10px));
  transition: translate var(--mid-dur) var(--ease-cursor);
}

.frame--a {
  top: 14%;
  left: -8%;
  width: 26rem;
  height: 14rem;
  border-color: color-mix(in srgb, var(--cold) 40%, transparent);
  box-shadow: 0 0 60px -20px var(--cold);
  --depth: 26px;
}

.frame--b {
  top: 10%;
  right: -6%;
  width: 22rem;
  height: 16rem;
  border-color: color-mix(in srgb, var(--hot) 42%, transparent);
  box-shadow: 0 0 60px -20px var(--hot);
  --depth: 18px;
}

.frame--c {
  top: 26%;
  right: -14%;
  width: 24rem;
  height: 18rem;
  border-color: color-mix(in srgb, var(--cool) 34%, transparent);
  box-shadow: 0 0 70px -24px var(--cool);
  --depth: 34px;
}

@media (max-width: 60rem) {
  .frame {
    display: none;
  }
}

.hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  max-width: 56rem;
}

.hero__title {
  line-height: 0.98;
}

.hero__sub {
  color: var(--muted);
  font-size: clamp(1rem, 0.95rem + 0.45vw, 1.1875rem);
  max-width: 36rem;
  line-height: 1.6;
}

.hero__cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}

/* ---------- the product shot ----------
   The reference puts its app on the orb straight after the hero. Ours
   is the real dashboard, in a browser chrome that is drawn rather than
   screenshotted so it stays sharp at any width. */

.shot {
  position: relative;
  /* The hero centres its text; a table of records must not inherit that. */
  text-align: left;
  margin-top: clamp(3rem, 9vh, 7rem);
  width: 100%;
  max-width: 66rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: var(--near);
  overflow: hidden;
  box-shadow: 0 40px 120px -40px color-mix(in srgb, var(--mid) 60%, transparent);
}

.shot__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--hair);
  background: var(--raised);
}

.shot__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hair-lit);
}

.shot__url {
  margin-inline-start: 0.75rem;
  font-family: var(--mono);
  font-size: var(--t-micro);
  color: var(--faint);
}

.shot__body {
  padding: 1.5rem;
}

/* ---------- sticky rail ----------
   Left column names the layers and stays put; the right column holds
   the panel. Straight from the reference, and it suits a system whose
   whole argument is that the layers run in order. */

.rail {
  display: grid;
  /* minmax(0, …) rather than 1fr. A grid item's automatic minimum size is
     its content, so the code pane inside a panel widened the whole
     column past the viewport instead of scrolling inside itself. */
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  margin-top: clamp(2.5rem, 6vh, 4.5rem);
  align-items: start;
}

.rail__nav {
  min-width: 0;
  position: sticky;
  top: 8rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-left: 1px solid var(--hair);
}

.rail__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0 0.625rem 1.25rem;
  font-size: var(--t-small);
  color: var(--faint);
  background: none;
  border: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: color var(--quick) var(--ease-cursor);
}

.rail__item::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 50%;
  translate: 0 -50%;
  width: 2px;
  height: 0;
  background: var(--warm);
  transition: height var(--mid-dur) var(--ease);
}

.rail__item[aria-selected="true"] {
  color: var(--paper);
}

.rail__item[aria-selected="true"]::before {
  height: 1.5rem;
}

.rail__panel {
  min-width: 0;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: var(--near);
  padding: clamp(1.75rem, 4vw, 2.75rem);
}

.rail__panel[hidden] {
  display: none;
}

@media (max-width: 60rem) {
  .rail {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail__nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    border-left: 0;
    border-bottom: 1px solid var(--hair);
  }
  .rail__item {
    padding: 0.75rem 1rem;
    white-space: nowrap;
  }
  .rail__item::before {
    left: 0;
    top: auto;
    bottom: -1px;
    translate: 0;
    width: 0;
    height: 2px;
    transition: width var(--mid-dur) var(--ease);
  }
  .rail__item[aria-selected="true"]::before {
    width: 100%;
    height: 2px;
  }
}

/* ---------- bento ----------
   Uneven grid with hairline seams and deliberate empty cells, as the
   reference uses. The gaps are the composition, not an oversight. */

.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: clamp(2.5rem, 6vh, 4.5rem);
}

.bento__cell {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  min-height: 15rem;
  border-right: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bento__cell:nth-child(3n) {
  border-right: 0;
}

.bento__cell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    18rem circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--warm) 9%, transparent),
    transparent 60%
  );
  opacity: 0;
  transition: opacity var(--mid-dur) var(--ease-cursor);
  pointer-events: none;
}

.bento__cell:hover::before {
  opacity: 1;
}

.bento__cell--wide {
  grid-column: span 2;
}

.bento__cell--lead .h2 {
  max-width: 14ch;
}

.bento__cell--empty {
  min-height: 15rem;
}

.bento__icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--lifted);
  color: var(--warm);
  margin-bottom: 1.25rem;
}

.bento__cell--machine .bento__icon {
  color: var(--cold);
}

.bento__title {
  margin-bottom: 0.75rem;
}

.bento__body {
  color: var(--muted);
  font-size: var(--t-small);
  line-height: 1.65;
  margin-top: auto;
}

@media (max-width: 60rem) {
  .bento {
    grid-template-columns: 1fr;
  }
  .bento__cell {
    border-right: 0;
  }
  .bento__cell--wide {
    grid-column: auto;
  }
  .bento__cell--empty {
    display: none;
  }
}
