/* stylelint-disable color-named */
/* stylelint-disable property-no-vendor-prefix */

@property --accentColor {
  syntax: "<color>";
  inherits: true;
  initial-value: magenta;
}

@property --outlineColor {
  syntax: "<color>";
  inherits: true;
  initial-value: magenta;
}

@property --caretColor {
  syntax: "<color>";
  inherits: true;
  initial-value: magenta;
}

@property --highlightedTextColor {
  syntax: "<color>";
  inherits: true;
  initial-value: currentcolor;
}

@property --highlightedTextBgColor {
  syntax: "<color>";
  inherits: true;
  initial-value: magenta;
}

:root {
  --highlightedTextBgColor: var(--accentColor);
  --outlineColor: var(--accentColor);
  --caretColor: var(--accentColor);
}

@supports (view-transition-name: custom-ident) {
  @view-transition {
    navigation: auto;
  }
}

*,
::after,
::backdrop,
::before,
::checkmark,
/* stylelint-disable-next-line selector-pseudo-element-no-unknown */
::column,
::cue,
::cue(*),
::details-content,
::file-selector-button,
::first-letter,
::picker(select),
::picker-icon,
::placeholder,
/* stylelint-disable-next-line selector-pseudo-element-no-unknown */
::scroll-button(*),
::scroll-marker,
::scroll-marker-group,
::slotted(*),
::view-transition,
::view-transition-group(*),
::view-transition-image-pair(*),
::view-transition-new(*),
::view-transition-old(*) {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow-wrap: break-word;
  border: none;
  @supports (transition-behavior: allow-discrete) {
    /* used to transition from display: none; to display: block; */
    transition-behavior: allow-discrete;
  }
  @supports (interpolate-size: allow-keywords) {
    /* used to transition from height: 0; to height: auto; without using the calc-size() function */
    interpolate-size: allow-keywords;
  }
}

* {
  &:focus-visible {
    outline: 2px solid var(--outlineColor);
    outline-offset: 2px;
  }

  &::selection,
  &::target-text {
    color: var(--highlightedTextColor);
    background-color: var(--highlightedTextBgColor);
    scroll-margin: 1.5rlh;
  }

  &[contenteditable] {
    caret-color: var(--caretColor);
  }
}
html {
  color-scheme: light dark;
  font-size: 100%;
  line-height: 1.5;
  -moz-tab-size: 2;
  tab-size: 2;
  accent-color: var(--accentColor);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;

  @media (prefers-reduced-motion: no-preference) {
    scroll-behavior: smooth;
  }
}
hr {
  height: 0;
  color: inherit;
}
abbr[title] {
  text-decoration: underline dotted;
}
b,
strong,
dt {
  font-weight: bold;
}
ul,
ol,
dl {
  list-style-position: inside;
  ul,
  ol,
  dl {
    padding-inline-start: 2ch;
  }
}
code,
kbd,
pre,
samp {
  font-family: Hack, ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1em;
}
small {
  font-size: 80%;
}
sub,
sup {
  vertical-align: baseline;
  position: relative;
  font-size: 75%;
  line-height: 0;
}
sub {
  bottom: -0.25em;
}
sup {
  top: -0.5em;
}
table {
  text-indent: 0;
  border-color: inherit;
}
[type="button"],
[type="reset"],
[type="submit"],
[type="file"]::file-selector-button,
button,
input,
textarea,
select,
optgroup,
option {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
  @supports (field-sizing: content) {
    field-sizing: content;
  }
}
input,
textarea {
  min-width: 0;
  caret-color: var(--caretColor);
}
[type="text"],
[type="search"],
textarea,
*[contenteditable] {
  @supports selector(*::spelling-error) {
    &::spelling-error {
      text-decoration: from-font red wavy underline;
    }
  }
  @supports selector(*::grammar-error) {
    &::grammar-error {
      text-decoration: from-font blue wavy underline;
    }
  }
}
button,
select {
  text-transform: none;
}
[type="button"],
[type="reset"],
[type="submit"],
[type="file"]::-webkit-file-upload-button,
button {
  -webkit-appearance: button;
  color: Canvas;
  border: 1px solid transparent; /* windows high contrast accessibility thing */
  background: CanvasText;
  @supports (text-box: trim-both cap alphabetic) {
    text-box: trim-both cap alphabetic;
  }
}
[aria-disabled="true" i],
[disabled] {
  cursor: not-allowed;
}
::-moz-focus-inner {
  padding: 0;
  border-style: none;
}
:-moz-focusring {
  outline: 1px dotted ButtonText;
}
:-moz-ui-invalid {
  box-shadow: none;
}
legend {
  padding: 0;
}
progress {
  vertical-align: baseline;
}
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}
[type="search"] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}
::-webkit-search-decoration {
  -webkit-appearance: none;
}
summary {
  display: list-item;
}
[popover] {
  inset: auto;
}
dialog {
  max-width: 100%;
  max-height: 100%;
}
img,
picture,
video,
canvas,
svg {
  width: auto;
  height: auto;
  user-select: none;
}
