/* Akashlipi. Palette from the app icon's night sky and amber sweep, set on the pale
   green-grey of an aeronautical chart. Flight progress strips carry the colour. */

@font-face { font-family: "Archivo"; src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("fonts/source-serif-4.woff2") format("woff2");
  font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Tiro Devanagari"; src: url("fonts/tiro-devanagari.woff2") format("woff2");
  font-display: swap; }

:root {
  --paper: #eef0eb;
  --band: #e3e7df;
  --ink: #172338;
  --ink-2: #4a5667;
  --rule: #c5cbc1;
  --amber: #b06c12;
  --amber-hi: #e8a33d;
  --code: #dfe4db;
  --buff: #ecdcab;
  --blue: #c5d9ec;
  --slip: #f7f6f1;
  --strip-ink: #1b2232;
  --strip-edge: rgba(23, 35, 56, .28);
  --rail: #1b2433;
  --sans: "Archivo", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", "DejaVu Sans Mono", Menlo, monospace;
  --deva: "Tiro Devanagari", "Noto Serif Devanagari", serif;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131c2a; --band: #182334; --ink: #e7e9e3; --ink-2: #a4aebb; --rule: #2d3b50;
    --amber: #e8a33d; --code: #1f2c40; --rail: #0b111b; --strip-edge: rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131c2a; --band: #182334; --ink: #e7e9e3; --ink-2: #a4aebb; --rule: #2d3b50;
  --amber: #e8a33d; --code: #1f2c40; --rail: #0b111b; --strip-edge: rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--serif);
  font-optical-sizing: auto;
  overflow-x: hidden;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--amber-hi); outline-offset: 2px; border-radius: 2px; }
code { font: .88em/1.4 var(--mono); background: var(--code); padding: .1em .35em; border-radius: 3px; }
pre { background: var(--code); padding: 1rem 1.1rem; overflow-x: auto; border-radius: 4px; }
pre code { padding: 0; background: none; font-size: .86rem; line-height: 1.55; }
img { max-width: 100%; }
.deva { font-family: var(--deva); font-weight: 400; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--ink); color: var(--paper); padding: .5rem .8rem; z-index: 9; }

/* masthead */
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem var(--gutter); font-family: var(--sans);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none;
  font-weight: 700; font-stretch: 112%; font-size: 1.1rem; }
.masthead ul { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; margin: 0; padding: 0; list-style: none; }
.masthead nav a { text-decoration: none; font-size: .98rem; padding: .2rem 0; border-bottom: 2px solid transparent; }
.masthead nav a:hover { border-color: var(--rule); }
.masthead nav a[aria-current="page"] { border-color: var(--amber); }

/* buttons */
.button {
  display: inline-block; font: 600 1rem/1.2 var(--sans); text-decoration: none;
  background: var(--ink); color: var(--paper); padding: .8rem 1.2rem; border-radius: 4px;
  border: 1.5px solid var(--ink);
}
.button:hover { background: transparent; color: var(--ink); }
.button.quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.button.quiet:hover { border-color: var(--ink); }

/* ---------- home ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 5rem);
  align-items: center; padding: clamp(2.5rem, 7vw, 6rem) var(--gutter) clamp(3rem, 6vw, 5rem);
  max-width: 1320px; margin: 0 auto;
}
.wordmark { margin: 0 0 1.4rem; line-height: .95; font-family: var(--sans); }
.wordmark .latin { display: block; font-weight: 800; font-stretch: 125%;
  font-size: clamp(2.9rem, 7.2vw, 5.6rem); letter-spacing: -.015em; }
.wordmark .deva { display: block; color: var(--amber); font-size: clamp(1.9rem, 4.2vw, 3.1rem);
  margin-top: .35em; line-height: 1.2; }
.lede { font-size: clamp(1.15rem, 1.8vw, 1.35rem); line-height: 1.5; max-width: 34ch; margin: 0 0 1.8rem; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 0 0 1.2rem; }
.fine { font: 400 .92rem/1.5 var(--sans); color: var(--ink-2); max-width: 46ch; margin: 0; }

/* the strip bay */
.bay { margin: 0; }
.strips {
  list-style: none; margin: 0; padding: 14px 12px 14px 22px; display: grid; gap: 7px;
  background: var(--rail); border-radius: 6px;
  box-shadow: inset 6px 0 0 rgba(255, 255, 255, .06);
}
.strip {
  display: grid; grid-template-columns: 7.2em 5.6em minmax(0, 1fr) 6.2em 3.4em;
  font-family: var(--sans); font-stretch: 78%; color: var(--strip-ink);
  font-size: clamp(.82rem, 1.25vw, 1rem); line-height: 1.2;
  background: var(--buff); border-radius: 2px; min-height: 3.6em;
  box-shadow: 0 1px 0 var(--strip-edge), 0 2px 5px rgba(0, 0, 0, .25);
  position: relative;
}
.strip.blue { background: var(--blue); }
.strip.msg { background: var(--slip); grid-template-columns: 7.2em minmax(0, 1fr) 3.4em; }
.strip .c { padding: .45em .6em; display: flex; flex-direction: column; justify-content: center; gap: .1em;
  border-left: 1px solid rgba(27, 34, 50, .35); min-width: 0; }
.strip .c:first-child { border-left: 0; }
.strip .c span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .c b { font-weight: 700; font-size: 1.22em; font-stretch: 85%; letter-spacing: .01em; }
.strip .lv b { font-variant-numeric: tabular-nums; }
.strip .tm { font-variant-numeric: tabular-nums; align-items: flex-end; }
.strip .say { font-family: var(--serif); font-size: .95em; line-height: 1.35; font-stretch: 100%; }
.bay figcaption { font: 400 .85rem/1.45 var(--sans); color: var(--ink-2); margin-top: .7rem; }

@media (prefers-reduced-motion: no-preference) {
  .strips .strip { animation: slot .55s cubic-bezier(.2, .7, .2, 1) both; }
  .strips .strip:nth-child(2) { animation-delay: .12s; }
  .strips .strip:nth-child(3) { animation-delay: .24s; }
  .strips .strip:nth-child(4) { animation-delay: .5s; }
  @keyframes slot { from { transform: translateX(110%); opacity: 0; } to { transform: none; opacity: 1; } }
  .strips { overflow: hidden; }
}

/* sections */
.home main > section { padding: clamp(3rem, 6vw, 5rem) var(--gutter); }
.home .band { background: var(--band); }
.narrow { max-width: 46rem; margin: 0 auto; }
.home h2, .prose h2 {
  font: 700 clamp(1.55rem, 2.6vw, 2.05rem)/1.15 var(--sans); font-stretch: 108%;
  margin: 0 0 1rem; letter-spacing: -.005em;
}
.home h3 { font: 650 1.12rem/1.3 var(--sans); margin: 0 0 .25rem; }
.home p { max-width: 68ch; }

/* anatomy */
.anatomy .strip.big {
  max-width: 1120px; margin: 2.2rem auto 0; font-size: clamp(.85rem, 1.25vw, 1.05rem);
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.anatomy .strip.big .c { padding: .6em .75em; }
.sources {
  max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 0;
}
.sources > div { padding: 1rem .75em 0; border-left: 1px solid var(--rule); position: relative; }
.sources > div::before { content: ""; position: absolute; left: -1px; top: 0; height: .9rem; border-left: 2px solid var(--amber); }
.sources dt { font: 650 .95rem/1.25 var(--sans); margin-bottom: .35rem; }
.sources dd { margin: 0; font-size: .92rem; line-height: 1.5; color: var(--ink-2); }

/* needs / more */
.needs, .more { margin: 1.5rem 0; }
.needs > div, .more > div { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: .3rem 1.5rem;
  padding: .9rem 0; border-top: 1px solid var(--rule); }
.needs > div:last-child, .more > div:last-child { border-bottom: 1px solid var(--rule); }
.needs dt, .more dt { font: 650 1rem/1.4 var(--sans); }
.needs dd, .more dd { margin: 0; }

/* steps: a real sequence, so numbered */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 1.6rem 0 1.4rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 3.2rem minmax(0, 1fr);
  padding: .4rem 0 1.1rem; }
.steps li::before { content: counter(s); grid-row: span 2; font: 800 2.4rem/1 var(--sans); font-stretch: 70%;
  color: var(--amber); }
.steps p { margin: 0; }

.name .deva { font-size: 1.15em; }

/* ---------- inner pages ---------- */
.doc { max-width: 1180px; margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) 4rem; }
.doc.has-toc { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); gap: 3.5rem; }
.toc { position: sticky; top: 1.5rem; align-self: start; font-family: var(--sans); font-size: .9rem; }
.toc p { font-weight: 650; margin: .4rem 0 .6rem; color: var(--ink-2); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc a { display: block; padding: .28rem 0 .28rem .85rem; text-decoration: none; color: var(--ink-2); }
.toc a:hover { color: var(--ink); }
.prose { max-width: 44rem; min-width: 0; }
.prose h1 { font: 800 clamp(2rem, 4.4vw, 3rem)/1.05 var(--sans); font-stretch: 118%; margin: 0 0 1.4rem;
  letter-spacing: -.01em; }
.prose h2 { margin-top: 2.8rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); scroll-margin-top: 1rem; }
.prose h3 { font: 650 1.15rem/1.35 var(--sans); margin: 2rem 0 .4rem; scroll-margin-top: 1rem; }
.prose p, .prose li { max-width: 68ch; }
.prose li { margin: .3rem 0; }
.prose ol, .prose ul { padding-left: 1.3rem; }
.table { overflow-x: auto; margin: 1.2rem 0; }
.prose table { border-collapse: collapse; font: 400 .93rem/1.45 var(--sans); width: 100%; min-width: 30rem; }
.prose th { text-align: left; font-weight: 650; border-bottom: 2px solid var(--ink); padding: .45rem .7rem .45rem 0; }
.prose td { border-bottom: 1px solid var(--rule); padding: .55rem .7rem .55rem 0; vertical-align: top; }
.prose td code { white-space: nowrap; }

/* downloads */
.downloads { margin: 2rem 0 2.4rem; border-top: 2px solid var(--ink); }
.dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem 1.5rem; align-items: center;
  padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.dl p { margin: 0; }
.dl-sys { font: 650 1.02rem/1.3 var(--sans); }
.dl-cpu { font: 400 .9rem/1.4 var(--sans); color: var(--ink-2); }
.dl .button { font-size: .88rem; font-stretch: 88%; padding: .65rem .95rem; overflow-wrap: anywhere; text-align: center; }
.dl-cmd { grid-column: 1 / -1; font: 400 .88rem/1.5 var(--sans); color: var(--ink-2); }
.dl-cmd code { overflow-wrap: anywhere; }

/* footer */
.foot { border-top: 1px solid var(--rule); padding: 2rem var(--gutter) 2.6rem; font: 400 .88rem/1.55 var(--sans);
  color: var(--ink-2); }
.foot p { max-width: 72ch; margin: .2rem 0 .6rem; }
.foot p:last-child { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin-top: 1rem; }
.foot .deva { color: var(--amber); font-size: 1.1em; margin-right: .3rem; }

/* ---------- narrower screens ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .doc.has-toc { display: block; }
  .toc { position: static; margin-bottom: 2rem; }
  .toc ol { columns: 2; column-gap: 1.5rem; }
  .anatomy .strip.big, .sources { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .anatomy .strip.big .c:nth-child(4) { border-left: 0; }
  .anatomy .strip.big .c:nth-child(n+4) { border-top: 1px solid rgba(27, 34, 50, .35); }
  .sources > div { padding-bottom: 1.2rem; }
}
@media (max-width: 640px) {
  .strip { grid-template-columns: 6.4em minmax(0, 1fr) 5.9em; font-size: .86rem; }
  .strip .ac, .strip .tm { display: none; }
  .strip.msg { grid-template-columns: 6.4em minmax(0, 1fr); }
  .strips { padding-left: 14px; }
  .anatomy .strip.big, .sources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .anatomy .strip.big .c:nth-child(4) { border-left: 1px solid rgba(27, 34, 50, .35); }
  .anatomy .strip.big .c:nth-child(odd) { border-left: 0; }
  .anatomy .strip.big .c:nth-child(n+3) { border-top: 1px solid rgba(27, 34, 50, .35); }
  .needs > div, .more > div { grid-template-columns: minmax(0, 1fr); }
  .toc ol { columns: 1; }
  .dl { grid-template-columns: minmax(0, 1fr); }
  .dl .button { justify-self: start; }
}
