/*
 * asomiya.codes
 *
 * Palette from the gamosa and the Assam valley: cotton white, gamosa red (used sparingly: the
 * woven border, the logo, the main action), muga-silk gold, tea green, and ink. Dark mode is the
 * Brahmaputra at night. The one decorative element is the woven band; everything else stays quiet.
 */

/* Dark by default (the tea garden at night); a light theme is available from the toggle. */
:root {
  --cotton: #0d1210;
  --mist: #121816;
  --mist-2: #19211e;
  --surface: #111714;
  --ink: #edede9;
  --ink-2: #a5aca7;
  --ink-3: #737b76;
  --line: #1d2523;
  --line-2: #2a3330;
  --accent: #f2c14e;
  --accent-hover: #f7d27a;
  --accent-ink: #0d1210;
  --accent-soft: rgb(242 193 78 / 0.1);
  --gold: #f2c14e;
  --gold-soft: rgb(242 193 78 / 0.1);
  --tea: #7fd1a5;
  --tea-soft: rgb(127 209 165 / 0.1);
  --link: #f2c14e;
  --danger: #ff7a85;

  --code-bg: #101614;
  --code-line: #1d2523;
  --code-ink: #e6e8e4;
  --tok-kw: #f2c14e;
  --tok-str: #7fd1a5;
  --tok-num: #ff9f87;
  --tok-lit: #c9a9ff;
  --tok-fn: #8cc8ff;
  --tok-com: #5e6763;
  --tok-op: #98a09b;

  --shadow: 0 0 0 1px var(--line), 0 24px 48px -24px rgb(0 0 0 / 0.8);
  --nav-h: 64px;
  --font: 'TASA Orbiter', 'Anek Bangla', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-as: 'Anek Bangla', 'TASA Orbiter', system-ui, sans-serif;
  --mono: 'Geist Mono', 'Anek Bangla', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

:root[data-theme='light'] {
  --cotton: #f6f6f2;
  --mist: #ffffff;
  --mist-2: #ecece6;
  --surface: #ffffff;
  --ink: #141816;
  --ink-2: #4c5450;
  --ink-3: #737b76;
  --line: #e2e2dc;
  --line-2: #cfcfc8;
  --accent: #f2c14e;
  --accent-hover: #e6b23a;
  --accent-ink: #141816;
  --accent-soft: rgb(242 193 78 / 0.18);
  --gold: #a87508;
  --gold-soft: rgb(242 193 78 / 0.18);
  --tea: #2f6b4f;
  --tea-soft: rgb(47 107 79 / 0.1);
  --link: #8a5d00;
  --danger: #b4162c;
  --code-bg: #ffffff;
  --code-line: #e2e2dc;
  --code-ink: #1d211f;
  --tok-kw: #a3620a;
  --tok-str: #2f6b4f;
  --tok-num: #b5452e;
  --tok-lit: #6a3d9a;
  --tok-fn: #1f5e9c;
  --tok-com: #8c918e;
  --tok-op: #5d6662;
  --shadow: 0 0 0 1px var(--line), 0 24px 48px -28px rgb(20 24 22 / 0.35);
  color-scheme: light;
}

/* ── base ─────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 20px);
}

body {
  margin: 0;
  background: var(--cotton);
  color: var(--ink);
  font: 400 16px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Assamese pages: Anek Bangla first, a touch larger and looser, because the script has tall
   ascenders and stacked conjuncts. */
html[lang='as'] body {
  font-family: var(--font-as);
  font-size: 17.5px;
  line-height: 1.8;
}

/* Assamese snippets inside English pages (only elements that declare lang themselves, so code
   keeps its monospace font on Assamese pages). */
[lang='as'] {
  font-family: var(--font-as);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--mist);
  border-radius: 5px;
  padding: 0.12em 0.36em;
  overflow-wrap: anywhere;
}

svg {
  max-width: 100%;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  vertical-align: -0.18em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  background: var(--ink);
  color: var(--cotton);
  padding: 8px 14px;
  border-radius: 6px;
}

.skip:focus {
  top: 16px;
}

.center {
  text-align: center;
  justify-content: center;
}

/* ── logo ────────────────────────────────────────────────────────── */

/* অ আ ক খ on four keycaps; অ is on the gold key. */
.logo {
  flex: none;
}

.logo-key {
  fill: var(--mist-2);
  stroke: var(--line-2);
  stroke-width: 0.8;
}

.logo-key-main {
  fill: var(--accent);
}

.logo-letter {
  font: 700 12.5px var(--font-as);
  fill: var(--ink);
}

.logo-letter-main {
  fill: var(--accent-ink);
}

/* ── top navigation ──────────────────────────────────────────────── */

/* Small monospace capitals for navigation, labels and buttons; big tight type for headlines. */
.label,
.topnav-links a,
.btn,
.code-btn,
.side-title,
.toc-title,
.code-output-label,
.eyebrow,
.foot-title,
.scroll-hint,
.lang-switch,
.brand-version {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Assamese has no capitals and needs room: keep labels in Assamese pages readable. */
html[lang='as'] .topnav-links a,
html[lang='as'] .btn,
html[lang='as'] .side-title,
html[lang='as'] .toc-title,
html[lang='as'] .code-output-label,
html[lang='as'] .eyebrow,
html[lang='as'] .foot-title,
html[lang='as'] .scroll-hint {
  font-family: var(--font-as);
  font-size: 0.92rem;
  letter-spacing: 0;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--cotton) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topnav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  height: var(--nav-h);
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  justify-self: start;
}

.brand:hover {
  text-decoration: none;
}

.brand-name {
  font: 700 1.12rem/1 var(--font);
  letter-spacing: -0.03em;
}

.brand-version {
  color: var(--ink-3);
  font-size: 0.66rem;
}

.topnav-links {
  display: flex;
  gap: 4px;
}

.topnav-links a,
.drawer-nav a {
  color: var(--ink-2);
  padding: 8px 12px;
  white-space: nowrap;
}

.topnav-links a:hover,
.drawer-nav a:hover,
.topnav-links a[aria-current='page'] {
  color: var(--ink);
  text-decoration: none;
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-self: end;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--ink);
  text-decoration: none;
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-right: 6px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--ink-2);
}

.lang-switch:hover {
  color: var(--ink);
  border-color: var(--ink-3);
  text-decoration: none;
}

.lang-switch .icon {
  width: 14px;
  height: 14px;
}

/* The toggle shows the current theme: a moon in the (default) dark theme, a sun in light. */
.icon-sun {
  display: none;
}

:root[data-theme='light'] .icon-sun {
  display: inline;
}

:root[data-theme='light'] .icon-moon {
  display: none;
}

.menu-btn,
.drawer {
  display: none;
}

@media (max-width: 920px) {
  .topnav-inner {
    display: flex;
    gap: 6px;
    padding: 0 12px;
  }

  .menu-btn {
    display: inline-grid;
  }

  .topnav-links,
  .brand-version {
    display: none;
  }

  .topnav-actions {
    margin-left: auto;
  }

  body.menu-open {
    overflow: hidden;
  }

  body.menu-open .drawer {
    display: block;
    position: fixed;
    inset: var(--nav-h) 0 0;
    z-index: 40;
    overflow-y: auto;
    background: var(--cotton);
    padding: 20px 20px 56px;
  }

  .drawer-nav {
    display: grid;
    gap: 2px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
  }

  .drawer-nav a {
    font-size: 1.15rem;
    font-weight: 600;
    padding: 10px 4px;
  }

  .drawer-nav a[aria-current='page'] {
    color: var(--accent);
  }
}

@media (max-width: 480px) {
  .lang-switch span {
    display: none;
  }

  .lang-switch {
    padding: 0 10px;
  }
}

/* ── buttons and links ───────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn .icon {
  width: 14px;
  height: 14px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary span[aria-hidden] {
  font-size: 1.2em;
  line-height: 1;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}

.btn-secondary:hover {
  border-color: var(--ink-3);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--ink);
}

.btn-danger {
  background: var(--ink);
  color: var(--cotton);
}

.btn-sm {
  min-height: 34px;
  padding: 0 14px;
}

.btn-xs {
  min-height: 26px;
  padding: 0 10px;
  font-size: 0.66rem;
}

.actions,
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0 0;
}

.text-link {
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.text-link:hover {
  color: var(--accent);
}

/* ── docs layout ─────────────────────────────────────────────────── */

.docs {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 224px;
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 32px 12px 48px 28px;
}

.side-group + .side-group {
  margin-top: 26px;
}

.side-title {
  margin: 0 0 8px;
  padding: 0 10px;
  color: var(--ink-3);
}

.side-group ul,
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-group a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 0.94rem;
  line-height: 1.45;
}

.side-group a:hover {
  color: var(--ink);
  background: var(--mist);
  text-decoration: none;
}

.side-group a[aria-current='page'] {
  color: var(--accent);
  font-weight: 600;
}

.article {
  min-width: 0;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 48px 96px;
}

.toc {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 52px 24px 40px 8px;
  font-size: 0.86rem;
}

.toc-title {
  margin: 0 0 12px;
  color: var(--ink-3);
}

.toc a {
  display: block;
  padding: 4px 0 4px 12px;
  border-left: 1px solid var(--line);
  color: var(--ink-3);
  line-height: 1.45;
}

.toc .toc-3 a {
  padding-left: 22px;
}

.toc a:hover {
  color: var(--ink);
  text-decoration: none;
}

.toc a.active {
  color: var(--accent);
  border-left: 2px solid var(--accent);
  padding-left: 11px;
}

@media (max-width: 1240px) {
  .docs {
    grid-template-columns: 252px minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 920px) {
  .docs {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .article {
    padding: 32px 18px 72px;
  }
}

/* ── article typography ──────────────────────────────────────────── */

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
}

.article h1 {
  margin: 0 0 16px;
  font-size: clamp(2.1rem, 4vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 700;
}

html[lang='as'] .article h1 {
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.lead {
  margin: 0 0 32px;
  color: var(--ink-2);
  font-size: 1.16rem;
  line-height: 1.65;
}

.article h2 {
  margin: 64px 0 14px;
  font-size: 1.6rem;
  line-height: 1.2;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.article h3 {
  margin: 36px 0 10px;
  font-size: 1.18rem;
  font-weight: 700;
}

html[lang='as'] .article h2,
html[lang='as'] .article h3 {
  letter-spacing: 0;
  font-weight: 700;
  line-height: 1.4;
}

.article h2,
.article h3 {
  position: relative;
}

.anchor {
  position: absolute;
  left: -1em;
  color: var(--ink-3);
  opacity: 0;
  font-weight: 400;
}

.article h2:hover .anchor,
.article h3:hover .anchor {
  opacity: 1;
  text-decoration: none;
}

.article p,
.article ul,
.article ol {
  margin: 0 0 18px;
}

.article li {
  margin: 5px 0;
}

.article li::marker {
  color: var(--ink-3);
}

.edit-link {
  margin-top: 48px;
  font-size: 0.9rem;
}

.edit-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
}

/* ── code blocks ─────────────────────────────────────────────────── */

.code-block {
  position: relative;
  margin: 22px 0 26px;
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  border-radius: 6px;
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid var(--code-line);
}

.code-title {
  margin-left: auto;
  font: 500 0.8rem var(--mono);
  color: var(--ink-3);
}

/* Script tabs: plain text, the chosen one underlined with a red thread. */
.script-tabs {
  display: inline-flex;
  gap: 4px;
  align-self: stretch;
}

.script-tabs button {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font: 600 0.84rem var(--font);
  padding: 0 8px;
  cursor: pointer;
}

.script-tabs button[data-script-tab='as'] {
  font-family: var(--font-as);
  font-size: 0.9rem;
}

.script-tabs button:hover {
  color: var(--ink);
}

html[data-script='as'] .script-tabs [data-script-tab='as'],
html[data-script='roman'] .script-tabs [data-script-tab='roman'] {
  color: var(--ink);
}

html[data-script='as'] .script-tabs [data-script-tab='as']::after,
html[data-script='roman'] .script-tabs [data-script-tab='roman']::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

html[data-script='as'] .pane[data-pane='roman'],
html[data-script='roman'] .pane[data-pane='as'] {
  display: none;
}

.pane {
  position: relative;
}

pre.code {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font: 400 0.9rem/1.8 var(--mono);
  color: var(--code-ink);
  tab-size: 4;
}

pre.code code,
.code-output pre,
.output {
  font-family: var(--mono);
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  overflow-wrap: normal;
}

.code-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.code-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--code-line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}

.code-btn:hover {
  color: var(--ink);
  border-color: var(--ink-3);
  text-decoration: none;
}

.code-btn .icon {
  width: 13px;
  height: 13px;
}

.code-output {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--code-line);
  background: var(--surface);
}

.code-output-label {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-3);
}

.code-output pre {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.75;
  white-space: pre;
  overflow-x: auto;
  color: var(--ink);
}

.error {
  color: var(--danger);
}

.shell pre.code {
  padding-right: 64px;
}

.prompt {
  color: var(--ink-3);
  user-select: none;
}

.tok-kw {
  color: var(--tok-kw);
  font-weight: 600;
}

.tok-str {
  color: var(--tok-str);
}

.tok-num {
  color: var(--tok-num);
}

.tok-lit {
  color: var(--tok-lit);
  font-weight: 600;
}

.tok-fn,
.tok-call {
  color: var(--tok-fn);
}

.tok-com {
  color: var(--tok-com);
  font-style: italic;
}

.tok-op,
.tok-punc {
  color: var(--tok-op);
}

/* ── callouts, tables, cards ─────────────────────────────────────── */

.callout {
  margin: 26px 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--line-2);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  margin: 0 0 2px !important;
  font-weight: 700;
}

.callout-tip {
  border-left-color: var(--tea);
}

.callout-tip .callout-title {
  color: var(--tea);
}

.callout-warning {
  border-left-color: var(--gold);
}

.callout-warning .callout-title {
  color: var(--gold);
}

.callout-note {
  border-left-color: var(--accent);
}

.callout-note .callout-title {
  color: var(--accent);
}

.table-wrap {
  margin: 22px 0 28px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

th,
td {
  padding: 10px 14px 10px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 2px solid var(--ink);
}

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-ok {
  color: var(--tea);
}

.badge-warn {
  color: var(--gold);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px 28px;
  margin: 28px 0;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.95rem;
}

.card strong {
  color: var(--ink);
  font-size: 1.04rem;
}

a.card:hover {
  text-decoration: none;
  border-top-color: var(--accent);
}

a.card:hover strong {
  color: var(--accent);
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ink);
  font-weight: 700;
}

.pager a span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-3);
}

.pager a:hover {
  color: var(--accent);
  text-decoration: none;
}

.pager-next {
  grid-column: 2;
  text-align: right;
}

.error-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.error-item p {
  margin: 0 0 4px !important;
}

.error-code a {
  font: 700 0.95rem var(--mono);
  color: var(--accent);
}

.error-msg {
  font-weight: 500;
}

.error-alt {
  color: var(--ink-3);
  font-size: 0.93rem;
}

.error-example span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-3);
}

/* ── home ────────────────────────────────────────────────────────── */

/* Hero: a quiet field of Assamese letters lighting up in diagonal waves, with the headline at the
   bottom left and install + start on the right. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 32px 72px;
  overflow: hidden;
}

.letter-field {
  position: absolute;
  inset: 8px 32px 300px;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  align-content: center;
  justify-items: center;
  row-gap: clamp(0.4rem, 1.6vh, 1.2rem);
  font: 500 clamp(1.3rem, 2.6vw, 2.4rem) / 1 var(--font-as);
  color: var(--line-2);
  user-select: none;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 42%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 70% at 50% 42%, #000 35%, transparent 100%);
}

.letter-field span {
  animation: glint 7.2s ease-in-out infinite;
}

.letter-field .g {
  animation-name: glint-gold;
}

.letter-field .d0 {
  animation-delay: 0s;
}
.letter-field .d1 {
  animation-delay: 0.3s;
}
.letter-field .d2 {
  animation-delay: 0.6s;
}
.letter-field .d3 {
  animation-delay: 0.9s;
}
.letter-field .d4 {
  animation-delay: 1.2s;
}
.letter-field .d5 {
  animation-delay: 1.5s;
}
.letter-field .d6 {
  animation-delay: 1.8s;
}
.letter-field .d7 {
  animation-delay: 2.1s;
}
.letter-field .d8 {
  animation-delay: 2.4s;
}
.letter-field .d9 {
  animation-delay: 2.7s;
}
.letter-field .d10 {
  animation-delay: 3s;
}
.letter-field .d11 {
  animation-delay: 3.3s;
}

@keyframes glint {
  0%,
  60%,
  100% {
    color: var(--line-2);
  }

  30% {
    color: var(--ink-3);
  }
}

@keyframes glint-gold {
  0%,
  60%,
  100% {
    color: var(--line-2);
  }

  30% {
    color: var(--accent);
  }
}

.hero-bottom {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
}

.hero-title {
  margin: 0 0 16px;
  font: 700 clamp(2.2rem, 3.5vw, 3.15rem) / 1.06 var(--font);
  letter-spacing: -0.04em;
  color: var(--ink);
}

html[lang='as'] .hero-title {
  font-family: var(--font-as);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.hero-sub {
  max-width: 30rem;
  margin: 0;
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.6;
}

.hero-side {
  justify-self: end;
  text-align: right;
}

.hero-note {
  margin: 0 0 12px;
  color: var(--ink-3);
  font-size: 0.85rem;
}

.hero-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.install {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  margin: 0;
  padding: 0 6px 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--mist);
}

.install code {
  background: none;
  padding: 0;
  color: var(--ink);
  font-size: 0.82rem;
  white-space: nowrap;
}

.install .code-btn {
  border: 0;
  background: transparent;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  color: var(--ink-3);
  font-size: 0.64rem;
}

.scroll-hint::after {
  content: '⌄';
  display: block;
  text-align: center;
  font-size: 1rem;
  line-height: 0.6;
}

.scroll-hint:hover {
  color: var(--ink);
  text-decoration: none;
}

/* Demo window. */
.hero-code {
  position: relative;
  margin: 0;
  background: var(--surface);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-code .code-block {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.window {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: var(--code-bg);
  border-bottom: 1px solid var(--code-line);
}

.window span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-2);
}

.window em {
  margin-left: 8px;
  font: 500 0.75rem var(--mono);
  font-style: normal;
  color: var(--ink-3);
}

.section,
.band {
  padding: 120px 32px;
  border-top: 1px solid var(--line);
}

.band {
  background: var(--mist);
}

.section > *,
.band > * {
  max-width: 1256px;
  margin-left: auto;
  margin-right: auto;
}

.section h2,
.band h2 {
  margin: 0 0 14px;
  font: 700 clamp(1.9rem, 3.2vw, 2.5rem) / 1.08 var(--font);
  letter-spacing: -0.04em;
}

html[lang='as'] .section h2,
html[lang='as'] .band h2 {
  font-family: var(--font-as);
  line-height: 1.3;
  letter-spacing: -0.005em;
}

.section-head {
  max-width: 1256px;
  margin-bottom: 64px;
}

.section-head h2,
.section-head p {
  max-width: 34rem;
}

.section-head p {
  margin: 0;
  color: var(--ink-2);
  font-size: 1rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.features li {
  padding: 32px 28px 36px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.features h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.features p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.65;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 80px;
  align-items: center;
}

.split .lead {
  max-width: 30rem;
  margin-bottom: 8px;
}

.split-reverse > :first-child {
  order: 2;
}

.points {
  margin: 32px 0 0;
  display: grid;
  gap: 20px;
}

.points div {
  padding-left: 16px;
  border-left: 1px solid var(--accent);
}

.points dt {
  font-weight: 700;
}

.points dd {
  margin: 2px 0 0;
  color: var(--ink-2);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  list-style: none;
  padding: 0;
  margin-bottom: 48px !important;
  border-top: 1px solid var(--line);
}

.steps li {
  padding: 28px 28px 8px 0;
}

.steps li + li {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.step-n {
  display: block;
  font: 600 3rem/1 var(--font-as);
  color: var(--accent);
}

.steps h3 {
  margin: 18px 0 6px;
  font-size: 1.15rem;
}

.steps p {
  margin: 0;
  color: var(--ink-2);
}

.team-band .section-head {
  margin-bottom: 48px;
}

.people {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  list-style: none;
  padding: 0;
  margin-bottom: 44px !important;
}

.people li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.people li span:last-child {
  color: var(--ink-3);
  font-size: 0.9rem;
}

.avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border-radius: 6px;
  background: var(--mist-2);
  border: 1px solid var(--line-2);
  color: var(--accent);
  font: 600 0.9rem var(--mono);
  letter-spacing: 0.06em;
}

.avatar-lg {
  width: 84px;
  height: 84px;
  font-size: 1.2rem;
}

.team-band .actions {
  justify-content: flex-start;
}

/* Team: the same hairline grid as the features, with plain text links. */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
  padding: 0;
  margin-bottom: 44px !important;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.team-grid li {
  padding: 28px 28px 30px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.team-role {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[lang='as'] .team-role {
  font-family: var(--font-as);
  font-size: 0.9rem;
  letter-spacing: 0;
}

.team-grid h3 {
  margin: 0 0 18px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.team-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0;
}

.team-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.team-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

.team-links .icon {
  width: 15px;
  height: 15px;
}

.footer-bottom a {
  color: var(--ink-2);
}

.footer-bottom a:hover {
  color: var(--accent);
}

@media (max-width: 760px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .letter-field span {
    animation: none;
  }

  .letter-field .g {
    color: var(--accent);
  }
}

@media (max-width: 1020px) {
  .hero-bottom,
  .split {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .hero-side {
    justify-self: start;
    text-align: left;
  }

  .hero-row {
    justify-content: flex-start;
  }

  .split-reverse > :first-child {
    order: 0;
  }

  .features {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 24px 18px 72px;
  }

  .hero {
    min-height: 0;
  }

  /* On phones the field becomes its own band above the headline instead of a background. */
  .letter-field {
    position: relative;
    inset: auto;
    margin: 8px 0 36px;
    grid-template-columns: repeat(8, 1fr);
    row-gap: 0.7rem;
    font-size: 1.5rem;
  }

  .letter-field span:nth-child(n + 81) {
    display: none;
  }

  .letter-field span:nth-child(16n + 9),
  .letter-field span:nth-child(16n + 10),
  .letter-field span:nth-child(16n + 11),
  .letter-field span:nth-child(16n + 12),
  .letter-field span:nth-child(16n + 13),
  .letter-field span:nth-child(16n + 14),
  .letter-field span:nth-child(16n + 15),
  .letter-field span:nth-child(16n + 16) {
    display: none;
  }

  .section,
  .band {
    padding: 80px 18px;
  }

  .features,
  .steps {
    grid-template-columns: 1fr;
  }

  .steps li + li {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

/* ── simple pages (community, 404) ───────────────────────────────── */

.page-hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 88px 24px 24px;
  text-align: center;
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2.3rem, 5vw, 3.3rem);
  letter-spacing: -0.035em;
  font-weight: 800;
}

html[lang='as'] .page-hero h1 {
  letter-spacing: 0;
  font-weight: 700;
}

.page-hero p {
  color: var(--ink-2);
  font-size: 1.15rem;
}

.big-code {
  margin: 0;
  font: 700 6rem/1 var(--font-as) !important;
  color: var(--accent) !important;
}

.narrow {
  padding-top: 48px;
  padding-bottom: 48px;
}

.narrow > * {
  max-width: 820px;
}

.narrow h2 {
  font-size: 1.75rem;
  margin: 0 auto 16px;
}

.narrow h2 + * {
  margin-top: 0;
}

.team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin: 28px auto;
}

.member {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 12px;
}

.member h3 {
  margin: 4px 0 0;
}

.member p {
  margin: 0 0 10px;
  color: var(--ink-3);
}

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
}

.social-pill:hover {
  border-color: var(--ink-3);
  background: var(--mist);
  text-decoration: none;
}

/* ── footer ──────────────────────────────────────────────────────── */

.footer {
  background: var(--mist);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 28px 32px;
}

.foot-brand p {
  max-width: 22rem;
  color: var(--ink-3);
  font-size: 0.95rem;
}

.foot-brand .socials {
  justify-content: flex-start;
  margin-left: -9px;
}

.foot-title {
  margin: 0 0 14px;
  color: var(--ink-3);
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer li {
  margin: 7px 0;
}

.footer li a {
  color: var(--ink-3);
  font-size: 0.94rem;
}

.footer li a:hover {
  color: var(--ink);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 28px 36px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.88rem;
}

.footer-bottom p {
  margin: 0;
}

@media (max-width: 920px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .foot-brand {
    grid-column: 1 / -1;
  }
}

/* ── playground ──────────────────────────────────────────────────── */

.layout-playground main {
  height: calc(100vh - var(--nav-h));
  height: calc(100dvh - var(--nav-h));
}

.pg {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pg-noscript {
  margin: 0;
  padding: 12px 16px;
  background: var(--gold-soft);
}

.pg-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.pg-spacer {
  flex: 1;
}

.select select,
.mini-select select {
  appearance: none;
  max-width: 260px;
  padding: 7px 32px 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%2374737d' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.mini-select select {
  padding: 3px 24px 3px 8px;
  font-size: 0.8rem;
  background-position: right 7px center;
}

.pg-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
}

.pg-editor {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--code-bg);
}

.pg-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--code-line);
  font: 500 0.8rem var(--mono);
  color: var(--ink-3);
}

.file-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.editor {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.gutter {
  flex: none;
  min-width: 52px;
  padding: 16px 12px 16px 8px;
  overflow: hidden;
  text-align: right;
  white-space: pre;
  user-select: none;
  color: var(--ink-3);
  font: 0.94rem/1.8 var(--mono);
  opacity: 0.7;
}

#editor {
  flex: 1;
  min-width: 0;
  padding: 16px 16px 40px 8px;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--code-ink);
  font: 0.94rem/1.8 var(--mono);
  tab-size: 4;
  white-space: pre;
  overflow: auto;
}

.pg-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.pg-panel {
  border-bottom: 1px solid var(--line);
}

.pg-panel-head,
.pg-panel summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.pg-panel summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 0.92rem;
}

.pg-panel summary::-webkit-details-marker {
  display: none;
}

.pg-panel summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--ink-3);
  transition: transform 0.15s ease;
}

.pg-panel:not([open]) summary {
  border-bottom: 0;
}

.pg-panel:not([open]) summary::after {
  transform: rotate(-90deg);
}

.pg-panel summary small {
  color: var(--ink-3);
  font-weight: 400;
  font-size: 0.8rem;
}

.pg-panel-head h2 {
  margin: 0;
  font-size: 0.92rem;
}

.pg-output {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.status {
  padding: 1px 8px;
  border-radius: 5px;
  background: var(--mist);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 600;
}

.status[data-kind='ok'] {
  background: var(--tea-soft);
  color: var(--tea);
}

.status[data-kind='fail'] {
  background: var(--accent-soft);
  color: var(--danger);
}

.output {
  flex: 1;
  margin: 0;
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.9rem/1.75 var(--mono);
  color: var(--ink);
}

.placeholder {
  color: var(--ink-3);
  font-family: var(--font);
}

.stdin {
  display: block;
  width: 100%;
  min-height: 84px;
  padding: 12px 16px;
  border: 0;
  outline: none;
  resize: vertical;
  background: var(--surface);
  color: var(--ink);
  font: 0.9rem/1.6 var(--mono);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px 16px;
}

.chip {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--tok-kw);
  font: 600 0.84rem var(--mono);
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 920px) {
  .layout-playground main {
    height: auto;
  }

  .pg-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .pg-editor {
    height: 55vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pg-toolbar {
    position: sticky;
    top: var(--nav-h);
    z-index: 5;
    flex-wrap: wrap;
    background: var(--cotton);
  }

  .select select {
    max-width: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Last, because the `font` shorthand above resets ligature settings. Code must show exactly what
   to type: no ligatures (>= must not turn into ≥, --> must not become an arrow). */
code,
pre,
pre *,
textarea,
.output,
.install code {
  /* !important: more specific rules set the `font` shorthand, which resets these. */
  font-variant-ligatures: none !important;
  font-feature-settings:
    'liga' 0,
    'calt' 0 !important;
}
