html,
body {
  background: #d5d7da;
}

.tools-shell {
  display: block;
  width: min(calc(100% - 2rem), 78rem);
}

.tools-shell > .site-header,
.tools-shell > .site-footer {
  width: 100%;
}

.tools-shell > .site-header {
  background: #08090a;
}

.tools-shell > .site-footer {
  padding-right: 0;
  padding-left: 0;
}

.tools-hero {
  display: grid;
  min-height: 42rem;
  padding: clamp(4.5rem, 10vw, 8.5rem) clamp(1.25rem, 4vw, 3rem);
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 23rem);
  align-items: center;
  gap: clamp(3rem, 8vw, 8rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background:
    radial-gradient(circle at 82% 18%, rgba(122, 18, 18, 0.18), transparent 24rem),
    #08090a;
}

.tools-hero h1 {
  margin: 0;
  font-size: clamp(4.1rem, 9vw, 8.5rem);
  font-weight: 680;
  letter-spacing: -0.085em;
  line-height: 0.82;
  color: #f4f4f5;
}

.tools-hero h1 span {
  color: var(--red);
  text-shadow: 0 0 2.8rem rgba(255, 32, 32, 0.22);
}

.tools-hero > div:first-child > p:last-child {
  max-width: 44rem;
  margin: 2rem 0 0;
  color: #a9abb0;
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.75;
}

.hero-command {
  display: grid;
  min-height: 13rem;
  padding: 1.4rem;
  align-content: end;
  gap: 0.7rem;
  border: 1px solid var(--line);
  background: #08090a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.65rem;
}

.hero-command span {
  color: var(--red-bright);
}

.hero-command strong {
  color: #777a7f;
  font-weight: 500;
}

.hero-command i {
  width: 0.45rem;
  height: 0.45rem;
  margin-top: 1.2rem;
  border-radius: 50%;
  background: #53d68a;
  box-shadow: 0 0 0.7rem rgba(83, 214, 138, 0.65);
}

.active-apps,
.lab-section {
  padding: clamp(4rem, 9vw, 7rem) 0;
  border-top: 1px solid rgba(8, 9, 10, 0.18);
}

.section-heading-row {
  display: flex;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.section-heading-row h2 {
  margin: 0;
  font-size: clamp(2.7rem, 6vw, 5.2rem);
  letter-spacing: -0.07em;
  line-height: 0.95;
  color: #08090a;
}

.section-heading-row > span {
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(8, 9, 10, 0.2);
  border-radius: 999px;
  color: #3f4247;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.active-app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.active-app-card {
  display: flex;
  min-height: 25rem;
  padding: clamp(1.5rem, 4vw, 2.2rem);
  flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #08090a;
}

.active-app-top {
  display: flex;
  margin-bottom: auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.app-initials {
  display: inline-flex;
  width: 3.5rem;
  height: 3.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 32, 32, 0.28);
  border-radius: 0.5rem;
  background: rgba(255, 32, 32, 0.08);
  color: var(--red);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
  text-shadow: 0 0 1rem rgba(255, 32, 32, 0.6);
}

.app-platform,
.experience-type {
  margin: 2.5rem 0 0.7rem;
  color: var(--red-bright);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.active-app-card h3,
.experience-header h3,
.utility-heading h3 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  letter-spacing: -0.055em;
}

.active-app-card > p:not(.app-platform),
.experience-header > div:first-child > p:last-child,
.utility-heading > p:last-child {
  margin: 0.9rem 0 1.8rem;
  color: var(--muted);
  line-height: 1.7;
}

.active-app-card > a {
  display: inline-flex;
  width: fit-content;
  min-height: 2.8rem;
  padding: 0 1rem;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.4rem;
  background: var(--red);
  color: white;
  font-size: 0.76rem;
  font-weight: 720;
}

.experience-coming {
  color: #74777c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
}

.lab-heading-row > p {
  max-width: 25rem;
  margin: 0;
  color: #42464c;
  font-size: 0.86rem;
  line-height: 1.6;
  text-align: right;
}

.experience-panel {
  border: 1px solid var(--line);
  background: #08090a;
  scroll-margin-top: 1rem;
}

.pulse-panel {
  padding: clamp(1.2rem, 4vw, 2.5rem);
}

.experience-header {
  display: grid;
  margin-bottom: 2rem;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: clamp(2rem, 7vw, 6rem);
}

.experience-number {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--red);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
}

.experience-type {
  margin-top: 0;
}

.experience-controls {
  align-self: end;
}

.experience-controls label {
  margin-top: 0;
}

.lab-button {
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.38rem;
  background: rgba(255, 255, 255, 0.035);
  color: #d4d5d7;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
}

.experience-controls .lab-button {
  width: 100%;
  margin-top: 0.7rem;
}

.lab-button:hover {
  border-color: rgba(255, 255, 255, 0.24);
  color: white;
}

.lab-button.is-primary {
  border-color: var(--red);
  background: var(--red);
  color: white;
}

.pulse-window {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.65rem;
  background: #090a0b;
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.3);
}

.pulse-titlebar {
  display: flex;
  min-height: 3.3rem;
  padding: 0 1rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: #777a7f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
}

.pulse-titlebar > div {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #b4b6b9;
}

.pulse-titlebar i {
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0.7rem rgba(255, 32, 32, 0.75);
}

.pulse-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.pulse-metric {
  padding: 1.25rem;
  border-right: 1px solid var(--line);
}

.pulse-metric:last-child {
  border-right: 0;
}

.pulse-metric > span {
  display: block;
  color: #707378;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.6rem;
  text-transform: uppercase;
}

.pulse-metric strong {
  display: block;
  margin: 0.45rem 0 1.1rem;
  font-size: clamp(1.3rem, 3vw, 2rem);
  letter-spacing: -0.045em;
}

.pulse-metric > div {
  height: 0.22rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
}

.pulse-metric i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7f0c0c, var(--red));
  transition: width 500ms ease;
}

.pulse-insight {
  display: flex;
  padding: 1rem 1.25rem;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 32, 32, 0.045);
}

.pulse-insight span {
  padding: 0.3rem 0.5rem;
  border: 1px solid rgba(255, 32, 32, 0.22);
  color: var(--red-bright);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
}

.pulse-insight p {
  margin: 0;
  color: #b6b8bb;
  font-size: 0.75rem;
}

.process-table-wrap {
  overflow-x: auto;
}

.process-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.74rem;
}

.process-table th,
.process-table td {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  color: #85888d;
  text-align: right;
  white-space: nowrap;
}

.process-table th {
  color: #5f6267;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.57rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.process-table th:first-child,
.process-table td:first-child {
  text-align: left;
}

.process-table .process-name {
  color: #d5d6d8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.demo-note {
  margin: 1rem 0 0;
  color: #616469;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.61rem;
  line-height: 1.5;
}

.utility-grid {
  display: grid;
  margin-top: 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.utility-panel {
  padding: clamp(1.3rem, 4vw, 2rem);
}

.utility-heading {
  min-height: 15rem;
}

.utility-heading .experience-type {
  margin-top: 0;
}

.utility-panel textarea {
  min-height: 9.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.6;
}

.utility-panel .tool-output {
  min-height: 8rem;
  color: #c7c9cc;
}

.button-row {
  display: flex;
  margin: 0.8rem 0 1.5rem;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tool-message {
  min-height: 1.2rem;
  margin: 0.7rem 0 0;
  color: #78c99c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.61rem;
}

.tool-message.is-error {
  color: #ff9292;
}

.portal-cta {
  display: grid;
  margin-bottom: clamp(4rem, 9vw, 7rem);
  padding: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3rem;
  border: 1px solid var(--line);
  background: #08090a;
}

.portal-cta h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.055em;
}

.portal-cta > div > p:last-child {
  max-width: 43rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.portal-cta > a {
  display: inline-flex;
  min-height: 3rem;
  padding: 0 1.1rem;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(255, 32, 32, 0.3);
  border-radius: 0.4rem;
  background: rgba(255, 32, 32, 0.08);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .tools-hero,
  .experience-header {
    grid-template-columns: 1fr;
  }

  .tools-hero {
    min-height: auto;
  }

  .hero-command {
    min-height: 10rem;
  }

  .experience-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.7rem;
  }

  .experience-controls label {
    grid-column: 1 / -1;
    margin-bottom: -0.3rem;
  }

  .experience-controls .lab-button {
    width: auto;
    min-width: 9rem;
    margin: 0;
  }
}

@media (max-width: 760px) {
  .active-app-grid,
  .utility-grid {
    grid-template-columns: 1fr;
  }

  .section-heading-row,
  .portal-cta {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .section-heading-row {
    flex-direction: column;
  }

  .lab-heading-row > p {
    text-align: left;
  }

  .pulse-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pulse-metric:nth-child(2) {
    border-right: 0;
  }

  .pulse-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .portal-cta {
    display: grid;
  }

  .portal-cta > a {
    width: fit-content;
  }
}

@media (max-width: 520px) {
  .tools-hero h1 {
    font-size: 4rem;
  }

  .experience-controls {
    grid-template-columns: 1fr;
  }

  .experience-controls label {
    grid-column: auto;
  }

  .experience-controls .lab-button {
    width: 100%;
  }

  .pulse-metrics {
    grid-template-columns: 1fr;
  }

  .pulse-metric,
  .pulse-metric:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pulse-metric:last-child {
    border-bottom: 0;
  }

  .pulse-insight {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-metric i {
    transition: none;
  }
}
