:root {
  /* Typography */
  --font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

  /* Responsive Breakpoints */
  --breakpoint-mobile: 640px;    /* Mobile devices */
  --breakpoint-tablet: 768px;    /* Tablet devices */
  --breakpoint-desktop: 1024px;  /* Desktop devices */
  --breakpoint-wide: 1280px;     /* Wide screens */
  --breakpoint-ultrawide: 1536px; /* Ultrawide screens */
}

html, body {
  -webkit-text-size-adjust: none;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  line-height: 1.4;
  overflow: initial;
  text-size-adjust: none;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  margin: 0;
  font-family: inherit;
}

/* Links */
:where(a:not([class]):not(:has(img))) {
  color: var(--link-color, var(--color-link));
  text-decoration: none;

  @media (any-hover: hover) {
    &:where(:not(:active):hover) {
      --hover-filter: brightness(1.3);
      filter: var(--hover-filter);
    }
  }
}
[data-link-url-value] {
  cursor: pointer;
}

:where(button, input, textarea, summary, .input, .btn) {
  --outline-size: min(0.2em, 2px);

  border: none;
  background-color: transparent;
  font: inherit;
  line-height: inherit;
  text-decoration: none;
  touch-action: manipulation;
  transition: box-shadow 150ms ease, outline-offset 150ms ease, background-color 150ms ease, opacity 150ms ease, filter 150ms ease;

  /* Hover */
  @media (any-hover: hover) {
    &:where(:not(:active):hover) {
      filter: var(--hover-filter);
    }
  }

  /* Keyboard navigation */
  &:where(:not(:active)):focus-visible {
    outline-width: var(--outline-size);
    outline-color: var(--outline-color, var(--color-link));
    outline-offset: var(--outline-offset, calc(var(--outline-size) * 2));
  }

  /* Pressing */
  &:focus:not(:focus-visible) {
    --outline-offset: 0;
  }

  /* Disabled */
  &:where([disabled]):not(:hover):not(:active) {
    cursor: not-allowed;
    filter: brightness(0.75);
  }
}

/* Turbo */
turbo-frame,
turbo-cable-stream-source {
  display: contents;
}

/* For settings */
fieldset {
  border: 2px solid var(--fieldset-border-color, var(--color-border));
  border-block-end: 0;
  border-inline: 0;
  display: flex;
  flex-direction: column;
  max-inline-size: 50ch;
  padding: var(--block-space) 0;

  &.border {
    border-color: var(--color-border-darker);
    border-style: solid;
    border-width: 1px;
  }
}

legend {
  align-items: center;
  display: flex;
  justify-content: center;
  margin-inline: auto;
  text-align: center;
}


/* Misc */
menu {
  outline: 0;
}

code {
  background: var(--color-bg);
  border: 1px solid var(--color-border-darker);
  padding: 0.2em 0.4em;
  border-radius: 0.3em;
  font-weight: 500;
}

pre {
  background-color: var(--color-bg);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monaco, monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}
