/* JINYAO LIMITED — jyao.uk
   System language follows Apple's Human Interface Guidelines (2026):
   content layer in standard materials, one Liquid Glass layer for navigation. */

:root {
  color-scheme: light dark;

  --bg-grouped: #f2f2f7;
  --bg: #ffffff;
  --bg-elevated: #ffffff;
  --label: #1d1d1f;
  --label-2: #6e6e73;
  --separator: rgba(60, 60, 67, 0.22);
  --fill: rgba(120, 120, 128, 0.14);
  --link: #0066cc;
  --tint: #007aff;
  --selection: rgba(0, 122, 255, 0.22);
  --bg-inset: #f2f2f7;

  --glass-bg: rgba(255, 255, 255, 0.58);
  --glass-bg-rest: rgba(255, 255, 255, 0.34);
  --glass-rim: rgba(255, 255, 255, 0.85);
  --glass-edge: rgba(0, 0, 0, 0.1);
  --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);

  --font: system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --column: 680px;
  --radius-group: 22px;
  --radius-row-inset: 20px;
  --gutter: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-grouped: #000000;
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --label: #f5f5f7;
    --label-2: #a1a1a6;
    --separator: rgba(84, 84, 88, 0.6);
    --fill: rgba(118, 118, 128, 0.24);
    --link: #2997ff;
    --tint: #0a84ff;
    --selection: rgba(10, 132, 255, 0.34);
    --bg-inset: #1c1c1e;

    --glass-bg: rgba(44, 44, 46, 0.62);
    --glass-bg-rest: rgba(44, 44, 46, 0.4);
    --glass-rim: rgba(255, 255, 255, 0.16);
    --glass-edge: rgba(0, 0, 0, 0.5);
    --glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 96px;
  accent-color: var(--tint);
}

body {
  margin: 0;
  background: var(--bg-grouped);
  color: var(--label);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.47;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

body.document {
  background: var(--bg);
}

::selection {
  background: var(--selection);
}

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

a:hover {
  text-decoration: underline;
}

.prose a,
.lede a,
.footnote a,
.site-footer p a {
  text-decoration: underline;
}

.dd-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dd-link:hover {
  text-decoration: none;
}

.dd-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.dd-link:focus-visible {
  outline: none;
}

.row:has(.dd-link) {
  transition: background-color 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.row:has(.dd-link:hover) {
  background: var(--fill);
}

.row:has(.dd-link:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent);
  outline-offset: -3px;
}

.dd-link .chev,
.dd-link .ext {
  color: currentColor;
  opacity: 0.6;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent);
  outline-offset: 2px;
  border-radius: 8px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--label);
  z-index: 30;
}

.skip:focus {
  top: 12px;
}

/* ---------- Liquid Glass navigation layer ---------- */

.edge {
  position: fixed;
  inset: 0 0 auto 0;
  height: 84px;
  z-index: 9;
  pointer-events: none;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent);
  mask-image: linear-gradient(to bottom, #000 35%, transparent);
}

.nav {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 10;
  width: min(var(--column), calc(100% - 24px));
  transform: translateX(-50%);
  container: nav / inline-size;
  padding: 6px;
  border-radius: 999px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-rim), inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  padding-left: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--label);
  white-space: nowrap;
}

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

.nav ul {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav li a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--label);
  transition: background-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav li a:hover {
  text-decoration: none;
  background: var(--fill);
}

.nav li a[aria-current="page"] {
  background: var(--fill);
  font-weight: 600;
}

/* Glass settles from clear to regular as content scrolls beneath it. */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .nav {
      animation: glass-settle linear both;
      animation-timeline: scroll(root);
      animation-range: 0 140px;
    }

    @keyframes glass-settle {
      from {
        background-color: var(--glass-bg-rest);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04), inset 0 1px 0 var(--glass-rim);
      }
      to {
        background-color: var(--glass-bg);
        box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-rim);
      }
    }
  }
}

@media (prefers-reduced-transparency: reduce) {
  .nav {
    background: var(--bg-elevated);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    animation: none;
  }

  .edge {
    display: none;
  }
}

@media (prefers-contrast: more) {
  .nav {
    background: var(--bg-elevated);
    border-color: var(--label);
  }

  :root {
    --separator: var(--label-2);
  }
}

/* ---------- Content layer ---------- */

main {
  width: min(var(--column), calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  padding: 120px 0 40px;
}

.large-title {
  margin: 0;
  font-size: 2.75rem;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lede {
  margin: 14px 0 0;
  max-width: 36em;
  font-size: 1.3125rem;
  line-height: 1.4;
  color: var(--label-2);
  text-wrap: pretty;
}

.lede strong {
  color: var(--label);
  font-weight: 600;
}

.meta {
  margin: 10px 0 0;
  font-size: 0.9375rem;
  color: var(--label-2);
}

/* Inset grouped list */

.group {
  margin-top: 40px;
}

.group h2 {
  margin: 0 0 10px var(--radius-row-inset);
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--bg-elevated);
  border-radius: var(--radius-group);
  overflow: hidden;
}

.row {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  min-height: 52px;
  padding: 14px var(--radius-row-inset);
  margin: 0;
}

.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--radius-row-inset);
  right: 0;
  border-top: 0.5px solid var(--separator);
}

@media (max-resolution: 1dppx) {
  .row + .row::before {
    border-top-width: 1px;
  }
}

.row dt,
.row .row-label {
  flex: 0 0 auto;
  color: var(--label);
}

.row dd {
  margin: 0;
  color: var(--label-2);
  text-align: right;
  text-wrap: pretty;
}

.row-note {
  display: block;
  color: var(--label-2);
}

a.row,
.row a.row-link {
  color: var(--label);
}

a.row {
  align-items: center;
  gap: 10px;
  transition: background-color 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

a.row:hover {
  text-decoration: none;
  background: var(--fill);
}

a.row:active {
  background: color-mix(in srgb, var(--fill) 100%, var(--label) 6%);
}

a.row .value {
  margin-left: auto;
  color: var(--link);
}

a.row .value.quiet {
  color: var(--label-2);
}

.chev {
  flex: 0 0 auto;
  width: 9px;
  height: 15px;
  color: var(--label-2);
  opacity: 0.7;
}

.ext {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  color: var(--label-2);
}

.footnote {
  margin: 10px var(--radius-row-inset) 0;
  font-size: 0.8125rem;
  line-height: 1.38;
  color: var(--label-2);
}

/* Single paragraph row */
.row.text {
  display: block;
  color: var(--label);
}

/* ---------- Document pages ---------- */

.doc {
  padding-top: 120px;
}

.doc .contents {
  margin-top: 32px;
}

.doc .contents .list {
  background: var(--bg-inset);
}

.prose {
  margin-top: 8px;
}

.prose h2 {
  margin: 48px 0 12px;
  font-size: 1.375rem;
  line-height: 1.27;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.prose h3 {
  margin: 28px 0 8px;
  font-size: 1.0625rem;
  font-weight: 600;
}

.prose p,
.prose li {
  max-width: 68ch;
}

.prose p {
  margin: 0 0 16px;
}

.prose ul {
  margin: 0 0 16px;
  padding-left: 1.25em;
}

.prose li {
  margin-bottom: 8px;
}

.prose li::marker {
  color: var(--label-2);
}

/* ---------- Footer ---------- */

.site-footer {
  width: min(var(--column), calc(100% - 2 * var(--gutter)));
  margin: 24px auto 0;
  padding: 20px 0 48px;
  border-top: 0.5px solid var(--separator);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--label-2);
}

.site-footer p {
  margin: 0 0 8px;
}

.site-footer nav a {
  color: var(--label);
}

.site-footer nav span {
  margin: 0 8px;
  color: var(--separator);
}

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  :root {
    --gutter: 16px;
    --radius-row-inset: 16px;
  }

  .wordmark {
    padding-left: 8px;
  }

  .wordmark .full {
    display: none;
  }

  .nav li a {
    padding: 8px 8px;
    font-size: 0.875rem;
  }

  main,
  .doc {
    padding-top: 96px;
  }

  .large-title {
    font-size: 2.125rem;
    line-height: 1.2;
  }

  .lede {
    font-size: 1.1875rem;
  }

  .row {
    gap: 16px;
  }

  .row.stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .row.stack dd {
    text-align: left;
  }
}

/* Hide the wordmark only when the capsule is too narrow for it at the current text size. */
@container nav (max-width: 20.4em) {
  .wordmark {
    display: none;
  }

  .nav-inner {
    justify-content: center;
  }
}

@media (max-width: 360px) {
  .nav li a {
    padding: 8px 7px;
    font-size: 0.8125rem;
  }
}
