/* silent's homepage: the app's warm paper and ink, light and dark. */

@font-face {
  font-family: "Literata";
  src: url("fonts/literata-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans";
  src: url("fonts/noto-sans-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f1e9;
  --bg-2: #efe8dc;
  --card: #fbf8f2;
  --ink: #2b2520;
  --ink-2: #4f453c;
  --muted: #6c6156;
  --rule: rgba(113, 102, 91, 0.24);
  --rule-strong: rgba(113, 102, 91, 0.45);
  --link: #a04a1f;
  --primary: #a84e22;
  --primary-hover: #93431b;
  --primary-ink: #fffaf3;
  --key-face: #fffcf7;
  --code-bg: #efe6d8;
  --shadow: 0 1px 2px rgba(70, 45, 25, 0.08), 0 22px 44px -22px rgba(70, 45, 25, 0.42);
  --shadow-soft: 0 1px 2px rgba(70, 45, 25, 0.06), 0 10px 24px -14px rgba(70, 45, 25, 0.3);
  --c-silent: #bf5f2b;
  --c-sushi: #7a4f8a;

  /* One type scale: 17 for reading, 15 for what supports it, 13 for the least. */
  --fs: 17px;
  --fs-s: 15px;
  --fs-xs: 13px;
  --font-display: "Literata", Georgia, serif;
  --font-text: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1120px;
  --gutter: 24px;
  --control: 44px;
  --radius-media: 14px;
  --radius-card: 18px;
  --section: 128px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1916;
    --bg-2: #221e1a;
    --card: #26211d;
    --ink: #ede5d9;
    --ink-2: #d2c7b9;
    --muted: #a99d8f;
    --rule: rgba(165, 153, 139, 0.22);
    --rule-strong: rgba(165, 153, 139, 0.42);
    --link: #eda877;
    --primary: #e39a63;
    --primary-hover: #eeab79;
    --primary-ink: #1c1916;
    --key-face: #342d27;
    --code-bg: #2a241f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 52px -22px rgba(0, 0, 0, 0.75);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 28px -16px rgba(0, 0, 0, 0.6);
    --c-silent: #d4703a;
    --c-sushi: #a578bd;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1916;
  --bg-2: #221e1a;
  --card: #26211d;
  --ink: #ede5d9;
  --ink-2: #d2c7b9;
  --muted: #a99d8f;
  --rule: rgba(165, 153, 139, 0.22);
  --rule-strong: rgba(165, 153, 139, 0.42);
  --link: #eda877;
  --primary: #e39a63;
  --primary-hover: #eeab79;
  --primary-ink: #1c1916;
  --key-face: #342d27;
  --code-bg: #2a241f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 52px -22px rgba(0, 0, 0, 0.75);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 28px -16px rgba(0, 0, 0, 0.6);
  --c-silent: #d4703a;
  --c-sushi: #a578bd;
  color-scheme: dark;
}

/* Media in the page's own theme: the other variant is hidden and, being
   lazy or never played, never loaded. */
.only-dark { display: none !important; }
:root[data-theme="dark"] .only-dark { display: block !important; }
:root[data-theme="dark"] .only-light { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block !important; }
  :root:not([data-theme="light"]) .only-light { display: none !important; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { margin: 0; color: var(--ink); text-wrap: balance; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.012em; }
h1 { font-size: clamp(42px, 6.2vw, 72px); line-height: 1.06; }
h2 { font-size: clamp(29px, 3.3vw, 39px); line-height: 1.16; }
h3 { font-size: 19px; font-weight: 650; line-height: 1.35; }
p, li, td, dd, figcaption { text-wrap: pretty; }
p { margin: 0; }
p + p { margin-top: 14px; }

code, kbd, pre { font-family: var(--font-mono); font-variant-ligatures: none; }
code { font-size: 0.875em; background: var(--code-bg); border-radius: 5px; padding: 0.12em 0.36em; white-space: nowrap; }
kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 0.06em 0.5em 0.02em;
  font-size: 0.84em;
  line-height: 1.5;
  text-align: center;
  color: var(--ink);
  background: var(--key-face);
  border: 1px solid var(--rule-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
}

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

.kicker {
  font-size: var(--fs-s);
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--link);
  margin-bottom: 12px;
}

/* The header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.top-row { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 23px;
  letter-spacing: -0.01em;
}
.brand img { width: 32px; height: 32px; }
.top-nav { display: flex; gap: 26px; margin-left: auto; }
.top-nav a { color: var(--ink-2); text-decoration: none; font-size: var(--fs-s); font-weight: 500; }
.top-nav a:hover { color: var(--ink); }
.top-actions { display: flex; gap: 8px; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: var(--control);
  height: var(--control);
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-button:hover { background: var(--bg-2); color: var(--ink); }
.icon-button svg { width: 21px; height: 21px; fill: currentColor; }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .when-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .when-light { display: none; }
:root[data-theme="dark"] .theme-toggle .when-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .when-light { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .when-dark { display: block; }
}

/* The hero */
.hero { padding: 80px 0 0; }
.hero-text { text-align: center; max-width: 820px; }
.hero-icon {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto 26px;
  /* The icon's night blue and acid green, as a glow about it only. */
  filter: drop-shadow(0 14px 22px rgba(15, 19, 41, 0.32)) drop-shadow(0 0 30px rgba(170, 214, 54, 0.16));
}
.hero .kicker { margin-bottom: 16px; }
.lede { margin: 24px auto 0; max-width: 640px; font-size: 19px; line-height: 1.6; color: var(--ink-2); }
.actions { display: flex; justify-content: center; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control);
  padding: 0 22px;
  border-radius: 10px;
  font-size: var(--fs-s);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--rule);
  background: var(--card);
}
.button:hover { text-decoration: none; border-color: var(--rule-strong); }
.button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.hero-media { margin-top: 56px; }
figcaption, .caption {
  margin-top: 14px;
  font-size: var(--fs-s);
  color: var(--muted);
}
.hero-media figcaption { text-align: center; }

/* Media frames: a clip or a still, as wide as the column. */
figure { margin: 0; }
/* A picture of separate windows with space between: the shadow follows each. */
.cutout img { width: 100%; height: auto; filter: drop-shadow(0 14px 22px rgba(70, 45, 25, 0.28)); }
:root[data-theme="dark"] .cutout img { filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.55)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cutout img { filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.55)); }
}
.frame {
  position: relative;
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: var(--shadow);
}
.frame video, .frame img { width: 100%; height: auto; }

/* The four points */
.points {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-top: 96px;
  padding-top: 36px;
  border-top: 1px solid var(--rule);
}
.point h2 { font-family: var(--font-text); font-size: var(--fs); font-weight: 650; letter-spacing: 0; line-height: 1.35; }
.point h2 a { color: var(--ink); text-decoration: none; }
.point h2 a:hover { text-decoration: underline; text-decoration-color: var(--rule-strong); }
.point p { margin-top: 6px; font-size: var(--fs-s); line-height: 1.55; color: var(--ink-2); }

/* A feature: its words in two columns, then its picture across the page. */
.feature { margin-top: var(--section); }
.feature-head {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 24px 56px;
  align-items: start;
  margin-bottom: 36px;
}
.feature-head h2 { margin-top: 2px; }
.feature-head .kicker { margin-bottom: 10px; }
.feature-text p { color: var(--ink-2); }
.feature-text .more { margin-top: 14px; font-size: var(--fs-s); }
.keyrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.keyrow kbd { font-size: var(--fs-s); min-width: 34px; }

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

/* The benchmark */
.chart { padding: 26px 30px 20px; margin-top: 36px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 26px; list-style: none; margin: 0 0 18px; padding: 0; font-size: var(--fs-s); color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 9px; }
.legend .legend-unit { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); }
.swatch { width: 12px; height: 12px; border-radius: 3px; }
.s-silent { background: var(--c-silent); }
.s-sushi { background: var(--c-sushi); }
.chart-grid { display: grid; grid-template-columns: 180px 1fr 1fr; column-gap: 32px; }
.chart-head { font-size: var(--fs-s); font-weight: 650; color: var(--ink); padding-bottom: 10px; }
.chart-label { font-size: var(--fs-s); color: var(--ink); line-height: 1.3; padding: 8px 0; border-top: 1px solid var(--rule); display: flex; align-items: center; }
.chart-cell { position: relative; padding: 9px 44px 9px 0; border-top: 1px solid var(--rule); display: grid; gap: 3px; align-content: center; }
.bar { height: 9px; border-radius: 0 3px 3px 0; min-width: 2px; position: relative; }
.bar.silent { background: var(--c-silent); }
.bar.sushi { background: var(--c-sushi); }
.bar-value { position: absolute; left: calc(100% + 6px); top: 50%; transform: translateY(-50%); font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1; }
.bar-missing { font-size: var(--fs-xs); color: var(--muted); line-height: 9px; white-space: nowrap; }
.chart-axis { position: relative; height: 24px; margin-right: 44px; border-top: 1px solid var(--rule-strong); font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-axis span { position: absolute; top: 5px; transform: translateX(-50%); white-space: nowrap; }
.chart-axis span:first-child { transform: none; }
.chart-table { margin-top: 16px; font-size: var(--fs-s); overflow-x: auto; }
.chart-table summary { cursor: pointer; color: var(--link); width: fit-content; }
.chart-table table { margin-top: 14px; }
.chart-table td:not(:first-child), .chart-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
th { text-align: left; font-weight: 650; color: var(--ink); padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule-strong); }
td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); vertical-align: top; }
tbody th { font-weight: 500; border-bottom: 1px solid var(--rule); }

/* Formats */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 28px; }
.tile img { width: 100%; border-radius: 12px; }
.tile figcaption { margin-top: 10px; font-size: var(--fs-s); font-weight: 600; color: var(--ink); }
.tile figcaption span { font-weight: 400; color: var(--muted); }

/* File managers */
.fm-table td:first-child { color: var(--ink); font-weight: 600; }
.fm-table .untested td { color: var(--muted); }
.fm-table kbd { font-size: var(--fs-xs); }
.status { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.split { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: start; margin-top: 36px; }

/* From the terminal */
.verbs td:first-child { white-space: nowrap; }

/* Built with */
.stack { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; margin: 36px 0 0; border-top: 1px solid var(--rule-strong); }
.stack div { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.stack dt { font-weight: 650; }
.stack dt a { color: var(--ink); text-decoration-color: var(--rule-strong); }
.stack dd { margin: 0; color: var(--ink-2); font-size: var(--fs-s); }

/* Install */
.install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 36px; }
.install-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
.install-item { padding: 24px 28px 26px; }
.install-item header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.install-item p { margin-top: 14px; color: var(--ink-2); font-size: var(--fs-s); }
.needs { margin: 24px 0 0; color: var(--ink-2); font-size: var(--fs-s); }
.needs ul { margin: 6px 0 14px; padding: 0 0 0 20px; }
.needs li + li { margin-top: 4px; }
.code pre {
  margin: 0;
  padding: 16px 18px;
  background: var(--code-bg);
  border-radius: 12px;
  overflow-x: auto;
  font-size: var(--fs-xs);
  line-height: 1.7;
}
.code pre code { background: none; padding: 0; font-size: inherit; white-space: pre; }
.copy {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--card);
  color: var(--ink-2);
  font: 600 var(--fs-xs)/1 var(--font-text);
  cursor: pointer;
}
.copy:hover { color: var(--ink); border-color: var(--rule-strong); }

.section-head { max-width: 760px; }
.section-head h2 { margin-bottom: 18px; }
.section-head p:not(.kicker) { color: var(--ink-2); }
.note { margin-top: 18px; font-size: var(--fs-s); color: var(--muted); }

/* Grid items may shrink below their longest line; code blocks scroll instead. */
.feature-head > *, .split > *, .install-grid > *, .tiles > *, .stack > * { min-width: 0; }

/* The footer */
.foot { margin-top: var(--section); border-top: 1px solid var(--rule); padding: 36px 0 48px; }
.foot-row { font-size: var(--fs-s); color: var(--muted); }
.foot-row a { color: var(--ink-2); }
.credits { margin-top: 10px; font-size: var(--fs-xs); }

/* Narrower screens */
@media (max-width: 1000px) {
  :root { --section: 100px; }
  .top-nav { display: none; }
  .top-actions { margin-left: auto; }
  .feature-head, .split { grid-template-columns: 1fr; gap: 16px; }
  .points { grid-template-columns: repeat(2, 1fr); gap: 28px 32px; }
  .stack { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 140px 1fr 1fr; column-gap: 20px; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; --section: 80px; }
  body { font-size: 16.5px; }
  .hero { padding-top: 48px; }
  .hero-text { text-align: left; }
  .hero-icon { width: 88px; height: 88px; margin: 0 0 20px; }
  .lede { font-size: 18px; margin-left: 0; }
  .actions { justify-content: flex-start; }
  .hero-media { margin-top: 40px; }
  .hero-media figcaption { text-align: left; }
  .frame { border-radius: 10px; }
  .points { grid-template-columns: 1fr; margin-top: 64px; }
  .tiles, .install-grid { grid-template-columns: 1fr; }
  .tiles { gap: 28px; }
  .chart { padding: 18px 16px 14px; }
  .chart-grid { grid-template-columns: 1fr 1fr; column-gap: 14px; }
  .chart-grid .chart-label { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-bottom: 2px; }
  .chart-grid .chart-cell { border-top: 0; padding-top: 2px; padding-right: 34px; }
  .chart-grid .chart-corner { display: none; }
  .chart-axis { margin-right: 34px; }
  .chart-axis span:nth-child(even) { display: none; }
  .legend .legend-unit { margin-left: 0; flex-basis: 100%; }
  .keyrow { gap: 6px; }
  .keyrow kbd { min-width: 30px; }
  .fm-table td:last-child { white-space: nowrap; }
  .stack div { grid-template-columns: 1fr; gap: 2px; }
  .install-item { padding: 20px 18px 22px; }
  .code pre { padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .code pre code { white-space: pre-wrap; }
  .verbs td:first-child { white-space: normal; }
  /* Long inline code in running text, as the xmonad rule, wraps rather than
     widening the page; commands in tables stay whole. */
  .needs code, .install-item p code { white-space: normal; overflow-wrap: anywhere; }
}
