/* ============================================================
   shell.css - index page layout only.
   Everything that looks like a control lives in ui.css.
   ============================================================ */

body {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ---------- background ------------------------------------ */

#topo-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
}

/* Content sits in opaque windows now, so the scrim only has to
   take the edge off the contours rather than hide them. */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(102deg, var(--scrim-1) 0%, var(--scrim-2) 38%, var(--scrim-3) 78%);
}

/* ---------- frame ----------------------------------------- */

.shell {
  position: relative;
  z-index: 10;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.col {
  max-width: 820px;
  margin: 0;
  margin-left: clamp(16px, 7vw, 108px);
  padding: 32px 20px 88px 0;
}

/* ---------- bar extras ------------------------------------ */

.bar--foot {
  border-bottom: 0;
  border-top: 1px solid var(--rule-2);
}

.bar--foot .bar__seg {
  border: 0;
  gap: 7px;
  color: var(--dim);
}

.hint {
  display: flex;
  align-items: center;
  gap: 7px;
  text-transform: none;
  letter-spacing: 0.02em;
}

/* Dot that reports whether the background is on live tiles. */
.led {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border: 1px solid var(--rule-2);
  background: var(--dim);
}

.led--live {
  background: var(--good);
}

.led--synthetic {
  background: var(--warn);
}

/* ---------- panes ----------------------------------------- */

.pane[hidden] {
  display: none;
}

.pane {
  animation: pane-in 200ms ease-out;
}

@keyframes pane-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.win + .win {
  margin-top: 24px;
}

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

.display {
  font-size: clamp(38px, 7.6vw, 74px);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.055em;
  text-transform: uppercase;
  color: var(--bright);
}

.lede {
  max-width: 54ch;
  margin-top: 16px;
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--muted);
}

.lede strong {
  font-weight: 600;
  color: var(--text);
}

.coords {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: var(--fs-xs);
  letter-spacing: var(--tr-mid);
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- project rows ---------------------------------- */

.proj {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 0 14px;
  padding: 14px 12px;
  border: 1px solid var(--rule);
  background: var(--surface-2);
  transition: background var(--t-mid);
}

.proj + .proj {
  margin-top: 8px;
}

.proj:hover,
.proj:focus-visible {
  background: var(--accent-wash);
  box-shadow: var(--bevel);
  outline: none;
}

.proj__n {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.proj:hover .proj__n {
  color: var(--accent);
}

.proj__title {
  display: block;
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: var(--tr-tight);
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.2;
}

.proj:hover .proj__title {
  color: var(--bright);
}

.proj__desc {
  display: block;
  max-width: 54ch;
  margin-top: 5px;
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--muted);
}

.proj__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.tag {
  padding: 1px 6px;
  border: 1px solid var(--rule);
  background: var(--surface);
  font-size: var(--fs-xs);
  letter-spacing: var(--tr-mid);
  text-transform: uppercase;
  color: var(--dim);
}

.proj__go {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--rule-2);
  background: var(--surface);
  box-shadow: var(--bevel);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-mid);
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.proj:hover .proj__go {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Compact variant used on the index tab. */
.proj--slim {
  padding: 10px 12px;
}

.proj--slim .proj__title {
  font-size: var(--fs-md);
}

.proj--slim .proj__desc {
  margin-top: 2px;
  font-size: var(--fs-sm);
}

/* ---------- link + data rows ------------------------------ */

.row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: var(--surface-2);
}

.row + .row {
  margin-top: 5px;
}

.row__k {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-mid);
  text-transform: uppercase;
  color: var(--dim);
}

.row__v {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

a.row {
  transition: background var(--t-mid);
}

a.row:hover,
a.row:focus-visible {
  background: var(--accent-wash);
  box-shadow: var(--bevel);
  outline: none;
}

a.row:hover .row__v {
  color: var(--bright);
}

.row__go {
  color: var(--dim);
  font-size: var(--fs-sm);
}

a.row:hover .row__go {
  color: var(--accent);
}

.prose {
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.7;
}

.prose p + p {
  margin-top: 12px;
}

.prose a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

.sign {
  margin-top: 26px;
  font-size: var(--fs-sm);
  color: var(--dim);
}

/* ---------- narrow ---------------------------------------- */

@media (max-width: 720px) {
  .col {
    margin-left: 14px;
    padding: 20px 14px 64px 0;
  }

  /* Too narrow for one row, so make the wrap look intentional:
     the theme switch becomes its own full-width strip. */
  .bar {
    flex-wrap: wrap;
  }

  .bar__right {
    width: 100%;
    margin-left: 0;
    border-top: 1px solid var(--rule);
  }

  .bar__right .bar__seg--btn {
    flex: 1;
    justify-content: space-between;
    border-left: 0;
  }

  .bar__seg--hide {
    display: none;
  }

  .win__body {
    padding: 13px 12px;
  }

  .proj {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .proj__go {
    grid-column: 2;
    margin-top: 9px;
    justify-self: start;
  }

  .row {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .row__go {
    display: none;
  }

  .bar--foot {
    display: none;
  }
}
