/* ═══ BENTO GRID — Linear/Vercel architecture ═══ */
.bento {
  display: grid;
  gap: var(--bento-gap);
  background: var(--line);
  border: var(--border);
  position: relative;
}

.bento--services {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
}

.bento--about {
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: auto auto auto;
}

.bento--about .bento__cell--profile {
  grid-column: span 2;
  grid-row: span 2;
}

.bento--about .bento__cell--lead {
  grid-column: span 4;
}

.bento--about .bento__cell--copy-a,
.bento--about .bento__cell--copy-b {
  grid-column: span 2;
}

.bento--about .bento__cell--tags-row {
  grid-column: 1 / -1;
}

.bento--vault {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto auto;
}

.bento--vault .bento__cell--vault-primary {
  grid-column: span 2;
  grid-row: span 2;
}

.bento--vault .bento__cell--vault-console {
  grid-column: span 2;
}

.bento--vault .bento__cell--vault-score {
  grid-column: 1 / -1;
}

.vault__layer {
  position: relative;
}

.bento__cell {
  position: relative;
  background: var(--bg-card);
  padding: var(--cell-pad);
  overflow: hidden;
  isolation: isolate;
  --mouse-x: 50%;
  --mouse-y: 50%;
  --mouse-opacity: 0;
  --spot-x: var(--mouse-x);
  --spot-y: var(--mouse-y);
  --spot-opacity: var(--mouse-opacity);
}

.bento__cell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x) var(--mouse-y),
    color-mix(in srgb, var(--signal) calc(var(--mouse-opacity) * 12%), transparent),
    transparent 40%
  );
  opacity: 1;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 0;
}

.bento__cell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  /* Isolate the glow to a 1px border ring via mask-composite: exclude (same
     technique as .spotlight::after), instead of the previous padding-box
     "solid cover" trick. That older trick faded the whole element's opacity
     on hover, which also faded its supposedly-opaque cover layer, letting it
     wash out the card content (z-index 1) underneath. Masking the ring means
     the animated opacity below can never bleed over the text. */
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(
    400px circle at var(--mouse-x) var(--mouse-y),
    color-mix(in srgb, var(--signal) 50%, transparent),
    transparent 40%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: calc(var(--mouse-opacity) * 0.8 + 0.05);
  transition: opacity 0.35s;
}

.bento__cell-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.bento__cell--span-3 {
  grid-column: span 3;
}

.bento__cell--span-4 {
  grid-column: span 4;
}

.bento__cell--tall {
  grid-row: span 2;
}

.bento__cell--featured {
  background: var(--bg-elevated);
}

.bento__cell--featured::before {
  background: radial-gradient(
    800px circle at var(--mouse-x) var(--mouse-y),
    color-mix(in srgb, var(--signal) calc(var(--mouse-opacity) * 18%), transparent),
    color-mix(in srgb, var(--accent-cyan) calc(var(--mouse-opacity) * 4%), transparent) 30%,
    transparent 55%
  );
}

.bento__num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  color: var(--signal);
  margin-bottom: 1.25rem;
}

.bento__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: var(--tracking-snug);
  line-height: var(--leading-snug);
  margin-bottom: 0.75rem;
  overflow-wrap: break-word;
  hyphens: auto;
}

.bento__cell--featured .bento__title {
  font-size: var(--text-3xl);
}

.bento__desc {
  font-size: var(--text-base);
  color: var(--muted);
  line-height: 1.65;
  max-width: 36ch;
  flex: 1;
}

.bento__tags {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.bento__tags li {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  color: var(--fg-dim);
}

.bento__metric {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.bento__metric-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 500;
  letter-spacing: var(--tracking-tight);
  line-height: 1;
  color: var(--signal);
}

.bento__metric-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.bento__icon {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 32px;
  height: 32px;
  opacity: 0.55;
  color: var(--signal);
}

.bento__hw {
  margin-top: auto;
  padding-top: 1.25rem;
  color: var(--signal);
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--signal) 22%, transparent));
}

.bento__hw--inline {
  margin-top: 1rem;
  padding-top: 0;
}

.bento__hw--terminal {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 120px;
}

.bento__hw--gauge {
  flex-shrink: 0;
}

.bento__hw-svg {
  width: min(100%, 200px);
  height: auto;
  opacity: 1;
}

/* Decorative hardware icons (lock, gauge, terminal, etc.) were drawn with
   hairline strokes and low per-shape opacity — fine on a Figma artboard, but
   they disappear on real screens especially in light mode. */
.bento__hw-svg :is(path, rect, circle, line, polyline)[stroke] {
  stroke-width: 1.45 !important;
  vector-effect: non-scaling-stroke;
}

.bento__hw-svg--sm {
  width: min(100%, 120px);
}

.bento__hw-svg--gauge {
  width: min(100%, 160px);
}

.bento__desc--lead {
  max-width: none;
  font-size: var(--text-xl);
  line-height: 1.55;
  color: var(--fg);
}

.bento__desc--score {
  max-width: 48ch;
  margin: 0;
}

.bento__cell-inner--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.bento__cell-inner--score {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.bento__score-block {
  min-width: 12rem;
}

.bento__metric--inline {
  margin-top: 0.5rem;
  padding-top: 0;
  border-top: none;
}

.bento__tags--stack {
  margin-top: 1rem;
}

.bento__tags--wide {
  margin-top: 0;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .bento--services,
  .bento--vault,
  .bento--about {
    grid-template-columns: 1fr;
  }

  .bento__cell--span-2,
  .bento__cell--span-3,
  .bento__cell--span-4,
  .bento__cell--tall,
  .bento--about .bento__cell--profile,
  .bento--about .bento__cell--lead,
  .bento--about .bento__cell--copy-a,
  .bento--about .bento__cell--copy-b,
  .bento--about .bento__cell--tags-row,
  .bento--vault .bento__cell--vault-primary,
  .bento--vault .bento__cell--vault-console,
  .bento--vault .bento__cell--vault-score {
    grid-column: span 1;
    grid-row: span 1;
  }

  .bento__cell-inner--row,
  .bento__cell-inner--score {
    flex-direction: column;
    align-items: flex-start;
  }

  .bento__tags--wide {
    justify-content: flex-start;
  }
}
