:root {
  color-scheme: dark;
  --ink: #eef7ff;
  --muted: #8ea0ad;
  --paper: #080b10;
  --panel: #101720;
  --line: #253443;
  --cyan: #48d8ff;
  --green: #58f29a;
  --amber: #f3b35b;
  --pink: #ff5c9b;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 22% 14%, rgba(72, 216, 255, 0.12), transparent 24rem),
    radial-gradient(circle at 88% 8%, rgba(88, 242, 154, 0.08), transparent 22rem),
    linear-gradient(180deg, #0b1017 0%, #080b10 44rem),
    var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(72, 216, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(72, 216, 255, 0.07) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

iframe {
  display: block;
}

.page-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.78fr);
  align-items: center;
  min-height: clamp(360px, 58vh, 560px);
  gap: 28px;
  padding: 16px 0 28px;
}

.intro-copy {
  max-width: 620px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 0.96;
}

h1 {
  max-width: 10ch;
  font-size: clamp(4.1rem, 13vw, 8.75rem);
  text-shadow: 0 0 34px rgba(72, 216, 255, 0.18);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.7rem);
}

.lede {
  max-width: 36rem;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.featured-widget {
  min-width: 0;
}

.featured-widget .widget {
  min-height: clamp(300px, 44vw, 430px);
  box-shadow: var(--shadow);
}

.widget-region {
  padding: 12px 0 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  border-top: 1px solid rgba(142, 160, 173, 0.18);
  padding-top: 26px;
}

.section-heading .kicker {
  margin-bottom: 8px;
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  grid-auto-rows: 112px;
  gap: 18px;
  align-items: stretch;
}

.widget {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border: 1px solid rgba(142, 160, 173, 0.18);
  border-radius: 8px;
  background: rgba(16, 23, 32, 0.86);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
  overflow: visible;
  backdrop-filter: blur(18px);
}

.widget[data-size="small"] {
  grid-row: span 4;
}

.widget[data-size="wide"] {
  grid-column: span 2;
  grid-row: span 4;
}

.widget[data-size="tall"] {
  grid-row: span 6;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(142, 160, 173, 0.14);
}

.widget-title {
  min-width: 0;
}

.widget-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.widget-title h3 {
  margin: 0;
  overflow: hidden;
  font-size: 0.98rem;
  letter-spacing: 0;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget-help {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.widget-help::after {
  position: absolute;
  top: 100%;
  left: -18px;
  width: 160px;
  height: 10px;
  content: "";
}

.widget-help-button {
  display: grid;
  width: 19px;
  height: 19px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(142, 160, 173, 0.32);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(238, 247, 255, 0.04);
  cursor: help;
  font: 700 0.72rem/1 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.widget-help-button:hover,
.widget-help-button:focus-visible {
  border-color: var(--cyan);
  color: var(--cyan);
  outline: none;
}

.widget-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  z-index: 20;
  width: max-content;
  max-width: 230px;
  padding: 9px 10px;
  border: 1px solid rgba(72, 216, 255, 0.28);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(8, 11, 16, 0.96);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.36);
  font-size: 0.78rem;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.widget-tooltip a {
  color: var(--green);
  text-decoration: none;
}

.widget-tooltip a:hover,
.widget-tooltip a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.widget-help:hover .widget-tooltip,
.widget-help:focus-within .widget-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.widget-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.widget-open {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(142, 160, 173, 0.24);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.widget-open:hover,
.widget-open:focus-visible {
  border-color: var(--cyan);
  background: var(--cyan);
  color: #041017;
  outline: none;
}

.widget-open svg {
  width: 17px;
  height: 17px;
}

.widget-frame {
  width: 100%;
  min-height: 0;
  flex: 1;
  border: 0;
  border-radius: 0 0 8px 8px;
  background: white;
}

.widget-accent {
  height: 4px;
  flex: 0 0 auto;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--pink));
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 24px, 640px);
    padding-top: 18px;
  }

  .intro {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 22px;
    padding-bottom: 30px;
  }

  .section-heading {
    display: block;
  }

  .widget-grid {
    grid-auto-rows: 98px;
  }

  .widget[data-size="wide"] {
    grid-column: span 1;
  }
}
