/* src/styles.css */
:root {
  color-scheme: dark;
  font-family:
    "Jetbrains Mono",
    "Source Code Pro",
    Monaco,
    Menlo,
    Consolas,
    "Courier New",
    Courier,
    "Hiragino Sans GB",
    "Microsoft YaHei",
    monospace;
  background: #060608;
  color: white;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --text: white;
  --comment: #5f615d;
  --bracket: #1d671d;
  --tag: #57ca3c;
  --attr: #c8ec83;
  --value: #f5a076;
  --line-accent: white;
  --line-gutter: #4a4c49;
  --line-hover: rgb(255 255 255 / 7%);
}
* {
  box-sizing: border-box;
}
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background-color: #060608;
  background-image:
    linear-gradient(
      45deg,
      #131319 0%,
      black 100%);
  background-attachment: fixed;
}
a {
  color: inherit;
}
#app {
  min-height: 100vh;
}
@media (scripting: enabled) {
  body[data-cloak] {
    background: #060608;
  }
  body[data-cloak] > * {
    display: none;
  }
}
.source-page {
  min-height: 100vh;
  overflow: auto;
  padding: clamp(2rem, 5vw, 5rem);
}
.source-code {
  width: max-content;
  min-width: min(100%, 120ch);
  margin: 0;
  color: var(--text);
  font:
    400 14px / 1.4 "Jetbrains Mono",
    "Source Code Pro",
    Monaco,
    Menlo,
    Consolas,
    "Courier New",
    Courier,
    "Hiragino Sans GB",
    "Microsoft YaHei",
    monospace;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre;
}
.code-line {
  display: inline-grid;
  grid-template-columns: 3ch max-content;
  column-gap: 2ch;
  align-items: baseline;
  max-width: 100%;
  overflow-wrap: inherit;
  padding: 0.04rem 0.55rem 0.04rem 0;
  border-radius: 4px;
  transition: background-color 160ms ease;
  white-space: inherit;
}
.line-number {
  color: var(--line-gutter);
  text-align: right;
  user-select: none;
}
.line-source {
  min-width: 0;
  white-space: inherit;
}
.code-line:hover,
.code-line:focus-within {
  background-color: var(--line-hover);
}
@media (prefers-reduced-motion: no-preference) {
  .code-line {
    animation: stream-line 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--line-index) * 42ms);
    clip-path: inset(0 100% 0 0);
    opacity: 0;
    transform: translateY(0.35rem);
    will-change:
      clip-path,
      opacity,
      transform;
  }
  .code-link::before {
    animation: scan-link 760ms cubic-bezier(0.22, 1, 0.36, 1);
    animation-delay: calc((var(--line-index) * 42ms) + 50ms);
  }
}
.code-link {
  display: inline-block;
  position: relative;
  isolation: isolate;
  border-radius: 3px;
  color: white;
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition:
    color 300ms ease,
    background-color 160ms ease,
    transform 300ms ease;
}
.code-link::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  content: "";
  opacity: 0;
  pointer-events: none;
}
.code-link:hover,
.code-link:focus-visible {
  outline: none;
  background-color: white;
  color: black;
  transform: scale(1.05);
}
.syntax-comment {
  color: var(--comment);
}
.syntax-bracket {
  color: var(--bracket);
}
.syntax-tag {
  color: var(--tag);
}
.syntax-attr {
  color: var(--attr);
}
.syntax-value {
  color: var(--value);
}
@keyframes stream-line {
  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes scan-link {
  0%, 35% {
    background-color: white;
    box-shadow: 0 0 0 0 transparent;
    opacity: 0;
  }
  55% {
    background-color: white;
    box-shadow: 0 0 0 1px white, 0 0 1.4rem white;
    opacity: 1;
  }
  100% {
    background-color: white;
    box-shadow: 0 0 0 0 transparent;
    opacity: 0;
  }
}
@media (max-width: 640px) {
  .source-page {
    padding: 1.25rem 1rem;
  }
  .source-code {
    width: 100%;
    min-width: 0;
    font-size: 12px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
  }
  .code-line {
    grid-template-columns: 2.5ch minmax(0, 1fr);
    width: 100%;
    padding-right: 0.35rem;
  }
  .code-link {
    display: inline;
    border-radius: 2px;
  }
  .source-href {
    display: none;
  }
  .code-link:hover,
  .code-link:focus-visible {
    transform: none;
  }
}
