/* Tilde landing page. Card Catalog world: palette tokens copied from src/styles/themes.css. */

@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/hanken-grotesk-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --bg: #282a36;
  --rail: #21222c;
  --raised: #313343;
  --line: #3e4052;
  --text: #f8f8f2;
  --muted: #a9adc8;
  --accent: #bd93f9;
  --link: #8be9fd;
  --issue: #ffb86c;
  --pr: #50fa7b;

  --sans: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: 118px;
  --page: min(1200px, 100% - 48px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* The palette tabs re-point the whole page, like the extension's theme switch. */
:root:has(input[value="material-light"]:checked) {
  color-scheme: light;
  --bg: #fafafa;
  --rail: #f0f0ef;
  --raised: #ececeb;
  --line: #dcdcdb;
  --text: #2b2f33;
  --muted: #5f6368;
  --accent: #6232e8;
  --link: #1f6f76;
  --issue: #985000;
  --pr: #3f6f12;
}
:root:has(input[value="nord"]:checked) {
  --bg: #2e3440;
  --rail: #272c36;
  --raised: #353c4a;
  --line: #444c5e;
  --text: #eceff4;
  --muted: #aeb6c6;
  --accent: #88c0d0;
  --link: #8fbcbb;
  --issue: #e09c86;
  --pr: #a3be8c;
}
:root:has(input[value="relaxed"]:checked) {
  --bg: #2e333b;
  --rail: #272b32;
  --raised: #363b45;
  --line: #424854;
  --text: #d9d9d9;
  --muted: #a6a6a6;
  --accent: #ebc17a;
  --link: #7eaac7;
  --issue: #e2a96d;
  --pr: #a9b874;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px / 1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.35s var(--ease),
    color 0.35s var(--ease);
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: var(--link);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

kbd {
  font: 500 0.8em var(--mono);
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--raised);
  color: var(--text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  padding: 8px 12px;
  background: var(--raised);
  z-index: 10;
}
.skip:focus {
  top: 12px;
}

.tilde {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
}

/* Top bar: the cabinet colour, one hairline under it. */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px max(24px, (100% - 1200px) / 2);
  background: var(--rail);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.35s var(--ease);
}
.mark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.mark .tilde {
  font-size: 22px;
}
.top nav {
  display: flex;
  gap: 22px;
  margin-right: auto;
}
.top nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
}
.top nav a:hover {
  color: var(--text);
}

/* The single primary action. */
.cta {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 650;
  text-decoration: none;
  transition: filter 0.2s var(--ease);
}
.cta:hover {
  filter: brightness(1.08);
}
.cta[hidden],
.pending[hidden] {
  display: none;
}
.cta-small {
  padding: 7px 14px;
  font-size: 14px;
}

.pending {
  font-weight: 600;
  color: var(--text);
}
.fine {
  color: var(--muted);
  font-size: 14.5px;
}

main {
  width: var(--page);
  margin-inline: auto;
}

/* Hero */
.hero {
  padding: clamp(56px, 10vw, 112px) 0 clamp(36px, 5vw, 56px);
  max-width: 880px;
}
.hero h1 {
  font-size: clamp(40px, 6.4vw, 76px);
  line-height: 1.02;
  font-weight: 750;
  letter-spacing: -0.035em;
}
.lede {
  margin-top: 24px;
  max-width: 62ch;
  font-size: clamp(17px, 1.6vw, 19.5px);
  color: var(--muted);
}
.actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}

/* Showcase: index tabs, a full hairline border open at the bottom, sitting on the frame. */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0 0 0 12px;
  border: 0;
}
.tabs label {
  padding: 7px 14px 8px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition:
    color 0.2s var(--ease),
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.tabs label:hover {
  color: var(--text);
  background: var(--raised);
}
.tabs input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tabs label:has(:checked) {
  color: var(--text);
  background: var(--rail);
  border-color: var(--accent);
  font-weight: 600;
}
.tabs label:has(:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.frame {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--rail);
}
.shot {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.shot-dracula,
:root:has(input[value="material-light"]:checked) .shot-material-light,
:root:has(input[value="nord"]:checked) .shot-nord,
:root:has(input[value="relaxed"]:checked) .shot-relaxed {
  opacity: 1;
}
:root:has(input[name="palette"]:not([value="dracula"]):checked) .shot-dracula {
  opacity: 0;
}

/* Sections */
.block {
  padding-top: clamp(72px, 10vw, 128px);
}
.block-head {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 16px 48px;
  align-items: end;
  padding-bottom: 28px;
}
.block-head h2 {
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.block-head p {
  color: var(--muted);
  max-width: 60ch;
}

/* The catalog: call-number gutter, title beside it, hairline rules. Two columns tile on a hairline. */
.catalog {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.catalog li {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  gap: 14px;
  padding: 20px 24px 22px 0;
  border-bottom: 1px solid var(--line);
}
.catalog li:nth-child(even) {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.cn {
  padding-top: 3px;
  font: 500 12px / 1.5 var(--mono);
  color: var(--muted);
}
.cn kbd {
  font-size: 11.5px;
}
.catalog h3 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.catalog p {
  margin-top: 4px;
  color: var(--muted);
  max-width: 54ch;
}
.catalog em {
  font-style: normal;
  color: var(--text);
}

/* Two more screens, side by side. */
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-top: clamp(56px, 7vw, 88px);
}
.pair figure {
  margin: 0;
}
.pair img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.pair figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14.5px;
}

.closing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-top: clamp(80px, 11vw, 140px);
  padding: 40px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.closing h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.foot {
  width: var(--page);
  margin: 0 auto;
  padding: 28px 0 48px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  color: var(--muted);
  font-size: 14px;
}
.foot a {
  color: inherit;
}
.foot a:hover {
  color: var(--text);
}

@media (max-width: 860px) {
  .block-head,
  .catalog,
  .pair {
    grid-template-columns: minmax(0, 1fr);
  }
  .catalog li:nth-child(even) {
    padding-left: 0;
    border-left: 0;
  }
  .top nav {
    display: none;
  }
  .top {
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  :root {
    --gutter: 88px;
  }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-left: 0;
  }
  .tabs label {
    flex: none;
    padding-inline: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    /* biome-ignore lint/complexity/noImportantStyles: reduced motion must beat every component transition */
    transition: none !important;
  }
}

/* Privacy policy: a reading page in the same world. */
.doc {
  width: min(760px, 100% - 48px);
  padding: clamp(48px, 8vw, 96px) 0 clamp(64px, 9vw, 112px);
}
.doc h1 {
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1.05;
  font-weight: 750;
  letter-spacing: -0.035em;
}
.doc .updated {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14.5px;
}
.doc h2 {
  margin: 48px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.doc > p {
  margin-top: 14px;
  max-width: 68ch;
}
.doc .updated + p {
  margin-top: 28px;
  font-size: 18px;
  color: var(--muted);
}
.doc ul {
  margin: 0;
  padding-left: 20px;
  max-width: 68ch;
}
.doc li + li {
  margin-top: 10px;
}
.doc li::marker {
  color: var(--muted);
}
.doc code {
  font: 500 0.86em var(--mono);
  color: var(--text);
}
.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.doc th,
.doc td {
  padding: 10px 16px 10px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.doc th {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.doc td:first-child {
  white-space: nowrap;
}
.top nav a[aria-current="page"] {
  color: var(--text);
}

@media (max-width: 600px) {
  .doc thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .doc tr {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .doc td {
    display: block;
    padding: 0;
    border: 0;
  }
  .doc td + td {
    margin-top: 2px;
    color: var(--muted);
  }
  .doc td:first-child {
    margin-bottom: 4px;
    color: var(--text);
  }
  .doc td:nth-child(2)::before {
    content: "When: ";
    color: var(--text);
    font-weight: 600;
  }
  .doc td:nth-child(3)::before {
    content: "Sends: ";
    color: var(--text);
    font-weight: 600;
  }
}

/* Secondary hero action: opens the live command palette. */
.try {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: 600 15px / 1.2 var(--sans);
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.try:hover {
  background: var(--raised);
  border-color: var(--muted);
}
.try kbd:first-of-type {
  margin-left: 4px;
}
.hero .fine {
  margin-top: 14px;
}

/* Live demo: a slice of the new tab. Rail is the cabinet; drawers fill the ground. */
.demo {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
}
.demo-rail {
  display: flex;
  flex-direction: column;
  background: var(--rail);
  border-right: 1px solid var(--line);
}
.demo-mark {
  padding: 18px 22px 14px;
  font-size: 22px;
  line-height: 1;
}
.demo-tabs {
  display: flex;
  flex-direction: column;
}
.demo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 22px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: 500 14.5px / 1.3 var(--sans);
  text-align: left;
  cursor: pointer;
  transition:
    color 0.15s var(--ease),
    background-color 0.15s var(--ease);
}
.demo-tabs .demo-row:last-child {
  border-bottom: 1px solid var(--line);
}
.demo-row:hover {
  color: var(--text);
  background: var(--raised);
}
.demo-row[aria-selected="true"] {
  color: var(--text);
  background: var(--bg);
}
.demo-row[aria-selected="true"] kbd {
  border-color: var(--accent);
  color: var(--accent);
}
.demo-row:focus-visible {
  outline-offset: -2px;
}
.demo-panels {
  min-width: 0;
}
.demo-panel {
  padding: 20px 24px 24px;
  animation: panel-in 0.32s var(--ease);
}
@keyframes panel-in {
  from {
    opacity: 0;
    translate: 0 6px;
  }
}
.demo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.demo-head h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.src {
  font: 500 11.5px / 1.5 var(--mono);
  color: var(--muted);
}
.gist-name {
  padding: 14px 0 8px;
  font: 500 13px / 1.5 var(--mono);
  color: var(--muted);
}
.gist {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--rail);
  font: 400 13px / 1.7 var(--mono);
  color: var(--text);
  tab-size: 2;
}
.gist .k {
  color: var(--link);
}
.gist .c {
  color: var(--muted);
}
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rows li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.rows small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 400;
}
.pad {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--raised);
  color: var(--text);
  font: 400 15px / 1.6 var(--sans);
  resize: vertical;
  caret-color: var(--accent);
}
.pad:focus-visible {
  outline-offset: 0;
}

/* Command palette: drops in place from just above, as in the extension. */
.palette {
  width: min(640px, 100vw - 32px);
  max-height: 76vh;
  margin: 12vh auto 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 18px 48px rgb(0 0 0 / 0.34);
}
.palette[open] {
  display: flex;
  flex-direction: column;
  animation: palette-in 0.18s var(--ease);
}
.palette:modal {
  overscroll-behavior: contain;
}
.palette::backdrop {
  background: rgb(0 0 0 / 0.38);
  overflow: hidden;
  overscroll-behavior: contain;
}
.palette[open]::backdrop {
  animation: backdrop-in 0.18s ease-out;
}
@keyframes palette-in {
  from {
    opacity: 0;
    translate: 0 -8px;
  }
}
@keyframes backdrop-in {
  from {
    opacity: 0;
  }
}
.palette-input {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.palette-input input {
  flex: 1;
  min-width: 0;
  height: 56px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 400 17px var(--sans);
  caret-color: var(--accent);
}
.palette-input input::placeholder {
  color: var(--muted);
}
.palette-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 0;
}
.palette-group {
  padding: 10px 20px 4px;
  font: 500 11px / 1.5 var(--mono);
  color: var(--muted);
}
.palette-option {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  padding: 8px 20px;
  cursor: pointer;
}
.palette-option .cn {
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cn.issue {
  color: var(--issue);
}
.cn.pr {
  color: var(--pr);
}
.palette-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.palette-title small {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 400;
}
.palette-option[aria-selected="true"] {
  background: var(--raised);
}
.palette-option[aria-selected="true"] .palette-title {
  color: var(--link);
}
.palette-empty:not(:empty) {
  padding: 20px;
  color: var(--muted);
}
.palette-foot {
  display: flex;
  gap: 20px;
  padding: 8px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

/* Toast: one status line, bottom centre. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: min(560px, 100vw - 32px);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--rail);
  color: var(--text);
  font-size: 14.5px;
  translate: -50% 12px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s var(--ease),
    translate 0.25s var(--ease);
}
.toast.show {
  opacity: 1;
  translate: -50% 0;
}

@media (max-width: 720px) {
  .demo {
    grid-template-columns: minmax(0, 1fr);
  }
  .demo-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .demo-mark {
    display: none;
  }
  .demo-tabs {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .demo-tabs .demo-row {
    flex: none;
    width: auto;
    border-bottom: 0;
    padding-inline: 16px;
  }
  .demo-tabs .demo-row:last-child {
    border-bottom: 0;
  }
  .demo-row kbd {
    display: none;
  }
  .palette-foot {
    display: none;
  }
  .palette-option {
    grid-template-columns: 84px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-panel,
  .palette[open],
  .palette[open]::backdrop {
    animation: none;
  }
}
