/* h5i showcase: the drafting sheet, used as a gallery.
 *
 * Same chassis as blog.css (hairlines, square cells, mono labels, red as the
 * lone accent). What the page adds is motion that follows the reader: a
 * spotlight under the pointer, cards that rule themselves in as they scroll
 * into view, and a terminal that types the next entry.
 */

.sc { --cell-pad: 26px; }
.sc > section { padding: 0; }
.sc code {
  font-family: var(--mono); font-size: 0.88em; color: var(--ink);
  background: var(--panel2); border: 1px solid var(--line2); padding: 0 5px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.sc-hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(60% 70% at 85% 30%, rgba(224,36,27,0.13), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 48px 48px;
}
.sc-hero-copy {
  padding: 68px var(--gut) 56px; display: flex; flex-direction: column;
  justify-content: center; border-right: 1px solid var(--line2);
  background: linear-gradient(90deg, var(--bg) 55%, transparent);
}
.sc-hero h1 {
  font-family: var(--disp); font-weight: 700;
  font-size: clamp(36px, 4.6vw, 64px); line-height: 0.98;
  letter-spacing: -0.035em; color: var(--ink); margin: 20px 0 0;
}
.sc-dot { color: var(--spot-solid); display: inline-block; animation: sc-pulse 2.4s var(--ease) infinite; }
@keyframes sc-pulse { 0%, 100% { transform: none; } 50% { transform: translateY(-0.06em); } }
.sc-deck { margin: 22px 0 0; max-width: 56ch; color: var(--dim); font-size: 15.5px; line-height: 1.7; }
.sc-deck a { color: var(--ink); }
.sc-deck a:hover code { border-color: var(--spot); color: var(--spot); }

.sc-term {
  align-self: center; min-width: 0; margin: 40px var(--gut) 40px 32px;
  border: 1px solid var(--line2); background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transform: perspective(1400px) rotateY(-6deg) rotateX(2deg);
  transform-origin: left center; transition: transform 0.7s var(--ease);
}
.sc-term:hover { transform: none; }
.sc-term-bar { display: flex; align-items: stretch; border-bottom: 1px solid var(--line2); overflow-x: auto; scrollbar-width: none; }
.sc-tab {
  flex: 0 0 auto; padding: 9px 14px; background: none; border: 0; border-right: 1px solid var(--line2);
  font-family: var(--mono); font-size: 11px; color: var(--faint); cursor: pointer;
  box-shadow: inset 0 -2px 0 transparent; transition: color 0.15s, box-shadow 0.25s var(--ease);
}
.sc-tab:hover { color: var(--text); }
.sc-tab[aria-selected="true"] { color: var(--ink); background: var(--panel2); box-shadow: inset 0 -2px 0 var(--spot-solid); }
.sc-tab:focus-visible { outline: 1px solid var(--spot); outline-offset: -3px; }
.sc-term-lang {
  margin-left: auto; padding: 9px 14px; display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint);
}
.sc-term-lang::before { content: ''; width: 6px; height: 6px; background: var(--green); }
.sc-term-body {
  margin: 0; padding: 16px 18px 20px; height: 330px; overflow: auto;
  font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--text);
}
.sc-term-body[hidden] { display: none; }
.t-line { display: block; white-space: pre; min-height: 1.7em; }
.src .t-line i { display: inline-block; width: 2.4em; margin-right: 0.9em; text-align: right; font-style: normal; color: var(--line2); user-select: none; }
.t-p { color: var(--spot); }
.t-in { color: var(--ink); }
.t-k { color: var(--spot); }
.t-t { color: var(--cyan); }
.t-n { color: var(--yellow); }
.t-c, .t-d { color: var(--faint); }
.t-g { color: var(--green); }
.t-r { color: var(--red-text); }
.t-caret { display: inline-block; width: 0.6em; height: 1.1em; vertical-align: -0.2em; background: var(--spot); animation: caret 1.1s steps(1) infinite; }
.sc-js .sc-term .t-line.off { visibility: hidden; }

/* ── Stats ────────────────────────────────────────────────── */
.sc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.sc-stat {
  position: relative; padding: 22px var(--gut) 18px; border-right: 1px solid var(--line2);
  display: flex; flex-direction: column; gap: 6px; overflow: hidden;
  transition: background 0.2s;
}
.sc-stat:last-child { border-right: 0; }
.sc-stat::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--spot-solid); transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.sc-stat:hover { background: var(--panel); }
.sc-stat:hover::after { transform: none; }
.sc-stat-n {
  font-family: var(--disp); font-weight: 700;
  font-size: clamp(30px, 3.2vw, 44px); line-height: 1; letter-spacing: -0.04em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.sc-stat-l { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }

/* ── Filter ───────────────────────────────────────────────── */
.sc-filter {
  position: sticky; top: 60px; z-index: 50;
  display: flex; gap: 0; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line2);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.sc-filter::-webkit-scrollbar { display: none; }
.sc-chip {
  flex: 0 0 auto; padding: 14px 22px; background: none; color: var(--dim);
  border: 0; border-right: 1px solid var(--line2); cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  transition: color 0.15s, background 0.15s;
}
.sc-chip span { color: var(--faint); margin-left: 6px; }
.sc-chip:hover { color: var(--ink); background: var(--panel); }
.sc-chip[aria-pressed="true"] { color: #fff; background: var(--spot-solid); }
.sc-chip[aria-pressed="true"] span { color: rgba(255,255,255,0.75); }
.sc-chip:focus-visible { outline: 1px solid var(--spot); outline-offset: -4px; }
.sc[data-filter]:not([data-filter="all"]) .sc-band { display: none; }
.sc[data-filter="apps"] .sc-band[data-band="apps"],
.sc[data-filter="bench"] .sc-band[data-band="bench"],
.sc[data-filter="tools"] .sc-band[data-band="tools"] { display: block; }

/* ── Bands ────────────────────────────────────────────────── */
.sc-band { scroll-margin-top: 108px; }
/* breathing room under each grid, so one band ends before the next begins */
.sc > .sc-band { padding-bottom: 88px; }
.sc-band-head {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: end;
  padding: 72px var(--gut) 34px; border-bottom: 1px solid var(--line2); overflow: hidden;
}
.sc-band-letter {
  font-family: var(--disp); font-weight: 800;
  font-size: clamp(64px, 7vw, 104px); line-height: 0.76; letter-spacing: -0.06em;
  color: transparent; -webkit-text-stroke: 1px var(--line2);
}
.sc-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--spot); }
.sc-band-head h2 {
  font-family: var(--disp); font-weight: 700; font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.05; letter-spacing: -0.03em; color: var(--ink); margin: 12px 0 0;
}
.sc-band-head h2 code { font-size: 0.8em; color: var(--spot); background: none; border: 0; padding: 0; }
.sc-band-head p { margin: 12px 0 0; color: var(--dim); max-width: 62ch; font-size: 14.5px; }

/* the grid draws its own hairlines: each cell carries a right and bottom rule */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.sc-card {
  --mx: 50%; --my: 50%;
  position: relative; display: flex; flex-direction: column; gap: 12px; min-height: 220px;
  padding: var(--cell-pad) var(--gut) 22px;
  border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2);
  isolation: isolate;
}
.sc-card::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(380px circle at var(--mx) var(--my), rgba(224,36,27,0.16), transparent 62%);
  transition: opacity 0.3s;
}
.sc-card::after {
  content: ''; position: absolute; left: 0; top: 0; width: 2px; height: 100%;
  background: var(--spot-solid); transform: scaleY(0); transform-origin: top;
  transition: transform 0.45s var(--ease);
}
.sc-card:hover::before, .sc-card:focus-within::before { opacity: 1; }
.sc-card:hover::after, .sc-card:focus-within::after { transform: none; }
.sc-card-top { display: flex; justify-content: space-between; align-items: center; }
.sc-code { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--faint); }
.sc-tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--dim); border: 1px solid var(--line2); padding: 2px 8px;
}
.sc-card.community .sc-tag { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); text-transform: none; letter-spacing: 0.04em; }
.sc-card h3 {
  font-family: var(--disp); font-weight: 600; font-size: 20px;
  line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); margin-top: 12px;
  overflow-wrap: anywhere;
}
/* the title link covers the whole cell; inline links sit above it */
.sc-main::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.sc-main:focus-visible { outline: none; }
.sc-card:has(.sc-main:focus-visible) { outline: 1px solid var(--spot); outline-offset: -1px; }
.sc-card p { color: var(--dim); font-size: 14.5px; line-height: 1.65; flex: 1; }
.sc-inline { position: relative; z-index: 2; color: var(--ink); border-bottom: 1px solid var(--spot); transition: color 0.15s; }
.sc-inline:hover { color: var(--spot); }
.sc-card-foot { display: flex; gap: 12px; align-items: center; padding-top: 14px; border-top: 1px dashed var(--line2); }
.sc-repo { flex: 1; min-width: 0; font-family: var(--mono); font-size: 11.5px; color: var(--faint); overflow-wrap: anywhere; }
.sc-stars { display: block; height: 20px; width: auto; flex: 0 0 auto; }
.sc-go {
  font-family: var(--mono); font-size: 18px; line-height: 1; color: var(--dim);
  transition: transform 0.3s var(--ease), color 0.2s;
}
.sc-card:hover .sc-go { color: var(--spot); transform: translate(3px, -3px); }
.sc-card:hover .sc-repo { color: var(--dim); }

/* ── CTA ──────────────────────────────────────────────────── */
.sc-cta {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  position: relative; overflow: hidden; background: var(--spot-solid); color: #fff;
}
.sc-cta::before {
  content: 'h5i'; position: absolute; right: -0.06em; bottom: -0.24em; pointer-events: none;
  font-family: var(--disp); font-weight: 800; font-size: clamp(160px, 22vw, 320px);
  letter-spacing: -0.07em; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,0.22);
}
.sc-cta-copy { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 40px var(--gut); border-right: 1px solid rgba(255,255,255,0.25); }
.sc-cta .sc-kicker { color: #fff; opacity: 0.85; }
.sc-cta h2 {
  font-family: var(--disp); font-weight: 700;
  font-size: clamp(32px, 3.8vw, 52px); line-height: 1; letter-spacing: -0.035em;
}
.sc-cta p { margin-top: 20px; max-width: 46ch; font-size: 15.5px; line-height: 1.65; color: rgba(255,255,255,0.92); }
.sc-cta .sc-cta-btn { background: #0a0a09; border-color: #0a0a09; color: #fff; }
.sc-cta .sc-cta-btn:hover { background: #fff; border-color: #fff; color: var(--spot-solid); }
.sc-steps { position: relative; list-style: none; align-self: center; padding: 28px var(--gut); }
.sc-steps li { display: grid; grid-template-columns: 54px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,0.25); }
.sc-steps li:last-child { border-bottom: 0; }
.sc-step-n { font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; opacity: 0.8; padding-top: 4px; }
.sc-steps h3 { font-family: var(--disp); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.sc-steps p { margin-top: 4px; font-size: 14.5px; line-height: 1.6; color: rgba(255,255,255,0.9); max-width: none; }
.sc-cta code { background: rgba(0,0,0,0.25); border-color: rgba(255,255,255,0.3); color: #fff; }
.sc-cta .sc-inline { color: #fff; border-color: #fff; }
.sc-cta .sc-inline:hover { color: #0a0a09; }

/* ── Reveal ───────────────────────────────────────────────── */
.sc-js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.sc-js [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .sc-js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .sc-dot { animation: none; }
  .sc-term { transform: none; }
}

/* ── Small screens ────────────────────────────────────────── */
@media (max-width: 960px) {
  .sc-hero, .sc-cta { grid-template-columns: 1fr; }
  .sc-hero { min-height: 0; }
  .sc-hero-copy { border-right: 0; border-bottom: 1px solid var(--line2); padding: 56px var(--gut) 44px; }
  .sc-term { margin: 28px var(--gut); transform: none; }
  .sc-cta-copy { border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.25); padding: 40px var(--gut) 32px; }
}
@media (max-width: 640px) {
  :root { --gut: 16px; }
  .sc-grid { grid-template-columns: 1fr; }
  .sc-card { border-right: 0; min-height: 0; }
  .sc-stats { grid-template-columns: repeat(2, 1fr); }
  .sc-stat { border-bottom: 1px solid var(--line2); }
  .sc-stat:nth-child(2n) { border-right: 0; }
  .sc-band-head { grid-template-columns: 1fr; gap: 0; padding-top: 52px; }
  .sc > .sc-band { padding-bottom: 56px; }
  .sc-band-letter { position: absolute; right: var(--gut); top: 18px; font-size: 72px; }
  .sc-term-body { font-size: 11px; height: 300px; }
  .sc-filter { top: 60px; }
}
