:root {
  --green: #138a07;
  --green-dark: #046530;
  --green-tint: #eef7ec;
  --green-tint-2: #f6faf5;
  --ink: #1b222c;
  --slate: #3b4452;
  --muted: #5f6b7a;
  --line: #e3e7ec;
  --term-bg: #15191e;
  --term-bar: #20252c;
  --term-line: #2b3139;
  --term-text: #d5dce3;
  --radius: 14px;
  --sans: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --shadow-lg: 0 30px 60px -20px rgba(16, 24, 32, .35), 0 12px 24px -12px rgba(16, 24, 32, .2);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--slate);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--green-dark); }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0; text-wrap: balance; }
.lead, .section-head p, .caption { text-wrap: pretty; }
code, kbd, pre { font-family: var(--mono); }
p code, td code {
  font-size: .86em;
  background: #f1f3f5;
  border-radius: 5px;
  padding: .1em .38em;
  color: var(--ink);
  white-space: nowrap;
}
kbd {
  display: inline-block;
  font-size: .82em;
  line-height: 1.5;
  padding: .05em .45em;
  border: 1px solid #d3d9e0;
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  white-space: nowrap;
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.container.narrow { max-width: 860px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 16px/1 var(--sans);
  padding: 15px 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background-color .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--green); border-color: var(--green); }
.btn-secondary:hover { background: var(--green-tint); color: var(--green-dark); border-color: var(--green-dark); }
.btn-outline { color: var(--ink); border-color: #cfd6dd; background: #fff; }
.btn-outline:hover { border-color: var(--green); color: var(--green-dark); }
.btn-sm { font-size: 14.5px; padding: 9px 16px; }
.btn:focus-visible, .tab:focus-visible, .copy:focus-visible, a:focus-visible { outline: 3px solid rgba(19,138,7,.45); outline-offset: 2px; }

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font: 700 22px/1 var(--sans); letter-spacing: -.02em; color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav-links a:not(.btn) { color: var(--slate); text-decoration: none; font-weight: 500; font-size: 15.5px; }
.nav-links a:not(.btn):hover { color: var(--green); }
.gh-icon { width: 17px; height: 17px; }

.hero { padding-top: 60px; }
.visual-band { padding-bottom: 64px; background: linear-gradient(180deg, #fff 0, #fff 42%, var(--green-tint-2) 42%, var(--green-tint-2) 100%); border-bottom: 1px solid #e6efe4; }
.hero-copy { text-align: center; max-width: 900px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 22px; padding: 6px 14px;
  font: 500 14px/1.2 var(--mono); color: var(--green-dark);
  background: var(--green-tint); border-radius: 999px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hero h1 {
  max-width: 820px; margin: 0 auto;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.1;
}
.lead { max-width: 660px; margin: 20px auto 0; font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 34px; }

.hero-visual { padding-top: 48px; }

.term {
  margin: 0;
  background: var(--term-bg);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid #0c0f12;
}
.term-bar {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 38px; background: var(--term-bar); border-bottom: 1px solid #0f1215;
}
.lights { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: flex; gap: 8px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.term-title { font: 500 13px/1 var(--mono); color: #8a949f; }
.term-body { display: grid; grid-template-columns: 1.08fr 1fr; height: 600px; }
.pane { min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.pane-editor { border-right: 1px solid var(--term-line); }

.code {
  flex: 1; margin: 0; padding: 14px 0 0;
  font: 400 13.5px/20px var(--mono);
  color: var(--term-text);
  white-space: pre; overflow: hidden;
}
.code .ln { display: inline-block; width: 44px; padding-right: 14px; text-align: right; color: #4d5661; user-select: none; }
.code .c { color: #82b4f5; }
.code .k { color: #e78ba8; }
.code .s { color: #7fd48a; font-weight: 500; }
.code .a { color: #e6c47f; }
.code .o { color: #9aa5b1; }
.code .m { color: #c3a6f2; }
.cursor { display: inline-block; width: 8px; height: 18px; vertical-align: -4px; background: #d5dce3; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

.editor-status, .viewer-status {
  flex: none; height: 26px; display: flex; align-items: center;
  font: 500 12.5px/1 var(--mono); white-space: nowrap; overflow: hidden;
}
.editor-status { background: #1d2228; color: #a8b2bd; border-top: 1px solid var(--term-line); }
.editor-status .mode { align-self: stretch; display: flex; align-items: center; padding: 0 12px; background: #7fd48a; color: #10231a; letter-spacing: .04em; }
.editor-status .fname { padding: 0 12px; flex: 1; }
.editor-status .pos { padding: 0 12px; }

.viewer-page { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; padding: 10px 12px; }
.viewer-page img { height: 100%; width: auto; max-width: 100%; object-fit: contain; }
/* termleaf draws its status row in reverse video */
.viewer-status { background: var(--term-text); color: var(--term-bg); padding: 0 10px; }

.caption { margin: 18px auto 0; max-width: 720px; text-align: center; font-size: 14.5px; color: var(--muted); }

.section { padding: 96px 0; }
.section-tint { background: var(--green-tint-2); border-top: 1px solid #e6efe4; border-bottom: 1px solid #e6efe4; }
.section-head { text-align: center; max-width: 700px; margin: 0 auto 52px; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 600; letter-spacing: -.02em; }
.section-head p { margin: 14px 0 0; color: var(--muted); font-size: 1.08rem; }

.grid { display: grid; gap: 24px; }
.cards { grid-template-columns: repeat(4, 1fr); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px 26px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { border-color: #c9dcc5; box-shadow: 0 14px 30px -18px rgba(4,101,48,.35); transform: translateY(-2px); }
.icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--green-tint); color: var(--green); margin-bottom: 18px; }
.icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.12rem; font-weight: 600; margin-bottom: 10px; }
.card p { margin: 0; font-size: 15.5px; }

.tabs { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 30px -22px rgba(16,24,32,.4); }
.tab-list { display: flex; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); background: #fafbfc; }
.tab {
  border: 0; background: none; cursor: pointer;
  font: 600 15px/1 var(--sans); color: var(--muted);
  padding: 14px 18px 15px; border-bottom: 3px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--green-dark); border-bottom-color: var(--green); }
.tab-panel { padding: 24px 26px 26px; }
.panel-note { margin: 0 0 12px; color: var(--muted); font-size: 15.5px; }
.panel-foot { margin: 14px 0 0; font-size: 14.5px; color: var(--muted); }
.panel-foot code { white-space: normal; }

.codeblock { display: flex; background: var(--term-bg); border-radius: 10px; overflow: hidden; }
.codeblock pre { flex: 1; min-width: 0; margin: 0; padding: 16px 18px; white-space: pre-wrap; color: var(--term-text); font-size: 15px; line-height: 1.5; }
.codeblock .prompt { color: #7fd48a; user-select: none; }
.codeblock .nw { white-space: nowrap; }
.codeblock .url { overflow-wrap: anywhere; }
.copy {
  flex: none; align-self: center; margin: 0 10px;
  cursor: pointer;
  font: 600 13px/1 var(--sans); color: #d5dce3;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; padding: 8px 14px;
  transition: background .15s, color .15s;
}
.copy:hover { background: rgba(255,255,255,.16); color: #fff; }
.copy.copied { background: var(--green); border-color: var(--green); color: #fff; }

.then { margin-top: 30px; }
.then-label { display: block; font: 500 14px/1 var(--mono); color: var(--green-dark); margin-bottom: 10px; }

#terminals { padding: 80px 0; }
.support { display: flex; gap: 26px; align-items: flex-start; background: #fff; border: 1px solid #d9e8d5; border-left: 5px solid var(--green); border-radius: var(--radius); padding: 32px 34px; }
.support-icon { flex: none; width: 54px; height: 54px; border-radius: 14px; background: var(--green-tint); color: var(--green); display: grid; place-items: center; }
.support-icon svg { width: 28px; height: 28px; }
.support h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: 10px; }
.support p { margin: 0 0 12px; }
.support .muted { margin: 0; color: var(--muted); font-size: 15.5px; }
.support .table-card { margin: 0 0 14px; }
.support td:first-child { width: 50%; }

.keys-grid { grid-template-columns: 1fr 1fr; align-items: start; }
.table-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
caption { text-align: left; padding: 16px 20px 12px; font: 600 1.02rem/1.2 var(--sans); color: var(--ink); background: #fafbfc; border-bottom: 1px solid var(--line); }
th { text-align: left; font: 500 12.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 20px; border-bottom: 1px solid var(--line); }
td { padding: 11px 20px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { width: 42%; color: var(--ink); }
td kbd { margin: 1px 0; }
.note { margin: 24px auto 0; max-width: 860px; text-align: center; font-size: 15px; color: var(--muted); text-wrap: pretty; }

.footer { background: var(--green-dark); color: rgba(255,255,255,.85); padding: 36px 0; font-size: 15px; }
.footer a { color: #fff; }
.footer a:hover { color: #d9f2d3; }
.footer-inner { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; font: 700 19px/1 var(--sans); color: #fff; }
.footer-brand .brand-mark { width: 26px; height: 26px; }
.footer-license { margin: 0; flex: 1; min-width: 260px; }
.footer-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.footer-links a { text-decoration: none; font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }

@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .term-body { height: 540px; }
}
@media (max-width: 900px) {
  .keys-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .container { padding: 0 20px; }
  .hero { padding: 44px 0 0; }
  .visual-band { padding-bottom: 44px; }
  .hero-visual { padding: 36px 12px 0; }
  .section { padding: 68px 0; }
  .section-head { margin-bottom: 36px; }
  .term-body { grid-template-columns: 1fr; grid-template-rows: 250px 460px; height: auto; }
  .pane-editor { border-right: 0; border-bottom: 1px solid var(--term-line); }
  .code { font-size: 12px; line-height: 18px; padding-top: 10px; }
  .code .ln { width: 34px; padding-right: 10px; }
  .cursor { height: 15px; width: 7px; vertical-align: -3px; }
  .support { flex-direction: column; gap: 16px; padding: 26px 22px; }
  .tab-panel { padding: 20px 18px 22px; }
  .tab { padding: 13px 12px 14px; font-size: 14.5px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}
@media (max-width: 600px) {
  .hide-sm { display: none; }
  .nav-links { gap: 18px; }
  .cards { grid-template-columns: 1fr; }
  .cta-row .btn { flex: 1 1 100%; }
  .cta-row { max-width: 340px; margin-left: auto; margin-right: auto; }
  .term-body { grid-template-rows: 230px 420px; }
  .codeblock pre { padding: 13px 4px 13px 14px; font-size: 13.5px; }
  .copy { align-self: flex-start; margin: 9px 8px 0 6px; padding: 7px 12px; }
  td, th { padding-left: 14px; padding-right: 14px; }
  caption { padding-left: 14px; }
  td:first-child { width: 44%; }
}
@media (max-width: 380px) {
  .container { padding: 0 16px; }
  .nav-links { gap: 12px; }
  .brand-name { font-size: 20px; }
  .brand-mark { width: 26px; height: 26px; }
  .btn-sm { padding: 8px 12px; }
  .tab { padding: 13px 9px 14px; font-size: 14px; }
}
.editors td:first-child { width: auto; }
