/* asolens.danielhan.dev -- shared by the landing page, the guide and the 404 page.
   Family: danielhan-website-design, sections 1-7. The one accent (--spot) marks the
   queried word in the autocomplete object and nothing else. */

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/barlow-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/barlow-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/barlow-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/barlow-latin-600-normal.woff2") format("woff2");
}

:root {
  /* The shared token table, by name and value. */
  --bg: #0c0c0e;
  --surface: #161618;
  --surface-raised: #1e1e22;
  --border: #2a2a30;
  --border-light: #38383f;
  --text: #e2e2e6;
  --text-muted: #9a9aa8;
  --text-dim: #636370; /* a floor; never used for text here (fails 4.5:1 on --bg) */
  --accent: #a8b0be;
  --accent-bright: #c8d0de;

  /* This site's one accent: the hosted report's dark spot colour. */
  --spot: #8cbaf0;

  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: 16px;
  --measure: 46rem;

  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--border-light) var(--bg);
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 90% at 50% 0%, #17181c 0%, #0c0c0e 55%, #060607 100%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  caret-color: var(--accent-bright);
  overflow-wrap: break-word;
}

::selection {
  background: rgba(168, 176, 190, 0.3);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 999px;
  border: 2px solid var(--bg);
}

a {
  color: var(--accent-bright);
  text-decoration: underline;
  text-decoration-color: rgba(200, 208, 222, 0.35);
  text-underline-offset: 0.18em;
  transition: color 0.18s, text-decoration-color 0.18s;
}
a:hover {
  color: #fff;
  text-decoration-color: currentColor;
}

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

code,
pre,
kbd {
  font-family: var(--mono);
  font-size: 0.875em;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 20;
  padding: 8px 14px;
  background: var(--surface-raised);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--border);
}
.skip:focus {
  top: 10px;
}

/* ---------- Chrome: dark glass top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(12, 12, 14, 0.86);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}
.wordmark span {
  color: var(--accent);
}
.topbar nav {
  display: flex;
  gap: 8px;
}
.topbar nav a {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: box-shadow 0.18s, color 0.18s;
}
.topbar nav a:hover {
  box-shadow: inset 0 0 0 1px var(--border-light);
}
.topbar nav a[aria-current="page"] {
  color: var(--accent-bright);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ---------- Page frame ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
}
.footer-inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 20px var(--gutter) 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.footer a {
  color: var(--text-muted);
}
.footer a:hover {
  color: var(--text);
}
.footer .credit {
  margin-left: auto;
}

/* ---------- Landing: hero ---------- */

.hero {
  padding: 72px 0 40px;
  max-width: 44rem;
}
.eyebrow {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.display {
  /* The one display size. */
  margin: 0 0 18px;
  font-size: clamp(2rem, 1.2rem + 3.6vw, 3.1rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.lead {
  margin: 0 0 28px;
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 40rem;
}

.install {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  background: var(--surface-raised);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--border);
  max-width: 40rem;
}
.install pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}
.install pre::before {
  content: "$ ";
  color: var(--text-muted);
  user-select: none;
}
.copy {
  flex: none;
  align-self: center;
  height: 38px;
  min-width: 82px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px var(--border-light);
  color: var(--text);
  font: 500 0.95rem var(--font);
  cursor: pointer;
  transition: box-shadow 0.18s, color 0.18s;
}
.copy:hover {
  box-shadow: inset 0 0 0 1px var(--accent);
}
.copy[data-state="done"] {
  color: var(--accent-bright);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.install-link {
  margin: 6px 0 0;
  font-size: 0.95rem;
}
.install-note {
  margin: 14px 0 0;
  max-width: 40rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ---------- Landing: sections ---------- */

.section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}
.section h2,
.prose h2 {
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}
.section p {
  max-width: var(--measure);
  color: var(--text-muted);
}
.section p strong,
.section dt {
  color: var(--text);
}

/* The object: the store's autocomplete dropdown for "division". */
.fanout {
  margin: 0;
  display: grid;
  gap: 28px;
  align-items: start;
}
@media (min-width: 860px) {
  .fanout {
    grid-template-columns: minmax(0, 25rem) minmax(0, 1fr);
    gap: 48px;
  }
}
.dropdown {
  margin: 0;
  padding: 10px;
  background: var(--surface-raised);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(200, 208, 222, 0.07),
    inset 0 0 0 1px var(--border),
    0 18px 40px rgba(0, 0, 0, 0.55);
}
.dropdown .field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  font-size: 1.05rem;
  color: var(--text);
}
.dropdown .field::after {
  content: "";
  width: 2px;
  height: 1.2em;
  margin-left: -8px;
  background: var(--accent-bright);
}
.dropdown svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--text-muted);
}
.dropdown ol {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}
.dropdown li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  color: var(--text);
  line-height: 1.35;
  animation: arrive 0.5s var(--ease) backwards;
}
.dropdown li:first-child {
  border-top: 0;
}
.dropdown mark {
  background: none;
  color: var(--spot);
  font-weight: 500;
}
.dropdown li:nth-child(1) { animation-delay: 0.04s; }
.dropdown li:nth-child(2) { animation-delay: 0.08s; }
.dropdown li:nth-child(3) { animation-delay: 0.12s; }
.dropdown li:nth-child(4) { animation-delay: 0.16s; }
.dropdown li:nth-child(5) { animation-delay: 0.2s; }
.dropdown li:nth-child(6) { animation-delay: 0.24s; }
.dropdown li:nth-child(7) { animation-delay: 0.28s; }
.dropdown li:nth-child(8) { animation-delay: 0.32s; }
.dropdown li:nth-child(9) { animation-delay: 0.36s; }
.dropdown li:nth-child(10) { animation-delay: 0.4s; }
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.fanout figcaption p:first-child {
  margin-top: 0;
  font-size: 1.05rem;
  color: var(--text);
}
.small-print {
  font-size: 0.875rem;
}

.answers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0 32px;
  margin: 0;
}
.answers div {
  padding: 14px 0 16px;
  border-top: 1px solid var(--border);
}
.answers dt {
  font-weight: 600;
  margin-bottom: 4px;
}
.answers dd {
  margin: 0;
  color: var(--text-muted);
}

.trust {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: var(--measure);
}
.trust li {
  position: relative;
  padding: 10px 0 10px 22px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}
.trust li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.15em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

/* ---------- Guide: rendered markdown ---------- */

.prose {
  max-width: var(--measure);
  padding: 48px 0 0;
}
.prose h1 {
  margin: 56px 0 16px;
  font-size: clamp(2rem, 1.2rem + 3.6vw, 3.1rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.prose h1:first-child {
  margin-top: 0;
}
.prose h2 {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.prose h3 {
  margin: 32px 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}
.prose h4 {
  margin: 24px 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-bright);
}
.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  scroll-margin-top: 72px;
}
.prose p,
.prose li {
  color: var(--text);
}
.prose strong {
  font-weight: 600;
}
.prose :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px var(--border);
  overflow-wrap: anywhere;
}
.prose pre {
  margin: 16px 0;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--border);
  overflow-x: auto;
  line-height: 1.5;
}
.prose blockquote {
  margin: 16px 0;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--accent);
  color: var(--text-muted);
}
.prose blockquote p,
.prose blockquote strong {
  color: inherit;
}
.prose blockquote strong {
  color: var(--text);
}

/* Tables scroll inside their own box; the page never does. */
.scroll {
  margin: 16px 0;
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--border);
}
.scroll table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.94rem;
}
.scroll th,
.scroll td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  min-width: 7.5rem;
}
.scroll th {
  background: var(--surface-raised);
  font-weight: 600;
}
.scroll tr:last-child td {
  border-bottom: 0;
}
.scroll code {
  overflow-wrap: normal !important;
}
/* On a phone the prose columns get room to read and the table scrolls instead; the first
   column (usually a tool name or a keyword) takes only what it needs, breaking only between code spans. */
.scroll td:first-child,
.scroll th:first-child {
  min-width: 0;
}
.scroll td:first-child code {
  white-space: nowrap;
}
.scroll td:not(:first-child) {
  min-width: 11rem;
}

.toc {
  margin: 24px 0 8px;
  padding: 16px 18px;
  background: var(--surface-raised);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px var(--border);
}
.toc h2 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2 15rem;
  column-gap: 28px;
}
.toc li {
  break-inside: avoid;
  padding: 3px 0;
}
.toc li.group {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.toc a {
  text-decoration: none;
}
.toc a:hover {
  text-decoration: underline;
}

/* ---------- 404 ---------- */

.notfound {
  padding: 96px 0 40px;
  max-width: 36rem;
}
.notfound p {
  color: var(--text-muted);
}

/* ---------- Motion ---------- */

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

@media (max-width: 520px) {
  .hero {
    padding-top: 44px;
  }
  .install {
    flex-direction: column;
  }
  .copy {
    align-self: flex-end;
  }
  .footer .credit {
    margin-left: 0;
  }
}
